From 6aa8ffe72450abfef45593acbb27adb4ca327e34 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 24 Sep 2024 07:22:08 +0000 Subject: [PATCH 01/14] sync with cpython e9b00cc7 --- c-api/code.po | 7 +- c-api/exceptions.po | 351 +- c-api/long.po | 48 +- c-api/memory.po | 411 +-- c-api/module.po | 108 +- c-api/monitoring.po | 119 +- c-api/refcounting.po | 27 +- c-api/time.po | 56 +- deprecations/c-api-pending-removal-in-3.14.po | 133 +- deprecations/c-api-pending-removal-in-3.15.po | 71 +- .../c-api-pending-removal-in-future.po | 107 +- deprecations/index.po | 634 ++-- deprecations/pending-removal-in-3.15.po | 219 +- deprecations/pending-removal-in-3.16.po | 89 +- faq/design.po | 14 +- faq/extending.po | 41 +- faq/general.po | 9 +- glossary.po | 7 +- howto/argparse.po | 5 +- howto/descriptor.po | 333 +- howto/free-threading-extensions.po | 50 +- library/argparse.po | 12 +- library/ast.po | 186 +- library/ctypes.po | 6 +- library/curses.po | 14 +- library/dbm.po | 212 +- library/ensurepip.po | 27 +- library/functools.po | 4 +- library/grp.po | 5 +- library/hashlib.po | 6 +- library/http.cookiejar.po | 4 +- library/importlib.po | 59 +- library/inspect.po | 273 +- library/intro.po | 101 +- library/json.po | 10 +- library/multiprocessing.po | 27 +- library/os.po | 83 +- library/re.po | 601 ++-- library/readline.po | 14 +- library/socket.po | 14 +- library/sqlite3.po | 731 ++-- library/ssl.po | 33 +- library/subprocess.po | 27 +- library/sys.monitoring.po | 4 +- library/time.po | 10 +- library/tkinter.po | 6 +- library/typing.po | 6 +- library/venv.po | 27 +- library/webbrowser.po | 23 +- library/wsgiref.po | 20 +- library/xml.etree.elementtree.po | 4 +- library/xmlrpc.client.po | 5 +- reference/introduction.po | 6 +- sphinx.po | 82 +- tutorial/errors.po | 231 +- using/android.po | 144 + using/ios.po | 4 +- using/mac.po | 4 +- using/windows.po | 7 +- whatsnew/2.4.po | 28 +- whatsnew/2.7.po | 79 +- whatsnew/3.12.po | 646 ++-- whatsnew/3.13.po | 3054 +++++++++-------- whatsnew/3.2.po | 6 +- whatsnew/3.4.po | 933 ++--- whatsnew/3.7.po | 8 +- whatsnew/3.8.po | 4 +- 67 files changed, 5988 insertions(+), 4641 deletions(-) create mode 100644 using/android.po diff --git a/c-api/code.po b/c-api/code.po index c653263f0a..79fec6db3e 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -128,9 +128,8 @@ msgstr "" #: ../../c-api/code.rst:99 msgid "" -"For efficiently iterating over the line numbers in a code object, use `the " -"API described in PEP 626 `_." +"For efficiently iterating over the line numbers in a code object, use :pep:" +"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" #: ../../c-api/code.rst:104 diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 7709f0093c..8f5b81bb6c 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -1038,451 +1038,461 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1160 -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1163 +#: ../../c-api/exceptions.rst:1208 msgid "C Name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1208 msgid "Python Name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1027 ../../c-api/exceptions.rst:1160 -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1028 ../../c-api/exceptions.rst:1163 +#: ../../c-api/exceptions.rst:1208 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1030 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1030 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1029 ../../c-api/exceptions.rst:1031 -#: ../../c-api/exceptions.rst:1033 ../../c-api/exceptions.rst:1079 -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1030 ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1034 ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1092 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1032 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1032 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1034 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1034 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1036 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1036 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1038 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1038 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1040 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1040 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1042 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1042 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1044 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1044 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1046 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1046 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1048 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1048 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1050 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1050 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1052 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1052 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1054 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1054 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1056 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1056 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1058 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1058 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1060 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1060 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1062 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1062 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1064 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1064 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1066 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1066 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1068 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1068 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1070 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1070 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1072 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1072 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1074 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1076 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1078 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1080 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1082 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1084 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1086 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1088 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1090 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1090 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1092 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1092 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1094 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1094 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1096 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1096 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1098 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1098 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1100 +#, fuzzy +msgid ":c:data:`PyExc_PythonFinalizationError`" +msgstr ":c:data:`PyExc_ConnectionError`" + +#: ../../c-api/exceptions.rst:1100 +#, fuzzy +msgid ":exc:`PythonFinalizationError`" +msgstr ":exc:`ConnectionError`" + +#: ../../c-api/exceptions.rst:1102 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1102 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1104 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1104 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1106 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1106 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1108 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1108 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1110 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1110 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1112 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1112 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1114 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1114 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1116 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1118 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1118 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1120 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:1120 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1122 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1122 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1124 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1124 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1126 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1126 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1128 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:1128 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1130 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:1130 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1132 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1132 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1134 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1134 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1136 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1139 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1502,57 +1512,57 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1146 +#: ../../c-api/exceptions.rst:1149 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1152 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1155 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1162 +#: ../../c-api/exceptions.rst:1165 msgid ":c:data:`!PyExc_EnvironmentError`" msgstr ":c:data:`!PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1164 +#: ../../c-api/exceptions.rst:1167 msgid ":c:data:`!PyExc_IOError`" msgstr ":c:data:`!PyExc_IOError`" -#: ../../c-api/exceptions.rst:1166 +#: ../../c-api/exceptions.rst:1169 msgid ":c:data:`!PyExc_WindowsError`" msgstr ":c:data:`!PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1166 +#: ../../c-api/exceptions.rst:1169 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1169 +#: ../../c-api/exceptions.rst:1172 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1172 ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1175 ../../c-api/exceptions.rst:1236 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1178 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1181 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1184 +#: ../../c-api/exceptions.rst:1187 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1186 +#: ../../c-api/exceptions.rst:1189 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1560,103 +1570,103 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1210 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1210 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1210 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1209 +#: ../../c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1209 +#: ../../c-api/exceptions.rst:1212 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1211 +#: ../../c-api/exceptions.rst:1214 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1211 +#: ../../c-api/exceptions.rst:1214 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1213 +#: ../../c-api/exceptions.rst:1216 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1213 +#: ../../c-api/exceptions.rst:1216 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1215 +#: ../../c-api/exceptions.rst:1218 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1215 +#: ../../c-api/exceptions.rst:1218 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1217 +#: ../../c-api/exceptions.rst:1220 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1217 +#: ../../c-api/exceptions.rst:1220 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1219 +#: ../../c-api/exceptions.rst:1222 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1219 +#: ../../c-api/exceptions.rst:1222 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1221 +#: ../../c-api/exceptions.rst:1224 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1221 +#: ../../c-api/exceptions.rst:1224 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1223 +#: ../../c-api/exceptions.rst:1226 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1223 +#: ../../c-api/exceptions.rst:1226 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1228 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1225 +#: ../../c-api/exceptions.rst:1228 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1230 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:1230 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1230 +#: ../../c-api/exceptions.rst:1233 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1236 +#: ../../c-api/exceptions.rst:1239 msgid "This is a base class for other standard warning categories." msgstr "" @@ -1823,6 +1833,11 @@ msgstr "PyExc_PermissionError(C 變數)" msgid "PyExc_ProcessLookupError (C var)" msgstr "PyExc_ProcessLookupError(C 變數)" +#: ../../c-api/exceptions.rst:971 +#, fuzzy +msgid "PyExc_PythonFinalizationError (C var)" +msgstr "PyExc_ConnectionError(C 變數)" + #: ../../c-api/exceptions.rst:971 msgid "PyExc_RecursionError (C var)" msgstr "PyExc_RecursionError(C 變數)" @@ -1895,58 +1910,58 @@ msgstr "PyExc_ValueError(C 變數)" msgid "PyExc_ZeroDivisionError (C var)" msgstr "PyExc_ZeroDivisionError(C 變數)" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1157 msgid "PyExc_EnvironmentError (C var)" msgstr "PyExc_EnvironmentError(C 變數)" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1157 msgid "PyExc_IOError (C var)" msgstr "PyExc_IOError(C 變數)" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1157 msgid "PyExc_WindowsError (C var)" msgstr "PyExc_WindowsError(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_Warning (C var)" msgstr "PyExc_Warning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_BytesWarning (C var)" msgstr "PyExc_BytesWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_DeprecationWarning (C var)" msgstr "PyExc_DeprecationWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_FutureWarning (C var)" msgstr "PyExc_FutureWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_ImportWarning (C var)" msgstr "PyExc_ImportWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_PendingDeprecationWarning (C var)" msgstr "PyExc_PendingDeprecationWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_ResourceWarning (C var)" msgstr "PyExc_ResourceWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_RuntimeWarning (C var)" msgstr "PyExc_RuntimeWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_SyntaxWarning (C var)" msgstr "PyExc_SyntaxWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_UnicodeWarning (C var)" msgstr "PyExc_UnicodeWarning(C 變數)" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1194 msgid "PyExc_UserWarning (C var)" msgstr "PyExc_UserWarning(C 變數)" diff --git a/c-api/long.po b/c-api/long.po index 7abcaaf2c1..2393cf7855 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -495,56 +495,56 @@ msgid "" "Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" -#: ../../c-api/long.rst:456 +#: ../../c-api/long.rst:458 msgid "Flag" msgstr "" -#: ../../c-api/long.rst:456 +#: ../../c-api/long.rst:458 msgid "Value" msgstr "" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:460 msgid "``-1``" msgstr "" -#: ../../c-api/long.rst:459 +#: ../../c-api/long.rst:461 msgid "``0``" msgstr "" -#: ../../c-api/long.rst:460 +#: ../../c-api/long.rst:462 msgid "``1``" msgstr "" -#: ../../c-api/long.rst:461 +#: ../../c-api/long.rst:463 msgid "``3``" msgstr "" -#: ../../c-api/long.rst:462 +#: ../../c-api/long.rst:464 msgid "``4``" msgstr "" -#: ../../c-api/long.rst:463 +#: ../../c-api/long.rst:465 msgid "``8``" msgstr "" -#: ../../c-api/long.rst:464 +#: ../../c-api/long.rst:466 msgid "``16``" msgstr "" -#: ../../c-api/long.rst:467 +#: ../../c-api/long.rst:469 msgid "" "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " "flags. Passing ``2`` is reserved." msgstr "" -#: ../../c-api/long.rst:470 +#: ../../c-api/long.rst:472 msgid "" "By default, sufficient buffer will be requested to include a sign bit. For " "example, when converting 128 with *n_bytes=1*, the function will return 2 " "(or more) in order to store a zero sign bit." msgstr "" -#: ../../c-api/long.rst:474 +#: ../../c-api/long.rst:476 msgid "" "If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " "be omitted from size calculations. This allows, for example, 128 to fit in a " @@ -554,7 +554,7 @@ msgid "" "requested." msgstr "" -#: ../../c-api/long.rst:481 +#: ../../c-api/long.rst:483 msgid "" "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " "set if *pylong* is negative. Without this flag, negative values will be " @@ -562,7 +562,7 @@ msgid "" "of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" -#: ../../c-api/long.rst:486 +#: ../../c-api/long.rst:488 msgid "" "If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " "passed, its :meth:`~object.__index__` method will be called first. This may " @@ -572,7 +572,7 @@ msgid "" "`TypeError`." msgstr "" -#: ../../c-api/long.rst:495 +#: ../../c-api/long.rst:497 msgid "" "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " "*REJECT_NEGATIVE*), multiple Python integers can map to a single value " @@ -580,22 +580,22 @@ msgid "" "buffer and set all its bits. This matches typical C cast behavior." msgstr "" -#: ../../c-api/long.rst:506 +#: ../../c-api/long.rst:508 msgid "" "On success, return a read only :term:`named tuple`, that holds information " "about Python's internal representation of integers. See :data:`sys.int_info` " "for description of individual fields." msgstr "" -#: ../../c-api/long.rst:510 +#: ../../c-api/long.rst:512 msgid "On failure, return ``NULL`` with an exception set." msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。" -#: ../../c-api/long.rst:517 +#: ../../c-api/long.rst:519 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:519 +#: ../../c-api/long.rst:521 msgid "" "This function makes it possible for performance-critical code to implement a " "“fast path” for small integers. For compact values use :c:func:" @@ -603,23 +603,23 @@ msgid "" "`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." msgstr "" -#: ../../c-api/long.rst:525 +#: ../../c-api/long.rst:527 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:527 +#: ../../c-api/long.rst:529 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:532 +#: ../../c-api/long.rst:534 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:535 +#: ../../c-api/long.rst:537 msgid "Otherwise, the return value is undefined." msgstr "" diff --git a/c-api/memory.po b/c-api/memory.po index 489366188e..e3b9669a9d 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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,59 +135,70 @@ msgid "" "details on how every domain allocates memory or what internal functions each " "domain calls is considered an implementation detail, but for debugging " "purposes a simplified table can be found at :ref:`here `. There is no hard requirement to use the memory returned by the " -"allocation functions belonging to a given domain for only the purposes " -"hinted by that domain (although this is the recommended practice). For " -"example, one could use the memory returned by :c:func:`PyMem_RawMalloc` for " -"allocating Python objects or the memory returned by :c:func:" -"`PyObject_Malloc` for allocating memory for buffers." +"allocators>`. The APIs used to allocate and free a block of memory must be " +"from the same domain. For example, :c:func:`PyMem_Free` must be used to free " +"memory allocated using :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:112 +#: ../../c-api/memory.rst:109 msgid "The three allocation domains are:" msgstr "" -#: ../../c-api/memory.rst:114 +#: ../../c-api/memory.rst:111 msgid "" "Raw domain: intended for allocating memory for general-purpose memory " "buffers where the allocation *must* go to the system allocator or where the " "allocator can operate without the :term:`GIL`. The memory is requested " -"directly to the system." +"directly from the system. See :ref:`Raw Memory Interface `." msgstr "" -#: ../../c-api/memory.rst:119 +#: ../../c-api/memory.rst:116 msgid "" "\"Mem\" domain: intended for allocating memory for Python buffers and " "general-purpose memory buffers where the allocation must be performed with " -"the :term:`GIL` held. The memory is taken from the Python private heap." +"the :term:`GIL` held. The memory is taken from the Python private heap. See :" +"ref:`Memory Interface `." msgstr "" -#: ../../c-api/memory.rst:123 +#: ../../c-api/memory.rst:121 msgid "" -"Object domain: intended for allocating memory belonging to Python objects. " -"The memory is taken from the Python private heap." +"Object domain: intended for allocating memory for Python objects. The memory " +"is taken from the Python private heap. See :ref:`Object allocators " +"`." msgstr "" #: ../../c-api/memory.rst:126 msgid "" -"When freeing memory previously allocated by the allocating functions " -"belonging to a given domain,the matching specific deallocating functions " -"must be used. For example, :c:func:`PyMem_Free` must be used to free memory " -"allocated using :c:func:`PyMem_Malloc`." +"The :term:`free-threaded ` build requires that only Python " +"objects are allocated using the \"object\" domain and that all Python " +"objects are allocated using that domain. This differs from the prior Python " +"versions, where this was only a best practice and not a hard requirement." msgstr "" -#: ../../c-api/memory.rst:131 -msgid "Raw Memory Interface" +#: ../../c-api/memory.rst:130 +msgid "" +"For example, buffers (non-Python objects) should be allocated using :c:func:" +"`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but not :c:" +"func:`PyObject_Malloc`." msgstr "" #: ../../c-api/memory.rst:133 +msgid "See :ref:`Memory Allocation APIs `." +msgstr "" + +#: ../../c-api/memory.rst:139 +msgid "Raw Memory Interface" +msgstr "" + +#: ../../c-api/memory.rst:141 msgid "" "The following function sets are wrappers to the system allocator. These " "functions are thread-safe, the :term:`GIL ` does " "not need to be held." msgstr "" -#: ../../c-api/memory.rst:137 +#: ../../c-api/memory.rst:145 msgid "" "The :ref:`default raw memory allocator ` uses the " "following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " @@ -195,63 +206,63 @@ msgid "" "requesting zero bytes." msgstr "" -#: ../../c-api/memory.rst:146 ../../c-api/memory.rst:217 -#: ../../c-api/memory.rst:325 +#: ../../c-api/memory.rst:154 ../../c-api/memory.rst:225 +#: ../../c-api/memory.rst:335 msgid "" "Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" -#: ../../c-api/memory.rst:149 +#: ../../c-api/memory.rst:157 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:156 ../../c-api/memory.rst:227 -#: ../../c-api/memory.rst:335 +#: ../../c-api/memory.rst:164 ../../c-api/memory.rst:235 +#: ../../c-api/memory.rst:345 msgid "" "Allocates *nelem* elements each whose size in bytes is *elsize* and returns " "a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " "the request fails. The memory is initialized to zeros." msgstr "" -#: ../../c-api/memory.rst:160 +#: ../../c-api/memory.rst:168 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:169 ../../c-api/memory.rst:240 -#: ../../c-api/memory.rst:348 +#: ../../c-api/memory.rst:177 ../../c-api/memory.rst:248 +#: ../../c-api/memory.rst:358 msgid "" "Resizes the memory block pointed to by *p* to *n* bytes. The contents will " "be unchanged to the minimum of the old and the new sizes." msgstr "" -#: ../../c-api/memory.rst:172 +#: ../../c-api/memory.rst:180 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:176 +#: ../../c-api/memory.rst:184 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:" "`PyMem_RawCalloc`." msgstr "" -#: ../../c-api/memory.rst:180 +#: ../../c-api/memory.rst:188 msgid "" "If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:186 +#: ../../c-api/memory.rst:194 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:" @@ -259,73 +270,73 @@ msgid "" "called before, undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:191 ../../c-api/memory.rst:261 -#: ../../c-api/memory.rst:369 +#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:269 +#: ../../c-api/memory.rst:379 msgid "If *p* is ``NULL``, no operation is performed." msgstr "" -#: ../../c-api/memory.rst:197 +#: ../../c-api/memory.rst:205 msgid "Memory Interface" msgstr "記憶體介面" -#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:305 +#: ../../c-api/memory.rst:207 ../../c-api/memory.rst:315 msgid "" "The following function sets, modeled after the ANSI C standard, but " "specifying behavior when requesting zero bytes, are available for allocating " "and releasing memory from the Python heap." msgstr "" -#: ../../c-api/memory.rst:203 +#: ../../c-api/memory.rst:211 msgid "" "The :ref:`default memory allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:208 ../../c-api/memory.rst:320 +#: ../../c-api/memory.rst:216 ../../c-api/memory.rst:330 msgid "" "The :term:`GIL ` must be held when using these " "functions." msgstr "" -#: ../../c-api/memory.rst:213 +#: ../../c-api/memory.rst:221 msgid "" "The default allocator is now pymalloc instead of system :c:func:`malloc`." msgstr "" -#: ../../c-api/memory.rst:220 +#: ../../c-api/memory.rst:228 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have " "been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:231 +#: ../../c-api/memory.rst:239 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:243 +#: ../../c-api/memory.rst:251 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if " "*n* is equal to zero, the memory block is resized but is not freed, and the " "returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:247 +#: ../../c-api/memory.rst:255 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." msgstr "" -#: ../../c-api/memory.rst:250 +#: ../../c-api/memory.rst:258 msgid "" "If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:256 +#: ../../c-api/memory.rst:264 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:" @@ -333,20 +344,20 @@ msgid "" "undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:263 +#: ../../c-api/memory.rst:271 msgid "" "The following type-oriented macros are provided for convenience. Note that " "*TYPE* refers to any C type." msgstr "" -#: ../../c-api/memory.rst:269 +#: ../../c-api/memory.rst:277 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " "of memory. Returns a pointer cast to ``TYPE*``. The memory will not have " "been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:276 +#: ../../c-api/memory.rst:284 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " "sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " @@ -354,17 +365,17 @@ msgid "" "failure." msgstr "" -#: ../../c-api/memory.rst:281 +#: ../../c-api/memory.rst:289 msgid "" "This is a C preprocessor macro; *p* is always reassigned. Save the original " "value of *p* to avoid losing memory when handling errors." msgstr "" -#: ../../c-api/memory.rst:287 +#: ../../c-api/memory.rst:295 msgid "Same as :c:func:`PyMem_Free`." msgstr "和 :c:func:`PyMem_Free` 相同。" -#: ../../c-api/memory.rst:289 +#: ../../c-api/memory.rst:297 msgid "" "In addition, the following macro sets are provided for calling the Python " "memory allocator directly, without involving the C API functions listed " @@ -372,35 +383,35 @@ msgid "" "across Python versions and is therefore deprecated in extension modules." msgstr "" -#: ../../c-api/memory.rst:294 +#: ../../c-api/memory.rst:302 msgid "``PyMem_MALLOC(size)``" msgstr "``PyMem_MALLOC(size)``" -#: ../../c-api/memory.rst:295 +#: ../../c-api/memory.rst:303 msgid "``PyMem_NEW(type, size)``" msgstr "``PyMem_NEW(type, size)``" -#: ../../c-api/memory.rst:296 +#: ../../c-api/memory.rst:304 msgid "``PyMem_REALLOC(ptr, size)``" msgstr "``PyMem_REALLOC(ptr, size)``" -#: ../../c-api/memory.rst:297 +#: ../../c-api/memory.rst:305 msgid "``PyMem_RESIZE(ptr, type, size)``" msgstr "``PyMem_RESIZE(ptr, type, size)``" -#: ../../c-api/memory.rst:298 +#: ../../c-api/memory.rst:306 msgid "``PyMem_FREE(ptr)``" msgstr "``PyMem_FREE(ptr)``" -#: ../../c-api/memory.rst:299 +#: ../../c-api/memory.rst:307 msgid "``PyMem_DEL(ptr)``" msgstr "``PyMem_DEL(ptr)``" -#: ../../c-api/memory.rst:303 +#: ../../c-api/memory.rst:313 msgid "Object allocators" msgstr "" -#: ../../c-api/memory.rst:310 +#: ../../c-api/memory.rst:320 msgid "" "There is no guarantee that the memory returned by these allocators can be " "successfully cast to a Python object when intercepting the allocating " @@ -408,47 +419,47 @@ msgid "" "Memory Allocators ` section." msgstr "" -#: ../../c-api/memory.rst:315 +#: ../../c-api/memory.rst:325 msgid "" "The :ref:`default object allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:328 +#: ../../c-api/memory.rst:338 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyObject_Malloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:339 +#: ../../c-api/memory.rst:349 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: ../../c-api/memory.rst:351 +#: ../../c-api/memory.rst:361 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: ../../c-api/memory.rst:355 +#: ../../c-api/memory.rst:365 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:" "`PyObject_Calloc`." msgstr "" -#: ../../c-api/memory.rst:358 +#: ../../c-api/memory.rst:368 msgid "" "If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: ../../c-api/memory.rst:364 +#: ../../c-api/memory.rst:374 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:" @@ -456,283 +467,283 @@ msgid "" "called before, undefined behavior occurs." msgstr "" -#: ../../c-api/memory.rst:375 +#: ../../c-api/memory.rst:385 msgid "Default Memory Allocators" msgstr "" -#: ../../c-api/memory.rst:377 +#: ../../c-api/memory.rst:387 msgid "Default memory allocators:" msgstr "" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:390 msgid "Configuration" msgstr "配置" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:390 msgid "Name" msgstr "名稱" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:390 msgid "PyMem_RawMalloc" msgstr "PyMem_RawMalloc" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:390 msgid "PyMem_Malloc" msgstr "PyMem_Malloc" -#: ../../c-api/memory.rst:380 +#: ../../c-api/memory.rst:390 msgid "PyObject_Malloc" msgstr "PyObject_Malloc" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:392 msgid "Release build" msgstr "" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:392 msgid "``\"pymalloc\"``" msgstr "``\"pymalloc\"``" -#: ../../c-api/memory.rst:382 ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:392 ../../c-api/memory.rst:394 msgid "``malloc``" msgstr "``malloc``" -#: ../../c-api/memory.rst:382 +#: ../../c-api/memory.rst:392 msgid "``pymalloc``" msgstr "``pymalloc``" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:393 msgid "Debug build" msgstr "" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:393 msgid "``\"pymalloc_debug\"``" msgstr "``\"pymalloc_debug\"``" -#: ../../c-api/memory.rst:383 ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:393 ../../c-api/memory.rst:395 msgid "``malloc`` + debug" msgstr "" -#: ../../c-api/memory.rst:383 +#: ../../c-api/memory.rst:393 msgid "``pymalloc`` + debug" msgstr "" -#: ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:394 msgid "Release build, without pymalloc" msgstr "" -#: ../../c-api/memory.rst:384 +#: ../../c-api/memory.rst:394 msgid "``\"malloc\"``" msgstr "``\"malloc\"``" -#: ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:395 msgid "Debug build, without pymalloc" msgstr "" -#: ../../c-api/memory.rst:385 +#: ../../c-api/memory.rst:395 msgid "``\"malloc_debug\"``" msgstr "``\"malloc_debug\"``" -#: ../../c-api/memory.rst:388 +#: ../../c-api/memory.rst:398 msgid "Legend:" msgstr "" -#: ../../c-api/memory.rst:390 +#: ../../c-api/memory.rst:400 msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." msgstr "" -#: ../../c-api/memory.rst:391 +#: ../../c-api/memory.rst:401 msgid "" "``malloc``: system allocators from the standard C library, C functions: :c:" "func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." msgstr "" -#: ../../c-api/memory.rst:393 +#: ../../c-api/memory.rst:403 msgid "``pymalloc``: :ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:394 +#: ../../c-api/memory.rst:404 msgid "" "``mimalloc``: :ref:`mimalloc memory allocator `. The pymalloc " "allocator will be used if mimalloc support isn't available." msgstr "" -#: ../../c-api/memory.rst:396 +#: ../../c-api/memory.rst:406 msgid "" "\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." msgstr "" -#: ../../c-api/memory.rst:398 +#: ../../c-api/memory.rst:408 msgid "\"Debug build\": :ref:`Python build in debug mode `." msgstr "" -#: ../../c-api/memory.rst:403 +#: ../../c-api/memory.rst:413 msgid "Customize Memory Allocators" msgstr "" -#: ../../c-api/memory.rst:409 +#: ../../c-api/memory.rst:419 msgid "" "Structure used to describe a memory block allocator. The structure has the " "following fields:" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 +#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670 msgid "Field" msgstr "欄位" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 +#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670 msgid "Meaning" msgstr "意義" -#: ../../c-api/memory.rst:415 ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:672 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:415 ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:672 msgid "user context passed as first argument" msgstr "" -#: ../../c-api/memory.rst:417 +#: ../../c-api/memory.rst:427 msgid "``void* malloc(void *ctx, size_t size)``" msgstr "``void* malloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:417 +#: ../../c-api/memory.rst:427 msgid "allocate a memory block" msgstr "" -#: ../../c-api/memory.rst:419 +#: ../../c-api/memory.rst:429 msgid "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" msgstr "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" -#: ../../c-api/memory.rst:419 +#: ../../c-api/memory.rst:429 msgid "allocate a memory block initialized with zeros" msgstr "" -#: ../../c-api/memory.rst:422 +#: ../../c-api/memory.rst:432 msgid "``void* realloc(void *ctx, void *ptr, size_t new_size)``" msgstr "``void* realloc(void *ctx, void *ptr, size_t new_size)``" -#: ../../c-api/memory.rst:422 +#: ../../c-api/memory.rst:432 msgid "allocate or resize a memory block" msgstr "" -#: ../../c-api/memory.rst:424 +#: ../../c-api/memory.rst:434 msgid "``void free(void *ctx, void *ptr)``" msgstr "``void free(void *ctx, void *ptr)``" -#: ../../c-api/memory.rst:424 +#: ../../c-api/memory.rst:434 msgid "free a memory block" msgstr "" -#: ../../c-api/memory.rst:427 +#: ../../c-api/memory.rst:437 msgid "" "The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" "`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" -#: ../../c-api/memory.rst:434 +#: ../../c-api/memory.rst:444 msgid "Enum used to identify an allocator domain. Domains:" msgstr "" -#: ../../c-api/memory.rst:440 ../../c-api/memory.rst:449 -#: ../../c-api/memory.rst:458 +#: ../../c-api/memory.rst:450 ../../c-api/memory.rst:459 +#: ../../c-api/memory.rst:468 msgid "Functions:" msgstr "函式:" -#: ../../c-api/memory.rst:442 +#: ../../c-api/memory.rst:452 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/memory.rst:443 +#: ../../c-api/memory.rst:453 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/memory.rst:444 +#: ../../c-api/memory.rst:454 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/memory.rst:445 +#: ../../c-api/memory.rst:455 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/memory.rst:451 +#: ../../c-api/memory.rst:461 msgid ":c:func:`PyMem_Malloc`," msgstr ":c:func:`PyMem_Malloc`," -#: ../../c-api/memory.rst:452 +#: ../../c-api/memory.rst:462 msgid ":c:func:`PyMem_Realloc`" msgstr ":c:func:`PyMem_Realloc`" -#: ../../c-api/memory.rst:453 +#: ../../c-api/memory.rst:463 msgid ":c:func:`PyMem_Calloc`" msgstr ":c:func:`PyMem_Calloc`" -#: ../../c-api/memory.rst:454 +#: ../../c-api/memory.rst:464 msgid ":c:func:`PyMem_Free`" msgstr ":c:func:`PyMem_Free`" -#: ../../c-api/memory.rst:460 +#: ../../c-api/memory.rst:470 msgid ":c:func:`PyObject_Malloc`" msgstr ":c:func:`PyObject_Malloc`" -#: ../../c-api/memory.rst:461 +#: ../../c-api/memory.rst:471 msgid ":c:func:`PyObject_Realloc`" msgstr ":c:func:`PyObject_Realloc`" -#: ../../c-api/memory.rst:462 +#: ../../c-api/memory.rst:472 msgid ":c:func:`PyObject_Calloc`" msgstr ":c:func:`PyObject_Calloc`" -#: ../../c-api/memory.rst:463 +#: ../../c-api/memory.rst:473 msgid ":c:func:`PyObject_Free`" msgstr ":c:func:`PyObject_Free`" -#: ../../c-api/memory.rst:467 +#: ../../c-api/memory.rst:477 msgid "Get the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:472 +#: ../../c-api/memory.rst:482 msgid "Set the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:474 +#: ../../c-api/memory.rst:484 msgid "" "The new allocator must return a distinct non-``NULL`` pointer when " "requesting zero bytes." msgstr "" -#: ../../c-api/memory.rst:477 +#: ../../c-api/memory.rst:487 msgid "" "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 "" -#: ../../c-api/memory.rst:481 +#: ../../c-api/memory.rst:491 msgid "" "For the remaining domains, the allocator must also be thread-safe: the " "allocator may be called in different interpreters that do not share a " "``GIL``." msgstr "" -#: ../../c-api/memory.rst:485 +#: ../../c-api/memory.rst:495 msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " "debug hooks on top on the new allocator." msgstr "" -#: ../../c-api/memory.rst:489 +#: ../../c-api/memory.rst:499 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: ../../c-api/memory.rst:494 +#: ../../c-api/memory.rst:504 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: ../../c-api/memory.rst:496 +#: ../../c-api/memory.rst:506 msgid "" "It can be called after :c:func:`Py_PreInitialize` and before :c:func:" "`Py_InitializeFromConfig` to install a custom memory allocator. There are no " @@ -742,7 +753,7 @@ msgid "" "domains>` for more information." msgstr "" -#: ../../c-api/memory.rst:504 +#: ../../c-api/memory.rst:514 msgid "" "If called after Python has finish initializing (after :c:func:" "`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " @@ -750,21 +761,21 @@ msgid "" "arbitrary one is **not supported**." msgstr "" -#: ../../c-api/memory.rst:509 +#: ../../c-api/memory.rst:519 msgid "All allocators must be thread-safe." msgstr "" -#: ../../c-api/memory.rst:515 +#: ../../c-api/memory.rst:525 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:522 +#: ../../c-api/memory.rst:532 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: ../../c-api/memory.rst:524 +#: ../../c-api/memory.rst:534 msgid "" "When :ref:`Python is built in debug mode `, the :c:func:" "`PyMem_SetupDebugHooks` function is called at the :ref:`Python " @@ -772,19 +783,19 @@ msgid "" "allocators to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:529 +#: ../../c-api/memory.rst:539 msgid "" "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " "hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" -#: ../../c-api/memory.rst:532 +#: ../../c-api/memory.rst:542 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " "after calling :c:func:`PyMem_SetAllocator`." msgstr "" -#: ../../c-api/memory.rst:535 +#: ../../c-api/memory.rst:545 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -794,25 +805,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: ../../c-api/memory.rst:542 +#: ../../c-api/memory.rst:552 msgid "Runtime checks:" msgstr "Runtime 檢查:" -#: ../../c-api/memory.rst:544 +#: ../../c-api/memory.rst:554 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:546 +#: ../../c-api/memory.rst:556 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: ../../c-api/memory.rst:547 +#: ../../c-api/memory.rst:557 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: ../../c-api/memory.rst:548 +#: ../../c-api/memory.rst:558 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -820,7 +831,7 @@ msgid "" "called." msgstr "" -#: ../../c-api/memory.rst:553 +#: ../../c-api/memory.rst:563 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -828,7 +839,7 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:558 +#: ../../c-api/memory.rst:568 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 " @@ -838,49 +849,49 @@ msgid "" "from a Python slice):" msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:574 msgid "``p[-2*S:-S]``" msgstr "``p[-2*S:-S]``" -#: ../../c-api/memory.rst:565 +#: ../../c-api/memory.rst:575 msgid "" "Number of bytes originally asked for. This is a size_t, big-endian (easier " "to read in a memory dump)." msgstr "" -#: ../../c-api/memory.rst:567 +#: ../../c-api/memory.rst:577 msgid "``p[-S]``" msgstr "``p[-S]``" -#: ../../c-api/memory.rst:568 +#: ../../c-api/memory.rst:578 msgid "API identifier (ASCII character):" msgstr "" -#: ../../c-api/memory.rst:570 +#: ../../c-api/memory.rst:580 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: ../../c-api/memory.rst:571 +#: ../../c-api/memory.rst:581 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: ../../c-api/memory.rst:572 +#: ../../c-api/memory.rst:582 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: ../../c-api/memory.rst:574 +#: ../../c-api/memory.rst:584 msgid "``p[-S+1:0]``" msgstr "``p[-S+1:0]``" -#: ../../c-api/memory.rst:575 +#: ../../c-api/memory.rst:585 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: ../../c-api/memory.rst:577 +#: ../../c-api/memory.rst:587 msgid "``p[0:N]``" msgstr "``p[0:N]``" -#: ../../c-api/memory.rst:578 +#: ../../c-api/memory.rst:588 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -891,25 +902,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: ../../c-api/memory.rst:586 +#: ../../c-api/memory.rst:596 msgid "``p[N:N+S]``" msgstr "``p[N:N+S]``" -#: ../../c-api/memory.rst:587 +#: ../../c-api/memory.rst:597 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: ../../c-api/memory.rst:589 +#: ../../c-api/memory.rst:599 msgid "``p[N+S:N+2*S]``" msgstr "``p[N+S:N+2*S]``" -#: ../../c-api/memory.rst:590 +#: ../../c-api/memory.rst:600 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: ../../c-api/memory.rst:593 +#: ../../c-api/memory.rst:603 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" "like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " @@ -919,7 +930,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: ../../c-api/memory.rst:600 +#: ../../c-api/memory.rst:610 msgid "" "A realloc-like or free-like function first checks that the " "PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " @@ -932,7 +943,7 @@ msgid "" "getting used)." msgstr "" -#: ../../c-api/memory.rst:609 +#: ../../c-api/memory.rst:619 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" @@ -941,7 +952,7 @@ msgid "" "`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: ../../c-api/memory.rst:617 +#: ../../c-api/memory.rst:627 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -949,11 +960,11 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:627 +#: ../../c-api/memory.rst:637 msgid "The pymalloc allocator" msgstr "" -#: ../../c-api/memory.rst:629 +#: ../../c-api/memory.rst:639 msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " @@ -962,75 +973,75 @@ msgid "" "`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: ../../c-api/memory.rst:635 +#: ../../c-api/memory.rst:645 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:649 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:641 +#: ../../c-api/memory.rst:651 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:642 +#: ../../c-api/memory.rst:652 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:643 +#: ../../c-api/memory.rst:653 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:645 +#: ../../c-api/memory.rst:655 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:650 +#: ../../c-api/memory.rst:660 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:656 +#: ../../c-api/memory.rst:666 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:664 +#: ../../c-api/memory.rst:674 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:664 +#: ../../c-api/memory.rst:674 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:676 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:676 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:671 +#: ../../c-api/memory.rst:681 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:675 +#: ../../c-api/memory.rst:685 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:680 +#: ../../c-api/memory.rst:690 msgid "The mimalloc allocator" msgstr "" -#: ../../c-api/memory.rst:684 +#: ../../c-api/memory.rst:694 msgid "" "Python supports the mimalloc allocator when the underlying platform support " "is available. mimalloc \"is a general purpose allocator with excellent " @@ -1038,46 +1049,46 @@ msgid "" "runtime systems of the Koka and Lean languages.\"" msgstr "" -#: ../../c-api/memory.rst:689 +#: ../../c-api/memory.rst:699 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:695 +#: ../../c-api/memory.rst:705 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:697 +#: ../../c-api/memory.rst:707 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:700 +#: ../../c-api/memory.rst:710 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:704 +#: ../../c-api/memory.rst:714 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:707 +#: ../../c-api/memory.rst:717 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:713 +#: ../../c-api/memory.rst:723 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:725 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:718 +#: ../../c-api/memory.rst:728 msgid "" "PyObject *res;\n" "char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n" @@ -1090,11 +1101,11 @@ msgid "" "return res;" msgstr "" -#: ../../c-api/memory.rst:728 +#: ../../c-api/memory.rst:738 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:730 +#: ../../c-api/memory.rst:740 msgid "" "PyObject *res;\n" "char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n" @@ -1107,7 +1118,7 @@ msgid "" "return res;" msgstr "" -#: ../../c-api/memory.rst:740 +#: ../../c-api/memory.rst:750 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1117,7 +1128,7 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:747 +#: ../../c-api/memory.rst:757 msgid "" "char *buf1 = PyMem_New(char, BUFSIZ);\n" "char *buf2 = (char *) malloc(BUFSIZ);\n" @@ -1128,14 +1139,14 @@ msgid "" "free(buf1); /* Fatal -- should be PyMem_Del() */" msgstr "" -#: ../../c-api/memory.rst:755 +#: ../../c-api/memory.rst:765 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:759 +#: ../../c-api/memory.rst:769 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/module.po b/c-api/module.po index cd977561d1..13cc3dc95a 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -50,7 +50,7 @@ msgid "" msgstr "" #: ../../c-api/module.rst:46 ../../c-api/module.rst:270 -#: ../../c-api/module.rst:470 +#: ../../c-api/module.rst:472 msgid "Return ``NULL`` with an exception set on error." msgstr "在失敗時回傳 ``NULL`` 並設定例外。" @@ -468,17 +468,17 @@ msgid "" "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:426 +#: ../../c-api/module.rst:428 msgid "" "The module depends on the presence of the global interpreter lock (GIL), and " "may access global state without synchronization." msgstr "" -#: ../../c-api/module.rst:431 +#: ../../c-api/module.rst:433 msgid "The module is safe to run without an active GIL." msgstr "" -#: ../../c-api/module.rst:433 +#: ../../c-api/module.rst:435 msgid "" "This slot is ignored by Python builds not configured with :option:`--disable-" "gil`. Otherwise, it determines whether or not importing this module will " @@ -486,26 +486,26 @@ msgid "" "threaded-cpython` for more detail." msgstr "" -#: ../../c-api/module.rst:438 +#: ../../c-api/module.rst:440 msgid "" "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:442 msgid "" "If ``Py_mod_gil`` is not specified, the import machinery defaults to " "``Py_MOD_GIL_USED``." msgstr "" -#: ../../c-api/module.rst:445 +#: ../../c-api/module.rst:447 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:448 +#: ../../c-api/module.rst:450 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:452 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -513,14 +513,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:457 +#: ../../c-api/module.rst:459 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 :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:465 +#: ../../c-api/module.rst:467 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -528,24 +528,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:474 +#: ../../c-api/module.rst:476 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:481 +#: ../../c-api/module.rst:483 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:487 +#: ../../c-api/module.rst:489 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:496 +#: ../../c-api/module.rst:498 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -557,11 +557,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:508 +#: ../../c-api/module.rst:510 msgid "Support functions" msgstr "支援的函式" -#: ../../c-api/module.rst:510 +#: ../../c-api/module.rst:512 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -569,29 +569,29 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:517 +#: ../../c-api/module.rst:519 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:520 +#: ../../c-api/module.rst:522 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:522 +#: ../../c-api/module.rst:524 msgid "" "Return ``-1`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:525 ../../c-api/module.rst:572 -#: ../../c-api/module.rst:599 +#: ../../c-api/module.rst:527 ../../c-api/module.rst:574 +#: ../../c-api/module.rst:601 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:527 +#: ../../c-api/module.rst:529 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -617,13 +617,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:539 +#: ../../c-api/module.rst:541 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:542 +#: ../../c-api/module.rst:544 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -643,13 +643,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:551 +#: ../../c-api/module.rst:553 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:554 +#: ../../c-api/module.rst:556 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -659,7 +659,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:567 +#: ../../c-api/module.rst:569 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -667,39 +667,39 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:574 +#: ../../c-api/module.rst:576 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" -#: ../../c-api/module.rst:583 +#: ../../c-api/module.rst:585 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:586 +#: ../../c-api/module.rst:588 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:593 +#: ../../c-api/module.rst:595 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:596 +#: ../../c-api/module.rst:598 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:601 +#: ../../c-api/module.rst:603 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -713,24 +713,24 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:614 +#: ../../c-api/module.rst:616 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: ../../c-api/module.rst:619 +#: ../../c-api/module.rst:621 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:623 +#: ../../c-api/module.rst:625 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:629 +#: ../../c-api/module.rst:631 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -738,14 +738,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:634 +#: ../../c-api/module.rst:636 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:641 +#: ../../c-api/module.rst:643 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -753,11 +753,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:649 +#: ../../c-api/module.rst:651 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:653 +#: ../../c-api/module.rst:655 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -765,7 +765,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:663 +#: ../../c-api/module.rst:665 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -776,25 +776,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:676 +#: ../../c-api/module.rst:678 msgid "Module lookup" msgstr "模組查找" -#: ../../c-api/module.rst:678 +#: ../../c-api/module.rst:680 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:682 +#: ../../c-api/module.rst:684 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:687 +#: ../../c-api/module.rst:689 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -803,18 +803,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:694 +#: ../../c-api/module.rst:696 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:697 +#: ../../c-api/module.rst:699 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:701 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -825,15 +825,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:707 ../../c-api/module.rst:718 +#: ../../c-api/module.rst:709 ../../c-api/module.rst:720 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:709 +#: ../../c-api/module.rst:711 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:715 +#: ../../c-api/module.rst:717 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." diff --git a/c-api/monitoring.po b/c-api/monitoring.po index cd950f57fa..9acef77d30 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -166,3 +166,120 @@ msgid "" "Monitoring states can be managed with the help of monitoring scopes. A scope " "would typically correspond to a python function." msgstr "" + +#: ../../c-api/monitoring.rst:138 +msgid "" +"Enter a monitored scope. ``event_types`` is an array of the event IDs for " +"events that may be fired from the scope. For example, the ID of a " +"``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is " +"numerically equal to the base-2 logarithm of ``sys.monitoring.events." +"PY_START``. ``state_array`` is an array with a monitoring state entry for " +"each event in ``event_types``, it is allocated by the user but populated by :" +"c:func:`!PyMonitoring_EnterScope` with information about the activation " +"state of the event. The size of ``event_types`` (and hence also of " +"``state_array``) is given in ``length``." +msgstr "" + +#: ../../c-api/monitoring.rst:148 +msgid "" +"The ``version`` argument is a pointer to a value which should be allocated " +"by the user together with ``state_array`` and initialized to 0, and then set " +"only by :c:func:`!PyMonitoring_EnterScope` itelf. It allows this function to " +"determine whether event states have changed since the previous call, and to " +"return quickly if they have not." +msgstr "" + +#: ../../c-api/monitoring.rst:154 +msgid "" +"The scopes referred to here are lexical scopes: a function, class or " +"method. :c:func:`!PyMonitoring_EnterScope` should be called whenever the " +"lexical scope is entered. Scopes can be reentered, reusing the same " +"*state_array* and *version*, in situations like when emulating a recursive " +"Python function. When a code-like's execution is paused, such as when " +"emulating a generator, the scope needs to be exited and re-entered." +msgstr "" + +#: ../../c-api/monitoring.rst:161 +msgid "The macros for *event_types* are:" +msgstr "" + +#: ../../c-api/monitoring.rst:169 +msgid "Macro" +msgstr "" + +#: ../../c-api/monitoring.rst:169 +msgid "Event" +msgstr "" + +#: ../../c-api/monitoring.rst:171 +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +#: ../../c-api/monitoring.rst:172 +msgid ":monitoring-event:`CALL`" +msgstr "" + +#: ../../c-api/monitoring.rst:173 +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +#: ../../c-api/monitoring.rst:174 +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +#: ../../c-api/monitoring.rst:175 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +#: ../../c-api/monitoring.rst:176 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +#: ../../c-api/monitoring.rst:177 +msgid ":monitoring-event:`JUMP`" +msgstr "" + +#: ../../c-api/monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr "" + +#: ../../c-api/monitoring.rst:179 +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +#: ../../c-api/monitoring.rst:180 +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +#: ../../c-api/monitoring.rst:181 +msgid ":monitoring-event:`PY_START`" +msgstr "" + +#: ../../c-api/monitoring.rst:182 +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +#: ../../c-api/monitoring.rst:183 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +#: ../../c-api/monitoring.rst:184 +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +#: ../../c-api/monitoring.rst:185 +msgid ":monitoring-event:`RAISE`" +msgstr "" + +#: ../../c-api/monitoring.rst:186 +msgid ":monitoring-event:`RERAISE`" +msgstr "" + +#: ../../c-api/monitoring.rst:187 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +#: ../../c-api/monitoring.rst:192 +msgid "" +"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." +msgstr "" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 4f44c6bec2..0343683dfa 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-08-06 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,15 +114,14 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使用 :c:func:" "`Py_XINCREF`。" -#: ../../c-api/refcounting.rst:64 ../../c-api/refcounting.rst:132 +#: ../../c-api/refcounting.rst:64 #, fuzzy msgid "" -"Do not expect this function to actually modify *o* in any way. For at least " -"`some objects `_, this function has no " -"effect." +"Do not expect this function to actually modify *o* in any way. For at least :" +"pep:`some objects <0683>`, this function has no effect." msgstr "" -"不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 <0683>`\\ " -"來說,此函式沒有任何效果。" +"不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 <683>`\\ 來" +"說,此函式沒有任何效果。" #: ../../c-api/refcounting.rst:74 msgid "" @@ -225,6 +224,14 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改用 :c:func:" "`Py_XDECREF`。" +#: ../../c-api/refcounting.rst:132 +msgid "" +"Do not expect this function to actually modify *o* in any way. For at least :" +"pep:`some objects <683>`, this function has no effect." +msgstr "" +"不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 <683>`\\ 來" +"說,此函式沒有任何效果。" + #: ../../c-api/refcounting.rst:138 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." @@ -352,9 +359,11 @@ msgstr "" ":c:macro:`Py_SETREF` 巨集的變體,請改用 :c:func:`Py_XDECREF` 而非 :c:func:" "`Py_DECREF`。" +#, fuzzy #~ msgid "" #~ "Do not expect this function to actually modify *o* in any way. For at " -#~ "least :pep:`some objects <683>`, this function has no effect." +#~ "least `some objects `_, this function " +#~ "has no effect." #~ msgstr "" #~ "不要期望此函式會以任何方式實際修改 *o*,至少對於\\ :pep:`某些物件 " -#~ "<683>`\\ 來說,此函式沒有任何效果。" +#~ "<0683>`\\ 來說,此函式沒有任何效果。" diff --git a/c-api/time.po b/c-api/time.po index d41ea7d002..7636335954 100644 --- a/c-api/time.po +++ b/c-api/time.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,70 +17,70 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../c-api/time.rst:4 +#: ../../c-api/time.rst:6 msgid "PyTime C API" msgstr "" -#: ../../c-api/time.rst:8 +#: ../../c-api/time.rst:10 msgid "" "The clock C API provides access to system clocks. It is similar to the " "Python :mod:`time` module." msgstr "" -#: ../../c-api/time.rst:11 +#: ../../c-api/time.rst:13 msgid "" "For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." msgstr "" -#: ../../c-api/time.rst:15 +#: ../../c-api/time.rst:17 msgid "Types" msgstr "" -#: ../../c-api/time.rst:19 +#: ../../c-api/time.rst:21 msgid "" "A timestamp or duration in nanoseconds, represented as a signed 64-bit " "integer." msgstr "" -#: ../../c-api/time.rst:22 +#: ../../c-api/time.rst:24 msgid "" "The reference point for timestamps depends on the clock used. For example, :" "c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." msgstr "" -#: ../../c-api/time.rst:25 +#: ../../c-api/time.rst:27 msgid "" "The supported range is around [-292.3 years; +292.3 years]. Using the Unix " "epoch (January 1st, 1970) as reference, the supported date range is around " "[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" msgstr "" -#: ../../c-api/time.rst:32 +#: ../../c-api/time.rst:34 msgid "Minimum value of :c:type:`PyTime_t`." msgstr "" -#: ../../c-api/time.rst:36 +#: ../../c-api/time.rst:38 msgid "Maximum value of :c:type:`PyTime_t`." msgstr "" -#: ../../c-api/time.rst:40 +#: ../../c-api/time.rst:42 msgid "Clock Functions" msgstr "" -#: ../../c-api/time.rst:42 +#: ../../c-api/time.rst:44 msgid "" "The following functions take a pointer to a :c:expr:`PyTime_t` that they set " "to the value of a particular clock. Details of each clock are given in the " "documentation of the corresponding Python function." msgstr "" -#: ../../c-api/time.rst:47 +#: ../../c-api/time.rst:49 msgid "" "The functions return ``0`` on success, or ``-1`` (with an exception set) on " "failure." msgstr "" -#: ../../c-api/time.rst:50 +#: ../../c-api/time.rst:52 msgid "" "On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " "and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` " @@ -88,45 +88,45 @@ msgid "" "misconfigured system time.)" msgstr "" -#: ../../c-api/time.rst:56 +#: ../../c-api/time.rst:58 msgid "" "As any other C API (unless otherwise specified), the functions must be " "called with the :term:`GIL` held." msgstr "" -#: ../../c-api/time.rst:61 +#: ../../c-api/time.rst:63 msgid "" "Read the monotonic clock. See :func:`time.monotonic` for important details " "on this clock." msgstr "" -#: ../../c-api/time.rst:66 +#: ../../c-api/time.rst:68 msgid "" "Read the performance counter. See :func:`time.perf_counter` for important " "details on this clock." msgstr "" -#: ../../c-api/time.rst:71 +#: ../../c-api/time.rst:73 msgid "" "Read the “wall clock” time. See :func:`time.time` for details important on " "this clock." msgstr "" -#: ../../c-api/time.rst:76 +#: ../../c-api/time.rst:78 msgid "Raw Clock Functions" msgstr "" -#: ../../c-api/time.rst:78 +#: ../../c-api/time.rst:80 msgid "" "Similar to clock functions, but don't set an exception on error and don't " "require the caller to hold the GIL." msgstr "" -#: ../../c-api/time.rst:81 +#: ../../c-api/time.rst:83 msgid "On success, the functions return ``0``." msgstr "" -#: ../../c-api/time.rst:83 +#: ../../c-api/time.rst:85 msgid "" "On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " "setting an exception. To get the cause of the error, acquire the GIL and " @@ -134,33 +134,33 @@ msgid "" "succeed after the ``Raw`` one failed." msgstr "" -#: ../../c-api/time.rst:90 +#: ../../c-api/time.rst:92 msgid "" "Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " "and don't require holding the GIL." msgstr "" -#: ../../c-api/time.rst:95 +#: ../../c-api/time.rst:97 msgid "" "Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error " "and don't require holding the GIL." msgstr "" -#: ../../c-api/time.rst:100 +#: ../../c-api/time.rst:102 msgid "" "Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " "don't require holding the GIL." msgstr "" -#: ../../c-api/time.rst:105 +#: ../../c-api/time.rst:107 msgid "Conversion functions" msgstr "" -#: ../../c-api/time.rst:109 +#: ../../c-api/time.rst:111 msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." msgstr "" -#: ../../c-api/time.rst:111 +#: ../../c-api/time.rst:113 msgid "" "The function cannot fail, but note that :c:expr:`double` has limited " "accuracy for large values." diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po index acd9ed6272..25b98dc4ae 100644 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-17 00:03+0000\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,164 +41,191 @@ msgid "" msgstr "設定 Python 初始化的函式,Python 3.11 中已被棄用:" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 -msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +#, fuzzy +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgvEx()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 -msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +#, fuzzy +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgv()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 -msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:16 +#, fuzzy +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" "``Py_SetProgramName()``:請改以 :c:member:`PyConfig.program_name` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 -msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:18 +#, fuzzy +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "``Py_SetPythonHome()``:請改以 :c:member:`PyConfig.home` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 msgid "Global configuration variables:" msgstr "全域設定變數:" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 -msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +#, fuzzy +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." msgstr ":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 -msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +#, fuzzy +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." msgstr ":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 -msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#, fuzzy +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." msgstr ":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#, fuzzy msgid "" -":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." msgstr ":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 -msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#, fuzzy +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." msgstr ":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:36 +#, fuzzy msgid "" -":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " "instead." msgstr "" ":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 -msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#, fuzzy +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." msgstr ":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#, fuzzy msgid "" -":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." msgstr "" ":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#, fuzzy msgid "" -":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." msgstr "" ":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:44 +#, fuzzy msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." "use_environment`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 +#, fuzzy msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." "write_bytecode`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 +#, fuzzy msgid "" -":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." "user_site_directory` instead." msgstr "" ":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." "user_site_directory`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 +#, fuzzy msgid "" -":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " "instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:52 +#, fuzzy msgid "" -":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed` instead." msgstr "" ":c:var:`Py_HashRandomizationFlag`:請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 -msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:55 +#, fuzzy +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." "legacy_windows_fs_encoding` instead." msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." "legacy_windows_stdio` instead." msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." "legacy_windows_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 +#, fuzzy msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." "filesystem_errors` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." "filesystem_errors`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 +#, fuzzy msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" "c:func:`Py_PreInitialize`)" msgstr "" ":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index 20ea03215f..96e1201729 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,65 +25,78 @@ msgid "The bundled copy of ``libmpdecimal``." msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 +#, fuzzy msgid "" -":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " -"instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 -msgid ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" - #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 -msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." -msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" +#, fuzzy +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 -msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +#, fuzzy +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr ":c:type:`Py_UNICODE` type:請改用 :c:type:`wchar_t`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 +#, fuzzy msgid "" -":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 -msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +#, fuzzy +msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +#, fuzzy +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 -msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#, fuzzy +msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 -msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 +#, fuzzy +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 +#, fuzzy +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 +#, fuzzy msgid "" -":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數。" + +#~ msgid "" +#~ ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." +#~ msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" + +#~ msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +#~ msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po index 28b6ce87dc..90982fcb83 100644 --- a/deprecations/c-api-pending-removal-in-future.po +++ b/deprecations/c-api-pending-removal-in-future.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-17 00:03+0000\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,84 +27,99 @@ msgid "" msgstr "下列 API 已被棄用並將會被移除,不過目前尚未訂定移除日期。" #: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +#, fuzzy +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:8 -msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#, fuzzy +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#, fuzzy msgid "" -":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:" "`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#, fuzzy msgid "" -":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#, fuzzy msgid "" -":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " "instead." msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:12 -msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#, fuzzy +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 +#, fuzzy msgid "" -":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` instead." msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +#: ../../deprecations/c-api-pending-removal-in-future.rst:25 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:18 -msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#, fuzzy +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +#, fuzzy +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +#: ../../deprecations/c-api-pending-removal-in-future.rst:33 +#, fuzzy msgid "" -":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#: ../../deprecations/c-api-pending-removal-in-future.rst:35 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." @@ -112,40 +127,46 @@ msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" "`PyObject_Hash`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +#: ../../deprecations/c-api-pending-removal-in-future.rst:38 msgid "Thread Local Storage (TLS) API:" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +#: ../../deprecations/c-api-pending-removal-in-future.rst:40 +#, fuzzy msgid "" -":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:42 +#, fuzzy +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +#: ../../deprecations/c-api-pending-removal-in-future.rst:44 +#, fuzzy msgid "" -":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#: ../../deprecations/c-api-pending-removal-in-future.rst:46 +#, fuzzy msgid "" -":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +#: ../../deprecations/c-api-pending-removal-in-future.rst:48 +#, fuzzy msgid "" -":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " "instead." msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +#: ../../deprecations/c-api-pending-removal-in-future.rst:50 +#, fuzzy +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" diff --git a/deprecations/index.po b/deprecations/index.po index 88748aa9dd..9b97344091 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -289,114 +289,131 @@ msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:4 +#, fuzzy +msgid ":mod:`ctypes`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:9 +#, fuzzy +msgid ":mod:`http.server`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +#, fuzzy msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." msgstr "" ":class:`http.server.CGIHTTPRequestHandler` 將會被移除,連同其相關的 ``--" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:17 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:20 +#, fuzzy +msgid ":class:`locale`:" +msgstr ":class:`!ast.Bytes`" + +#: ../../deprecations/pending-removal-in-3.15.rst:22 +#, fuzzy +msgid "" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" ":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用," "原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:16 +#: ../../deprecations/pending-removal-in-3.15.rst:30 +#, fuzzy +msgid ":mod:`pathlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:32 +#, fuzzy msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. Use :func:`os.path.isreserved` to " -"detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:21 +#: ../../deprecations/pending-removal-in-3.15.rst:36 +#, fuzzy +msgid ":mod:`platform`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" -":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它幾" -"乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita Sobolev " -"於 :gh:`116349` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:27 +#: ../../deprecations/pending-removal-in-3.15.rst:42 +#, fuzzy +msgid ":mod:`threading`:" +msgstr ":mod:`threading` 方法:" + +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" -":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C 版本" -"允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何引數。所" -"有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 Nikita " -"Sobolev 於 :gh:`102029` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid ":class:`typing.NamedTuple`:" -msgstr ":class:`typing.NamedTuple`:" +#: ../../deprecations/pending-removal-in-3.15.rst:50 +#, fuzzy +msgid ":mod:`typing`:" +msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:52 +#, fuzzy msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" "用於建立 :class:`!NamedTuple` 類別的未以文件記錄之關鍵字引數語法 (``NT = " "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:40 -msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." -msgstr "" -"當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參數" -"的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 *fields* 參" -"數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 Python 3.15 中" -"會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請使用 ``class " -"NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:47 -msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." -msgstr "" -":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別時," -"沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄用,將 " -"``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也已被棄用。" -"這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!TypedDict` " -"類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = TypedDict(\"TD\", " -"{})``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:54 -msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +#: ../../deprecations/pending-removal-in-3.15.rst:58 +msgid "" +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +#, fuzzy +msgid ":mod:`wave`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +#, fuzzy +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" ":mod:`wave`:已棄用 :class:`wave.Wave_read` 和 :class:`wave.Wave_write` 類別" "的 ``getmark()``、``setmark()`` 和 ``getmarkers()`` 方法。它們將在 Python " @@ -407,24 +424,76 @@ msgid "Pending Removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:4 +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." msgstr "" -":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改用 " -"``'w'`` 型別 (``Py_UCS4``)。" -#: ../../deprecations/pending-removal-in-3.16.rst:8 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." -msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" +#: ../../deprecations/pending-removal-in-3.16.rst:13 +#, fuzzy +msgid ":mod:`array`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:15 +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:21 +#, fuzzy +msgid ":mod:`shutil`:" +msgstr ":mod:`msilib`" -#: ../../deprecations/pending-removal-in-3.16.rst:11 +#: ../../deprecations/pending-removal-in-3.16.rst:23 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +#, fuzzy +msgid ":mod:`symtable`:" +msgstr ":mod:`sqlite3`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:30 +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:33 +#, fuzzy +msgid ":mod:`sys`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:35 +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:39 +#, fuzzy +msgid ":mod:`tarfile`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:41 +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" -":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." -"get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -447,10 +516,6 @@ msgstr ":mod:`argparse`:已棄用巢狀引數群組和巢狀互斥群組。" msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)" -#: ../../deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr ":mod:`builtins`:" - #: ../../deprecations/pending-removal-in-future.rst:14 msgid "``bool(NotImplemented)``." msgstr "``bool(NotImplemented)``。" @@ -871,164 +936,191 @@ msgid "" msgstr "設定 Python 初始化的函式,Python 3.11 中已被棄用:" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 -msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +#, fuzzy +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgvEx()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 -msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +#, fuzzy +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgv()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 -msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:16 +#, fuzzy +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" "``Py_SetProgramName()``:請改以 :c:member:`PyConfig.program_name` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 -msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:18 +#, fuzzy +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "``Py_SetPythonHome()``:請改以 :c:member:`PyConfig.home` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 msgid "Global configuration variables:" msgstr "全域設定變數:" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 -msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +#, fuzzy +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." msgstr ":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 -msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +#, fuzzy +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." msgstr ":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 -msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#, fuzzy +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." msgstr ":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#, fuzzy msgid "" -":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." msgstr ":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 -msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#, fuzzy +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." msgstr ":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:36 +#, fuzzy msgid "" -":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " "instead." msgstr "" ":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 -msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#, fuzzy +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." msgstr ":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#, fuzzy msgid "" -":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." msgstr "" ":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#, fuzzy msgid "" -":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." msgstr "" ":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:44 +#, fuzzy msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." "use_environment`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 +#, fuzzy msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." "write_bytecode`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 +#, fuzzy msgid "" -":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." "user_site_directory` instead." msgstr "" ":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." "user_site_directory`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 +#, fuzzy msgid "" -":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " "instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:52 +#, fuzzy msgid "" -":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed` instead." msgstr "" ":c:var:`Py_HashRandomizationFlag`:請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 -msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:55 +#, fuzzy +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." "legacy_windows_fs_encoding` instead." msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." "legacy_windows_stdio` instead." msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." "legacy_windows_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 +#, fuzzy msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." "filesystem_errors` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." "filesystem_errors`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 +#, fuzzy msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" "c:func:`Py_PreInitialize`)" msgstr "" ":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" @@ -1039,64 +1131,70 @@ msgid "The bundled copy of ``libmpdecimal``." msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 +#, fuzzy msgid "" -":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " -"instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 -msgid ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" - #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 -msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." -msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" +#, fuzzy +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 -msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +#, fuzzy +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr ":c:type:`Py_UNICODE` type:請改用 :c:type:`wchar_t`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 +#, fuzzy msgid "" -":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 -msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +#, fuzzy +msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +#, fuzzy +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 -msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#, fuzzy +msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 -msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 +#, fuzzy +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 +#, fuzzy +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 +#, fuzzy msgid "" -":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" @@ -1109,84 +1207,99 @@ msgid "" msgstr "下列 API 已被棄用並將會被移除,不過目前尚未訂定移除日期。" #: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +#, fuzzy +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:8 -msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#, fuzzy +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#, fuzzy msgid "" -":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:" "`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#, fuzzy msgid "" -":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#, fuzzy msgid "" -":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " "instead." msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:12 -msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#, fuzzy +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 +#, fuzzy msgid "" -":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` instead." msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +#: ../../deprecations/c-api-pending-removal-in-future.rst:25 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:18 -msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#, fuzzy +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +#, fuzzy +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +#: ../../deprecations/c-api-pending-removal-in-future.rst:33 +#, fuzzy msgid "" -":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#: ../../deprecations/c-api-pending-removal-in-future.rst:35 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." @@ -1194,44 +1307,130 @@ msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" "`PyObject_Hash`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +#: ../../deprecations/c-api-pending-removal-in-future.rst:38 msgid "Thread Local Storage (TLS) API:" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +#: ../../deprecations/c-api-pending-removal-in-future.rst:40 +#, fuzzy msgid "" -":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:42 +#, fuzzy +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +#: ../../deprecations/c-api-pending-removal-in-future.rst:44 +#, fuzzy msgid "" -":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#: ../../deprecations/c-api-pending-removal-in-future.rst:46 +#, fuzzy msgid "" -":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +#: ../../deprecations/c-api-pending-removal-in-future.rst:48 +#, fuzzy msgid "" -":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " "instead." msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +#: ../../deprecations/c-api-pending-removal-in-future.rst:50 +#, fuzzy +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" +#~ msgid "" +#~ ":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " +#~ "removed in 3.15. It was largely untested, had a confusing API, and was " +#~ "only useful for Jython support. (Contributed by Nikita Sobolev in :gh:" +#~ "`116349`.)" +#~ msgstr "" +#~ ":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它" +#~ "幾乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita " +#~ "Sobolev 於 :gh:`116349` 貢獻。)" + +#~ msgid "" +#~ ":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " +#~ "deprecated. C version allows any numbers of args and kwargs, but they are " +#~ "just ignored. Python version does not allow any arguments. All arguments " +#~ "will be removed from :func:`threading.RLock` in Python 3.15. (Contributed " +#~ "by Nikita Sobolev in :gh:`102029`.)" +#~ msgstr "" +#~ ":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C " +#~ "版本允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何" +#~ "引數。所有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 " +#~ "Nikita Sobolev 於 :gh:`102029` 貢獻。)" + +#~ msgid ":class:`typing.NamedTuple`:" +#~ msgstr ":class:`typing.NamedTuple`:" + +#~ msgid "" +#~ "When using the functional syntax to create a :class:`!NamedTuple` class, " +#~ "failing to pass a value to the *fields* parameter (``NT = " +#~ "NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " +#~ "parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both " +#~ "will be disallowed in Python 3.15. To create a :class:`!NamedTuple` class " +#~ "with 0 fields, use ``class NT(NamedTuple): pass`` or ``NT = " +#~ "NamedTuple(\"NT\", [])``." +#~ msgstr "" +#~ "當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參" +#~ "數的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 " +#~ "*fields* 參數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 " +#~ "Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請" +#~ "使用 ``class NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" + +#~ msgid "" +#~ ":class:`typing.TypedDict`: When using the functional syntax to create a :" +#~ "class:`!TypedDict` class, failing to pass a value to the *fields* " +#~ "parameter (``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to " +#~ "the *fields* parameter (``TD = TypedDict(\"TD\", None)``) is also " +#~ "deprecated. Both will be disallowed in Python 3.15. To create a :class:`!" +#~ "TypedDict` class with 0 fields, use ``class TD(TypedDict): pass`` or ``TD " +#~ "= TypedDict(\"TD\", {})``." +#~ msgstr "" +#~ ":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別" +#~ "時,沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄" +#~ "用,將 ``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也" +#~ "已被棄用。這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:" +#~ "`!TypedDict` 類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = " +#~ "TypedDict(\"TD\", {})``。" + +#~ msgid "" +#~ ":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use " +#~ "the ``'w'`` type instead (``Py_UCS4``)." +#~ msgstr "" +#~ ":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改" +#~ "用 ``'w'`` 型別 (``Py_UCS4``)。" + +#~ msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#~ msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" + +#~ msgid "" +#~ ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " +#~ "lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +#~ msgstr "" +#~ ":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." +#~ "get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" + +#~ msgid "" +#~ ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." +#~ msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" + +#~ msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +#~ msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" + #~ msgid "Pending Removal in Python 3.13" #~ msgstr "Python 3.13 中待移除的項目" @@ -1262,9 +1461,6 @@ msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" #~ msgid ":mod:`mailcap`" #~ msgstr ":mod:`mailcap`" -#~ msgid ":mod:`msilib`" -#~ msgstr ":mod:`msilib`" - #~ msgid ":mod:`nis`" #~ msgstr ":mod:`nis`" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index b2019d1972..da018ca7d9 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,115 +21,178 @@ msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid ":mod:`ctypes`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:9 +msgid ":mod:`http.server`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +#, fuzzy +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." msgstr "" ":class:`http.server.CGIHTTPRequestHandler` 將會被移除,連同其相關的 ``--" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:17 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:20 +#, fuzzy +msgid ":class:`locale`:" +msgstr ":class:`typing.NamedTuple`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:22 +#, fuzzy +msgid "" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" ":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用," "原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:16 +#: ../../deprecations/pending-removal-in-3.15.rst:30 +msgid ":mod:`pathlib`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:32 +#, fuzzy msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. Use :func:`os.path.isreserved` to " -"detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:21 +#: ../../deprecations/pending-removal-in-3.15.rst:36 +msgid ":mod:`platform`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:42 +msgid ":mod:`threading`:" msgstr "" -":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它幾" -"乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita Sobolev " -"於 :gh:`116349` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:27 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" -msgstr "" -":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C 版本" -"允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何引數。所" -"有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 Nikita " -"Sobolev 於 :gh:`102029` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid ":class:`typing.NamedTuple`:" -msgstr ":class:`typing.NamedTuple`:" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." +msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:50 +msgid ":mod:`typing`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:52 +#, fuzzy msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" "用於建立 :class:`!NamedTuple` 類別的未以文件記錄之關鍵字引數語法 (``NT = " "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:40 -msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." -msgstr "" -"當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參數" -"的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 *fields* 參" -"數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 Python 3.15 中" -"會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請使用 ``class " -"NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:58 msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." -msgstr "" -":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別時," -"沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄用,將 " -"``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也已被棄用。" -"這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!TypedDict` " -"類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = TypedDict(\"TD\", " -"{})``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:54 +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`wave`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +#, fuzzy msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" ":mod:`wave`:已棄用 :class:`wave.Wave_read` 和 :class:`wave.Wave_write` 類別" "的 ``getmark()``、``setmark()`` 和 ``getmarkers()`` 方法。它們將在 Python " "3.15 中被移除。 (由 Victor Stinner 於 :gh:`105096` 貢獻。)" + +#~ msgid "" +#~ ":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " +#~ "removed in 3.15. It was largely untested, had a confusing API, and was " +#~ "only useful for Jython support. (Contributed by Nikita Sobolev in :gh:" +#~ "`116349`.)" +#~ msgstr "" +#~ ":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它" +#~ "幾乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita " +#~ "Sobolev 於 :gh:`116349` 貢獻。)" + +#~ msgid "" +#~ ":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " +#~ "deprecated. C version allows any numbers of args and kwargs, but they are " +#~ "just ignored. Python version does not allow any arguments. All arguments " +#~ "will be removed from :func:`threading.RLock` in Python 3.15. (Contributed " +#~ "by Nikita Sobolev in :gh:`102029`.)" +#~ msgstr "" +#~ ":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C " +#~ "版本允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何" +#~ "引數。所有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 " +#~ "Nikita Sobolev 於 :gh:`102029` 貢獻。)" + +#~ msgid "" +#~ "When using the functional syntax to create a :class:`!NamedTuple` class, " +#~ "failing to pass a value to the *fields* parameter (``NT = " +#~ "NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " +#~ "parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both " +#~ "will be disallowed in Python 3.15. To create a :class:`!NamedTuple` class " +#~ "with 0 fields, use ``class NT(NamedTuple): pass`` or ``NT = " +#~ "NamedTuple(\"NT\", [])``." +#~ msgstr "" +#~ "當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參" +#~ "數的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 " +#~ "*fields* 參數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 " +#~ "Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請" +#~ "使用 ``class NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" + +#~ msgid "" +#~ ":class:`typing.TypedDict`: When using the functional syntax to create a :" +#~ "class:`!TypedDict` class, failing to pass a value to the *fields* " +#~ "parameter (``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to " +#~ "the *fields* parameter (``TD = TypedDict(\"TD\", None)``) is also " +#~ "deprecated. Both will be disallowed in Python 3.15. To create a :class:`!" +#~ "TypedDict` class with 0 fields, use ``class TD(TypedDict): pass`` or ``TD " +#~ "= TypedDict(\"TD\", {})``." +#~ msgstr "" +#~ ":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別" +#~ "時,沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄" +#~ "用,將 ``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也" +#~ "已被棄用。這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:" +#~ "`!TypedDict` 類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = " +#~ "TypedDict(\"TD\", {})``。" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index 184a9c07c8..f9dd3fe363 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-26 00:03+0000\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,21 +20,84 @@ msgid "Pending Removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid ":mod:`builtins`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:6 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:13 +msgid ":mod:`array`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:15 +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid ":mod:`shutil`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:23 +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +msgid ":mod:`symtable`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:30 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." msgstr "" -":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改用 " -"``'w'`` 型別 (``Py_UCS4``)。" -#: ../../deprecations/pending-removal-in-3.16.rst:8 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." -msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" +#: ../../deprecations/pending-removal-in-3.16.rst:33 +msgid ":mod:`sys`:" +msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:11 +#: ../../deprecations/pending-removal-in-3.16.rst:35 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:39 +msgid ":mod:`tarfile`:" msgstr "" -":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." -"get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.16.rst:41 +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." +msgstr "" + +#~ msgid "" +#~ ":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use " +#~ "the ``'w'`` type instead (``Py_UCS4``)." +#~ msgstr "" +#~ ":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改" +#~ "用 ``'w'`` 型別 (``Py_UCS4``)。" + +#~ msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#~ msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" + +#~ msgid "" +#~ ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " +#~ "lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +#~ msgstr "" +#~ ":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." +#~ "get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" diff --git a/faq/design.po b/faq/design.po index 0b92963fe7..26224e56c0 100644 --- a/faq/design.po +++ b/faq/design.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-08-31 11:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -650,8 +650,8 @@ msgstr "Python 可以被編譯成機器語言、C 語言或其他種語言嗎? #, fuzzy msgid "" "`Cython `_ compiles a modified version of Python with " -"optional annotations into C extensions. `Nuitka `_ " -"is an up-and-coming compiler of Python into C++ code, aiming to support the " +"optional annotations into C extensions. `Nuitka `_ is " +"an up-and-coming compiler of Python into C++ code, aiming to support the " "full Python language." msgstr "" "`Cython `_ 可以編譯一個調整過有選擇性註解的 Python 版" @@ -682,10 +682,10 @@ msgstr "" #, fuzzy msgid "" "Other implementations (such as `Jython `_ or `PyPy " -"`_), however, can rely on a different mechanism such " -"as a full-blown garbage collector. This difference can cause some subtle " -"porting problems if your Python code depends on the behavior of the " -"reference counting implementation." +"`_), however, can rely on a different mechanism such as a " +"full-blown garbage collector. This difference can cause some subtle porting " +"problems if your Python code depends on the behavior of the reference " +"counting implementation." msgstr "" "然而,在其他實作(像是 `Jython `_ 或 `PyPy `_)中,會使用像是成熟的垃圾收集器等不同機制。如果你的 Python 程式碼" diff --git a/faq/extending.po b/faq/extending.po index f55f34caaf..0d3fb55618 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-02-18 13:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,10 +51,10 @@ msgstr "我可以在 C++ 中建立自己的函式嗎?" #: ../../faq/extending.rst:28 #, fuzzy 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 "" "是的,使用 C++ 中的 C 相容性功能。將 ``extern \"C\" { ... }`` 放在 Python 包" "含檔案周圍,並將 ``extern \"C\"`` 放在每個將由 Python 直譯器呼叫的函式之前。" @@ -467,26 +467,27 @@ msgstr "" #: ../../faq/extending.rst:249 #, fuzzy msgid "" -"Most packaged versions of Python don't include the :file:`/usr/lib/python2." -"{x}/config/` directory, which contains various files required for compiling " +"Most packaged versions of Python omit some files required for compiling " "Python extensions." msgstr "" "大多數打包版本的 Python 不包含 :file:`/usr/lib/python2.{x}/config/` 目錄,該" "目錄包含編譯 Python 擴充所需的各種檔案。" -#: ../../faq/extending.rst:253 -msgid "For Red Hat, install the python-devel RPM to get the necessary files." +#: ../../faq/extending.rst:252 +#, fuzzy +msgid "For Red Hat, install the python3-devel RPM to get the necessary files." msgstr "在 Red Hat 上,請安裝 python-devel RPM 來取得必要的檔案。" -#: ../../faq/extending.rst:255 -msgid "For Debian, run ``apt-get install python-dev``." +#: ../../faq/extending.rst:254 +#, fuzzy +msgid "For Debian, run ``apt-get install python3-dev``." msgstr "對於 Debian,運行 ``apt-get install python-dev``。" -#: ../../faq/extending.rst:258 +#: ../../faq/extending.rst:257 msgid "How do I tell \"incomplete input\" from \"invalid input\"?" msgstr "如何從「無效輸入」區分出「不完整輸入」?" -#: ../../faq/extending.rst:260 +#: ../../faq/extending.rst:259 #, fuzzy msgid "" "Sometimes you want to emulate the Python interactive interpreter's behavior, " @@ -499,7 +500,7 @@ msgstr "" "(例如,你鍵入了 \"if\" 陳述句的開頭或者你沒有關閉你的括號或三重字串引號)," "但是當輸入無效時,它會立即為你提供語法錯誤消息。" -#: ../../faq/extending.rst:266 +#: ../../faq/extending.rst:265 msgid "" "In Python you can use the :mod:`codeop` module, which approximates the " "parser's behavior sufficiently. IDLE uses this, for example." @@ -507,7 +508,7 @@ msgstr "" "在 Python 中,你可以使用 :mod:`codeop` 模組,它充分模擬了剖析器 (parser) 的行" "為。像是 IDLE 就有使用它。" -#: ../../faq/extending.rst:269 +#: ../../faq/extending.rst:268 #, fuzzy msgid "" "The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " @@ -521,11 +522,11 @@ msgstr "" "`PyOS_ReadlineFunctionPointer` 設定為指向你的自定義輸入函式。有關更多提示,請" "參閱``Modules/readline.c`` 和``Parser/myreadline.c``。" -#: ../../faq/extending.rst:276 +#: ../../faq/extending.rst:275 msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" msgstr "如何找到未定義的 g++ 符號 __builtin_new 或 __pure_virtual?" -#: ../../faq/extending.rst:278 +#: ../../faq/extending.rst:277 #, fuzzy msgid "" "To dynamically load g++ extension modules, you must recompile Python, relink " @@ -536,7 +537,7 @@ msgstr "" "Python 模組 Makefile 中的 LINKCC),並使用 g++ 鏈接你的擴充模組(例如,``g++ " "-shared -o mymodule.so mymodule.o` `)。" -#: ../../faq/extending.rst:284 +#: ../../faq/extending.rst:283 #, fuzzy msgid "" "Can I create an object class with some methods implemented in C and others " @@ -545,7 +546,7 @@ msgstr "" "我可以用一些用 C 實作的方法和用 Python 實作的其他方法(例如通過繼承)建立一個" "物件類別嗎?" -#: ../../faq/extending.rst:286 +#: ../../faq/extending.rst:285 msgid "" "Yes, you can inherit from built-in classes such as :class:`int`, :class:" "`list`, :class:`dict`, etc." @@ -553,7 +554,7 @@ msgstr "" "是的,你可以繼承內建類別,例如 :class:`int`、:class:`list`、:class:`dict` " "等。" -#: ../../faq/extending.rst:289 +#: ../../faq/extending.rst:288 msgid "" "The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index." "html) provides a way of doing this from C++ (i.e. you can inherit from an " diff --git a/faq/general.po b/faq/general.po index 95f7688655..ac24b2276b 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-06-23 16:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -614,10 +614,9 @@ msgstr "" #, fuzzy msgid "" "The latest stable releases can always be found on the `Python download page " -"`_. There are two production-ready " -"versions of Python: 2.x and 3.x. The recommended version is 3.x, which is " -"supported by most widely used libraries. Although 2.x is still widely used, " -"`it is not maintained anymore `_." +"`_. Python 3.x is the recommended version " +"and supported by most widely used libraries. Python 2.x :pep:`is not " +"maintained anymore <373>`." msgstr "" "最新的穩定發布版本隨時都可以在 `Python 下載頁面 `_\\ 上找到。Python 有兩個生產就緒 (production-ready) 的版本:2.x " diff --git a/glossary.po b/glossary.po index 076f333c7b..302ad5c3c8 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2533,6 +2533,7 @@ msgid "sequence" msgstr "sequence(序列)" #: ../../glossary.rst:1117 +#, fuzzy msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -2540,8 +2541,8 @@ msgid "" "built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " "and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." "__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " -"sequence because the lookups use arbitrary :term:`immutable` keys rather " -"than integers." +"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" diff --git a/howto/argparse.po b/howto/argparse.po index c8731127a1..7e6cfdf95d 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-12-11 17:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -858,6 +858,7 @@ msgstr "" " print(answer)" #: ../../howto/argparse.rst:434 +#, fuzzy msgid "" "$ python prog.py 4 -v 3\n" "usage: prog.py [-h] [-v {0,1,2}] square\n" @@ -871,7 +872,7 @@ msgid "" "\n" "options:\n" " -h, --help show this help message and exit\n" -" -v {0,1,2}, --verbosity {0,1,2}\n" +" -v, --verbosity {0,1,2}\n" " increase output verbosity" msgstr "" "$ python prog.py 4 -v 3\n" diff --git a/howto/descriptor.po b/howto/descriptor.po index 6cc6a29c8f..973d24eabd 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -583,8 +583,9 @@ msgid "" "\n" " def validate(self, value):\n" " if value not in self.options:\n" -" raise ValueError(f'Expected {value!r} to be one of {self.options!" -"r}')\n" +" raise ValueError(\n" +" f'Expected {value!r} to be one of {self.options!r}'\n" +" )\n" "\n" "class Number(Validator):\n" "\n" @@ -629,15 +630,15 @@ msgid "" " )" msgstr "" -#: ../../howto/descriptor.rst:437 +#: ../../howto/descriptor.rst:439 msgid "Practical application" msgstr "" -#: ../../howto/descriptor.rst:439 +#: ../../howto/descriptor.rst:441 msgid "Here's how the data validators can be used in a real class:" msgstr "" -#: ../../howto/descriptor.rst:441 +#: ../../howto/descriptor.rst:443 msgid "" "class Component:\n" "\n" @@ -651,11 +652,11 @@ msgid "" " self.quantity = quantity" msgstr "" -#: ../../howto/descriptor.rst:454 +#: ../../howto/descriptor.rst:456 msgid "The descriptors prevent invalid instances from being created:" msgstr "" -#: ../../howto/descriptor.rst:456 +#: ../../howto/descriptor.rst:458 msgid "" ">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " "uppercase\n" @@ -673,6 +674,7 @@ msgid "" "Traceback (most recent call last):\n" " ...\n" "ValueError: Expected -5 to be at least 0\n" +"\n" ">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" "Traceback (most recent call last):\n" " ...\n" @@ -681,37 +683,37 @@ msgid "" ">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" msgstr "" -#: ../../howto/descriptor.rst:481 +#: ../../howto/descriptor.rst:484 msgid "Technical Tutorial" msgstr "" -#: ../../howto/descriptor.rst:483 +#: ../../howto/descriptor.rst:486 msgid "" "What follows is a more technical tutorial for the mechanics and details of " "how descriptors work." msgstr "" -#: ../../howto/descriptor.rst:488 +#: ../../howto/descriptor.rst:491 msgid "Abstract" msgstr "摘要" -#: ../../howto/descriptor.rst:490 +#: ../../howto/descriptor.rst:493 msgid "" "Defines descriptors, summarizes the protocol, and shows how descriptors are " "called. Provides an example showing how object relational mappings work." msgstr "" -#: ../../howto/descriptor.rst:493 +#: ../../howto/descriptor.rst:496 msgid "" "Learning about descriptors not only provides access to a larger toolset, it " "creates a deeper understanding of how Python works." msgstr "" -#: ../../howto/descriptor.rst:498 +#: ../../howto/descriptor.rst:501 msgid "Definition and introduction" msgstr "" -#: ../../howto/descriptor.rst:500 +#: ../../howto/descriptor.rst:503 msgid "" "In general, a descriptor is an attribute value that has one of the methods " "in the descriptor protocol. Those methods are :meth:`__get__`, :meth:" @@ -719,7 +721,7 @@ msgid "" "an attribute, it is said to be a :term:`descriptor`." msgstr "" -#: ../../howto/descriptor.rst:505 +#: ../../howto/descriptor.rst:508 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 " @@ -731,7 +733,7 @@ msgid "" "methods were defined." msgstr "" -#: ../../howto/descriptor.rst:514 +#: ../../howto/descriptor.rst:517 msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" @@ -740,30 +742,30 @@ msgid "" "Python programs." msgstr "" -#: ../../howto/descriptor.rst:522 +#: ../../howto/descriptor.rst:525 msgid "Descriptor protocol" msgstr "描述器協定" -#: ../../howto/descriptor.rst:524 +#: ../../howto/descriptor.rst:527 msgid "``descr.__get__(self, obj, type=None)``" msgstr "``descr.__get__(self, obj, type=None)``" -#: ../../howto/descriptor.rst:526 +#: ../../howto/descriptor.rst:529 msgid "``descr.__set__(self, obj, value)``" msgstr "``descr.__set__(self, obj, value)``" -#: ../../howto/descriptor.rst:528 +#: ../../howto/descriptor.rst:531 msgid "``descr.__delete__(self, obj)``" msgstr "``descr.__delete__(self, obj)``" -#: ../../howto/descriptor.rst:530 +#: ../../howto/descriptor.rst:533 msgid "" "That is all there is to it. Define any of these methods and an object is " "considered a descriptor and can override default behavior upon being looked " "up as an attribute." msgstr "" -#: ../../howto/descriptor.rst:534 +#: ../../howto/descriptor.rst:537 msgid "" "If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered " "a data descriptor. Descriptors that only define :meth:`__get__` are called " @@ -771,7 +773,7 @@ msgid "" "possible)." msgstr "" -#: ../../howto/descriptor.rst:539 +#: ../../howto/descriptor.rst:542 msgid "" "Data and non-data descriptors differ in how overrides are calculated with " "respect to entries in an instance's dictionary. If an instance's dictionary " @@ -780,7 +782,7 @@ msgid "" "name as a non-data descriptor, the dictionary entry takes precedence." msgstr "" -#: ../../howto/descriptor.rst:545 +#: ../../howto/descriptor.rst:548 msgid "" "To make a read-only data descriptor, define both :meth:`__get__` and :meth:" "`__set__` with the :meth:`__set__` raising an :exc:`AttributeError` when " @@ -788,23 +790,23 @@ msgid "" "placeholder is enough to make it a data descriptor." msgstr "" -#: ../../howto/descriptor.rst:552 +#: ../../howto/descriptor.rst:555 msgid "Overview of descriptor invocation" msgstr "" -#: ../../howto/descriptor.rst:554 +#: ../../howto/descriptor.rst:557 msgid "" "A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc." "__get__(None, cls)``." msgstr "" -#: ../../howto/descriptor.rst:557 +#: ../../howto/descriptor.rst:560 msgid "" "But it is more common for a descriptor to be invoked automatically from " "attribute access." msgstr "" -#: ../../howto/descriptor.rst:560 +#: ../../howto/descriptor.rst:563 msgid "" "The expression ``obj.x`` looks up the attribute ``x`` in the chain of " "namespaces for ``obj``. If the search finds a descriptor outside of the " @@ -812,17 +814,17 @@ msgid "" "the precedence rules listed below." msgstr "" -#: ../../howto/descriptor.rst:565 +#: ../../howto/descriptor.rst:568 msgid "" "The details of invocation depend on whether ``obj`` is an object, class, or " "instance of super." msgstr "" -#: ../../howto/descriptor.rst:570 +#: ../../howto/descriptor.rst:573 msgid "Invocation from an instance" msgstr "" -#: ../../howto/descriptor.rst:572 +#: ../../howto/descriptor.rst:575 msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " @@ -830,19 +832,19 @@ msgid "" "provided." msgstr "" -#: ../../howto/descriptor.rst:577 +#: ../../howto/descriptor.rst:580 msgid "" "If a descriptor is found for ``a.x``, then it is invoked with: ``desc." "__get__(a, type(a))``." msgstr "" -#: ../../howto/descriptor.rst:580 +#: ../../howto/descriptor.rst:583 msgid "" "The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " "is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:583 +#: ../../howto/descriptor.rst:586 msgid "" "def find_name_in_mro(cls, name, default):\n" " \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" @@ -871,14 +873,14 @@ msgid "" " raise AttributeError(name)" msgstr "" -#: ../../howto/descriptor.rst:719 +#: ../../howto/descriptor.rst:722 msgid "" "Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " "code. That is why calling :meth:`__getattribute__` directly or with " "``super().__getattribute__`` will bypass :meth:`__getattr__` entirely." msgstr "" -#: ../../howto/descriptor.rst:723 +#: ../../howto/descriptor.rst:726 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " "responsible for invoking :meth:`__getattr__` whenever :meth:" @@ -886,7 +888,7 @@ msgid "" "encapsulated in a helper function:" msgstr "" -#: ../../howto/descriptor.rst:728 +#: ../../howto/descriptor.rst:731 msgid "" "def getattr_hook(obj, name):\n" " \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" @@ -906,11 +908,11 @@ msgstr "" " raise\n" " return type(obj).__getattr__(obj, name) # __getattr__" -#: ../../howto/descriptor.rst:773 +#: ../../howto/descriptor.rst:776 msgid "Invocation from a class" msgstr "" -#: ../../howto/descriptor.rst:775 +#: ../../howto/descriptor.rst:778 msgid "" "The logic for a dotted lookup such as ``A.x`` is in :meth:`type." "__getattribute__`. The steps are similar to those for :meth:`object." @@ -918,27 +920,27 @@ msgid "" "through the class's :term:`method resolution order`." msgstr "" -#: ../../howto/descriptor.rst:780 +#: ../../howto/descriptor.rst:783 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" -#: ../../howto/descriptor.rst:782 +#: ../../howto/descriptor.rst:785 msgid "" "The full C implementation can be found in :c:func:`!type_getattro` and :c:" "func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:787 +#: ../../howto/descriptor.rst:790 msgid "Invocation from super" msgstr "" -#: ../../howto/descriptor.rst:789 +#: ../../howto/descriptor.rst:792 msgid "" "The logic for super's dotted lookup is in the :meth:`__getattribute__` " "method for object returned by :func:`super`." msgstr "" -#: ../../howto/descriptor.rst:792 +#: ../../howto/descriptor.rst:795 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " @@ -946,7 +948,7 @@ msgid "" "returned unchanged." msgstr "" -#: ../../howto/descriptor.rst:797 +#: ../../howto/descriptor.rst:800 msgid "" "The full C implementation can be found in :c:func:`!super_getattro` in :" "source:`Objects/typeobject.c`. A pure Python equivalent can be found in " @@ -954,37 +956,37 @@ msgid "" "#cooperation>`_." msgstr "" -#: ../../howto/descriptor.rst:804 +#: ../../howto/descriptor.rst:807 msgid "Summary of invocation logic" msgstr "" -#: ../../howto/descriptor.rst:806 +#: ../../howto/descriptor.rst:809 msgid "" "The mechanism for descriptors is embedded in the :meth:`__getattribute__` " "methods for :class:`object`, :class:`type`, and :func:`super`." msgstr "" -#: ../../howto/descriptor.rst:809 +#: ../../howto/descriptor.rst:812 msgid "The important points to remember are:" msgstr "要記住的重點是:" -#: ../../howto/descriptor.rst:811 +#: ../../howto/descriptor.rst:814 msgid "Descriptors are invoked by the :meth:`__getattribute__` method." msgstr "" -#: ../../howto/descriptor.rst:813 +#: ../../howto/descriptor.rst:816 msgid "" "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" "`super`." msgstr "" -#: ../../howto/descriptor.rst:816 +#: ../../howto/descriptor.rst:819 msgid "" "Overriding :meth:`__getattribute__` prevents automatic descriptor calls " "because all the descriptor logic is in that method." msgstr "" -#: ../../howto/descriptor.rst:819 +#: ../../howto/descriptor.rst:822 msgid "" ":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " "different calls to :meth:`__get__`. The first includes the instance and may " @@ -992,19 +994,19 @@ msgid "" "includes the class." msgstr "" -#: ../../howto/descriptor.rst:824 +#: ../../howto/descriptor.rst:827 msgid "Data descriptors always override instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:826 +#: ../../howto/descriptor.rst:829 msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:830 +#: ../../howto/descriptor.rst:833 msgid "Automatic name notification" msgstr "" -#: ../../howto/descriptor.rst:832 +#: ../../howto/descriptor.rst:835 msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " @@ -1014,38 +1016,38 @@ msgid "" "and the *name* is the class variable the descriptor was assigned to." msgstr "" -#: ../../howto/descriptor.rst:839 +#: ../../howto/descriptor.rst:842 msgid "" "The implementation details are in :c:func:`!type_new` and :c:func:`!" "set_names` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:842 +#: ../../howto/descriptor.rst:845 msgid "" "Since the update logic is in :meth:`type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " "afterwards, :meth:`__set_name__` will need to be called manually." msgstr "" -#: ../../howto/descriptor.rst:848 +#: ../../howto/descriptor.rst:851 msgid "ORM example" msgstr "ORM 範例" -#: ../../howto/descriptor.rst:850 +#: ../../howto/descriptor.rst:853 msgid "" "The following code is a simplified skeleton showing how data descriptors " "could be used to implement an `object relational mapping `_." msgstr "" -#: ../../howto/descriptor.rst:854 +#: ../../howto/descriptor.rst:857 msgid "" "The essential idea is that the data is stored in an external database. The " "Python instances only hold keys to the database's tables. Descriptors take " "care of lookups or updates:" msgstr "" -#: ../../howto/descriptor.rst:858 +#: ../../howto/descriptor.rst:861 msgid "" "class Field:\n" "\n" @@ -1077,14 +1079,14 @@ msgstr "" " conn.execute(self.store, [value, obj.key])\n" " conn.commit()" -#: ../../howto/descriptor.rst:873 +#: ../../howto/descriptor.rst:876 msgid "" "We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" -#: ../../howto/descriptor.rst:877 +#: ../../howto/descriptor.rst:880 msgid "" "class Movie:\n" " table = 'Movies' # Table name\n" @@ -1106,11 +1108,11 @@ msgid "" " self.key = key" msgstr "" -#: ../../howto/descriptor.rst:898 +#: ../../howto/descriptor.rst:901 msgid "To use the models, first connect to the database::" msgstr "" -#: ../../howto/descriptor.rst:900 +#: ../../howto/descriptor.rst:903 msgid "" ">>> import sqlite3\n" ">>> conn = sqlite3.connect('entertainment.db')" @@ -1118,13 +1120,13 @@ msgstr "" ">>> import sqlite3\n" ">>> conn = sqlite3.connect('entertainment.db')" -#: ../../howto/descriptor.rst:903 +#: ../../howto/descriptor.rst:906 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:931 +#: ../../howto/descriptor.rst:934 msgid "" ">>> Movie('Star Wars').director\n" "'George Lucas'\n" @@ -1152,11 +1154,11 @@ msgstr "" ">>> Movie('Star Wars').director\n" "'J.J. Abrams'" -#: ../../howto/descriptor.rst:952 +#: ../../howto/descriptor.rst:955 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:954 +#: ../../howto/descriptor.rst:957 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -1164,27 +1166,27 @@ msgid "" "\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:961 +#: ../../howto/descriptor.rst:964 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:963 +#: ../../howto/descriptor.rst:966 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:966 +#: ../../howto/descriptor.rst:969 msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" msgstr "property(fget=None, fset=None, fdel=None, doc=None) -> property" -#: ../../howto/descriptor.rst:968 +#: ../../howto/descriptor.rst:971 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:970 +#: ../../howto/descriptor.rst:973 msgid "" "class C:\n" " def getx(self): return self.__x\n" @@ -1198,14 +1200,14 @@ msgstr "" " def delx(self): del self.__x\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../howto/descriptor.rst:992 +#: ../../howto/descriptor.rst:995 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent that implements most of the core " "functionality:" msgstr "" -#: ../../howto/descriptor.rst:995 +#: ../../howto/descriptor.rst:998 msgid "" "class Property:\n" " \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" @@ -1217,7 +1219,6 @@ msgid "" " if doc is None and fget is not None:\n" " doc = fget.__doc__\n" " self.__doc__ = doc\n" -" self.__name__ = ''\n" "\n" " def __set_name__(self, owner, name):\n" " self.__name__ = name\n" @@ -1249,14 +1250,14 @@ msgid "" " return type(self)(self.fget, self.fset, fdel, self.__doc__)" msgstr "" -#: ../../howto/descriptor.rst:1120 +#: ../../howto/descriptor.rst:1122 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1124 +#: ../../howto/descriptor.rst:1126 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -1266,7 +1267,7 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1130 +#: ../../howto/descriptor.rst:1132 msgid "" "class Cell:\n" " ...\n" @@ -1278,23 +1279,23 @@ msgid "" " return self._value" msgstr "" -#: ../../howto/descriptor.rst:1141 +#: ../../howto/descriptor.rst:1143 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1146 +#: ../../howto/descriptor.rst:1148 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1148 +#: ../../howto/descriptor.rst:1150 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1151 +#: ../../howto/descriptor.rst:1153 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -1302,13 +1303,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1156 +#: ../../howto/descriptor.rst:1158 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1159 +#: ../../howto/descriptor.rst:1161 msgid "" "class MethodType:\n" " \"Emulate PyMethod_Type in Objects/classobject.c\"\n" @@ -1337,7 +1338,7 @@ msgid "" " return self" msgstr "" -#: ../../howto/descriptor.rst:1187 +#: ../../howto/descriptor.rst:1189 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -1345,7 +1346,7 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1192 +#: ../../howto/descriptor.rst:1194 msgid "" "class Function:\n" " ...\n" @@ -1357,13 +1358,13 @@ msgid "" " return MethodType(self, obj)" msgstr "" -#: ../../howto/descriptor.rst:1203 +#: ../../howto/descriptor.rst:1205 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1206 +#: ../../howto/descriptor.rst:1208 #, fuzzy msgid "" "class D:\n" @@ -1377,12 +1378,12 @@ msgstr "" " def f(self, x):\n" " return x" -#: ../../howto/descriptor.rst:1224 +#: ../../howto/descriptor.rst:1226 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:1228 msgid "" ">>> D.f.__qualname__\n" "'D.f'" @@ -1390,13 +1391,13 @@ msgstr "" ">>> D.f.__qualname__\n" "'D.f'" -#: ../../howto/descriptor.rst:1231 +#: ../../howto/descriptor.rst:1233 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1234 +#: ../../howto/descriptor.rst:1236 msgid "" ">>> D.__dict__['f']\n" "" @@ -1404,13 +1405,13 @@ msgstr "" ">>> D.__dict__['f']\n" "" -#: ../../howto/descriptor.rst:1237 +#: ../../howto/descriptor.rst:1239 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1240 +#: ../../howto/descriptor.rst:1242 msgid "" ">>> D.f\n" "" @@ -1418,13 +1419,13 @@ msgstr "" ">>> D.f\n" "" -#: ../../howto/descriptor.rst:1243 +#: ../../howto/descriptor.rst:1245 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1246 +#: ../../howto/descriptor.rst:1248 msgid "" ">>> d = D()\n" ">>> d.f\n" @@ -1434,13 +1435,13 @@ msgstr "" ">>> d.f\n" ">" -#: ../../howto/descriptor.rst:1250 +#: ../../howto/descriptor.rst:1252 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1253 +#: ../../howto/descriptor.rst:1255 msgid "" ">>> d.f.__func__\n" "\n" @@ -1454,23 +1455,23 @@ msgstr "" ">>> d.f.__self__\n" "<__main__.D object at 0x00B18C90>" -#: ../../howto/descriptor.rst:1259 +#: ../../howto/descriptor.rst:1261 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1264 +#: ../../howto/descriptor.rst:1266 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1266 +#: ../../howto/descriptor.rst:1268 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1269 +#: ../../howto/descriptor.rst:1271 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -1478,55 +1479,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1274 +#: ../../howto/descriptor.rst:1276 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1277 +#: ../../howto/descriptor.rst:1279 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1277 +#: ../../howto/descriptor.rst:1279 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1277 +#: ../../howto/descriptor.rst:1279 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1280 +#: ../../howto/descriptor.rst:1282 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1280 +#: ../../howto/descriptor.rst:1282 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1280 ../../howto/descriptor.rst:1282 +#: ../../howto/descriptor.rst:1282 ../../howto/descriptor.rst:1284 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1282 +#: ../../howto/descriptor.rst:1284 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1284 +#: ../../howto/descriptor.rst:1286 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1284 +#: ../../howto/descriptor.rst:1286 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1284 +#: ../../howto/descriptor.rst:1286 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1289 +#: ../../howto/descriptor.rst:1291 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1291 +#: ../../howto/descriptor.rst:1293 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -1535,13 +1536,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1297 +#: ../../howto/descriptor.rst:1299 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1300 +#: ../../howto/descriptor.rst:1302 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -1550,16 +1551,16 @@ msgid "" "but do not depend on the data. For instance, ``erf(x)`` is handy conversion " "routine that comes up in statistical work but does not directly depend on a " "particular dataset. It can be called either from an object or the class: " -"``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." +"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." msgstr "" -#: ../../howto/descriptor.rst:1309 +#: ../../howto/descriptor.rst:1311 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1312 +#: ../../howto/descriptor.rst:1314 msgid "" "class E:\n" " @staticmethod\n" @@ -1571,7 +1572,7 @@ msgstr "" " def f(x):\n" " return x * 10" -#: ../../howto/descriptor.rst:1319 +#: ../../howto/descriptor.rst:1321 msgid "" ">>> E.f(3)\n" "30\n" @@ -1583,13 +1584,13 @@ msgstr "" ">>> E().f(3)\n" "30" -#: ../../howto/descriptor.rst:1326 +#: ../../howto/descriptor.rst:1328 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1329 +#: ../../howto/descriptor.rst:1331 msgid "" "import functools\n" "\n" @@ -1607,7 +1608,7 @@ msgid "" " return self.f(*args, **kwds)" msgstr "" -#: ../../howto/descriptor.rst:1346 +#: ../../howto/descriptor.rst:1348 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -1616,18 +1617,18 @@ msgid "" "__doc__`, and :attr:`~function.__annotations__`." msgstr "" -#: ../../howto/descriptor.rst:1415 +#: ../../howto/descriptor.rst:1417 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1417 +#: ../../howto/descriptor.rst:1419 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:1421 +#: ../../howto/descriptor.rst:1423 msgid "" "class F:\n" " @classmethod\n" @@ -1639,7 +1640,7 @@ msgstr "" " def f(cls, x):\n" " return cls.__name__, x" -#: ../../howto/descriptor.rst:1428 +#: ../../howto/descriptor.rst:1430 msgid "" ">>> F.f(3)\n" "('F', 3)\n" @@ -1651,7 +1652,7 @@ msgstr "" ">>> F().f(3)\n" "('F', 3)" -#: ../../howto/descriptor.rst:1435 +#: ../../howto/descriptor.rst:1437 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 " @@ -1660,7 +1661,7 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1441 +#: ../../howto/descriptor.rst:1443 msgid "" "class Dict(dict):\n" " @classmethod\n" @@ -1672,11 +1673,11 @@ msgid "" " return d" msgstr "" -#: ../../howto/descriptor.rst:1452 +#: ../../howto/descriptor.rst:1454 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1454 +#: ../../howto/descriptor.rst:1456 msgid "" ">>> d = Dict.fromkeys('abracadabra')\n" ">>> type(d) is Dict\n" @@ -1690,13 +1691,13 @@ msgstr "" ">>> d\n" "{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" -#: ../../howto/descriptor.rst:1462 +#: ../../howto/descriptor.rst:1464 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1465 +#: ../../howto/descriptor.rst:1467 msgid "" "import functools\n" "\n" @@ -1713,7 +1714,7 @@ msgid "" " return MethodType(self.f, cls)" msgstr "" -#: ../../howto/descriptor.rst:1527 +#: ../../howto/descriptor.rst:1529 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -1723,24 +1724,24 @@ msgid "" "__annotations__`." msgstr "" -#: ../../howto/descriptor.rst:1536 +#: ../../howto/descriptor.rst:1538 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1538 +#: ../../howto/descriptor.rst:1540 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:1542 +#: ../../howto/descriptor.rst:1544 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1545 +#: ../../howto/descriptor.rst:1547 msgid "" "class Vehicle:\n" " __slots__ = ('id_number', 'make', 'model')" @@ -1748,7 +1749,7 @@ msgstr "" "class Vehicle:\n" " __slots__ = ('id_number', 'make', 'model')" -#: ../../howto/descriptor.rst:1550 +#: ../../howto/descriptor.rst:1552 msgid "" ">>> auto = Vehicle()\n" ">>> auto.id_nubmer = 'VYE483814LQEX'\n" @@ -1762,13 +1763,13 @@ msgstr "" " ...\n" "AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" -#: ../../howto/descriptor.rst:1558 +#: ../../howto/descriptor.rst:1560 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1561 +#: ../../howto/descriptor.rst:1563 msgid "" "class Immutable:\n" "\n" @@ -1788,7 +1789,7 @@ msgid "" " return self._name" msgstr "" -#: ../../howto/descriptor.rst:1579 +#: ../../howto/descriptor.rst:1581 msgid "" ">>> mark = Immutable('Botany', 'Mark Watney')\n" ">>> mark.dept\n" @@ -1814,7 +1815,7 @@ msgstr "" " ...\n" "AttributeError: 'Immutable' object has no attribute 'location'" -#: ../../howto/descriptor.rst:1593 +#: ../../howto/descriptor.rst:1595 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 " @@ -1822,19 +1823,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1598 +#: ../../howto/descriptor.rst:1600 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:1601 +#: ../../howto/descriptor.rst:1603 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1604 +#: ../../howto/descriptor.rst:1606 msgid "" "from functools import cached_property\n" "\n" @@ -1847,7 +1848,7 @@ msgid "" " for n in reversed(range(100_000)))" msgstr "" -#: ../../howto/descriptor.rst:1616 +#: ../../howto/descriptor.rst:1618 msgid "" ">>> CP().pi\n" "Traceback (most recent call last):\n" @@ -1859,7 +1860,7 @@ msgstr "" " ...\n" "TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." -#: ../../howto/descriptor.rst:1623 +#: ../../howto/descriptor.rst:1625 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 " @@ -1869,7 +1870,7 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1630 +#: ../../howto/descriptor.rst:1632 msgid "" "null = object()\n" "\n" @@ -1908,13 +1909,13 @@ msgid "" " return f''" msgstr "" -#: ../../howto/descriptor.rst:1668 +#: ../../howto/descriptor.rst:1670 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1671 +#: ../../howto/descriptor.rst:1673 msgid "" "class Type(type):\n" " 'Simulate how the type metaclass adds member objects for slots'\n" @@ -1928,14 +1929,14 @@ msgid "" " return type.__new__(mcls, clsname, bases, mapping, **kwargs)" msgstr "" -#: ../../howto/descriptor.rst:1684 +#: ../../howto/descriptor.rst:1686 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:1688 +#: ../../howto/descriptor.rst:1690 msgid "" "class Object:\n" " 'Simulate how object.__new__() allocates memory for __slots__'\n" @@ -1967,13 +1968,13 @@ msgid "" " super().__delattr__(name)" msgstr "" -#: ../../howto/descriptor.rst:1719 +#: ../../howto/descriptor.rst:1721 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:1722 +#: ../../howto/descriptor.rst:1724 msgid "" "class H(Object, metaclass=Type):\n" " 'Instance variables stored in slots'\n" @@ -1985,12 +1986,12 @@ msgid "" " self.y = y" msgstr "" -#: ../../howto/descriptor.rst:1733 +#: ../../howto/descriptor.rst:1735 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1735 +#: ../../howto/descriptor.rst:1737 msgid "" ">>> from pprint import pp\n" ">>> pp(dict(vars(H)))\n" @@ -2010,13 +2011,13 @@ msgstr "" " 'x': ,\n" " 'y': }" -#: ../../howto/descriptor.rst:1754 +#: ../../howto/descriptor.rst:1756 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1757 +#: ../../howto/descriptor.rst:1759 msgid "" ">>> h = H(10, 20)\n" ">>> vars(h)\n" @@ -2032,11 +2033,11 @@ msgstr "" ">>> vars(h)\n" "{'_slotvalues': [55, 20]}" -#: ../../howto/descriptor.rst:1766 +#: ../../howto/descriptor.rst:1768 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" -#: ../../howto/descriptor.rst:1768 +#: ../../howto/descriptor.rst:1770 msgid "" ">>> h.xz\n" "Traceback (most recent call last):\n" diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index 08d6aaa97a..a71d38d7bb 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -303,11 +303,11 @@ msgid "" "to provide implementations of these functions for older Python versions." msgstr "" -#: ../../howto/free-threading-extensions.rst:185 +#: ../../howto/free-threading-extensions.rst:187 msgid "Memory Allocation APIs" msgstr "" -#: ../../howto/free-threading-extensions.rst:187 +#: ../../howto/free-threading-extensions.rst:189 msgid "" "Python's memory management C API provides functions in three different :ref:" "`allocation domains `: \"raw\", \"mem\", and \"object\". " @@ -317,36 +317,36 @@ msgid "" "where this was only a best practice and not a hard requirement." msgstr "" -#: ../../howto/free-threading-extensions.rst:196 +#: ../../howto/free-threading-extensions.rst:198 msgid "" "Search for uses of :c:func:`PyObject_Malloc` in your extension and check " "that the allocated memory is used for Python objects. Use :c:func:" "`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." msgstr "" -#: ../../howto/free-threading-extensions.rst:203 +#: ../../howto/free-threading-extensions.rst:205 msgid "Thread State and GIL APIs" msgstr "" -#: ../../howto/free-threading-extensions.rst:205 +#: ../../howto/free-threading-extensions.rst:207 msgid "" "Python provides a set of functions and macros to manage thread state and the " "GIL, such as:" msgstr "" -#: ../../howto/free-threading-extensions.rst:208 +#: ../../howto/free-threading-extensions.rst:210 msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" msgstr "" -#: ../../howto/free-threading-extensions.rst:209 +#: ../../howto/free-threading-extensions.rst:211 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" msgstr "" -#: ../../howto/free-threading-extensions.rst:210 +#: ../../howto/free-threading-extensions.rst:212 msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" msgstr "" -#: ../../howto/free-threading-extensions.rst:212 +#: ../../howto/free-threading-extensions.rst:214 msgid "" "These functions should still be used in the free-threaded build to manage " "thread state even when the :term:`GIL` is disabled. For example, if you " @@ -355,7 +355,7 @@ msgid "" "Python thread state." msgstr "" -#: ../../howto/free-threading-extensions.rst:218 +#: ../../howto/free-threading-extensions.rst:220 msgid "" "You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" "`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " @@ -363,25 +363,25 @@ msgid "" "collector `." msgstr "" -#: ../../howto/free-threading-extensions.rst:225 +#: ../../howto/free-threading-extensions.rst:227 msgid "Protecting Internal Extension State" msgstr "" -#: ../../howto/free-threading-extensions.rst:227 +#: ../../howto/free-threading-extensions.rst:229 msgid "" "Your extension may have internal state that was previously protected by the " "GIL. You may need to add locking to protect this state. The approach will " "depend on your extension, but some common patterns include:" msgstr "" -#: ../../howto/free-threading-extensions.rst:231 +#: ../../howto/free-threading-extensions.rst:233 msgid "" "**Caches**: global caches are a common source of shared state. Consider " "using a lock to protect the cache or disabling it in the free-threaded build " "if the cache is not critical for performance." msgstr "" -#: ../../howto/free-threading-extensions.rst:234 +#: ../../howto/free-threading-extensions.rst:236 msgid "" "**Global State**: global state may need to be protected by a lock or moved " "to thread local storage. C11 and C++11 provide the ``thread_local`` or " @@ -389,34 +389,34 @@ msgid "" "language/storage_duration>`_." msgstr "" -#: ../../howto/free-threading-extensions.rst:241 +#: ../../howto/free-threading-extensions.rst:243 msgid "Building Extensions for the Free-Threaded Build" msgstr "" -#: ../../howto/free-threading-extensions.rst:243 +#: ../../howto/free-threading-extensions.rst:245 msgid "" "C API extensions need to be built specifically for the free-threaded build. " "The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." msgstr "" -#: ../../howto/free-threading-extensions.rst:246 +#: ../../howto/free-threading-extensions.rst:248 msgid "" "`pypa/manylinux `_ supports the free-" "threaded build, with the ``t`` suffix, such as ``python3.13t``." msgstr "" -#: ../../howto/free-threading-extensions.rst:248 +#: ../../howto/free-threading-extensions.rst:250 msgid "" "`pypa/cibuildwheel `_ supports the " "free-threaded build if you set `CIBW_FREE_THREADED_SUPPORT `_." msgstr "" -#: ../../howto/free-threading-extensions.rst:253 +#: ../../howto/free-threading-extensions.rst:255 msgid "Limited C API and Stable ABI" msgstr "" -#: ../../howto/free-threading-extensions.rst:255 +#: ../../howto/free-threading-extensions.rst:257 msgid "" "The free-threaded build does not currently support the :ref:`Limited C API " "` or the stable ABI. If you use `setuptools `_: A community-maintained porting guide for " diff --git a/library/argparse.po b/library/argparse.po index 726a5ed8f2..8c2959c432 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2614,7 +2614,7 @@ msgid "" "argument of :meth:`~ArgumentParser.add_argument`, which defaults to " "``False``, specifies if the argument is deprecated and will be removed in " "the future. For arguments, if ``deprecated`` is ``True``, then a warning " -"will be printed to standard error when the argument is used::" +"will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" #: ../../library/argparse.rst:1460 @@ -3858,8 +3858,8 @@ msgstr "" #: ../../library/argparse.rst:2237 msgid "" "This method terminates the program, exiting with the specified *status* and, " -"if given, it prints a *message* before that. The user can override this " -"method to handle these steps differently::" +"if given, it prints a *message* to :data:`sys.stderr` before that. The user " +"can override this method to handle these steps differently::" msgstr "" #: ../../library/argparse.rst:2241 @@ -3878,8 +3878,8 @@ msgstr "" #: ../../library/argparse.rst:2249 msgid "" -"This method prints a usage message including the *message* to the standard " -"error and terminates the program with a status code of 2." +"This method prints a usage message, including the *message*, to :data:`sys." +"stderr` and terminates the program with a status code of 2." msgstr "" #: ../../library/argparse.rst:2254 diff --git a/library/ast.po b/library/ast.po index 4a81075034..0eb49e1a68 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3359,12 +3359,12 @@ msgstr "" msgid "``returns`` is the return annotation." msgstr "``returns`` 是回傳註釋。" -#: ../../library/ast.rst:1877 ../../library/ast.rst:2041 +#: ../../library/ast.rst:1877 ../../library/ast.rst:2040 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "``type_params`` 是\\ :ref:`型別參數 `\\ 的串列。" -#: ../../library/ast.rst:1883 ../../library/ast.rst:2068 -#: ../../library/ast.rst:2079 +#: ../../library/ast.rst:1883 ../../library/ast.rst:2067 +#: ../../library/ast.rst:2078 msgid "Added ``type_params``." msgstr "新增了 ``type_params``。" @@ -3656,23 +3656,23 @@ msgstr "``bases`` 是被顯式指定的基底類別節點串列。" #, fuzzy msgid "" "``keywords`` is a list of :class:`.keyword` nodes, principally for " -"'metaclass'. Other keywords will be passed to the metaclass, as per " -"`PEP-3115 `_." +"'metaclass'. Other keywords will be passed to the metaclass, as per :pep:" +"`3115`." msgstr "" "``keywords`` 是一個 :class:`.keyword` 節點的串列,主要用於 'metaclass'(元類" "別)。如 :pep:`3115` 所述,其他關鍵字將被傳遞到 metaclass。" -#: ../../library/ast.rst:2038 +#: ../../library/ast.rst:2037 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "``body`` 是表示類別定義中程式碼的節點串列。" -#: ../../library/ast.rst:2040 +#: ../../library/ast.rst:2039 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "``decorator_list`` 是一個節點串列,如 :class:`FunctionDef` 中所示。" -#: ../../library/ast.rst:2043 +#: ../../library/ast.rst:2042 #, fuzzy msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -3723,17 +3723,17 @@ msgstr "" " type_params=[])],\n" " type_ignores=[])" -#: ../../library/ast.rst:2072 +#: ../../library/ast.rst:2071 msgid "Async and await" msgstr "async 和 await" -#: ../../library/ast.rst:2076 +#: ../../library/ast.rst:2075 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "一個 ``async def`` 函式定義。與 :class:`FunctionDef` 具有相同的欄位。" -#: ../../library/ast.rst:2085 +#: ../../library/ast.rst:2084 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." @@ -3741,7 +3741,7 @@ msgstr "" "一個 ``await`` 運算式。``value`` 是它等待的東西。僅在 :class:" "`AsyncFunctionDef` 主體 (body) 中有效。" -#: ../../library/ast.rst:2088 +#: ../../library/ast.rst:2087 #, fuzzy msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -3784,7 +3784,7 @@ msgstr "" " type_params=[])],\n" " type_ignores=[])" -#: ../../library/ast.rst:2109 +#: ../../library/ast.rst:2108 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 " @@ -3793,7 +3793,7 @@ msgstr "" "``async for`` 迴圈和 ``async with`` 情境管理器。它們分別具有與 :class:`For` " "和 :class:`With` 相同的欄位。僅在 :class:`AsyncFunctionDef` 主體中有效。" -#: ../../library/ast.rst:2114 +#: ../../library/ast.rst:2113 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." @@ -3806,11 +3806,11 @@ msgstr "" "boolop` 和 :class:`ast.expr_context`\\ )將是單例。對其中之一的更改將反映在所" "有其他出現的相同值中(例如 :class:`ast.Add`\\ )。" -#: ../../library/ast.rst:2122 +#: ../../library/ast.rst:2121 msgid ":mod:`ast` Helpers" msgstr ":mod:`ast` 輔助程式" -#: ../../library/ast.rst:2124 +#: ../../library/ast.rst:2123 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" @@ -3818,7 +3818,7 @@ msgstr "" "除了節點類別之外,:mod:`ast` 模組還定義了這些用於遍歷 (traverse) 抽象語法樹的" "實用函式和類別:" -#: ../../library/ast.rst:2129 +#: ../../library/ast.rst:2128 #, fuzzy msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " @@ -3829,7 +3829,7 @@ msgstr "" "將原始碼剖析為 AST 節點。相當於 ``compile(source, filename, mode, ast." "PyCF_ONLY_AST)``。" -#: ../../library/ast.rst:2134 +#: ../../library/ast.rst:2133 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 " @@ -3848,7 +3848,7 @@ msgstr "" "``None``。此外,``# type: ignore`` 註釋的位置將作為 :class:`Module` 的 " "``type_ignores`` 屬性回傳(否則它始終是一個空串列)。" -#: ../../library/ast.rst:2144 +#: ../../library/ast.rst:2143 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) -> " @@ -3858,7 +3858,7 @@ msgstr "" "名型別註解 (signature type comments)」而被修改,例如 ``(str, int) -> " "List[str]``。" -#: ../../library/ast.rst:2148 +#: ../../library/ast.rst:2147 #, fuzzy msgid "" "Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " @@ -3879,12 +3879,12 @@ msgstr "" "能保證剖析(或剖析的成功)與在與 ``feature_version`` 對應的 Python 版本上運行" "時相同。" -#: ../../library/ast.rst:2158 +#: ../../library/ast.rst:2157 msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "如果來源包含 null 字元 (``\\0``),則會引發 :exc:`ValueError`。" -#: ../../library/ast.rst:2161 +#: ../../library/ast.rst:2160 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 " @@ -3898,14 +3898,14 @@ msgstr "" "原始的 ``return 42`` 為 return 陳述式生成一個有效的 AST 節點,但它不能單獨編" "譯(它需要位於函式節點內)。" -#: ../../library/ast.rst:2168 +#: ../../library/ast.rst:2167 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" "特別是 :func:`ast.parse` 不會執行任何範圍檢查,而編譯步驟才會執行此操作。" -#: ../../library/ast.rst:2172 +#: ../../library/ast.rst:2171 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." @@ -3913,17 +3913,17 @@ msgstr "" "由於 Python AST 編譯器中的堆疊 (stack) 深度限制,太大或太複雜的字串可能會導" "致 Python 直譯器崩潰。" -#: ../../library/ast.rst:2176 +#: ../../library/ast.rst:2175 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "新增 ``type_comments``、``mode='func_type'`` 與 ``feature_version``。" -#: ../../library/ast.rst:2179 +#: ../../library/ast.rst:2178 msgid "" "The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " "``optimize`` argument was added." msgstr "" -#: ../../library/ast.rst:2186 +#: ../../library/ast.rst:2185 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 :" @@ -3932,7 +3932,7 @@ msgstr "" "反剖析 :class:`ast.AST` 物件並生成一個帶有程式碼的字串,如果使用 :func:`ast." "parse` 剖析回來,該程式碼將生成等效的 :class:`ast.AST` 物件。" -#: ../../library/ast.rst:2191 +#: ../../library/ast.rst:2190 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " @@ -3941,13 +3941,13 @@ msgstr "" "生成的程式碼字串不一定等於生成 :class:`ast.AST` 物件的原始程式碼(沒有任何編" "譯器最佳化,例如常數元組/凍結集合)。" -#: ../../library/ast.rst:2196 +#: ../../library/ast.rst:2195 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "嘗試剖析高度複雜的運算式會導致 :exc:`RecursionError`。" -#: ../../library/ast.rst:2204 +#: ../../library/ast.rst:2203 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 " @@ -3958,7 +3958,7 @@ msgstr "" "能包含以下 Python 文本結構:字串、位元組、數字、元組、串列、字典、集合、布林" "值、``None`` 和 ``Ellipsis``。" -#: ../../library/ast.rst:2209 +#: ../../library/ast.rst:2208 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 " @@ -3967,7 +3967,7 @@ msgstr "" "這可用於為包含 Python 值的字串求值,而無需自己剖析這些值。它無法計算任意複雜" "的運算式,例如涉及運算子或索引。" -#: ../../library/ast.rst:2214 +#: ../../library/ast.rst:2213 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 " @@ -3984,13 +3984,13 @@ msgstr "" "盡或 C 堆疊耗盡,從而導致行程崩潰。某些輸入也可能會出現 CPU 消耗過多而導致拒" "絕服務的情況。因此不建議在不受信任的資料上呼叫它。" -#: ../../library/ast.rst:2224 +#: ../../library/ast.rst:2223 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "由於 Python AST 編譯器的堆疊深度限制,Python 直譯器可能會崩潰。" -#: ../../library/ast.rst:2227 +#: ../../library/ast.rst:2226 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." @@ -3998,19 +3998,19 @@ msgstr "" "它可能會引發 :exc:`ValueError`、:exc:`TypeError`、:exc:`SyntaxError`、:exc:" "`MemoryError` 和 :exc:`RecursionError`,具體取決於格式錯誤的輸入。" -#: ../../library/ast.rst:2231 +#: ../../library/ast.rst:2230 msgid "Now allows bytes and set literals." msgstr "現在允許位元組和集合文本 (set literal)。" -#: ../../library/ast.rst:2234 +#: ../../library/ast.rst:2233 msgid "Now supports creating empty sets with ``'set()'``." msgstr "現在支援使用 ``'set()'`` 建立空集合。" -#: ../../library/ast.rst:2237 +#: ../../library/ast.rst:2236 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "對於字串輸入,前導空格和定位字元 (tab) 現在已被去除。" -#: ../../library/ast.rst:2243 +#: ../../library/ast.rst:2242 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -4022,11 +4022,11 @@ msgstr "" "件字串則為 ``None``。如果 *clean* 為 true,則使用 :func:`inspect.cleandoc` 清" "理文件字串的縮排。" -#: ../../library/ast.rst:2249 +#: ../../library/ast.rst:2248 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`。" -#: ../../library/ast.rst:2255 +#: ../../library/ast.rst:2254 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" @@ -4037,7 +4037,7 @@ msgstr "" "lineno`、:attr:`~ast.AST.end_lineno`、:attr:`~ast.AST.col_offset` 或 :attr:" "`~ast.AST.end_col_offset`\\ )遺漏,則回傳 ``None``。" -#: ../../library/ast.rst:2259 +#: ../../library/ast.rst:2258 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." @@ -4045,7 +4045,7 @@ msgstr "" "如果 *padded* 為 ``True``,則多列陳述式的第一列將用空格填充 (padded) 以匹配其" "原始位置。" -#: ../../library/ast.rst:2267 +#: ../../library/ast.rst:2266 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " @@ -4059,7 +4059,7 @@ msgstr "" "要存在。填入生成的節點相當繁瑣,因此該輔助工具透過將這些屬性設定為父節點的" "值,在尚未設定的地方遞迴地新增這些屬性。它從 *node* 開始遞迴地作用。" -#: ../../library/ast.rst:2276 +#: ../../library/ast.rst:2275 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 " @@ -4068,7 +4068,7 @@ msgstr "" "將樹中從 *node* 開始的每個節點的列號和結束列號增加 *n*。這對於「移動程式碼」" "到檔案中的不同位置很有用。" -#: ../../library/ast.rst:2283 +#: ../../library/ast.rst:2282 msgid "" "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " @@ -4078,7 +4078,7 @@ msgstr "" "attr:`~ast.AST.end_lineno` 和 :attr:`~ast.AST.end_col_offset` )從 " "*old_node* 複製到 *new_node*,並回傳 *new_node* 。" -#: ../../library/ast.rst:2290 +#: ../../library/ast.rst:2289 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." @@ -4086,7 +4086,7 @@ msgstr "" "為 *node* 上存在的 ``node._fields`` 中的每個欄位生成一個 ``(fieldname, " "value)`` 元組。" -#: ../../library/ast.rst:2296 +#: ../../library/ast.rst:2295 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." @@ -4094,7 +4094,7 @@ msgstr "" "生成 *node* 的所有直接子節點,即作為節點的所有欄位以及作為節點串列欄位的所有" "項目。" -#: ../../library/ast.rst:2302 +#: ../../library/ast.rst:2301 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " @@ -4103,7 +4103,7 @@ msgstr "" "遞迴地生成樹中從 *node* 開始的所有後代節點(包括 *node* 本身),不按指定順" "序。如果你只想就地修改節點而不關心情境,這非常有用。" -#: ../../library/ast.rst:2309 +#: ../../library/ast.rst:2308 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 " @@ -4112,13 +4112,13 @@ msgstr "" "節點訪問者基底類別,它遍歷抽象語法樹並為找到的每個節點呼叫訪問者函式。該函式" "可能會回傳一個由 :meth:`visit` 方法轉發的值。" -#: ../../library/ast.rst:2313 +#: ../../library/ast.rst:2312 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "這個類別應該被子類別化,子類別新增訪問者方法。" -#: ../../library/ast.rst:2318 +#: ../../library/ast.rst:2317 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " @@ -4128,11 +4128,11 @@ msgstr "" "*classname* 是節點類別的名稱,或者在該方法不存在時呼叫 :meth:" "`generic_visit`。" -#: ../../library/ast.rst:2324 +#: ../../library/ast.rst:2323 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "該訪問者對該節點的所有子節點呼叫 :meth:`visit`。" -#: ../../library/ast.rst:2326 +#: ../../library/ast.rst:2325 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." @@ -4140,11 +4140,11 @@ msgstr "" "請注意,除非訪問者呼叫 :meth:`generic_visit` 或訪問它們本身,否則不會訪問具有" "自定義訪問者方法的節點之子節點。" -#: ../../library/ast.rst:2332 +#: ../../library/ast.rst:2331 msgid "Handles all constant nodes." msgstr "處理所有常數節點。" -#: ../../library/ast.rst:2334 +#: ../../library/ast.rst:2333 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" @@ -4154,7 +4154,7 @@ msgstr "" "`NodeVisitor`。為此,有個允許修改的特殊遍歷訪問者工具 :class:" "`NodeTransformer`。" -#: ../../library/ast.rst:2340 +#: ../../library/ast.rst:2339 msgid "" "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" "`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " @@ -4165,13 +4165,13 @@ msgstr "" "visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法現已棄用,並且不會在未來的" "Python 版本中被呼叫。新增 :meth:`visit_Constant` 方法來處理所有常數節點。" -#: ../../library/ast.rst:2348 +#: ../../library/ast.rst:2347 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "一個 :class:`NodeVisitor` 子類別,它會遍歷抽象語法樹並允許修改節點。" -#: ../../library/ast.rst:2351 +#: ../../library/ast.rst:2350 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 " @@ -4183,7 +4183,7 @@ msgstr "" "點。如果訪問者方法的回傳值為 ``None``,則該節點將從其位置中刪除,否則將被替換" "為回傳值。回傳值可能是原始節點,在這種情況下不會發生替換。" -#: ../../library/ast.rst:2357 +#: ../../library/ast.rst:2356 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" @@ -4191,7 +4191,7 @@ msgstr "" "下面是一個示範用的 transformer,它將查找所有出現名稱 (``foo``) 並改寫為 " "``data['foo']``: ::" -#: ../../library/ast.rst:2360 +#: ../../library/ast.rst:2359 msgid "" "class RewriteName(NodeTransformer):\n" "\n" @@ -4211,7 +4211,7 @@ msgstr "" " ctx=node.ctx\n" " )" -#: ../../library/ast.rst:2369 +#: ../../library/ast.rst:2368 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:`~ast." @@ -4220,7 +4220,7 @@ msgstr "" "請記住,如果你正在操作的節點有子節點,你必須自己轉換子節點或先呼叫該節點的 :" "meth:`~ast.NodeVisitor.generic_visit` 方法。" -#: ../../library/ast.rst:2373 +#: ../../library/ast.rst:2372 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 " @@ -4229,7 +4229,7 @@ msgstr "" "對於屬於陳述式總集 (collection) 一部分的節點(適用於所有陳述式節點),訪問者" "還可以回傳節點串列,而不僅僅是單個節點。" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2376 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:`~ast." @@ -4240,7 +4240,7 @@ msgstr "" "它們提供位置資訊(例如 :attr:`~ast.AST.lineno`\\ ),則應使用新的子樹呼叫 :" "func:`fix_missing_locations` 以重新計算位置資訊: ::" -#: ../../library/ast.rst:2382 +#: ../../library/ast.rst:2381 msgid "" "tree = ast.parse('foo', mode='eval')\n" "new_tree = fix_missing_locations(RewriteName().visit(tree))" @@ -4248,15 +4248,15 @@ msgstr "" "tree = ast.parse('foo', mode='eval')\n" "new_tree = fix_missing_locations(RewriteName().visit(tree))" -#: ../../library/ast.rst:2385 +#: ../../library/ast.rst:2384 msgid "Usually you use the transformer like this::" msgstr "你通常會像這樣使用 transformer: ::" -#: ../../library/ast.rst:2387 +#: ../../library/ast.rst:2386 msgid "node = YourTransformer().visit(node)" msgstr "node = YourTransformer().visit(node)" -#: ../../library/ast.rst:2392 +#: ../../library/ast.rst:2391 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 " @@ -4272,7 +4272,7 @@ msgstr "" "潔。預設情況下,不會傾印列號和行偏移量等屬性。如果需要,可以設定 " "*include_attributes* 為 true。" -#: ../../library/ast.rst:2400 +#: ../../library/ast.rst:2399 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 " @@ -4286,22 +4286,22 @@ msgstr "" "(預設值)代表選擇單列表示。使用正整數縮排可以在每個級別縮排相同數量的空格。" "如果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個級別。" -#: ../../library/ast.rst:2407 +#: ../../library/ast.rst:2406 msgid "" "If *show_empty* is ``False`` (the default), empty lists and fields that are " "``None`` will be omitted from the output." msgstr "" -#: ../../library/ast.rst:2410 +#: ../../library/ast.rst:2409 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2413 +#: ../../library/ast.rst:2412 #, fuzzy msgid "Added the *show_empty* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2416 +#: ../../library/ast.rst:2415 #, fuzzy msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" @@ -4354,17 +4354,17 @@ msgstr "" " type_params=[])],\n" " type_ignores=[])" -#: ../../library/ast.rst:2447 +#: ../../library/ast.rst:2446 msgid "Compiler Flags" msgstr "編譯器旗標" -#: ../../library/ast.rst:2449 +#: ../../library/ast.rst:2448 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "可以將以下旗標傳遞給 :func:`compile` 以變更對程式的編譯效果:" -#: ../../library/ast.rst:2454 +#: ../../library/ast.rst:2453 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." @@ -4372,19 +4372,19 @@ msgstr "" "啟用對最高階 ``await``、``async for``、``async with`` 和非同步綜合運算的支" "援。" -#: ../../library/ast.rst:2461 +#: ../../library/ast.rst:2460 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "生成並回傳抽象語法樹,而不是回傳已編譯的程式碼物件。" -#: ../../library/ast.rst:2466 +#: ../../library/ast.rst:2465 msgid "" "The returned AST is optimized according to the *optimize* argument in :func:" "`compile` or :func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:2473 +#: ../../library/ast.rst:2472 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." @@ -4392,47 +4392,47 @@ msgstr "" "啟用對 :pep:`484` 和 :pep:`526` 樣式型別註釋的支援 (``# type: ``, ``# " "type: ignore ``)。" -#: ../../library/ast.rst:2482 +#: ../../library/ast.rst:2481 msgid "Command-Line Usage" msgstr "命令列用法" -#: ../../library/ast.rst:2486 +#: ../../library/ast.rst:2485 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr ":mod:`ast` 模組可以作為腳本從命令列執行,可以像這樣簡單地做到:" -#: ../../library/ast.rst:2489 +#: ../../library/ast.rst:2488 msgid "python -m ast [-m ] [-a] [infile]" msgstr "python -m ast [-m ] [-a] [infile]" -#: ../../library/ast.rst:2493 +#: ../../library/ast.rst:2492 msgid "The following options are accepted:" msgstr "以下選項可被接受:" -#: ../../library/ast.rst:2499 +#: ../../library/ast.rst:2498 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/ast.rst:2504 +#: ../../library/ast.rst:2503 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "指定必須編譯哪種類型的程式碼,像是 :func:`parse` 中的 *mode* 引數。" -#: ../../library/ast.rst:2509 +#: ../../library/ast.rst:2508 msgid "Don't parse type comments." msgstr "不要剖析型別註解。" -#: ../../library/ast.rst:2513 +#: ../../library/ast.rst:2512 msgid "Include attributes such as line numbers and column offsets." msgstr "包括列號和行偏移量等屬性。" -#: ../../library/ast.rst:2518 +#: ../../library/ast.rst:2517 msgid "Indentation of nodes in AST (number of spaces)." msgstr "AST 中節點的縮進(空格數)。" -#: ../../library/ast.rst:2520 +#: ../../library/ast.rst:2519 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." @@ -4440,7 +4440,7 @@ msgstr "" "如果指定了 :file:`infile`,則其內容將被剖析為 AST 並傾印 (dump) 到 stdout。否" "則會從 stdin 讀取內容。" -#: ../../library/ast.rst:2526 +#: ../../library/ast.rst:2525 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." @@ -4448,7 +4448,7 @@ msgstr "" "`Green Tree Snakes `_ 是一個外部文件" "資源,提供了有關使用 Python AST 的詳細資訊。" -#: ../../library/ast.rst:2529 +#: ../../library/ast.rst:2528 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -4459,7 +4459,7 @@ msgstr "" "用生成它們的原始碼中的標記和文本的位置來註釋 Python AST。這對於進行原始碼轉換" "的工具很有幫助。" -#: ../../library/ast.rst:2534 +#: ../../library/ast.rst:2533 msgid "" "`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " @@ -4469,7 +4469,7 @@ msgstr "" "py>`_ 透過在 token 和 ast 節點之間插入雙向鏈結,統一了 python 程式的基於 " "token 和基於剖析樹的視圖。" -#: ../../library/ast.rst:2539 +#: ../../library/ast.rst:2538 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " @@ -4479,7 +4479,7 @@ msgstr "" "(Concrete Syntax Tree),看起來像 ast 樹並保留所有格式詳細資訊。它對於建置自動" "重構 (codemod) 應用程式和 linter 非常有用。" -#: ../../library/ast.rst:2544 +#: ../../library/ast.rst:2543 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/ctypes.po b/library/ctypes.po index 048c245976..4d41b963bb 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,8 +83,8 @@ msgstr "" #: ../../library/ctypes.rst:53 msgid "" "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " -"C library containing most standard C functions, and uses the cdecl calling " -"convention::" +"C library containing most standard C functions, and uses the ``cdecl`` " +"calling convention::" msgstr "" #: ../../library/ctypes.rst:57 diff --git a/library/curses.po b/library/curses.po index e2707a4f1a..963eaac381 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -40,16 +40,14 @@ msgid "" "curses library hosted on Linux and the BSD variants of Unix." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:5 +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" #: ../../library/curses.rst:28 diff --git a/library/dbm.po b/library/dbm.po index c93cd0d4b0..d22ea3490f 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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,56 +50,44 @@ msgid "" "`_ to the Oracle Berkeley DB." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." -msgstr "" - -#: ../../includes/wasm-ios-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." -msgstr "" - -#: ../../library/dbm.rst:26 +#: ../../library/dbm.rst:24 msgid "" "A tuple containing the exceptions that can be raised by each of the " "supported modules, with a unique exception also named :exc:`dbm.error` as " "the first item --- the latter is used when :exc:`dbm.error` is raised." msgstr "" -#: ../../library/dbm.rst:33 +#: ../../library/dbm.rst:31 msgid "" "This function attempts to guess which of the several simple database modules " "available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" "`dbm.dumb` --- should be used to open a given file." msgstr "" -#: ../../library/dbm.rst:37 +#: ../../library/dbm.rst:35 msgid "Return one of the following values:" msgstr "回傳以下其中一個值:" -#: ../../library/dbm.rst:39 +#: ../../library/dbm.rst:37 msgid "" "``None`` if the file can't be opened because it's unreadable or doesn't exist" msgstr "" -#: ../../library/dbm.rst:40 +#: ../../library/dbm.rst:38 msgid "the empty string (``''``) if the file's format can't be guessed" msgstr "" -#: ../../library/dbm.rst:41 +#: ../../library/dbm.rst:39 msgid "" "a string containing the required module name, such as ``'dbm.ndbm'`` or " "``'dbm.gnu'``" msgstr "" -#: ../../library/dbm.rst:43 ../../library/dbm.rst:248 ../../library/dbm.rst:444 +#: ../../library/dbm.rst:41 ../../library/dbm.rst:250 ../../library/dbm.rst:448 msgid "*filename* accepts a :term:`path-like object`." msgstr "" -#: ../../library/dbm.rst:67 +#: ../../library/dbm.rst:65 msgid "Open a database and return the corresponding database object." msgstr "" @@ -107,7 +95,7 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/dbm.rst:69 +#: ../../library/dbm.rst:67 msgid "" "The database file to open. If the database file already exists, the :func:" "`whichdb` function is used to determine its type and the appropriate module " @@ -115,18 +103,18 @@ msgid "" "imported is used." msgstr "" -#: ../../library/dbm.rst:70 ../../library/dbm.rst:220 +#: ../../library/dbm.rst:68 ../../library/dbm.rst:222 msgid "The database file to open." msgstr "要打開的資料庫檔案" -#: ../../library/dbm.rst:72 +#: ../../library/dbm.rst:70 msgid "" "If the database file already exists, the :func:`whichdb` function is used to " "determine its type and the appropriate module is used; if it does not exist, " "the first submodule listed above that can be imported is used." msgstr "" -#: ../../library/dbm.rst:77 ../../library/dbm.rst:178 ../../library/dbm.rst:349 +#: ../../library/dbm.rst:75 ../../library/dbm.rst:178 ../../library/dbm.rst:353 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" @@ -134,36 +122,36 @@ msgstr "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:78 ../../library/dbm.rst:180 ../../library/dbm.rst:225 -#: ../../library/dbm.rst:350 +#: ../../library/dbm.rst:76 ../../library/dbm.rst:180 ../../library/dbm.rst:227 +#: ../../library/dbm.rst:354 msgid "``'r'`` (default): |flag_r|" msgstr "``'r'`` (default): |flag_r|" -#: ../../library/dbm.rst:79 ../../library/dbm.rst:181 ../../library/dbm.rst:226 -#: ../../library/dbm.rst:351 ../../library/dbm.rst:425 +#: ../../library/dbm.rst:77 ../../library/dbm.rst:181 ../../library/dbm.rst:228 +#: ../../library/dbm.rst:355 ../../library/dbm.rst:429 msgid "``'w'``: |flag_w|" msgstr "``'w'``: |flag_w|" -#: ../../library/dbm.rst:80 ../../library/dbm.rst:182 ../../library/dbm.rst:227 -#: ../../library/dbm.rst:352 +#: ../../library/dbm.rst:78 ../../library/dbm.rst:182 ../../library/dbm.rst:229 +#: ../../library/dbm.rst:356 msgid "``'c'``: |flag_c|" msgstr "``'c'``: |flag_c|" -#: ../../library/dbm.rst:81 ../../library/dbm.rst:183 ../../library/dbm.rst:228 -#: ../../library/dbm.rst:353 ../../library/dbm.rst:427 +#: ../../library/dbm.rst:79 ../../library/dbm.rst:183 ../../library/dbm.rst:230 +#: ../../library/dbm.rst:357 ../../library/dbm.rst:431 msgid "``'n'``: |flag_n|" msgstr "``'n'``: |flag_n|" -#: ../../library/dbm.rst:83 ../../library/dbm.rst:242 ../../library/dbm.rst:355 -#: ../../library/dbm.rst:429 +#: ../../library/dbm.rst:81 ../../library/dbm.rst:244 ../../library/dbm.rst:359 +#: ../../library/dbm.rst:433 msgid "|mode_param_doc|" msgstr "|mode_param_doc|" -#: ../../library/dbm.rst:86 +#: ../../library/dbm.rst:84 msgid "*file* accepts a :term:`path-like object`." msgstr "*file* 接受一個\\ :term:`類路徑物件 `。" -#: ../../library/dbm.rst:89 +#: ../../library/dbm.rst:87 msgid "" "The object returned by :func:`~dbm.open` supports the same basic " "functionality as a :class:`dict`; keys and their corresponding values can be " @@ -172,44 +160,44 @@ msgid "" "setdefault` methods." msgstr "" -#: ../../library/dbm.rst:94 +#: ../../library/dbm.rst:92 msgid "" "Key and values are always stored as :class:`bytes`. This means that when " "strings are used they are implicitly converted to the default encoding " "before being stored." msgstr "" -#: ../../library/dbm.rst:98 +#: ../../library/dbm.rst:96 msgid "" "These objects also support being used in a :keyword:`with` statement, which " "will automatically close them when done." msgstr "" -#: ../../library/dbm.rst:101 +#: ../../library/dbm.rst:99 msgid "" ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" "`dbm` backends." msgstr "" -#: ../../library/dbm.rst:105 +#: ../../library/dbm.rst:103 msgid "" "Added native support for the context management protocol to the objects " "returned by :func:`~dbm.open`." msgstr "" -#: ../../library/dbm.rst:109 +#: ../../library/dbm.rst:107 msgid "" "Deleting a key from a read-only database raises a database module specific " "exception instead of :exc:`KeyError`." msgstr "" -#: ../../library/dbm.rst:113 +#: ../../library/dbm.rst:111 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" msgstr "" -#: ../../library/dbm.rst:116 +#: ../../library/dbm.rst:114 msgid "" "import dbm\n" "\n" @@ -236,28 +224,28 @@ msgid "" "# db is automatically closed when leaving the with statement." msgstr "" -#: ../../library/dbm.rst:143 +#: ../../library/dbm.rst:141 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/dbm.rst:144 +#: ../../library/dbm.rst:142 msgid "Persistence module which stores non-string data." msgstr "" -#: ../../library/dbm.rst:147 +#: ../../library/dbm.rst:145 msgid "The individual submodules are described in the following sections." msgstr "" -#: ../../library/dbm.rst:150 +#: ../../library/dbm.rst:148 msgid ":mod:`dbm.sqlite3` --- SQLite backend for dbm" msgstr "" -#: ../../library/dbm.rst:158 +#: ../../library/dbm.rst:156 #, fuzzy msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:162 +#: ../../library/dbm.rst:160 msgid "" "This module uses the standard library :mod:`sqlite3` module to provide an " "SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." @@ -265,6 +253,16 @@ msgid "" "including the SQLite CLI." msgstr "" +#: ../../includes/wasm-notavail.rst:3 +msgid ":ref:`Availability `: not WASI." +msgstr "" + +#: ../../includes/wasm-notavail.rst:5 +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + #: ../../library/dbm.rst:169 msgid "" "Open an SQLite database. The returned object behaves like a :term:`mapping`, " @@ -298,24 +296,34 @@ msgid "" "functionality like crash tolerance." msgstr "" -#: ../../library/dbm.rst:207 ../../library/dbm.rst:319 +#: ../../library/dbm.rst:207 ../../library/dbm.rst:321 msgid "" "The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " "incompatible and can not be used interchangeably." msgstr "" -#: ../../library/dbm.rst:212 +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgstr "" + +#: ../../includes/wasm-mobile-notavail.rst:5 +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +#: ../../library/dbm.rst:214 msgid "" "Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:218 +#: ../../library/dbm.rst:220 msgid "Open a GDBM database and return a :class:`!gdbm` object." msgstr "" -#: ../../library/dbm.rst:224 +#: ../../library/dbm.rst:226 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n| The following additional characters may be appended to " @@ -327,29 +335,29 @@ msgid "" "flag characters." msgstr "" -#: ../../library/dbm.rst:230 +#: ../../library/dbm.rst:232 msgid "" "The following additional characters may be appended to control how the " "database is opened:" msgstr "" -#: ../../library/dbm.rst:233 +#: ../../library/dbm.rst:235 msgid "" "``'f'``: Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" -#: ../../library/dbm.rst:235 +#: ../../library/dbm.rst:237 msgid "" "``'s'``: Synchronized mode. Changes to the database will be written " "immediately to the file." msgstr "" -#: ../../library/dbm.rst:237 +#: ../../library/dbm.rst:239 msgid "``'u'``: Do not lock database." msgstr "``'u'``: 不要鎖住資料庫。" -#: ../../library/dbm.rst:239 +#: ../../library/dbm.rst:241 msgid "" "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " "member for a list of supported flag characters." @@ -359,24 +367,24 @@ msgstr "" msgid "Raises" msgstr "引發" -#: ../../library/dbm.rst:245 +#: ../../library/dbm.rst:247 msgid "If an invalid *flag* argument is passed." msgstr "如果一個無效的 *flag* 引數被傳入。" -#: ../../library/dbm.rst:253 +#: ../../library/dbm.rst:255 msgid "" "A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " "supports." msgstr "" -#: ../../library/dbm.rst:255 +#: ../../library/dbm.rst:257 msgid "" ":class:`!gdbm` objects behave similar to :term:`mappings `, but :" "meth:`!items` and :meth:`!values` methods are not supported. The following " "methods are also provided:" msgstr "" -#: ../../library/dbm.rst:261 +#: ../../library/dbm.rst:263 msgid "" "It's possible to loop over every key in the database using this method and " "the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " @@ -384,14 +392,14 @@ msgid "" "starting key." msgstr "" -#: ../../library/dbm.rst:268 +#: ../../library/dbm.rst:270 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " "memory that contains them all::" msgstr "" -#: ../../library/dbm.rst:272 +#: ../../library/dbm.rst:274 msgid "" "k = db.firstkey()\n" "while k is not None:\n" @@ -403,7 +411,7 @@ msgstr "" " print(k)\n" " k = db.nextkey(k)" -#: ../../library/dbm.rst:279 +#: ../../library/dbm.rst:281 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used by the GDBM file, this routine will reorganize the database. :" @@ -412,37 +420,37 @@ msgid "" "reused as new (key, value) pairs are added." msgstr "" -#: ../../library/dbm.rst:287 +#: ../../library/dbm.rst:289 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." msgstr "" -#: ../../library/dbm.rst:292 +#: ../../library/dbm.rst:294 msgid "Close the GDBM database." msgstr "關閉 GDBM 資料庫。" -#: ../../library/dbm.rst:296 +#: ../../library/dbm.rst:298 #, fuzzy msgid "Remove all items from the GDBM database." msgstr "關閉 GDBM 資料庫。" -#: ../../library/dbm.rst:302 +#: ../../library/dbm.rst:304 msgid ":mod:`dbm.ndbm` --- New Database Manager" msgstr ":mod:`dbm.ndbm` --- 新資料庫管理器" -#: ../../library/dbm.rst:308 +#: ../../library/dbm.rst:310 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:312 +#: ../../library/dbm.rst:314 msgid "" "The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " "Database Manager)` library. This module can be used with the \"classic\" " "NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" -#: ../../library/dbm.rst:324 +#: ../../library/dbm.rst:326 msgid "" "The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " @@ -450,56 +458,56 @@ msgid "" "result in a hard crash (segmentation fault)." msgstr "" -#: ../../library/dbm.rst:331 +#: ../../library/dbm.rst:335 msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:337 +#: ../../library/dbm.rst:341 msgid "Name of the NDBM implementation library used." msgstr "" -#: ../../library/dbm.rst:342 +#: ../../library/dbm.rst:346 msgid "Open an NDBM database and return an :class:`!ndbm` object." msgstr "" -#: ../../library/dbm.rst:344 +#: ../../library/dbm.rst:348 msgid "" "The basename of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" -#: ../../library/dbm.rst:358 +#: ../../library/dbm.rst:362 msgid "" ":class:`!ndbm` objects behave similar to :term:`mappings `, but :" "meth:`!items` and :meth:`!values` methods are not supported. The following " "methods are also provided:" msgstr "" -#: ../../library/dbm.rst:362 +#: ../../library/dbm.rst:366 msgid "Accepts :term:`path-like object` for filename." msgstr "" -#: ../../library/dbm.rst:367 +#: ../../library/dbm.rst:371 msgid "Close the NDBM database." msgstr "關閉 NDBM 資料庫。" -#: ../../library/dbm.rst:371 +#: ../../library/dbm.rst:375 #, fuzzy msgid "Remove all items from the NDBM database." msgstr "關閉 NDBM 資料庫。" -#: ../../library/dbm.rst:377 +#: ../../library/dbm.rst:381 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr ":mod:`dbm.dumb` --- 可攜式 DBM 實作" -#: ../../library/dbm.rst:382 +#: ../../library/dbm.rst:386 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:388 +#: ../../library/dbm.rst:392 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -507,53 +515,53 @@ msgid "" "the other database modules." msgstr "" -#: ../../library/dbm.rst:395 +#: ../../library/dbm.rst:399 msgid "" "The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " "interface which is written entirely in Python. Unlike other :mod:`dbm` " "backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" -#: ../../library/dbm.rst:400 +#: ../../library/dbm.rst:404 msgid "The :mod:`!dbm.dumb` module defines the following:" msgstr ":mod:`!dbm.dumb` 模組定義了以下項目:" -#: ../../library/dbm.rst:404 +#: ../../library/dbm.rst:408 msgid "" "Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:410 +#: ../../library/dbm.rst:414 msgid "" "Open a :mod:`!dbm.dumb` database. The returned database object behaves " "similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " "and :meth:`~dumbdbm.close` methods." msgstr "" -#: ../../library/dbm.rst:415 +#: ../../library/dbm.rst:419 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files: - :file:`{filename}.dat` - :file:`{filename}." "dir`" msgstr "" -#: ../../library/dbm.rst:416 +#: ../../library/dbm.rst:420 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files:" msgstr "" -#: ../../library/dbm.rst:419 +#: ../../library/dbm.rst:423 msgid ":file:`{filename}.dat`" msgstr ":file:`{filename}.dat`" -#: ../../library/dbm.rst:420 +#: ../../library/dbm.rst:424 msgid ":file:`{filename}.dir`" msgstr ":file:`{filename}.dir`" -#: ../../library/dbm.rst:423 +#: ../../library/dbm.rst:427 msgid "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" @@ -561,49 +569,49 @@ msgstr "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:424 +#: ../../library/dbm.rst:428 msgid "``'r'``: |flag_r|" msgstr "``'r'``: |flag_r|" -#: ../../library/dbm.rst:426 +#: ../../library/dbm.rst:430 msgid "``'c'`` (default): |flag_c|" msgstr "``'c'`` (default): |flag_c|" -#: ../../library/dbm.rst:433 +#: ../../library/dbm.rst:437 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: ../../library/dbm.rst:437 +#: ../../library/dbm.rst:441 msgid "" ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" -#: ../../library/dbm.rst:440 +#: ../../library/dbm.rst:444 msgid "" "A database opened read-only if *flag* is ``'r'``. A database is not created " "if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" -#: ../../library/dbm.rst:447 +#: ../../library/dbm.rst:451 msgid "" "In addition to the methods provided by the :class:`collections.abc." "MutableMapping` class, the following methods are provided:" msgstr "" -#: ../../library/dbm.rst:453 +#: ../../library/dbm.rst:457 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`Shelve.sync` method." msgstr "" -#: ../../library/dbm.rst:458 +#: ../../library/dbm.rst:462 msgid "Close the database." msgstr "關閉資料庫。" -#: ../../library/dbm.rst:384 +#: ../../library/dbm.rst:388 msgid "databases" msgstr "databases(資料庫)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 8b2bc4d453..9a8a3dcc0f 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -75,20 +75,15 @@ msgstr ":pep:`453`: 在 Python 安裝中的 pip 明確初始建置" msgid "The original rationale and specification for this module." msgstr "此模組的最初設計理念與規範。" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:5 -#, fuzzy +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/ensurepip.rst:44 msgid "Command line interface" @@ -273,3 +268,13 @@ msgstr "" "初始建置的過程也許會安裝 ``pip`` 所需要的額外的模組,但其他軟體不應該假設這些" "相依 (dependency) 總是預設存在(因為這些相依很可能會在未來版本的 ``pip`` 中被" "移除)。" + +#, fuzzy +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms, " +#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " +#~ "availability; see :ref:`iOS-availability` for more information on iOS " +#~ "availability." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/functools.po b/library/functools.po index 280a86fb33..7032ad9def 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -397,7 +397,7 @@ msgstr "" #, fuzzy msgid "" "An `LRU (least recently used) cache `_ works best when the " +"Cache_replacement_policies#Least_Recently_Used_(LRU)>`_ works best when the " "most recent calls are the best predictors of upcoming calls (for example, " "the most popular articles on a news server tend to change each day). The " "cache's size limit assures that the cache does not grow without bound on " diff --git a/library/grp.po b/library/grp.po index 00ca37fb41..4d5f800f8f 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -30,7 +30,8 @@ msgstr "" #: ../../library/grp.rst:13 #, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." +msgid "" +":ref:`Availability `: Unix, not WASI, not Android, not iOS." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/grp.rst:15 diff --git a/library/hashlib.po b/library/hashlib.po index c3eba1ece2..57104480e7 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-05-11 16:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -979,7 +979,7 @@ msgstr "" #, fuzzy msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" +"csrc.nist.gov/pubs/sp/800/106/final>`_)" msgstr "" "(`NIST SP-800-106 「數位簽章的隨機雜湊 (Randomized Hashing for Digital " "Signatures)」 `_)" @@ -1252,7 +1252,7 @@ msgstr "有關安全雜湊演算法的 FIPS 180-4 出版物。" #: ../../library/hashlib.rst:830 #, fuzzy -msgid "https://csrc.nist.gov/publications/detail/fips/202/final" +msgid "https://csrc.nist.gov/pubs/fips/202/final" msgstr "https://csrc.nist.gov/pubs/fips/202/final" #: ../../library/hashlib.rst:831 diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index ea30115b2d..d1cf846f2c 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -201,7 +201,7 @@ msgstr "" #: ../../library/http.cookiejar.rst:140 #, fuzzy -msgid "http://kristol.org/cookie/errata.html" +msgid "https://kristol.org/cookie/errata.html" msgstr "https://kristol.org/cookie/errata.html" #: ../../library/http.cookiejar.rst:141 diff --git a/library/importlib.po b/library/importlib.po index 4ce7485363..77865d2b32 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -1919,34 +1919,53 @@ msgid "Importing a source file directly" msgstr "" #: ../../library/importlib.rst:1587 -msgid "To import a Python source file directly, use the following recipe::" +msgid "" +"This recipe should be used with caution: it is an approximation of an import " +"statement where the file path is specified directly, rather than :data:`sys." +"path` being searched. Alternatives should first be considered first, such as " +"modifying :data:`sys.path` when a proper module is required, or using :func:" +"`runpy.run_path` when the global namespace resulting from running a Python " +"file is appropriate." +msgstr "" + +#: ../../library/importlib.rst:1594 +msgid "" +"To import a Python source file directly from a path, use the following " +"recipe::" msgstr "" -#: ../../library/importlib.rst:1589 +#: ../../library/importlib.rst:1596 msgid "" "import importlib.util\n" "import sys\n" "\n" -"# For illustrative purposes.\n" -"import tokenize\n" -"file_path = tokenize.__file__\n" -"module_name = tokenize.__name__\n" "\n" -"spec = importlib.util.spec_from_file_location(module_name, file_path)\n" -"module = importlib.util.module_from_spec(spec)\n" -"sys.modules[module_name] = module\n" -"spec.loader.exec_module(module)" +"def import_from_path(module_name, file_path):\n" +" spec = importlib.util.spec_from_file_location(module_name, file_path)\n" +" module = importlib.util.module_from_spec(spec)\n" +" sys.modules[module_name] = module\n" +" spec.loader.exec_module(module)\n" +" return module\n" +"\n" +"\n" +"# For illustrative purposes only (use of `json` is arbitrary).\n" +"import json\n" +"file_path = json.__file__\n" +"module_name = json.__name__\n" +"\n" +"# Similar outcome as `import json`.\n" +"json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1604 +#: ../../library/importlib.rst:1618 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1606 +#: ../../library/importlib.rst:1620 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1608 +#: ../../library/importlib.rst:1622 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1966,11 +1985,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1628 +#: ../../library/importlib.rst:1641 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1630 +#: ../../library/importlib.rst:1643 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1984,7 +2003,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1641 +#: ../../library/importlib.rst:1654 msgid "" "import importlib.machinery\n" "import sys\n" @@ -2008,11 +2027,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1662 +#: ../../library/importlib.rst:1675 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1664 +#: ../../library/importlib.rst:1677 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -2020,7 +2039,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1670 +#: ../../library/importlib.rst:1683 msgid "" "import importlib.util\n" "import sys\n" diff --git a/library/inspect.po b/library/inspect.po index 75c786af83..3744b86614 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -1131,7 +1131,7 @@ msgid "" "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:770 ../../library/inspect.rst:1124 +#: ../../library/inspect.rst:770 ../../library/inspect.rst:1125 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 " @@ -1487,28 +1487,29 @@ msgstr "" #: ../../library/inspect.rst:1020 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" -"`arguments` attribute." +"`arguments` attribute. Arguments that can be passed positionally are " +"included in :attr:`args` instead." msgstr "" -#: ../../library/inspect.rst:1025 +#: ../../library/inspect.rst:1026 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:1029 +#: ../../library/inspect.rst:1030 msgid "Set default values for missing arguments." msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:1031 +#: ../../library/inspect.rst:1032 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:1034 +#: ../../library/inspect.rst:1035 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:1037 +#: ../../library/inspect.rst:1038 msgid "" ">>> def foo(a, b='ham', *args): pass\n" ">>> ba = inspect.signature(foo).bind('spam')\n" @@ -1522,13 +1523,13 @@ msgstr "" ">>> ba.arguments\n" "{'a': 'spam', 'b': 'ham', 'args': ()}" -#: ../../library/inspect.rst:1047 +#: ../../library/inspect.rst:1048 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: ../../library/inspect.rst:1050 +#: ../../library/inspect.rst:1051 msgid "" "def test(a, *, b):\n" " ...\n" @@ -1544,19 +1545,19 @@ msgstr "" "ba = sig.bind(10, b=20)\n" "test(*ba.args, **ba.kwargs)" -#: ../../library/inspect.rst:1062 +#: ../../library/inspect.rst:1063 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:1063 +#: ../../library/inspect.rst:1064 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:1069 +#: ../../library/inspect.rst:1070 msgid "Classes and functions" msgstr "類別與函式" -#: ../../library/inspect.rst:1073 +#: ../../library/inspect.rst:1074 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 " @@ -1567,19 +1568,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:1084 +#: ../../library/inspect.rst:1085 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1087 +#: ../../library/inspect.rst:1088 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1090 +#: ../../library/inspect.rst:1091 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 " @@ -1594,7 +1595,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1105 +#: ../../library/inspect.rst:1106 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1604,14 +1605,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1112 +#: ../../library/inspect.rst:1113 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:1117 +#: ../../library/inspect.rst:1118 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 " @@ -1619,7 +1620,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1132 +#: ../../library/inspect.rst:1133 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1628,18 +1629,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1139 ../../library/inspect.rst:1149 +#: ../../library/inspect.rst:1140 ../../library/inspect.rst:1150 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1145 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:1154 +#: ../../library/inspect.rst:1155 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 " @@ -1647,7 +1648,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1162 +#: ../../library/inspect.rst:1163 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 " @@ -1660,7 +1661,7 @@ msgid "" "example:" msgstr "" -#: ../../library/inspect.rst:1171 +#: ../../library/inspect.rst:1172 msgid "" ">>> from inspect import getcallargs\n" ">>> def f(a, b=1, *pos, **named):\n" @@ -1690,11 +1691,11 @@ msgstr "" "...\n" "TypeError: f() missing 1 required positional argument: 'a'" -#: ../../library/inspect.rst:1188 +#: ../../library/inspect.rst:1189 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1195 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1706,18 +1707,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1204 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1210 +#: ../../library/inspect.rst:1211 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:1213 +#: ../../library/inspect.rst:1214 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 " @@ -1727,80 +1728,80 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1220 +#: ../../library/inspect.rst:1221 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1227 +#: ../../library/inspect.rst:1228 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1229 +#: ../../library/inspect.rst:1230 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1232 +#: ../../library/inspect.rst:1233 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:1236 +#: ../../library/inspect.rst:1237 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1238 +#: ../../library/inspect.rst:1239 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:1242 +#: ../../library/inspect.rst:1243 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:1246 +#: ../../library/inspect.rst:1247 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1248 +#: ../../library/inspect.rst:1249 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1250 +#: ../../library/inspect.rst:1251 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1252 +#: ../../library/inspect.rst:1253 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:1255 +#: ../../library/inspect.rst:1256 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` raises an " "exception, it will unwind the stack past the ``get_annotations`` call.)" msgstr "" -#: ../../library/inspect.rst:1259 +#: ../../library/inspect.rst:1260 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1261 +#: ../../library/inspect.rst:1262 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval`; see the " "documentation for :func:`eval` for more information. If ``globals`` or " @@ -1808,35 +1809,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1266 +#: ../../library/inspect.rst:1267 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1267 +#: ../../library/inspect.rst:1268 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:1270 +#: ../../library/inspect.rst:1271 msgid "" "If ``obj`` is a callable, ``globals`` defaults to :attr:`obj.__globals__ " "`, although if ``obj`` is a wrapped function (using :" "func:`functools.update_wrapper`) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1275 +#: ../../library/inspect.rst:1276 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:1285 +#: ../../library/inspect.rst:1286 msgid "The interpreter stack" msgstr "直譯器堆疊" -#: ../../library/inspect.rst:1287 +#: ../../library/inspect.rst:1288 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1844,95 +1845,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1296 +#: ../../library/inspect.rst:1297 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1300 +#: ../../library/inspect.rst:1301 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1305 +#: ../../library/inspect.rst:1306 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:1310 +#: ../../library/inspect.rst:1311 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1314 +#: ../../library/inspect.rst:1315 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:1319 ../../library/inspect.rst:1358 +#: ../../library/inspect.rst:1320 ../../library/inspect.rst:1359 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1323 +#: ../../library/inspect.rst:1324 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:1327 +#: ../../library/inspect.rst:1328 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1330 +#: ../../library/inspect.rst:1331 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1340 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1344 +#: ../../library/inspect.rst:1345 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:1349 +#: ../../library/inspect.rst:1350 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1353 +#: ../../library/inspect.rst:1354 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:1362 +#: ../../library/inspect.rst:1363 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:1367 +#: ../../library/inspect.rst:1368 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1374 +#: ../../library/inspect.rst:1375 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 " @@ -1944,7 +1945,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1382 +#: ../../library/inspect.rst:1383 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 :" @@ -1952,7 +1953,7 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1387 +#: ../../library/inspect.rst:1388 msgid "" "def handle_stackframe_without_leak():\n" " frame = inspect.currentframe()\n" @@ -1962,31 +1963,31 @@ msgid "" " del frame" msgstr "" -#: ../../library/inspect.rst:1394 +#: ../../library/inspect.rst:1395 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:1398 +#: ../../library/inspect.rst:1399 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:1405 +#: ../../library/inspect.rst:1406 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1408 +#: ../../library/inspect.rst:1409 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1413 +#: ../../library/inspect.rst:1414 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 " @@ -1994,19 +1995,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1418 ../../library/inspect.rst:1433 -#: ../../library/inspect.rst:1459 ../../library/inspect.rst:1474 +#: ../../library/inspect.rst:1419 ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1475 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1423 ../../library/inspect.rst:1438 -#: ../../library/inspect.rst:1464 ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1424 ../../library/inspect.rst:1439 +#: ../../library/inspect.rst:1465 ../../library/inspect.rst:1480 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1428 +#: ../../library/inspect.rst:1429 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 " @@ -2014,11 +2015,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1443 +#: ../../library/inspect.rst:1444 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1447 +#: ../../library/inspect.rst:1448 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 " @@ -2026,14 +2027,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1456 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:1469 +#: ../../library/inspect.rst:1470 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 " @@ -2041,11 +2042,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1483 +#: ../../library/inspect.rst:1484 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1485 +#: ../../library/inspect.rst:1486 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -2053,20 +2054,20 @@ msgid "" "`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1491 +#: ../../library/inspect.rst:1492 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:1497 +#: ../../library/inspect.rst:1498 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1502 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 " @@ -2074,27 +2075,27 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1508 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:1513 +#: ../../library/inspect.rst:1514 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:1517 +#: ../../library/inspect.rst:1518 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:1521 +#: ../../library/inspect.rst:1522 msgid "" "# example code for resolving the builtin descriptor types\n" "class _foo:\n" @@ -2117,11 +2118,11 @@ msgid "" " pass" msgstr "" -#: ../../library/inspect.rst:1543 +#: ../../library/inspect.rst:1544 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1545 +#: ../../library/inspect.rst:1546 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -2130,32 +2131,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1553 +#: ../../library/inspect.rst:1554 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1555 ../../library/inspect.rst:1571 -#: ../../library/inspect.rst:1588 +#: ../../library/inspect.rst:1556 ../../library/inspect.rst:1572 +#: ../../library/inspect.rst:1589 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1557 +#: ../../library/inspect.rst:1558 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1558 +#: ../../library/inspect.rst:1559 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1559 +#: ../../library/inspect.rst:1560 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1560 +#: ../../library/inspect.rst:1561 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1566 +#: ../../library/inspect.rst:1567 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 " @@ -2163,23 +2164,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1573 +#: ../../library/inspect.rst:1574 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1574 +#: ../../library/inspect.rst:1575 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1575 +#: ../../library/inspect.rst:1576 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1576 +#: ../../library/inspect.rst:1577 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1582 +#: ../../library/inspect.rst:1583 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -2188,30 +2189,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1590 +#: ../../library/inspect.rst:1591 msgid "AGEN_CREATED: Waiting to start execution." msgstr "AGEN_CREATED: 等待開始執行。" -#: ../../library/inspect.rst:1591 +#: ../../library/inspect.rst:1592 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "AGEN_RUNNING: 目前正在被直譯器執行。" -#: ../../library/inspect.rst:1592 +#: ../../library/inspect.rst:1593 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "AGEN_SUSPENDED: 目前於 yield 運算式暫停。" -#: ../../library/inspect.rst:1593 +#: ../../library/inspect.rst:1594 msgid "AGEN_CLOSED: Execution has completed." msgstr "AGEN_CLOSED: 執行已完成。" -#: ../../library/inspect.rst:1597 +#: ../../library/inspect.rst:1598 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:1603 +#: ../../library/inspect.rst:1604 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. " @@ -2219,14 +2220,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1608 +#: ../../library/inspect.rst:1609 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:1614 +#: ../../library/inspect.rst:1615 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 " @@ -2234,79 +2235,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1623 +#: ../../library/inspect.rst:1624 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1630 +#: ../../library/inspect.rst:1631 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1640 +#: ../../library/inspect.rst:1641 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1642 +#: ../../library/inspect.rst:1643 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: ../../library/inspect.rst:1647 +#: ../../library/inspect.rst:1648 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1651 +#: ../../library/inspect.rst:1652 msgid "" "If set, a new dict will be created for the frame's :attr:`~frame.f_locals` " "when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1656 +#: ../../library/inspect.rst:1657 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1660 +#: ../../library/inspect.rst:1661 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1664 +#: ../../library/inspect.rst:1665 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1668 +#: ../../library/inspect.rst:1669 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:1673 +#: ../../library/inspect.rst:1674 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:1681 +#: ../../library/inspect.rst:1682 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:1690 +#: ../../library/inspect.rst:1691 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:1697 +#: ../../library/inspect.rst:1698 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -2314,39 +2315,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1705 +#: ../../library/inspect.rst:1706 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1709 +#: ../../library/inspect.rst:1710 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1713 +#: ../../library/inspect.rst:1714 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1740 +#: ../../library/inspect.rst:1741 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1742 +#: ../../library/inspect.rst:1743 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1747 +#: ../../library/inspect.rst:1748 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:1753 +#: ../../library/inspect.rst:1754 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/intro.po b/library/intro.po index 599f406f42..b9aca9fe30 100644 --- a/library/intro.po +++ b/library/intro.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2021-10-26 17:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -132,7 +132,7 @@ msgstr "" #, fuzzy msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on macOS and iOS, both of which build on a Unix core." +"supported on macOS, iOS and Android, all of which build on a Unix core." msgstr "" "如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 macOS 上支援," "因其建於 Unix 核心之上。" @@ -213,64 +213,87 @@ msgid "" "not permit symlinks with absolute file names." msgstr "" -#: ../../library/intro.rst:126 -msgid "iOS" -msgstr "" +#: ../../library/intro.rst:127 +#, fuzzy +msgid "Mobile platforms" +msgstr "WebAssembly 平台" -#: ../../library/intro.rst:128 +#: ../../library/intro.rst:129 msgid "" -"iOS is, in most respects, a POSIX operating system. File I/O, socket " -"handling, and threading all behave as they would on any POSIX operating " -"system. However, there are several major differences between iOS and other " -"POSIX systems." +"Android and iOS are, in most respects, POSIX operating systems. File I/O, " +"socket handling, and threading all behave as they would on any POSIX " +"operating system. However, there are several major differences:" msgstr "" -#: ../../library/intro.rst:132 +#: ../../library/intro.rst:133 msgid "" -"iOS can only use Python in \"embedded\" mode. There is no Python REPL, and " -"no ability to execute binaries that are part of the normal Python developer " -"experience, such as :program:`pip`. To add Python code to your iOS app, you " -"must use the :ref:`Python embedding API ` to add a Python " -"interpreter to an iOS app created with Xcode. See the :ref:`iOS usage guide " -"` for more details." +"Mobile platforms can only use Python in \"embedded\" mode. There is no " +"Python REPL, and no ability to use separate executables such as :program:" +"`python` or :program:`pip`. To add Python code to your mobile app, you must " +"use the :ref:`Python embedding API `. For more details, see :ref:" +"`using-android` and :ref:`using-ios`." msgstr "" #: ../../library/intro.rst:139 +msgid "Subprocesses:" +msgstr "" + +#: ../../library/intro.rst:141 msgid "" -"An iOS app cannot use any form of subprocessing, background processing, or " -"inter-process communication. If an iOS app attempts to create a subprocess, " -"the process creating the subprocess will either lock up, or crash. An iOS " -"app has no visibility of other applications that are running, nor any " -"ability to communicate with other running applications, outside of the iOS-" -"specific APIs that exist for this purpose." +"On Android, creating subprocesses is possible but `officially unsupported " +"`__. In " +"particular, Android does not support any part of the System V IPC API, so :" +"mod:`multiprocessing` is not available." msgstr "" #: ../../library/intro.rst:146 msgid "" -"iOS apps have limited access to modify system resources (such as the system " -"clock). These resources will often be *readable*, but attempts to modify " -"those resources will usually fail." +"An iOS app cannot use any form of subprocessing, multiprocessing, or inter-" +"process communication. If an iOS app attempts to create a subprocess, the " +"process creating the subprocess will either lock up, or crash. An iOS app " +"has no visibility of other applications that are running, nor any ability to " +"communicate with other running applications, outside of the iOS-specific " +"APIs that exist for this purpose." msgstr "" -#: ../../library/intro.rst:150 +#: ../../library/intro.rst:153 msgid "" -"iOS apps have a limited concept of console input and output. ``stdout`` and " -"``stderr`` *exist*, and content written to ``stdout`` and ``stderr`` will be " -"visible in logs when running in Xcode, but this content *won't* be recorded " -"in the system log. If a user who has installed your app provides their app " -"logs as a diagnostic aid, they will not include any detail written to " -"``stdout`` or ``stderr``." +"Mobile apps have limited access to modify system resources (such as the " +"system clock). These resources will often be *readable*, but attempts to " +"modify those resources will usually fail." msgstr "" #: ../../library/intro.rst:157 +msgid "Console input and output:" +msgstr "" + +#: ../../library/intro.rst:159 +msgid "" +"On Android, the native ``stdout`` and ``stderr`` are not connected to " +"anything, so Python installs its own streams which redirect messages to the " +"system log. These can be seen under the tags ``python.stdout`` and ``python." +"stderr`` respectively." +msgstr "" + +#: ../../library/intro.rst:164 +msgid "" +"iOS apps have a limited concept of console output. ``stdout`` and ``stderr`` " +"*exist*, and content written to ``stdout`` and ``stderr`` will be visible in " +"logs when running in Xcode, but this content *won't* be recorded in the " +"system log. If a user who has installed your app provides their app logs as " +"a diagnostic aid, they will not include any detail written to ``stdout`` or " +"``stderr``." +msgstr "" + +#: ../../library/intro.rst:171 msgid "" -"iOS apps have no concept of ``stdin`` at all. While iOS apps can have a " -"keyboard, this is a software feature, not something that is attached to " -"``stdin``." +"Mobile apps have no usable ``stdin`` at all. While apps can display an on-" +"screen keyboard, this is a software feature, not something that is attached " +"to ``stdin``." msgstr "" -#: ../../library/intro.rst:161 +#: ../../library/intro.rst:175 msgid "" -"As a result, Python library that involve console manipulation (such as :mod:" -"`curses` and :mod:`readline`) are not available on iOS." +"As a result, Python modules that involve console manipulation (such as :mod:" +"`curses` and :mod:`readline`) are not available on mobile platforms." msgstr "" diff --git a/library/json.po b/library/json.po index 8d22f578e3..a7e1e63e67 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-08-05 15:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgstr "**原始碼:**\\ :source:`Lib/json/__init__.py`" #, fuzzy msgid "" "`JSON (JavaScript Object Notation) `_, specified by :rfc:" -"`7159` (which obsoletes :rfc:`4627`) and by `ECMA-404 `_, is a " "lightweight data interchange format inspired by `JavaScript `_ object literal syntax (although it is not a " @@ -914,9 +914,9 @@ msgstr "合規性與互通性(Interoperability)" #: ../../library/json.rst:559 #, fuzzy msgid "" -"The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. " -"This section details this module's level of compliance with the RFC. For " +"The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This " +"section details this module's level of compliance with the RFC. For " "simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and " "parameters other than those explicitly mentioned, are not considered." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 6bbd946213..3439e54315 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -25,20 +25,15 @@ msgstr ":mod:`!multiprocessing` --- 以行程為基礎的平行性" msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "**原始碼:**\\ :source:`Lib/multiprocessing/`" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:5 -#, fuzzy +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/multiprocessing.rst:14 msgid "Introduction" @@ -4883,5 +4878,15 @@ msgid "" " test()\n" msgstr "" +#, fuzzy +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms, " +#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " +#~ "availability; see :ref:`iOS-availability` for more information on iOS " +#~ "availability." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + #~ msgid ":func:`os.cpu_count`" #~ msgstr ":func:`os.cpu_count`" diff --git a/library/os.po b/library/os.po index 8e1f1843ff..50c5b2ff1a 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,12 +84,12 @@ msgstr "在 VxWorks, 不支援 os.popen、os.fork、os.execv 和 os.spawn*p*。" #: ../../library/os.rst:37 #, fuzzy msgid "" -"On WebAssembly platforms, and on iOS, large parts of the :mod:`os` module " -"are not available or behave differently. API related to processes (e.g. :" -"func:`~os.fork`, :func:`~os.execve`) and resources (e.g. :func:`~os.nice`) " -"are not available. Others like :func:`~os.getuid` and :func:`~os.getpid` are " -"emulated or stubs. WebAssembly platforms also lack support for signals (e." -"g. :func:`~os.kill`, :func:`~os.wait`)." +"On WebAssembly platforms, Android and iOS, large parts of the :mod:`os` " +"module are not available or behave differently. APIs related to processes (e." +"g. :func:`~os.fork`, :func:`~os.execve`) and resources (e.g. :func:`~os." +"nice`) are not available. Others like :func:`~os.getuid` and :func:`~os." +"getpid` are emulated or stubs. WebAssembly platforms also lack support for " +"signals (e.g. :func:`~os.kill`, :func:`~os.wait`)." msgstr "" "在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上,大部分 :mod:" "`os` 模組無法使用或行為不同。與行程(Process)(例如 :func:`~os.fork`、:func:" @@ -309,29 +309,25 @@ msgstr "" #: ../../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:512 ../../library/os.rst:522 ../../library/os.rst:545 -#: ../../library/os.rst:579 ../../library/os.rst:586 ../../library/os.rst:593 -#: ../../library/os.rst:602 ../../library/os.rst:652 ../../library/os.rst:661 -#: ../../library/os.rst:678 ../../library/os.rst:687 ../../library/os.rst:694 -#: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 -#: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1139 +#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:602 +#: ../../library/os.rst:652 ../../library/os.rst:661 ../../library/os.rst:678 +#: ../../library/os.rst:719 ../../library/os.rst:726 ../../library/os.rst:1139 #: ../../library/os.rst:1183 ../../library/os.rst:1367 #: ../../library/os.rst:1393 ../../library/os.rst:1463 #: ../../library/os.rst:1535 ../../library/os.rst:1662 #: ../../library/os.rst:1682 ../../library/os.rst:1691 #: ../../library/os.rst:1772 ../../library/os.rst:1780 #: ../../library/os.rst:1800 ../../library/os.rst:2087 -#: ../../library/os.rst:2181 ../../library/os.rst:2221 -#: ../../library/os.rst:2514 ../../library/os.rst:2536 -#: ../../library/os.rst:4330 ../../library/os.rst:4337 -#: ../../library/os.rst:4344 ../../library/os.rst:4351 -#: ../../library/os.rst:4358 ../../library/os.rst:4365 -#: ../../library/os.rst:4372 ../../library/os.rst:4380 -#: ../../library/os.rst:4388 ../../library/os.rst:4395 -#: ../../library/os.rst:4402 ../../library/os.rst:4411 -#: ../../library/os.rst:4419 ../../library/os.rst:4427 -#: ../../library/os.rst:4434 ../../library/os.rst:4441 -#: ../../library/os.rst:4564 +#: ../../library/os.rst:2221 ../../library/os.rst:2514 +#: ../../library/os.rst:2536 ../../library/os.rst:4330 +#: ../../library/os.rst:4337 ../../library/os.rst:4344 +#: ../../library/os.rst:4351 ../../library/os.rst:4358 +#: ../../library/os.rst:4365 ../../library/os.rst:4372 +#: ../../library/os.rst:4380 ../../library/os.rst:4388 +#: ../../library/os.rst:4395 ../../library/os.rst:4402 +#: ../../library/os.rst:4411 ../../library/os.rst:4419 +#: ../../library/os.rst:4427 ../../library/os.rst:4434 +#: ../../library/os.rst:4441 ../../library/os.rst:4564 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" @@ -671,6 +667,14 @@ msgid "" "group id." msgstr "" +#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 +#: ../../library/os.rst:593 ../../library/os.rst:687 ../../library/os.rst:694 +#: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:735 +#: ../../library/os.rst:2181 +#, fuzzy +msgid ":ref:`Availability `: Unix, not WASI, not Android." +msgstr ":ref:`適用 `:Unix、非 WASI。" + #: ../../library/os.rst:554 msgid "" "Set the environment variable named *key* to the string *value*. Such " @@ -4939,11 +4943,13 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4287 ../../library/os.rst:4541 -#: ../../library/os.rst:4852 ../../library/os.rst:4976 -#: ../../library/os.rst:5095 ../../library/os.rst:5264 +#: ../../library/os.rst:4287 ../../library/os.rst:4852 +#: ../../library/os.rst:4976 ../../library/os.rst:5095 +#: ../../library/os.rst:5264 #, fuzzy -msgid ":ref:`Availability `: Unix, Windows, not WASI, not iOS." +msgid "" +":ref:`Availability `: Unix, Windows, not WASI, not Android, " +"not iOS." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" #: ../../library/os.rst:4289 @@ -5131,7 +5137,8 @@ msgstr "" #: ../../library/os.rst:4490 ../../library/os.rst:4750 #, fuzzy -msgid ":ref:`Availability `: POSIX, not WASI, not iOS." +msgid "" +":ref:`Availability `: POSIX, not WASI, not Android, not iOS." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" #: ../../library/os.rst:4495 @@ -5161,8 +5168,7 @@ msgid "" "fork`." msgstr "" -#: ../../library/os.rst:4517 ../../library/os.rst:4557 -#: ../../library/os.rst:4594 ../../library/os.rst:4734 +#: ../../library/os.rst:4517 ../../library/os.rst:4734 #: ../../library/os.rst:4783 ../../library/os.rst:5020 #: ../../library/os.rst:5054 ../../library/os.rst:5115 #: ../../library/os.rst:5129 ../../library/os.rst:5146 @@ -5175,7 +5181,8 @@ msgstr "" #: ../../library/os.rst:5328 ../../library/os.rst:5337 #: ../../library/os.rst:5346 #, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." +msgid "" +":ref:`Availability `: Unix, not WASI, not Android, not iOS." msgstr ":ref:`適用 `:Unix、非 WASI。" #: ../../library/os.rst:4526 @@ -5207,6 +5214,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" +#: ../../library/os.rst:4541 +#, fuzzy +msgid ":ref:`Availability `: Unix, Windows, not WASI, not iOS." +msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" + #: ../../library/os.rst:4553 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" @@ -5219,6 +5231,11 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" +#: ../../library/os.rst:4557 ../../library/os.rst:4594 +#, fuzzy +msgid ":ref:`Availability `: Unix, not WASI, not iOS." +msgstr ":ref:`適用 `:Unix、非 WASI。" + #: ../../library/os.rst:4562 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." @@ -5295,7 +5312,7 @@ msgstr "" #: ../../library/os.rst:4626 #, fuzzy -msgid ":ref:`Availability `: not WASI, not iOS." +msgid ":ref:`Availability `: not WASI, not Android, not iOS." msgstr ":ref:`適用 `:非 WASI。" #: ../../library/os.rst:4629 diff --git a/library/re.po b/library/re.po index 5059b8501a..905b1126aa 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -169,7 +169,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:101 ../../library/re.rst:1643 +#: ../../library/re.rst:101 ../../library/re.rst:1649 msgid "``.``" msgstr "``.``" @@ -829,53 +829,60 @@ msgid "" msgstr "" #: ../../library/re.rst:577 +msgid "" +"Note that ``\\B`` does not match an empty string, which differs from RE " +"implementations in other programming languages such as Perl. This behavior " +"is kept for compatibility reasons." +msgstr "" + +#: ../../library/re.rst:583 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:578 ../../library/re.rst:602 ../../library/re.rst:624 +#: ../../library/re.rst:584 ../../library/re.rst:608 ../../library/re.rst:630 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:579 +#: ../../library/re.rst:585 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category `[Nd]`__). This includes ``[0-9]``, and also many other " "digit characters." msgstr "" -#: ../../library/re.rst:583 +#: ../../library/re.rst:589 msgid "Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:587 ../../library/re.rst:609 ../../library/re.rst:632 +#: ../../library/re.rst:593 ../../library/re.rst:615 ../../library/re.rst:638 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:588 +#: ../../library/re.rst:594 msgid "" "Matches any decimal digit in the ASCII character set; this is equivalent to " "``[0-9]``." msgstr "" -#: ../../library/re.rst:593 +#: ../../library/re.rst:599 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:594 +#: ../../library/re.rst:600 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``." msgstr "" -#: ../../library/re.rst:597 +#: ../../library/re.rst:603 msgid "Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:601 +#: ../../library/re.rst:607 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:603 +#: ../../library/re.rst:609 msgid "" "Matches Unicode whitespace characters (as defined by :py:meth:`str." "isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also many other " @@ -883,48 +890,48 @@ msgid "" "in many languages." msgstr "" -#: ../../library/re.rst:607 +#: ../../library/re.rst:613 msgid "" "Matches ``[ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:610 +#: ../../library/re.rst:616 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:615 +#: ../../library/re.rst:621 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:616 +#: ../../library/re.rst:622 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``." msgstr "" -#: ../../library/re.rst:619 +#: ../../library/re.rst:625 msgid "" "Matches ``[^ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:623 +#: ../../library/re.rst:629 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:625 +#: ../../library/re.rst:631 msgid "" "Matches Unicode word characters; this includes all Unicode alphanumeric " "characters (as defined by :py:meth:`str.isalnum`), as well as the underscore " "(``_``)." msgstr "" -#: ../../library/re.rst:630 +#: ../../library/re.rst:636 msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:633 +#: ../../library/re.rst:639 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :py:const:`~re.LOCALE` flag is " @@ -932,42 +939,42 @@ msgid "" "the underscore." msgstr "" -#: ../../library/re.rst:640 +#: ../../library/re.rst:646 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:641 +#: ../../library/re.rst:647 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. By default, matches non-underscore (``_``) characters for which :py:" "meth:`str.isalnum` returns ``False``." msgstr "" -#: ../../library/re.rst:646 +#: ../../library/re.rst:652 msgid "Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:648 +#: ../../library/re.rst:654 msgid "" "If the :py:const:`~re.LOCALE` flag is used, matches characters which are " "neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:654 +#: ../../library/re.rst:660 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:655 +#: ../../library/re.rst:661 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:671 +#: ../../library/re.rst:677 msgid "" "Most of the :ref:`escape sequences ` supported by Python " "string literals are also accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:674 +#: ../../library/re.rst:680 msgid "" "\\a \\b \\f \\n\n" "\\N \\r \\t \\u\n" @@ -977,20 +984,20 @@ msgstr "" "\\N \\r \\t \\u\n" "\\U \\v \\x \\\\" -#: ../../library/re.rst:678 +#: ../../library/re.rst:684 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:681 +#: ../../library/re.rst:687 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode (str) 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:687 +#: ../../library/re.rst:693 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. " @@ -998,27 +1005,27 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:692 +#: ../../library/re.rst:698 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:695 +#: ../../library/re.rst:701 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:698 +#: ../../library/re.rst:704 msgid "" "The :samp:`'\\\\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:706 +#: ../../library/re.rst:712 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:708 +#: ../../library/re.rst:714 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -1026,26 +1033,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:715 +#: ../../library/re.rst:721 msgid "Flags" msgstr "旗標" -#: ../../library/re.rst:717 +#: ../../library/re.rst:723 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:724 +#: ../../library/re.rst:730 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:726 +#: ../../library/re.rst:732 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:731 +#: ../../library/re.rst:737 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -1053,11 +1060,11 @@ msgid "" "patterns." msgstr "" -#: ../../library/re.rst:735 +#: ../../library/re.rst:741 msgid "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:739 +#: ../../library/re.rst:745 msgid "" "The :py:const:`~re.U` flag still exists for backward compatibility, but is " "redundant in Python 3 since matches are Unicode by default for ``str`` " @@ -1065,15 +1072,15 @@ msgid "" "`~re.UNICODE` and the inline flag ``(?u)`` are similarly redundant." msgstr "" -#: ../../library/re.rst:748 +#: ../../library/re.rst:754 msgid "Display debug information about compiled expression." msgstr "" -#: ../../library/re.rst:750 +#: ../../library/re.rst:756 msgid "No corresponding inline flag." msgstr "" -#: ../../library/re.rst:756 +#: ../../library/re.rst:762 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -1082,33 +1089,33 @@ msgid "" "flag unless the :py:const:`~re.LOCALE` flag is also used." msgstr "" -#: ../../library/re.rst:764 +#: ../../library/re.rst:770 msgid "Corresponds to the inline flag ``(?i)``." msgstr "" -#: ../../library/re.rst:766 +#: ../../library/re.rst:772 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 " "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). If the :" -"py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to 'Z' " -"are matched." +"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). If " +"the :py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to " +"'Z' are matched." msgstr "" -#: ../../library/re.rst:777 +#: ../../library/re.rst:783 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " "patterns." msgstr "" -#: ../../library/re.rst:781 +#: ../../library/re.rst:787 msgid "Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:785 +#: ../../library/re.rst:791 msgid "" "This flag is discouraged; consider Unicode matching instead. The locale " "mechanism is very unreliable as it only handles one \"culture\" at a time " @@ -1117,20 +1124,20 @@ msgid "" "languages." msgstr "" -#: ../../library/re.rst:792 +#: ../../library/re.rst:798 msgid "" ":py:const:`~re.LOCALE` can be used only with bytes patterns and is not " "compatible with :py:const:`~re.ASCII`." msgstr "" -#: ../../library/re.rst:796 +#: ../../library/re.rst:802 msgid "" "Compiled regular expression objects with the :py: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:805 +#: ../../library/re.rst:811 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1141,11 +1148,11 @@ msgid "" "the end of the string." msgstr "" -#: ../../library/re.rst:812 +#: ../../library/re.rst:818 msgid "Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:816 +#: ../../library/re.rst:822 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 " @@ -1153,35 +1160,35 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:821 +#: ../../library/re.rst:827 msgid "" "def myfunc(text, flag=re.NOFLAG):\n" " return re.match(text, flag)" msgstr "" -#: ../../library/re.rst:829 +#: ../../library/re.rst:835 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../library/re.rst:832 +#: ../../library/re.rst:838 msgid "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:838 +#: ../../library/re.rst:844 msgid "" "In Python 3, Unicode characters are matched by default for ``str`` patterns. " "This flag is therefore redundant with **no effect** and is only kept for " "backward compatibility." msgstr "" -#: ../../library/re.rst:843 +#: ../../library/re.rst:849 msgid "" "See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead." msgstr "" -#: ../../library/re.rst:850 +#: ../../library/re.rst:856 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 " @@ -1194,13 +1201,13 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:860 +#: ../../library/re.rst:866 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:863 +#: ../../library/re.rst:869 msgid "" "a = re.compile(r\"\"\"\\d + # the integral part\n" " \\. # the decimal point\n" @@ -1208,57 +1215,57 @@ msgid "" "b = re.compile(r\"\\d+\\.\\d*\")" msgstr "" -#: ../../library/re.rst:868 +#: ../../library/re.rst:874 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:872 +#: ../../library/re.rst:878 msgid "Functions" msgstr "" -#: ../../library/re.rst:876 +#: ../../library/re.rst:882 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:881 ../../library/re.rst:913 ../../library/re.rst:931 -#: ../../library/re.rst:942 ../../library/re.rst:988 ../../library/re.rst:1022 -#: ../../library/re.rst:1037 ../../library/re.rst:1096 -#: ../../library/re.rst:1132 +#: ../../library/re.rst:887 ../../library/re.rst:919 ../../library/re.rst:937 +#: ../../library/re.rst:948 ../../library/re.rst:994 ../../library/re.rst:1028 +#: ../../library/re.rst:1043 ../../library/re.rst:1102 +#: ../../library/re.rst:1138 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the `flags`_ variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:885 +#: ../../library/re.rst:891 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:887 +#: ../../library/re.rst:893 msgid "" "prog = re.compile(pattern)\n" "result = prog.match(string)" msgstr "" -#: ../../library/re.rst:890 +#: ../../library/re.rst:896 msgid "is equivalent to ::" msgstr "等價於: ::" -#: ../../library/re.rst:892 +#: ../../library/re.rst:898 msgid "result = re.match(pattern, string)" msgstr "" -#: ../../library/re.rst:894 +#: ../../library/re.rst:900 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:900 +#: ../../library/re.rst:906 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1266,7 +1273,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:908 +#: ../../library/re.rst:914 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :class:" @@ -1275,7 +1282,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:920 +#: ../../library/re.rst:926 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :class:`~re.Match`. Return " @@ -1283,26 +1290,26 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:925 +#: ../../library/re.rst:931 msgid "" "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match " "at the beginning of the string and not at the beginning of each line." msgstr "" -#: ../../library/re.rst:928 +#: ../../library/re.rst:934 msgid "" "If you want to locate a match anywhere in *string*, use :func:`search` " "instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:938 +#: ../../library/re.rst:944 msgid "" "If the whole *string* matches the regular expression *pattern*, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:951 +#: ../../library/re.rst:957 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 " @@ -1311,7 +1318,7 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:957 +#: ../../library/re.rst:963 #, fuzzy msgid "" ">>> re.split(r'\\W+', 'Words, words, words.')\n" @@ -1332,14 +1339,14 @@ msgstr "" ">>> re.split('[a-f]+', '0a3B9', flags=re.IGNORECASE)\n" "['0', '3', '9']" -#: ../../library/re.rst:966 +#: ../../library/re.rst:972 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:970 +#: ../../library/re.rst:976 msgid "" ">>> re.split(r'(\\W+)', '...words, words...')\n" "['', '...', 'words', ', ', 'words', '...', '']" @@ -1347,19 +1354,19 @@ msgstr "" ">>> re.split(r'(\\W+)', '...words, words...')\n" "['', '...', 'words', ', ', 'words', '...', '']" -#: ../../library/re.rst:973 +#: ../../library/re.rst:979 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:976 +#: ../../library/re.rst:982 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:979 +#: ../../library/re.rst:985 msgid "" ">>> re.split(r'\\b', 'Words, words, words.')\n" "['', 'Words', ', ', 'words', ', ', 'words', '.']\n" @@ -1377,30 +1384,30 @@ msgstr "" "['', '...', '', '', 'w', '', 'o', '', 'r', '', 'd', '', 's', '...', '', '', " "'']" -#: ../../library/re.rst:992 ../../library/re.rst:1100 +#: ../../library/re.rst:998 ../../library/re.rst:1106 msgid "Added the optional flags argument." msgstr "新增可選的旗標引數。" -#: ../../library/re.rst:995 +#: ../../library/re.rst:1001 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:998 +#: ../../library/re.rst:1004 msgid "" "Passing *maxsplit* and *flags* as positional arguments is deprecated. In " "future Python versions they will be :ref:`keyword-only parameters `." msgstr "" -#: ../../library/re.rst:1006 +#: ../../library/re.rst:1012 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:1010 +#: ../../library/re.rst:1016 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. " @@ -1410,11 +1417,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:1026 ../../library/re.rst:1041 +#: ../../library/re.rst:1032 ../../library/re.rst:1047 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:1032 +#: ../../library/re.rst:1038 msgid "" "Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-" "overlapping matches for the RE *pattern* in *string*. The *string* is " @@ -1422,7 +1429,7 @@ msgid "" "matches are included in the result." msgstr "" -#: ../../library/re.rst:1047 +#: ../../library/re.rst:1053 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1436,7 +1443,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:1058 +#: ../../library/re.rst:1064 msgid "" ">>> re.sub(r'def\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(\\s*\\):',\n" "... r'static PyObject*\\npy_\\1(void)\\n{',\n" @@ -1448,14 +1455,14 @@ msgstr "" "... 'def myfunc():')\n" "'static PyObject*\\npy_myfunc(void)\\n{'" -#: ../../library/re.rst:1063 +#: ../../library/re.rst:1069 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :class:`~re.Match` argument, and " "returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:1067 +#: ../../library/re.rst:1073 msgid "" ">>> def dashrepl(matchobj):\n" "... if matchobj.group(0) == '-': return ' '\n" @@ -1477,11 +1484,11 @@ msgstr "" "IGNORECASE)\n" "'Baked Beans & Spam'" -#: ../../library/re.rst:1076 +#: ../../library/re.rst:1082 msgid "The pattern may be a string or a :class:`~re.Pattern`." msgstr "" -#: ../../library/re.rst:1078 +#: ../../library/re.rst:1084 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, " @@ -1490,7 +1497,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:1086 +#: ../../library/re.rst:1092 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1503,51 +1510,51 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1103 ../../library/re.rst:1381 +#: ../../library/re.rst:1109 ../../library/re.rst:1387 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1106 +#: ../../library/re.rst:1112 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1110 +#: ../../library/re.rst:1116 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors. Empty matches for the pattern are replaced when adjacent to a " "previous non-empty match." msgstr "" -#: ../../library/re.rst:1116 +#: ../../library/re.rst:1122 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:1121 +#: ../../library/re.rst:1127 msgid "" "Passing *count* and *flags* as positional arguments is deprecated. In future " "Python versions they will be :ref:`keyword-only parameters `." msgstr "" -#: ../../library/re.rst:1129 +#: ../../library/re.rst:1135 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1139 +#: ../../library/re.rst:1145 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:1143 +#: ../../library/re.rst:1149 msgid "" ">>> print(re.escape('https://www.python.org'))\n" "https://www\\.python\\.org\n" @@ -1573,13 +1580,13 @@ msgstr "" ">>> print('|'.join(map(re.escape, sorted(operators, reverse=True))))\n" "/|\\-|\\+|\\*\\*|\\*" -#: ../../library/re.rst:1154 +#: ../../library/re.rst:1160 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:1157 +#: ../../library/re.rst:1163 msgid "" ">>> digits_re = r'\\d+'\n" ">>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings'\n" @@ -1591,11 +1598,11 @@ msgstr "" ">>> print(re.sub(digits_re, digits_re.replace('\\\\', r'\\\\'), sample))\n" "/usr/sbin/sendmail - \\d+ errors, \\d+ warnings" -#: ../../library/re.rst:1162 +#: ../../library/re.rst:1168 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1165 +#: ../../library/re.rst:1171 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1603,15 +1610,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1174 +#: ../../library/re.rst:1180 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1178 +#: ../../library/re.rst:1184 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1182 +#: ../../library/re.rst:1188 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 " @@ -1621,51 +1628,51 @@ msgid "" "attributes:" msgstr "" -#: ../../library/re.rst:1190 +#: ../../library/re.rst:1196 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1194 +#: ../../library/re.rst:1200 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1198 +#: ../../library/re.rst:1204 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1202 +#: ../../library/re.rst:1208 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1206 +#: ../../library/re.rst:1212 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1208 +#: ../../library/re.rst:1214 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1211 +#: ../../library/re.rst:1217 msgid "" "``PatternError`` was originally named ``error``; the latter is kept as an " "alias for backward compatibility." msgstr "" -#: ../../library/re.rst:1218 +#: ../../library/re.rst:1224 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1228 msgid "Compiled regular expression object returned by :func:`re.compile`." msgstr "" -#: ../../library/re.rst:1224 +#: ../../library/re.rst:1230 msgid "" ":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " "pattern. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1230 +#: ../../library/re.rst:1236 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :class:`~re.Match`. " @@ -1674,7 +1681,7 @@ msgid "" "string." msgstr "" -#: ../../library/re.rst:1235 +#: ../../library/re.rst:1241 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 " @@ -1683,7 +1690,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1241 +#: ../../library/re.rst:1247 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 " @@ -1693,7 +1700,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1248 +#: ../../library/re.rst:1254 msgid "" ">>> pattern = re.compile(\"d\")\n" ">>> pattern.search(\"dog\") # Match at index 0\n" @@ -1701,7 +1708,7 @@ msgid "" ">>> pattern.search(\"dog\", 1) # No match; search doesn't include the \"d\"" msgstr "" -#: ../../library/re.rst:1256 +#: ../../library/re.rst:1262 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :class:`~re.Match`. Return ``None`` if " @@ -1709,13 +1716,13 @@ msgid "" "zero-length match." msgstr "" -#: ../../library/re.rst:1261 ../../library/re.rst:1279 +#: ../../library/re.rst:1267 ../../library/re.rst:1285 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1264 +#: ../../library/re.rst:1270 msgid "" ">>> pattern = re.compile(\"o\")\n" ">>> pattern.match(\"dog\") # No match as \"o\" is not at the start of " @@ -1725,20 +1732,20 @@ msgid "" "" msgstr "" -#: ../../library/re.rst:1269 +#: ../../library/re.rst:1275 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:1275 +#: ../../library/re.rst:1281 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:1282 +#: ../../library/re.rst:1288 msgid "" ">>> pattern = re.compile(\"o[gh]\")\n" ">>> pattern.fullmatch(\"dog\") # No match as \"o\" is not at the start " @@ -1749,72 +1756,72 @@ msgid "" "" msgstr "" -#: ../../library/re.rst:1293 +#: ../../library/re.rst:1299 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1298 +#: ../../library/re.rst:1304 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:1305 +#: ../../library/re.rst:1311 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:1312 +#: ../../library/re.rst:1318 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1317 +#: ../../library/re.rst:1323 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1322 +#: ../../library/re.rst:1328 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 :py:const:`~re.UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1329 +#: ../../library/re.rst:1335 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1334 +#: ../../library/re.rst:1340 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:1341 +#: ../../library/re.rst:1347 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1344 +#: ../../library/re.rst:1350 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1352 +#: ../../library/re.rst:1358 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1354 +#: ../../library/re.rst:1360 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:1359 +#: ../../library/re.rst:1365 msgid "" "match = re.search(pattern, string)\n" "if match:\n" @@ -1824,17 +1831,17 @@ msgstr "" "if match:\n" " process(match)" -#: ../../library/re.rst:1365 +#: ../../library/re.rst:1371 msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -#: ../../library/re.rst:1367 +#: ../../library/re.rst:1373 msgid "" ":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " "match. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1373 +#: ../../library/re.rst:1379 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1844,7 +1851,7 @@ msgid "" "backreference ``\\g<0>`` will be replaced by the entire match." msgstr "" -#: ../../library/re.rst:1386 +#: ../../library/re.rst:1392 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 " @@ -1859,7 +1866,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1398 +#: ../../library/re.rst:1404 msgid "" ">>> m = re.match(r\"(\\w+) (\\w+)\", \"Isaac Newton, physicist\")\n" ">>> m.group(0) # The entire match\n" @@ -1872,7 +1879,7 @@ msgid "" "('Isaac', 'Newton')" msgstr "" -#: ../../library/re.rst:1408 +#: ../../library/re.rst:1414 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1880,11 +1887,11 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1413 +#: ../../library/re.rst:1419 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1415 +#: ../../library/re.rst:1421 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Malcolm " "Reynolds\")\n" @@ -1900,11 +1907,11 @@ msgstr "" ">>> m.group('last_name')\n" "'Reynolds'" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1427 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1429 msgid "" ">>> m.group(1)\n" "'Malcolm'\n" @@ -1916,24 +1923,24 @@ msgstr "" ">>> m.group(2)\n" "'Reynolds'" -#: ../../library/re.rst:1428 +#: ../../library/re.rst:1434 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1430 +#: ../../library/re.rst:1436 msgid "" ">>> m = re.match(r\"(..)+\", \"a1b2c3\") # Matches 3 times.\n" ">>> m.group(1) # Returns only the last match.\n" "'c3'" msgstr "" -#: ../../library/re.rst:1437 +#: ../../library/re.rst:1443 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1440 +#: ../../library/re.rst:1446 msgid "" ">>> m = re.match(r\"(\\w+) (\\w+)\", \"Isaac Newton, physicist\")\n" ">>> m[0] # The entire match\n" @@ -1944,11 +1951,11 @@ msgid "" "'Newton'" msgstr "" -#: ../../library/re.rst:1448 +#: ../../library/re.rst:1454 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1450 +#: ../../library/re.rst:1456 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Isaac " "Newton\")\n" @@ -1964,18 +1971,18 @@ msgstr "" ">>> m['last_name']\n" "'Newton'" -#: ../../library/re.rst:1461 +#: ../../library/re.rst:1467 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:1465 ../../library/re.rst:1690 +#: ../../library/re.rst:1471 ../../library/re.rst:1696 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/re.rst:1467 +#: ../../library/re.rst:1473 msgid "" ">>> m = re.match(r\"(\\d+)\\.(\\d+)\", \"24.1632\")\n" ">>> m.groups()\n" @@ -1985,14 +1992,14 @@ msgstr "" ">>> m.groups()\n" "('24', '1632')" -#: ../../library/re.rst:1471 +#: ../../library/re.rst:1477 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:1475 +#: ../../library/re.rst:1481 msgid "" ">>> m = re.match(r\"(\\d+)\\.?(\\d+)?\", \"24\")\n" ">>> m.groups() # Second group defaults to None.\n" @@ -2001,14 +2008,14 @@ msgid "" "('24', '0')" msgstr "" -#: ../../library/re.rst:1484 +#: ../../library/re.rst:1490 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:1488 +#: ../../library/re.rst:1494 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Malcolm " "Reynolds\")\n" @@ -2020,7 +2027,7 @@ msgstr "" ">>> m.groupdict()\n" "{'first_name': 'Malcolm', 'last_name': 'Reynolds'}" -#: ../../library/re.rst:1496 +#: ../../library/re.rst:1502 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 " @@ -2029,11 +2036,11 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1502 +#: ../../library/re.rst:1508 msgid "m.string[m.start(g):m.end(g)]" msgstr "m.string[m.start(g):m.end(g)]" -#: ../../library/re.rst:1504 +#: ../../library/re.rst:1510 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." @@ -2041,11 +2048,11 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1509 +#: ../../library/re.rst:1515 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1511 +#: ../../library/re.rst:1517 msgid "" ">>> email = \"tony@tiremove_thisger.net\"\n" ">>> m = re.search(\"remove_this\", email)\n" @@ -2057,28 +2064,28 @@ msgstr "" ">>> email[:m.start()] + email[m.end():]\n" "'tony@tiger.net'" -#: ../../library/re.rst:1519 +#: ../../library/re.rst:1525 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:1526 +#: ../../library/re.rst:1532 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:1533 +#: ../../library/re.rst:1539 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:1540 +#: ../../library/re.rst:1546 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)" @@ -2087,43 +2094,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1555 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:1555 +#: ../../library/re.rst:1561 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1567 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1570 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1572 +#: ../../library/re.rst:1578 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1576 +#: ../../library/re.rst:1582 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1578 +#: ../../library/re.rst:1584 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1581 +#: ../../library/re.rst:1587 msgid "" "def displaymatch(match):\n" " if match is None:\n" @@ -2135,7 +2142,7 @@ msgstr "" " return None\n" " return '' % (match.group(), match.groups())" -#: ../../library/re.rst:1586 +#: ../../library/re.rst:1592 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 " @@ -2143,11 +2150,11 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1591 +#: ../../library/re.rst:1597 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1593 +#: ../../library/re.rst:1599 msgid "" ">>> valid = re.compile(r\"^[a2-9tjqk]{5}$\")\n" ">>> displaymatch(valid.match(\"akt5q\")) # Valid.\n" @@ -2158,14 +2165,14 @@ msgid "" "\"\"" msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1607 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:1604 +#: ../../library/re.rst:1610 msgid "" ">>> pair = re.compile(r\".*(.).*\\1\")\n" ">>> displaymatch(pair.match(\"717ak\")) # Pair of 7s.\n" @@ -2175,13 +2182,13 @@ msgid "" "\"\"" msgstr "" -#: ../../library/re.rst:1611 +#: ../../library/re.rst:1617 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:1614 +#: ../../library/re.rst:1620 msgid "" ">>> pair = re.compile(r\".*(.).*\\1\")\n" ">>> pair.match(\"717ak\").group(1)\n" @@ -2199,11 +2206,11 @@ msgid "" "'a'" msgstr "" -#: ../../library/re.rst:1630 +#: ../../library/re.rst:1636 msgid "Simulating scanf()" msgstr "模擬 scanf()" -#: ../../library/re.rst:1634 +#: ../../library/re.rst:1640 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -2212,130 +2219,130 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1641 +#: ../../library/re.rst:1647 msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1641 +#: ../../library/re.rst:1647 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1643 +#: ../../library/re.rst:1649 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1645 +#: ../../library/re.rst:1651 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1645 +#: ../../library/re.rst:1651 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1647 +#: ../../library/re.rst:1653 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1647 +#: ../../library/re.rst:1653 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1649 +#: ../../library/re.rst:1655 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1649 +#: ../../library/re.rst:1655 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1651 +#: ../../library/re.rst:1657 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1651 +#: ../../library/re.rst:1657 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1653 +#: ../../library/re.rst:1659 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1653 +#: ../../library/re.rst:1659 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1655 +#: ../../library/re.rst:1661 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1655 +#: ../../library/re.rst:1661 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1657 +#: ../../library/re.rst:1663 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1657 +#: ../../library/re.rst:1663 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1659 +#: ../../library/re.rst:1665 msgid "``%x``, ``%X``" msgstr "``%x``、``%X``" -#: ../../library/re.rst:1659 +#: ../../library/re.rst:1665 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1662 +#: ../../library/re.rst:1668 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1664 +#: ../../library/re.rst:1670 msgid "/usr/sbin/sendmail - 0 errors, 4 warnings" msgstr "/usr/sbin/sendmail - 0 errors, 4 warnings" -#: ../../library/re.rst:1666 +#: ../../library/re.rst:1672 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1668 +#: ../../library/re.rst:1674 msgid "%s - %d errors, %d warnings" msgstr "" -#: ../../library/re.rst:1670 +#: ../../library/re.rst:1676 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1672 +#: ../../library/re.rst:1678 msgid "(\\S+) - (\\d+) errors, (\\d+) warnings" msgstr "" -#: ../../library/re.rst:1678 +#: ../../library/re.rst:1684 msgid "search() vs. match()" msgstr "search() vs. match()" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1688 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1684 +#: ../../library/re.rst:1690 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1685 +#: ../../library/re.rst:1691 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1687 +#: ../../library/re.rst:1693 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1692 +#: ../../library/re.rst:1698 msgid "" ">>> re.match(\"c\", \"abcdef\") # No match\n" ">>> re.search(\"c\", \"abcdef\") # Match\n" @@ -2345,13 +2352,13 @@ msgid "" ">>> re.fullmatch(\"r.*n\", \"python\") # No match" msgstr "" -#: ../../library/re.rst:1699 +#: ../../library/re.rst:1705 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:1702 +#: ../../library/re.rst:1708 msgid "" ">>> re.match(\"c\", \"abcdef\") # No match\n" ">>> re.search(\"^c\", \"abcdef\") # No match\n" @@ -2359,7 +2366,7 @@ msgid "" "" msgstr "" -#: ../../library/re.rst:1707 +#: ../../library/re.rst:1713 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 " @@ -2367,18 +2374,18 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1711 +#: ../../library/re.rst:1717 msgid "" ">>> re.match(\"X\", \"A\\nB\\nX\", re.MULTILINE) # No match\n" ">>> re.search(\"^X\", \"A\\nB\\nX\", re.MULTILINE) # Match\n" "" msgstr "" -#: ../../library/re.rst:1717 +#: ../../library/re.rst:1723 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1719 +#: ../../library/re.rst:1725 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 " @@ -2386,13 +2393,13 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1724 +#: ../../library/re.rst:1730 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:1727 +#: ../../library/re.rst:1733 msgid "" ">>> text = \"\"\"Ross McFluff: 834.345.1254 155 Elm Street\n" "...\n" @@ -2410,13 +2417,13 @@ msgstr "" "...\n" "... Heather Albrecht: 548.326.4584 919 Park Place\"\"\"" -#: ../../library/re.rst:1737 +#: ../../library/re.rst:1743 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:1740 +#: ../../library/re.rst:1746 msgid "" ">>> entries = re.split(\"\\n+\", text)\n" ">>> entries\n" @@ -2432,14 +2439,14 @@ msgstr "" "'Frank Burger: 925.541.7625 662 South Dogwood Way',\n" "'Heather Albrecht: 548.326.4584 919 Park Place']" -#: ../../library/re.rst:1750 +#: ../../library/re.rst:1756 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:1754 +#: ../../library/re.rst:1760 #, fuzzy msgid "" ">>> [re.split(\":? \", entry, maxsplit=3) for entry in entries]\n" @@ -2454,14 +2461,14 @@ msgstr "" "['Frank', 'Burger', '925.541.7625', '662 South Dogwood Way'],\n" "['Heather', 'Albrecht', '548.326.4584', '919 Park Place']]" -#: ../../library/re.rst:1763 +#: ../../library/re.rst:1769 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:1767 +#: ../../library/re.rst:1773 #, fuzzy msgid "" ">>> [re.split(\":? \", entry, maxsplit=4) for entry in entries]\n" @@ -2476,11 +2483,11 @@ msgstr "" "['Frank', 'Burger', '925.541.7625', '662', 'South Dogwood Way'],\n" "['Heather', 'Albrecht', '548.326.4584', '919', 'Park Place']]" -#: ../../library/re.rst:1778 +#: ../../library/re.rst:1784 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1780 +#: ../../library/re.rst:1786 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 " @@ -2488,7 +2495,7 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1785 +#: ../../library/re.rst:1791 msgid "" ">>> def repl(m):\n" "... inner_word = list(m.group(2))\n" @@ -2512,11 +2519,11 @@ msgstr "" ">>> re.sub(r\"(\\w)(\\w+)(\\w)\", repl, text)\n" "'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'" -#: ../../library/re.rst:1798 +#: ../../library/re.rst:1804 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1800 +#: ../../library/re.rst:1806 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 " @@ -2524,7 +2531,7 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1805 +#: ../../library/re.rst:1811 msgid "" ">>> text = \"He was carefully disguised but captured quickly by police.\"\n" ">>> re.findall(r\"\\w+ly\\b\", text)\n" @@ -2534,11 +2541,11 @@ msgstr "" ">>> re.findall(r\"\\w+ly\\b\", text)\n" "['carefully', 'quickly']" -#: ../../library/re.rst:1811 +#: ../../library/re.rst:1817 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1813 +#: ../../library/re.rst:1819 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " @@ -2547,7 +2554,7 @@ msgid "" "they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1819 +#: ../../library/re.rst:1825 msgid "" ">>> text = \"He was carefully disguised but captured quickly by police.\"\n" ">>> for m in re.finditer(r\"\\w+ly\\b\", text):\n" @@ -2561,11 +2568,11 @@ msgstr "" "07-16: carefully\n" "40-47: quickly" -#: ../../library/re.rst:1827 +#: ../../library/re.rst:1833 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1829 +#: ../../library/re.rst:1835 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -2573,7 +2580,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1834 +#: ../../library/re.rst:1840 msgid "" ">>> re.match(r\"\\W(.)\\1\\W\", \" ff \")\n" "\n" @@ -2585,7 +2592,7 @@ msgstr "" ">>> re.match(\"\\\\W(.)\\\\1\\\\W\", \" ff \")\n" "" -#: ../../library/re.rst:1839 +#: ../../library/re.rst:1845 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -2593,7 +2600,7 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1844 +#: ../../library/re.rst:1850 msgid "" ">>> re.match(r\"\\\\\", r\"\\\\\")\n" "\n" @@ -2605,25 +2612,25 @@ msgstr "" ">>> re.match(\"\\\\\\\\\", r\"\\\\\")\n" "" -#: ../../library/re.rst:1851 +#: ../../library/re.rst:1857 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1853 +#: ../../library/re.rst:1859 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:1857 +#: ../../library/re.rst:1863 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:1861 +#: ../../library/re.rst:1867 msgid "" "from typing import NamedTuple\n" "import re\n" @@ -2679,11 +2686,11 @@ msgid "" " print(token)" msgstr "" -#: ../../library/re.rst:1913 +#: ../../library/re.rst:1919 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1915 +#: ../../library/re.rst:1921 msgid "" "Token(type='IF', value='IF', line=2, column=4)\n" "Token(type='ID', value='quantity', line=2, column=7)\n" @@ -2725,7 +2732,7 @@ msgstr "" "Token(type='ENDIF', value='ENDIF', line=5, column=4)\n" "Token(type='END', value=';', line=5, column=9)" -#: ../../library/re.rst:1936 +#: ../../library/re.rst:1942 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 " @@ -2747,10 +2754,10 @@ msgstr ". (點)" #: ../../library/re.rst:448 ../../library/re.rst:455 ../../library/re.rst:462 #: ../../library/re.rst:489 ../../library/re.rst:499 ../../library/re.rst:522 #: ../../library/re.rst:534 ../../library/re.rst:539 ../../library/re.rst:561 -#: ../../library/re.rst:575 ../../library/re.rst:591 ../../library/re.rst:599 -#: ../../library/re.rst:613 ../../library/re.rst:621 ../../library/re.rst:638 -#: ../../library/re.rst:652 ../../library/re.rst:657 ../../library/re.rst:848 -#: ../../library/re.rst:1084 +#: ../../library/re.rst:581 ../../library/re.rst:597 ../../library/re.rst:605 +#: ../../library/re.rst:619 ../../library/re.rst:627 ../../library/re.rst:644 +#: ../../library/re.rst:658 ../../library/re.rst:663 ../../library/re.rst:854 +#: ../../library/re.rst:1090 msgid "in regular expressions" msgstr "於正規表示式中" @@ -2866,7 +2873,7 @@ msgstr "(?(" msgid "\\A" msgstr "\\A" -#: ../../library/re.rst:539 ../../library/re.rst:657 +#: ../../library/re.rst:539 ../../library/re.rst:663 msgid "\\b" msgstr "\\b" @@ -2874,87 +2881,87 @@ msgstr "\\b" msgid "\\B" msgstr "\\B" -#: ../../library/re.rst:575 +#: ../../library/re.rst:581 msgid "\\d" msgstr "\\d" -#: ../../library/re.rst:591 +#: ../../library/re.rst:597 msgid "\\D" msgstr "\\D" -#: ../../library/re.rst:599 +#: ../../library/re.rst:605 msgid "\\s" msgstr "\\s" -#: ../../library/re.rst:613 +#: ../../library/re.rst:619 msgid "\\S" msgstr "\\S" -#: ../../library/re.rst:621 +#: ../../library/re.rst:627 msgid "\\w" msgstr "\\w" -#: ../../library/re.rst:638 +#: ../../library/re.rst:644 msgid "\\W" msgstr "\\W" -#: ../../library/re.rst:652 +#: ../../library/re.rst:658 msgid "\\Z" msgstr "\\Z" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\a" msgstr "\\a" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\f" msgstr "\\f" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\n" msgstr "\\n" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\N" msgstr "\\N" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\r" msgstr "\\r" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\t" msgstr "\\t" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\u" msgstr "\\u" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\U" msgstr "\\U" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\v" msgstr "\\v" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\x" msgstr "\\x" -#: ../../library/re.rst:657 +#: ../../library/re.rst:663 msgid "\\\\" msgstr "\\\\" -#: ../../library/re.rst:848 +#: ../../library/re.rst:854 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/re.rst:1084 +#: ../../library/re.rst:1090 msgid "\\g" msgstr "\\g" -#: ../../library/re.rst:1632 +#: ../../library/re.rst:1638 msgid "scanf (C function)" msgstr "scanf(C 函式)" diff --git a/library/readline.po b/library/readline.po index 258923d199..8082da20e1 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -43,16 +43,14 @@ msgid "" "general." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:5 +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" #: ../../library/readline.rst:31 diff --git a/library/socket.po b/library/socket.po index d365183971..88afba9a25 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -1552,10 +1552,10 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1275 ../../library/socket.rst:1715 -#: ../../library/socket.rst:1759 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/socket.rst:1275 +#, fuzzy +msgid ":ref:`Availability `: Unix, not Android." +msgstr ":ref:`適用 `:Unix、非 WASI。" #: ../../library/socket.rst:1282 msgid "" @@ -2018,6 +2018,10 @@ msgid "" " return msg, list(fds)" msgstr "" +#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + #: ../../library/socket.rst:1729 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" diff --git a/library/sqlite3.po b/library/sqlite3.po index 547e4c0846..a4b0b34ec1 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -356,7 +356,7 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:244 ../../library/sqlite3.rst:616 +#: ../../library/sqlite3.rst:244 ../../library/sqlite3.rst:615 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" @@ -723,8 +723,8 @@ msgid "SQLite threading mode" msgstr "" #: ../../library/sqlite3.rst:529 -msgid "`threadsafety`_" -msgstr "`threadsafety`_" +msgid ":pep:`threadsafety <0249#threadsafety>`" +msgstr "" #: ../../library/sqlite3.rst:529 msgid "`SQLITE_THREADSAFE`_" @@ -774,106 +774,106 @@ msgstr "3" msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:545 +#: ../../library/sqlite3.rst:544 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:550 +#: ../../library/sqlite3.rst:549 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:553 ../../library/sqlite3.rst:563 +#: ../../library/sqlite3.rst:552 ../../library/sqlite3.rst:562 msgid "" "This constant used to reflect the version number of the ``pysqlite`` " "package, a third-party library which used to upstream changes to :mod:`!" "sqlite3`. Today, it carries no meaning or practical value." msgstr "" -#: ../../library/sqlite3.rst:560 +#: ../../library/sqlite3.rst:559 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:587 +#: ../../library/sqlite3.rst:586 msgid "" "These constants are used for the :meth:`Connection.setconfig` and :meth:" "`~Connection.getconfig` methods." msgstr "" -#: ../../library/sqlite3.rst:590 +#: ../../library/sqlite3.rst:589 msgid "" "The availability of these constants varies depending on the version of " "SQLite Python was compiled with." msgstr "" -#: ../../library/sqlite3.rst:597 +#: ../../library/sqlite3.rst:596 msgid "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" msgstr "" -#: ../../library/sqlite3.rst:598 +#: ../../library/sqlite3.rst:597 msgid "SQLite docs: Database Connection Configuration Options" msgstr "" -#: ../../library/sqlite3.rst:604 +#: ../../library/sqlite3.rst:603 msgid "Connection objects" msgstr "Connection 物件" -#: ../../library/sqlite3.rst:608 +#: ../../library/sqlite3.rst:607 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:615 +#: ../../library/sqlite3.rst:614 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:621 +#: ../../library/sqlite3.rst:620 msgid "" "A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" "class:`!Connection` object is deleted." msgstr "" -#: ../../library/sqlite3.rst:624 +#: ../../library/sqlite3.rst:623 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:628 +#: ../../library/sqlite3.rst:627 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:635 +#: ../../library/sqlite3.rst:634 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:638 +#: ../../library/sqlite3.rst:637 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:641 +#: ../../library/sqlite3.rst:640 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:644 +#: ../../library/sqlite3.rst:643 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:647 +#: ../../library/sqlite3.rst:646 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:652 +#: ../../library/sqlite3.rst:651 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -882,17 +882,17 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:656 +#: ../../library/sqlite3.rst:655 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:663 +#: ../../library/sqlite3.rst:662 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:670 +#: ../../library/sqlite3.rst:669 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -900,7 +900,7 @@ msgid "" "pending transaction was committed by this method." msgstr "" -#: ../../library/sqlite3.rst:678 +#: ../../library/sqlite3.rst:677 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -908,7 +908,7 @@ msgid "" "pending transaction was rolled back by this method." msgstr "" -#: ../../library/sqlite3.rst:686 +#: ../../library/sqlite3.rst:685 msgid "" "Close the database connection. If :attr:`autocommit` is ``False``, any " "pending transaction is implicitly rolled back. If :attr:`!autocommit` is " @@ -917,63 +917,63 @@ msgid "" "losing pending changes." msgstr "" -#: ../../library/sqlite3.rst:696 +#: ../../library/sqlite3.rst:695 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:702 +#: ../../library/sqlite3.rst:701 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:708 +#: ../../library/sqlite3.rst:707 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:714 +#: ../../library/sqlite3.rst:713 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:716 +#: ../../library/sqlite3.rst:715 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:719 +#: ../../library/sqlite3.rst:718 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:723 +#: ../../library/sqlite3.rst:722 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:730 +#: ../../library/sqlite3.rst:729 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:735 +#: ../../library/sqlite3.rst:734 msgid "Added the *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:738 ../../library/sqlite3.rst:782 -#: ../../library/sqlite3.rst:850 ../../library/sqlite3.rst:1129 -#: ../../library/sqlite3.rst:1551 ../../library/sqlite3.rst:1594 +#: ../../library/sqlite3.rst:737 ../../library/sqlite3.rst:781 +#: ../../library/sqlite3.rst:849 ../../library/sqlite3.rst:1128 +#: ../../library/sqlite3.rst:1550 ../../library/sqlite3.rst:1593 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:740 +#: ../../library/sqlite3.rst:739 msgid "" ">>> import hashlib\n" ">>> def md5sum(t):\n" @@ -995,27 +995,27 @@ msgstr "" "('acbd18db4cc2f85cedef654fccc4a4d8',)\n" ">>> con.close()" -#: ../../library/sqlite3.rst:754 +#: ../../library/sqlite3.rst:753 msgid "" "Passing *name*, *narg*, and *func* as keyword arguments is deprecated. These " "parameters will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:759 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:762 +#: ../../library/sqlite3.rst:761 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:765 +#: ../../library/sqlite3.rst:764 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:769 +#: ../../library/sqlite3.rst:768 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -1024,31 +1024,31 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:770 +#: ../../library/sqlite3.rst:769 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:772 +#: ../../library/sqlite3.rst:771 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:773 ../../library/sqlite3.rst:834 +#: ../../library/sqlite3.rst:772 ../../library/sqlite3.rst:833 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:776 +#: ../../library/sqlite3.rst:775 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:779 +#: ../../library/sqlite3.rst:778 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:784 +#: ../../library/sqlite3.rst:783 msgid "" "class MySum:\n" " def __init__(self):\n" @@ -1090,27 +1090,27 @@ msgstr "" "\n" "con.close()" -#: ../../library/sqlite3.rst:813 +#: ../../library/sqlite3.rst:812 msgid "" "Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is " "deprecated. These parameters will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:819 +#: ../../library/sqlite3.rst:818 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:821 +#: ../../library/sqlite3.rst:820 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:823 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:828 +#: ../../library/sqlite3.rst:827 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -1122,39 +1122,39 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:828 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:830 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:831 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:833 +#: ../../library/sqlite3.rst:832 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:837 +#: ../../library/sqlite3.rst:836 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:840 +#: ../../library/sqlite3.rst:839 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:842 +#: ../../library/sqlite3.rst:841 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:852 +#: ../../library/sqlite3.rst:851 msgid "" "# Example taken from https://www.sqlite.org/windowfunctions.html#udfwinfunc\n" "class WindowSumInt:\n" @@ -1202,30 +1202,30 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:906 +#: ../../library/sqlite3.rst:905 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:910 +#: ../../library/sqlite3.rst:909 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:911 +#: ../../library/sqlite3.rst:910 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:912 +#: ../../library/sqlite3.rst:911 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:914 +#: ../../library/sqlite3.rst:913 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:916 +#: ../../library/sqlite3.rst:915 msgid "" "def collate_reverse(string1, string2):\n" " if string1 == string2:\n" @@ -1263,24 +1263,24 @@ msgstr "" " print(row)\n" "con.close()" -#: ../../library/sqlite3.rst:942 +#: ../../library/sqlite3.rst:941 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:944 +#: ../../library/sqlite3.rst:943 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:951 +#: ../../library/sqlite3.rst:950 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:958 +#: ../../library/sqlite3.rst:957 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 " @@ -1289,7 +1289,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:965 +#: ../../library/sqlite3.rst:964 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`` " @@ -1299,7 +1299,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:972 +#: ../../library/sqlite3.rst:971 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 " @@ -1307,21 +1307,21 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:976 +#: ../../library/sqlite3.rst:975 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:978 +#: ../../library/sqlite3.rst:977 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:981 +#: ../../library/sqlite3.rst:980 msgid "" "Passing *authorizer_callback* as a keyword argument is deprecated. The " "parameter will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:988 +#: ../../library/sqlite3.rst:987 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 " @@ -1329,32 +1329,32 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:993 +#: ../../library/sqlite3.rst:992 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:996 +#: ../../library/sqlite3.rst:995 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise a :exc:`DatabaseError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:1000 +#: ../../library/sqlite3.rst:999 msgid "" "Passing *progress_handler* as a keyword argument is deprecated. The " "parameter will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:1007 +#: ../../library/sqlite3.rst:1006 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:1010 +#: ../../library/sqlite3.rst:1009 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 " @@ -1364,24 +1364,24 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:1018 +#: ../../library/sqlite3.rst:1017 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:1021 +#: ../../library/sqlite3.rst:1020 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:1028 +#: ../../library/sqlite3.rst:1027 msgid "" "Passing *trace_callback* as a keyword argument is deprecated. The parameter " "will become positional-only in Python 3.15." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1034 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -1390,7 +1390,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:1044 +#: ../../library/sqlite3.rst:1043 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1399,7 +1399,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:1051 +#: ../../library/sqlite3.rst:1050 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1407,11 +1407,11 @@ msgstr "" "引發一個附帶引數 ``connection``、``enabled`` 的\\ :ref:`稽核事件 ` " "``sqlite3.enable_load_extension``。" -#: ../../library/sqlite3.rst:1055 +#: ../../library/sqlite3.rst:1054 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "加入 ``sqlite3.enable_load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1061 +#: ../../library/sqlite3.rst:1060 msgid "" "con.enable_load_extension(True)\n" "\n" @@ -1441,24 +1441,24 @@ msgid "" " print(row)" msgstr "" -#: ../../library/sqlite3.rst:1087 +#: ../../library/sqlite3.rst:1086 msgid "" "Load an SQLite extension from a shared library. Enable extension loading " "with :meth:`enable_load_extension` before calling this method." msgstr "" -#: ../../library/sqlite3.rst:1091 +#: ../../library/sqlite3.rst:1090 msgid "The path to the SQLite extension." msgstr "" -#: ../../library/sqlite3.rst:1095 +#: ../../library/sqlite3.rst:1094 msgid "" "Entry point name. If ``None`` (the default), SQLite will come up with an " "entry point name of its own; see the SQLite docs `Loading an Extension`_ for " "details." msgstr "" -#: ../../library/sqlite3.rst:1104 +#: ../../library/sqlite3.rst:1103 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." @@ -1466,29 +1466,29 @@ msgstr "" "引發一個附帶引數 ``connection``、``path`` 的\\ :ref:`稽核事件 ` " "``sqlite3.load_extension``。" -#: ../../library/sqlite3.rst:1108 +#: ../../library/sqlite3.rst:1107 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1111 +#: ../../library/sqlite3.rst:1110 msgid "Added the *entrypoint* parameter." msgstr "新增 *entrypoint* 參數。" -#: ../../library/sqlite3.rst:1118 +#: ../../library/sqlite3.rst:1117 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:1122 +#: ../../library/sqlite3.rst:1121 msgid "" "An optional ``LIKE`` pattern for database objects to dump, e.g. " "``prefix_%``. If ``None`` (the default), all database objects will be " "included." msgstr "" -#: ../../library/sqlite3.rst:1131 +#: ../../library/sqlite3.rst:1130 msgid "" "# Convert file example.db to SQL dump file dump.sql\n" "con = sqlite3.connect('example.db')\n" @@ -1498,36 +1498,36 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:1142 ../../library/sqlite3.rst:1216 +#: ../../library/sqlite3.rst:1141 ../../library/sqlite3.rst:1215 msgid ":ref:`sqlite3-howto-encoding`" msgstr ":ref:`sqlite3-howto-encoding`" -#: ../../library/sqlite3.rst:1144 +#: ../../library/sqlite3.rst:1143 #, fuzzy msgid "Added the *filter* parameter." msgstr "新增 *uri* 參數。" -#: ../../library/sqlite3.rst:1149 +#: ../../library/sqlite3.rst:1148 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1151 +#: ../../library/sqlite3.rst:1150 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1154 +#: ../../library/sqlite3.rst:1153 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1157 +#: ../../library/sqlite3.rst:1156 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:1163 +#: ../../library/sqlite3.rst:1162 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* " @@ -1535,24 +1535,24 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1172 +#: ../../library/sqlite3.rst:1171 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:1179 +#: ../../library/sqlite3.rst:1178 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1183 +#: ../../library/sqlite3.rst:1182 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1185 +#: ../../library/sqlite3.rst:1184 msgid "" "def progress(status, remaining, total):\n" " print(f'Copied {total-remaining} of {total} pages...')\n" @@ -1574,11 +1574,11 @@ msgstr "" "dst.close()\n" "src.close()" -#: ../../library/sqlite3.rst:1202 +#: ../../library/sqlite3.rst:1201 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1203 msgid "" "src = sqlite3.connect('example.db')\n" "dst = sqlite3.connect(':memory:')\n" @@ -1592,25 +1592,25 @@ msgstr "" "dst.close()\n" "src.close()" -#: ../../library/sqlite3.rst:1220 +#: ../../library/sqlite3.rst:1219 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1222 +#: ../../library/sqlite3.rst:1221 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1227 ../../library/sqlite3.rst:1264 +#: ../../library/sqlite3.rst:1226 ../../library/sqlite3.rst:1263 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1230 +#: ../../library/sqlite3.rst:1229 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1240 +#: ../../library/sqlite3.rst:1239 msgid "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" @@ -1618,7 +1618,7 @@ msgstr "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" -#: ../../library/sqlite3.rst:1250 +#: ../../library/sqlite3.rst:1249 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 " @@ -1626,22 +1626,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1255 +#: ../../library/sqlite3.rst:1254 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1258 +#: ../../library/sqlite3.rst:1257 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1267 +#: ../../library/sqlite3.rst:1266 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1270 +#: ../../library/sqlite3.rst:1269 msgid "" ">>> con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)\n" "10\n" @@ -1653,25 +1653,25 @@ msgstr "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_ATTACHED)\n" "1" -#: ../../library/sqlite3.rst:1288 +#: ../../library/sqlite3.rst:1287 msgid "Query a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1290 ../../library/sqlite3.rst:1301 +#: ../../library/sqlite3.rst:1289 ../../library/sqlite3.rst:1300 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: ../../library/sqlite3.rst:1299 +#: ../../library/sqlite3.rst:1298 msgid "Set a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1304 +#: ../../library/sqlite3.rst:1303 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: ../../library/sqlite3.rst:1312 +#: ../../library/sqlite3.rst:1311 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-" @@ -1680,17 +1680,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1318 +#: ../../library/sqlite3.rst:1317 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1326 +#: ../../library/sqlite3.rst:1325 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1333 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1698,96 +1698,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1340 +#: ../../library/sqlite3.rst:1339 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1342 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1347 +#: ../../library/sqlite3.rst:1346 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1351 +#: ../../library/sqlite3.rst:1350 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1353 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1359 +#: ../../library/sqlite3.rst:1358 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1366 +#: ../../library/sqlite3.rst:1365 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: ../../library/sqlite3.rst:1369 +#: ../../library/sqlite3.rst:1368 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: ../../library/sqlite3.rst:1373 +#: ../../library/sqlite3.rst:1372 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1375 +#: ../../library/sqlite3.rst:1374 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1377 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1381 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1384 +#: ../../library/sqlite3.rst:1383 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: ../../library/sqlite3.rst:1387 +#: ../../library/sqlite3.rst:1386 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" -#: ../../library/sqlite3.rst:1391 +#: ../../library/sqlite3.rst:1390 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1397 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1401 +#: ../../library/sqlite3.rst:1400 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1408 +#: ../../library/sqlite3.rst:1407 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1797,13 +1797,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1416 +#: ../../library/sqlite3.rst:1415 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:1421 +#: ../../library/sqlite3.rst:1420 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1811,7 +1811,7 @@ msgid "" "default)." msgstr "" -#: ../../library/sqlite3.rst:1428 +#: ../../library/sqlite3.rst:1427 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1820,33 +1820,33 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1435 ../../library/sqlite3.rst:1721 -#: ../../library/sqlite3.rst:1744 +#: ../../library/sqlite3.rst:1434 ../../library/sqlite3.rst:1720 +#: ../../library/sqlite3.rst:1743 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" -#: ../../library/sqlite3.rst:1439 +#: ../../library/sqlite3.rst:1438 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 " "the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:1444 +#: ../../library/sqlite3.rst:1443 msgid "See :ref:`sqlite3-howto-encoding` for more details." msgstr "更多詳情請見 :ref:`sqlite3-howto-encoding`。" -#: ../../library/sqlite3.rst:1448 +#: ../../library/sqlite3.rst:1447 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:1455 +#: ../../library/sqlite3.rst:1454 msgid "Cursor objects" msgstr "Cursor 物件" -#: ../../library/sqlite3.rst:1457 +#: ../../library/sqlite3.rst:1456 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 " @@ -1854,14 +1854,14 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1464 +#: ../../library/sqlite3.rst:1463 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:1475 +#: ../../library/sqlite3.rst:1474 msgid "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" @@ -1869,32 +1869,32 @@ msgstr "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" -#: ../../library/sqlite3.rst:1489 +#: ../../library/sqlite3.rst:1488 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1496 +#: ../../library/sqlite3.rst:1495 msgid "" "Execute a single SQL statement, optionally binding Python values using :ref:" "`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1500 +#: ../../library/sqlite3.rst:1499 msgid "A single SQL statement." msgstr "單一個 SQL 陳述式。" -#: ../../library/sqlite3.rst:1503 +#: ../../library/sqlite3.rst:1502 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:1510 +#: ../../library/sqlite3.rst:1509 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1513 +#: ../../library/sqlite3.rst:1512 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1902,7 +1902,7 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: ../../library/sqlite3.rst:1522 +#: ../../library/sqlite3.rst:1521 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" @@ -1910,37 +1910,37 @@ msgid "" "instead." msgstr "" -#: ../../library/sqlite3.rst:1528 +#: ../../library/sqlite3.rst:1527 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1532 +#: ../../library/sqlite3.rst:1531 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1536 +#: ../../library/sqlite3.rst:1535 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1538 +#: ../../library/sqlite3.rst:1537 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1541 +#: ../../library/sqlite3.rst:1540 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1547 +#: ../../library/sqlite3.rst:1546 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" -#: ../../library/sqlite3.rst:1553 +#: ../../library/sqlite3.rst:1552 msgid "" "rows = [\n" " (\"row1\",),\n" @@ -1956,13 +1956,13 @@ msgstr "" "# cur 是一個 sqlite3.Cursor 物件\n" "cur.executemany(\"INSERT INTO data VALUES(?)\", rows)" -#: ../../library/sqlite3.rst:1568 +#: ../../library/sqlite3.rst:1567 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1575 +#: ../../library/sqlite3.rst:1574 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " @@ -1970,7 +1970,7 @@ msgid "" "be raised instead." msgstr "" -#: ../../library/sqlite3.rst:1584 +#: ../../library/sqlite3.rst:1583 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1979,11 +1979,11 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1592 +#: ../../library/sqlite3.rst:1591 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1596 +#: ../../library/sqlite3.rst:1595 msgid "" "# cur is an sqlite3.Cursor object\n" "cur.executescript(\"\"\"\n" @@ -2003,20 +2003,20 @@ msgstr "" " COMMIT;\n" "\"\"\")" -#: ../../library/sqlite3.rst:1609 +#: ../../library/sqlite3.rst:1608 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:1617 +#: ../../library/sqlite3.rst:1616 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:1620 +#: ../../library/sqlite3.rst:1619 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 " @@ -2024,7 +2024,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1626 +#: ../../library/sqlite3.rst:1625 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -2032,36 +2032,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1633 +#: ../../library/sqlite3.rst:1632 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:1640 +#: ../../library/sqlite3.rst:1639 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1642 +#: ../../library/sqlite3.rst:1641 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:1647 ../../library/sqlite3.rst:1651 +#: ../../library/sqlite3.rst:1646 ../../library/sqlite3.rst:1650 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1655 +#: ../../library/sqlite3.rst:1654 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:1660 +#: ../../library/sqlite3.rst:1659 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -2069,7 +2069,7 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1665 +#: ../../library/sqlite3.rst:1664 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> cur = con.cursor()\n" @@ -2083,18 +2083,18 @@ msgstr "" "True\n" ">>> con.close()" -#: ../../library/sqlite3.rst:1675 +#: ../../library/sqlite3.rst:1674 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:1679 +#: ../../library/sqlite3.rst:1678 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1683 +#: ../../library/sqlite3.rst:1682 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 " @@ -2104,15 +2104,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1691 +#: ../../library/sqlite3.rst:1690 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1693 +#: ../../library/sqlite3.rst:1692 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1698 +#: ../../library/sqlite3.rst:1697 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -2122,7 +2122,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1709 +#: ../../library/sqlite3.rst:1708 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 " @@ -2131,18 +2131,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1716 +#: ../../library/sqlite3.rst:1715 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:1732 +#: ../../library/sqlite3.rst:1731 msgid "Row objects" msgstr "Row 物件" -#: ../../library/sqlite3.rst:1736 +#: ../../library/sqlite3.rst:1735 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -2150,28 +2150,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1740 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1748 +#: ../../library/sqlite3.rst:1747 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:1752 +#: ../../library/sqlite3.rst:1751 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1759 +#: ../../library/sqlite3.rst:1758 msgid "Blob objects" msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1765 +#: ../../library/sqlite3.rst:1764 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:" @@ -2179,13 +2179,13 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1770 +#: ../../library/sqlite3.rst:1769 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1772 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE test(blob_col blob)\")\n" @@ -2207,18 +2207,18 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:1801 +#: ../../library/sqlite3.rst:1800 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1803 +#: ../../library/sqlite3.rst:1802 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:1809 +#: ../../library/sqlite3.rst:1808 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)` " @@ -2226,18 +2226,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1817 +#: ../../library/sqlite3.rst:1816 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:1823 +#: ../../library/sqlite3.rst:1822 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1827 +#: ../../library/sqlite3.rst:1826 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -2245,26 +2245,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1835 +#: ../../library/sqlite3.rst:1834 msgid "PrepareProtocol objects" msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1839 +#: ../../library/sqlite3.rst:1838 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:1847 +#: ../../library/sqlite3.rst:1846 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1849 +#: ../../library/sqlite3.rst:1848 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1853 +#: ../../library/sqlite3.rst:1852 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-" @@ -2272,39 +2272,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1860 +#: ../../library/sqlite3.rst:1859 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:1864 +#: ../../library/sqlite3.rst:1863 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1869 +#: ../../library/sqlite3.rst:1868 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1876 +#: ../../library/sqlite3.rst:1875 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1883 +#: ../../library/sqlite3.rst:1882 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:1890 +#: ../../library/sqlite3.rst:1889 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 " @@ -2312,14 +2312,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1897 +#: ../../library/sqlite3.rst:1896 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:1903 +#: ../../library/sqlite3.rst:1902 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 " @@ -2327,20 +2327,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1911 +#: ../../library/sqlite3.rst:1910 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:1916 +#: ../../library/sqlite3.rst:1915 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:1923 +#: ../../library/sqlite3.rst:1922 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 " @@ -2348,7 +2348,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1930 +#: ../../library/sqlite3.rst:1929 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -2357,78 +2357,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1940 +#: ../../library/sqlite3.rst:1939 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1942 +#: ../../library/sqlite3.rst:1941 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1945 +#: ../../library/sqlite3.rst:1944 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1947 ../../library/sqlite3.rst:1964 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1947 ../../library/sqlite3.rst:1964 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1949 ../../library/sqlite3.rst:1966 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1949 ../../library/sqlite3.rst:1966 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1951 ../../library/sqlite3.rst:1968 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1951 ../../library/sqlite3.rst:1968 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1971 +#: ../../library/sqlite3.rst:1953 ../../library/sqlite3.rst:1970 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1971 +#: ../../library/sqlite3.rst:1953 ../../library/sqlite3.rst:1970 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1956 +#: ../../library/sqlite3.rst:1955 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1956 ../../library/sqlite3.rst:1973 +#: ../../library/sqlite3.rst:1955 ../../library/sqlite3.rst:1972 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1958 ../../library/sqlite3.rst:1976 +#: ../../library/sqlite3.rst:1957 ../../library/sqlite3.rst:1975 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1958 ../../library/sqlite3.rst:1976 +#: ../../library/sqlite3.rst:1957 ../../library/sqlite3.rst:1975 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1962 +#: ../../library/sqlite3.rst:1961 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1973 +#: ../../library/sqlite3.rst:1972 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1979 +#: ../../library/sqlite3.rst:1978 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 " @@ -2437,47 +2437,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1988 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1992 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1996 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1999 +#: ../../library/sqlite3.rst:1998 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:2000 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:2003 +#: ../../library/sqlite3.rst:2002 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:2005 +#: ../../library/sqlite3.rst:2004 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:2011 +#: ../../library/sqlite3.rst:2010 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -2485,42 +2485,42 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2024 +#: ../../library/sqlite3.rst:2023 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/sqlite3.rst:2026 +#: ../../library/sqlite3.rst:2025 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2031 +#: ../../library/sqlite3.rst:2030 msgid "python -m sqlite3 [-h] [-v] [filename] [sql]" msgstr "python -m sqlite3 [-h] [-v] [filename] [sql]" -#: ../../library/sqlite3.rst:2033 +#: ../../library/sqlite3.rst:2032 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2039 +#: ../../library/sqlite3.rst:2038 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2043 +#: ../../library/sqlite3.rst:2042 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2051 +#: ../../library/sqlite3.rst:2050 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2056 +#: ../../library/sqlite3.rst:2055 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2058 +#: ../../library/sqlite3.rst:2057 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 " @@ -2528,7 +2528,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2063 +#: ../../library/sqlite3.rst:2062 msgid "" ">>> # Never do this -- insecure!\n" ">>> symbol = input()\n" @@ -2539,7 +2539,7 @@ msgid "" ">>> cur.execute(sql)" msgstr "" -#: ../../library/sqlite3.rst:2071 +#: ../../library/sqlite3.rst:2070 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 " @@ -2547,7 +2547,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2076 +#: ../../library/sqlite3.rst:2075 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, " @@ -2558,7 +2558,7 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2087 +#: ../../library/sqlite3.rst:2086 msgid "" "con = sqlite3.connect(\":memory:\")\n" "cur = con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" @@ -2579,24 +2579,24 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2114 +#: ../../library/sqlite3.rst:2113 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2121 +#: ../../library/sqlite3.rst:2120 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2123 +#: ../../library/sqlite3.rst:2122 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:2127 +#: ../../library/sqlite3.rst:2126 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 " @@ -2606,11 +2606,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2139 +#: ../../library/sqlite3.rst:2138 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2141 +#: ../../library/sqlite3.rst:2140 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2620,7 +2620,7 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2149 +#: ../../library/sqlite3.rst:2148 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2652,18 +2652,18 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2173 +#: ../../library/sqlite3.rst:2172 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2175 +#: ../../library/sqlite3.rst:2174 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:2179 +#: ../../library/sqlite3.rst:2178 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2697,36 +2697,36 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2206 +#: ../../library/sqlite3.rst:2205 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2208 +#: ../../library/sqlite3.rst:2207 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:2213 +#: ../../library/sqlite3.rst:2212 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:2216 +#: ../../library/sqlite3.rst:2215 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:2221 +#: ../../library/sqlite3.rst:2220 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2224 +#: ../../library/sqlite3.rst:2223 msgid "" "def convert_point(s):\n" " x, y = map(float, s.split(b\";\"))\n" @@ -2736,32 +2736,32 @@ msgstr "" " x, y = map(float, s.split(b\";\"))\n" " return Point(x, y)" -#: ../../library/sqlite3.rst:2230 +#: ../../library/sqlite3.rst:2229 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:2234 +#: ../../library/sqlite3.rst:2233 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2234 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2236 +#: ../../library/sqlite3.rst:2235 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2240 +#: ../../library/sqlite3.rst:2239 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2242 +#: ../../library/sqlite3.rst:2241 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2803,15 +2803,15 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2293 +#: ../../library/sqlite3.rst:2292 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2295 +#: ../../library/sqlite3.rst:2294 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2297 +#: ../../library/sqlite3.rst:2296 msgid "" "import datetime\n" "import sqlite3\n" @@ -2849,11 +2849,11 @@ msgid "" "sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgstr "" -#: ../../library/sqlite3.rst:2357 +#: ../../library/sqlite3.rst:2356 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2359 +#: ../../library/sqlite3.rst:2358 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2865,7 +2865,7 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2368 +#: ../../library/sqlite3.rst:2367 msgid "" "# Create and fill the table.\n" "con = sqlite3.connect(\":memory:\")\n" @@ -2889,11 +2889,11 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2400 +#: ../../library/sqlite3.rst:2399 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2402 +#: ../../library/sqlite3.rst:2401 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2905,21 +2905,21 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2413 +#: ../../library/sqlite3.rst:2412 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2418 +#: ../../library/sqlite3.rst:2417 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2422 +#: ../../library/sqlite3.rst:2421 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " @@ -2943,19 +2943,19 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2452 +#: ../../library/sqlite3.rst:2451 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2454 +#: ../../library/sqlite3.rst:2453 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2456 +#: ../../library/sqlite3.rst:2455 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2458 +#: ../../library/sqlite3.rst:2457 msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" @@ -2967,13 +2967,13 @@ msgstr "" "Traceback (most recent call last):\n" "OperationalError: attempt to write a readonly database" -#: ../../library/sqlite3.rst:2465 +#: ../../library/sqlite3.rst:2464 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:2468 +#: ../../library/sqlite3.rst:2467 msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" @@ -2983,11 +2983,11 @@ msgstr "" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" -#: ../../library/sqlite3.rst:2475 +#: ../../library/sqlite3.rst:2474 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2477 +#: ../../library/sqlite3.rst:2476 msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" "con1 = sqlite3.connect(db, uri=True)\n" @@ -3013,24 +3013,24 @@ msgstr "" "con1.close()\n" "con2.close()" -#: ../../library/sqlite3.rst:2491 +#: ../../library/sqlite3.rst:2490 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2500 +#: ../../library/sqlite3.rst:2499 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2502 +#: ../../library/sqlite3.rst:2501 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:2507 +#: ../../library/sqlite3.rst:2506 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -3038,7 +3038,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2512 +#: ../../library/sqlite3.rst:2511 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -3046,7 +3046,7 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2517 +#: ../../library/sqlite3.rst:2516 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" @@ -3054,11 +3054,11 @@ msgstr "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" -#: ../../library/sqlite3.rst:2522 +#: ../../library/sqlite3.rst:2521 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2524 +#: ../../library/sqlite3.rst:2523 msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" ">>> row = res.fetchone()\n" @@ -3073,7 +3073,7 @@ msgid "" ">>> con.close()" msgstr "" -#: ../../library/sqlite3.rst:2540 +#: ../../library/sqlite3.rst:2539 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 " @@ -3081,13 +3081,13 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2545 +#: ../../library/sqlite3.rst:2544 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:2548 +#: ../../library/sqlite3.rst:2547 msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" @@ -3097,12 +3097,12 @@ msgstr "" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" -#: ../../library/sqlite3.rst:2554 +#: ../../library/sqlite3.rst:2553 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2556 +#: ../../library/sqlite3.rst:2555 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = dict_factory\n" @@ -3118,11 +3118,11 @@ msgstr "" "{'a': 1, 'b': 2}\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2565 +#: ../../library/sqlite3.rst:2564 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2567 +#: ../../library/sqlite3.rst:2566 msgid "" "from collections import namedtuple\n" "\n" @@ -3138,11 +3138,11 @@ msgstr "" " cls = namedtuple(\"Row\", fields)\n" " return cls._make(row)" -#: ../../library/sqlite3.rst:2576 +#: ../../library/sqlite3.rst:2575 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2578 +#: ../../library/sqlite3.rst:2577 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = namedtuple_factory\n" @@ -3168,18 +3168,18 @@ msgstr "" "2\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2592 +#: ../../library/sqlite3.rst:2591 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:2600 +#: ../../library/sqlite3.rst:2599 msgid "How to handle non-UTF-8 text encodings" msgstr "" -#: ../../library/sqlite3.rst:2602 +#: ../../library/sqlite3.rst:2601 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " @@ -3187,7 +3187,7 @@ msgid "" "`~Connection.text_factory` to handle such cases." msgstr "" -#: ../../library/sqlite3.rst:2608 +#: ../../library/sqlite3.rst:2607 msgid "" "Because of SQLite's `flexible typing`_, it is not uncommon to encounter " "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " @@ -3198,39 +3198,39 @@ msgid "" "text using this :attr:`~Connection.text_factory`:" msgstr "" -#: ../../library/sqlite3.rst:2617 +#: ../../library/sqlite3.rst:2616 msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" msgstr "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -#: ../../library/sqlite3.rst:2621 +#: ../../library/sqlite3.rst:2620 msgid "" "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " "can use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" -#: ../../library/sqlite3.rst:2624 +#: ../../library/sqlite3.rst:2623 msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" msgstr "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -#: ../../library/sqlite3.rst:2630 +#: ../../library/sqlite3.rst:2629 msgid "" "The :mod:`!sqlite3` module API does not support strings containing " "surrogates." msgstr "" -#: ../../library/sqlite3.rst:2635 +#: ../../library/sqlite3.rst:2634 msgid ":ref:`unicode-howto`" msgstr ":ref:`unicode-howto`" -#: ../../library/sqlite3.rst:2641 +#: ../../library/sqlite3.rst:2640 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2647 +#: ../../library/sqlite3.rst:2646 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2649 +#: ../../library/sqlite3.rst:2648 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -3238,24 +3238,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2658 +#: ../../library/sqlite3.rst:2657 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2660 +#: ../../library/sqlite3.rst:2659 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2665 +#: ../../library/sqlite3.rst:2664 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2669 +#: ../../library/sqlite3.rst:2668 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -3264,21 +3264,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2674 +#: ../../library/sqlite3.rst:2673 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2675 +#: ../../library/sqlite3.rst:2674 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2676 +#: ../../library/sqlite3.rst:2675 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2679 +#: ../../library/sqlite3.rst:2678 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -3287,25 +3287,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2687 +#: ../../library/sqlite3.rst:2686 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2696 +#: ../../library/sqlite3.rst:2695 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2700 +#: ../../library/sqlite3.rst:2699 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2704 +#: ../../library/sqlite3.rst:2703 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -3313,7 +3313,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2710 +#: ../../library/sqlite3.rst:2709 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -3327,7 +3327,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2723 +#: ../../library/sqlite3.rst:2722 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -3337,33 +3337,36 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2731 +#: ../../library/sqlite3.rst:2730 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:2735 +#: ../../library/sqlite3.rst:2734 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2739 +#: ../../library/sqlite3.rst:2738 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: ../../library/sqlite3.rst:1491 +#: ../../library/sqlite3.rst:1490 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1491 ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1490 ../../library/sqlite3.rst:1491 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1491 msgid ": (colon)" msgstr ": (冒號)" + +#~ msgid "`threadsafety`_" +#~ msgstr "`threadsafety`_" diff --git a/library/ssl.po b/library/ssl.po index 17af83b322..ad0e9f709c 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2234,8 +2234,7 @@ msgstr "" msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " -"`_." +"`_." msgstr "" #: ../../library/ssl.rst:1571 @@ -2343,10 +2342,10 @@ msgstr "" #: ../../library/ssl.rst:1642 msgid "" "Set the available ciphers for sockets created with this context. It should " -"be a string in the `OpenSSL cipher list format `_. If no cipher can be selected (because " -"compile-time options or other configuration forbids use of all the specified " -"ciphers), an :class:`SSLError` will be raised." +"be a string in the `OpenSSL cipher list format `_. If no cipher can be selected (because compile-time " +"options or other configuration forbids use of all the specified ciphers), " +"an :class:`SSLError` will be raised." msgstr "" #: ../../library/ssl.rst:1650 @@ -2640,9 +2639,9 @@ msgstr "" msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " -"`_ to " -"their numeric values. For example, here is the total number of hits and " -"misses in the session cache since the context was created::" +"`_ to their " +"numeric values. For example, here is the total number of hits and misses in " +"the session cache since the context was created::" msgstr "" #: ../../library/ssl.rst:1881 @@ -2801,9 +2800,9 @@ msgstr "" #: ../../library/ssl.rst:2019 msgid "" -"An integer representing the `security level `_ for the context. This " -"attribute is read-only." +"An integer representing the `security level `_ for the context. This attribute is read-" +"only." msgstr "" #: ../../library/ssl.rst:2027 @@ -3951,10 +3950,10 @@ msgid "" "`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the ssl module " "disables certain weak ciphers by default, but you may want to further " "restrict the cipher choice. Be sure to read OpenSSL's documentation about " -"the `cipher list format `_. If you want to check which ciphers are enabled " -"by a given cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl " -"ciphers`` command on your system." +"the `cipher list format `_. If you want to check which ciphers are enabled by a given " +"cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl ciphers`` " +"command on your system." msgstr "" #: ../../library/ssl.rst:2768 diff --git a/library/subprocess.po b/library/subprocess.po index a6c58c0908..748bc1a1fe 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -50,21 +50,16 @@ msgstr "" msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr ":pep:`324` -- 提議 subprocess 模組的 PEP" -#: ../../includes/wasm-ios-notavail.rst:3 +#: ../../includes/wasm-mobile-notavail.rst:3 #, fuzzy -msgid ":ref:`Availability `: not WASI, not iOS." +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr ":ref:`適用 `:Unix 和 Windows。" -#: ../../includes/wasm-ios-notavail.rst:5 -#, fuzzy +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/subprocess.rst:31 msgid "Using the :mod:`subprocess` Module" @@ -2218,3 +2213,13 @@ msgstr "universal newlines" #: ../../library/subprocess.rst:296 msgid "subprocess module" msgstr "subprocess 模組" + +#, fuzzy +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms, " +#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " +#~ "availability; see :ref:`iOS-availability` for more information on iOS " +#~ "availability." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 67cae05d1b..99edc3a8a0 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -418,7 +418,7 @@ msgid "" "Events can also be controlled on a per code object basis. The functions " "defined below which accept a :class:`types.CodeType` should be prepared to " "accept a look-alike object from functions which are not defined in Python " -"(see :ref:`monitoring`)." +"(see :ref:`c-api-monitoring`)." msgstr "" #: ../../library/sys.monitoring.rst:265 diff --git a/library/time.po b/library/time.po index 8b03cadcce..a1acf58f77 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-08-14 16:05+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -282,8 +282,7 @@ msgstr "" "參閱 :ref:`time-clock-id-constants`。" #: ../../library/time.rst:161 ../../library/time.rst:174 -#: ../../library/time.rst:183 ../../library/time.rst:196 -#: ../../library/time.rst:205 ../../library/time.rst:745 +#: ../../library/time.rst:183 ../../library/time.rst:745 #: ../../library/time.rst:862 ../../library/time.rst:890 #: ../../library/time.rst:918 ../../library/time.rst:962 msgid ":ref:`Availability `: Unix." @@ -324,6 +323,11 @@ msgid "" msgstr "" "使用 :func:`clock_settime_ns` 以避免 :class:`float` 型別造成的精確度損失。" +#: ../../library/time.rst:196 ../../library/time.rst:205 +#, fuzzy +msgid ":ref:`Availability `: Unix, not Android, not iOS." +msgstr ":ref:`適用 `:Unix。" + #: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "類似於 :func:`clock_settime`,但設定以奈秒為單位的時間。" diff --git a/library/tkinter.po b/library/tkinter.po index 60989d08ac..01168f81dd 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -127,8 +127,8 @@ msgstr "由 Mark Roseman 所著。(ISBN 978-1999149567)" #: ../../library/tkinter.rst:61 #, fuzzy msgid "" -"`Python GUI programming with Tkinter `_" +"`Python GUI programming with Tkinter `_" msgstr "" "`Python GUI programming with Tkinter `_" diff --git a/library/typing.po b/library/typing.po index 0840c1c64a..d379333c16 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2024-07-11 11:12+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2135,7 +2135,7 @@ msgid "" " year: int\n" "\n" "def mutate_movie(m: Movie) -> None:\n" -" m[\"year\"] = 1992 # allowed\n" +" m[\"year\"] = 1999 # allowed\n" " m[\"title\"] = \"The Matrix\" # typechecker error" msgstr "" @@ -4299,7 +4299,7 @@ msgstr "" #: ../../library/typing.rst:2792 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " +"en/latest/guides/unreachable.html>`__ has more information about " "exhaustiveness checking with static typing." msgstr "" diff --git a/library/venv.po b/library/venv.po index f24d52177e..25b042169f 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -91,20 +91,15 @@ msgid "" "environments/#create-and-use-virtual-environments>`__" msgstr "" -#: ../../includes/wasm-ios-notavail.rst:3 -msgid ":ref:`Availability `: not WASI, not iOS." +#: ../../includes/wasm-mobile-notavail.rst:3 +msgid ":ref:`Availability `: not Android, not iOS, not WASI." msgstr "" -#: ../../includes/wasm-ios-notavail.rst:5 -#, fuzzy +#: ../../includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms, or " -"on iOS. See :ref:`wasm-availability` for more information on WASM " -"availability; see :ref:`iOS-availability` for more information on iOS " -"availability." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/venv.rst:62 msgid "Creating virtual environments" @@ -1130,3 +1125,13 @@ msgstr "Environments (環境)" #: ../../library/venv.rst:14 msgid "virtual" msgstr "virtual (虛擬)" + +#, fuzzy +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms, " +#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " +#~ "availability; see :ref:`iOS-availability` for more information on iOS " +#~ "availability." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/webbrowser.po b/library/webbrowser.po index 58e216d74c..771f0b8dad 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -94,19 +94,10 @@ msgstr "" msgid "python -m webbrowser -t \"https://www.python.org\"" msgstr "python -m webbrowser -t \"https://www.python.org\"" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +#: ../../library/webbrowser.rst:54 +msgid ":ref:`Availability `: not WASI, not Android." msgstr "" -#: ../../includes/wasm-notavail.rst:5 -#, fuzzy -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - #: ../../library/webbrowser.rst:56 msgid "The following exception is defined:" msgstr "" @@ -475,6 +466,14 @@ msgid "" "directories given in the :envvar:`PATH` environment variable." msgstr "" +#, fuzzy +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly. See :ref:" +#~ "`wasm-availability` for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + #~ msgid ":class:`Konqueror()`" #~ msgstr ":class:`Konqueror()`" diff --git a/library/wsgiref.po b/library/wsgiref.po index 364b60b0a9..17b240f7a3 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-12-09 21:29+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1209,8 +1209,8 @@ msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型 #: ../../library/wsgiref.rst:786 #, fuzzy msgid "" -"A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." +"A :class:`typing.Protocol` describing :pep:`start_response() <3333#the-start-" +"response-callable>` callables (:pep:`3333`)." msgstr "" "一個描述 :pep:`start_response() <3333#the-start-response-callable>` 可呼叫物" "件的 :class:`typing.Protocol` (:pep:`3333`)。" @@ -1226,8 +1226,8 @@ msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" #: ../../library/wsgiref.rst:800 #, fuzzy msgid "" -"A :class:`typing.Protocol` describing a `WSGI Input Stream `_." +"A :class:`typing.Protocol` describing a :pep:`WSGI Input Stream <3333#input-" +"and-error-streams>`." msgstr "" "一個描述 :pep:`WSGI 輸入串流 <3333#input-and-error-streams>`\\ 的 :class:" "`typing.Protocol`。" @@ -1235,8 +1235,8 @@ msgstr "" #: ../../library/wsgiref.rst:805 #, fuzzy msgid "" -"A :class:`typing.Protocol` describing a `WSGI Error Stream `_." +"A :class:`typing.Protocol` describing a :pep:`WSGI Error Stream <3333#input-" +"and-error-streams>`." msgstr "" "一個描述 :pep:`WSGI 錯誤串流 <3333#input-and-error-streams>`\\ 的 :class:" "`typing.Protocol`。" @@ -1244,9 +1244,9 @@ msgstr "" #: ../../library/wsgiref.rst:810 #, fuzzy msgid "" -"A :class:`typing.Protocol` describing a `file wrapper `_. See :class:" -"`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." +"A :class:`typing.Protocol` describing a :pep:`file wrapper <3333#optional-" +"platform-specific-file-handling>`. See :class:`wsgiref.util.FileWrapper` for " +"a concrete implementation of this protocol." msgstr "" "一個描述\\ :pep:`檔案包裝器 <3333#optional-platform-specific-file-" "handling>`\\ 的 :class:`typing.Protocol`。請參閱 :class:`wsgiref.util." diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index cb631dab21..b5a9518fc2 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -1907,7 +1907,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:1376 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " -"argument no longer supported." +"argument is no longer supported." msgstr "" #: ../../library/xml.etree.elementtree.rst:1383 diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index efbc83579f..f4751962b1 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -282,8 +282,7 @@ msgstr "" #: ../../library/xmlrpc.client.rst:168 msgid "" -"`XML-RPC Introspection `_" +"`XML-RPC Introspection `_" msgstr "" #: ../../library/xmlrpc.client.rst:169 diff --git a/reference/introduction.po b/reference/introduction.po index 94633cbb7f..41407dcc00 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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 2e0b49145c..d0a08b7cd3 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,30 +66,10 @@ msgid "Packed as .tar.bz2" msgstr "打包成 .tar.bz2" #: ../../tools/templates/download.html:28 -msgid "PDF (US-Letter paper size)" -msgstr "PDF(美國信紙大小)" - -#: ../../tools/templates/download.html:29 -msgid "" -"Download " -"(ca. %(download_size)s MiB)" -msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" - -#: ../../tools/templates/download.html:30 -msgid "" -"Download (ca. %(download_size)s MiB)" +msgid "PDF" msgstr "" -"下載 " -"(ca. %(download_size)s MiB)" -#: ../../tools/templates/download.html:33 -msgid "PDF (A4 paper size)" -msgstr "PDF(A4 紙張大小)" - -#: ../../tools/templates/download.html:34 +#: ../../tools/templates/download.html:29 msgid "" "Download (ca. " "%(download_size)s MiB)" @@ -97,7 +77,7 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:35 +#: ../../tools/templates/download.html:30 msgid "" "Download " "(ca. %(download_size)s MiB)" @@ -105,11 +85,11 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:38 +#: ../../tools/templates/download.html:33 msgid "HTML" msgstr "HTML" -#: ../../tools/templates/download.html:39 +#: ../../tools/templates/download.html:34 msgid "" "Download (ca. " "%(download_size)s MiB)" @@ -117,7 +97,7 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:40 +#: ../../tools/templates/download.html:35 msgid "" "Download " "(ca. %(download_size)s MiB)" @@ -125,11 +105,11 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:43 +#: ../../tools/templates/download.html:38 msgid "Plain text" msgstr "純文字" -#: ../../tools/templates/download.html:44 +#: ../../tools/templates/download.html:39 msgid "" "Download (ca. " "%(download_size)s MiB)" @@ -137,7 +117,7 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:45 +#: ../../tools/templates/download.html:40 msgid "" "Download " "(ca. %(download_size)s MiB)" @@ -145,11 +125,11 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:48 +#: ../../tools/templates/download.html:43 msgid "Texinfo" msgstr "Texinfo" -#: ../../tools/templates/download.html:49 +#: ../../tools/templates/download.html:44 msgid "" "Download (ca. " "%(download_size)s MiB)" @@ -157,7 +137,7 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:50 +#: ../../tools/templates/download.html:45 msgid "" "Download " "(ca. %(download_size)s MiB)" @@ -165,11 +145,11 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:53 +#: ../../tools/templates/download.html:48 msgid "EPUB" msgstr "EPUB" -#: ../../tools/templates/download.html:54 +#: ../../tools/templates/download.html:49 msgid "" "Download (ca. " "%(download_size)s MiB)" @@ -177,15 +157,15 @@ msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:59 +#: ../../tools/templates/download.html:54 msgid "These archives contain all the content in the documentation." msgstr "這些歸檔包含了說明文件中的所有內容。" -#: ../../tools/templates/download.html:62 +#: ../../tools/templates/download.html:57 msgid "Unpacking" msgstr "解壓縮" -#: ../../tools/templates/download.html:64 +#: ../../tools/templates/download.html:59 msgid "" "Unix users should download the .tar.bz2 archives; these are bzipped tar\n" "archives and can be handled in the usual way using tar and the bzip2\n" @@ -200,7 +180,7 @@ msgstr "" "net\">Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸檔提供最佳壓縮率和最" "快的下載時間。" -#: ../../tools/templates/download.html:70 +#: ../../tools/templates/download.html:65 msgid "" "Windows users can use the ZIP archives since those are customary on that\n" "platform. These are created on Unix using the Info-ZIP zip program." @@ -208,11 +188,11 @@ msgstr "" "Windows 使用者可以使用 ZIP 歸檔,因為這在該平台上是常見的。這些是在 Unix 上使" "用 Info-ZIP zip 程式建立的。" -#: ../../tools/templates/download.html:74 +#: ../../tools/templates/download.html:69 msgid "Problems" msgstr "問題" -#: ../../tools/templates/download.html:76 +#: ../../tools/templates/download.html:71 msgid "" "If you have comments or suggestions for the Python documentation, please " "send\n" @@ -552,3 +532,23 @@ msgstr "" #: ../../tools/templates/layout.html:16 msgid "the current stable release" msgstr "當前的穩定發行版" + +#~ msgid "PDF (US-Letter paper size)" +#~ msgstr "PDF(美國信紙大小)" + +#~ msgid "" +#~ "Download (ca. %(download_size)s MiB)" +#~ msgstr "" +#~ "下載 " +#~ "(ca. %(download_size)s MiB)" + +#~ msgid "" +#~ "Download (ca. %(download_size)s MiB)" +#~ msgstr "" +#~ "下載 (ca. %(download_size)s MiB)" + +#~ msgid "PDF (A4 paper size)" +#~ msgstr "PDF(A4 紙張大小)" diff --git a/tutorial/errors.po b/tutorial/errors.po index 6e4e0d9bd0..9931582f51 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -95,18 +95,25 @@ msgstr "" "處理它們。不過大多數的例外不會被程式處理,並且會顯示如下的錯誤訊息: ::" #: ../../tutorial/errors.rst:45 +#, fuzzy msgid "" ">>> 10 * (1/0)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" +" 10 * (1/0)\n" +" ~^~\n" "ZeroDivisionError: division by zero\n" ">>> 4 + spam*3\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" +" 4 + spam*3\n" +" ^^^^\n" "NameError: name 'spam' is not defined\n" ">>> '2' + 2\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" +" '2' + 2\n" +" ~~~~^~~\n" "TypeError: can only concatenate str (not \"int\") to str" msgstr "" ">>> 10 * (1/0)\n" @@ -122,7 +129,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: can only concatenate str (not \"int\") to str" -#: ../../tutorial/errors.rst:58 +#: ../../tutorial/errors.rst:64 msgid "" "The last line of the error message indicates what happened. Exceptions come " "in different types, and the type is printed as part of the message: the " @@ -140,13 +147,13 @@ msgstr "" "需要遵守(雖然這是一個有用的慣例)。標準例外名稱是內建的識別字 (identifier)," "不是保留關鍵字 (reserved keyword)。" -#: ../../tutorial/errors.rst:66 +#: ../../tutorial/errors.rst:72 msgid "" "The rest of the line provides detail based on the type of exception and what " "caused it." msgstr "此行其餘部分,根據例外的類型及導致例外的原因,說明例外的細節。" -#: ../../tutorial/errors.rst:69 +#: ../../tutorial/errors.rst:75 msgid "" "The preceding part of the error message shows the context where the " "exception occurred, in the form of a stack traceback. In general it contains " @@ -157,16 +164,16 @@ msgstr "" "說,它含有一個列出源程式碼行 (source line) 的堆疊回溯;但它不會顯示從標準輸入" "中讀取的程式碼。" -#: ../../tutorial/errors.rst:74 +#: ../../tutorial/errors.rst:80 msgid "" ":ref:`bltin-exceptions` lists the built-in exceptions and their meanings." msgstr ":ref:`bltin-exceptions`\\ 章節列出內建的例外及它們的意義。" -#: ../../tutorial/errors.rst:80 +#: ../../tutorial/errors.rst:86 msgid "Handling Exceptions" msgstr "處理例外" -#: ../../tutorial/errors.rst:82 +#: ../../tutorial/errors.rst:88 msgid "" "It is possible to write programs that handle selected exceptions. Look at " "the following example, which asks the user for input until a valid integer " @@ -180,7 +187,7 @@ msgstr "" "令);請注意,由使用者產生的程式中斷會引發 :exc:`KeyboardInterrupt` 例外信" "號。 ::" -#: ../../tutorial/errors.rst:88 +#: ../../tutorial/errors.rst:94 msgid "" ">>> while True:\n" "... try:\n" @@ -198,11 +205,11 @@ msgstr "" "... print(\"Oops! That was no valid number. Try again...\")\n" "..." -#: ../../tutorial/errors.rst:96 +#: ../../tutorial/errors.rst:102 msgid "The :keyword:`try` statement works as follows." msgstr ":keyword:`try` 陳述式運作方式如下。" -#: ../../tutorial/errors.rst:98 +#: ../../tutorial/errors.rst:104 msgid "" "First, the *try clause* (the statement(s) between the :keyword:`try` and :" "keyword:`except` keywords) is executed." @@ -210,7 +217,7 @@ msgstr "" "首先,執行 *try 子句*\\ (\\ :keyword:`try` 和 :keyword:`except` 關鍵字之間的" "陳述式)。" -#: ../../tutorial/errors.rst:101 +#: ../../tutorial/errors.rst:107 msgid "" "If no exception occurs, the *except clause* is skipped and execution of the :" "keyword:`try` statement is finished." @@ -218,7 +225,7 @@ msgstr "" "如果沒有發生例外,則 *except 子句*\\ 會被跳過,:keyword:`try` 陳述式執行完" "畢。" -#: ../../tutorial/errors.rst:104 +#: ../../tutorial/errors.rst:110 msgid "" "If an exception occurs during execution of the :keyword:`try` clause, the " "rest of the clause is skipped. Then, if its type matches the exception " @@ -229,7 +236,7 @@ msgstr "" "例外的類型與 :keyword:`except` 關鍵字後面的例外名稱相符,則 *except 子句*\\ " "被執行,然後,繼續執行 try/except 區塊之後的程式碼。" -#: ../../tutorial/errors.rst:109 +#: ../../tutorial/errors.rst:115 msgid "" "If an exception occurs which does not match the exception named in the " "*except clause*, it is passed on to outer :keyword:`try` statements; if no " @@ -240,7 +247,7 @@ msgstr "" "`try` 陳述式;如果仍無法找到處理者,則它是一個\\ *未處理例外 (unhandled " "exception)*,執行將停止,並顯示錯誤訊息。" -#: ../../tutorial/errors.rst:113 +#: ../../tutorial/errors.rst:119 msgid "" "A :keyword:`try` statement may have more than one *except clause*, to " "specify handlers for different exceptions. At most one handler will be " @@ -254,7 +261,7 @@ msgstr "" "理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*\\ 可以" "用一組括號內的 tuple 列舉多個例外,例如: ::" -#: ../../tutorial/errors.rst:119 +#: ../../tutorial/errors.rst:125 msgid "" "... except (RuntimeError, TypeError, NameError):\n" "... pass" @@ -262,7 +269,7 @@ msgstr "" "... except (RuntimeError, TypeError, NameError):\n" "... pass" -#: ../../tutorial/errors.rst:122 +#: ../../tutorial/errors.rst:128 #, fuzzy msgid "" "A class in an :keyword:`except` clause matches exceptions which are " @@ -276,7 +283,7 @@ msgstr "" "derived class (衍生類別)的 *except 子句*\\ 並不能與 base class 相容。例如," "以下程式碼會依序印出 B、C、D: ::" -#: ../../tutorial/errors.rst:127 +#: ../../tutorial/errors.rst:133 msgid "" "class B(Exception):\n" " pass\n" @@ -316,7 +323,7 @@ msgstr "" " except B:\n" " print(\"B\")" -#: ../../tutorial/errors.rst:146 +#: ../../tutorial/errors.rst:152 msgid "" "Note that if the *except clauses* were reversed (with ``except B`` first), " "it would have printed B, B, B --- the first matching *except clause* is " @@ -325,7 +332,7 @@ msgstr "" "請注意,如果 *except 子句*\\ 的順序被反轉(把 ``except B`` 放到第一個),則會" "印出 B、B、B ­­——第一個符合的 *except 子句*\\ 會被觸發。" -#: ../../tutorial/errors.rst:149 +#: ../../tutorial/errors.rst:155 msgid "" "When an exception occurs, it may have associated values, also known as the " "exception's *arguments*. The presence and types of the arguments depend on " @@ -334,7 +341,7 @@ msgstr "" "當例外發生時,它可能有相關聯的值,也就是例外的\\ *引數*。引數的存在與否及它的" "類型,是取決於例外的類型。" -#: ../../tutorial/errors.rst:153 +#: ../../tutorial/errors.rst:159 msgid "" "The *except clause* may specify a variable after the exception name. The " "variable is bound to the exception instance which typically has an ``args`` " @@ -346,7 +353,7 @@ msgstr "" "(instance),其引數通常儲存在 ``args`` 屬性中。為了方便,內建例外型別定義了 :" "meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``: ::" -#: ../../tutorial/errors.rst:159 +#: ../../tutorial/errors.rst:165 msgid "" ">>> try:\n" "... raise Exception('spam', 'eggs')\n" @@ -367,7 +374,7 @@ msgid "" "y = eggs" msgstr "" -#: ../../tutorial/errors.rst:176 +#: ../../tutorial/errors.rst:182 msgid "" "The exception's :meth:`~object.__str__` output is printed as the last part " "('detail') of the message for unhandled exceptions." @@ -375,7 +382,7 @@ msgstr "" "例外的 :meth:`~object.__str__` 輸出會被印在未處理例外訊息的最後一部分(「細" "節」)。" -#: ../../tutorial/errors.rst:179 +#: ../../tutorial/errors.rst:185 msgid "" ":exc:`BaseException` is the common base class of all exceptions. One of its " "subclasses, :exc:`Exception`, is the base class of all the non-fatal " @@ -391,7 +398,7 @@ msgstr "" "它們是用來指示程式應該終止。這些例外包括了由 :meth:`sys.exit` 所引發的 :exc:" "`SystemExit`,以及當使用者想要中斷程式時所引發的 :exc:`KeyboardInterrupt`。" -#: ../../tutorial/errors.rst:187 +#: ../../tutorial/errors.rst:193 msgid "" ":exc:`Exception` can be used as a wildcard that catches (almost) everything. " "However, it is good practice to be as specific as possible with the types of " @@ -402,7 +409,7 @@ msgstr "" "較好的做法是盡可能具體地說明我們打算處理的例外類型,並容許任何非預期例外的傳" "遞 (propagate)。" -#: ../../tutorial/errors.rst:192 +#: ../../tutorial/errors.rst:198 msgid "" "The most common pattern for handling :exc:`Exception` is to print or log the " "exception and then re-raise it (allowing a caller to handle the exception as " @@ -411,7 +418,7 @@ msgstr "" "處理 :exc:`Exception` 的最常見模式,是先將該例外印出或記錄,然後再重新引發它" "(也允許一個呼叫函式 (caller) 來處理該例外): ::" -#: ../../tutorial/errors.rst:196 +#: ../../tutorial/errors.rst:202 msgid "" "import sys\n" "\n" @@ -441,7 +448,7 @@ msgstr "" " print(f\"Unexpected {err=}, {type(err)=}\")\n" " raise" -#: ../../tutorial/errors.rst:210 +#: ../../tutorial/errors.rst:216 msgid "" "The :keyword:`try` ... :keyword:`except` statement has an optional *else " "clause*, which, when present, must follow all *except clauses*. It is " @@ -452,7 +459,7 @@ msgstr "" "時,該子句必須放在所有 *except 子句*\\ 之後。如果一段程式碼必須被執行,但 " "*try 子句*\\ 又沒有引發例外時,這個子句很有用。例如: ::" -#: ../../tutorial/errors.rst:215 +#: ../../tutorial/errors.rst:221 msgid "" "for arg in sys.argv[1:]:\n" " try:\n" @@ -472,7 +479,7 @@ msgstr "" " print(arg, 'has', len(f.readlines()), 'lines')\n" " f.close()" -#: ../../tutorial/errors.rst:224 +#: ../../tutorial/errors.rst:230 msgid "" "The use of the :keyword:`!else` clause is better than adding additional code " "to the :keyword:`try` clause because it avoids accidentally catching an " @@ -483,7 +490,7 @@ msgstr "" "這可以避免意外地捕獲不是由 :keyword:`!try` ... :keyword:`!except` 陳述式保護" "的程式碼所引發的例外。" -#: ../../tutorial/errors.rst:229 +#: ../../tutorial/errors.rst:235 msgid "" "Exception handlers do not handle only exceptions that occur immediately in " "the *try clause*, but also those that occur inside functions that are called " @@ -492,7 +499,7 @@ msgstr "" "例外的處理者不僅處理 *try 子句*\\ 內立即發生的例外,還處理 *try 子句*\\ 內" "(即使是間接地)呼叫的函式內部發生的例外。例如: ::" -#: ../../tutorial/errors.rst:233 +#: ../../tutorial/errors.rst:239 msgid "" ">>> def this_fails():\n" "... x = 1/0\n" @@ -514,21 +521,23 @@ msgstr "" "...\n" "Handling run-time error: division by zero" -#: ../../tutorial/errors.rst:247 +#: ../../tutorial/errors.rst:253 msgid "Raising Exceptions" msgstr "引發例外" -#: ../../tutorial/errors.rst:249 +#: ../../tutorial/errors.rst:255 msgid "" "The :keyword:`raise` statement allows the programmer to force a specified " "exception to occur. For example::" msgstr ":keyword:`raise` 陳述式可讓程式設計師強制引發指定的例外。例如: ::" -#: ../../tutorial/errors.rst:252 +#: ../../tutorial/errors.rst:258 +#, fuzzy msgid "" ">>> raise NameError('HiThere')\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" +" raise NameError('HiThere')\n" "NameError: HiThere" msgstr "" ">>> raise NameError('HiThere')\n" @@ -536,7 +545,7 @@ msgstr "" " File \"\", line 1, in \n" "NameError: HiThere" -#: ../../tutorial/errors.rst:257 +#: ../../tutorial/errors.rst:264 msgid "" "The sole argument to :keyword:`raise` indicates the exception to be raised. " "This must be either an exception instance or an exception class (a class " @@ -549,11 +558,11 @@ msgstr "" "的 subclass)。如果一個例外 class 被傳遞,它會不含引數地呼叫它的建構函式 " "(constructor) ,使它被自動建立實例 (implicitly instantiated): ::" -#: ../../tutorial/errors.rst:263 +#: ../../tutorial/errors.rst:270 msgid "raise ValueError # shorthand for 'raise ValueError()'" msgstr "raise ValueError # 'raise ValueError()' 的簡寫" -#: ../../tutorial/errors.rst:265 +#: ../../tutorial/errors.rst:272 msgid "" "If you need to determine whether an exception was raised but don't intend to " "handle it, a simpler form of the :keyword:`raise` statement allows you to re-" @@ -562,7 +571,8 @@ msgstr "" "如果你只想判斷是否引發了例外,但並不打算處理它,則可以使用簡單的 :keyword:" "`raise` 陳述式來重新引發該例外: ::" -#: ../../tutorial/errors.rst:269 +#: ../../tutorial/errors.rst:276 +#, fuzzy msgid "" ">>> try:\n" "... raise NameError('HiThere')\n" @@ -573,6 +583,7 @@ msgid "" "An exception flew by!\n" "Traceback (most recent call last):\n" " File \"\", line 2, in \n" +" raise NameError('HiThere')\n" "NameError: HiThere" msgstr "" ">>> try:\n" @@ -586,11 +597,11 @@ msgstr "" " File \"\", line 2, in \n" "NameError: HiThere" -#: ../../tutorial/errors.rst:284 +#: ../../tutorial/errors.rst:292 msgid "Exception Chaining" msgstr "例外鏈接 (Exception Chaining)" -#: ../../tutorial/errors.rst:286 +#: ../../tutorial/errors.rst:294 msgid "" "If an unhandled exception occurs inside an :keyword:`except` section, it " "will have the exception being handled attached to it and included in the " @@ -599,7 +610,8 @@ msgstr "" "如果在 :keyword:`except` 段落內部發生了一個未處理的例外,則它會讓這個將要被處" "理的例外附加在後,並將其包含在錯誤訊息中: ::" -#: ../../tutorial/errors.rst:290 +#: ../../tutorial/errors.rst:298 +#, fuzzy msgid "" ">>> try:\n" "... open(\"database.sqlite\")\n" @@ -608,12 +620,15 @@ msgid "" "...\n" "Traceback (most recent call last):\n" " File \"\", line 2, in \n" +" open(\"database.sqlite\")\n" +" ~~~~^^^^^^^^^^^^^^^^^^^\n" "FileNotFoundError: [Errno 2] No such file or directory: 'database.sqlite'\n" "\n" "During handling of the above exception, another exception occurred:\n" "\n" "Traceback (most recent call last):\n" " File \"\", line 4, in \n" +" raise RuntimeError(\"unable to handle error\")\n" "RuntimeError: unable to handle error" msgstr "" ">>> try:\n" @@ -631,7 +646,7 @@ msgstr "" " File \"\", line 4, in \n" "RuntimeError: unable to handle error" -#: ../../tutorial/errors.rst:305 +#: ../../tutorial/errors.rst:316 msgid "" "To indicate that an exception is a direct consequence of another, the :" "keyword:`raise` statement allows an optional :keyword:`from` clause::" @@ -639,7 +654,7 @@ msgstr "" "為了表明一個例外是另一個例外直接造成的結果,:keyword:`raise` 陳述式容許一個選" "擇性的 :keyword:`from` 子句: ::" -#: ../../tutorial/errors.rst:308 +#: ../../tutorial/errors.rst:319 msgid "" "# exc must be exception instance or None.\n" "raise RuntimeError from exc" @@ -647,11 +662,12 @@ msgstr "" "# exc 必須是例外實例或 None。\n" "raise RuntimeError from exc" -#: ../../tutorial/errors.rst:311 +#: ../../tutorial/errors.rst:322 msgid "This can be useful when you are transforming exceptions. For example::" msgstr "要變換例外時,這種方式很有用。例如: ::" -#: ../../tutorial/errors.rst:313 +#: ../../tutorial/errors.rst:324 +#, fuzzy msgid "" ">>> def func():\n" "... raise ConnectionError\n" @@ -663,6 +679,8 @@ msgid "" "...\n" "Traceback (most recent call last):\n" " File \"\", line 2, in \n" +" func()\n" +" ~~~~^^\n" " File \"\", line 2, in func\n" "ConnectionError\n" "\n" @@ -670,6 +688,7 @@ msgid "" "\n" "Traceback (most recent call last):\n" " File \"\", line 4, in \n" +" raise RuntimeError('Failed to open database') from exc\n" "RuntimeError: Failed to open database" msgstr "" ">>> def func():\n" @@ -691,13 +710,14 @@ msgstr "" " File \"\", line 4, in \n" "RuntimeError: Failed to open database" -#: ../../tutorial/errors.rst:332 +#: ../../tutorial/errors.rst:346 msgid "" "It also allows disabling automatic exception chaining using the ``from " "None`` idiom::" msgstr "它也容許使用慣用語 ``from None`` 來停用自動例外鏈接: ::" -#: ../../tutorial/errors.rst:335 +#: ../../tutorial/errors.rst:349 +#, fuzzy msgid "" ">>> try:\n" "... open('database.sqlite')\n" @@ -706,6 +726,7 @@ msgid "" "...\n" "Traceback (most recent call last):\n" " File \"\", line 4, in \n" +" raise RuntimeError from None\n" "RuntimeError" msgstr "" ">>> try:\n" @@ -717,16 +738,16 @@ msgstr "" " File \"\", line 4, in \n" "RuntimeError" -#: ../../tutorial/errors.rst:344 +#: ../../tutorial/errors.rst:359 msgid "" "For more information about chaining mechanics, see :ref:`bltin-exceptions`." msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`。" -#: ../../tutorial/errors.rst:350 +#: ../../tutorial/errors.rst:365 msgid "User-defined Exceptions" msgstr "使用者自定的例外" -#: ../../tutorial/errors.rst:352 +#: ../../tutorial/errors.rst:367 msgid "" "Programs may name their own exceptions by creating a new exception class " "(see :ref:`tut-classes` for more about Python classes). Exceptions should " @@ -737,7 +758,7 @@ msgstr "" "\\ :ref:`tut-classes`\\ )。不論是直接還是間接地,例外通常應該從 :exc:" "`Exception` class 衍生出來。" -#: ../../tutorial/errors.rst:356 +#: ../../tutorial/errors.rst:371 msgid "" "Exception classes can be defined which do anything any other class can do, " "but are usually kept simple, often only offering a number of attributes that " @@ -747,23 +768,23 @@ msgstr "" "例外 class 可被定義來做任何其他 class 能夠做的事,但通常會讓它維持簡單,只提" "供一些屬性,讓關於錯誤的資訊可被例外的處理者抽取出來。" -#: ../../tutorial/errors.rst:360 +#: ../../tutorial/errors.rst:375 msgid "" "Most exceptions are defined with names that end in \"Error\", similar to the " "naming of the standard exceptions." msgstr "大多數的例外定義,都會以「Error」作為名稱結尾,類似於標準例外的命名。" -#: ../../tutorial/errors.rst:363 +#: ../../tutorial/errors.rst:378 msgid "" "Many standard modules define their own exceptions to report errors that may " "occur in functions they define." msgstr "許多標準模組會定義它們自己的例外,以報告在其定義的函式中發生的錯誤。" -#: ../../tutorial/errors.rst:370 +#: ../../tutorial/errors.rst:385 msgid "Defining Clean-up Actions" msgstr "定義清理動作" -#: ../../tutorial/errors.rst:372 +#: ../../tutorial/errors.rst:387 msgid "" "The :keyword:`try` statement has another optional clause which is intended " "to define clean-up actions that must be executed under all circumstances. " @@ -772,7 +793,8 @@ msgstr "" ":keyword:`try` 陳述式有另一個選擇性子句,用於定義在所有情況下都必須被執行的清" "理動作。例如: ::" -#: ../../tutorial/errors.rst:376 +#: ../../tutorial/errors.rst:391 +#, fuzzy msgid "" ">>> try:\n" "... raise KeyboardInterrupt\n" @@ -782,6 +804,7 @@ msgid "" "Goodbye, world!\n" "Traceback (most recent call last):\n" " File \"\", line 2, in \n" +" raise KeyboardInterrupt\n" "KeyboardInterrupt" msgstr "" ">>> try:\n" @@ -794,7 +817,7 @@ msgstr "" " File \"\", line 2, in \n" "KeyboardInterrupt" -#: ../../tutorial/errors.rst:386 +#: ../../tutorial/errors.rst:402 msgid "" "If a :keyword:`finally` clause is present, the :keyword:`!finally` clause " "will execute as the last task before the :keyword:`try` statement completes. " @@ -807,7 +830,7 @@ msgstr "" "外,都會執行 :keyword:`!finally` 子句。以下幾點將探討例外發生時,比較複雜的情" "況:" -#: ../../tutorial/errors.rst:392 +#: ../../tutorial/errors.rst:408 msgid "" "If an exception occurs during execution of the :keyword:`!try` clause, the " "exception may be handled by an :keyword:`except` clause. If the exception is " @@ -818,7 +841,7 @@ msgstr "" "`except` 子句處理。如果該例外沒有被 :keyword:`!except` 子句處理,它會在 :" "keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:398 +#: ../../tutorial/errors.rst:414 msgid "" "An exception could occur during execution of an :keyword:`!except` or :" "keyword:`!else` clause. Again, the exception is re-raised after the :keyword:" @@ -827,7 +850,7 @@ msgstr "" "一個例外可能發生於 :keyword:`!except` 或 :keyword:`!else` 子句的執行過程。同" "樣地,該例外會在 :keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:402 +#: ../../tutorial/errors.rst:418 msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised." @@ -835,7 +858,7 @@ msgstr "" "如果 :keyword:`!finally` 子句執行 :keyword:`break`、:keyword:`continue` 或 :" "keyword:`return` 陳述式,則例外不會被重新引發。" -#: ../../tutorial/errors.rst:406 +#: ../../tutorial/errors.rst:422 msgid "" "If the :keyword:`!try` statement reaches a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, the :keyword:`!finally` clause " @@ -846,7 +869,7 @@ msgstr "" "keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" "break`、:keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" -#: ../../tutorial/errors.rst:412 +#: ../../tutorial/errors.rst:428 msgid "" "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the " "returned value will be the one from the :keyword:`!finally` clause's :" @@ -857,11 +880,11 @@ msgstr "" "自 :keyword:`!finally` 子句的 :keyword:`!return` 陳述式的回傳值,而不是來自 :" "keyword:`!try` 子句的 :keyword:`!return` 陳述式的回傳值。" -#: ../../tutorial/errors.rst:418 +#: ../../tutorial/errors.rst:434 msgid "For example::" msgstr "例如: ::" -#: ../../tutorial/errors.rst:420 +#: ../../tutorial/errors.rst:436 msgid "" ">>> def bool_return():\n" "... try:\n" @@ -881,11 +904,12 @@ msgstr "" ">>> bool_return()\n" "False" -#: ../../tutorial/errors.rst:429 +#: ../../tutorial/errors.rst:445 msgid "A more complicated example::" msgstr "另一個比較複雜的範例: ::" -#: ../../tutorial/errors.rst:431 +#: ../../tutorial/errors.rst:447 +#, fuzzy msgid "" ">>> def divide(x, y):\n" "... try:\n" @@ -907,7 +931,11 @@ msgid "" "executing finally clause\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" +" divide(\"2\", \"0\")\n" +" ~~~~~~^^^^^^^^^^\n" " File \"\", line 3, in divide\n" +" result = x / y\n" +" ~~^~~\n" "TypeError: unsupported operand type(s) for /: 'str' and 'str'" msgstr "" ">>> def divide(x, y):\n" @@ -933,7 +961,7 @@ msgstr "" " File \"\", line 3, in divide\n" "TypeError: unsupported operand type(s) for /: 'str' and 'str'" -#: ../../tutorial/errors.rst:454 +#: ../../tutorial/errors.rst:474 msgid "" "As you can see, the :keyword:`finally` clause is executed in any event. " "The :exc:`TypeError` raised by dividing two strings is not handled by the :" @@ -944,7 +972,7 @@ msgstr "" "的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" "finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:459 +#: ../../tutorial/errors.rst:479 msgid "" "In real world applications, the :keyword:`finally` clause is useful for " "releasing external resources (such as files or network connections), " @@ -953,11 +981,11 @@ msgstr "" "在真實應用程式中,:keyword:`finally` 子句對於釋放外部資源(例如檔案或網路連" "線)很有用,無論該資源的使用是否成功。" -#: ../../tutorial/errors.rst:467 +#: ../../tutorial/errors.rst:487 msgid "Predefined Clean-up Actions" msgstr "預定義的清理動作" -#: ../../tutorial/errors.rst:469 +#: ../../tutorial/errors.rst:489 msgid "" "Some objects define standard clean-up actions to be undertaken when the " "object is no longer needed, regardless of whether or not the operation using " @@ -967,7 +995,7 @@ msgstr "" "某些物件定義了在物件不再被需要時的標準清理動作,無論使用該物件的作業是成功或" "失敗。請看以下範例,它嘗試開啟一個檔案,並印出檔案內容至螢幕。 ::" -#: ../../tutorial/errors.rst:474 +#: ../../tutorial/errors.rst:494 msgid "" "for line in open(\"myfile.txt\"):\n" " print(line, end=\"\")" @@ -975,7 +1003,7 @@ msgstr "" "for line in open(\"myfile.txt\"):\n" " print(line, end=\"\")" -#: ../../tutorial/errors.rst:477 +#: ../../tutorial/errors.rst:497 msgid "" "The problem with this code is that it leaves the file open for an " "indeterminate amount of time after this part of the code has finished " @@ -989,7 +1017,7 @@ msgstr "" "keyword:`with` 陳述式讓物件(例如檔案)在被使用時,能保證它們總是及時、正確地" "被清理。 ::" -#: ../../tutorial/errors.rst:483 +#: ../../tutorial/errors.rst:503 msgid "" "with open(\"myfile.txt\") as f:\n" " for line in f:\n" @@ -999,7 +1027,7 @@ msgstr "" " for line in f:\n" " print(line, end=\"\")" -#: ../../tutorial/errors.rst:487 +#: ../../tutorial/errors.rst:507 msgid "" "After the statement is executed, the file *f* is always closed, even if a " "problem was encountered while processing the lines. Objects which, like " @@ -1009,11 +1037,11 @@ msgstr "" "陳述式執行完畢後,就算是在處理內容時遇到問題,檔案 *f* 總是會被關閉。和檔案一" "樣,提供預定義清理動作的物件會在說明文件中表明這一點。" -#: ../../tutorial/errors.rst:495 +#: ../../tutorial/errors.rst:515 msgid "Raising and Handling Multiple Unrelated Exceptions" msgstr "引發及處理多個無關的例外" -#: ../../tutorial/errors.rst:497 +#: ../../tutorial/errors.rst:517 msgid "" "There are situations where it is necessary to report several exceptions that " "have occurred. This is often the case in concurrency frameworks, when " @@ -1025,7 +1053,7 @@ msgstr "" "中經常會出現這種情況,當平行的 (parallel) 某些任務可能已經失效,但還有其他用" "例 (use case) 希望能繼續執行並收集多個例外,而不是只有引發第一個例外時。" -#: ../../tutorial/errors.rst:503 +#: ../../tutorial/errors.rst:523 msgid "" "The builtin :exc:`ExceptionGroup` wraps a list of exception instances so " "that they can be raised together. It is an exception itself, so it can be " @@ -1035,7 +1063,8 @@ msgstr "" "(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像任何" "其他例外一樣被捕獲。 ::" -#: ../../tutorial/errors.rst:507 +#: ../../tutorial/errors.rst:527 +#, fuzzy msgid "" ">>> def f():\n" "... excs = [OSError('error 1'), SystemError('error 2')]\n" @@ -1044,8 +1073,11 @@ msgid "" ">>> f()\n" " + Exception Group Traceback (most recent call last):\n" " | File \"\", line 1, in \n" +" | f()\n" +" | ~^^\n" " | File \"\", line 3, in f\n" -" | ExceptionGroup: there were problems\n" +" | raise ExceptionGroup('there were problems', excs)\n" +" | ExceptionGroup: there were problems (2 sub-exceptions)\n" " +-+---------------- 1 ----------------\n" " | OSError: error 1\n" " +---------------- 2 ----------------\n" @@ -1081,7 +1113,7 @@ msgstr "" "caught : e\n" ">>>" -#: ../../tutorial/errors.rst:529 +#: ../../tutorial/errors.rst:552 msgid "" "By using ``except*`` instead of ``except``, we can selectively handle only " "the exceptions in the group that match a certain type. In the following " @@ -1094,7 +1126,8 @@ msgstr "" "``except*`` 子句分別從該群組中提取一個特定類型的例外,同時讓所有其他的例外都" "傳遞到其他子句,最後再被重新引發。 ::" -#: ../../tutorial/errors.rst:536 +#: ../../tutorial/errors.rst:559 +#, fuzzy msgid "" ">>> def f():\n" "... raise ExceptionGroup(\n" @@ -1123,10 +1156,15 @@ msgid "" "There were SystemErrors\n" " + Exception Group Traceback (most recent call last):\n" " | File \"\", line 2, in \n" +" | f()\n" +" | ~^^\n" " | File \"\", line 2, in f\n" -" | ExceptionGroup: group1\n" +" | raise ExceptionGroup(\n" +" | ...<12 lines>...\n" +" | )\n" +" | ExceptionGroup: group1 (1 sub-exception)\n" " +-+---------------- 1 ----------------\n" -" | ExceptionGroup: group2\n" +" | ExceptionGroup: group2 (1 sub-exception)\n" " +-+---------------- 1 ----------------\n" " | RecursionError: 4\n" " +------------------------------------\n" @@ -1168,7 +1206,7 @@ msgstr "" " +------------------------------------\n" ">>>" -#: ../../tutorial/errors.rst:572 +#: ../../tutorial/errors.rst:600 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 " @@ -1178,7 +1216,7 @@ msgstr "" "請注意,被巢套在例外群組中的例外必須是實例,而不是類型。這是因為在實務上,這" "些例外通常是已經被程式引發並捕獲的例外,類似以下的模式: ::" -#: ../../tutorial/errors.rst:577 +#: ../../tutorial/errors.rst:605 msgid "" ">>> excs = []\n" "... for test in tests:\n" @@ -1202,11 +1240,11 @@ msgstr "" "... raise ExceptionGroup(\"Test Failures\", excs)\n" "..." -#: ../../tutorial/errors.rst:592 +#: ../../tutorial/errors.rst:620 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:594 +#: ../../tutorial/errors.rst:622 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -1222,7 +1260,8 @@ msgstr "" "的註解清單中。標準的回溯呈現會在例外之後列出所有的註解,並按照其被添加的順序" "來排列。 ::" -#: ../../tutorial/errors.rst:601 +#: ../../tutorial/errors.rst:629 +#, fuzzy msgid "" ">>> try:\n" "... raise TypeError('bad type')\n" @@ -1233,6 +1272,7 @@ msgid "" "...\n" "Traceback (most recent call last):\n" " File \"\", line 2, in \n" +" raise TypeError('bad type')\n" "TypeError: bad type\n" "Add some information\n" "Add some more information\n" @@ -1252,7 +1292,7 @@ msgstr "" "Add some more information\n" ">>>" -#: ../../tutorial/errors.rst:615 +#: ../../tutorial/errors.rst:644 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 " @@ -1261,7 +1301,8 @@ msgstr "" "例如,在將例外收集到例外群組中時,我們可能希望為各個錯誤添加一些上下文的資" "訊。在以下範例中,群組中的每個例外都有一條註解,指示此錯誤是在何時發生。 ::" -#: ../../tutorial/errors.rst:619 +#: ../../tutorial/errors.rst:648 +#, fuzzy msgid "" ">>> def f():\n" "... raise OSError('operation failed')\n" @@ -1277,23 +1318,33 @@ msgid "" ">>> raise ExceptionGroup('We have some problems', excs)\n" " + Exception Group Traceback (most recent call last):\n" " | File \"\", line 1, in \n" +" | raise ExceptionGroup('We have some problems', excs)\n" " | ExceptionGroup: We have some problems (3 sub-exceptions)\n" " +-+---------------- 1 ----------------\n" " | Traceback (most recent call last):\n" " | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" " | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" " | OSError: operation failed\n" " | Happened in Iteration 1\n" " +---------------- 2 ----------------\n" " | Traceback (most recent call last):\n" " | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" " | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" " | OSError: operation failed\n" " | Happened in Iteration 2\n" " +---------------- 3 ----------------\n" " | Traceback (most recent call last):\n" " | File \"\", line 3, in \n" +" | f()\n" +" | ~^^\n" " | File \"\", line 2, in f\n" +" | raise OSError('operation failed')\n" " | OSError: operation failed\n" " | Happened in Iteration 3\n" " +------------------------------------\n" diff --git a/using/android.po b/using/android.po new file mode 100644 index 0000000000..dfdfe80f89 --- /dev/null +++ b/using/android.po @@ -0,0 +1,144 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../using/android.rst:5 +msgid "Using Python on Android" +msgstr "" + +#: ../../using/android.rst:7 +msgid "" +"Python on Android is unlike Python on desktop platforms. On a desktop " +"platform, Python is generally installed as a system resource that can be " +"used by any user of that computer. Users then interact with Python by " +"running a :program:`python` executable and entering commands at an " +"interactive prompt, or by running a Python script." +msgstr "" + +#: ../../using/android.rst:13 +msgid "" +"On Android, there is no concept of installing as a system resource. The only " +"unit of software distribution is an \"app\". There is also no console where " +"you could run a :program:`python` executable, or interact with a Python REPL." +msgstr "" + +#: ../../using/android.rst:17 +msgid "" +"As a result, the only way you can use Python on Android is in embedded mode " +"– that is, by writing a native Android application, embedding a Python " +"interpreter using ``libpython``, and invoking Python code using the :ref:" +"`Python embedding API `. The full Python interpreter, the " +"standard library, and all your Python code is then packaged into your app " +"for its own private use." +msgstr "" + +#: ../../using/android.rst:23 +msgid "" +"The Python standard library has some notable omissions and restrictions on " +"Android. See the :ref:`API availability guide ` for " +"details." +msgstr "" + +#: ../../using/android.rst:28 +msgid "Adding Python to an Android app" +msgstr "" + +#: ../../using/android.rst:30 +msgid "" +"These instructions are only needed if you're planning to compile Python for " +"Android yourself. Most users should *not* need to do this. Instead, use one " +"of the following tools, which will provide a much easier experience:" +msgstr "" + +#: ../../using/android.rst:34 +msgid "" +"`Briefcase `__, from the BeeWare project" +msgstr "" + +#: ../../using/android.rst:35 +msgid "`Buildozer `__, from the Kivy project" +msgstr "" + +#: ../../using/android.rst:36 +msgid "`Chaquopy `__" +msgstr "" + +#: ../../using/android.rst:37 +msgid "" +"`pyqtdeploy `__" +msgstr "" + +#: ../../using/android.rst:38 +msgid "`Termux `__" +msgstr "" + +#: ../../using/android.rst:40 +msgid "" +"If you're sure you want to do all of this manually, read on. You can use " +"the :source:`testbed app ` as a guide; each step below " +"contains a link to the relevant file." +msgstr "" + +#: ../../using/android.rst:44 +msgid "" +"Build Python by following the instructions in :source:`Android/README.md`." +msgstr "" + +#: ../../using/android.rst:46 +msgid "" +"Add code to your :source:`build.gradle ` file to copy the following items into your project. All except your " +"own Python code can be copied from ``cross-build/HOST/prefix/lib``:" +msgstr "" + +#: ../../using/android.rst:50 +msgid "In your JNI libraries:" +msgstr "" + +#: ../../using/android.rst:52 +msgid "``libpython*.*.so``" +msgstr "" + +#: ../../using/android.rst:53 +msgid "``lib*_python.so`` (external libraries such as OpenSSL)" +msgstr "" + +#: ../../using/android.rst:55 +msgid "In your assets:" +msgstr "" + +#: ../../using/android.rst:57 +msgid "``python*.*`` (the Python standard library)" +msgstr "" + +#: ../../using/android.rst:58 +msgid "``python*.*/site-packages`` (your own Python code)" +msgstr "" + +#: ../../using/android.rst:60 +msgid "" +"Add code to your app to :source:`extract the assets to the filesystem " +"`." +msgstr "" + +#: ../../using/android.rst:63 +msgid "" +"Add code to your app to :source:`start Python in embedded mode `. This will need to be C code called " +"via JNI." +msgstr "" diff --git a/using/ios.po b/using/ios.po index 2d702dba27..f2c2df9111 100644 --- a/using/ios.po +++ b/using/ios.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -115,7 +115,7 @@ msgstr "" #: ../../using/ios.rst:65 msgid "" "The Python standard library has some notable omissions and restrictions on " -"iOS. See the :ref:`API availability guide for iOS ` for " +"iOS. See the :ref:`API availability guide for iOS ` for " "details." msgstr "" diff --git a/using/mac.po b/using/mac.po index 9ece55a5c4..8654f0c004 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -292,7 +292,7 @@ msgstr "有許多替代 macOS GUI 工具套件可用:" #, fuzzy msgid "" "`PySide `__: Official Python bindings to " -"the `Qt GUI toolkit `__." +"the `Qt GUI toolkit `__." msgstr "" "`PySide `__:`Qt GUI 工具包 `__\\ 的官方 Python 繫結。" diff --git a/using/windows.po b/using/windows.po index 2ef76eb5e5..eb8767e023 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1146,7 +1146,8 @@ msgstr "" #: ../../using/windows.rst:611 #, fuzzy -msgid "`Enthought Deployment Manager `_" +msgid "" +"`Enthought Deployment Manager `_" msgstr "" "`Enthought Deployment Manager `_" @@ -2302,7 +2303,7 @@ msgstr "" #: ../../using/windows.rst:1308 #, fuzzy msgid "" -"`Win32 How Do I...? `_" +"`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index f8d6f7d7ed..0ce16b670d 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1043,8 +1043,12 @@ msgid "" msgstr "" #: ../../whatsnew/2.4.rst:687 -msgid "http://www.lahey.com/float.htm" +msgid "" +"`http://www.lahey.com/float.htm `__" msgstr "" +"`http://www.lahey.com/float.htm `__" #: ../../whatsnew/2.4.rst:688 msgid "" @@ -1054,7 +1058,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:691 #, fuzzy -msgid "http://speleotrove.com/decimal/" +msgid "https://speleotrove.com/decimal/" msgstr "https://speleotrove.com/decimal/" #: ../../whatsnew/2.4.rst:692 @@ -1159,11 +1163,12 @@ msgstr "" #: ../../whatsnew/2.4.rst:759 msgid "" -"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." +"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." msgstr "" #: ../../whatsnew/2.4.rst:768 @@ -2373,10 +2378,3 @@ msgstr "universal newlines" #: ../../whatsnew/2.4.rst:415 msgid "What's new" msgstr "What's new(有什麼新功能)" - -#~ msgid "" -#~ "`http://www.lahey.com/float.htm `__" -#~ msgstr "" -#~ "`http://www.lahey.com/float.htm `__" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 381ebe4260..8eaa5f46cd 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -2132,8 +2132,8 @@ msgid "" "The :func:`~ssl.SSLContext.wrap_socket` constructor function now takes a " "*ciphers* argument that's a string listing the encryption algorithms to be " "allowed; the format of the string is described `in the OpenSSL documentation " -"`__. (Added by " -"Antoine Pitrou; :issue:`8322`.)" +"`__. (Added by Antoine " +"Pitrou; :issue:`8322`.)" msgstr "" #: ../../whatsnew/2.7.rst:1554 @@ -2846,14 +2846,14 @@ 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 elements " -"as ```` instead of ````, and text mode will skip over " -"elements and only output the text chunks. If you set the :attr:`~xml.etree." -"ElementTree.Element.tag` attribute of an element to ``None`` but leave its " -"children in place, the element will be omitted when the tree is written out, " -"so you don't need to do more extensive rearrangement to remove a single " -"element." +"`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:" +"`~xml.etree.ElementTree.Element.tag` attribute of an element to ``None`` but " +"leave its children in place, the element will be omitted when the tree is " +"written out, so you don't need to do more extensive rearrangement to remove " +"a single element." msgstr "" #: ../../whatsnew/2.7.rst:2044 @@ -3675,17 +3675,18 @@ msgstr "" #: ../../whatsnew/2.7.rst:2683 msgid "" -"As `discussed in the PEP`__, platform packagers may choose not to install " -"these commands by default, as long as, when invoked, they provide clear and " -"simple directions on how to install them on that platform (usually using the " -"system package manager)." +"As :pep:`discussed in the PEP <0477#disabling-ensurepip-by-downstream-" +"distributors>`, platform packagers may choose not to install these commands " +"by default, as long as, when invoked, they provide clear and simple " +"directions on how to install them on that platform (usually using the system " +"package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2692 +#: ../../whatsnew/2.7.rst:2690 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2694 +#: ../../whatsnew/2.7.rst:2692 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3695,29 +3696,29 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2702 +#: ../../whatsnew/2.7.rst:2700 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" "ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/2.7.rst:2708 +#: ../../whatsnew/2.7.rst:2706 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2709 +#: ../../whatsnew/2.7.rst:2707 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/2.7.rst:2713 +#: ../../whatsnew/2.7.rst:2711 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2715 +#: ../../whatsnew/2.7.rst:2713 msgid "" ":pep:`476` updated :mod:`httplib ` and modules which use it, such as :" "mod:`urllib2 ` and :mod:`xmlrpclib `, to now " @@ -3727,13 +3728,13 @@ msgid "" "for many applications. This change was made in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2723 +#: ../../whatsnew/2.7.rst:2721 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2726 +#: ../../whatsnew/2.7.rst:2724 msgid "" "import urllib2\n" "import ssl\n" @@ -3748,11 +3749,11 @@ msgid "" "urllib2.urlopen(\"https://invalid-cert\", context=context)" msgstr "" -#: ../../whatsnew/2.7.rst:2740 +#: ../../whatsnew/2.7.rst:2738 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2742 +#: ../../whatsnew/2.7.rst:2740 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3761,14 +3762,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2748 +#: ../../whatsnew/2.7.rst:2746 msgid "" "These tools are intended for use in cases where affected applications and " "services can't be modified to explicitly pass a more permissive SSL context " "when establishing the connection." msgstr "" -#: ../../whatsnew/2.7.rst:2752 +#: ../../whatsnew/2.7.rst:2750 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3776,18 +3777,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2757 +#: ../../whatsnew/2.7.rst:2755 msgid "" "For cases where the connection establishment code can't be modified, but the " "overall application can be, the new :func:`!ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2763 +#: ../../whatsnew/2.7.rst:2761 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2765 +#: ../../whatsnew/2.7.rst:2763 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3795,43 +3796,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2770 +#: ../../whatsnew/2.7.rst:2768 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/2.7.rst:2774 +#: ../../whatsnew/2.7.rst:2772 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2777 ../../whatsnew/2.7.rst:2790 +#: ../../whatsnew/2.7.rst:2775 ../../whatsnew/2.7.rst:2788 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/2.7.rst:2783 +#: ../../whatsnew/2.7.rst:2781 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2785 +#: ../../whatsnew/2.7.rst:2783 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/2.7.rst:2788 +#: ../../whatsnew/2.7.rst:2786 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/2.7.rst:2799 +#: ../../whatsnew/2.7.rst:2797 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2801 +#: ../../whatsnew/2.7.rst:2799 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 3c3f4d6e2c..455bd09e90 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -239,11 +239,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:156 msgid "" -":pep:`632`: Remove the :mod:`!distutils` package. See `the migration guide " -"`_ for advice replacing " -"the APIs it provided. The third-party `Setuptools `__ package continues to " -"provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond." +":pep:`632`: Remove the :mod:`!distutils` package. See :pep:`the migration " +"guide <0632#migration-advice>` for advice replacing the APIs it provided. " +"The third-party `Setuptools `__ package continues to provide :mod:`!distutils`, if " +"you still require it in Python 3.12 and beyond." msgstr "" #: ../../whatsnew/3.12.rst:163 @@ -525,7 +525,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:361 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" -"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +"interpreter GIL, see ``Modules/_xxsubinterpretersmodule.c``." msgstr "" #: ../../whatsnew/3.12.rst:364 @@ -1936,8 +1936,9 @@ msgid "" "warning to raise awareness as issues encountered by code doing this are " "becoming more frequent. See the :func:`os.fork` documentation for more " "details along with `this discussion on fork being incompatible with threads " -"`_ for *why* we're now surfacing this " -"longstanding platform compatibility problem to developers." +"`_ for *why* we're now surfacing this longstanding " +"platform compatibility problem to developers." msgstr "" #: ../../whatsnew/3.12.rst:1260 @@ -1993,6 +1994,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2405,114 +2407,126 @@ msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:4 +#, fuzzy +msgid ":mod:`ctypes`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:9 +#, fuzzy +msgid ":mod:`http.server`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +#, fuzzy msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." msgstr "" ":class:`http.server.CGIHTTPRequestHandler` 將會被移除,連同其相關的 ``--" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:17 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:20 +#, fuzzy +msgid ":class:`locale`:" +msgstr ":class:`!ast.Bytes`" + +#: ../../deprecations/pending-removal-in-3.15.rst:22 +#, fuzzy +msgid "" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" ":class:`locale`::func:`locale.getdefaultlocale` 已在 Python 3.11 中被棄用," "原本計劃在 Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:16 +#: ../../deprecations/pending-removal-in-3.15.rst:30 +#, fuzzy +msgid ":mod:`pathlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:32 +#, fuzzy msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. Use :func:`os.path.isreserved` to " -"detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:21 +#: ../../deprecations/pending-removal-in-3.15.rst:36 +#, fuzzy +msgid ":mod:`platform`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" -":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它幾" -"乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita Sobolev " -"於 :gh:`116349` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:27 +#: ../../deprecations/pending-removal-in-3.15.rst:42 +#, fuzzy +msgid ":mod:`threading`:" +msgstr ":mod:`threading` 方法:" + +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" -":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C 版本" -"允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何引數。所" -"有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 Nikita " -"Sobolev 於 :gh:`102029` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid ":class:`typing.NamedTuple`:" -msgstr ":class:`typing.NamedTuple`:" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:52 +#, fuzzy msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" "用於建立 :class:`!NamedTuple` 類別的未以文件記錄之關鍵字引數語法 (``NT = " "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:40 -msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." -msgstr "" -"當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參數" -"的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 *fields* 參" -"數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 Python 3.15 中" -"會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請使用 ``class " -"NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:47 -msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." -msgstr "" -":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別時," -"沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄用,將 " -"``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也已被棄用。" -"這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!TypedDict` " -"類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = TypedDict(\"TD\", " -"{})``。" - -#: ../../deprecations/pending-removal-in-3.15.rst:54 -msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +#: ../../deprecations/pending-removal-in-3.15.rst:58 +msgid "" +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +#, fuzzy +msgid ":mod:`wave`:" +msgstr ":mod:`os`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +#, fuzzy +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" ":mod:`wave`:已棄用 :class:`wave.Wave_read` 和 :class:`wave.Wave_write` 類別" "的 ``getmark()``、``setmark()`` 和 ``getmarkers()`` 方法。它們將在 Python " @@ -2523,24 +2537,76 @@ msgid "Pending Removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:4 +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." msgstr "" -":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改用 " -"``'w'`` 型別 (``Py_UCS4``)。" -#: ../../deprecations/pending-removal-in-3.16.rst:8 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." -msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" +#: ../../deprecations/pending-removal-in-3.16.rst:13 +#, fuzzy +msgid ":mod:`array`:" +msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.16.rst:11 +#: ../../deprecations/pending-removal-in-3.16.rst:15 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:21 +#, fuzzy +msgid ":mod:`shutil`:" +msgstr ":mod:`os`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:23 +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +#, fuzzy +msgid ":mod:`symtable`:" +msgstr ":mod:`sqlite3`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:30 +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:33 +#, fuzzy +msgid ":mod:`sys`:" +msgstr ":mod:`os`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:35 +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:39 +#, fuzzy +msgid ":mod:`tarfile`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:41 +msgid "" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" -":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." -"get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -2563,10 +2629,6 @@ msgstr ":mod:`argparse`:已棄用巢狀引數群組和巢狀互斥群組。" msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)" -#: ../../deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr ":mod:`builtins`:" - #: ../../deprecations/pending-removal-in-future.rst:14 msgid "``bool(NotImplemented)``." msgstr "``bool(NotImplemented)``。" @@ -4704,164 +4766,191 @@ msgid "" msgstr "設定 Python 初始化的函式,Python 3.11 中已被棄用:" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 -msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +#, fuzzy +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgvEx()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 -msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +#, fuzzy +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "``PySys_SetArgv()``:請改以 :c:member:`PyConfig.argv` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 -msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:16 +#, fuzzy +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" "``Py_SetProgramName()``:請改以 :c:member:`PyConfig.program_name` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 -msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:18 +#, fuzzy +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "``Py_SetPythonHome()``:請改以 :c:member:`PyConfig.home` 設定。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 msgid "Global configuration variables:" msgstr "全域設定變數:" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 -msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +#, fuzzy +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." msgstr ":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 -msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +#, fuzzy +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." msgstr ":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 -msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#, fuzzy +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." msgstr ":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#, fuzzy msgid "" -":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." msgstr ":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 -msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#, fuzzy +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." msgstr ":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:36 +#, fuzzy msgid "" -":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " "instead." msgstr "" ":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 -msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#, fuzzy +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." msgstr ":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#, fuzzy msgid "" -":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." msgstr "" ":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#, fuzzy msgid "" -":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." msgstr "" ":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:44 +#, fuzzy msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." "use_environment`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 +#, fuzzy msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." "write_bytecode`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 +#, fuzzy msgid "" -":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." "user_site_directory` instead." msgstr "" ":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." "user_site_directory`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 +#, fuzzy msgid "" -":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " "instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:52 +#, fuzzy msgid "" -":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed` instead." msgstr "" ":c:var:`Py_HashRandomizationFlag`:請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 -msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:55 +#, fuzzy +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." "legacy_windows_fs_encoding` instead." msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 +#, fuzzy msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." "legacy_windows_stdio` instead." msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." "legacy_windows_stdio`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 +#, fuzzy msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 +#, fuzzy msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." "filesystem_errors` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." "filesystem_errors`。" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 +#, fuzzy msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" "c:func:`Py_PreInitialize`)" msgstr "" ":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" @@ -4872,64 +4961,70 @@ msgid "The bundled copy of ``libmpdecimal``." msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 +#, fuzzy msgid "" -":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " -"instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 -msgid ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" - #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." -msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 -msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." -msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" +#, fuzzy +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GET_OBJECT`:請改用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 -msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +#, fuzzy +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr ":c:type:`Py_UNICODE` type:請改用 :c:type:`wchar_t`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 +#, fuzzy msgid "" -":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 -msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +#, fuzzy +msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +#, fuzzy +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 -msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#, fuzzy +msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 -msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 +#, fuzzy +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 +#, fuzzy +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 +#, fuzzy msgid "" -":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" @@ -4942,84 +5037,99 @@ msgid "" msgstr "下列 API 已被棄用並將會被移除,不過目前尚未訂定移除日期。" #: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +#, fuzzy +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:8 -msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#, fuzzy +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#, fuzzy msgid "" -":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:" "`PyErr_GetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#, fuzzy msgid "" -":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#, fuzzy msgid "" -":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " "instead." msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:12 -msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#, fuzzy +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 +#, fuzzy msgid "" -":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` instead." msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +#: ../../deprecations/c-api-pending-removal-in-future.rst:25 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 +#, fuzzy msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:18 -msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#, fuzzy +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +#, fuzzy +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +#: ../../deprecations/c-api-pending-removal-in-future.rst:33 +#, fuzzy msgid "" -":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#: ../../deprecations/c-api-pending-removal-in-future.rst:35 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." @@ -5027,42 +5137,48 @@ msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" "`PyObject_Hash`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +#: ../../deprecations/c-api-pending-removal-in-future.rst:38 msgid "Thread Local Storage (TLS) API:" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +#: ../../deprecations/c-api-pending-removal-in-future.rst:40 +#, fuzzy msgid "" -":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:42 +#, fuzzy +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +#: ../../deprecations/c-api-pending-removal-in-future.rst:44 +#, fuzzy msgid "" -":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#: ../../deprecations/c-api-pending-removal-in-future.rst:46 +#, fuzzy msgid "" -":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +#: ../../deprecations/c-api-pending-removal-in-future.rst:48 +#, fuzzy msgid "" -":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " "instead." msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`。" -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +#: ../../deprecations/c-api-pending-removal-in-future.rst:50 +#, fuzzy +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" #: ../../whatsnew/3.12.rst:2224 @@ -5120,6 +5236,86 @@ msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" "`85858` 中貢獻。)" +#~ msgid "" +#~ ":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " +#~ "removed in 3.15. It was largely untested, had a confusing API, and was " +#~ "only useful for Jython support. (Contributed by Nikita Sobolev in :gh:" +#~ "`116349`.)" +#~ msgstr "" +#~ ":mod:`platform`::func:`~platform.java_ver` 已被棄用並將在 3.15 中移除。它" +#~ "幾乎沒有被測試過,API 令人困惑並且只對 Jython 支援有用。 (由 Nikita " +#~ "Sobolev 於 :gh:`116349` 貢獻。)" + +#~ msgid "" +#~ ":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " +#~ "deprecated. C version allows any numbers of args and kwargs, but they are " +#~ "just ignored. Python version does not allow any arguments. All arguments " +#~ "will be removed from :func:`threading.RLock` in Python 3.15. (Contributed " +#~ "by Nikita Sobolev in :gh:`102029`.)" +#~ msgstr "" +#~ ":mod:`threading`:對 :func:`threading.RLock` 傳遞任何引數現在已被棄用。C " +#~ "版本允許任意數量的引數和關鍵字引數,但它們會被忽略。Python 版本不允許任何" +#~ "引數。所有引數將在 Python 3.15 中從 :func:`threading.RLock` 中移除。 (由 " +#~ "Nikita Sobolev 於 :gh:`102029` 貢獻。)" + +#~ msgid ":class:`typing.NamedTuple`:" +#~ msgstr ":class:`typing.NamedTuple`:" + +#~ msgid "" +#~ "When using the functional syntax to create a :class:`!NamedTuple` class, " +#~ "failing to pass a value to the *fields* parameter (``NT = " +#~ "NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " +#~ "parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both " +#~ "will be disallowed in Python 3.15. To create a :class:`!NamedTuple` class " +#~ "with 0 fields, use ``class NT(NamedTuple): pass`` or ``NT = " +#~ "NamedTuple(\"NT\", [])``." +#~ msgstr "" +#~ "當使用函式語法來建立 :class:`!NamedTuple` 類別時,沒將值傳遞給 *fields* 參" +#~ "數的方式 (``NT = NamedTuple(\"NT\")``) 已被棄用,將 ``None`` 傳遞給 " +#~ "*fields* 參數(``NT = NamedTuple(\"NT\", None)``)也已被棄用。這兩者將在 " +#~ "Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:`!NamedTuple` 類別,請" +#~ "使用 ``class NT(NamedTuple): pass`` 或 ``NT = NamedTuple(\"NT\", [])``。" + +#~ msgid "" +#~ ":class:`typing.TypedDict`: When using the functional syntax to create a :" +#~ "class:`!TypedDict` class, failing to pass a value to the *fields* " +#~ "parameter (``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to " +#~ "the *fields* parameter (``TD = TypedDict(\"TD\", None)``) is also " +#~ "deprecated. Both will be disallowed in Python 3.15. To create a :class:`!" +#~ "TypedDict` class with 0 fields, use ``class TD(TypedDict): pass`` or ``TD " +#~ "= TypedDict(\"TD\", {})``." +#~ msgstr "" +#~ ":class:`typing.TypedDict`:當使用函式語法來建立 :class:`!TypedDict` 類別" +#~ "時,沒將值傳遞給 *fields* 參數的方式(``TD = TypedDict(\"TD\")``)已被棄" +#~ "用,將 ``None`` 傳遞給 *fields* 參數(``TD = TypedDict(\"TD\", None)``)也" +#~ "已被棄用。這兩者將在 Python 3.15 中會被禁止。要建立一個沒有欄位的 :class:" +#~ "`!TypedDict` 類別,請使用 ``class TD(TypedDict): pass`` 或 ``TD = " +#~ "TypedDict(\"TD\", {})``。" + +#~ msgid "" +#~ ":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use " +#~ "the ``'w'`` type instead (``Py_UCS4``)." +#~ msgstr "" +#~ ":mod:`array`::class:`array.array` ``'u'`` 型別 (:c:type:`wchar_t`):請改" +#~ "用 ``'w'`` 型別 (``Py_UCS4``)。" + +#~ msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#~ msgstr ":mod:`builtins`:``~bool``,對 bool 進行位元反轉。" + +#~ msgid "" +#~ ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " +#~ "lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +#~ msgstr "" +#~ ":mod:`symtable`:由於並沒有太多關注,已棄用 :meth:`symtable.Class." +#~ "get_methods`。 (由 Bénédikt Tran 於 :gh:`119698` 貢獻。)" + +#~ msgid "" +#~ ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." +#~ msgstr ":c:func:`PyWeakref_GetObject`:請改用 :c:func:`PyWeakref_GetRef`。" + +#~ msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +#~ msgstr ":c:type:`!Py_UNICODE_WIDE` type:請改用 :c:type:`wchar_t`。" + #~ msgid "Notable changes in 3.12.4" #~ msgstr "3.12.4 中的顯著變更" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 380acd14d1..0f78043e87 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,11 +22,11 @@ msgid "What's New In Python 3.13" msgstr "" #: ../../whatsnew/3.13.rst:0 -msgid "Editor" +msgid "Editors" msgstr "" #: ../../whatsnew/3.13.rst:6 -msgid "Thomas Wouters" +msgid "Adam Turner and Thomas Wouters" msgstr "" #: ../../whatsnew/3.13.rst:48 @@ -41,17 +41,10 @@ msgid ":pep:`719` -- Python 3.13 Release Schedule" msgstr "" #: ../../whatsnew/3.13.rst:58 -msgid "" -"Prerelease users should be aware that this document is currently in draft " -"form. It will be updated substantially as Python 3.13 moves towards release, " -"so it's worth checking back even after reading earlier versions." -msgstr "" - -#: ../../whatsnew/3.13.rst:64 msgid "Summary -- Release Highlights" msgstr "" -#: ../../whatsnew/3.13.rst:69 +#: ../../whatsnew/3.13.rst:63 msgid "" "Python 3.13 will be the latest stable release of the Python programming " "language, with a mix of changes to the language, the implementation and the " @@ -62,7 +55,7 @@ msgid "" "`744`)." msgstr "" -#: ../../whatsnew/3.13.rst:78 +#: ../../whatsnew/3.13.rst:72 msgid "" "Error messages continue to improve, with tracebacks now highlighted in color " "by default. The :func:`locals` builtin now has :ref:`defined semantics " @@ -70,7 +63,7 @@ msgid "" "parameters now support default values." msgstr "" -#: ../../whatsnew/3.13.rst:83 +#: ../../whatsnew/3.13.rst:77 msgid "" "The library changes contain removal of deprecated APIs and modules, as well " "as the usual improvements in user-friendliness and correctness. Several " @@ -78,7 +71,7 @@ msgid "" "pep594_>`_ following their deprecation in Python 3.11 (:pep:`594`)." msgstr "" -#: ../../whatsnew/3.13.rst:88 +#: ../../whatsnew/3.13.rst:82 msgid "" "This article doesn't attempt to provide a complete specification of all new " "features, but instead gives a convenient overview. For full details refer to " @@ -90,18 +83,18 @@ msgid "" "guidance on upgrading from earlier versions of Python." msgstr "" -#: ../../whatsnew/3.13.rst:104 +#: ../../whatsnew/3.13.rst:98 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.13.rst:106 +#: ../../whatsnew/3.13.rst:100 msgid "" "A greatly improved :ref:`interactive interpreter ` and :ref:`improved error messages `." msgstr "" -#: ../../whatsnew/3.13.rst:109 +#: ../../whatsnew/3.13.rst:103 msgid "" ":pep:`667`: The :func:`locals` builtin now has :ref:`defined semantics " "` when mutating the returned mapping. Python " @@ -109,14 +102,14 @@ msgid "" "optimized scopes even during concurrent code execution." msgstr "" -#: ../../whatsnew/3.13.rst:114 +#: ../../whatsnew/3.13.rst:108 msgid "" ":pep:`703`: CPython 3.13 has experimental support for running with the :term:" "`global interpreter lock` disabled. See :ref:`Free-threaded CPython " "` for more details." msgstr "" -#: ../../whatsnew/3.13.rst:117 +#: ../../whatsnew/3.13.rst:111 msgid "" ":pep:`744`: A basic :ref:`JIT compiler ` was " "added. It is currently disabled by default (though we may turn it on later). " @@ -124,7 +117,7 @@ msgid "" "next few releases." msgstr "" -#: ../../whatsnew/3.13.rst:121 +#: ../../whatsnew/3.13.rst:115 msgid "" "Color support in the new :ref:`interactive interpreter `, as well as in :ref:`tracebacks `." msgstr "" -#: ../../whatsnew/3.13.rst:138 +#: ../../whatsnew/3.13.rst:132 msgid "" "The :mod:`argparse` module now supports deprecating command-line options, " "positional arguments, and subcommands." msgstr "" -#: ../../whatsnew/3.13.rst:140 +#: ../../whatsnew/3.13.rst:134 msgid "" "The new functions :func:`base64.z85encode` and :func:`base64.z85decode` " "support encoding and decoding `Z85 data`_." msgstr "" -#: ../../whatsnew/3.13.rst:142 +#: ../../whatsnew/3.13.rst:136 msgid "" "The :mod:`copy` module now has a :func:`copy.replace` function, with support " "for many builtin types and any class defining the :func:`~object." "__replace__` method." msgstr "" -#: ../../whatsnew/3.13.rst:145 -msgid "The :mod:`dbm.sqlite3` module is now the default :mod:`dbm` backend." +#: ../../whatsnew/3.13.rst:139 +msgid "" +"The new :mod:`dbm.sqlite3` module is now the default :mod:`dbm` backend." msgstr "" -#: ../../whatsnew/3.13.rst:146 +#: ../../whatsnew/3.13.rst:140 msgid "" "The :mod:`os` module has a :ref:`suite of new functions ` for " "working with Linux's timer notification file descriptors." msgstr "" -#: ../../whatsnew/3.13.rst:148 +#: ../../whatsnew/3.13.rst:142 msgid "" "The :mod:`random` module now has a :ref:`command-line interface `." msgstr "" -#: ../../whatsnew/3.13.rst:150 +#: ../../whatsnew/3.13.rst:144 msgid "Security improvements:" msgstr "" -#: ../../whatsnew/3.13.rst:152 +#: ../../whatsnew/3.13.rst:146 msgid "" ":func:`ssl.create_default_context` sets :data:`ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`ssl.VERIFY_X509_STRICT` as default " "flags." msgstr "" -#: ../../whatsnew/3.13.rst:155 +#: ../../whatsnew/3.13.rst:149 msgid "C API improvements:" msgstr "" -#: ../../whatsnew/3.13.rst:157 +#: ../../whatsnew/3.13.rst:151 msgid "" "The :c:data:`Py_mod_gil` slot is now used to indicate that an extension " "module supports running with the :term:`GIL` disabled." msgstr "" -#: ../../whatsnew/3.13.rst:159 +#: ../../whatsnew/3.13.rst:153 msgid "" "The :doc:`PyTime C API ` has been added, providing access to " "system clocks." msgstr "" -#: ../../whatsnew/3.13.rst:161 +#: ../../whatsnew/3.13.rst:155 msgid "" ":c:type:`PyMutex` is a new lightweight mutex that occupies a single byte." msgstr "" -#: ../../whatsnew/3.13.rst:163 +#: ../../whatsnew/3.13.rst:156 +msgid "" +"There is a new :ref:`suite of functions ` for generating :" +"pep:`669` monitoring events in the C API." +msgstr "" + +#: ../../whatsnew/3.13.rst:159 msgid "New typing features:" msgstr "" -#: ../../whatsnew/3.13.rst:165 +#: ../../whatsnew/3.13.rst:161 msgid "" ":pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing." "ParamSpec`, and :data:`typing.TypeVarTuple`) now support defaults." msgstr "" -#: ../../whatsnew/3.13.rst:167 +#: ../../whatsnew/3.13.rst:163 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator adds support for " -"marking deprecations in the type system." +"marking deprecations in the type system and at runtime." msgstr "" -#: ../../whatsnew/3.13.rst:169 +#: ../../whatsnew/3.13.rst:165 msgid "" ":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of a :class:" "`typing.TypedDict` as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:171 +#: ../../whatsnew/3.13.rst:167 msgid "" ":pep:`742`: :data:`typing.TypeIs` provides more intuitive type narrowing " "behavior, as an alternative to :data:`typing.TypeGuard`." msgstr "" -#: ../../whatsnew/3.13.rst:174 +#: ../../whatsnew/3.13.rst:170 msgid "Platform support:" msgstr "" -#: ../../whatsnew/3.13.rst:176 +#: ../../whatsnew/3.13.rst:172 msgid "" ":pep:`730`: Apple's iOS is now an :ref:`officially supported platform " -"`, at :pep:`tier 3 <11#tier-3>`. Official " -"Android support (:pep:`738`) is in the works as well." +"`, at :pep:`tier 3 <11#tier-3>`." msgstr "" -#: ../../whatsnew/3.13.rst:179 +#: ../../whatsnew/3.13.rst:174 +msgid "" +":pep:`738`: Android is now an :ref:`officially supported platform " +"`, at :pep:`tier 3 <11#tier-3>`." +msgstr "" + +#: ../../whatsnew/3.13.rst:176 msgid "" "``wasm32-wasi`` is now supported as a :pep:`tier 2 <11#tier-2>` platform." msgstr "" -#: ../../whatsnew/3.13.rst:180 +#: ../../whatsnew/3.13.rst:177 msgid "``wasm32-emscripten`` is no longer an officially supported platform." msgstr "" -#: ../../whatsnew/3.13.rst:182 +#: ../../whatsnew/3.13.rst:179 msgid "Important removals:" msgstr "" -#: ../../whatsnew/3.13.rst:184 +#: ../../whatsnew/3.13.rst:181 msgid "" -":ref:`PEP 594 `: The remaining 19 \"dead batteries\" " -"have been removed from the standard library: :mod:`!aifc`, :mod:`!audioop`, :" -"mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!crypt`, :mod:`!imghdr`, :" -"mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!nntplib`, :mod:`!" -"ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!spwd`, :mod:`!sunau`, :" -"mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." +":ref:`PEP 594 `: The remaining 19 \"dead " +"batteries\" (legacy stdlib modules) have been removed from the standard " +"library: :mod:`!aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!" +"chunk`, :mod:`!crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:" +"`!nis`, :mod:`!nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!" +"sndhdr`, :mod:`!spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:" +"`!xdrlib`." msgstr "" -#: ../../whatsnew/3.13.rst:190 +#: ../../whatsnew/3.13.rst:187 msgid "" "Remove the :program:`2to3` tool and :mod:`!lib2to3` module (deprecated in " "Python 3.11)." msgstr "" -#: ../../whatsnew/3.13.rst:192 +#: ../../whatsnew/3.13.rst:189 msgid "Remove the :mod:`!tkinter.tix` module (deprecated in Python 3.6)." msgstr "" -#: ../../whatsnew/3.13.rst:193 -msgid "Remove :func:`!locale.resetlocale`." +#: ../../whatsnew/3.13.rst:190 +msgid "Remove the :func:`!locale.resetlocale` function." msgstr "" -#: ../../whatsnew/3.13.rst:194 -msgid "Remove :mod:`!typing.io` and :mod:`!typing.re`." +#: ../../whatsnew/3.13.rst:191 +msgid "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces." msgstr "" -#: ../../whatsnew/3.13.rst:195 +#: ../../whatsnew/3.13.rst:192 msgid "Remove chained :class:`classmethod` descriptors." msgstr "" -#: ../../whatsnew/3.13.rst:197 +#: ../../whatsnew/3.13.rst:194 msgid "Release schedule changes:" msgstr "" -#: ../../whatsnew/3.13.rst:199 +#: ../../whatsnew/3.13.rst:196 msgid "" ":pep:`602` (\"Annual Release Cycle for Python\") has been updated to extend " "the full support ('bugfix') period for new releases to two years. This " "updated policy means that:" msgstr "" -#: ../../whatsnew/3.13.rst:203 +#: ../../whatsnew/3.13.rst:200 msgid "" "Python 3.9--3.12 have one and a half years of full support, followed by " "three and a half years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:205 +#: ../../whatsnew/3.13.rst:202 msgid "" "Python 3.13 and later have two years of full support, followed by three " "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:210 ../../whatsnew/3.13.rst:1954 +#: ../../whatsnew/3.13.rst:207 ../../whatsnew/3.13.rst:2005 msgid "New Features" msgstr "" -#: ../../whatsnew/3.13.rst:216 +#: ../../whatsnew/3.13.rst:213 msgid "A better interactive interpreter" msgstr "" -#: ../../whatsnew/3.13.rst:218 +#: ../../whatsnew/3.13.rst:215 msgid "" "Python now uses a new :term:`interactive` shell by default, based on code " "from the `PyPy project`_. When the user starts the :term:`REPL` from an " "interactive terminal, the following new features are now supported:" msgstr "" -#: ../../whatsnew/3.13.rst:223 +#: ../../whatsnew/3.13.rst:220 msgid "Multiline editing with history preservation." msgstr "" -#: ../../whatsnew/3.13.rst:224 +#: ../../whatsnew/3.13.rst:221 msgid "" "Direct support for REPL-specific commands like :kbd:`help`, :kbd:`exit`, " "and :kbd:`quit`, without the need to call them as functions." msgstr "" -#: ../../whatsnew/3.13.rst:226 +#: ../../whatsnew/3.13.rst:223 msgid "" "Prompts and tracebacks with :ref:`color enabled by default `." msgstr "" -#: ../../whatsnew/3.13.rst:228 +#: ../../whatsnew/3.13.rst:225 msgid "" "Interactive help browsing using :kbd:`F1` with a separate command history." msgstr "" -#: ../../whatsnew/3.13.rst:230 +#: ../../whatsnew/3.13.rst:227 msgid "" "History browsing using :kbd:`F2` that skips output as well as the :term:" "`>>>` and :term:`...` prompts." msgstr "" -#: ../../whatsnew/3.13.rst:232 +#: ../../whatsnew/3.13.rst:229 msgid "" "\"Paste mode\" with :kbd:`F3` that makes pasting larger blocks of code " "easier (press :kbd:`F3` again to return to the regular prompt)." msgstr "" -#: ../../whatsnew/3.13.rst:235 +#: ../../whatsnew/3.13.rst:232 msgid "" "To disable the new interactive shell, set the :envvar:`PYTHON_BASIC_REPL` " "environment variable. For more on interactive mode, see :ref:`tut-interac`." msgstr "" -#: ../../whatsnew/3.13.rst:239 +#: ../../whatsnew/3.13.rst:236 msgid "" "(Contributed by Pablo Galindo Salgado, Łukasz Langa, and Lysandros Nikolaou " "in :gh:`111201` based on code from the PyPy project. Windows support " "contributed by Dino Viehland and Anthony Shaw.)" msgstr "" -#: ../../whatsnew/3.13.rst:249 +#: ../../whatsnew/3.13.rst:246 msgid "Improved error messages" msgstr "" -#: ../../whatsnew/3.13.rst:251 +#: ../../whatsnew/3.13.rst:248 msgid "" "The interpreter now uses color by default when displaying tracebacks in the " "terminal. This feature :ref:`can be controlled ` " @@ -406,14 +412,14 @@ msgid "" "by Pablo Galindo Salgado in :gh:`112730`.)" msgstr "" -#: ../../whatsnew/3.13.rst:266 +#: ../../whatsnew/3.13.rst:263 msgid "" "A common mistake is to write a script with the same name as a standard " "library module. When this results in errors, we now display a more helpful " "error message:" msgstr "" -#: ../../whatsnew/3.13.rst:270 +#: ../../whatsnew/3.13.rst:267 msgid "" "$ python random.py\n" "Traceback (most recent call last):\n" @@ -427,14 +433,14 @@ msgid "" "library module named 'random' and the import system gives it precedence)" msgstr "" -#: ../../whatsnew/3.13.rst:281 +#: ../../whatsnew/3.13.rst:278 msgid "" "Similarly, if a script has the same name as a third-party module that it " "attempts to import and this results in errors, we also display a more " "helpful error message:" msgstr "" -#: ../../whatsnew/3.13.rst:285 +#: ../../whatsnew/3.13.rst:282 msgid "" "$ python numpy.py\n" "Traceback (most recent call last):\n" @@ -448,17 +454,17 @@ msgid "" "intended to import)" msgstr "" -#: ../../whatsnew/3.13.rst:296 +#: ../../whatsnew/3.13.rst:293 msgid "(Contributed by Shantanu Jain in :gh:`95754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:298 +#: ../../whatsnew/3.13.rst:295 msgid "" "The error message now tries to suggest the correct keyword argument when an " "incorrect keyword argument is passed to a function." msgstr "" -#: ../../whatsnew/3.13.rst:301 +#: ../../whatsnew/3.13.rst:298 msgid "" ">>> \"Better error messages!\".split(max_split=1)\n" "Traceback (most recent call last):\n" @@ -469,16 +475,16 @@ msgid "" "mean 'maxsplit'?" msgstr "" -#: ../../whatsnew/3.13.rst:310 +#: ../../whatsnew/3.13.rst:307 msgid "" "(Contributed by Pablo Galindo Salgado and Shantanu Jain in :gh:`107944`.)" msgstr "" -#: ../../whatsnew/3.13.rst:316 +#: ../../whatsnew/3.13.rst:313 msgid "Free-threaded CPython" msgstr "" -#: ../../whatsnew/3.13.rst:318 +#: ../../whatsnew/3.13.rst:315 msgid "" "CPython now has experimental support for running in a free-threaded mode, " "with the :term:`global interpreter lock` (GIL) disabled. This is an " @@ -491,7 +497,7 @@ msgid "" "gil` option." msgstr "" -#: ../../whatsnew/3.13.rst:331 +#: ../../whatsnew/3.13.rst:328 msgid "" "Free-threaded execution allows for full utilization of the available " "processing power by running threads in parallel on available CPU cores. " @@ -501,10 +507,10 @@ msgid "" "it: expect some bugs and a substantial single-threaded performance hit. Free-" "threaded builds of CPython support optionally running with the GIL enabled " "at runtime using the environment variable :envvar:`PYTHON_GIL` or the " -"command-line option :option:`-X gil`." +"command-line option :option:`-X gil=1`." msgstr "" -#: ../../whatsnew/3.13.rst:341 +#: ../../whatsnew/3.13.rst:338 msgid "" "To check if the current interpreter supports free-threading, :option:`python " "-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " @@ -512,7 +518,7 @@ msgid "" "whether the GIL is actually disabled in the running process." msgstr "" -#: ../../whatsnew/3.13.rst:346 +#: ../../whatsnew/3.13.rst:343 msgid "" "C-API extension modules need to be built specifically for the free-threaded " "build. Extensions that support running with the :term:`GIL` disabled should " @@ -525,24 +531,24 @@ msgid "" "extensions in the free-threaded build." msgstr "" -#: ../../whatsnew/3.13.rst:359 +#: ../../whatsnew/3.13.rst:356 msgid "" ":pep:`703` \"Making the Global Interpreter Lock Optional in CPython\" " "contains rationale and information surrounding this work." msgstr "" -#: ../../whatsnew/3.13.rst:362 +#: ../../whatsnew/3.13.rst:359 msgid "" "`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " "extension authors." msgstr "" -#: ../../whatsnew/3.13.rst:370 +#: ../../whatsnew/3.13.rst:367 msgid "An experimental just-in-time (JIT) compiler" msgstr "" -#: ../../whatsnew/3.13.rst:372 +#: ../../whatsnew/3.13.rst:369 msgid "" "When CPython is configured and built using the :option:`!--enable-" "experimental-jit` option, a just-in-time (JIT) compiler is added which may " @@ -552,104 +558,104 @@ msgid "" "information `are contained at`__ :file:`Tools/jit/README.md`." msgstr "" -#: ../../whatsnew/3.13.rst:382 +#: ../../whatsnew/3.13.rst:379 msgid "" "The :option:`!--enable-experimental-jit` option takes these (optional) " "values, defaulting to ``yes`` if :option:`!--enable-experimental-jit` is " "present without the optional value." msgstr "" -#: ../../whatsnew/3.13.rst:386 +#: ../../whatsnew/3.13.rst:383 msgid "``no``: Disable the entire Tier 2 and JIT pipeline." msgstr "" -#: ../../whatsnew/3.13.rst:387 +#: ../../whatsnew/3.13.rst:384 msgid "" "``yes``: Enable the JIT. To disable the JIT at runtime, pass the environment " "variable ``PYTHON_JIT=0``." msgstr "" -#: ../../whatsnew/3.13.rst:389 +#: ../../whatsnew/3.13.rst:386 msgid "" "``yes-off``: Build the JIT but disable it by default. To enable the JIT at " "runtime, pass the environment variable ``PYTHON_JIT=1``." msgstr "" -#: ../../whatsnew/3.13.rst:391 +#: ../../whatsnew/3.13.rst:388 msgid "" "``interpreter``: Enable the Tier 2 interpreter but disable the JIT. The " "interpreter can be disabled by running with ``PYTHON_JIT=0``." msgstr "" -#: ../../whatsnew/3.13.rst:394 +#: ../../whatsnew/3.13.rst:391 msgid "The internal architecture is roughly as follows:" msgstr "" -#: ../../whatsnew/3.13.rst:396 +#: ../../whatsnew/3.13.rst:393 msgid "" "We start with specialized *Tier 1 bytecode*. See :ref:`What's new in 3.11 " "` for details." msgstr "" -#: ../../whatsnew/3.13.rst:398 +#: ../../whatsnew/3.13.rst:395 msgid "" "When the Tier 1 bytecode gets hot enough, it gets translated to a new purely " "internal intermediate representation (IR), called the *Tier 2 IR*, and " "sometimes referred to as micro-ops (\"uops\")." msgstr "" -#: ../../whatsnew/3.13.rst:401 +#: ../../whatsnew/3.13.rst:398 msgid "" "The Tier 2 IR uses the same stack-based virtual machine as Tier 1, but the " "instruction format is better suited to translation to machine code." msgstr "" -#: ../../whatsnew/3.13.rst:403 +#: ../../whatsnew/3.13.rst:400 msgid "" "We have several optimization passes for Tier 2 IR, which are applied before " "it is interpreted or translated to machine code." msgstr "" -#: ../../whatsnew/3.13.rst:405 +#: ../../whatsnew/3.13.rst:402 msgid "" "There is a Tier 2 interpreter, but it is mostly intended for debugging the " "earlier stages of the optimization pipeline. The Tier 2 interpreter can be " "enabled by configuring Python with ``--enable-experimental-jit=interpreter``." msgstr "" -#: ../../whatsnew/3.13.rst:409 +#: ../../whatsnew/3.13.rst:406 msgid "" "When the JIT is enabled, the optimized Tier 2 IR is translated to machine " "code, which is then executed." msgstr "" -#: ../../whatsnew/3.13.rst:411 +#: ../../whatsnew/3.13.rst:408 msgid "" "The machine code translation process uses a technique called *copy-and-" "patch*. It has no runtime dependencies, but there is a new build-time " "dependency on LLVM." msgstr "" -#: ../../whatsnew/3.13.rst:415 +#: ../../whatsnew/3.13.rst:412 msgid ":pep:`744`" msgstr "" -#: ../../whatsnew/3.13.rst:417 +#: ../../whatsnew/3.13.rst:414 msgid "" "(JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik " "Kjolstad. Tier 2 IR by Mark Shannon and Guido van Rossum. Tier 2 optimizer " "by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.13.rst:425 +#: ../../whatsnew/3.13.rst:422 msgid "Defined mutation semantics for :py:func:`locals`" msgstr "" -#: ../../whatsnew/3.13.rst:427 +#: ../../whatsnew/3.13.rst:424 msgid "" "Historically, the expected result of mutating the return value of :func:" "`locals` has been left to individual Python implementations to define. " -"Starting from Python 3.13, :pep:`667` standardises the historical behaviour " +"Starting from Python 3.13, :pep:`667` standardises the historical behavior " "of CPython for most code execution scopes, but changes :term:`optimized " "scopes ` (functions, generators, coroutines, " "comprehensions, and generator expressions) to explicitly return independent " @@ -657,10 +663,10 @@ msgid "" "referenced nonlocal variables captured in closures." msgstr "" -#: ../../whatsnew/3.13.rst:436 +#: ../../whatsnew/3.13.rst:433 msgid "" "This change to the semantics of :func:`locals` in optimized scopes also " -"affects the default behaviour of code execution functions that implicitly " +"affects the default behavior of code execution functions that implicitly " "target :func:`!locals` if no explicit namespace is provided (such as :func:" "`exec` and :func:`eval`). In previous versions, whether or not changes could " "be accessed by calling :func:`!locals` after calling the code execution " @@ -678,7 +684,7 @@ msgid "" "disk)." msgstr "" -#: ../../whatsnew/3.13.rst:455 +#: ../../whatsnew/3.13.rst:452 msgid "" "To ensure debuggers and similar tools can reliably update local variables in " "scopes affected by this change, :attr:`FrameType.f_locals ` " @@ -688,7 +694,7 @@ msgid "" "semantics." msgstr "" -#: ../../whatsnew/3.13.rst:461 +#: ../../whatsnew/3.13.rst:458 msgid "" "See :pep:`667` for more details, including related C API changes and " "deprecations. Porting notes are also provided below for the affected :ref:" @@ -696,18 +702,18 @@ msgid "" "notes-c>`." msgstr "" -#: ../../whatsnew/3.13.rst:466 +#: ../../whatsnew/3.13.rst:463 msgid "" "(PEP and implementation contributed by Mark Shannon and Tian Gao in :gh:" "`74929`. Documentation updates provided by Guido van Rossum and Alyssa " "Coghlan.)" msgstr "" -#: ../../whatsnew/3.13.rst:474 +#: ../../whatsnew/3.13.rst:471 msgid "Support for mobile platforms" msgstr "" -#: ../../whatsnew/3.13.rst:476 +#: ../../whatsnew/3.13.rst:473 msgid "" ":pep:`730`: iOS is now a :pep:`11` supported platform, with the ``arm64-" "apple-ios`` and ``arm64-apple-ios-simulator`` targets at tier 3 (iPhone and " @@ -718,28 +724,30 @@ msgid "" "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:486 +#: ../../whatsnew/3.13.rst:483 msgid "" -":pep:`738`: Android support is being actively worked on, but the platform is " -"not yet officially supported. (PEP written and implementation contributed by " -"Malcolm Smith in :gh:`116622`.)" +":pep:`738`: Android is now a :pep:`11` supported platform, with the " +"``aarch64-linux-android`` and ``x86_64-linux-android`` targets at tier 3. " +"The 32-bit targets ``arm-linux-androideabi`` and ``i686-linux-android`` are " +"not tier 3 supported platforms, but will have best-effort support. (PEP " +"written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:491 +#: ../../whatsnew/3.13.rst:490 msgid ":pep:`730`, :pep:`738`" msgstr "" -#: ../../whatsnew/3.13.rst:497 +#: ../../whatsnew/3.13.rst:496 msgid "Incremental garbage collection" msgstr "" -#: ../../whatsnew/3.13.rst:499 +#: ../../whatsnew/3.13.rst:498 msgid "" "The cycle garbage collector is now incremental. This means that maximum " "pause times are reduced by an order of magnitude or more for larger heaps." msgstr "" -#: ../../whatsnew/3.13.rst:503 +#: ../../whatsnew/3.13.rst:502 msgid "" "There are now only two generations: young and old. When :func:`gc.collect` " "is not called directly, the GC is invoked a little less frequently. When " @@ -747,29 +755,29 @@ msgid "" "generation, instead of collecting one or more generations." msgstr "" -#: ../../whatsnew/3.13.rst:509 +#: ../../whatsnew/3.13.rst:508 msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.13.rst:511 +#: ../../whatsnew/3.13.rst:510 ../../whatsnew/3.13.rst:2617 msgid "" -"``gc.collect(1)``: Performs an increment of GC, rather than collecting " -"generation 1." +"``gc.collect(1)``: Performs an increment of garbage collection, rather than " +"collecting generation 1." msgstr "" -#: ../../whatsnew/3.13.rst:513 +#: ../../whatsnew/3.13.rst:512 ../../whatsnew/3.13.rst:2619 msgid "Other calls to :func:`!gc.collect` are unchanged." msgstr "" -#: ../../whatsnew/3.13.rst:515 +#: ../../whatsnew/3.13.rst:514 msgid "(Contributed by Mark Shannon in :gh:`108362`.)" msgstr "" -#: ../../whatsnew/3.13.rst:519 +#: ../../whatsnew/3.13.rst:518 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.13.rst:521 +#: ../../whatsnew/3.13.rst:520 msgid "" "The compiler now strips common leading whitespace from every line in a " "docstring. This reduces the size of the :term:`bytecode cache ` " @@ -778,7 +786,7 @@ msgid "" "affects tools that use docstrings, such as :mod:`doctest`." msgstr "" -#: ../../whatsnew/3.13.rst:528 +#: ../../whatsnew/3.13.rst:527 msgid "" ">>> def spam():\n" "... \"\"\"\n" @@ -793,28 +801,28 @@ msgid "" "multiple paragraphs!\\n'" msgstr "" -#: ../../whatsnew/3.13.rst:541 +#: ../../whatsnew/3.13.rst:540 msgid "(Contributed by Inada Naoki in :gh:`81283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:543 +#: ../../whatsnew/3.13.rst:542 msgid "" ":ref:`Annotation scopes ` within class scopes can now " "contain lambdas and comprehensions. Comprehensions that are located within " "class scopes are not inlined into their parent scope." msgstr "" -#: ../../whatsnew/3.13.rst:548 +#: ../../whatsnew/3.13.rst:547 msgid "" "class C[T]:\n" " type Alias = lambda: T" msgstr "" -#: ../../whatsnew/3.13.rst:553 +#: ../../whatsnew/3.13.rst:552 msgid "(Contributed by Jelle Zijlstra in :gh:`109118` and :gh:`118160`.)" msgstr "" -#: ../../whatsnew/3.13.rst:555 +#: ../../whatsnew/3.13.rst:554 msgid "" ":ref:`Future statements ` are no longer triggered by relative " "imports of the :mod:`__future__` module, meaning that statements of the form " @@ -823,7 +831,7 @@ msgid "" "in :gh:`118216`.)" msgstr "" -#: ../../whatsnew/3.13.rst:561 +#: ../../whatsnew/3.13.rst:560 msgid "" ":keyword:`global` declarations are now permitted in :keyword:`except` blocks " "when that global is used in the :keyword:`else` block. Previously this " @@ -831,7 +839,7 @@ msgid "" "`111123`.)" msgstr "" -#: ../../whatsnew/3.13.rst:566 +#: ../../whatsnew/3.13.rst:565 msgid "" "Add :envvar:`PYTHON_FROZEN_MODULES`, a new environment variable that " "determines whether frozen modules are ignored by the import machinery, " @@ -839,7 +847,7 @@ msgid "" "(Contributed by Yilei Yang in :gh:`111374`.)" msgstr "" -#: ../../whatsnew/3.13.rst:571 +#: ../../whatsnew/3.13.rst:570 msgid "" "Add :ref:`support for the perf profiler ` working without " "`frame pointers `_ through the new " @@ -848,14 +856,14 @@ msgid "" "`118518`.)" msgstr "" -#: ../../whatsnew/3.13.rst:577 +#: ../../whatsnew/3.13.rst:576 msgid "" "The location of a :file:`.python_history` file can be changed via the new :" "envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi Sabah, " "Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" msgstr "" -#: ../../whatsnew/3.13.rst:582 +#: ../../whatsnew/3.13.rst:581 msgid "" "Classes have a new :attr:`~class.__static_attributes__` attribute. This is " "populated by the compiler with a tuple of the class's attribute names which " @@ -863,21 +871,21 @@ msgid "" "(Contributed by Irit Katriel in :gh:`115775`.)" msgstr "" -#: ../../whatsnew/3.13.rst:587 +#: ../../whatsnew/3.13.rst:586 msgid "" "The compiler now creates a :attr:`!__firstlineno__` attribute on classes " "with the line number of the first line of the class definition. (Contributed " "by Serhiy Storchaka in :gh:`118465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:591 +#: ../../whatsnew/3.13.rst:590 msgid "" "The :func:`exec` and :func:`eval` builtins now accept the *globals* and " "*locals* arguments as keywords. (Contributed by Raphael Gaschignard in :gh:" "`105879`)" msgstr "" -#: ../../whatsnew/3.13.rst:595 +#: ../../whatsnew/3.13.rst:594 msgid "" "The :func:`compile` builtin now accepts a new flag, ``ast." "PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except that " @@ -885,7 +893,13 @@ msgid "" "argument. (Contributed by Irit Katriel in :gh:`108113`)." msgstr "" -#: ../../whatsnew/3.13.rst:601 +#: ../../whatsnew/3.13.rst:600 +msgid "" +"Add a :attr:`~property.__name__` attribute on :class:`property` objects. " +"(Contributed by Eugene Toder in :gh:`101860`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:603 msgid "" "Add :exc:`PythonFinalizationError`, a new exception derived from :exc:" "`RuntimeError` and used to signal when operations are blocked during :term:" @@ -893,71 +907,65 @@ msgid "" "exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" msgstr "" -#: ../../whatsnew/3.13.rst:607 +#: ../../whatsnew/3.13.rst:609 msgid ":func:`_thread.start_new_thread`" msgstr "" -#: ../../whatsnew/3.13.rst:608 +#: ../../whatsnew/3.13.rst:610 msgid ":func:`os.fork`" msgstr "" -#: ../../whatsnew/3.13.rst:609 +#: ../../whatsnew/3.13.rst:611 msgid ":func:`os.forkpty`" msgstr "" -#: ../../whatsnew/3.13.rst:610 +#: ../../whatsnew/3.13.rst:612 msgid ":class:`subprocess.Popen`" msgstr "" -#: ../../whatsnew/3.13.rst:612 +#: ../../whatsnew/3.13.rst:614 msgid "(Contributed by Victor Stinner in :gh:`114570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:614 +#: ../../whatsnew/3.13.rst:616 msgid "" "Allow the *count* argument of :meth:`str.replace` to be a keyword. " "(Contributed by Hugo van Kemenade in :gh:`106487`.)" msgstr "" -#: ../../whatsnew/3.13.rst:617 +#: ../../whatsnew/3.13.rst:619 msgid "" "Many functions now emit a warning if a boolean value is passed as a file " "descriptor argument. This can help catch some errors earlier. (Contributed " "by Serhiy Storchaka in :gh:`82626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:622 +#: ../../whatsnew/3.13.rst:624 msgid "" "Added :attr:`!name` and :attr:`!mode` attributes for compressed and archived " "file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, and :mod:" "`zipfile` modules. (Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:627 -msgid "" -"Add a :attr:`~property.__name__` attribute on :class:`property` objects. " -"(Contributed by Eugene Toder in :gh:`101860`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:632 +#: ../../whatsnew/3.13.rst:631 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.13.rst:634 +#: ../../whatsnew/3.13.rst:633 msgid "" ":mod:`dbm.sqlite3`: An SQLite backend for :mod:`dbm`. (Contributed by " "Raymond Hettinger and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:639 +#: ../../whatsnew/3.13.rst:638 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.13.rst:643 +#: ../../whatsnew/3.13.rst:642 msgid "argparse" msgstr "" -#: ../../whatsnew/3.13.rst:645 +#: ../../whatsnew/3.13.rst:644 msgid "" "Add the *deprecated* parameter to the :meth:`~argparse.ArgumentParser." "add_argument` and :meth:`!add_parser` methods, to enable deprecating command-" @@ -965,36 +973,36 @@ msgid "" "Storchaka in :gh:`83648`.)" msgstr "" -#: ../../whatsnew/3.13.rst:653 +#: ../../whatsnew/3.13.rst:652 msgid "array" msgstr "" -#: ../../whatsnew/3.13.rst:655 +#: ../../whatsnew/3.13.rst:654 msgid "" "Add the ``'w'`` type code (``Py_UCS4``) for Unicode characters. It should be " "used instead of the deprecated ``'u'`` type code. (Contributed by Inada " "Naoki in :gh:`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:659 +#: ../../whatsnew/3.13.rst:658 msgid "" "Register :class:`array.array` as a :class:`~collections.abc.MutableSequence` " "by implementing the :meth:`~array.array.clear` method. (Contributed by Mike " "Zimin in :gh:`114894`.)" msgstr "" -#: ../../whatsnew/3.13.rst:665 +#: ../../whatsnew/3.13.rst:664 msgid "ast" msgstr "" -#: ../../whatsnew/3.13.rst:667 +#: ../../whatsnew/3.13.rst:666 msgid "" "The constructors of node types in the :mod:`ast` module are now stricter in " -"the arguments they accept, with more intuitive behaviour when arguments are " +"the arguments they accept, with more intuitive behavior when arguments are " "omitted." msgstr "" -#: ../../whatsnew/3.13.rst:671 +#: ../../whatsnew/3.13.rst:670 msgid "" "If an optional field on an AST node is not included as an argument when " "constructing an instance, the field will now be set to ``None``. Similarly, " @@ -1004,7 +1012,7 @@ msgid "" "the newly constructed AST node instance.)" msgstr "" -#: ../../whatsnew/3.13.rst:679 +#: ../../whatsnew/3.13.rst:678 msgid "" "In all other cases, where a required argument is omitted, the node " "constructor will emit a :exc:`DeprecationWarning`. This will raise an " @@ -1013,31 +1021,31 @@ msgid "" "and will raise an exception in Python 3.15." msgstr "" -#: ../../whatsnew/3.13.rst:686 +#: ../../whatsnew/3.13.rst:685 msgid "" "These changes do not apply to user-defined subclasses of :class:`ast.AST` " "unless the class opts in to the new behavior by defining the :attr:`.AST." "_field_types` mapping." msgstr "" -#: ../../whatsnew/3.13.rst:690 +#: ../../whatsnew/3.13.rst:689 msgid "" "(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, and :gh:" "`118851`.)" msgstr "" -#: ../../whatsnew/3.13.rst:692 +#: ../../whatsnew/3.13.rst:691 msgid "" ":func:`ast.parse` now accepts an optional argument *optimize* which is " "passed on to :func:`compile`. This makes it possible to obtain an optimized " "AST. (Contributed by Irit Katriel in :gh:`108113`.)" msgstr "" -#: ../../whatsnew/3.13.rst:699 +#: ../../whatsnew/3.13.rst:698 msgid "asyncio" msgstr "" -#: ../../whatsnew/3.13.rst:701 +#: ../../whatsnew/3.13.rst:700 msgid "" ":func:`asyncio.as_completed` now returns an object that is both an :term:" "`asynchronous iterator` and a plain :term:`iterator` of :term:`awaitables " @@ -1047,14 +1055,14 @@ msgid "" "Arthur in :gh:`77714`.)" msgstr "" -#: ../../whatsnew/3.13.rst:709 +#: ../../whatsnew/3.13.rst:708 msgid "" ":meth:`asyncio.loop.create_unix_server` will now automatically remove the " "Unix socket when the server is closed. (Contributed by Pierre Ossman in :gh:" "`111246`.)" msgstr "" -#: ../../whatsnew/3.13.rst:713 +#: ../../whatsnew/3.13.rst:712 msgid "" ":meth:`.DatagramTransport.sendto` will now send zero-length datagrams if " "called with an empty bytes object. The transport flow control also now " @@ -1062,28 +1070,28 @@ msgid "" "(Contributed by Jamie Phan in :gh:`115199`.)" msgstr "" -#: ../../whatsnew/3.13.rst:719 +#: ../../whatsnew/3.13.rst:718 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~asyncio." "QueueShutDown` to manage queue termination. (Contributed by Laurie Opperman " "and Yves Duprat in :gh:`104228`.)" msgstr "" -#: ../../whatsnew/3.13.rst:723 +#: ../../whatsnew/3.13.rst:722 msgid "" "Add the :meth:`.Server.close_clients` and :meth:`.Server.abort_clients` " "methods, which more forcefully close an asyncio server. (Contributed by " "Pierre Ossman in :gh:`113538`.)" msgstr "" -#: ../../whatsnew/3.13.rst:727 +#: ../../whatsnew/3.13.rst:726 msgid "" "Accept a tuple of separators in :meth:`.StreamReader.readuntil`, stopping " "when any one of them is encountered. (Contributed by Bruce Merry in :gh:" "`81322`.)" msgstr "" -#: ../../whatsnew/3.13.rst:731 +#: ../../whatsnew/3.13.rst:730 msgid "" "Improve the behavior of :class:`~asyncio.TaskGroup` when an external " "cancellation collides with an internal cancellation. For example, when two " @@ -1092,7 +1100,7 @@ msgid "" "because its internal cancellation was swallowed by the inner task group." msgstr "" -#: ../../whatsnew/3.13.rst:738 +#: ../../whatsnew/3.13.rst:737 msgid "" "In the case where a task group is cancelled externally and also must raise " "an :exc:`ExceptionGroup`, it will now call the parent task's :meth:`~asyncio." @@ -1100,24 +1108,24 @@ msgid "" "be raised at the next :keyword:`await`, so the cancellation is not lost." msgstr "" -#: ../../whatsnew/3.13.rst:744 +#: ../../whatsnew/3.13.rst:743 msgid "" "An added benefit of these changes is that task groups now preserve the " "cancellation count (:meth:`~asyncio.Task.cancelling`)." msgstr "" -#: ../../whatsnew/3.13.rst:747 +#: ../../whatsnew/3.13.rst:746 msgid "" "In order to handle some corner cases, :meth:`~asyncio.Task.uncancel` may now " "reset the undocumented ``_must_cancel`` flag when the cancellation count " "reaches zero." msgstr "" -#: ../../whatsnew/3.13.rst:751 +#: ../../whatsnew/3.13.rst:750 msgid "(Inspired by an issue reported by Arthur Tacca in :gh:`116720`.)" msgstr "" -#: ../../whatsnew/3.13.rst:753 +#: ../../whatsnew/3.13.rst:752 msgid "" "When :meth:`.TaskGroup.create_task` is called on an inactive :class:" "`~asyncio.TaskGroup`, the given coroutine will be closed (which prevents a :" @@ -1125,46 +1133,46 @@ msgid "" "(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)" msgstr "" -#: ../../whatsnew/3.13.rst:761 +#: ../../whatsnew/3.13.rst:760 msgid "base64" msgstr "" -#: ../../whatsnew/3.13.rst:763 +#: ../../whatsnew/3.13.rst:762 msgid "" "Add :func:`~base64.z85encode` and :func:`~base64.z85decode` functions for " "encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data to :" "class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" msgstr "" -#: ../../whatsnew/3.13.rst:772 +#: ../../whatsnew/3.13.rst:771 msgid "compileall" msgstr "" -#: ../../whatsnew/3.13.rst:774 ../../whatsnew/3.13.rst:790 -#: ../../whatsnew/3.13.rst:1050 +#: ../../whatsnew/3.13.rst:773 ../../whatsnew/3.13.rst:789 +#: ../../whatsnew/3.13.rst:1049 msgid "" "The default number of worker threads and processes is now selected using :" "func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:780 ../../whatsnew/3.13.rst:796 -#: ../../whatsnew/3.13.rst:1646 +#: ../../whatsnew/3.13.rst:779 ../../whatsnew/3.13.rst:795 +#: ../../whatsnew/3.13.rst:1649 msgid "configparser" msgstr "" -#: ../../whatsnew/3.13.rst:782 +#: ../../whatsnew/3.13.rst:781 msgid "" "The :class:`configparser.ConfigParser` now accepts unnamed sections before " "named ones if configured to do so. (Contributed by Pedro Sousa Lacerda in :" "gh:`66449`.)" msgstr "" -#: ../../whatsnew/3.13.rst:788 +#: ../../whatsnew/3.13.rst:787 msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:798 +#: ../../whatsnew/3.13.rst:797 msgid "" ":class:`~configparser.ConfigParser` now has support for unnamed sections, " "which allows for top-level key-value pairs. This can be enabled with the new " @@ -1172,11 +1180,11 @@ msgid "" "gh:`66449`.)" msgstr "" -#: ../../whatsnew/3.13.rst:805 +#: ../../whatsnew/3.13.rst:804 msgid "copy" msgstr "" -#: ../../whatsnew/3.13.rst:807 +#: ../../whatsnew/3.13.rst:806 msgid "" "The new :func:`~copy.replace` function and the :meth:`replace protocol " "` make creating modified copies of objects much simpler. " @@ -1185,61 +1193,61 @@ msgid "" "protocol:" msgstr "" -#: ../../whatsnew/3.13.rst:813 +#: ../../whatsnew/3.13.rst:812 msgid ":func:`collections.namedtuple`" msgstr "" -#: ../../whatsnew/3.13.rst:814 +#: ../../whatsnew/3.13.rst:813 msgid ":class:`dataclasses.dataclass`" msgstr "" -#: ../../whatsnew/3.13.rst:815 +#: ../../whatsnew/3.13.rst:814 msgid "" ":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" msgstr "" -#: ../../whatsnew/3.13.rst:816 +#: ../../whatsnew/3.13.rst:815 msgid ":class:`inspect.Signature`, :class:`inspect.Parameter`" msgstr "" -#: ../../whatsnew/3.13.rst:817 +#: ../../whatsnew/3.13.rst:816 msgid ":class:`types.SimpleNamespace`" msgstr "" -#: ../../whatsnew/3.13.rst:818 +#: ../../whatsnew/3.13.rst:817 msgid ":ref:`code objects `" msgstr "" -#: ../../whatsnew/3.13.rst:820 +#: ../../whatsnew/3.13.rst:819 msgid "" "Any user-defined class can also support :func:`copy.replace` by defining " "the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka in :" "gh:`108751`.)" msgstr "" -#: ../../whatsnew/3.13.rst:826 +#: ../../whatsnew/3.13.rst:825 msgid "dbm" msgstr "" -#: ../../whatsnew/3.13.rst:828 +#: ../../whatsnew/3.13.rst:827 msgid "" "Add :mod:`dbm.sqlite3`, a new module which implements an SQLite backend, and " "make it the default :mod:`!dbm` backend. (Contributed by Raymond Hettinger " "and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:832 +#: ../../whatsnew/3.13.rst:831 msgid "" "Allow removing all items from the database through the new :meth:`.gdbm." "clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" "`107122`.)" msgstr "" -#: ../../whatsnew/3.13.rst:838 +#: ../../whatsnew/3.13.rst:837 msgid "dis" msgstr "" -#: ../../whatsnew/3.13.rst:840 +#: ../../whatsnew/3.13.rst:839 msgid "" "Change the output of :mod:`dis` module functions to show logical labels for " "jump targets and exception handlers, rather than offsets. The offsets can be " @@ -1247,7 +1255,7 @@ msgid "" "the *show_offsets* argument. (Contributed by Irit Katriel in :gh:`112137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:847 +#: ../../whatsnew/3.13.rst:846 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " "instructions. Instead, it returns them as part of the :class:`~dis." @@ -1256,11 +1264,11 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:859 +#: ../../whatsnew/3.13.rst:858 msgid "doctest" msgstr "" -#: ../../whatsnew/3.13.rst:861 +#: ../../whatsnew/3.13.rst:860 msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " @@ -1269,18 +1277,18 @@ msgid "" "`117225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:868 +#: ../../whatsnew/3.13.rst:867 msgid "" "The :meth:`.DocTestRunner.run` method now counts the number of skipped " "tests. Add the :attr:`.DocTestRunner.skips` and :attr:`.TestResults.skipped` " "attributes. (Contributed by Victor Stinner in :gh:`108794`.)" msgstr "" -#: ../../whatsnew/3.13.rst:874 +#: ../../whatsnew/3.13.rst:873 msgid "email" msgstr "" -#: ../../whatsnew/3.13.rst:876 +#: ../../whatsnew/3.13.rst:875 msgid "" "Headers with embedded newlines are now quoted on output. The :mod:`~email." "generator` will now refuse to serialize (write) headers that are improperly " @@ -1290,23 +1298,23 @@ msgid "" "Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" -#: ../../whatsnew/3.13.rst:884 +#: ../../whatsnew/3.13.rst:883 msgid "" ":func:`~email.utils.getaddresses` and :func:`~email.utils.parseaddr` now " "return ``('', '')`` pairs in more situations where invalid email addresses " "are encountered instead of potentially inaccurate values. The two functions " "have a new optional *strict* parameter (default ``True``). To get the old " -"behaviour (accepting malformed input), use ``strict=False``. ``getattr(email." +"behavior (accepting malformed input), use ``strict=False``. ``getattr(email." "utils, 'supports_strict_parsing', False)`` can be used to check if the " "*strict* parameter is available. (Contributed by Thomas Dwyer and Victor " "Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" -#: ../../whatsnew/3.13.rst:896 +#: ../../whatsnew/3.13.rst:895 msgid "fractions" msgstr "" -#: ../../whatsnew/3.13.rst:898 +#: ../../whatsnew/3.13.rst:897 msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " @@ -1314,18 +1322,18 @@ msgid "" "`111320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:905 +#: ../../whatsnew/3.13.rst:904 msgid "gc" msgstr "" -#: ../../whatsnew/3.13.rst:907 +#: ../../whatsnew/3.13.rst:906 msgid "" "The cyclic garbage collector is now incremental, which changes the meaning " "of the results of :meth:`~gc.get_threshold` and :meth:`~gc.set_threshold` as " "well as :meth:`~gc.get_count` and :meth:`~gc.get_stats`." msgstr "" -#: ../../whatsnew/3.13.rst:912 +#: ../../whatsnew/3.13.rst:911 msgid "" "For backwards compatibility, :meth:`~gc.get_threshold` continues to return a " "three-item tuple. The first value is the threshold for young collections, as " @@ -1334,11 +1342,11 @@ msgid "" "is scanned more slowly). The third value is meaningless and is always zero." msgstr "" -#: ../../whatsnew/3.13.rst:920 +#: ../../whatsnew/3.13.rst:919 msgid ":meth:`~gc.set_threshold` ignores any items after the second." msgstr "" -#: ../../whatsnew/3.13.rst:922 +#: ../../whatsnew/3.13.rst:921 msgid "" ":meth:`~gc.get_count` and :meth:`~gc.get_stats` continue to return the same " "format of results. The only difference is that instead of the results " @@ -1346,29 +1354,29 @@ msgid "" "young generation and the aging and collecting spaces of the old generation." msgstr "" -#: ../../whatsnew/3.13.rst:929 +#: ../../whatsnew/3.13.rst:928 msgid "" "In summary, code that attempted to manipulate the behavior of the cycle GC " "may not work exactly as intended, but it is very unlikely to be harmful. All " "other code will work just fine." msgstr "" -#: ../../whatsnew/3.13.rst:935 +#: ../../whatsnew/3.13.rst:934 msgid "glob" msgstr "" -#: ../../whatsnew/3.13.rst:937 +#: ../../whatsnew/3.13.rst:936 msgid "" "Add :func:`~glob.translate`, a function to convert a path specification with " "shell-style wildcards to a regular expression. (Contributed by Barney Gale " "in :gh:`72904`.)" msgstr "" -#: ../../whatsnew/3.13.rst:943 +#: ../../whatsnew/3.13.rst:942 msgid "importlib" msgstr "" -#: ../../whatsnew/3.13.rst:945 +#: ../../whatsnew/3.13.rst:944 msgid "" "The following functions in :mod:`importlib.resources` now allow accessing a " "directory (or tree) of resources, using multiple positional arguments (the " @@ -1376,37 +1384,37 @@ msgid "" "keyword-only):" msgstr "" -#: ../../whatsnew/3.13.rst:950 +#: ../../whatsnew/3.13.rst:949 msgid ":func:`~importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.13.rst:951 +#: ../../whatsnew/3.13.rst:950 msgid ":func:`~importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:952 +#: ../../whatsnew/3.13.rst:951 msgid ":func:`~importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.13.rst:953 +#: ../../whatsnew/3.13.rst:952 msgid ":func:`~importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.13.rst:954 +#: ../../whatsnew/3.13.rst:953 msgid ":func:`~importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:955 +#: ../../whatsnew/3.13.rst:954 msgid ":func:`~importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.13.rst:957 +#: ../../whatsnew/3.13.rst:956 msgid "" "These functions are no longer deprecated and are not scheduled for removal. " "(Contributed by Petr Viktorin in :gh:`106532`.)" msgstr "" -#: ../../whatsnew/3.13.rst:960 +#: ../../whatsnew/3.13.rst:959 msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " @@ -1414,11 +1422,11 @@ msgid "" "`106532`.)" msgstr "" -#: ../../whatsnew/3.13.rst:967 +#: ../../whatsnew/3.13.rst:966 msgid "io" msgstr "" -#: ../../whatsnew/3.13.rst:969 +#: ../../whatsnew/3.13.rst:968 msgid "" "The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" "`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " @@ -1427,17 +1435,17 @@ msgid "" "build>`. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:978 +#: ../../whatsnew/3.13.rst:977 msgid "ipaddress" msgstr "" -#: ../../whatsnew/3.13.rst:980 +#: ../../whatsnew/3.13.rst:979 msgid "" "Add the :attr:`.IPv4Address.ipv6_mapped` property, which returns the IPv4-" "mapped IPv6 address. (Contributed by Charles Machalow in :gh:`109466`.)" msgstr "" -#: ../../whatsnew/3.13.rst:984 +#: ../../whatsnew/3.13.rst:983 msgid "" "Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." "IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." @@ -1445,22 +1453,22 @@ msgid "" "Stasiak in :gh:`113171`.)" msgstr "" -#: ../../whatsnew/3.13.rst:991 +#: ../../whatsnew/3.13.rst:990 msgid "itertools" msgstr "" -#: ../../whatsnew/3.13.rst:993 +#: ../../whatsnew/3.13.rst:992 msgid "" ":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" "`ValueError` if the final batch is shorter than the specified batch size. " "(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1000 +#: ../../whatsnew/3.13.rst:999 msgid "marshal" msgstr "" -#: ../../whatsnew/3.13.rst:1002 +#: ../../whatsnew/3.13.rst:1001 msgid "" "Add the *allow_code* parameter in module functions. Passing " "``allow_code=False`` prevents serialization and de-serialization of code " @@ -1468,11 +1476,11 @@ msgid "" "Serhiy Storchaka in :gh:`113626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1009 +#: ../../whatsnew/3.13.rst:1008 msgid "math" msgstr "" -#: ../../whatsnew/3.13.rst:1011 +#: ../../whatsnew/3.13.rst:1010 msgid "" "The new function :func:`~math.fma` performs fused multiply-add operations. " "This computes ``x * y + z`` with only a single round, and so avoids any " @@ -1482,11 +1490,11 @@ msgid "" "Stinner in :gh:`73468`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1021 +#: ../../whatsnew/3.13.rst:1020 msgid "mimetypes" msgstr "" -#: ../../whatsnew/3.13.rst:1023 +#: ../../whatsnew/3.13.rst:1022 msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " @@ -1494,18 +1502,18 @@ msgid "" "`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1030 +#: ../../whatsnew/3.13.rst:1029 msgid "mmap" msgstr "" -#: ../../whatsnew/3.13.rst:1032 +#: ../../whatsnew/3.13.rst:1031 msgid "" ":class:`~mmap.mmap` is now protected from crashing on Windows when the " "mapped memory is inaccessible due to file system errors or access " "violations. (Contributed by Jannis Weigend in :gh:`118209`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1036 +#: ../../whatsnew/3.13.rst:1035 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " "used when a seekable file-like object is required. The :meth:`~mmap.mmap." @@ -1513,7 +1521,7 @@ msgid "" "Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1041 +#: ../../whatsnew/3.13.rst:1040 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " @@ -1521,22 +1529,22 @@ msgid "" "gh:`78502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1048 +#: ../../whatsnew/3.13.rst:1047 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.13.rst:1056 +#: ../../whatsnew/3.13.rst:1055 msgid "os" msgstr "" -#: ../../whatsnew/3.13.rst:1058 +#: ../../whatsnew/3.13.rst:1057 msgid "" "Add :func:`~os.process_cpu_count` function to get the number of logical CPU " "cores usable by the calling thread of the current process. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1062 +#: ../../whatsnew/3.13.rst:1061 msgid "" ":func:`~os.cpu_count` and :func:`~os.process_cpu_count` can be overridden " "through the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new " @@ -1546,7 +1554,7 @@ msgid "" "Na in :gh:`109595`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1070 +#: ../../whatsnew/3.13.rst:1069 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " "file descriptors ` via :func:`~os.timerfd_create`, :func:" @@ -1557,7 +1565,7 @@ msgid "" "in :gh:`108277`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1079 +#: ../../whatsnew/3.13.rst:1078 msgid "" ":func:`~os.lchmod` and the *follow_symlinks* argument of :func:`~os.chmod` " "are both now available on Windows. Note that the default value of " @@ -1565,14 +1573,14 @@ msgid "" "by Serhiy Storchaka in :gh:`59616`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1085 +#: ../../whatsnew/3.13.rst:1084 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " "both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" "`113191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1089 +#: ../../whatsnew/3.13.rst:1088 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " @@ -1581,14 +1589,14 @@ msgid "" "Steve Dower in :gh:`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1096 +#: ../../whatsnew/3.13.rst:1095 msgid "" ":func:`~os.posix_spawn` now accepts ``None`` for the *env* argument, which " "makes the newly spawned process use the current process environment. " "(Contributed by Jakub Kulik in :gh:`113119`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1100 +#: ../../whatsnew/3.13.rst:1099 msgid "" ":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" @@ -1596,76 +1604,76 @@ msgid "" "gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1107 +#: ../../whatsnew/3.13.rst:1106 msgid "os.path" msgstr "" -#: ../../whatsnew/3.13.rst:1109 +#: ../../whatsnew/3.13.rst:1108 msgid "" "Add :func:`~os.path.isreserved` to check if a path is reserved on the " "current system. This function is only available on Windows. (Contributed by " "Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1114 +#: ../../whatsnew/3.13.rst:1113 msgid "" "On Windows, :func:`~os.path.isabs` no longer considers paths starting with " "exactly one slash (``\\`` or ``/``) to be absolute. (Contributed by Barney " "Gale and Jon Foster in :gh:`44626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1118 +#: ../../whatsnew/3.13.rst:1117 msgid "" ":func:`~os.path.realpath` now resolves MS-DOS style file names even if the " "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1124 ../../whatsnew/3.13.rst:1686 +#: ../../whatsnew/3.13.rst:1123 ../../whatsnew/3.13.rst:1689 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.13.rst:1126 +#: ../../whatsnew/3.13.rst:1125 msgid "" "Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" "`NotImplementedError` when a path operation isn't supported. (Contributed by " "Barney Gale in :gh:`89812`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1130 +#: ../../whatsnew/3.13.rst:1129 msgid "" "Add a new constructor for creating :class:`~pathlib.Path` objects from " "'file' URIs (``file:///``), :meth:`.Path.from_uri`. (Contributed by Barney " "Gale in :gh:`107465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1134 +#: ../../whatsnew/3.13.rst:1133 msgid "" "Add :meth:`.PurePath.full_match` for matching paths with shell-style " "wildcards, including the recursive wildcard \"``**``\". (Contributed by " "Barney Gale in :gh:`73435`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1138 +#: ../../whatsnew/3.13.rst:1137 msgid "" "Add the :attr:`.PurePath.parser` class attribute to store the implementation " "of :mod:`os.path` used for low-level path parsing and joining. This will be " "either :mod:`!posixpath` or :mod:`!ntpath`." msgstr "" -#: ../../whatsnew/3.13.rst:1143 +#: ../../whatsnew/3.13.rst:1142 msgid "" "Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" "`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1147 +#: ../../whatsnew/3.13.rst:1146 msgid "" ":meth:`.Path.glob` and :meth:`~pathlib.Path.rglob` now return files and " "directories when given a pattern that ends with \"``**``\". Previously, only " "directories were returned. (Contributed by Barney Gale in :gh:`70303`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1152 +#: ../../whatsnew/3.13.rst:1151 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " "`, :meth:`Path.is_dir `, :meth:`." @@ -1673,11 +1681,11 @@ msgid "" "`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1160 +#: ../../whatsnew/3.13.rst:1159 msgid "pdb" msgstr "" -#: ../../whatsnew/3.13.rst:1162 +#: ../../whatsnew/3.13.rst:1161 msgid "" ":func:`breakpoint` and :func:`~pdb.set_trace` now enter the debugger " "immediately rather than on the next line of code to be executed. This change " @@ -1686,20 +1694,20 @@ msgid "" "Gao in :gh:`118579`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1168 +#: ../../whatsnew/3.13.rst:1167 msgid "" "``sys.path[0]`` is no longer replaced by the directory of the script being " "debugged when :attr:`sys.flags.safe_path` is set. (Contributed by Tian Gao " "and Christian Walther in :gh:`111762`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1172 +#: ../../whatsnew/3.13.rst:1171 msgid "" ":mod:`zipapp` is now supported as a debugging target. (Contributed by Tian " "Gao in :gh:`118501`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1175 +#: ../../whatsnew/3.13.rst:1174 msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " @@ -1707,101 +1715,101 @@ msgid "" "`106676`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1180 +#: ../../whatsnew/3.13.rst:1179 msgid "" "Expressions and statements whose prefix is a pdb command are now correctly " "identified and executed. (Contributed by Tian Gao in :gh:`108464`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1186 +#: ../../whatsnew/3.13.rst:1185 msgid "queue" msgstr "" -#: ../../whatsnew/3.13.rst:1188 +#: ../../whatsnew/3.13.rst:1187 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~queue.ShutDown` " "to manage queue termination. (Contributed by Laurie Opperman and Yves Duprat " "in :gh:`104750`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1194 +#: ../../whatsnew/3.13.rst:1193 msgid "random" msgstr "" -#: ../../whatsnew/3.13.rst:1196 +#: ../../whatsnew/3.13.rst:1195 msgid "" "Add a :ref:`command-line interface `. (Contributed by Hugo van " "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1201 ../../whatsnew/3.13.rst:1694 +#: ../../whatsnew/3.13.rst:1200 ../../whatsnew/3.13.rst:1697 msgid "re" msgstr "" -#: ../../whatsnew/3.13.rst:1203 +#: ../../whatsnew/3.13.rst:1202 msgid "" "Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" "exc:`!re.error` is kept for backward compatibility." msgstr "" -#: ../../whatsnew/3.13.rst:1208 +#: ../../whatsnew/3.13.rst:1207 msgid "shutil" msgstr "" -#: ../../whatsnew/3.13.rst:1210 +#: ../../whatsnew/3.13.rst:1209 msgid "" "Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" "`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" -#: ../../whatsnew/3.13.rst:1216 +#: ../../whatsnew/3.13.rst:1215 msgid "site" msgstr "" -#: ../../whatsnew/3.13.rst:1218 +#: ../../whatsnew/3.13.rst:1217 msgid "" ":file:`.pth` files are now decoded using UTF-8 first, and then with the :" "term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " "in :gh:`117802`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1224 +#: ../../whatsnew/3.13.rst:1223 msgid "sqlite3" msgstr "" -#: ../../whatsnew/3.13.rst:1226 +#: ../../whatsnew/3.13.rst:1225 msgid "" "A :exc:`ResourceWarning` is now emitted if a :class:`~sqlite3.Connection` " "object is not :meth:`closed ` explicitly. " "(Contributed by Erlend E. Aasland in :gh:`105539`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1230 +#: ../../whatsnew/3.13.rst:1229 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " "filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" "`91602`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1236 +#: ../../whatsnew/3.13.rst:1235 msgid "ssl" msgstr "" -#: ../../whatsnew/3.13.rst:1238 +#: ../../whatsnew/3.13.rst:1237 msgid "" "The :func:`~ssl.create_default_context` API now includes :data:`~ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " "default flags." msgstr "" -#: ../../whatsnew/3.13.rst:1244 +#: ../../whatsnew/3.13.rst:1243 msgid "" ":data:`~ssl.VERIFY_X509_STRICT` may reject pre-:rfc:`5280` or malformed " "certificates that the underlying OpenSSL implementation might otherwise " "accept. Whilst disabling this is not recommended, you can do so using:" msgstr "" -#: ../../whatsnew/3.13.rst:1249 +#: ../../whatsnew/3.13.rst:1248 msgid "" "import ssl\n" "\n" @@ -1809,15 +1817,15 @@ msgid "" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgstr "" -#: ../../whatsnew/3.13.rst:1256 +#: ../../whatsnew/3.13.rst:1255 msgid "(Contributed by William Woodruff in :gh:`112389`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1260 +#: ../../whatsnew/3.13.rst:1259 msgid "statistics" msgstr "" -#: ../../whatsnew/3.13.rst:1262 +#: ../../whatsnew/3.13.rst:1261 msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " @@ -1825,24 +1833,24 @@ msgid "" "`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1267 +#: ../../whatsnew/3.13.rst:1266 msgid "" "Add :func:`~statistics.kde_random` for sampling from an estimated " "probability density function created by :func:`~statistics.kde`. " "(Contributed by Raymond Hettinger in :gh:`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1275 +#: ../../whatsnew/3.13.rst:1274 msgid "subprocess" msgstr "" -#: ../../whatsnew/3.13.rst:1277 +#: ../../whatsnew/3.13.rst:1276 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations." msgstr "" -#: ../../whatsnew/3.13.rst:1280 +#: ../../whatsnew/3.13.rst:1279 msgid "" "Notably, when *close_fds* is ``True`` (the default), :func:`~os.posix_spawn` " "will be used when the C library provides :c:func:`!" @@ -1851,7 +1859,7 @@ msgid "" "existing Linux :c:func:`!vfork` based code." msgstr "" -#: ../../whatsnew/3.13.rst:1287 +#: ../../whatsnew/3.13.rst:1286 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " "``False`` if you need to force :mod:`subprocess` to never use :func:`~os." @@ -1861,22 +1869,22 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1297 +#: ../../whatsnew/3.13.rst:1296 msgid "sys" msgstr "" -#: ../../whatsnew/3.13.rst:1299 +#: ../../whatsnew/3.13.rst:1298 msgid "" "Add the :func:`~sys._is_interned` function to test if a string was interned. " "This function is not guaranteed to exist in all implementations of Python. " "(Contributed by Serhiy Storchaka in :gh:`78573`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1305 +#: ../../whatsnew/3.13.rst:1304 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.13.rst:1307 +#: ../../whatsnew/3.13.rst:1306 msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " @@ -1884,11 +1892,11 @@ msgid "" "`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1314 +#: ../../whatsnew/3.13.rst:1313 msgid "time" msgstr "" -#: ../../whatsnew/3.13.rst:1316 +#: ../../whatsnew/3.13.rst:1315 msgid "" "On Windows, :func:`~time.monotonic` now uses the " "``QueryPerformanceCounter()`` clock for a resolution of 1 microsecond, " @@ -1896,7 +1904,7 @@ msgid "" "milliseconds. (Contributed by Victor Stinner in :gh:`88494`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1322 +#: ../../whatsnew/3.13.rst:1321 msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " @@ -1905,11 +1913,11 @@ msgid "" "`63207`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1330 +#: ../../whatsnew/3.13.rst:1329 msgid "tkinter" msgstr "" -#: ../../whatsnew/3.13.rst:1332 +#: ../../whatsnew/3.13.rst:1331 msgid "" "Add :mod:`tkinter` widget methods: :meth:`!tk_busy_hold`, :meth:`!" "tk_busy_configure`, :meth:`!tk_busy_cget`, :meth:`!tk_busy_forget`, :meth:`!" @@ -1917,7 +1925,7 @@ msgid "" "klappnase and Serhiy Storchaka in :gh:`72684`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1338 +#: ../../whatsnew/3.13.rst:1337 msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " @@ -1926,14 +1934,14 @@ msgid "" "wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1345 +#: ../../whatsnew/3.13.rst:1344 msgid "" ":meth:`!wm_attributes` can now return attributes as a :class:`dict`, by " "using the new optional keyword-only parameter *return_python_dict*. " "(Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1349 +#: ../../whatsnew/3.13.rst:1348 msgid "" ":meth:`!Text.count` can now return a simple :class:`int` when the new " "optional keyword-only parameter *return_ints* is used. Otherwise, the single " @@ -1941,27 +1949,27 @@ msgid "" "in :gh:`97928`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1354 +#: ../../whatsnew/3.13.rst:1353 msgid "" "Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." "element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " "Storchaka in :gh:`68166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1359 +#: ../../whatsnew/3.13.rst:1358 msgid "" "Add the :meth:`!after_info` method for Tkinter widgets. (Contributed by " "Cheryl Sabella in :gh:`77020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1362 +#: ../../whatsnew/3.13.rst:1361 msgid "" "Add a new :meth:`!copy_replace` method to :class:`!PhotoImage` to copy a " "region from one image to another, possibly with pixel zooming, subsampling, " "or both. (Contributed by Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1367 +#: ../../whatsnew/3.13.rst:1366 msgid "" "Add *from_coords* parameter to the :class:`!PhotoImage` methods :meth:`!" "copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* " @@ -1969,7 +1977,7 @@ msgid "" "Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1373 +#: ../../whatsnew/3.13.rst:1372 msgid "" "Add the :class:`!PhotoImage` methods :meth:`!read` to read an image from a " "file and :meth:`!data` to get the image data. Add *background* and " @@ -1977,11 +1985,11 @@ msgid "" "Storchaka in :gh:`118271`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1381 +#: ../../whatsnew/3.13.rst:1380 msgid "traceback" msgstr "" -#: ../../whatsnew/3.13.rst:1383 +#: ../../whatsnew/3.13.rst:1382 msgid "" "Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" "class:`~traceback.TracebackException`, which holds a string display of the " @@ -1991,7 +1999,7 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1392 +#: ../../whatsnew/3.13.rst:1391 msgid "" "Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." "format_exception_only` to (recursively) format the nested exceptions of a :" @@ -1999,11 +2007,11 @@ msgid "" "`105292`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1399 +#: ../../whatsnew/3.13.rst:1398 msgid "types" msgstr "" -#: ../../whatsnew/3.13.rst:1401 +#: ../../whatsnew/3.13.rst:1400 msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " @@ -2011,63 +2019,63 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1408 ../../whatsnew/3.13.rst:1719 +#: ../../whatsnew/3.13.rst:1407 ../../whatsnew/3.13.rst:1722 msgid "typing" msgstr "" -#: ../../whatsnew/3.13.rst:1410 +#: ../../whatsnew/3.13.rst:1409 msgid "" ":pep:`705`: Add :data:`~typing.ReadOnly`, a special typing construct to mark " "a :class:`~typing.TypedDict` item as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:1413 +#: ../../whatsnew/3.13.rst:1412 msgid "" ":pep:`742`: Add :data:`~typing.TypeIs`, a typing construct that can be used " "to instruct a type checker how to narrow a type." msgstr "" -#: ../../whatsnew/3.13.rst:1416 +#: ../../whatsnew/3.13.rst:1415 msgid "" "Add :data:`~typing.NoDefault`, a sentinel object used to represent the " "defaults of some parameters in the :mod:`typing` module. (Contributed by " "Jelle Zijlstra in :gh:`116126`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1420 +#: ../../whatsnew/3.13.rst:1419 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " "defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" "`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1424 +#: ../../whatsnew/3.13.rst:1423 msgid "" "Add :func:`~typing.is_protocol` to check whether a class is a :class:" "`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1428 +#: ../../whatsnew/3.13.rst:1427 msgid "" ":data:`~typing.ClassVar` can now be nested in :data:`~typing.Final`, and " "vice versa. (Contributed by Mehdi Drissi in :gh:`89547`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1434 +#: ../../whatsnew/3.13.rst:1433 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.13.rst:1436 +#: ../../whatsnew/3.13.rst:1435 msgid "" "Update the Unicode database to `version 15.1.0`__. (Contributed by James " "Gerity in :gh:`109559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1443 +#: ../../whatsnew/3.13.rst:1442 msgid "venv" msgstr "" -#: ../../whatsnew/3.13.rst:1445 +#: ../../whatsnew/3.13.rst:1444 msgid "" "Add support for creating source control management (SCM) ignore files in a " "virtual environment's directory. By default, Git is supported. This is " @@ -2077,11 +2085,11 @@ msgid "" "Cannon in :gh:`108125`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1456 +#: ../../whatsnew/3.13.rst:1455 msgid "warnings" msgstr "" -#: ../../whatsnew/3.13.rst:1458 +#: ../../whatsnew/3.13.rst:1457 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator provides a way to " "communicate deprecations to a :term:`static type checker` and to warn on " @@ -2090,69 +2098,69 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`104003`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1467 +#: ../../whatsnew/3.13.rst:1466 msgid "xml" msgstr "" -#: ../../whatsnew/3.13.rst:1469 +#: ../../whatsnew/3.13.rst:1468 msgid "" "Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by " "adding five new methods:" msgstr "" -#: ../../whatsnew/3.13.rst:1472 +#: ../../whatsnew/3.13.rst:1471 msgid ":meth:`xml.etree.ElementTree.XMLParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1473 +#: ../../whatsnew/3.13.rst:1472 msgid ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1474 +#: ../../whatsnew/3.13.rst:1473 msgid ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1475 +#: ../../whatsnew/3.13.rst:1474 msgid ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1476 +#: ../../whatsnew/3.13.rst:1475 msgid ":meth:`!xml.sax.expatreader.ExpatParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1478 +#: ../../whatsnew/3.13.rst:1477 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1480 +#: ../../whatsnew/3.13.rst:1479 msgid "" "Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." "ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " "Storchaka in :gh:`69893`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1486 +#: ../../whatsnew/3.13.rst:1485 msgid "zipimport" msgstr "" -#: ../../whatsnew/3.13.rst:1488 +#: ../../whatsnew/3.13.rst:1487 msgid "" "Add support for ZIP64_ format files. Everybody loves huge data, right? " "(Contributed by Tim Hatch in :gh:`94146`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1496 +#: ../../whatsnew/3.13.rst:1495 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.13.rst:1498 +#: ../../whatsnew/3.13.rst:1497 msgid "" "The new :ref:`incremental garbage collector ` " "means that maximum pause times are reduced by an order of magnitude or more " "for larger heaps. (Contributed by Mark Shannon in :gh:`108362`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1503 +#: ../../whatsnew/3.13.rst:1502 msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " @@ -2163,13 +2171,13 @@ msgid "" "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1514 +#: ../../whatsnew/3.13.rst:1513 msgid "" ":func:`textwrap.indent` is now around 30% faster than before for large " "input. (Contributed by Inada Naoki in :gh:`107369`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1517 +#: ../../whatsnew/3.13.rst:1516 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations, including when *close_fds* is ``True`` (the default) on " @@ -2179,15 +2187,15 @@ msgid "" "Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1527 +#: ../../whatsnew/3.13.rst:1526 msgid "Removed Modules And APIs" msgstr "" -#: ../../whatsnew/3.13.rst:1533 +#: ../../whatsnew/3.13.rst:1532 msgid "PEP 594: Remove \"dead batteries\" from the standard library" msgstr "" -#: ../../whatsnew/3.13.rst:1535 +#: ../../whatsnew/3.13.rst:1534 msgid "" ":pep:`594` proposed removing 19 modules from the standard library, " "colloquially referred to as 'dead batteries' due to their historic, " @@ -2195,23 +2203,23 @@ msgid "" "in Python 3.11, and are now removed:" msgstr "" -#: ../../whatsnew/3.13.rst:1541 +#: ../../whatsnew/3.13.rst:1540 msgid ":mod:`!aifc`" msgstr "" -#: ../../whatsnew/3.13.rst:1542 +#: ../../whatsnew/3.13.rst:1541 msgid ":mod:`!audioop`" msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1542 msgid ":mod:`!chunk`" msgstr "" -#: ../../whatsnew/3.13.rst:1544 +#: ../../whatsnew/3.13.rst:1543 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr "" -#: ../../whatsnew/3.13.rst:1546 +#: ../../whatsnew/3.13.rst:1545 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2219,7 +2227,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1551 +#: ../../whatsnew/3.13.rst:1550 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2227,14 +2235,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1556 +#: ../../whatsnew/3.13.rst:1555 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1560 +#: ../../whatsnew/3.13.rst:1559 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2243,7 +2251,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1568 +#: ../../whatsnew/3.13.rst:1567 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2251,41 +2259,41 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1574 +#: ../../whatsnew/3.13.rst:1573 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1578 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1581 +#: ../../whatsnew/3.13.rst:1580 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1582 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1584 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1588 +#: ../../whatsnew/3.13.rst:1587 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1593 +#: ../../whatsnew/3.13.rst:1592 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2293,83 +2301,83 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1599 +#: ../../whatsnew/3.13.rst:1598 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1601 +#: ../../whatsnew/3.13.rst:1600 msgid ":mod:`!msilib`" msgstr "" -#: ../../whatsnew/3.13.rst:1602 +#: ../../whatsnew/3.13.rst:1601 msgid ":mod:`!nis`" msgstr "" -#: ../../whatsnew/3.13.rst:1603 +#: ../../whatsnew/3.13.rst:1602 msgid ":mod:`!nntplib`: Use the :pypi:`nntplib` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1605 +#: ../../whatsnew/3.13.rst:1604 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1607 +#: ../../whatsnew/3.13.rst:1606 msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1609 +#: ../../whatsnew/3.13.rst:1608 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1612 +#: ../../whatsnew/3.13.rst:1611 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1614 +#: ../../whatsnew/3.13.rst:1613 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1615 +#: ../../whatsnew/3.13.rst:1614 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1617 +#: ../../whatsnew/3.13.rst:1616 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1619 +#: ../../whatsnew/3.13.rst:1618 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1621 +#: ../../whatsnew/3.13.rst:1620 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1625 +#: ../../whatsnew/3.13.rst:1624 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1627 +#: ../../whatsnew/3.13.rst:1626 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1633 +#: ../../whatsnew/3.13.rst:1632 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1635 +#: ../../whatsnew/3.13.rst:1634 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2379,40 +2387,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1643 +msgid "" +"Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " +"frame (as has always been the case for an executing frame). (Contributed by " +"Irit Katriel in :gh:`79932`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1651 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1655 +#: ../../whatsnew/3.13.rst:1658 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1657 +#: ../../whatsnew/3.13.rst:1660 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1663 +#: ../../whatsnew/3.13.rst:1666 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1665 +#: ../../whatsnew/3.13.rst:1668 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1671 +#: ../../whatsnew/3.13.rst:1674 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1673 +#: ../../whatsnew/3.13.rst:1676 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2420,7 +2435,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1678 +#: ../../whatsnew/3.13.rst:1681 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2428,43 +2443,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1688 +#: ../../whatsnew/3.13.rst:1691 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1696 +#: ../../whatsnew/3.13.rst:1699 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1702 +#: ../../whatsnew/3.13.rst:1705 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1704 +#: ../../whatsnew/3.13.rst:1707 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1710 +#: ../../whatsnew/3.13.rst:1713 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1712 +#: ../../whatsnew/3.13.rst:1715 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1721 +#: ../../whatsnew/3.13.rst:1724 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2472,66 +2487,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1727 +#: ../../whatsnew/3.13.rst:1730 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1733 +#: ../../whatsnew/3.13.rst:1736 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1735 +#: ../../whatsnew/3.13.rst:1738 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1737 +#: ../../whatsnew/3.13.rst:1740 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1741 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1739 +#: ../../whatsnew/3.13.rst:1742 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1741 +#: ../../whatsnew/3.13.rst:1744 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1743 +#: ../../whatsnew/3.13.rst:1746 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1744 +#: ../../whatsnew/3.13.rst:1747 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1745 +#: ../../whatsnew/3.13.rst:1748 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1747 +#: ../../whatsnew/3.13.rst:1750 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1749 +#: ../../whatsnew/3.13.rst:1752 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1755 +#: ../../whatsnew/3.13.rst:1758 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1757 +#: ../../whatsnew/3.13.rst:1760 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2542,261 +2557,325 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1768 +#: ../../whatsnew/3.13.rst:1771 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1770 +#: ../../whatsnew/3.13.rst:1773 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1778 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1782 +#: ../../whatsnew/3.13.rst:1785 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1784 -msgid "" -":mod:`array`: :mod:`array`'s ``'u'`` format code, deprecated in docs since " -"Python 3.3, emits :exc:`DeprecationWarning` since 3.13 and will be removed " -"in Python 3.16. Use the ``'w'`` format code instead. (Contributed by Hugo " -"van Kemenade in :gh:`80480`.)" +#: ../../whatsnew/3.13.rst:1787 +msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1790 +#: ../../whatsnew/3.13.rst:1789 msgid "" -":mod:`ctypes`: Deprecate undocumented :func:`!ctypes.SetPointerType` " -"function. :term:`Soft-deprecate ` the :func:`ctypes.ARRAY` " -"function in favor of multiplication. (Contributed by Victor Stinner in :gh:" -"`105733`.)" +"Deprecate assignment to a function's :attr:`~function.__code__` attribute, " +"where the new code object's type does not match the function's type. The " +"different types are: plain function, generator, async generator, and " +"coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" #: ../../whatsnew/3.13.rst:1795 -msgid "" -":mod:`decimal`: Deprecate non-standard format specifier \"N\" for :class:" -"`decimal.Decimal`. It was not documented and only supported in the C " -"implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" +#: ../../deprecations/pending-removal-in-3.16.rst:13 +msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1800 +#: ../../whatsnew/3.13.rst:1797 msgid "" -":mod:`dis`: The ``dis.HAVE_ARGUMENT`` separator is deprecated. Check " -"membership in :data:`~dis.hasarg` instead. (Contributed by Irit Katriel in :" -"gh:`109319`.)" +"Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " +"format code has been deprecated in documentation since Python 3.3, and will " +"be removed in Python 3.16. Use the ``'w'`` format code (:c:type:`Py_UCS4`) " +"for Unicode characters instead. (Contributed by Hugo van Kemenade in :gh:" +"`80480`.)" msgstr "" #: ../../whatsnew/3.13.rst:1804 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid ":mod:`ctypes`:" +msgstr "" + +#: ../../whatsnew/3.13.rst:1806 msgid "" -":ref:`frame-objects`: Calling :meth:`frame.clear` on a suspended frame " -"raises :exc:`RuntimeError` (as has always been the case for an executing " -"frame). (Contributed by Irit Katriel in :gh:`79932`.)" +"Deprecate the undocumented :func:`!SetPointerType` function, to be removed " +"in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1809 +#: ../../whatsnew/3.13.rst:1810 msgid "" -":mod:`getopt` and :mod:`optparse` modules: They are now :term:`soft " -"deprecated`: the :mod:`argparse` module should be used for new projects. " -"Previously, the :mod:`optparse` module was already deprecated, its removal " -"was not scheduled, and no warnings was emitted: so there is no change in " -"practice. (Contributed by Victor Stinner in :gh:`106535`.)" +":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " +"in favour of ``type * length`` multiplication. (Contributed by Victor " +"Stinner in :gh:`105733`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1814 +msgid ":mod:`decimal`:" msgstr "" #: ../../whatsnew/3.13.rst:1816 msgid "" -":mod:`gettext`: Emit deprecation warning for non-integer numbers in :mod:" -"`gettext` functions and methods that consider plural forms even if the " -"translation was not found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" +"Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " +"specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " +"implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" #: ../../whatsnew/3.13.rst:1821 -msgid "" -":mod:`glob`: The undocumented :func:`!glob.glob0` and :func:`!glob.glob1` " -"functions are deprecated. Use :func:`glob.glob` and pass a directory to its " -"*root_dir* argument instead. (Contributed by Barney Gale in :gh:`117337`.)" +msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1826 +#: ../../whatsnew/3.13.rst:1823 msgid "" -":mod:`http.server`: :class:`http.server.CGIHTTPRequestHandler` now emits a :" -"exc:`DeprecationWarning` as it will be removed in 3.15. Process-based CGI " -"HTTP servers have been out of favor for a very long time. This code was " -"outdated, unmaintained, and rarely used. It has a high potential for both " -"security and functionality bugs. This includes removal of the ``--cgi`` " -"flag to the ``python -m http.server`` command line in 3.15." +"Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" +"`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1827 +msgid ":mod:`getopt` and :mod:`optparse`:" msgstr "" -#: ../../whatsnew/3.13.rst:1833 +#: ../../whatsnew/3.13.rst:1829 msgid "" -":mod:`mimetypes`: Passing file path instead of URL in :func:`~mimetypes." -"guess_type` is :term:`soft deprecated`. Use :func:`~mimetypes." -"guess_file_type` instead. (Contributed by Serhiy Storchaka in :gh:`66543`.)" +"Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " +"for new projects. This is a new soft-deprecation for the :mod:`!getopt` " +"module, whereas the :mod:`!optparse` module was already *de facto* soft " +"deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1835 +msgid ":mod:`gettext`:" msgstr "" #: ../../whatsnew/3.13.rst:1837 msgid "" -":mod:`re`: Passing optional arguments *maxsplit*, *count* and *flags* in " -"module-level functions :func:`re.split`, :func:`re.sub` and :func:`re.subn` " -"as positional arguments is now deprecated. In future Python versions these " -"parameters will be :ref:`keyword-only `. " -"(Contributed by Serhiy Storchaka in :gh:`56166`.)" +"Deprecate non-integer numbers as arguments to functions and methods that " +"consider plural forms in the :mod:`!gettext` module, even if no translation " +"was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1842 +msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1843 -#: ../../deprecations/pending-removal-in-3.15.rst:16 +#: ../../whatsnew/3.13.rst:1844 msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. Use :func:`os.path.isreserved` to " -"detect reserved paths on Windows." +"Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" +"func:`~glob.glob` and pass a :term:`path-like object` specifying the root " +"directory to the *root_dir* parameter instead. (Contributed by Barney Gale " +"in :gh:`117337`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1849 +#: ../../deprecations/pending-removal-in-3.15.rst:9 +msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1848 -#: ../../deprecations/pending-removal-in-3.15.rst:21 +#: ../../whatsnew/3.13.rst:1851 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +"Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " +"Python 3.15. Process-based CGI HTTP servers have been out of favor for a " +"very long time. This code was outdated, unmaintained, and rarely used. It " +"has a high potential for both security and functionality bugs. (Contributed " +"by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1854 +#: ../../whatsnew/3.13.rst:1858 msgid "" -":mod:`pydoc`: Deprecate undocumented :func:`!pydoc.ispackage` function. " -"(Contributed by Zackery Spytz in :gh:`64020`.)" +"Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " +"command-line interface, to be removed in Python 3.15. (Contributed by " +"Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1857 +#: ../../whatsnew/3.13.rst:1863 +msgid ":mod:`mimetypes`:" +msgstr "" + +#: ../../whatsnew/3.13.rst:1865 msgid "" -":mod:`sqlite3`: Passing more than one positional argument to :func:`sqlite3." -"connect` and the :class:`sqlite3.Connection` constructor is deprecated. The " -"remaining parameters will become keyword-only in Python 3.15." +":term:`Soft-deprecate ` file path arguments to :func:" +"`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " +"(Contributed by Serhiy Storchaka in :gh:`66543`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1870 +msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1861 +#: ../../whatsnew/3.13.rst:1872 msgid "" -"Deprecate passing name, number of arguments, and the callable as keyword " -"arguments for the following :class:`sqlite3.Connection` APIs:" +"Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " +"positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " +"and :func:`~re.subn` functions. These parameters will become :ref:`keyword-" +"only ` in a future version of Python. (Contributed " +"by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1864 -msgid ":meth:`~sqlite3.Connection.create_function`" +#: ../../whatsnew/3.13.rst:1879 +#: ../../deprecations/pending-removal-in-3.15.rst:30 +msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1865 -msgid ":meth:`~sqlite3.Connection.create_aggregate`" +#: ../../whatsnew/3.13.rst:1881 +msgid "" +"Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " +"by Barney Gale in :gh:`88569`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1886 +#: ../../deprecations/pending-removal-in-3.15.rst:36 +msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1867 +#: ../../whatsnew/3.13.rst:1888 msgid "" -"Deprecate passing the callback callable by keyword for the following :class:" -"`sqlite3.Connection` APIs:" +"Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1870 -msgid ":meth:`~sqlite3.Connection.set_authorizer`" +#: ../../whatsnew/3.13.rst:1894 +msgid ":mod:`pydoc`:" +msgstr "" + +#: ../../whatsnew/3.13.rst:1896 +msgid "" +"Deprecate the undocumented :func:`!ispackage` function. (Contributed by " +"Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1871 -msgid ":meth:`~sqlite3.Connection.set_progress_handler`" +#: ../../whatsnew/3.13.rst:1899 +#: ../../deprecations/pending-removal-in-3.14.rst:94 +msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1872 -msgid ":meth:`~sqlite3.Connection.set_trace_callback`" +#: ../../whatsnew/3.13.rst:1901 +msgid "" +"Deprecate passing more than one positional argument to the :func:`~sqlite3." +"connect` function and the :class:`~sqlite3.Connection` constructor. The " +"remaining parameters will become keyword-only in Python 3.15. (Contributed " +"by Erlend E. Aasland in :gh:`107948`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1907 +msgid "" +"Deprecate passing name, number of arguments, and the callable as keyword " +"arguments for :meth:`.Connection.create_function` and :meth:`.Connection." +"create_aggregate` These parameters will become positional-only in Python " +"3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1874 -msgid "The affected parameters will become positional-only in Python 3.15." +#: ../../whatsnew/3.13.rst:1913 +msgid "" +"Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." +"Connection.set_authorizer`, :meth:`~sqlite3.Connection." +"set_progress_handler`, and :meth:`~sqlite3.Connection.set_trace_callback` :" +"class:`~sqlite3.Connection` methods. The callback callables will become " +"positional-only in Python 3.15. (Contributed by Erlend E. Aasland in :gh:" +"`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1876 -msgid "(Contributed by Erlend E. Aasland in :gh:`107948` and :gh:`108278`.)" +#: ../../whatsnew/3.13.rst:1921 +#: ../../deprecations/pending-removal-in-3.16.rst:33 +msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1878 +#: ../../whatsnew/3.13.rst:1923 msgid "" -":mod:`sys`: The :func:`sys._enablelegacywindowsfsencoding` function is " -"deprecated. Replace it with the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " -"environment variable. (Contributed by Inada Naoki in :gh:`73427`.)" +"Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " +"removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1928 +#: ../../deprecations/pending-removal-in-3.16.rst:39 +msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1882 +#: ../../whatsnew/3.13.rst:1930 msgid "" -":mod:`tarfile`: The undocumented and unused ``tarfile`` attribute of :class:" -"`tarfile.TarFile` is deprecated and scheduled for removal in Python 3.16." +"Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " +"be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1886 +#: ../../whatsnew/3.13.rst:1934 +msgid ":mod:`traceback`:" +msgstr "" + +#: ../../whatsnew/3.13.rst:1936 msgid "" -":mod:`traceback`: The field *exc_type* of :class:`traceback." -"TracebackException` is deprecated. Use *exc_type_str* instead." +"Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." +"TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" +"gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1889 +#: ../../whatsnew/3.13.rst:1940 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1891 +#: ../../whatsnew/3.13.rst:1942 msgid "" -"Creating a :class:`typing.NamedTuple` class using keyword arguments to " -"denote the fields (``NT = NamedTuple(\"NT\", x=int, y=int)``) is deprecated, " -"and will be disallowed in Python 3.15. Use the class-based syntax or the " +"Deprecate the undocumented keyword argument syntax for creating :class:" +"`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``), to be removed in Python 3.15. Use the class-based syntax or the " "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1896 +#: ../../whatsnew/3.13.rst:1949 msgid "" -"When using the functional syntax to create a :class:`typing.NamedTuple` " -"class or a :class:`typing.TypedDict` class, failing to pass a value to the " -"'fields' parameter (``NT = NamedTuple(\"NT\")`` or ``TD = " -"TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the 'fields' " -"parameter (``NT = NamedTuple(\"NT\", None)`` or ``TD = TypedDict(\"TD\", " -"None)``) is also deprecated. Both will be disallowed in Python 3.15. To " -"create a NamedTuple class with zero fields, use ``class NT(NamedTuple): " -"pass`` or ``NT = NamedTuple(\"NT\", [])``. To create a TypedDict class with " -"zero fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", " -"{})``. (Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)" +"Deprecate omitting the *fields* parameter when creating a :class:`~typing." +"NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " +"``None`` to the *fields* parameter of both types. Python 3.15 will require a " +"valid sequence for the *fields* parameter. To create a NamedTuple class with " +"zero fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " +"())``. To create a TypedDict class with zero fields, use ``class " +"TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``. (Contributed by " +"Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1907 +#: ../../whatsnew/3.13.rst:1959 msgid "" -":func:`typing.no_type_check_decorator` is deprecated, and scheduled for " -"removal in Python 3.15. After eight years in the :mod:`typing` module, it " -"has yet to be supported by any major type checkers. (Contributed by Alex " +"Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " +"be removed in in Python 3.15. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker. (Contributed by Alex " "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1912 +#: ../../whatsnew/3.13.rst:1965 msgid "" -":data:`typing.AnyStr` is deprecated. In Python 3.16, it will be removed from " -"``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted when it " -"is imported or accessed. It will be removed entirely in Python 3.18. Use the " -"new :ref:`type parameter syntax ` instead. (Contributed by " -"Michael The in :gh:`107116`.)" +"Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " +"``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " +"runtime when it is imported or accessed. It will be removed entirely in " +"Python 3.18. Use the new :ref:`type parameter syntax ` instead. " +"(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1918 -msgid "" -":ref:`user-defined-funcs`: Assignment to a function's :attr:`~function." -"__code__` attribute where the new code object's type does not match the " -"function's type is deprecated. The different types are: plain function, " -"generator, async generator and coroutine. (Contributed by Irit Katriel in :" -"gh:`81137`.)" +#: ../../whatsnew/3.13.rst:1973 +#: ../../deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1925 -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../whatsnew/3.13.rst:1975 msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +"Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" +"`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" +"class:`~wave.Wave_write` classes, to be removed in Python 3.15. (Contributed " +"by Victor Stinner in :gh:`105096`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 @@ -2968,10 +3047,6 @@ msgstr "" msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:94 -msgid ":mod:`sqlite3`:" -msgstr "" - #: ../../deprecations/pending-removal-in-3.14.rst:96 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" @@ -3015,63 +3090,83 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:27 +#: ../../deprecations/pending-removal-in-3.15.rst:17 msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid ":class:`typing.NamedTuple`:" +#: ../../deprecations/pending-removal-in-3.15.rst:20 +msgid ":class:`locale`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:22 msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:32 +msgid "" +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:38 +msgid "" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:42 +msgid ":mod:`threading`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:44 +msgid "" +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:40 +#: ../../deprecations/pending-removal-in-3.15.rst:52 msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:58 msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:2 @@ -3079,19 +3174,58 @@ msgid "Pending Removal in Python 3.16" msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:4 +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:6 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:15 +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid ":mod:`shutil`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:23 +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +msgid ":mod:`symtable`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:30 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:8 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#: ../../deprecations/pending-removal-in-3.16.rst:35 +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:11 +#: ../../deprecations/pending-removal-in-3.16.rst:41 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 @@ -3115,10 +3249,6 @@ msgstr "" msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr "" - #: ../../deprecations/pending-removal-in-future.rst:14 msgid "``bool(NotImplemented)``." msgstr "" @@ -3458,778 +3588,594 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1941 +#: ../../whatsnew/3.13.rst:1992 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1943 +#: ../../whatsnew/3.13.rst:1994 msgid "" -"The oparg of ``YIELD_VALUE`` is now ``1`` if the yield is part of a yield-" -"from or await, and ``0`` otherwise. The oparg of ``RESUME`` was changed to " -"add a bit indicating whether the except-depth is 1, which is needed to " +"The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " +"yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " +"changed to add a bit indicating if the except-depth is 1, which is needed to " "optimize closing of generators. (Contributed by Irit Katriel in :gh:" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1951 +#: ../../whatsnew/3.13.rst:2002 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1956 +#: ../../whatsnew/3.13.rst:2007 msgid "" -"You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " -"including :file:`Python.h` when using ``#`` formats in :ref:`format codes " -"`. APIs accepting the format codes always " -"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki in :gh:" -"`104922`.)" +"Add the :ref:`PyMonitoring C API ` for generating :pep:" +"`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1962 -msgid "" -"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" -"func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " -"in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char " -"**`. It makes these functions compatible with arguments of type :c:expr:" -"`const char * const *`, :c:expr:`const char **` or :c:expr:`char * const *` " -"in C++ and :c:expr:`char * const *` in C without an explicit type cast. This " -"can be overridden with the :c:macro:`PY_CXX_CONST` macro. (Contributed by " -"Serhiy Storchaka in :gh:`65210`.)" +#: ../../whatsnew/3.13.rst:2010 +msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:1972 -msgid "" -"Add :c:func:`PyImport_AddModuleRef`: similar to :c:func:" -"`PyImport_AddModule`, but return a :term:`strong reference` instead of a :" -"term:`borrowed reference`. (Contributed by Victor Stinner in :gh:`105922`.)" +#: ../../whatsnew/3.13.rst:2011 +msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1977 -msgid "" -"Add :c:func:`PyWeakref_GetRef` function: similar to :c:func:" -"`PyWeakref_GetObject` but returns a :term:`strong reference`, or ``NULL`` if " -"the referent is no longer live. (Contributed by Victor Stinner in :gh:" -"`105927`.)" +#: ../../whatsnew/3.13.rst:2012 +msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1982 -msgid "" -"Add :c:func:`PyObject_GetOptionalAttr` and :c:func:" -"`PyObject_GetOptionalAttrString`, variants of :c:func:`PyObject_GetAttr` " -"and :c:func:`PyObject_GetAttrString` which don't raise :exc:`AttributeError` " -"if the attribute is not found. These variants are more convenient and faster " -"if the missing attribute should not be treated as a failure. (Contributed by " -"Serhiy Storchaka in :gh:`106521`.)" +#: ../../whatsnew/3.13.rst:2013 +msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1990 -msgid "" -"Add :c:func:`PyMapping_GetOptionalItem` and :c:func:" -"`PyMapping_GetOptionalItemString`: variants of :c:func:`PyObject_GetItem` " -"and :c:func:`PyMapping_GetItemString` which don't raise :exc:`KeyError` if " -"the key is not found. These variants are more convenient and faster if the " -"missing key should not be treated as a failure. (Contributed by Serhiy " -"Storchaka in :gh:`106307`.)" +#: ../../whatsnew/3.13.rst:2014 +msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1998 -msgid "Add fixed variants of functions which silently ignore errors:" +#: ../../whatsnew/3.13.rst:2015 +msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2000 -msgid "" -":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." +#: ../../whatsnew/3.13.rst:2016 +msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2001 -msgid "" -":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" -"`PyObject_HasAttrString`." +#: ../../whatsnew/3.13.rst:2017 +msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2002 -msgid "" -":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." +#: ../../whatsnew/3.13.rst:2018 +msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2003 -msgid "" -":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" -"`PyMapping_HasKeyString`." +#: ../../whatsnew/3.13.rst:2019 +msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2005 -msgid "" -"New functions return not only ``1`` for true and ``0`` for false, but also " -"``-1`` for error." +#: ../../whatsnew/3.13.rst:2020 +msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2008 -msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" +#: ../../whatsnew/3.13.rst:2021 +msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2010 -msgid "" -"If Python is built in :ref:`debug mode ` or :option:`with " -"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" -"`PyList_SET_ITEM` now check the index argument with an assertion. " -"(Contributed by Victor Stinner in :gh:`106168`.)" +#: ../../whatsnew/3.13.rst:2022 +msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2015 -msgid "" -"Add :c:func:`PyModule_Add` function: similar to :c:func:" -"`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject` but always steals a " -"reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" +#: ../../whatsnew/3.13.rst:2023 +msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2020 -msgid "" -"Add :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " -"functions: similar to :c:func:`PyDict_GetItemWithError` but returning a :" -"term:`strong reference` instead of a :term:`borrowed reference`. Moreover, " -"these functions return -1 on error and so checking ``PyErr_Occurred()`` is " -"not needed. (Contributed by Victor Stinner in :gh:`106004`.)" +#: ../../whatsnew/3.13.rst:2024 +msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" +msgstr "" + +#: ../../whatsnew/3.13.rst:2025 +msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" +msgstr "" + +#: ../../whatsnew/3.13.rst:2026 +msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" #: ../../whatsnew/3.13.rst:2027 -msgid "" -"Added :c:func:`PyDict_SetDefaultRef`, which is similar to :c:func:" -"`PyDict_SetDefault` but returns a :term:`strong reference` instead of a :" -"term:`borrowed reference`. This function returns ``-1`` on error, ``0`` on " -"insertion, and ``1`` if the key was already present in the dictionary. " -"(Contributed by Sam Gross in :gh:`112066`.)" +msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2033 -msgid "" -"Add :c:func:`PyDict_ContainsString` function: same as :c:func:" -"`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` UTF-8 " -"encoded bytes string, rather than a :c:expr:`PyObject*`. (Contributed by " -"Victor Stinner in :gh:`108314`.)" +#: ../../whatsnew/3.13.rst:2028 +msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2038 -msgid "" -"Added :c:func:`PyList_GetItemRef` function: similar to :c:func:" -"`PyList_GetItem` but returns a :term:`strong reference` instead of a :term:" -"`borrowed reference`." +#: ../../whatsnew/3.13.rst:2030 +msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:2042 +#: ../../whatsnew/3.13.rst:2032 msgid "" -"Add :c:func:`Py_IsFinalizing` function: check if the main Python interpreter " -"is :term:`shutting down `. (Contributed by Victor " -"Stinner in :gh:`108014`.)" +"Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " +"the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" +"func:`!PyMutex_Lock` will release the :term:`GIL` (if currently held) if the " +"operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2038 msgid "" -"Add :c:func:`PyLong_AsInt` function: similar to :c:func:`PyLong_AsLong`, but " -"store the result in a C :c:expr:`int` instead of a C :c:expr:`long`. " -"Previously, it was known as the private function :c:func:`!_PyLong_AsInt` " -"(with an underscore prefix). (Contributed by Victor Stinner in :gh:`108014`.)" +"Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2052 -msgid "" -"Python built with :file:`configure` :option:`--with-trace-refs` (tracing " -"references) now supports the :ref:`Limited API `. " -"(Contributed by Victor Stinner in :gh:`108634`.)" +#: ../../whatsnew/3.13.rst:2040 +msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2056 -msgid "" -"Add :c:func:`PyObject_VisitManagedDict` and :c:func:" -"`PyObject_ClearManagedDict` functions which must be called by the traverse " -"and clear functions of a type using :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"flag. The `pythoncapi-compat project `__ can be used to get these functions on Python 3.11 and 3.12. " -"(Contributed by Victor Stinner in :gh:`107073`.)" +#: ../../whatsnew/3.13.rst:2041 +msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2064 -msgid "" -"Add :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" -"`PyUnicode_EqualToUTF8` functions: compare Unicode object with a :c:expr:" -"`const char*` UTF-8 encoded string and return true (``1``) if they are " -"equal, or false (``0``) otherwise. These functions do not raise exceptions. " -"(Contributed by Serhiy Storchaka in :gh:`110289`.)" +#: ../../whatsnew/3.13.rst:2042 +msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2070 -msgid "" -"Add :c:func:`PyThreadState_GetUnchecked()` function: similar to :c:func:" -"`PyThreadState_Get()`, but don't kill the process with a fatal error if it " -"is NULL. The caller is responsible to check if the result is NULL. " -"Previously, the function was private and known as " -"``_PyThreadState_UncheckedGet()``. (Contributed by Victor Stinner in :gh:" -"`108867`.)" +#: ../../whatsnew/3.13.rst:2043 +msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2077 -msgid "" -"Add :c:func:`PySys_AuditTuple` function: similar to :c:func:`PySys_Audit`, " -"but pass event arguments as a Python :class:`tuple` object. (Contributed by " -"Victor Stinner in :gh:`85283`.)" +#: ../../whatsnew/3.13.rst:2044 +msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2081 -msgid "" -":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " -"parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" +#: ../../whatsnew/3.13.rst:2045 +msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2085 -msgid "" -"Add :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawCalloc`, :c:func:" -"`PyMem_RawRealloc` and :c:func:`PyMem_RawFree` to the limited C API (version " -"3.13). (Contributed by Victor Stinner in :gh:`85283`.)" +#: ../../whatsnew/3.13.rst:2046 +msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2090 -msgid "" -"Add :c:func:`PySys_Audit` and :c:func:`PySys_AuditTuple` functions to the " -"limited C API. (Contributed by Victor Stinner in :gh:`85283`.)" +#: ../../whatsnew/3.13.rst:2047 +msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2094 -msgid "" -"Add :c:func:`PyErr_FormatUnraisable` function: similar to :c:func:" -"`PyErr_WriteUnraisable`, but allow customizing the warning message. " -"(Contributed by Serhiy Storchaka in :gh:`108082`.)" +#: ../../whatsnew/3.13.rst:2048 +msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2098 -msgid "" -"Add :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions: similar to " -"Python ``list.extend()`` and ``list.clear()`` methods. (Contributed by " -"Victor Stinner in :gh:`111138`.)" +#: ../../whatsnew/3.13.rst:2050 +msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2102 +#: ../../whatsnew/3.13.rst:2052 msgid "" -"Add :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions: remove a " -"key from a dictionary and optionally return the removed value. This is " -"similar to :meth:`dict.pop`, but without the default value and not raising :" -"exc:`KeyError` if the key is missing. (Contributed by Stefan Behnel and " -"Victor Stinner in :gh:`111262`.)" +"Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" +"c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " +"UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`. (Contributed " +"by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2108 +#: ../../whatsnew/3.13.rst:2058 msgid "" -"Add :c:func:`Py_HashPointer` function to hash a pointer. (Contributed by " -"Victor Stinner in :gh:`111545`.)" +"Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " +"functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " +"return a :term:`strong reference` instead of a :term:`borrowed reference`. " +"Moreover, these functions return ``-1`` on error, removing the need to " +"check :c:func:`!PyErr_Occurred`. (Contributed by Victor Stinner in :gh:" +"`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2111 +#: ../../whatsnew/3.13.rst:2066 msgid "" -"Add :c:func:`PyObject_GenericHash` function that implements the default " -"hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" -"`113024`.)" +"Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" +"c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " +"of a :term:`borrowed reference`. This function returns ``-1`` on error, " +"``0`` on insertion, and ``1`` if the key was already present in the " +"dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2115 -msgid "Add PyTime C API:" +#: ../../whatsnew/3.13.rst:2074 +msgid "" +"Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " +"remove a key from a dictionary and optionally return the removed value. This " +"is similar to :meth:`dict.pop`, though there is no default value, and :exc:" +"`KeyError` is not raised for missing keys. (Contributed by Stefan Behnel and " +"Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2117 -msgid ":c:type:`PyTime_t` type." +#: ../../whatsnew/3.13.rst:2081 +msgid "" +"Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" +"`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" +"`PyObject_GetItem` and :c:func:`PyMapping_GetItemString` respectively. The " +"new functions do not raise :exc:`KeyError` if the requested key is missing " +"from the mapping. These variants are more convenient and faster if a missing " +"key should not be treated as a failure. (Contributed by Serhiy Storchaka in :" +"gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2118 -msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX` constants." +#: ../../whatsnew/3.13.rst:2091 +msgid "" +"Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" +"`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" +"`PyObject_GetAttr` and :c:func:`PyObject_GetAttrString` respectively. The " +"new functions do not raise :exc:`AttributeError` if the requested attribute " +"is not found on the object. These variants are more convenient and faster if " +"the missing attribute should not be treated as a failure. (Contributed by " +"Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2119 -msgid "Add functions:" +#: ../../whatsnew/3.13.rst:2101 +msgid "" +"Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" +"`PyErr_WriteUnraisable` that allows customizing the warning message. " +"(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2121 -msgid ":c:func:`PyTime_AsSecondsDouble`." +#: ../../whatsnew/3.13.rst:2106 +msgid "" +"Add new functions that return a :term:`strong reference` instead of a :term:" +"`borrowed reference` for frame locals, globals, and builtins, as part of :" +"ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2122 -msgid ":c:func:`PyTime_Monotonic`." +#: ../../whatsnew/3.13.rst:2110 +msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2123 -msgid ":c:func:`PyTime_MonotonicRaw`." +#: ../../whatsnew/3.13.rst:2111 +msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2124 -msgid ":c:func:`PyTime_PerfCounter`." +#: ../../whatsnew/3.13.rst:2112 +msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2125 -msgid ":c:func:`PyTime_PerfCounterRaw`." +#: ../../whatsnew/3.13.rst:2114 +msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2126 -msgid ":c:func:`PyTime_Time`." +#: ../../whatsnew/3.13.rst:2116 +msgid "" +"Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " +"functions to get :term:`strong ` or :term:`borrowed " +"` references to constants. For example, " +"``Py_GetConstant(Py_CONSTANT_ZERO)`` returns a strong reference to the " +"constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2127 -msgid ":c:func:`PyTime_TimeRaw`." +#: ../../whatsnew/3.13.rst:2123 +msgid "" +"Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" +"func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " +"a :term:`borrowed reference`. (Contributed by Victor Stinner in :gh:" +"`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2129 -msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" +#: ../../whatsnew/3.13.rst:2128 +msgid "" +"Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " +"interpreter is :term:`shutting down `. (Contributed by " +"Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2131 +#: ../../whatsnew/3.13.rst:2133 msgid "" -"Add :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes` and :c:" -"func:`PyLong_FromUnsignedNativeBytes` functions to simplify converting " -"between native integer types and Python :class:`int` objects. (Contributed " -"by Steve Dower in :gh:`111140`.)" +"Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" +"`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" +"`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2136 +#: ../../whatsnew/3.13.rst:2138 msgid "" -"Add :c:func:`PyType_GetFullyQualifiedName` function to get the type's fully " -"qualified name. Equivalent to ``f\"{type.__module__}.{type." -"__qualname__}\"``, or ``type.__qualname__`` if ``type.__module__`` is not a " -"string or is equal to ``\"builtins\"``. (Contributed by Victor Stinner in :" -"gh:`111696`.)" +"Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " +"mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " +"(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" #: ../../whatsnew/3.13.rst:2142 msgid "" -"Add :c:func:`PyType_GetModuleName` function to get the type's module name. " -"Equivalent to getting the ``type.__module__`` attribute. (Contributed by " -"Eric Snow and Victor Stinner in :gh:`111696`.)" +"Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" +"`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" +"c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2146 +#: ../../whatsnew/3.13.rst:2147 msgid "" -"Add support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" -"`PyUnicode_FromFormat`: format the fully qualified name of an object type " -"and of a type: call :c:func:`PyType_GetModuleName`. See :pep:`737` for more " -"information. (Contributed by Victor Stinner in :gh:`111696`.)" +"Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " +"and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " +"converting between native integer types and Python :class:`int` objects. " +"(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2152 +#: ../../whatsnew/3.13.rst:2153 msgid "" -"Add :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` functions " -"to get constants. For example, ``Py_GetConstant(Py_CONSTANT_ZERO)`` returns " -"a :term:`strong reference` to the constant zero. (Contributed by Victor " -"Stinner in :gh:`115754`.)" +"Add :c:func:`PyModule_Add` function, which is similar to :c:func:" +"`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " +"a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2157 +#: ../../whatsnew/3.13.rst:2158 msgid "" -"Add :c:func:`PyType_GetModuleByDef` to the limited C API (Contributed by " -"Victor Stinner in :gh:`116936`.)" +"Add the :c:func:`PyObject_GenericHash` function that implements the default " +"hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" +"`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2160 +#: ../../whatsnew/3.13.rst:2162 msgid "" -"Add two new functions to the C-API, :c:func:`PyRefTracer_SetTracer` and :c:" -"func:`PyRefTracer_GetTracer`, that allow to track object creation and " -"destruction the same way the :mod:`tracemalloc` module does. (Contributed by " -"Pablo Galindo in :gh:`93502`.)" +"Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " +"(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" #: ../../whatsnew/3.13.rst:2165 msgid "" -"Add :c:func:`PyEval_GetFrameBuiltins`, :c:func:`PyEval_GetFrameGlobals`, " -"and :c:func:`PyEval_GetFrameLocals` to the C API. These replacements for :c:" -"func:`PyEval_GetBuiltins`, :c:func:`PyEval_GetGlobals`, and :c:func:" -"`PyEval_GetLocals` return :term:`strong references ` " -"rather than borrowed references. (Added as part of :pep:`667`.)" +"Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" +"`PyObject_ClearManagedDict` functions. which must be called by the traverse " +"and clear functions of a type using the :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"flag. The `pythoncapi-compat project`_ can be used to use these functions " +"with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2171 +#: ../../whatsnew/3.13.rst:2173 msgid "" -"Add :c:type:`PyMutex` API, a lightweight mutex that occupies a single byte. " -"The :c:func:`PyMutex_Lock` function will release the GIL (if currently held) " -"if the operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:2177 -msgid "Build Changes" +"Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " +"functions, which enable tracking object creation and destruction in the same " +"way that the :mod:`tracemalloc` module does. (Contributed by Pablo Galindo " +"in :gh:`93502`.)" msgstr "" #: ../../whatsnew/3.13.rst:2179 msgid "" -"The :file:`configure` option :option:`--with-system-libmpdec` now defaults " -"to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " -"3.15." +"Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" +"`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " +"(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2183 +#: ../../whatsnew/3.13.rst:2184 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" -"`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" +"Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " +"to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " +"error if it is ``NULL``. The caller is responsible for checking if the " +"result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2187 +#: ../../whatsnew/3.13.rst:2190 msgid "" -"SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " -"module. (Contributed by Erlend Aasland in :gh:`105875`.)" +"Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " +"fully qualified name. The module name is prepended if ``type.__module__`` is " +"a string and is not equal to either ``'builtins'`` or ``'__main__'``. " +"(Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2190 +#: ../../whatsnew/3.13.rst:2196 msgid "" -"Python built with :file:`configure` :option:`--with-trace-refs` (tracing " -"references) is now ABI compatible with the Python release build and :ref:" -"`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" +"Add the :c:func:`PyType_GetModuleName` function to get the type's module " +"name. This is equivalent to getting the ``type.__module__`` attribute. " +"(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2195 +#: ../../whatsnew/3.13.rst:2201 msgid "" -"Building CPython now requires a compiler with support for the C11 atomic " -"library, GCC built-in atomic functions, or MSVC interlocked intrinsics." +"Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" +"`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" +"`const char*` UTF-8 encoded string and ``1`` if they are equal or ``0`` " +"otherwise. These functions do not raise exceptions. (Contributed by Serhiy " +"Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2198 +#: ../../whatsnew/3.13.rst:2208 msgid "" -"The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " -"``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." -"posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, ``_testconsole``, " -"``_testimportmultiple`` and ``_uuid`` C extensions are now built with the :" -"ref:`limited C API `. (Contributed by Victor Stinner in :gh:" -"`85283`.)" +"Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" +"`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " +"the referent is no longer live. (Contributed by Victor Stinner in :gh:" +"`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2205 -msgid "" -"``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " -"Cannon in :gh:`115192`.)" +#: ../../whatsnew/3.13.rst:2214 +msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2208 +#: ../../whatsnew/3.13.rst:2216 msgid "" -"``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " -"(Contributed by Brett Cannon in :gh:`115192`.)" +":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2211 +#: ../../whatsnew/3.13.rst:2217 msgid "" -"Python now bundles the `mimalloc library `__. It is licensed under the MIT license; see :ref:`mimalloc " -"license `. The bundled mimalloc has custom changes, see :" -"gh:`113141` for details. (Contributed by Dino Viehland in :gh:`109914`.)" +":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" +"`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2216 +#: ../../whatsnew/3.13.rst:2219 msgid "" -"On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " -"flags. For example, the free-threaded build generates ``python-3.13t.pc`` " -"and the debug build generates ``python-3.13d.pc``." +":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2222 -msgid "Porting to Python 3.13" +#: ../../whatsnew/3.13.rst:2220 +msgid "" +":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" +"`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2223 msgid "" -"This section lists previously described changes and other bugfixes that may " -"require changes to your code." +"The new functions return ``-1`` for errors and the standard ``1`` for true " +"and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2228 -msgid "Changes in the Python API" +#: ../../whatsnew/3.13.rst:2226 +msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" #: ../../whatsnew/3.13.rst:2230 -msgid "" -"An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " -"to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " -"or :exc:`KeyError` on Unix platforms where the password database is empty." -msgstr "" - -#: ../../whatsnew/3.13.rst:2234 -msgid "" -"The :mod:`threading` module now expects the :mod:`!_thread` module to have " -"an ``_is_main_interpreter`` attribute. It is a function with no arguments " -"that returns ``True`` if the current interpreter is the main interpreter." +msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2239 +#: ../../whatsnew/3.13.rst:2232 msgid "" -"Any library or application that provides a custom ``_thread`` module must " -"provide ``_is_main_interpreter()``, just like the module's other \"private\" " -"attributes. (See :gh:`112826`.)" +"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" +"func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " +"in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char " +"**`. In C++, this makes these functions compatible with arguments of type :c:" +"expr:`const char * const *`, :c:expr:`const char **`, or :c:expr:`char * " +"const *` without an explicit type cast. In C, the functions only support " +"arguments of type :c:expr:`char * const *`. This can be overridden with the :" +"c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy Storchaka in :gh:" +"`65210`.)" msgstr "" #: ../../whatsnew/3.13.rst:2244 msgid "" -":class:`mailbox.Maildir` now ignores files with a leading dot. (Contributed " -"by Zackery Spytz in :gh:`65559`.)" +":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " +"parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2248 msgid "" -":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " -"files and directories if a pattern that ends with \"``**``\" is given, " -"rather than directories only. Users may add a trailing slash to match only " -"directories." +"The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " +"named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " +"Romanyuk in :gh:`115781`.)" msgstr "" #: ../../whatsnew/3.13.rst:2252 msgid "" -"The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` was " -"changed from integer (``1`` or ``2``) to string (``'rb'`` or ``'wb'``). The " -"value of the :attr:`!mode` attribute of the readable file-like object " -"returned by :meth:`zipfile.ZipFile.open` was changed from ``'r'`` to " -"``'rb'``. (Contributed by Serhiy Storchaka in :gh:`115961`.)" +"The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" +"`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" +"`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, and :c:func:" +"`PySys_GetObject` functions, each of which clears all errors which occurred " +"when calling them now reports these errors using :func:`sys.unraisablehook`. " +"You may replace them with other functions as recommended in the " +"documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2261 msgid "" -":class:`functools.partial` now emits a :exc:`FutureWarning` when it is used " -"as a method. Its behavior will be changed in future Python versions. Wrap it " -"in :func:`staticmethod` if you want to preserve the old behavior. " -"(Contributed by Serhiy Storchaka in :gh:`121027`.)" +"Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" +"`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2266 -msgid "" -"Calling :func:`locals` in an :term:`optimized scope` now produces an " -"independent snapshot on each call, and hence no longer implicitly updates " -"previously returned references. Obtaining the legacy CPython behaviour now " -"requires explicit calls to update the initially returned dictionary with the " -"results of subsequent calls to :func:`!locals`. Code execution functions " -"that implicitly target :func:`!locals` (such as ``exec`` and ``eval``) must " -"be passed an explicit namespace to access their results in an optimized " -"scope. (Changed as part of :pep:`667`.)" +#: ../../whatsnew/3.13.rst:2264 +msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2275 -msgid "" -"Calling :func:`locals` from a comprehension at module or class scope " -"(including via ``exec`` or ``eval``) once more behaves as if the " -"comprehension were running as an independent nested function (i.e. the local " -"variables from the containing scope are not included). In Python 3.12, this " -"had changed to include the local variables from the containing scope when " -"implementing :pep:`709`. (Changed as part of :pep:`667`.)" +#: ../../whatsnew/3.13.rst:2265 +msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2282 -msgid "" -"Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " -"scope` now returns a write-through proxy rather than a snapshot that gets " -"updated at ill-specified times. If a snapshot is desired, it must be created " -"explicitly with ``dict`` or the proxy's ``.copy()`` method. (Changed as part " -"of :pep:`667`.)" +#: ../../whatsnew/3.13.rst:2266 +msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2289 -msgid "Changes in the C API" +#: ../../whatsnew/3.13.rst:2267 +msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2291 +#: ../../whatsnew/3.13.rst:2269 msgid "" -"``Python.h`` no longer includes the ```` standard header. It was " -"included for the ``finite()`` function which is now provided by the ```` header. It should now be included explicitly if needed. Remove also the " -"``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner in :gh:`108765`.)" +"See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" +"`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2297 +#: ../../whatsnew/3.13.rst:2272 msgid "" -"``Python.h`` no longer includes these standard header files: ````, " -"```` and ````. If needed, they should now be " -"included explicitly. For example, ```` provides the ``clock()`` and " -"``gmtime()`` functions, ```` provides the ``select()`` " -"function, and ```` provides the ``futimes()``, " -"``gettimeofday()`` and ``setitimer()`` functions. (Contributed by Victor " -"Stinner in :gh:`108765`.)" +"You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " +"including :file:`Python.h` when using ``#`` formats in :ref:`format codes " +"`. APIs accepting the format codes always " +"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki in :gh:" +"`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2305 +#: ../../whatsnew/3.13.rst:2278 msgid "" -"On Windows, ``Python.h`` no longer includes the ```` standard " -"header file. If needed, it should now be included explicitly. For example, " -"it provides ``offsetof()`` function, and ``size_t`` and ``ptrdiff_t`` types. " -"Including ```` explicitly was already needed by all other " -"platforms, the ``HAVE_STDDEF_H`` macro is only defined on Windows. " -"(Contributed by Victor Stinner in :gh:`108765`.)" +"If Python is built in :ref:`debug mode ` or :option:`with " +"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" +"`PyList_SET_ITEM` now check the index argument with an assertion. " +"(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2312 -msgid "" -"If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" -"Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" -"Py_BUILD_CORE_MODULE` macros are now undefined by ````. " -"(Contributed by Victor Stinner in :gh:`85283`.)" +#: ../../whatsnew/3.13.rst:2286 +msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2317 -msgid "" -"The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " -"``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " -"macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." +#: ../../whatsnew/3.13.rst:2288 +msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2321 -msgid "A ``tp_dealloc`` function that has the old macros, such as::" +#: ../../whatsnew/3.13.rst:2290 +msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2323 -msgid "" -"static void\n" -"mytype_dealloc(mytype *p)\n" -"{\n" -" PyObject_GC_UnTrack(p);\n" -" Py_TRASHCAN_SAFE_BEGIN(p);\n" -" ...\n" -" Py_TRASHCAN_SAFE_END\n" -"}" +#: ../../whatsnew/3.13.rst:2291 +msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2332 -msgid "should migrate to the new macros as follows::" +#: ../../whatsnew/3.13.rst:2292 +msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2334 -msgid "" -"static void\n" -"mytype_dealloc(mytype *p)\n" -"{\n" -" PyObject_GC_UnTrack(p);\n" -" Py_TRASHCAN_BEGIN(p, mytype_dealloc)\n" -" ...\n" -" Py_TRASHCAN_END\n" -"}" +#: ../../whatsnew/3.13.rst:2293 +msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2343 -msgid "" -"Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " -"deallocation function it is in. The new macros were added in Python 3.8 and " -"the old macros were deprecated in Python 3.11. (Contributed by Irit Katriel " -"in :gh:`105111`.)" +#: ../../whatsnew/3.13.rst:2294 +msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2348 -msgid "" -"Functions :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" -"`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" -"`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, and :c:func:" -"`PySys_GetObject`, which clear all errors which occurred when calling them, " -"now report them using :func:`sys.unraisablehook`. You may replace them with " -"other functions as recommended in the documentation. (Contributed by Serhiy " -"Storchaka in :gh:`106672`.)" +#: ../../whatsnew/3.13.rst:2295 +msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2357 -msgid "" -":c:func:`!PyCode_GetFirstFree` is an unstable API now and has been renamed " -"to :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan Romanyuk " -"in :gh:`115781`.)" +#: ../../whatsnew/3.13.rst:2296 +msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2363 +#: ../../whatsnew/3.13.rst:2298 msgid "" -"The effects of mutating the dictionary returned from :c:func:" -"`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " -"entries added this way will now *only* be visible to subsequent :c:func:" -"`PyEval_GetLocals` calls in that frame, as :c:func:`PyFrame_GetLocals`, :" -"func:`locals`, and :attr:`FrameType.f_locals ` no longer " -"access the same underlying cached dictionary. Changes made to entries for " -"actual variable names and names added via the write-through proxy interfaces " -"will be overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in " -"that frame. The recommended code update depends on how the function was " -"being used, so refer to the deprecation notice on the function for details. " -"(Changed as part of :pep:`667`.)" +"(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" +"`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2374 +#: ../../whatsnew/3.13.rst:2300 msgid "" -"Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " -"returns a write-through proxy rather than a snapshot that gets updated at " -"ill-specified times. If a snapshot is desired, it must be created explicitly " -"(e.g. with :c:func:`PyDict_Copy`) or by calling the new :c:func:" -"`PyEval_GetFrameLocals` API. (Changed as part of :pep:`667`.)" +"Python built with :option:`--with-trace-refs` (tracing references) now " +"supports the :ref:`Limited API `. (Contributed by Victor " +"Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2379 -msgid "" -":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " -"no longer have any effect. Calling these functions has been redundant since " -"Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced. (Changed " -"as part of :pep:`667`.)" +#: ../../whatsnew/3.13.rst:2306 +msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2384 +#: ../../whatsnew/3.13.rst:2308 msgid "" -":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " -"function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" -"through proxy for :term:`optimized scopes `. (Changed as " -"part of :pep:`667`.)" +"Remove several functions, macros, variables, etc with names prefixed by " +"``_Py`` or ``_PY`` (which are considered private). If your project is " +"affected by one of these removals and you believe that the removed API " +"should remain available, please :ref:`open a new issue ` " +"to request a public C API and add ``cc: @vstinner`` to the issue to notify " +"Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2389 -msgid "Removed C APIs" -msgstr "" - -#: ../../whatsnew/3.13.rst:2391 -msgid "" -"Remove many APIs (functions, macros, variables) with names prefixed by " -"``_Py`` or ``_PY`` (considered as private API). If your project is affected " -"by one of these removals and you consider that the removed API should remain " -"available, please open a new issue to request a public C API and add ``cc " -"@vstinner`` to the issue to notify Victor Stinner. (Contributed by Victor " -"Stinner in :gh:`106320`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:2398 -msgid "Remove functions deprecated in Python 3.9:" -msgstr "" - -#: ../../whatsnew/3.13.rst:2400 -msgid "" -"``PyEval_CallObject()``, ``PyEval_CallObjectWithKeywords()``: use :c:func:" -"`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead. Warning: :c:func:" -"`PyObject_Call` positional arguments must be a :class:`tuple` and must not " -"be ``NULL``, keyword arguments must be a :class:`dict` or ``NULL``, whereas " -"removed functions checked arguments type and accepted ``NULL`` positional " -"and keyword arguments. To replace ``PyEval_CallObjectWithKeywords(func, " -"NULL, kwargs)`` with :c:func:`PyObject_Call`, pass an empty tuple as " -"positional arguments using :c:func:`PyTuple_New(0) `." -msgstr "" - -#: ../../whatsnew/3.13.rst:2409 -msgid "``PyEval_CallFunction()``: use :c:func:`PyObject_CallFunction` instead." -msgstr "" - -#: ../../whatsnew/3.13.rst:2410 -msgid "``PyEval_CallMethod()``: use :c:func:`PyObject_CallMethod` instead." -msgstr "" - -#: ../../whatsnew/3.13.rst:2411 -msgid "``PyCFunction_Call()``: use :c:func:`PyObject_Call` instead." -msgstr "" - -#: ../../whatsnew/3.13.rst:2413 -msgid "(Contributed by Victor Stinner in :gh:`105107`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:2415 +#: ../../whatsnew/3.13.rst:2316 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2417 +#: ../../whatsnew/3.13.rst:2319 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " -"test if the object supports the buffer protocol. Note that :c:func:" +"test whether the object supports the buffer protocol. Note that :c:func:" "`PyObject_CheckBuffer` doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. To test if the object is actually readable, see the next " "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2327 msgid "" -":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: :c:func:" -"`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" +":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" +"func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2427 +#: ../../whatsnew/3.13.rst:2330 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4240,13 +4186,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2437 +#: ../../whatsnew/3.13.rst:2340 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2343 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4256,213 +4202,264 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2449 +#: ../../whatsnew/3.13.rst:2352 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2354 +msgid "Remove various functions deprecated in Python 3.9:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2356 +msgid "" +":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" +"c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." +msgstr "" + +#: ../../whatsnew/3.13.rst:2361 +msgid "" +"In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " +"and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " +"``NULL``, whereas the removed functions checked argument types and accepted " +"``NULL`` positional and keyword arguments. To replace " +"``PyEval_CallObjectWithKeywords(func, NULL, kwargs)`` with :c:func:" +"`PyObject_Call`, pass an empty tuple as positional arguments using :c:func:" +"`PyTuple_New(0) `." +msgstr "" + +#: ../../whatsnew/3.13.rst:2371 +msgid "" +":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." +msgstr "" + +#: ../../whatsnew/3.13.rst:2373 +msgid "" +":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." +msgstr "" + +#: ../../whatsnew/3.13.rst:2375 +msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." +msgstr "" + +#: ../../whatsnew/3.13.rst:2378 +msgid "(Contributed by Victor Stinner in :gh:`105107`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2380 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2454 +#: ../../whatsnew/3.13.rst:2383 msgid "" -"``PySys_AddWarnOptionUnicode()``: use :c:member:`PyConfig.warnoptions` " +":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2455 +#: ../../whatsnew/3.13.rst:2385 msgid "" -"``PySys_AddWarnOption()``: use :c:member:`PyConfig.warnoptions` instead." +":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2456 -msgid "``PySys_AddXOption()``: use :c:member:`PyConfig.xoptions` instead." +#: ../../whatsnew/3.13.rst:2387 +msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2457 -msgid "``PySys_HasWarnOptions()``: use :c:member:`PyConfig.xoptions` instead." +#: ../../whatsnew/3.13.rst:2389 +msgid "" +":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2458 +#: ../../whatsnew/3.13.rst:2391 msgid "" -"``PySys_SetPath()``: set :c:member:`PyConfig.module_search_paths` instead." +":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " +"instead." msgstr "" -#: ../../whatsnew/3.13.rst:2459 -msgid "``Py_SetPath()``: set :c:member:`PyConfig.module_search_paths` instead." +#: ../../whatsnew/3.13.rst:2393 +msgid "" +":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2460 +#: ../../whatsnew/3.13.rst:2395 msgid "" -"``Py_SetStandardStreamEncoding()``: set :c:member:`PyConfig.stdio_encoding` " -"instead, and set also maybe :c:member:`PyConfig.legacy_windows_stdio` (on " -"Windows)." +":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." +"stdio_encoding` instead, and set also maybe :c:member:`PyConfig." +"legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2463 +#: ../../whatsnew/3.13.rst:2398 msgid "" -"``_Py_SetProgramFullPath()``: set :c:member:`PyConfig.executable` instead." +":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " +"instead." msgstr "" -#: ../../whatsnew/3.13.rst:2465 +#: ../../whatsnew/3.13.rst:2401 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2469 +#: ../../whatsnew/3.13.rst:2405 msgid "" -"Remove ``PyEval_ThreadsInitialized()`` function, deprecated in Python 3.9. " -"Since Python 3.7, ``Py_Initialize()`` always creates the GIL: calling " -"``PyEval_InitThreads()`` does nothing and ``PyEval_ThreadsInitialized()`` " -"always returned non-zero. (Contributed by Victor Stinner in :gh:`105182`.)" +"Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " +"functions, deprecated in Python 3.2. They didn't update the current thread " +"state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2475 -msgid "" -"Remove ``PyEval_AcquireLock()`` and ``PyEval_ReleaseLock()`` functions, " -"deprecated in Python 3.2. They didn't update the current thread state. They " -"can be replaced with:" -msgstr "" - -#: ../../whatsnew/3.13.rst:2479 +#: ../../whatsnew/3.13.rst:2410 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2480 +#: ../../whatsnew/3.13.rst:2411 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2481 +#: ../../whatsnew/3.13.rst:2412 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2483 +#: ../../whatsnew/3.13.rst:2414 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2485 +#: ../../whatsnew/3.13.rst:2416 msgid "" -"Remove private ``_PyObject_FastCall()`` function: use " -"``PyObject_Vectorcall()`` which is available since Python 3.8 (:pep:`590`). " -"(Contributed by Victor Stinner in :gh:`106023`.)" +"Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " +"Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " +"GIL: calling :c:func:`!PyEval_InitThreads` does nothing and :c:func:`!" +"PyEval_ThreadsInitialized` always returns non-zero. (Contributed by Victor " +"Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2490 +#: ../../whatsnew/3.13.rst:2423 msgid "" -"Remove ``cpython/pytime.h`` header file: it only contained private " -"functions. (Contributed by Victor Stinner in :gh:`106316`.)" +"Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" +"`PyInterpreterState_Get()` which was kept for backward compatibility with " +"Python 3.8. The `pythoncapi-compat project`_ can be used to get :c:func:" +"`PyInterpreterState_Get()` on Python 3.8 and older. (Contributed by Victor " +"Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2493 +#: ../../whatsnew/3.13.rst:2430 msgid "" -"Remove ``_PyInterpreterState_Get()`` alias to :c:func:" -"`PyInterpreterState_Get()` which was kept for backward compatibility with " -"Python 3.8. The `pythoncapi-compat project `__ can be used to get :c:func:`PyInterpreterState_Get()` " -"on Python 3.8 and older. (Contributed by Victor Stinner in :gh:`106320`.)" +"Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" +"PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " +"(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2500 +#: ../../whatsnew/3.13.rst:2435 msgid "" -"The :c:func:`PyModule_AddObject` function is now :term:`soft deprecated`: :c:" -"func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions should be " -"used instead. (Contributed by Serhiy Storchaka in :gh:`86493`.)" +"Remove the ``cpython/pytime.h`` header file, which only contained private " +"functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2505 +#: ../../whatsnew/3.13.rst:2439 msgid "" -"Remove undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " +"Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2509 -msgid "Deprecated C APIs" +#: ../../whatsnew/3.13.rst:2442 +msgid "" +"Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " +"``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " +"``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``. (Contributed by Irit Katriel " +"in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2511 -msgid "" -"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types: use directly " -"the :c:type:`wchar_t` type instead. Since Python 3.3, ``Py_UNICODE`` and " -"``PY_UNICODE_TYPE`` are just aliases to :c:type:`wchar_t`. (Contributed by " -"Victor Stinner in :gh:`105156`.)" +#: ../../whatsnew/3.13.rst:2449 +msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2516 +#: ../../whatsnew/3.13.rst:2451 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2518 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +#: ../../whatsnew/3.13.rst:2453 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" -":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2520 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 -msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +#: ../../whatsnew/3.13.rst:2455 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2521 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +#: ../../whatsnew/3.13.rst:2457 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2522 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 -msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +#: ../../whatsnew/3.13.rst:2459 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2523 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 -msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +#: ../../whatsnew/3.13.rst:2461 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 +msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2524 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +#: ../../whatsnew/3.13.rst:2463 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 +msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2525 +#: ../../whatsnew/3.13.rst:2465 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" -":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or :envvar:" +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2528 +#: ../../whatsnew/3.13.rst:2469 +msgid "(Contributed by Victor Stinner in :gh:`105145`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2471 msgid "" -"Functions scheduled for removal in Python 3.15. (Contributed by Victor " -"Stinner in :gh:`105145`.)" +":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" +"c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " +"return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2531 +#: ../../whatsnew/3.13.rst:2477 msgid "" -"Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function which is just " -"an alias to :c:func:`PyImport_ImportModule` since Python 3.3. Scheduled for " -"removal in Python 3.15. (Contributed by Victor Stinner in :gh:`105396`.)" +"Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " +"an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " +"by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2536 +#: ../../whatsnew/3.13.rst:2481 msgid "" -"Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" -"`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`: " -"use the new :c:func:`PyWeakref_GetRef` function instead, it returns a :term:" -"`strong reference`. The `pythoncapi-compat project `__ can be used to get :c:func:`PyWeakref_GetRef` " -"on Python 3.12 and older. (Contributed by Victor Stinner in :gh:`105927`.)" +":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " +"function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" +"`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2544 +#: ../../whatsnew/3.13.rst:2487 msgid "" -"Deprecate the :c:func:`PyEval_GetBuiltins`, :c:func:`PyEval_GetGlobals`, " -"and :c:func:`PyEval_GetLocals` functions, which return a :term:`borrowed " -"reference`. Refer to the deprecation notices on each function for their " -"recommended replacements. (Soft deprecated as part of :pep:`667`.)" +"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" +"macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " +"instead. Since Python 3.3, ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` are just " +"aliases to :c:type:`!wchar_t`. (Contributed by Victor Stinner in :gh:" +"`105156`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2494 +msgid "" +"Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" +"`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " +"Replace them with the new :c:func:`PyWeakref_GetRef` function, which returns " +"a :term:`strong reference`. The `pythoncapi-compat project`_ can be used to " +"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older. (Contributed by " +"Victor Stinner in :gh:`105927`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 @@ -4483,140 +4480,142 @@ msgid "" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 -msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 -msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 -msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:16 +msgid "" +":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " +"instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 -msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:18 +msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 msgid "Global configuration variables:" msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 -msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +msgid ":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 -msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +msgid ":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 -msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +msgid ":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 msgid "" -":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 -msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +msgid ":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:36 msgid "" -":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 -msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +msgid ":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 msgid "" -":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 msgid "" -":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:44 msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 msgid "" -":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." "user_site_directory` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 msgid "" -":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:52 msgid "" -":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 -msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:55 +msgid ":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." "legacy_windows_fs_encoding` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." "legacy_windows_stdio` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." "filesystem_encoding` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." "filesystem_errors` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" "c:func:`Py_PreInitialize`)" msgstr "" @@ -4626,36 +4625,26 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 msgid "" -":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 -msgid ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`PyWeakref_GetRef` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`PyWeakref_GetRef` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 -msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +msgid "" +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead." msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 -msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +msgid "" +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" msgstr "" -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 -msgid "" -":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" -"`PYTHONHOME` environment variable instead." -msgstr "" - #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" "The following APIs are deprecated and will be removed, although there is " @@ -4663,122 +4652,451 @@ msgid "" msgstr "" #: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:8 -msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 msgid "" -":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" -":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 msgid "" -":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:12 -msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +#: ../../deprecations/c-api-pending-removal-in-future.rst:25 msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:18 -msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +#: ../../deprecations/c-api-pending-removal-in-future.rst:33 msgid "" -":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " +"instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +#: ../../deprecations/c-api-pending-removal-in-future.rst:35 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +#: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +#: ../../deprecations/c-api-pending-removal-in-future.rst:38 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +#: ../../deprecations/c-api-pending-removal-in-future.rst:40 msgid "" -":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +#: ../../deprecations/c-api-pending-removal-in-future.rst:42 +msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +#: ../../deprecations/c-api-pending-removal-in-future.rst:44 msgid "" -":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +#: ../../deprecations/c-api-pending-removal-in-future.rst:46 msgid "" -":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +#: ../../deprecations/c-api-pending-removal-in-future.rst:48 msgid "" -":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " "instead." msgstr "" -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +#: ../../deprecations/c-api-pending-removal-in-future.rst:50 +msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2558 -msgid "Regression Test Changes" +#: ../../whatsnew/3.13.rst:2514 +msgid "Build Changes" +msgstr "" + +#: ../../whatsnew/3.13.rst:2516 +msgid "" +"``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " +"tier 3 platforms. (:ref:`PEP 730 ` written and " +"implementation contributed by Russell Keith-Magee in :gh:`114099`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2521 +msgid "" +"``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" +"`11` tier 3 platforms. (:ref:`PEP 738 ` " +"written and implementation contributed by Malcolm Smith in :gh:`116622`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2526 +msgid "" +"``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " +"Cannon in :gh:`115192`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2529 +msgid "" +"``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " +"(Contributed by Brett Cannon in :gh:`115192`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2532 +msgid "" +"Building CPython now requires a compiler with support for the C11 atomic " +"library, GCC built-in atomic functions, or MSVC interlocked intrinsics." +msgstr "" + +#: ../../whatsnew/3.13.rst:2535 +msgid "" +"Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" +"`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2539 +msgid "" +"SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " +"module. (Contributed by Erlend Aasland in :gh:`105875`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2543 +msgid "" +"CPython now bundles the `mimalloc library`_ by default. It is licensed under " +"the MIT license; see :ref:`mimalloc license `. The bundled " +"mimalloc has custom changes, see :gh:`113141` for details. (Contributed by " +"Dino Viehland in :gh:`109914`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2551 +msgid "" +"The :file:`configure` option :option:`--with-system-libmpdec` now defaults " +"to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " +"3.15." +msgstr "" + +#: ../../whatsnew/3.13.rst:2555 +msgid "" +"Python built with :file:`configure` :option:`--with-trace-refs` (tracing " +"references) is now ABI compatible with the Python release build and :ref:" +"`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" #: ../../whatsnew/3.13.rst:2560 msgid "" +"On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " +"flags. For example, the free-threaded build generates ``python-3.13t.pc`` " +"and the debug build generates ``python-3.13d.pc``." +msgstr "" + +#: ../../whatsnew/3.13.rst:2564 +msgid "" +"The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " +"``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." +"posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, ``_testconsole``, " +"``_testimportmultiple`` and ``_uuid`` C extensions are now built with the :" +"ref:`limited C API `. (Contributed by Victor Stinner in :gh:" +"`85283`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2573 +msgid "Porting to Python 3.13" +msgstr "" + +#: ../../whatsnew/3.13.rst:2575 +msgid "" +"This section lists previously described changes and other bugfixes that may " +"require changes to your code." +msgstr "" + +#: ../../whatsnew/3.13.rst:2579 +msgid "Changes in the Python API" +msgstr "" + +#: ../../whatsnew/3.13.rst:2583 +msgid "" +":ref:`PEP 667 ` introduces several changes to " +"the semantics of :func:`locals` and :attr:`f_locals `:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2586 +msgid "" +"Calling :func:`locals` in an :term:`optimized scope` now produces an " +"independent snapshot on each call, and hence no longer implicitly updates " +"previously returned references. Obtaining the legacy CPython behavior now " +"requires explicit calls to update the initially returned dictionary with the " +"results of subsequent calls to :func:`!locals`. Code execution functions " +"that implicitly target :func:`!locals` (such as ``exec`` and ``eval``) must " +"be passed an explicit namespace to access their results in an optimized " +"scope. (Changed as part of :pep:`667`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2595 +msgid "" +"Calling :func:`locals` from a comprehension at module or class scope " +"(including via ``exec`` or ``eval``) once more behaves as if the " +"comprehension were running as an independent nested function (i.e. the local " +"variables from the containing scope are not included). In Python 3.12, this " +"had changed to include the local variables from the containing scope when " +"implementing :pep:`709`. (Changed as part of :pep:`667`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2602 +msgid "" +"Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " +"scope` now returns a write-through proxy rather than a snapshot that gets " +"updated at ill-specified times. If a snapshot is desired, it must be created " +"explicitly with ``dict`` or the proxy's ``.copy()`` method. (Changed as part " +"of :pep:`667`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2608 +msgid "" +":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " +"method. The behavior will change in future Python versions. Wrap it in :func:" +"`staticmethod` if you want to preserve the old behavior. (Contributed by " +"Serhiy Storchaka in :gh:`121027`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2614 +msgid "" +"The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2621 +msgid "" +"An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " +"to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " +"or :exc:`KeyError` on Unix platforms where the password database is empty." +msgstr "" + +#: ../../whatsnew/3.13.rst:2626 +msgid "" +"The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " +"string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " +"value of the :attr:`!mode` attribute of the readable file-like object " +"returned by :meth:`zipfile.ZipFile.open` is now ``'rb'`` instead of ``'r'``. " +"(Contributed by Serhiy Storchaka in :gh:`115961`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2632 +msgid "" +":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " +"(Contributed by Zackery Spytz in :gh:`65559`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2635 +msgid "" +":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " +"files and directories if a pattern that ends with \"``**``\" is given, " +"rather than directories only. Add a trailing slash to keep the previous " +"behavior and only match directories." +msgstr "" + +#: ../../whatsnew/3.13.rst:2640 +msgid "" +"The :mod:`threading` module now expects the :mod:`!_thread` module to have " +"an :func:`!_is_main_interpreter` function. This function takes no arguments " +"and returns ``True`` if the current interpreter is the main interpreter." +msgstr "" + +#: ../../whatsnew/3.13.rst:2645 +msgid "" +"Any library or application that provides a custom :mod:`!_thread` module " +"must provide :func:`!_is_main_interpreter`, just like the module's other " +"\"private\" attributes. (:gh:`112826`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2652 +msgid "Changes in the C API" +msgstr "" + +#: ../../whatsnew/3.13.rst:2654 +msgid "" +"``Python.h`` no longer includes the ```` standard header. It was " +"included for the :c:func:`!finite` function which is now provided by the " +"```` header. It should now be included explicitly if needed. Remove " +"also the ``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner in :gh:" +"`108765`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2660 +msgid "" +"``Python.h`` no longer includes these standard header files: ````, " +"```` and ````. If needed, they should now be " +"included explicitly. For example, ```` provides the :c:func:`!clock` " +"and :c:func:`!gmtime` functions, ```` provides the :c:func:`!" +"select` function, and ```` provides the :c:func:`!futimes`, :c:" +"func:`!gettimeofday` and :c:func:`!setitimer` functions. (Contributed by " +"Victor Stinner in :gh:`108765`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2668 +msgid "" +"On Windows, ``Python.h`` no longer includes the ```` standard " +"header file. If needed, it should now be included explicitly. For example, " +"it provides :c:func:`!offsetof` function, and ``size_t`` and ``ptrdiff_t`` " +"types. Including ```` explicitly was already needed by all other " +"platforms, the ``HAVE_STDDEF_H`` macro is only defined on Windows. " +"(Contributed by Victor Stinner in :gh:`108765`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2675 +msgid "" +"If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" +"Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" +"Py_BUILD_CORE_MODULE` macros are now undefined by ````. " +"(Contributed by Victor Stinner in :gh:`85283`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2680 +msgid "" +"The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " +"``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " +"macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." +msgstr "" + +#: ../../whatsnew/3.13.rst:2684 +msgid "A ``tp_dealloc`` function that has the old macros, such as::" +msgstr "" + +#: ../../whatsnew/3.13.rst:2686 +msgid "" +"static void\n" +"mytype_dealloc(mytype *p)\n" +"{\n" +" PyObject_GC_UnTrack(p);\n" +" Py_TRASHCAN_SAFE_BEGIN(p);\n" +" ...\n" +" Py_TRASHCAN_SAFE_END\n" +"}" +msgstr "" + +#: ../../whatsnew/3.13.rst:2695 +msgid "should migrate to the new macros as follows::" +msgstr "" + +#: ../../whatsnew/3.13.rst:2697 +msgid "" +"static void\n" +"mytype_dealloc(mytype *p)\n" +"{\n" +" PyObject_GC_UnTrack(p);\n" +" Py_TRASHCAN_BEGIN(p, mytype_dealloc)\n" +" ...\n" +" Py_TRASHCAN_END\n" +"}" +msgstr "" + +#: ../../whatsnew/3.13.rst:2706 +msgid "" +"Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " +"deallocation function it is in. The new macros were added in Python 3.8 and " +"the old macros were deprecated in Python 3.11. (Contributed by Irit Katriel " +"in :gh:`105111`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:2713 +msgid "" +":ref:`PEP 667 ` introduces several changes to " +"frame-related functions:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2716 +msgid "" +"The effects of mutating the dictionary returned from :c:func:" +"`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " +"entries added this way will now *only* be visible to subsequent :c:func:" +"`PyEval_GetLocals` calls in that frame, as :c:func:`PyFrame_GetLocals`, :" +"func:`locals`, and :attr:`FrameType.f_locals ` no longer " +"access the same underlying cached dictionary. Changes made to entries for " +"actual variable names and names added via the write-through proxy interfaces " +"will be overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in " +"that frame. The recommended code update depends on how the function was " +"being used, so refer to the deprecation notice on the function for details." +msgstr "" + +#: ../../whatsnew/3.13.rst:2729 +msgid "" +"Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " +"returns a write-through proxy rather than a snapshot that gets updated at " +"ill-specified times. If a snapshot is desired, it must be created explicitly " +"(e.g. with :c:func:`PyDict_Copy`), or by calling the new :c:func:" +"`PyEval_GetFrameLocals` API." +msgstr "" + +#: ../../whatsnew/3.13.rst:2736 +msgid "" +":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " +"no longer have any effect. Calling these functions has been redundant since " +"Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." +msgstr "" + +#: ../../whatsnew/3.13.rst:2741 +msgid "" +":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " +"function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" +"through proxy for :term:`optimized scopes `." +msgstr "" + +#: ../../whatsnew/3.13.rst:2746 +msgid "Regression Test Changes" +msgstr "" + +#: ../../whatsnew/3.13.rst:2748 +msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " "specifies a module that should be imported early in the lifecycle of the " diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index f27239f8a4..5f49805ffb 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -2537,8 +2537,8 @@ msgid "" "The :func:`ssl.wrap_socket() ` constructor " "function now takes a *ciphers* argument. The *ciphers* string lists the " "allowed encryption algorithms using the format described in the `OpenSSL " -"documentation `__." +"documentation `__." msgstr "" #: ../../whatsnew/3.2.rst:1655 diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 35f2b010c0..49ff4555d8 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -339,13 +339,14 @@ msgstr "" #: ../../whatsnew/3.4.rst:218 msgid "" -"As `discussed in the PEP`__, platform packagers may choose not to install " -"these commands by default, as long as, when invoked, they provide clear and " -"simple directions on how to install them on that platform (usually using the " -"system package manager)." +"As :pep:`discussed in the PEP <0453#recommendations-for-downstream-" +"distributors>` platform packagers may choose not to install these commands " +"by default, as long as, when invoked, they provide clear and simple " +"directions on how to install them on that platform (usually using the system " +"package manager)." msgstr "" -#: ../../whatsnew/3.4.rst:227 +#: ../../whatsnew/3.4.rst:226 msgid "" "To avoid conflicts between parallel Python 2 and Python 3 installations, " "only the versioned ``pip3`` and ``pip3.4`` commands are bootstrapped by " @@ -357,11 +358,11 @@ msgid "" "multiple Python installations." msgstr "" -#: ../../whatsnew/3.4.rst:238 +#: ../../whatsnew/3.4.rst:237 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/3.4.rst:240 +#: ../../whatsnew/3.4.rst:239 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -371,28 +372,28 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/3.4.rst:248 +#: ../../whatsnew/3.4.rst:247 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" "ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/3.4.rst:254 +#: ../../whatsnew/3.4.rst:253 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/3.4.rst:255 +#: ../../whatsnew/3.4.rst:254 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/3.4.rst:262 +#: ../../whatsnew/3.4.rst:261 msgid "PEP 446: Newly Created File Descriptors Are Non-Inheritable" msgstr "" -#: ../../whatsnew/3.4.rst:264 +#: ../../whatsnew/3.4.rst:263 msgid "" ":pep:`446` makes newly created file descriptors :ref:`non-inheritable " "`. In general, this is the behavior an application will " @@ -401,39 +402,39 @@ msgid "" "to security issues." msgstr "" -#: ../../whatsnew/3.4.rst:270 +#: ../../whatsnew/3.4.rst:269 msgid "" "However, there are occasions when inheritance is desired. To support these " "cases, the following new functions and methods are available:" msgstr "" -#: ../../whatsnew/3.4.rst:273 +#: ../../whatsnew/3.4.rst:272 msgid ":func:`os.get_inheritable`, :func:`os.set_inheritable`" msgstr ":func:`os.get_inheritable`, :func:`os.set_inheritable`" -#: ../../whatsnew/3.4.rst:274 +#: ../../whatsnew/3.4.rst:273 msgid ":func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`" msgstr ":func:`os.get_handle_inheritable`, :func:`os.set_handle_inheritable`" -#: ../../whatsnew/3.4.rst:275 +#: ../../whatsnew/3.4.rst:274 msgid "" ":meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`" msgstr "" ":meth:`socket.socket.get_inheritable`, :meth:`socket.socket.set_inheritable`" -#: ../../whatsnew/3.4.rst:279 +#: ../../whatsnew/3.4.rst:278 msgid ":pep:`446` -- Make newly created file descriptors non-inheritable" msgstr "" -#: ../../whatsnew/3.4.rst:280 ../../whatsnew/3.4.rst:1812 +#: ../../whatsnew/3.4.rst:279 ../../whatsnew/3.4.rst:1811 msgid "PEP written and implemented by Victor Stinner." msgstr "由 Victor Stinner 撰寫 PEP 與實作。" -#: ../../whatsnew/3.4.rst:286 +#: ../../whatsnew/3.4.rst:285 msgid "Improvements to Codec Handling" msgstr "" -#: ../../whatsnew/3.4.rst:288 +#: ../../whatsnew/3.4.rst:287 msgid "" "Since it was first introduced, the :mod:`codecs` module has always been " "intended to operate as a type-neutral dynamic encoding and decoding system. " @@ -442,7 +443,7 @@ msgid "" "and :class:`bytearray` types, has historically obscured that fact." msgstr "" -#: ../../whatsnew/3.4.rst:295 +#: ../../whatsnew/3.4.rst:294 msgid "" "As a key step in clarifying the situation, the :meth:`codecs.encode` and :" "meth:`codecs.decode` convenience functions are now properly documented in " @@ -451,7 +452,7 @@ msgid "" "2.4, but were previously only discoverable through runtime introspection." msgstr "" -#: ../../whatsnew/3.4.rst:301 +#: ../../whatsnew/3.4.rst:300 msgid "" "Unlike the convenience methods on :class:`str`, :class:`bytes` and :class:" "`bytearray`, the :mod:`codecs` convenience functions support arbitrary " @@ -460,14 +461,14 @@ msgid "" "conversions (in Python 2)." msgstr "" -#: ../../whatsnew/3.4.rst:307 +#: ../../whatsnew/3.4.rst:306 msgid "" "In Python 3.4, the interpreter is able to identify the known non-text " "encodings provided in the standard library and direct users towards these " "general purpose convenience functions when appropriate::" msgstr "" -#: ../../whatsnew/3.4.rst:311 +#: ../../whatsnew/3.4.rst:310 msgid "" ">>> b\"abcdef\".decode(\"hex\")\n" "Traceback (most recent call last):\n" @@ -505,7 +506,7 @@ msgstr "" "LookupError: 'hex' is not a text encoding; use codecs.open() to handle " "arbitrary codecs" -#: ../../whatsnew/3.4.rst:326 +#: ../../whatsnew/3.4.rst:325 msgid "" "In a related change, whenever it is feasible without breaking backwards " "compatibility, exceptions raised during encoding and decoding operations are " @@ -513,7 +514,7 @@ msgid "" "the codec responsible for producing the error::" msgstr "" -#: ../../whatsnew/3.4.rst:331 +#: ../../whatsnew/3.4.rst:330 msgid "" ">>> import codecs\n" "\n" @@ -548,7 +549,7 @@ msgid "" "support the buffer interface)" msgstr "" -#: ../../whatsnew/3.4.rst:359 +#: ../../whatsnew/3.4.rst:358 msgid "" "Finally, as the examples above show, these improvements have permitted the " "restoration of the convenience aliases for the non-Unicode codecs that were " @@ -556,7 +557,7 @@ msgid "" "and from its hexadecimal representation (for example) can now be written as::" msgstr "" -#: ../../whatsnew/3.4.rst:365 +#: ../../whatsnew/3.4.rst:364 msgid "" ">>> from codecs import encode, decode\n" ">>> encode(b\"hello\", \"hex\")\n" @@ -565,13 +566,13 @@ msgid "" "b'hello'" msgstr "" -#: ../../whatsnew/3.4.rst:371 +#: ../../whatsnew/3.4.rst:370 msgid "" "The binary and text transforms provided in the standard library are detailed " "in :ref:`binary-transforms` and :ref:`text-transforms`." msgstr "" -#: ../../whatsnew/3.4.rst:374 +#: ../../whatsnew/3.4.rst:373 msgid "" "(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" "`17828` and :issue:`19619`.)" @@ -579,11 +580,11 @@ msgstr "" "(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:" "`19619` 中貢獻。)" -#: ../../whatsnew/3.4.rst:381 +#: ../../whatsnew/3.4.rst:380 msgid "PEP 451: A ModuleSpec Type for the Import System" msgstr "" -#: ../../whatsnew/3.4.rst:383 +#: ../../whatsnew/3.4.rst:382 msgid "" ":pep:`451` provides an encapsulation of the information about a module that " "the import machinery will use to load it (that is, a module specification). " @@ -592,7 +593,7 @@ msgid "" "related improvements`__." msgstr "" -#: ../../whatsnew/3.4.rst:391 +#: ../../whatsnew/3.4.rst:390 msgid "" "The public-facing changes from the PEP are entirely backward-compatible. " "Furthermore, they should be transparent to everyone but importer authors. " @@ -603,19 +604,19 @@ msgid "" "and their replacements." msgstr "" -#: ../../whatsnew/3.4.rst:401 +#: ../../whatsnew/3.4.rst:400 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.4.rst:403 +#: ../../whatsnew/3.4.rst:402 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/3.4.rst:405 +#: ../../whatsnew/3.4.rst:404 msgid "Unicode database updated to UCD version 6.3." msgstr "" -#: ../../whatsnew/3.4.rst:407 +#: ../../whatsnew/3.4.rst:406 msgid "" ":func:`min` and :func:`max` now accept a *default* keyword-only argument " "that can be used to specify the value they return if the iterable they are " @@ -623,11 +624,11 @@ msgid "" "`18111`.)" msgstr "" -#: ../../whatsnew/3.4.rst:412 +#: ../../whatsnew/3.4.rst:411 msgid "Module objects are now :ref:`weakly referenceable `." msgstr "" -#: ../../whatsnew/3.4.rst:414 +#: ../../whatsnew/3.4.rst:413 msgid "" "Module ``__file__`` attributes (and related values) should now always " "contain absolute paths by default, with the sole exception of ``__main__." @@ -635,7 +636,7 @@ msgid "" "(Contributed by Brett Cannon in :issue:`18416`.)" msgstr "" -#: ../../whatsnew/3.4.rst:419 +#: ../../whatsnew/3.4.rst:418 msgid "" "All the UTF-\\* codecs (except UTF-7) now reject surrogates during both " "encoding and decoding unless the ``surrogatepass`` error handler is used, " @@ -645,69 +646,69 @@ msgid "" "Storchaka in :issue:`12892`.)" msgstr "" -#: ../../whatsnew/3.4.rst:426 +#: ../../whatsnew/3.4.rst:425 msgid "" "New German EBCDIC :ref:`codec ` ``cp273``. (Contributed " "by Michael Bierenfeld and Andrew Kuchling in :issue:`1097797`.)" msgstr "" -#: ../../whatsnew/3.4.rst:429 +#: ../../whatsnew/3.4.rst:428 msgid "" "New Ukrainian :ref:`codec ` ``cp1125``. (Contributed by " "Serhiy Storchaka in :issue:`19668`.)" msgstr "" -#: ../../whatsnew/3.4.rst:432 +#: ../../whatsnew/3.4.rst:431 msgid "" ":class:`bytes`.join() and :class:`bytearray`.join() now accept arbitrary " "buffer objects as arguments. (Contributed by Antoine Pitrou in :issue:" "`15958`.)" msgstr "" -#: ../../whatsnew/3.4.rst:436 +#: ../../whatsnew/3.4.rst:435 msgid "" "The :class:`int` constructor now accepts any object that has an " "``__index__`` method for its *base* argument. (Contributed by Mark " "Dickinson in :issue:`16772`.)" msgstr "" -#: ../../whatsnew/3.4.rst:440 +#: ../../whatsnew/3.4.rst:439 msgid "" "Frame objects now have a :func:`~frame.clear` method that clears all " "references to local variables from the frame. (Contributed by Antoine " "Pitrou in :issue:`17934`.)" msgstr "" -#: ../../whatsnew/3.4.rst:444 +#: ../../whatsnew/3.4.rst:443 msgid "" ":class:`memoryview` is now registered as a :class:`Sequence `, and supports the :func:`reversed` builtin. (Contributed by Nick " "Coghlan and Claudiu Popa in :issue:`18690` and :issue:`19078`.)" msgstr "" -#: ../../whatsnew/3.4.rst:448 +#: ../../whatsnew/3.4.rst:447 msgid "" "Signatures reported by :func:`help` have been modified and improved in " "several cases as a result of the introduction of Argument Clinic and other " "changes to the :mod:`inspect` and :mod:`pydoc` modules." msgstr "" -#: ../../whatsnew/3.4.rst:452 +#: ../../whatsnew/3.4.rst:451 msgid "" ":meth:`~object.__length_hint__` is now part of the formal language " "specification (see :pep:`424`). (Contributed by Armin Ronacher in :issue:" "`16148`.)" msgstr "" -#: ../../whatsnew/3.4.rst:458 +#: ../../whatsnew/3.4.rst:457 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.4.rst:464 +#: ../../whatsnew/3.4.rst:463 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.4.rst:466 +#: ../../whatsnew/3.4.rst:465 msgid "" "The new :mod:`asyncio` module (defined in :pep:`3156`) provides a standard " "pluggable event loop model for Python, providing solid asynchronous IO " @@ -715,23 +716,23 @@ msgid "" "implementations to interoperate with the standard library and each other." msgstr "" -#: ../../whatsnew/3.4.rst:471 ../../whatsnew/3.4.rst:534 +#: ../../whatsnew/3.4.rst:470 ../../whatsnew/3.4.rst:533 msgid "For Python 3.4, this module is considered a :term:`provisional API`." msgstr "" -#: ../../whatsnew/3.4.rst:475 +#: ../../whatsnew/3.4.rst:474 msgid ":pep:`3156` -- Asynchronous IO Support Rebooted: the \"asyncio\" Module" msgstr "" -#: ../../whatsnew/3.4.rst:476 +#: ../../whatsnew/3.4.rst:475 msgid "PEP written and implementation led by Guido van Rossum." msgstr "由 Guido van Rossum 撰寫 PEP 與帶領實作。" -#: ../../whatsnew/3.4.rst:482 +#: ../../whatsnew/3.4.rst:481 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.4.rst:484 +#: ../../whatsnew/3.4.rst:483 msgid "" "The new :mod:`ensurepip` module is the primary infrastructure for the :pep:" "`453` implementation. In the normal course of events end users will not " @@ -740,7 +741,7 @@ msgid "" "environment was declined." msgstr "" -#: ../../whatsnew/3.4.rst:490 +#: ../../whatsnew/3.4.rst:489 msgid "" ":mod:`ensurepip` includes a bundled copy of ``pip``, up-to-date as of the " "first release candidate of the release of CPython with which it ships (this " @@ -752,7 +753,7 @@ msgid "" "package and will not be removed if Python is uninstalled.)" msgstr "" -#: ../../whatsnew/3.4.rst:499 +#: ../../whatsnew/3.4.rst:498 msgid "" "The module is named *ensure*\\ pip because if called when ``pip`` is already " "installed, it does nothing. It also has an ``--upgrade`` option that will " @@ -760,11 +761,11 @@ msgid "" "version of ``pip`` is older than the bundled copy." msgstr "" -#: ../../whatsnew/3.4.rst:508 +#: ../../whatsnew/3.4.rst:507 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.4.rst:510 +#: ../../whatsnew/3.4.rst:509 msgid "" "The new :mod:`enum` module (defined in :pep:`435`) provides a standard " "implementation of enumeration types, allowing other modules (such as :mod:" @@ -773,21 +774,21 @@ msgid "" "enumeration values." msgstr "" -#: ../../whatsnew/3.4.rst:518 +#: ../../whatsnew/3.4.rst:517 msgid ":pep:`435` -- Adding an Enum type to the Python standard library" msgstr "" -#: ../../whatsnew/3.4.rst:519 +#: ../../whatsnew/3.4.rst:518 msgid "" "PEP written by Barry Warsaw, Eli Bendersky and Ethan Furman, implemented by " "Ethan Furman." msgstr "" -#: ../../whatsnew/3.4.rst:526 +#: ../../whatsnew/3.4.rst:525 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.4.rst:528 +#: ../../whatsnew/3.4.rst:527 msgid "" "The new :mod:`pathlib` module offers classes representing filesystem paths " "with semantics appropriate for different operating systems. Path classes " @@ -796,30 +797,30 @@ msgid "" "but also provide I/O operations." msgstr "" -#: ../../whatsnew/3.4.rst:538 +#: ../../whatsnew/3.4.rst:537 msgid ":pep:`428` -- The pathlib module -- object-oriented filesystem paths" msgstr "" -#: ../../whatsnew/3.4.rst:539 ../../whatsnew/3.4.rst:1835 +#: ../../whatsnew/3.4.rst:538 ../../whatsnew/3.4.rst:1834 msgid "PEP written and implemented by Antoine Pitrou." msgstr "由 Antoine Pitrou 撰寫 PEP 與實作。" -#: ../../whatsnew/3.4.rst:545 +#: ../../whatsnew/3.4.rst:544 msgid "selectors" msgstr "selectors" -#: ../../whatsnew/3.4.rst:547 +#: ../../whatsnew/3.4.rst:546 msgid "" "The new :mod:`selectors` module (created as part of implementing :pep:" "`3156`) allows high-level and efficient I/O multiplexing, built upon the :" "mod:`select` module primitives." msgstr "" -#: ../../whatsnew/3.4.rst:555 +#: ../../whatsnew/3.4.rst:554 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.4.rst:557 +#: ../../whatsnew/3.4.rst:556 msgid "" "The new :mod:`statistics` module (defined in :pep:`450`) offers some core " "statistics functionality directly in the standard library. This module " @@ -827,64 +828,64 @@ msgid "" "deviation of a data series." msgstr "" -#: ../../whatsnew/3.4.rst:564 +#: ../../whatsnew/3.4.rst:563 msgid ":pep:`450` -- Adding A Statistics Module To The Standard Library" msgstr "" -#: ../../whatsnew/3.4.rst:565 +#: ../../whatsnew/3.4.rst:564 msgid "PEP written and implemented by Steven D'Aprano" msgstr "由 Steven D'Aprano 撰寫 PEP 與實作" -#: ../../whatsnew/3.4.rst:571 +#: ../../whatsnew/3.4.rst:570 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.4.rst:573 +#: ../../whatsnew/3.4.rst:572 msgid "" "The new :mod:`tracemalloc` module (defined in :pep:`454`) is a debug tool to " "trace memory blocks allocated by Python. It provides the following " "information:" msgstr "" -#: ../../whatsnew/3.4.rst:576 +#: ../../whatsnew/3.4.rst:575 msgid "Trace where an object was allocated" msgstr "" -#: ../../whatsnew/3.4.rst:577 +#: ../../whatsnew/3.4.rst:576 msgid "" "Statistics on allocated memory blocks per filename and per line number: " "total size, number and average size of allocated memory blocks" msgstr "" -#: ../../whatsnew/3.4.rst:579 +#: ../../whatsnew/3.4.rst:578 msgid "Compute the differences between two snapshots to detect memory leaks" msgstr "" -#: ../../whatsnew/3.4.rst:583 +#: ../../whatsnew/3.4.rst:582 msgid "" ":pep:`454` -- Add a new tracemalloc module to trace Python memory allocations" msgstr "" -#: ../../whatsnew/3.4.rst:584 +#: ../../whatsnew/3.4.rst:583 msgid "PEP written and implemented by Victor Stinner" msgstr "由 Victor Stinner 撰寫 PEP 與實作" -#: ../../whatsnew/3.4.rst:589 +#: ../../whatsnew/3.4.rst:588 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.4.rst:593 +#: ../../whatsnew/3.4.rst:592 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.4.rst:595 +#: ../../whatsnew/3.4.rst:594 msgid "" "New function :func:`abc.get_cache_token` can be used to know when to " "invalidate caches that are affected by changes in the object graph. " "(Contributed by Łukasz Langa in :issue:`16832`.)" msgstr "" -#: ../../whatsnew/3.4.rst:599 +#: ../../whatsnew/3.4.rst:598 msgid "" "New class :class:`~abc.ABC` has :class:`~abc.ABCMeta` as its meta class. " "Using ``ABC`` as a base class has essentially the same effect as specifying " @@ -892,17 +893,17 @@ msgid "" "(Contributed by Bruno Dupuis in :issue:`16049`.)" msgstr "" -#: ../../whatsnew/3.4.rst:606 +#: ../../whatsnew/3.4.rst:605 msgid "aifc" msgstr "aifc" -#: ../../whatsnew/3.4.rst:608 +#: ../../whatsnew/3.4.rst:607 msgid "" "The :meth:`!getparams` method now returns a namedtuple rather than a plain " "tuple. (Contributed by Claudiu Popa in :issue:`17818`.)" msgstr "" -#: ../../whatsnew/3.4.rst:611 +#: ../../whatsnew/3.4.rst:610 msgid "" ":func:`!aifc.open` now supports the context management protocol: when used " "in a :keyword:`with` block, the :meth:`!close` method of the returned object " @@ -910,52 +911,52 @@ msgid "" "Serhiy Storchacha in :issue:`16486`.)" msgstr "" -#: ../../whatsnew/3.4.rst:616 ../../whatsnew/3.4.rst:1543 +#: ../../whatsnew/3.4.rst:615 ../../whatsnew/3.4.rst:1542 msgid "" "The :meth:`!writeframesraw` and :meth:`!writeframes` methods now accept any :" "term:`bytes-like object`. (Contributed by Serhiy Storchaka in :issue:" "`8311`.)" msgstr "" -#: ../../whatsnew/3.4.rst:622 +#: ../../whatsnew/3.4.rst:621 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.4.rst:624 +#: ../../whatsnew/3.4.rst:623 msgid "" "The :class:`~argparse.FileType` class now accepts *encoding* and *errors* " "arguments, which are passed through to :func:`open`. (Contributed by Lucas " "Maystre in :issue:`11175`.)" msgstr "" -#: ../../whatsnew/3.4.rst:630 +#: ../../whatsnew/3.4.rst:629 msgid "audioop" msgstr "audioop" -#: ../../whatsnew/3.4.rst:632 +#: ../../whatsnew/3.4.rst:631 msgid "" ":mod:`!audioop` now supports 24-bit samples. (Contributed by Serhiy " "Storchaka in :issue:`12866`.)" msgstr "" -#: ../../whatsnew/3.4.rst:635 +#: ../../whatsnew/3.4.rst:634 msgid "" "New :func:`!byteswap` function converts big-endian samples to little-endian " "and vice versa. (Contributed by Serhiy Storchaka in :issue:`19641`.)" msgstr "" -#: ../../whatsnew/3.4.rst:639 +#: ../../whatsnew/3.4.rst:638 msgid "" "All :mod:`!audioop` functions now accept any :term:`bytes-like object`. " "Strings are not accepted: they didn't work before, now they raise an error " "right away. (Contributed by Serhiy Storchaka in :issue:`16685`.)" msgstr "" -#: ../../whatsnew/3.4.rst:645 +#: ../../whatsnew/3.4.rst:644 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.4.rst:647 +#: ../../whatsnew/3.4.rst:646 msgid "" "The encoding and decoding functions in :mod:`base64` now accept any :term:" "`bytes-like object` in cases where it previously required a :class:`bytes` " @@ -963,7 +964,7 @@ msgid "" "`17839`.)" msgstr "" -#: ../../whatsnew/3.4.rst:652 +#: ../../whatsnew/3.4.rst:651 msgid "" "New functions :func:`~base64.a85encode`, :func:`~base64.a85decode`, :func:" "`~base64.b85encode`, and :func:`~base64.b85decode` provide the ability to " @@ -974,11 +975,11 @@ msgid "" "Mercurial project, Serhiy Storchaka, and Antoine Pitrou in :issue:`17618`.)" msgstr "" -#: ../../whatsnew/3.4.rst:662 +#: ../../whatsnew/3.4.rst:661 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.4.rst:664 +#: ../../whatsnew/3.4.rst:663 msgid "" "The :meth:`.ChainMap.new_child` method now accepts an *m* argument " "specifying the child map to add to the chain. This allows an existing " @@ -986,11 +987,11 @@ msgid "" "by Vinay Sajip in :issue:`16613`.)" msgstr "" -#: ../../whatsnew/3.4.rst:671 +#: ../../whatsnew/3.4.rst:670 msgid "colorsys" msgstr "colorsys" -#: ../../whatsnew/3.4.rst:673 +#: ../../whatsnew/3.4.rst:672 msgid "" "The number of digits in the coefficients for the RGB --- YIQ conversions " "have been expanded so that they match the FCC NTSC versions. The change in " @@ -998,11 +999,11 @@ msgid "" "(Contributed by Brian Landers and Serhiy Storchaka in :issue:`14323`.)" msgstr "" -#: ../../whatsnew/3.4.rst:680 +#: ../../whatsnew/3.4.rst:679 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.4.rst:682 +#: ../../whatsnew/3.4.rst:681 msgid "" "The new :class:`contextlib.suppress` context manager helps to clarify the " "intent of code that deliberately suppresses exceptions from a single " @@ -1010,7 +1011,7 @@ msgid "" "Piraeus in :issue:`19266`.)" msgstr "" -#: ../../whatsnew/3.4.rst:687 +#: ../../whatsnew/3.4.rst:686 msgid "" "The new :func:`contextlib.redirect_stdout` context manager makes it easier " "for utility scripts to handle inflexible APIs that write their output to :" @@ -1023,18 +1024,18 @@ msgid "" "data:`sys.stdout`. (Contributed by Raymond Hettinger in :issue:`15805`.)" msgstr "" -#: ../../whatsnew/3.4.rst:698 +#: ../../whatsnew/3.4.rst:697 msgid "" "The :mod:`contextlib` documentation has also been updated to include a :ref:" "`discussion ` of the differences " "between single use, reusable and reentrant context managers." msgstr "" -#: ../../whatsnew/3.4.rst:704 +#: ../../whatsnew/3.4.rst:703 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.4.rst:706 +#: ../../whatsnew/3.4.rst:705 msgid "" ":func:`dbm.open` objects now support the context management protocol. When " "used in a :keyword:`with` statement, the ``close`` method of the database " @@ -1042,25 +1043,25 @@ msgid "" "by Claudiu Popa and Nick Coghlan in :issue:`19282`.)" msgstr "" -#: ../../whatsnew/3.4.rst:713 +#: ../../whatsnew/3.4.rst:712 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.4.rst:715 +#: ../../whatsnew/3.4.rst:714 msgid "" "Functions :func:`~dis.show_code`, :func:`~dis.dis`, :func:`~dis.distb`, and :" "func:`~dis.disassemble` now accept a keyword-only *file* argument that " "controls where they write their output." msgstr "" -#: ../../whatsnew/3.4.rst:719 +#: ../../whatsnew/3.4.rst:718 msgid "" "The :mod:`dis` module is now built around an :class:`~dis.Instruction` class " "that provides object oriented access to the details of each individual " "bytecode operation." msgstr "" -#: ../../whatsnew/3.4.rst:723 +#: ../../whatsnew/3.4.rst:722 msgid "" "A new method, :func:`~dis.get_instructions`, provides an iterator that emits " "the Instruction stream for a given piece of Python code. Thus it is now " @@ -1069,7 +1070,7 @@ msgid "" "example::" msgstr "" -#: ../../whatsnew/3.4.rst:729 +#: ../../whatsnew/3.4.rst:728 msgid "" ">>> import dis\n" ">>> for instr in dis.get_instructions(lambda x: x + 1):\n" @@ -1087,13 +1088,13 @@ msgstr "" "BINARY_ADD\n" "RETURN_VALUE" -#: ../../whatsnew/3.4.rst:737 +#: ../../whatsnew/3.4.rst:736 msgid "" "The various display tools in the :mod:`dis` module have been rewritten to " "use these new components." msgstr "" -#: ../../whatsnew/3.4.rst:740 +#: ../../whatsnew/3.4.rst:739 msgid "" "In addition, a new application-friendly class :class:`~dis.Bytecode` " "provides an object-oriented API for inspecting bytecode in both in human-" @@ -1105,7 +1106,7 @@ msgid "" "dis` on the constructor argument, but returned as a multi-line string::" msgstr "" -#: ../../whatsnew/3.4.rst:749 +#: ../../whatsnew/3.4.rst:748 msgid "" ">>> bytecode = dis.Bytecode(lambda x: x + 1, current_offset=3)\n" ">>> for instr in bytecode:\n" @@ -1121,7 +1122,7 @@ msgid "" " ' 7 RETURN_VALUE']" msgstr "" -#: ../../whatsnew/3.4.rst:762 +#: ../../whatsnew/3.4.rst:761 msgid "" ":class:`~dis.Bytecode` also has a class method, :meth:`~dis.Bytecode." "from_traceback`, that provides the ability to manipulate a traceback (that " @@ -1129,7 +1130,7 @@ msgid "" "``distb(tb)``)." msgstr "" -#: ../../whatsnew/3.4.rst:767 +#: ../../whatsnew/3.4.rst:766 msgid "" "(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" "`11816` and Claudiu Popa in :issue:`17916`.)" @@ -1137,25 +1138,25 @@ msgstr "" "(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 " "Claudiu Popa 在 :issue:`17916` 中貢獻。)" -#: ../../whatsnew/3.4.rst:770 +#: ../../whatsnew/3.4.rst:769 msgid "" "New function :func:`~dis.stack_effect` computes the effect on the Python " "stack of a given opcode and argument, information that is not otherwise " "available. (Contributed by Larry Hastings in :issue:`19722`.)" msgstr "" -#: ../../whatsnew/3.4.rst:776 +#: ../../whatsnew/3.4.rst:775 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.4.rst:778 +#: ../../whatsnew/3.4.rst:777 msgid "" "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 "" -#: ../../whatsnew/3.4.rst:782 +#: ../../whatsnew/3.4.rst:781 msgid "" "The :mod:`doctest` command line interface now uses :mod:`argparse`, and has " "two new options, ``-o`` and ``-f``. ``-o`` allows :ref:`doctest options " @@ -1165,17 +1166,17 @@ msgid "" "`11390`.)" msgstr "" -#: ../../whatsnew/3.4.rst:788 +#: ../../whatsnew/3.4.rst:787 msgid "" ":mod:`doctest` will now find doctests in extension module ``__doc__`` " "strings. (Contributed by Zachary Ware in :issue:`3158`.)" msgstr "" -#: ../../whatsnew/3.4.rst:793 +#: ../../whatsnew/3.4.rst:792 msgid "email" msgstr "email" -#: ../../whatsnew/3.4.rst:795 +#: ../../whatsnew/3.4.rst:794 msgid "" ":meth:`~email.message.Message.as_string` now accepts a *policy* argument to " "override the default policy of the message when generating a string " @@ -1185,7 +1186,7 @@ msgid "" "(Contributed by R. David Murray in :issue:`18600`.)" msgstr "" -#: ../../whatsnew/3.4.rst:802 +#: ../../whatsnew/3.4.rst:801 msgid "" "New method :meth:`~email.message.Message.as_bytes` added to produce a bytes " "representation of the message in a fashion similar to how ``as_string`` " @@ -1197,7 +1198,7 @@ msgid "" "(Contributed by R. David Murray in :issue:`18600`.)" msgstr "" -#: ../../whatsnew/3.4.rst:811 +#: ../../whatsnew/3.4.rst:810 msgid "" "The :meth:`.Message.set_param` message now accepts a *replace* keyword " "argument. When specified, the associated header will be updated without " @@ -1206,7 +1207,7 @@ msgid "" "`18891`.)" msgstr "" -#: ../../whatsnew/3.4.rst:819 +#: ../../whatsnew/3.4.rst:818 msgid "" "A pair of new subclasses of :class:`~email.message.Message` have been added " "(:class:`.EmailMessage` and :class:`.MIMEPart`), along with a new sub-" @@ -1223,11 +1224,11 @@ msgid "" "handling). (Contributed by R. David Murray in :issue:`18891`.)" msgstr "" -#: ../../whatsnew/3.4.rst:835 +#: ../../whatsnew/3.4.rst:834 msgid "filecmp" msgstr "filecmp" -#: ../../whatsnew/3.4.rst:837 +#: ../../whatsnew/3.4.rst:836 msgid "" "A new :func:`~filecmp.clear_cache` function provides the ability to clear " "the :mod:`filecmp` comparison cache, which uses :func:`os.stat` information " @@ -1237,7 +1238,7 @@ msgid "" "time field. (Contributed by Mark Levitt in :issue:`18149`.)" msgstr "" -#: ../../whatsnew/3.4.rst:844 +#: ../../whatsnew/3.4.rst:843 msgid "" "New module attribute :const:`~filecmp.DEFAULT_IGNORES` provides the list of " "directories that are used as the default value for the *ignore* parameter of " @@ -1245,11 +1246,11 @@ msgid "" "issue:`15442`.)" msgstr "" -#: ../../whatsnew/3.4.rst:851 +#: ../../whatsnew/3.4.rst:850 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.4.rst:853 +#: ../../whatsnew/3.4.rst:852 msgid "" "The new :func:`~functools.partialmethod` descriptor brings partial argument " "application to descriptors, just as :func:`~functools.partial` provides for " @@ -1259,7 +1260,7 @@ msgid "" "Alon Horev and Nick Coghlan in :issue:`4331`.)" msgstr "" -#: ../../whatsnew/3.4.rst:862 +#: ../../whatsnew/3.4.rst:861 msgid "" "The new :func:`~functools.singledispatch` decorator brings support for " "single-dispatch generic functions to the Python standard library. Where " @@ -1269,22 +1270,22 @@ msgid "" "*different* kinds of data." msgstr "" -#: ../../whatsnew/3.4.rst:871 +#: ../../whatsnew/3.4.rst:870 msgid ":pep:`443` -- Single-dispatch generic functions" msgstr "" -#: ../../whatsnew/3.4.rst:872 +#: ../../whatsnew/3.4.rst:871 msgid "PEP written and implemented by Łukasz Langa." msgstr "由 Łukasz Langa 撰寫 PEP 與實作。" -#: ../../whatsnew/3.4.rst:874 +#: ../../whatsnew/3.4.rst:873 msgid "" ":func:`~functools.total_ordering` now supports a return value of :data:" "`NotImplemented` from the underlying comparison function. (Contributed by " "Katie Miller in :issue:`10042`.)" msgstr "" -#: ../../whatsnew/3.4.rst:878 +#: ../../whatsnew/3.4.rst:877 msgid "" "A pure-python version of the :func:`~functools.partial` function is now in " "the stdlib; in CPython it is overridden by the C accelerated version, but it " @@ -1292,22 +1293,22 @@ msgid "" "in :issue:`12428`.)" msgstr "" -#: ../../whatsnew/3.4.rst:885 +#: ../../whatsnew/3.4.rst:884 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.4.rst:887 +#: ../../whatsnew/3.4.rst:886 msgid "" "New function :func:`~gc.get_stats` returns a list of three per-generation " "dictionaries containing the collections statistics since interpreter " "startup. (Contributed by Antoine Pitrou in :issue:`16351`.)" msgstr "" -#: ../../whatsnew/3.4.rst:893 +#: ../../whatsnew/3.4.rst:892 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.4.rst:895 +#: ../../whatsnew/3.4.rst:894 msgid "" "A new function :func:`~glob.escape` provides a way to escape special " "characters in a filename so that they do not become part of the globbing " @@ -1315,18 +1316,18 @@ msgid "" "Storchaka in :issue:`8402`.)" msgstr "" -#: ../../whatsnew/3.4.rst:901 +#: ../../whatsnew/3.4.rst:900 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.4.rst:903 +#: ../../whatsnew/3.4.rst:902 msgid "" "A new :func:`hashlib.pbkdf2_hmac` function provides the `PKCS#5 password-" "based key derivation function 2 `_. " "(Contributed by Christian Heimes in :issue:`18582`.)" msgstr "" -#: ../../whatsnew/3.4.rst:908 +#: ../../whatsnew/3.4.rst:907 msgid "" "The :attr:`~hashlib.hash.name` attribute of :mod:`hashlib` hash objects is " "now a formally supported interface. It has always existed in CPython's :mod:" @@ -1336,11 +1337,11 @@ msgid "" "Coombs in :issue:`18532`.)" msgstr "" -#: ../../whatsnew/3.4.rst:917 +#: ../../whatsnew/3.4.rst:916 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.4.rst:919 +#: ../../whatsnew/3.4.rst:918 msgid "" ":mod:`hmac` now accepts ``bytearray`` as well as ``bytes`` for the *key* " "argument to the :func:`~hmac.new` function, and the *msg* parameter to both " @@ -1349,7 +1350,7 @@ msgid "" "Jonas Borgström in :issue:`18240`.)" msgstr "" -#: ../../whatsnew/3.4.rst:925 +#: ../../whatsnew/3.4.rst:924 msgid "" "The *digestmod* argument to the :func:`hmac.new` function may now be any " "hash digest name recognized by :mod:`hashlib`. In addition, the current " @@ -1358,7 +1359,7 @@ msgid "" "(Contributed by Christian Heimes in :issue:`17276`.)" msgstr "" -#: ../../whatsnew/3.4.rst:931 +#: ../../whatsnew/3.4.rst:930 msgid "" "With the addition of :attr:`~hmac.HMAC.block_size` and :attr:`~hmac.HMAC." "name` attributes (and the formal documentation of the :attr:`~hmac.HMAC." @@ -1366,18 +1367,18 @@ msgid "" "pep:`247` API. (Contributed by Christian Heimes in :issue:`18775`.)" msgstr "" -#: ../../whatsnew/3.4.rst:938 +#: ../../whatsnew/3.4.rst:937 msgid "html" msgstr "html" -#: ../../whatsnew/3.4.rst:940 +#: ../../whatsnew/3.4.rst:939 msgid "" "New function :func:`~html.unescape` function converts HTML5 character " "references to the corresponding Unicode characters. (Contributed by Ezio " "Melotti in :issue:`2927`.)" msgstr "" -#: ../../whatsnew/3.4.rst:944 +#: ../../whatsnew/3.4.rst:943 msgid "" ":class:`~html.parser.HTMLParser` accepts a new keyword argument " "*convert_charrefs* that, when ``True``, automatically converts all character " @@ -1387,17 +1388,17 @@ msgid "" "(Contributed by Ezio Melotti in :issue:`13633`.)" msgstr "" -#: ../../whatsnew/3.4.rst:951 +#: ../../whatsnew/3.4.rst:950 msgid "" "The *strict* argument of :class:`~html.parser.HTMLParser` is now deprecated. " "(Contributed by Ezio Melotti in :issue:`15114`.)" msgstr "" -#: ../../whatsnew/3.4.rst:956 +#: ../../whatsnew/3.4.rst:955 msgid "http" msgstr "http" -#: ../../whatsnew/3.4.rst:958 +#: ../../whatsnew/3.4.rst:957 msgid "" ":meth:`~http.server.BaseHTTPRequestHandler.send_error` now accepts an " "optional additional *explain* parameter which can be used to provide an " @@ -1407,18 +1408,18 @@ msgid "" "the error response. (Contributed by Karl Cow in :issue:`12921`.)" msgstr "" -#: ../../whatsnew/3.4.rst:965 +#: ../../whatsnew/3.4.rst:964 msgid "" "The :mod:`http.server` :ref:`command line interface ` now " "has a ``-b/--bind`` option that causes the server to listen on a specific " "address. (Contributed by Malte Swart in :issue:`17764`.)" msgstr "" -#: ../../whatsnew/3.4.rst:971 +#: ../../whatsnew/3.4.rst:970 msgid "idlelib and IDLE" msgstr "idlelib 與 IDLE" -#: ../../whatsnew/3.4.rst:973 +#: ../../whatsnew/3.4.rst:972 msgid "" "Since idlelib implements the IDLE shell and editor and is not intended for " "import by other programs, it gets improvements with every release. See :file:" @@ -1427,11 +1428,11 @@ msgid "" "the IDLE :menuselection:`Help --> About IDLE` dialog." msgstr "" -#: ../../whatsnew/3.4.rst:981 +#: ../../whatsnew/3.4.rst:980 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.4.rst:983 +#: ../../whatsnew/3.4.rst:982 msgid "" "The :class:`~importlib.abc.InspectLoader` ABC defines a new method, :meth:" "`~importlib.abc.InspectLoader.source_to_code` that accepts source data and a " @@ -1440,7 +1441,7 @@ msgid "" "Snow and Brett Cannon in :issue:`15627`.)" msgstr "" -#: ../../whatsnew/3.4.rst:989 +#: ../../whatsnew/3.4.rst:988 msgid "" ":class:`~importlib.abc.InspectLoader` also now has a default implementation " "for the :meth:`~importlib.abc.InspectLoader.get_code` method. However, it " @@ -1448,14 +1449,14 @@ msgid "" "performance reasons. (Contributed by Brett Cannon in :issue:`18072`.)" msgstr "" -#: ../../whatsnew/3.4.rst:994 +#: ../../whatsnew/3.4.rst:993 msgid "" "The :func:`~importlib.reload` function has been moved from :mod:`!imp` to :" "mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed " "by Berker Peksag in :issue:`18193`.)" msgstr "" -#: ../../whatsnew/3.4.rst:998 +#: ../../whatsnew/3.4.rst:997 msgid "" ":mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` " "attribute providing access to the bytecode version number. This replaces " @@ -1463,7 +1464,7 @@ msgid "" "(Contributed by Brett Cannon in :issue:`18192`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1003 +#: ../../whatsnew/3.4.rst:1002 msgid "" "New :mod:`importlib.util` functions :func:`~importlib.util." "cache_from_source` and :func:`~importlib.util.source_from_cache` replace the " @@ -1471,7 +1472,7 @@ msgid "" "Brett Cannon in :issue:`18194`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1008 +#: ../../whatsnew/3.4.rst:1007 msgid "" "The :mod:`importlib` bootstrap :class:`.NamespaceLoader` now conforms to " "the :class:`.InspectLoader` ABC, which means that ``runpy`` and ``python -" @@ -1479,7 +1480,7 @@ msgid "" "in :issue:`18058`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1013 +#: ../../whatsnew/3.4.rst:1012 msgid "" ":mod:`importlib.util` has a new function :func:`~importlib.util." "decode_source` that decodes source from bytes using universal newline " @@ -1487,7 +1488,7 @@ msgid "" "get_source` methods." msgstr "" -#: ../../whatsnew/3.4.rst:1017 +#: ../../whatsnew/3.4.rst:1016 msgid "" ":class:`importlib.machinery.ExtensionFileLoader` now has a :meth:`~importlib." "machinery.ExtensionFileLoader.get_filename` method. This was inadvertently " @@ -1495,11 +1496,11 @@ msgid "" "`19152`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1024 +#: ../../whatsnew/3.4.rst:1023 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.4.rst:1026 +#: ../../whatsnew/3.4.rst:1025 msgid "" "The :mod:`inspect` module now offers a basic :ref:`command line interface " "` to quickly display source code and other information " @@ -1507,7 +1508,7 @@ msgid "" "Coghlan in :issue:`18626`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1031 +#: ../../whatsnew/3.4.rst:1030 msgid "" ":func:`~inspect.unwrap` makes it easy to unravel wrapper function chains " "created by :func:`functools.wraps` (and any other API that sets the " @@ -1515,7 +1516,7 @@ msgid "" "Urban, Aaron Iles and Nick Coghlan in :issue:`13266`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1036 +#: ../../whatsnew/3.4.rst:1035 msgid "" "As part of the implementation of the new :mod:`enum` module, the :mod:" "`inspect` module now has substantially better support for custom ``__dir__`` " @@ -1523,7 +1524,7 @@ msgid "" "(Contributed by Ethan Furman in :issue:`18929` and :issue:`19030`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1042 +#: ../../whatsnew/3.4.rst:1041 msgid "" ":func:`~inspect.getfullargspec` and :func:`~inspect.getargspec` now use the :" "func:`~inspect.signature` API. This allows them to support a much broader " @@ -1536,18 +1537,18 @@ msgid "" "(Contributed by Yury Selivanov in :issue:`17481`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1053 +#: ../../whatsnew/3.4.rst:1052 msgid "" ":func:`~inspect.signature` now supports duck types of CPython functions, " "which adds support for functions compiled with Cython. (Contributed by " "Stefan Behnel and Yury Selivanov in :issue:`17159`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1059 +#: ../../whatsnew/3.4.rst:1058 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.4.rst:1061 +#: ../../whatsnew/3.4.rst:1060 msgid "" ":mod:`ipaddress` was added to the standard library in Python 3.3 as a :term:" "`provisional API`. With the release of Python 3.4, this qualification has " @@ -1555,32 +1556,32 @@ msgid "" "the normal standard library requirements to maintain backwards compatibility." msgstr "" -#: ../../whatsnew/3.4.rst:1067 +#: ../../whatsnew/3.4.rst:1066 msgid "" "A new :attr:`~ipaddress.IPv4Address.is_global` property is ``True`` if an " "address is globally routeable. (Contributed by Peter Moody in :issue:" "`17400`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1073 +#: ../../whatsnew/3.4.rst:1072 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.4.rst:1075 +#: ../../whatsnew/3.4.rst:1074 msgid "" "The :class:`~logging.handlers.TimedRotatingFileHandler` has a new *atTime* " "parameter that can be used to specify the time of day when rollover should " "happen. (Contributed by Ronald Oussoren in :issue:`9556`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1079 +#: ../../whatsnew/3.4.rst:1078 msgid "" ":class:`~logging.handlers.SocketHandler` and :class:`~logging.handlers." "DatagramHandler` now support Unix domain sockets (by setting *port* to " "``None``). (Contributed by Vinay Sajip in commit ce46195b56a9.)" msgstr "" -#: ../../whatsnew/3.4.rst:1084 +#: ../../whatsnew/3.4.rst:1083 msgid "" ":func:`~logging.config.fileConfig` now accepts a :class:`configparser." "RawConfigParser` subclass instance for the *fname* parameter. This " @@ -1590,7 +1591,7 @@ msgid "" "fileConfig`. (Contributed by Vinay Sajip in :issue:`16110`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1092 +#: ../../whatsnew/3.4.rst:1091 msgid "" "Logging configuration data received from a socket via the :func:`logging." "config.listen` function can now be validated before being processed by " @@ -1598,11 +1599,11 @@ msgid "" "keyword argument. (Contributed by Vinay Sajip in :issue:`15452`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1101 +#: ../../whatsnew/3.4.rst:1100 msgid "marshal" msgstr "marshal" -#: ../../whatsnew/3.4.rst:1103 +#: ../../whatsnew/3.4.rst:1102 msgid "" "The default :mod:`marshal` version has been bumped to 3. The code " "implementing the new version restores the Python2 behavior of recording only " @@ -1615,21 +1616,21 @@ msgid "" "issue:`19219`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1114 +#: ../../whatsnew/3.4.rst:1113 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.4.rst:1116 +#: ../../whatsnew/3.4.rst:1115 msgid "" "mmap objects are now :ref:`weakly referenceable `. (Contributed " "by Valerie Lambert in :issue:`4885`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1121 +#: ../../whatsnew/3.4.rst:1120 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.4.rst:1125 +#: ../../whatsnew/3.4.rst:1124 msgid "" "On Unix two new :ref:`start methods `, " "``spawn`` and ``forkserver``, have been added for starting processes using :" @@ -1642,7 +1643,7 @@ msgid "" "(Contributed by Richard Oudkerk in :issue:`8713`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1135 +#: ../../whatsnew/3.4.rst:1134 msgid "" ":mod:`multiprocessing` also now has the concept of a ``context``, which " "determines how child processes are created. New function :func:" @@ -1655,14 +1656,14 @@ msgid "" "Richard Oudkerk in :issue:`18999`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1145 +#: ../../whatsnew/3.4.rst:1144 msgid "" "Except when using the old *fork* start method, child processes no longer " "inherit unneeded handles/file descriptors from their parents (part of :issue:" "`8713`)." msgstr "" -#: ../../whatsnew/3.4.rst:1149 +#: ../../whatsnew/3.4.rst:1148 msgid "" ":mod:`multiprocessing` now relies on :mod:`runpy` (which implements the ``-" "m`` switch) to initialise ``__main__`` appropriately in child processes when " @@ -1672,11 +1673,11 @@ msgid "" "(Contributed by Nick Coghlan in :issue:`19946`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1158 +#: ../../whatsnew/3.4.rst:1157 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.4.rst:1160 +#: ../../whatsnew/3.4.rst:1159 msgid "" "New function :func:`~operator.length_hint` provides an implementation of the " "specification for how the :meth:`~object.__length_hint__` special method " @@ -1684,18 +1685,18 @@ msgid "" "language feature. (Contributed by Armin Ronacher in :issue:`16148`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1165 +#: ../../whatsnew/3.4.rst:1164 msgid "" "There is now a pure-python version of the :mod:`operator` module available " "for reference and for use by alternate implementations of Python. " "(Contributed by Zachary Ware in :issue:`16694`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1171 +#: ../../whatsnew/3.4.rst:1170 msgid "os" msgstr "os" -#: ../../whatsnew/3.4.rst:1173 +#: ../../whatsnew/3.4.rst:1172 msgid "" "There are new functions to get and set the :ref:`inheritable flag " "` of a file descriptor (:func:`os.get_inheritable`, :func:" @@ -1703,7 +1704,7 @@ msgid "" "get_handle_inheritable`, :func:`os.set_handle_inheritable`)." msgstr "" -#: ../../whatsnew/3.4.rst:1178 +#: ../../whatsnew/3.4.rst:1177 msgid "" "New function :func:`~os.cpu_count` reports the number of CPUs available on " "the platform on which Python is running (or ``None`` if the count can't be " @@ -1713,20 +1714,20 @@ msgid "" "`17914`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1184 +#: ../../whatsnew/3.4.rst:1183 msgid "" ":func:`os.path.samestat` is now available on the Windows platform (and the :" "func:`os.path.samefile` implementation is now shared between Unix and " "Windows). (Contributed by Brian Curtin in :issue:`11939`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1188 +#: ../../whatsnew/3.4.rst:1187 msgid "" ":func:`os.path.ismount` now recognizes volumes mounted below a drive root on " "Windows. (Contributed by Tim Golden in :issue:`9035`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1191 +#: ../../whatsnew/3.4.rst:1190 msgid "" ":func:`os.open` supports two new flags on platforms that provide them, :" "const:`~os.O_PATH` (un-opened file descriptor), and :const:`~os.O_TMPFILE` " @@ -1736,11 +1737,11 @@ msgid "" "respectively.)" msgstr "" -#: ../../whatsnew/3.4.rst:1199 +#: ../../whatsnew/3.4.rst:1198 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.4.rst:1201 +#: ../../whatsnew/3.4.rst:1200 msgid "" ":mod:`pdb` has been enhanced to handle generators, :keyword:`yield`, and " "``yield from`` in a more useful fashion. This is especially helpful when " @@ -1748,7 +1749,7 @@ msgid "" "Xavier de Gaye in :issue:`16596`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1206 +#: ../../whatsnew/3.4.rst:1205 msgid "" "The ``print`` command has been removed from :mod:`pdb`, restoring access to " "the Python :func:`print` function from the pdb command line. Python2's " @@ -1761,11 +1762,11 @@ msgid "" "(Contributed by Connor Osborn in :issue:`18764`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1220 +#: ../../whatsnew/3.4.rst:1219 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.4.rst:1222 +#: ../../whatsnew/3.4.rst:1221 msgid "" ":mod:`pickle` now supports (but does not use by default) a new pickle " "protocol, protocol 4. This new protocol addresses a number of issues that " @@ -1775,19 +1776,19 @@ msgid "" "efficiency improvements." msgstr "" -#: ../../whatsnew/3.4.rst:1230 +#: ../../whatsnew/3.4.rst:1229 msgid ":pep:`3154` -- Pickle protocol 4" msgstr "" -#: ../../whatsnew/3.4.rst:1231 +#: ../../whatsnew/3.4.rst:1230 msgid "PEP written by Antoine Pitrou and implemented by Alexandre Vassalotti." msgstr "由 Antoine Pitrou 撰寫 PEP、Alexandre Vassalotti 實作。" -#: ../../whatsnew/3.4.rst:1235 +#: ../../whatsnew/3.4.rst:1234 msgid "plistlib" msgstr "plistlib" -#: ../../whatsnew/3.4.rst:1237 +#: ../../whatsnew/3.4.rst:1236 msgid "" ":mod:`plistlib` now has an API that is similar to the standard pattern for " "stdlib serialization protocols, with new :func:`~plistlib.load`, :func:" @@ -1798,11 +1799,11 @@ msgid "" "(Contributed by Ronald Oussoren and others in :issue:`14455`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1247 +#: ../../whatsnew/3.4.rst:1246 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.4.rst:1249 +#: ../../whatsnew/3.4.rst:1248 msgid "" "Two new methods have been added to :mod:`poplib`: :meth:`~poplib.POP3.capa`, " "which returns the list of capabilities advertised by the POP server, and :" @@ -1811,11 +1812,11 @@ msgid "" "Lorenzo Catucci in :issue:`4473`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1257 +#: ../../whatsnew/3.4.rst:1256 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.4.rst:1259 +#: ../../whatsnew/3.4.rst:1258 msgid "" "The :mod:`pprint` module's :class:`~pprint.PrettyPrinter` class and its :" "func:`~pprint.pformat`, and :func:`~pprint.pprint` functions have a new " @@ -1825,27 +1826,27 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`19132`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1266 +#: ../../whatsnew/3.4.rst:1265 msgid "" "Long strings are now wrapped using Python's normal line continuation " "syntax. (Contributed by Antoine Pitrou in :issue:`17150`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1271 +#: ../../whatsnew/3.4.rst:1270 msgid "pty" msgstr "pty" -#: ../../whatsnew/3.4.rst:1273 +#: ../../whatsnew/3.4.rst:1272 msgid "" ":func:`pty.spawn` now returns the status value from :func:`os.waitpid` on " "the child process, instead of ``None``. (Contributed by Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/3.4.rst:1278 +#: ../../whatsnew/3.4.rst:1277 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.4.rst:1280 +#: ../../whatsnew/3.4.rst:1279 msgid "" "The :mod:`pydoc` module is now based directly on the :func:`inspect." "signature` introspection API, allowing it to provide signature information " @@ -1854,7 +1855,7 @@ msgid "" "information. (Contributed by Larry Hastings in :issue:`19674`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1286 +#: ../../whatsnew/3.4.rst:1285 msgid "" "The :mod:`pydoc` module no longer displays the ``self`` parameter for " "already bound methods. Instead, it aims to always display the exact current " @@ -1862,7 +1863,7 @@ msgid "" "issue:`20710`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1291 +#: ../../whatsnew/3.4.rst:1290 msgid "" "In addition to the changes that have been made to :mod:`pydoc` directly, its " "handling of custom ``__dir__`` methods and various descriptor behaviours has " @@ -1870,17 +1871,17 @@ msgid "" "`inspect` module." msgstr "" -#: ../../whatsnew/3.4.rst:1296 +#: ../../whatsnew/3.4.rst:1295 msgid "" "As the :func:`help` builtin is based on :mod:`pydoc`, the above changes also " "affect the behaviour of :func:`help`." msgstr "" -#: ../../whatsnew/3.4.rst:1301 +#: ../../whatsnew/3.4.rst:1300 msgid "re" msgstr "re" -#: ../../whatsnew/3.4.rst:1303 +#: ../../whatsnew/3.4.rst:1302 msgid "" "New :func:`~re.fullmatch` function and :meth:`.regex.fullmatch` method " "anchor the pattern at both ends of the string to match. This provides a way " @@ -1890,7 +1891,7 @@ msgid "" "Barnett in :issue:`16203`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1310 +#: ../../whatsnew/3.4.rst:1309 msgid "" "The repr of :ref:`regex objects ` now includes the pattern and " "the flags; the repr of :ref:`match objects ` now includes the " @@ -1898,11 +1899,11 @@ msgid "" "Lopes Tavares and Serhiy Storchaka in :issue:`13592` and :issue:`17087`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1318 +#: ../../whatsnew/3.4.rst:1317 msgid "resource" msgstr "resource" -#: ../../whatsnew/3.4.rst:1320 +#: ../../whatsnew/3.4.rst:1319 msgid "" "New :func:`~resource.prlimit` function, available on Linux platforms with a " "kernel version of 2.6.36 or later and glibc of 2.13 or later, provides the " @@ -1910,7 +1911,7 @@ msgid "" "making the call. (Contributed by Christian Heimes in :issue:`16595`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1325 +#: ../../whatsnew/3.4.rst:1324 msgid "" "On Linux kernel version 2.6.36 or later, there are also some new Linux " "specific constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource." @@ -1919,18 +1920,18 @@ msgid "" "Christian Heimes in :issue:`19324`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1331 +#: ../../whatsnew/3.4.rst:1330 msgid "" "On FreeBSD version 9 and later, there some new FreeBSD specific constants: :" "const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" "`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1338 +#: ../../whatsnew/3.4.rst:1337 msgid "select" msgstr "select" -#: ../../whatsnew/3.4.rst:1340 +#: ../../whatsnew/3.4.rst:1339 msgid "" ":class:`~select.epoll` objects now support the context management protocol. " "When used in a :keyword:`with` statement, the :meth:`~select.epoll.close` " @@ -1938,29 +1939,29 @@ msgid "" "by Serhiy Storchaka in :issue:`16488`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1345 +#: ../../whatsnew/3.4.rst:1344 msgid "" ":class:`~select.devpoll` objects now have :meth:`~select.devpoll.fileno` " "and :meth:`~select.devpoll.close` methods, as well as a new attribute :attr:" "`~select.devpoll.closed`. (Contributed by Victor Stinner in :issue:`18794`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1352 +#: ../../whatsnew/3.4.rst:1351 msgid "shelve" msgstr "shelve" -#: ../../whatsnew/3.4.rst:1354 +#: ../../whatsnew/3.4.rst:1353 msgid "" ":class:`~shelve.Shelf` instances may now be used in :keyword:`with` " "statements, and will be automatically closed at the end of the :keyword:`!" "with` block. (Contributed by Filip Gruszczyński in :issue:`13896`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1360 +#: ../../whatsnew/3.4.rst:1359 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.4.rst:1362 +#: ../../whatsnew/3.4.rst:1361 msgid "" ":func:`~shutil.copyfile` now raises a specific :exc:`~shutil.Error` " "subclass, :exc:`~shutil.SameFileError`, when the source and destination are " @@ -1969,11 +1970,11 @@ msgid "" "issue:`1492704`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1370 +#: ../../whatsnew/3.4.rst:1369 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.4.rst:1372 +#: ../../whatsnew/3.4.rst:1371 msgid "" "The :class:`!SMTPServer` and :class:`!SMTPChannel` classes now accept a " "*map* keyword argument which, if specified, is passed in to :class:`!" @@ -1982,11 +1983,11 @@ msgid "" "issue:`11959`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1380 +#: ../../whatsnew/3.4.rst:1379 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.4.rst:1382 +#: ../../whatsnew/3.4.rst:1381 msgid "" ":exc:`~smtplib.SMTPException` is now a subclass of :exc:`OSError`, which " "allows both socket level errors and SMTP protocol level errors to be caught " @@ -1994,45 +1995,45 @@ msgid "" "occurred. (Contributed by Ned Jackson Lovely in :issue:`2118`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1389 +#: ../../whatsnew/3.4.rst:1388 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.4.rst:1391 +#: ../../whatsnew/3.4.rst:1390 msgid "" "The socket module now supports the :const:`~socket.CAN_BCM` protocol on " "platforms that support it. (Contributed by Brian Thorne in :issue:`15359`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1394 +#: ../../whatsnew/3.4.rst:1393 msgid "" "Socket objects have new methods to get or set their :ref:`inheritable flag " "`, :meth:`~socket.socket.get_inheritable` and :meth:`~socket." "socket.set_inheritable`." msgstr "" -#: ../../whatsnew/3.4.rst:1398 +#: ../../whatsnew/3.4.rst:1397 msgid "" "The ``socket.AF_*`` and ``socket.SOCK_*`` constants are now enumeration " "values using the new :mod:`enum` module. This allows meaningful names to be " "printed during debugging, instead of integer \"magic numbers\"." msgstr "" -#: ../../whatsnew/3.4.rst:1402 +#: ../../whatsnew/3.4.rst:1401 msgid "The :const:`~socket.AF_LINK` constant is now available on BSD and OSX." msgstr "" -#: ../../whatsnew/3.4.rst:1404 +#: ../../whatsnew/3.4.rst:1403 msgid "" ":func:`~socket.inet_pton` and :func:`~socket.inet_ntop` are now supported on " "Windows. (Contributed by Atsuo Ishimoto in :issue:`7171`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1409 +#: ../../whatsnew/3.4.rst:1408 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.4.rst:1411 +#: ../../whatsnew/3.4.rst:1410 msgid "" "A new boolean parameter to the :func:`~sqlite3.connect` function, *uri*, can " "be used to indicate that the *database* parameter is a ``uri`` (see the " @@ -2040,11 +2041,11 @@ msgid "" "(Contributed by poq in :issue:`13773`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1418 +#: ../../whatsnew/3.4.rst:1417 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.4.rst:1422 +#: ../../whatsnew/3.4.rst:1421 msgid "" ":data:`~ssl.PROTOCOL_TLSv1_1` and :data:`~ssl.PROTOCOL_TLSv1_2` (TLSv1.1 and " "TLSv1.2 support) have been added; support for these protocols is only " @@ -2052,7 +2053,7 @@ msgid "" "Michele Orrù and Antoine Pitrou in :issue:`16692`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1429 +#: ../../whatsnew/3.4.rst:1428 msgid "" "New function :func:`~ssl.create_default_context` provides a standard way to " "obtain an :class:`~ssl.SSLContext` whose settings are intended to be a " @@ -2066,7 +2067,7 @@ msgid "" "stdlib API. (Contributed by Christian Heimes in :issue:`19689`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1441 +#: ../../whatsnew/3.4.rst:1440 msgid "" ":class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext." "load_verify_locations` accepts a new optional argument *cadata*, which can " @@ -2074,7 +2075,7 @@ msgid "" "bytes, respectively. (Contributed by Christian Heimes in :issue:`18138`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1446 +#: ../../whatsnew/3.4.rst:1445 msgid "" "New function :func:`~ssl.get_default_verify_paths` returns a named tuple of " "the paths and environment variables that the :meth:`~ssl.SSLContext." @@ -2083,7 +2084,7 @@ msgid "" "issues. (Contributed by Christian Heimes in :issue:`18143`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1453 +#: ../../whatsnew/3.4.rst:1452 msgid "" ":class:`~ssl.SSLContext` has a new method, :meth:`~ssl.SSLContext." "cert_store_stats`, that reports the number of loaded ``X.509`` certs, " @@ -2093,7 +2094,7 @@ msgid "" "`18147`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1460 +#: ../../whatsnew/3.4.rst:1459 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 " @@ -2104,7 +2105,7 @@ msgid "" "default. (Contributed by Christien Heimes in :issue:`8813`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1468 +#: ../../whatsnew/3.4.rst:1467 msgid "" "New :class:`~ssl.SSLContext` method :meth:`~ssl.SSLContext." "load_default_certs` loads a set of default \"certificate authority\" (CA) " @@ -2116,7 +2117,7 @@ msgid "" "by Christian Heimes in :issue:`19292`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1479 +#: ../../whatsnew/3.4.rst:1478 msgid "" "Two new windows-only functions, :func:`~ssl.enum_certificates` and :func:" "`~ssl.enum_crls` provide the ability to retrieve certificates, certificate " @@ -2124,14 +2125,14 @@ msgid "" "Christian Heimes in :issue:`17134`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1486 +#: ../../whatsnew/3.4.rst:1485 msgid "" "Support for server-side SNI (Server Name Indication) using the new :meth:" "`ssl.SSLContext.set_servername_callback` method. (Contributed by Daniel " "Black in :issue:`8109`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1490 +#: ../../whatsnew/3.4.rst:1489 msgid "" "The dictionary returned by :meth:`.SSLSocket.getpeercert` contains " "additional ``X509v3`` extension items: ``crlDistributionPoints``, " @@ -2139,29 +2140,29 @@ msgid "" "issue:`18379`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1496 +#: ../../whatsnew/3.4.rst:1495 msgid "stat" msgstr "stat" -#: ../../whatsnew/3.4.rst:1498 +#: ../../whatsnew/3.4.rst:1497 msgid "" "The :mod:`stat` module is now backed by a C implementation in :mod:`!_stat`. " "A C implementation is required as most of the values aren't standardized and " "are platform-dependent. (Contributed by Christian Heimes in :issue:`11016`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1502 +#: ../../whatsnew/3.4.rst:1501 msgid "" "The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`, :" "const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " "Christian Hiemes in :issue:`11016`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1508 +#: ../../whatsnew/3.4.rst:1507 msgid "struct" msgstr "struct" -#: ../../whatsnew/3.4.rst:1510 +#: ../../whatsnew/3.4.rst:1509 msgid "" "New function :mod:`~struct.iter_unpack` and a new :meth:`struct.Struct." "iter_unpack` method on compiled formats provide streamed unpacking of a " @@ -2169,35 +2170,35 @@ msgid "" "by Antoine Pitrou in :issue:`17804`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1517 +#: ../../whatsnew/3.4.rst:1516 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.4.rst:1519 +#: ../../whatsnew/3.4.rst:1518 msgid "" ":func:`~subprocess.check_output` now accepts an *input* argument that can be " "used to provide the contents of ``stdin`` for the command that is run. " "(Contributed by Zack Weinberg in :issue:`16624`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1523 +#: ../../whatsnew/3.4.rst:1522 msgid "" ":func:`~subprocess.getstatus` and :func:`~subprocess.getstatusoutput` now " "work on Windows. This change was actually inadvertently made in 3.3.4. " "(Contributed by Tim Golden in :issue:`10197`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1529 +#: ../../whatsnew/3.4.rst:1528 msgid "sunau" msgstr "sunau" -#: ../../whatsnew/3.4.rst:1531 +#: ../../whatsnew/3.4.rst:1530 msgid "" "The :meth:`!getparams` method now returns a namedtuple rather than a plain " "tuple. (Contributed by Claudiu Popa in :issue:`18901`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1534 +#: ../../whatsnew/3.4.rst:1533 msgid "" ":meth:`!sunau.open` now supports the context management protocol: when used " "in a :keyword:`with` block, the ``close`` method of the returned object will " @@ -2205,18 +2206,18 @@ msgid "" "Storchaka in :issue:`18878`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1539 +#: ../../whatsnew/3.4.rst:1538 msgid "" ":meth:`.AU_write.setsampwidth` now supports 24 bit samples, thus adding " "support for writing 24 sample using the module. (Contributed by Serhiy " "Storchaka in :issue:`19261`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1549 +#: ../../whatsnew/3.4.rst:1548 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.4.rst:1551 +#: ../../whatsnew/3.4.rst:1550 msgid "" "New function :func:`sys.getallocatedblocks` returns the current number of " "blocks allocated by the interpreter. (In CPython with the default ``--with-" @@ -2226,7 +2227,7 @@ msgid "" "in :issue:`13390`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1558 +#: ../../whatsnew/3.4.rst:1557 msgid "" "When the Python interpreter starts in :ref:`interactive mode `, it checks for an :data:`~sys.__interactivehook__` attribute " @@ -2242,11 +2243,11 @@ msgid "" "Araujo and Antoine Pitrou in :issue:`5845`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1573 +#: ../../whatsnew/3.4.rst:1572 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.4.rst:1575 +#: ../../whatsnew/3.4.rst:1574 msgid "" "The :mod:`tarfile` module now supports a simple :ref:`tarfile-commandline` " "when called as a script directly or via ``-m``. This can be used to create " @@ -2254,11 +2255,11 @@ msgid "" "`13477`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1581 +#: ../../whatsnew/3.4.rst:1580 msgid "textwrap" msgstr "textwrap" -#: ../../whatsnew/3.4.rst:1583 +#: ../../whatsnew/3.4.rst:1582 msgid "" "The :class:`~textwrap.TextWrapper` class has two new attributes/constructor " "arguments: :attr:`~textwrap.TextWrapper.max_lines`, which limits the number " @@ -2272,11 +2273,11 @@ msgid "" "issue:`18725`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1595 +#: ../../whatsnew/3.4.rst:1594 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.4.rst:1597 +#: ../../whatsnew/3.4.rst:1596 msgid "" "The :class:`~threading.Thread` object representing the main thread can be " "obtained from the new :func:`~threading.main_thread` function. In normal " @@ -2284,11 +2285,11 @@ msgid "" "started. (Contributed by Andrew Svetlov in :issue:`18882`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1604 +#: ../../whatsnew/3.4.rst:1603 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.4.rst:1606 +#: ../../whatsnew/3.4.rst:1605 msgid "" "A new :func:`traceback.clear_frames` function takes a traceback object and " "clears the local variables in all of the frames it references, reducing the " @@ -2296,11 +2297,11 @@ msgid "" "`1565525`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1613 +#: ../../whatsnew/3.4.rst:1612 msgid "types" msgstr "types" -#: ../../whatsnew/3.4.rst:1615 +#: ../../whatsnew/3.4.rst:1614 msgid "" "A new :func:`~types.DynamicClassAttribute` descriptor provides a way to " "define an attribute that acts normally when looked up through an instance " @@ -2310,18 +2311,18 @@ msgid "" "for an example). (Contributed by Ethan Furman in :issue:`19030`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1624 +#: ../../whatsnew/3.4.rst:1623 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.4.rst:1626 +#: ../../whatsnew/3.4.rst:1625 msgid "" ":mod:`urllib.request` now supports ``data:`` URLs via the :class:`~urllib." "request.DataHandler` class. (Contributed by Mathias Panzenböck in :issue:" "`16423`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1630 +#: ../../whatsnew/3.4.rst:1629 msgid "" "The http method that will be used by a :class:`~urllib.request.Request` " "class can now be specified by setting a :class:`~urllib.request.Request." @@ -2329,7 +2330,7 @@ msgid "" "issue:`18978`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1635 +#: ../../whatsnew/3.4.rst:1634 msgid "" ":class:`~urllib.request.Request` objects are now reusable: if the :attr:" "`~urllib.request.Request.full_url` or :attr:`~urllib.request.Request.data` " @@ -2344,7 +2345,7 @@ msgid "" "`17485`, and Damien Brecht and Senthil Kumaran in :issue:`17272`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1648 +#: ../../whatsnew/3.4.rst:1647 msgid "" ":class:`~urllib.error.HTTPError` objects now have a :attr:`~urllib.error." "HTTPError.headers` attribute that provides access to the HTTP response " @@ -2352,11 +2353,11 @@ msgid "" "`15701`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1655 +#: ../../whatsnew/3.4.rst:1654 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.4.rst:1657 +#: ../../whatsnew/3.4.rst:1656 msgid "" "The :class:`~unittest.TestCase` class has a new method, :meth:`~unittest." "TestCase.subTest`, that produces a context manager whose :keyword:`with` " @@ -2367,7 +2368,7 @@ msgid "" "of which will run even if one or more of them fail. For example::" msgstr "" -#: ../../whatsnew/3.4.rst:1665 +#: ../../whatsnew/3.4.rst:1664 msgid "" "class NumbersTest(unittest.TestCase):\n" " def test_even(self):\n" @@ -2381,7 +2382,7 @@ msgstr "" " with self.subTest(i=i):\n" " self.assertEqual(i % 2, 0)" -#: ../../whatsnew/3.4.rst:1671 +#: ../../whatsnew/3.4.rst:1670 msgid "" "will result in six subtests, each identified in the unittest verbose output " "with a label consisting of the variable name ``i`` and a particular value " @@ -2389,28 +2390,28 @@ msgid "" "version of this example. (Contributed by Antoine Pitrou in :issue:`16997`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1676 +#: ../../whatsnew/3.4.rst:1675 msgid "" ":func:`unittest.main` now accepts an iterable of test names for " "*defaultTest*, where previously it only accepted a single test name as a " "string. (Contributed by Jyrki Pulliainen in :issue:`15132`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1680 +#: ../../whatsnew/3.4.rst:1679 msgid "" "If :class:`~unittest.SkipTest` is raised during test discovery (that is, at " "the module level in the test file), it is now reported as a skip instead of " "an error. (Contributed by Zach Ware in :issue:`16935`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1684 +#: ../../whatsnew/3.4.rst:1683 msgid "" ":meth:`~unittest.TestLoader.discover` now sorts the discovered files to " "provide consistent test ordering. (Contributed by Martin Melin and Jeff " "Ramnani in :issue:`16709`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1688 +#: ../../whatsnew/3.4.rst:1687 msgid "" ":class:`~unittest.TestSuite` now drops references to tests as soon as the " "test has been run, if the test is successful. On Python interpreters that " @@ -2421,7 +2422,7 @@ msgid "" "Wardill, Matt McClure, and Andrew Svetlov in :issue:`11798`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1696 +#: ../../whatsnew/3.4.rst:1695 msgid "" "A new test assertion context-manager, :meth:`~unittest.TestCase.assertLogs`, " "will ensure that a given block of code emits a log message using the :mod:" @@ -2433,13 +2434,13 @@ msgid "" "in :issue:`18937`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1705 +#: ../../whatsnew/3.4.rst:1704 msgid "" "Test discovery now works with namespace packages (Contributed by Claudiu " "Popa in :issue:`17457`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1708 +#: ../../whatsnew/3.4.rst:1707 msgid "" ":mod:`unittest.mock` objects now inspect their specification signatures when " "matching calls, which means an argument can now be matched by either " @@ -2447,23 +2448,23 @@ msgid "" "Pitrou in :issue:`17015`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1713 +#: ../../whatsnew/3.4.rst:1712 msgid "" ":func:`~mock.mock_open` objects now have ``readline`` and ``readlines`` " "methods. (Contributed by Toshio Kuratomi in :issue:`17467`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1718 +#: ../../whatsnew/3.4.rst:1717 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.4.rst:1720 +#: ../../whatsnew/3.4.rst:1719 msgid "" ":mod:`venv` now includes activation scripts for the ``csh`` and ``fish`` " "shells. (Contributed by Andrew Svetlov in :issue:`15417`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1723 +#: ../../whatsnew/3.4.rst:1722 msgid "" ":class:`~venv.EnvBuilder` and the :func:`~venv.create` convenience function " "take a new keyword argument *with_pip*, which defaults to ``False``, that " @@ -2472,47 +2473,47 @@ msgid "" "issue:`19552` as part of the :pep:`453` implementation.)" msgstr "" -#: ../../whatsnew/3.4.rst:1731 +#: ../../whatsnew/3.4.rst:1730 msgid "wave" msgstr "wave" -#: ../../whatsnew/3.4.rst:1733 +#: ../../whatsnew/3.4.rst:1732 msgid "" "The :meth:`~wave.getparams` method now returns a namedtuple rather than a " "plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1736 +#: ../../whatsnew/3.4.rst:1735 msgid "" ":meth:`wave.open` now supports the context management protocol. " "(Contributed by Claudiu Popa in :issue:`17616`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1739 +#: ../../whatsnew/3.4.rst:1738 msgid "" ":mod:`wave` can now :ref:`write output to unseekable files `. (Contributed by David Jones, Guilherme Polo, and Serhiy " "Storchaka in :issue:`5202`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1743 +#: ../../whatsnew/3.4.rst:1742 msgid "" "The :meth:`~wave.Wave_write.writeframesraw` and :meth:`~wave.Wave_write." "writeframes` methods now accept any :term:`bytes-like object`. (Contributed " "by Serhiy Storchaka in :issue:`8311`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1749 +#: ../../whatsnew/3.4.rst:1748 msgid "weakref" msgstr "weakref" -#: ../../whatsnew/3.4.rst:1751 +#: ../../whatsnew/3.4.rst:1750 msgid "" "New :class:`~weakref.WeakMethod` class simulates weak references to bound " "methods. (Contributed by Antoine Pitrou in :issue:`14631`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1754 +#: ../../whatsnew/3.4.rst:1753 msgid "" "New :class:`~weakref.finalize` class makes it possible to register a " "callback to be invoked when an object is garbage collected, without needing " @@ -2520,18 +2521,18 @@ msgid "" "(Contributed by Richard Oudkerk in :issue:`15528`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1759 +#: ../../whatsnew/3.4.rst:1758 msgid "" "The callback, if any, associated with a :class:`~weakref.ref` is now exposed " "via the :attr:`~weakref.ref.__callback__` attribute. (Contributed by Mark " "Dickinson in :issue:`17643`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1765 +#: ../../whatsnew/3.4.rst:1764 msgid "xml.etree" msgstr "xml.etree" -#: ../../whatsnew/3.4.rst:1767 +#: ../../whatsnew/3.4.rst:1766 msgid "" "A new parser, :class:`~xml.etree.ElementTree.XMLPullParser`, allows a non-" "blocking applications to parse XML documents. An example can be seen at :" @@ -2539,7 +2540,7 @@ msgid "" "`17741`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1772 +#: ../../whatsnew/3.4.rst:1771 msgid "" "The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` " "and :func:`~xml.etree.ElementTree.tostringlist` functions, and the :class:" @@ -2551,11 +2552,11 @@ msgid "" "Storchaka in :issue:`14377`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1783 +#: ../../whatsnew/3.4.rst:1782 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.4.rst:1785 +#: ../../whatsnew/3.4.rst:1784 msgid "" "The :meth:`~zipfile.PyZipFile.writepy` method of the :class:`~zipfile." "PyZipFile` class has a new *filterfunc* option that can be used to control " @@ -2564,36 +2565,36 @@ msgid "" "Christian Tismer in :issue:`19274`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1791 +#: ../../whatsnew/3.4.rst:1790 msgid "" "The *allowZip64* parameter to :class:`~zipfile.ZipFile` and :class:`~zipfile." "PyZipfile` is now ``True`` by default. (Contributed by William Mallard in :" "issue:`17201`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1798 +#: ../../whatsnew/3.4.rst:1797 msgid "CPython Implementation Changes" msgstr "CPython 實作變更" -#: ../../whatsnew/3.4.rst:1804 +#: ../../whatsnew/3.4.rst:1803 msgid "PEP 445: Customization of CPython Memory Allocators" msgstr "" -#: ../../whatsnew/3.4.rst:1806 +#: ../../whatsnew/3.4.rst:1805 msgid "" ":pep:`445` adds new C level interfaces to customize memory allocation in the " "CPython interpreter." msgstr "" -#: ../../whatsnew/3.4.rst:1811 +#: ../../whatsnew/3.4.rst:1810 msgid ":pep:`445` -- Add new APIs to customize Python memory allocators" msgstr "" -#: ../../whatsnew/3.4.rst:1818 +#: ../../whatsnew/3.4.rst:1817 msgid "PEP 442: Safe Object Finalization" msgstr "" -#: ../../whatsnew/3.4.rst:1820 +#: ../../whatsnew/3.4.rst:1819 msgid "" ":pep:`442` removes the current limitations and quirks of object finalization " "in CPython. With it, objects with :meth:`__del__` methods, as well as " @@ -2601,7 +2602,7 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../whatsnew/3.4.rst:1825 +#: ../../whatsnew/3.4.rst:1824 msgid "" "As part of this change, module globals are no longer forcibly set to :const:" "`None` during interpreter shutdown in most cases, instead relying on the " @@ -2610,15 +2611,15 @@ msgid "" "that have plagued Python since the cyclic GC was first introduced." msgstr "" -#: ../../whatsnew/3.4.rst:1834 +#: ../../whatsnew/3.4.rst:1833 msgid ":pep:`442` -- Safe object finalization" msgstr "" -#: ../../whatsnew/3.4.rst:1841 +#: ../../whatsnew/3.4.rst:1840 msgid "PEP 456: Secure and Interchangeable Hash Algorithm" msgstr "" -#: ../../whatsnew/3.4.rst:1843 +#: ../../whatsnew/3.4.rst:1842 msgid "" ":pep:`456` follows up on earlier security fix work done on Python's hash " "algorithm to address certain DOS attacks to which public facing APIs backed " @@ -2630,18 +2631,18 @@ msgid "" "comparison with the older FNV algorithm are trivial." msgstr "" -#: ../../whatsnew/3.4.rst:1852 +#: ../../whatsnew/3.4.rst:1851 msgid "" "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 "" -#: ../../whatsnew/3.4.rst:1860 +#: ../../whatsnew/3.4.rst:1859 msgid "PEP 436: Argument Clinic" msgstr "" -#: ../../whatsnew/3.4.rst:1862 +#: ../../whatsnew/3.4.rst:1861 msgid "" "\"Argument Clinic\" (:pep:`436`) is now part of the CPython build process " "and can be used to simplify the process of defining and maintaining accurate " @@ -2649,21 +2650,21 @@ msgid "" "in C." msgstr "" -#: ../../whatsnew/3.4.rst:1867 +#: ../../whatsnew/3.4.rst:1866 msgid "" "Some standard library extension modules have been converted to use Argument " "Clinic in Python 3.4, and :mod:`pydoc` and :mod:`inspect` have been updated " "accordingly." msgstr "" -#: ../../whatsnew/3.4.rst:1871 +#: ../../whatsnew/3.4.rst:1870 msgid "" "It is expected that signature metadata for programmatic introspection will " "be added to additional callables implemented in C as part of Python 3.4 " "maintenance releases." msgstr "" -#: ../../whatsnew/3.4.rst:1876 +#: ../../whatsnew/3.4.rst:1875 msgid "" "The Argument Clinic PEP is not fully up to date with the state of the " "implementation. This has been deemed acceptable by the release manager and " @@ -2671,26 +2672,26 @@ msgid "" "available as a public API for third party use in Python 3.4." msgstr "" -#: ../../whatsnew/3.4.rst:1883 +#: ../../whatsnew/3.4.rst:1882 msgid ":pep:`436` -- The Argument Clinic DSL" msgstr "" -#: ../../whatsnew/3.4.rst:1884 +#: ../../whatsnew/3.4.rst:1883 msgid "PEP written and implemented by Larry Hastings." msgstr "由 Larry Hastings 撰寫 PEP 與實作。" -#: ../../whatsnew/3.4.rst:1888 +#: ../../whatsnew/3.4.rst:1887 msgid "Other Build and C API Changes" msgstr "" -#: ../../whatsnew/3.4.rst:1890 +#: ../../whatsnew/3.4.rst:1889 msgid "" "The new :c:func:`PyType_GetSlot` function has been added to the stable ABI, " "allowing retrieval of function pointers from named type slots when using the " "limited API. (Contributed by Martin von Löwis in :issue:`17162`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1894 +#: ../../whatsnew/3.4.rst:1893 msgid "" "The new :c:func:`!Py_SetStandardStreamEncoding` pre-initialization API " "allows applications embedding the CPython interpreter to reliably force a " @@ -2698,34 +2699,34 @@ msgid "" "by Bastien Montagne and Nick Coghlan in :issue:`16129`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1899 +#: ../../whatsnew/3.4.rst:1898 msgid "" "Most Python C APIs that don't mutate string arguments are now correctly " "marked as accepting ``const char *`` rather than ``char *``. (Contributed " "by Serhiy Storchaka in :issue:`1772673`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1903 +#: ../../whatsnew/3.4.rst:1902 msgid "" "A new shell version of ``python-config`` can be used even when a python " "interpreter is not available (for example, in cross compilation scenarios)." msgstr "" -#: ../../whatsnew/3.4.rst:1906 +#: ../../whatsnew/3.4.rst:1905 msgid "" ":c:func:`PyUnicode_FromFormat` now supports width and precision " "specifications for ``%s``, ``%A``, ``%U``, ``%V``, ``%S``, and ``%R``. " "(Contributed by Ysj Ray and Victor Stinner in :issue:`7330`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1910 +#: ../../whatsnew/3.4.rst:1909 msgid "" "New function :c:func:`PyStructSequence_InitType2` supplements the existing :" "c:func:`PyStructSequence_InitType` function. The difference is that it " "returns ``0`` on success and ``-1`` on failure." msgstr "" -#: ../../whatsnew/3.4.rst:1914 +#: ../../whatsnew/3.4.rst:1913 msgid "" "The CPython source can now be compiled using the address sanity checking " "features of recent versions of GCC and clang: the false alarms in the small " @@ -2733,7 +2734,7 @@ msgid "" "`18596`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1919 +#: ../../whatsnew/3.4.rst:1918 msgid "" "The Windows build now uses `Address Space Layout Randomization `_ and `Data Execution " @@ -2741,17 +2742,17 @@ msgid "" "(Contributed by Christian Heimes in :issue:`16632`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1924 +#: ../../whatsnew/3.4.rst:1923 msgid "" "New function :c:func:`PyObject_LengthHint` is the C API equivalent of :func:" "`operator.length_hint`. (Contributed by Armin Ronacher in :issue:`16148`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1932 +#: ../../whatsnew/3.4.rst:1931 msgid "Other Improvements" msgstr "" -#: ../../whatsnew/3.4.rst:1936 +#: ../../whatsnew/3.4.rst:1935 msgid "" "The :ref:`python ` command has a new :ref:`option `, ``-I``, which causes it to run in \"isolated mode\", " @@ -2765,7 +2766,7 @@ msgid "" "scripts. (Contributed by Christian Heimes in :issue:`16499`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1947 +#: ../../whatsnew/3.4.rst:1946 msgid "" "Tab-completion is now enabled by default in the interactive interpreter on " "systems that support :mod:`readline`. History is also enabled by default, " @@ -2773,7 +2774,7 @@ msgid "" "(Contributed by Antoine Pitrou and Éric Araujo in :issue:`5845`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1952 +#: ../../whatsnew/3.4.rst:1951 msgid "" "Invoking the Python interpreter with ``--version`` now outputs the version " "to standard output instead of standard error (:issue:`18338`). Similar " @@ -2781,7 +2782,7 @@ msgid "" "have script-like invocation capabilities (:issue:`18922`)." msgstr "" -#: ../../whatsnew/3.4.rst:1957 +#: ../../whatsnew/3.4.rst:1956 msgid "" "The CPython Windows installer now adds ``.py`` to the :envvar:`PATHEXT` " "variable when extensions are registered, allowing users to run a python " @@ -2789,40 +2790,40 @@ msgid "" "py`` extension. (Contributed by Paul Moore in :issue:`18569`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1962 +#: ../../whatsnew/3.4.rst:1961 msgid "" "A new ``make`` target `coverage-report `_ will build python, run " "the test suite, and generate an HTML coverage report for the C codebase " -"using ``gcov`` and `lcov `_." +"using ``gcov`` and `lcov `_." msgstr "" -#: ../../whatsnew/3.4.rst:1968 +#: ../../whatsnew/3.4.rst:1967 msgid "" "The ``-R`` option to the :ref:`python regression test suite ` now " "also checks for memory allocation leaks, using :func:`sys." "getallocatedblocks`. (Contributed by Antoine Pitrou in :issue:`13390`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1973 +#: ../../whatsnew/3.4.rst:1972 msgid "``python -m`` now works with namespace packages." msgstr "" -#: ../../whatsnew/3.4.rst:1975 +#: ../../whatsnew/3.4.rst:1974 msgid "" "The :mod:`stat` module is now implemented in C, which means it gets the " "values for its constants from the C header files, instead of having the " "values hard-coded in the python module as was previously the case." msgstr "" -#: ../../whatsnew/3.4.rst:1979 +#: ../../whatsnew/3.4.rst:1978 msgid "" "Loading multiple python modules from a single OS module (``.so``, ``.dll``) " "now works correctly (previously it silently returned the first python module " "in the file). (Contributed by Václav Šmilauer in :issue:`16421`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1983 +#: ../../whatsnew/3.4.rst:1982 msgid "" "A new opcode, :opcode:`LOAD_CLASSDEREF`, has been added to fix a bug in the " "loading of free variables in class bodies that could be triggered by certain " @@ -2830,21 +2831,21 @@ msgid "" "issue:`17853`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1988 +#: ../../whatsnew/3.4.rst:1987 msgid "" "A number of MemoryError-related crashes were identified and fixed by Victor " "Stinner using his :pep:`445`-based ``pyfailmalloc`` tool (:issue:`18408`, :" "issue:`18520`)." msgstr "" -#: ../../whatsnew/3.4.rst:1992 +#: ../../whatsnew/3.4.rst:1991 msgid "" "The ``pyvenv`` command now accepts a ``--copies`` option to use copies " "rather than symlinks even on systems where symlinks are the default. " "(Contributed by Vinay Sajip in :issue:`18807`.)" msgstr "" -#: ../../whatsnew/3.4.rst:1996 +#: ../../whatsnew/3.4.rst:1995 msgid "" "The ``pyvenv`` command also accepts a ``--without-pip`` option to suppress " "the otherwise-automatic bootstrapping of pip into the virtual environment. " @@ -2852,7 +2853,7 @@ msgid "" "implementation.)" msgstr "" -#: ../../whatsnew/3.4.rst:2001 +#: ../../whatsnew/3.4.rst:2000 msgid "" "The encoding name is now optional in the value set for the :envvar:" "`PYTHONIOENCODING` environment variable. This makes it possible to set just " @@ -2860,24 +2861,24 @@ msgid "" "Serhiy Storchaka in :issue:`18818`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2006 +#: ../../whatsnew/3.4.rst:2005 msgid "" "The :mod:`bz2`, :mod:`lzma`, and :mod:`gzip` module ``open`` functions now " "support ``x`` (exclusive creation) mode. (Contributed by Tim Heaney and " "Vajrasky Kok in :issue:`19201`, :issue:`19222`, and :issue:`19223`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2012 +#: ../../whatsnew/3.4.rst:2011 msgid "Significant Optimizations" msgstr "顯著最佳化" -#: ../../whatsnew/3.4.rst:2014 +#: ../../whatsnew/3.4.rst:2013 msgid "" "The UTF-32 decoder is now 3x to 4x faster. (Contributed by Serhiy Storchaka " "in :issue:`14625`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2017 +#: ../../whatsnew/3.4.rst:2016 msgid "" "The cost of hash collisions for sets is now reduced. Each hash table probe " "now checks a series of consecutive, adjacent key/hash pairs before " @@ -2890,7 +2891,7 @@ msgid "" "Raymond Hettinger in :issue:`18771`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2028 +#: ../../whatsnew/3.4.rst:2027 msgid "" "The interpreter starts about 30% faster. A couple of measures lead to the " "speedup. The interpreter loads fewer modules on startup, e.g. the :mod:" @@ -2901,27 +2902,27 @@ msgid "" "`19209`, :issue:`19205` and :issue:`9548`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2036 +#: ../../whatsnew/3.4.rst:2035 msgid "" ":class:`bz2.BZ2File` is now as fast or faster than the Python2 version for " "most cases. :class:`lzma.LZMAFile` has also been optimized. (Contributed " "by Serhiy Storchaka and Nadeem Vawda in :issue:`16034`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2040 +#: ../../whatsnew/3.4.rst:2039 msgid "" ":func:`random.getrandbits` is 20%-40% faster for small integers (the most " "common use case). (Contributed by Serhiy Storchaka in :issue:`16674`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2043 +#: ../../whatsnew/3.4.rst:2042 msgid "" "By taking advantage of the new storage format for strings, pickling of " "strings is now significantly faster. (Contributed by Victor Stinner and " "Antoine Pitrou in :issue:`15596`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2047 +#: ../../whatsnew/3.4.rst:2046 msgid "" "A performance issue in :meth:`io.FileIO.readall` has been solved. This " "particularly affects Windows, and significantly speeds up the case of piping " @@ -2929,31 +2930,31 @@ msgid "" "Richard Oudkerk in :issue:`15758`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2052 +#: ../../whatsnew/3.4.rst:2051 msgid "" ":func:`html.escape` is now 10x faster. (Contributed by Matt Bryant in :" "issue:`18020`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2055 +#: ../../whatsnew/3.4.rst:2054 msgid "" "On Windows, the native ``VirtualAlloc`` is now used instead of the CRT " "``malloc`` in ``obmalloc``. Artificial benchmarks show about a 3% memory " "savings." msgstr "" -#: ../../whatsnew/3.4.rst:2059 +#: ../../whatsnew/3.4.rst:2058 msgid "" ":func:`os.urandom` now uses a lazily opened persistent file descriptor so as " "to avoid using many file descriptors when run in parallel from multiple " "threads. (Contributed by Antoine Pitrou in :issue:`18756`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2067 +#: ../../whatsnew/3.4.rst:2066 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.4.rst:2069 +#: ../../whatsnew/3.4.rst:2068 msgid "" "This section covers various APIs and other features that have been " "deprecated in Python 3.4, and will be removed in Python 3.5 or later. In " @@ -2962,11 +2963,11 @@ msgid "" "enabled (for example, by using ``-Wd``)." msgstr "" -#: ../../whatsnew/3.4.rst:2077 +#: ../../whatsnew/3.4.rst:2076 msgid "Deprecations in the Python API" msgstr "" -#: ../../whatsnew/3.4.rst:2079 +#: ../../whatsnew/3.4.rst:2078 msgid "" "As mentioned in :ref:`whatsnew-pep-451`, a number of :mod:`importlib` " "methods and functions are deprecated: :meth:`!importlib.find_loader` is " @@ -2989,45 +2990,45 @@ msgid "" "now handled automatically by the import system." msgstr "" -#: ../../whatsnew/3.4.rst:2104 +#: ../../whatsnew/3.4.rst:2103 msgid "" "The :mod:`!imp` module is pending deprecation. To keep compatibility with " "Python 2/3 code bases, the module's removal is currently not scheduled." msgstr "" -#: ../../whatsnew/3.4.rst:2107 +#: ../../whatsnew/3.4.rst:2106 msgid "" "The :mod:`formatter` module is pending deprecation and is slated for removal " "in Python 3.6." msgstr "" -#: ../../whatsnew/3.4.rst:2110 +#: ../../whatsnew/3.4.rst:2109 msgid "" "``MD5`` as the default *digestmod* for the :func:`hmac.new` function is " "deprecated. Python 3.6 will require an explicit digest name or constructor " "as *digestmod* argument." msgstr "" -#: ../../whatsnew/3.4.rst:2114 +#: ../../whatsnew/3.4.rst:2113 msgid "" "The internal ``Netrc`` class in the :mod:`ftplib` module has been documented " "as deprecated in its docstring for quite some time. It now emits a :exc:" "`DeprecationWarning` and will be removed completely in Python 3.5." msgstr "" -#: ../../whatsnew/3.4.rst:2118 +#: ../../whatsnew/3.4.rst:2117 msgid "" "The undocumented *endtime* argument to :meth:`subprocess.Popen.wait` should " "not have been exposed and is hopefully not in use; it is deprecated and will " "mostly likely be removed in Python 3.5." msgstr "" -#: ../../whatsnew/3.4.rst:2122 +#: ../../whatsnew/3.4.rst:2121 msgid "" "The *strict* argument of :class:`~html.parser.HTMLParser` is deprecated." msgstr "" -#: ../../whatsnew/3.4.rst:2124 +#: ../../whatsnew/3.4.rst:2123 msgid "" "The :mod:`plistlib` :func:`~plistlib.readPlist`, :func:`~plistlib." "writePlist`, :func:`~plistlib.readPlistFromBytes`, and :func:`~plistlib." @@ -3037,13 +3038,13 @@ msgid "" "deprecated in favor of just using the :class:`bytes` constructor." msgstr "" -#: ../../whatsnew/3.4.rst:2131 +#: ../../whatsnew/3.4.rst:2130 msgid "" "The :mod:`sysconfig` key ``SO`` is deprecated, it has been replaced by " "``EXT_SUFFIX``." msgstr "" -#: ../../whatsnew/3.4.rst:2134 +#: ../../whatsnew/3.4.rst:2133 msgid "" "The ``U`` mode accepted by various ``open`` functions is deprecated. In " "Python3 it does not do anything useful, and should be replaced by " @@ -3051,7 +3052,7 @@ msgid "" "argument." msgstr "" -#: ../../whatsnew/3.4.rst:2139 +#: ../../whatsnew/3.4.rst:2138 msgid "" "The *parser* argument of :func:`xml.etree.ElementTree.iterparse` has been " "deprecated, as has the *html* argument of :func:`~xml.etree.ElementTree." @@ -3059,97 +3060,97 @@ msgid "" "``XMLParser`` should be passed by keyword." msgstr "" -#: ../../whatsnew/3.4.rst:2146 +#: ../../whatsnew/3.4.rst:2145 msgid "Deprecated Features" msgstr "已棄用功能" -#: ../../whatsnew/3.4.rst:2148 +#: ../../whatsnew/3.4.rst:2147 msgid "" "Running :ref:`idle` with the ``-n`` flag (no subprocess) is deprecated. " "However, the feature will not be removed until :issue:`18823` is resolved." msgstr "" -#: ../../whatsnew/3.4.rst:2151 +#: ../../whatsnew/3.4.rst:2150 msgid "" "The site module adding a \"site-python\" directory to sys.path, if it " "exists, is deprecated (:issue:`19375`)." msgstr "" -#: ../../whatsnew/3.4.rst:2157 +#: ../../whatsnew/3.4.rst:2156 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.4.rst:2161 +#: ../../whatsnew/3.4.rst:2160 msgid "Operating Systems No Longer Supported" msgstr "" -#: ../../whatsnew/3.4.rst:2163 +#: ../../whatsnew/3.4.rst:2162 msgid "" "Support for the following operating systems has been removed from the source " "and build tools:" msgstr "" -#: ../../whatsnew/3.4.rst:2166 +#: ../../whatsnew/3.4.rst:2165 msgid "OS/2 (:issue:`16135`)." msgstr "OS/2 (:issue:`16135`)。" -#: ../../whatsnew/3.4.rst:2167 +#: ../../whatsnew/3.4.rst:2166 msgid "Windows 2000 (changeset e52df05b496a)." msgstr "" -#: ../../whatsnew/3.4.rst:2168 +#: ../../whatsnew/3.4.rst:2167 msgid "" "Windows systems where ``COMSPEC`` points to ``command.com`` (:issue:`14470`)." msgstr "" -#: ../../whatsnew/3.4.rst:2169 +#: ../../whatsnew/3.4.rst:2168 msgid "VMS (:issue:`16136`)." msgstr "VMS (:issue:`16136`)。" -#: ../../whatsnew/3.4.rst:2173 +#: ../../whatsnew/3.4.rst:2172 msgid "API and Feature Removals" msgstr "API 與功能的移除" -#: ../../whatsnew/3.4.rst:2175 +#: ../../whatsnew/3.4.rst:2174 msgid "" "The following obsolete and previously deprecated APIs and features have been " "removed:" msgstr "" -#: ../../whatsnew/3.4.rst:2178 +#: ../../whatsnew/3.4.rst:2177 msgid "" "The unmaintained ``Misc/TextMate`` and ``Misc/vim`` directories have been " "removed (see the `devguide `_ for suggestions " "on what to use instead)." msgstr "" -#: ../../whatsnew/3.4.rst:2182 +#: ../../whatsnew/3.4.rst:2181 msgid "" "The ``SO`` makefile macro is removed (it was replaced by the " "``SHLIB_SUFFIX`` and ``EXT_SUFFIX`` macros) (:issue:`16754`)." msgstr "" -#: ../../whatsnew/3.4.rst:2185 +#: ../../whatsnew/3.4.rst:2184 msgid "" "The ``PyThreadState.tick_counter`` field has been removed; its value has " "been meaningless since Python 3.2, when the \"new GIL\" was introduced (:" "issue:`19199`)." msgstr "" -#: ../../whatsnew/3.4.rst:2189 +#: ../../whatsnew/3.4.rst:2188 msgid "" "``PyLoader`` and ``PyPycLoader`` have been removed from :mod:`importlib`. " "(Contributed by Taras Lyapun in :issue:`15641`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2192 +#: ../../whatsnew/3.4.rst:2191 msgid "" "The *strict* argument to :class:`~http.client.HTTPConnection` and :class:" "`~http.client.HTTPSConnection` has been removed. HTTP 0.9-style \"Simple " "Responses\" are no longer supported." msgstr "" -#: ../../whatsnew/3.4.rst:2196 +#: ../../whatsnew/3.4.rst:2195 msgid "" "The deprecated :mod:`urllib.request.Request` getter and setter methods " "``add_data``, ``has_data``, ``get_data``, ``get_type``, ``get_host``, " @@ -3157,19 +3158,19 @@ msgid "" "``is_unverifiable`` have been removed (use direct attribute access instead)." msgstr "" -#: ../../whatsnew/3.4.rst:2201 +#: ../../whatsnew/3.4.rst:2200 msgid "" "Support for loading the deprecated ``TYPE_INT64`` has been removed from :mod:" "`marshal`. (Contributed by Dan Riti in :issue:`15480`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2204 +#: ../../whatsnew/3.4.rst:2203 msgid "" ":class:`inspect.Signature`: positional-only parameters are now required to " "have a valid name." msgstr "" -#: ../../whatsnew/3.4.rst:2207 +#: ../../whatsnew/3.4.rst:2206 msgid "" ":meth:`object.__format__` no longer accepts non-empty format strings, it now " "raises a :exc:`TypeError` instead. Using a non-empty string has been " @@ -3181,7 +3182,7 @@ msgid "" "`7994` for background." msgstr "" -#: ../../whatsnew/3.4.rst:2216 +#: ../../whatsnew/3.4.rst:2215 msgid "" ":meth:`difflib.SequenceMatcher.isbjunk` and :meth:`difflib.SequenceMatcher." "isbpopular` were deprecated in 3.2, and have now been removed: use ``x in sm." @@ -3189,17 +3190,17 @@ msgid "" "SequenceMatcher` object (:issue:`13248`)." msgstr "" -#: ../../whatsnew/3.4.rst:2224 +#: ../../whatsnew/3.4.rst:2223 msgid "Code Cleanups" msgstr "程式碼的清除" -#: ../../whatsnew/3.4.rst:2226 +#: ../../whatsnew/3.4.rst:2225 msgid "" "The unused and undocumented internal ``Scanner`` class has been removed from " "the :mod:`pydoc` module." msgstr "" -#: ../../whatsnew/3.4.rst:2229 +#: ../../whatsnew/3.4.rst:2228 msgid "" "The private and effectively unused ``_gestalt`` module has been removed, " "along with the private :mod:`platform` functions ``_mac_ver_lookup``, " @@ -3207,27 +3208,27 @@ msgid "" "called on badly broken OSX systems (see :issue:`18393`)." msgstr "" -#: ../../whatsnew/3.4.rst:2234 +#: ../../whatsnew/3.4.rst:2233 msgid "" "The hardcoded copies of certain :mod:`stat` constants that were included in " "the :mod:`tarfile` module namespace have been removed." msgstr "" -#: ../../whatsnew/3.4.rst:2240 +#: ../../whatsnew/3.4.rst:2239 msgid "Porting to Python 3.4" msgstr "" -#: ../../whatsnew/3.4.rst:2242 +#: ../../whatsnew/3.4.rst:2241 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.4.rst:2247 +#: ../../whatsnew/3.4.rst:2246 msgid "Changes in 'python' Command Behavior" msgstr "" -#: ../../whatsnew/3.4.rst:2249 +#: ../../whatsnew/3.4.rst:2248 msgid "" "In a posix shell, setting the :envvar:`PATH` environment variable to an " "empty value is equivalent to not setting it at all. However, setting :" @@ -3238,25 +3239,25 @@ msgid "" "for :envvar:`PATH`." msgstr "" -#: ../../whatsnew/3.4.rst:2257 +#: ../../whatsnew/3.4.rst:2256 msgid "" "The [X refs, Y blocks] output of a debug (``--with-pydebug``) build of the " "CPython interpreter is now off by default. It can be re-enabled using the " "``-X showrefcount`` option. (Contributed by Ezio Melotti in :issue:`17323`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2261 +#: ../../whatsnew/3.4.rst:2260 msgid "" "The python command and most stdlib scripts (as well as :mod:`argparse`) now " "output ``--version`` information to ``stdout`` instead of ``stderr`` (for " "issue list see :ref:`other-improvements-3.4` above)." msgstr "" -#: ../../whatsnew/3.4.rst:2267 +#: ../../whatsnew/3.4.rst:2266 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.4.rst:2269 +#: ../../whatsnew/3.4.rst:2268 msgid "" "The ABCs defined in :mod:`importlib.abc` now either raise the appropriate " "exception or return a default value instead of raising :exc:" @@ -3265,7 +3266,7 @@ msgid "" "catch both :exc:`NotImplementedError` or the appropriate exception as needed." msgstr "" -#: ../../whatsnew/3.4.rst:2275 +#: ../../whatsnew/3.4.rst:2274 msgid "" "The module type now initializes the :attr:`__package__` and :attr:" "`__loader__` attributes to ``None`` by default. To determine if these " @@ -3273,7 +3274,7 @@ msgid "" "``getattr(module, '__loader__', None) is not None``. (:issue:`17115`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2280 +#: ../../whatsnew/3.4.rst:2279 msgid "" ":meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and " "``__package__`` unconditionally to properly support reloading. If this is " @@ -3281,7 +3282,7 @@ msgid "" "use :func:`importlib.util.module_to_load` for module management." msgstr "" -#: ../../whatsnew/3.4.rst:2285 +#: ../../whatsnew/3.4.rst:2284 msgid "" "Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``, " "``__package__``, ``__file__``, ``__cached__``) unconditionally when " @@ -3289,7 +3290,7 @@ msgid "" "module is re-found when re-loaded (:issue:`19413`)." msgstr "" -#: ../../whatsnew/3.4.rst:2290 +#: ../../whatsnew/3.4.rst:2289 msgid "" "Frozen packages no longer set ``__path__`` to a list containing the package " "name, they now set it to an empty list. The previous behavior could cause " @@ -3299,7 +3300,7 @@ msgid "" "'__path__')`` (:issue:`18065`)." msgstr "" -#: ../../whatsnew/3.4.rst:2297 +#: ../../whatsnew/3.4.rst:2296 msgid "" "Frozen modules no longer define a ``__file__`` attribute. It's semantically " "incorrect for frozen modules to set the attribute as they are not loaded " @@ -3310,7 +3311,7 @@ msgid "" "use :func:`!imp.is_frozen`." msgstr "" -#: ../../whatsnew/3.4.rst:2305 +#: ../../whatsnew/3.4.rst:2304 msgid "" ":func:`py_compile.compile` now raises :exc:`FileExistsError` if the file " "path it would write to is a symlink or a non-regular file. This is to act as " @@ -3318,7 +3319,7 @@ msgid "" "regardless of what type of file path they were originally." msgstr "" -#: ../../whatsnew/3.4.rst:2310 +#: ../../whatsnew/3.4.rst:2309 msgid "" ":meth:`importlib.abc.SourceLoader.get_source` no longer raises :exc:" "`ImportError` when the source code being loaded triggers a :exc:" @@ -3330,7 +3331,7 @@ msgid "" "exceptions now." msgstr "" -#: ../../whatsnew/3.4.rst:2319 +#: ../../whatsnew/3.4.rst:2318 msgid "" ":func:`functools.update_wrapper` and :func:`functools.wraps` now correctly " "set the ``__wrapped__`` attribute to the function being wrapped, even if " @@ -3342,7 +3343,7 @@ msgid "" "function in the chain that has no ``__wrapped__`` attribute." msgstr "" -#: ../../whatsnew/3.4.rst:2329 +#: ../../whatsnew/3.4.rst:2328 msgid "" ":func:`inspect.getfullargspec` has been reimplemented on top of :func:" "`inspect.signature` and hence handles a much wider variety of callable " @@ -3352,7 +3353,7 @@ msgid "" "will fail on non-Python callables may need to be adjusted accordingly." msgstr "" -#: ../../whatsnew/3.4.rst:2337 +#: ../../whatsnew/3.4.rst:2336 msgid "" ":class:`importlib.machinery.PathFinder` now passes on the current working " "directory to objects in :data:`sys.path_hooks` for the empty string. This " @@ -3366,7 +3367,7 @@ msgid "" "`18416`)." msgstr "" -#: ../../whatsnew/3.4.rst:2348 +#: ../../whatsnew/3.4.rst:2347 msgid "" "The removal of the *strict* argument to :class:`~http.client.HTTPConnection` " "and :class:`~http.client.HTTPSConnection` changes the meaning of the " @@ -3375,7 +3376,7 @@ msgid "" "should already be specifying any additional arguments via keywords." msgstr "" -#: ../../whatsnew/3.4.rst:2354 +#: ../../whatsnew/3.4.rst:2353 msgid "" "Strings between ``from __future__ import ...`` statements now *always* raise " "a :exc:`SyntaxError`. Previously if there was no leading docstring, an " @@ -3384,7 +3385,7 @@ msgid "" "`17434`)." msgstr "" -#: ../../whatsnew/3.4.rst:2360 +#: ../../whatsnew/3.4.rst:2359 msgid "" ":meth:`ssl.SSLSocket.getpeercert` and :meth:`ssl.SSLSocket.do_handshake` now " "raise an :exc:`OSError` with ``ENOTCONN`` when the ``SSLSocket`` is not " @@ -3393,7 +3394,7 @@ msgid "" "raise a :exc:`ValueError` if the handshake has not yet been done." msgstr "" -#: ../../whatsnew/3.4.rst:2366 +#: ../../whatsnew/3.4.rst:2365 msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " @@ -3402,7 +3403,7 @@ msgid "" "`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" -#: ../../whatsnew/3.4.rst:2373 +#: ../../whatsnew/3.4.rst:2372 msgid "" "The :attr:`!file` attribute is now automatically closed when the creating :" "class:`!cgi.FieldStorage` instance is garbage collected. If you were pulling " @@ -3412,14 +3413,14 @@ msgid "" "the :class:`!cgi.FieldStorage` instance is garbage collected." msgstr "" -#: ../../whatsnew/3.4.rst:2380 +#: ../../whatsnew/3.4.rst:2379 msgid "" "Calling ``read`` or ``write`` on a closed SSL socket now raises an " "informative :exc:`ValueError` rather than the previous more mysterious :exc:" "`AttributeError` (:issue:`9177`)." msgstr "" -#: ../../whatsnew/3.4.rst:2384 +#: ../../whatsnew/3.4.rst:2383 msgid "" ":meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge " "values. As a consequence of this fix, :meth:`slice.indices` now raises a :" @@ -3427,7 +3428,7 @@ msgid "" "values (:issue:`14794`)." msgstr "" -#: ../../whatsnew/3.4.rst:2389 +#: ../../whatsnew/3.4.rst:2388 msgid "" "The :class:`complex` constructor, unlike the :mod:`cmath` functions, was " "incorrectly accepting :class:`float` values if an object's ``__complex__`` " @@ -3435,21 +3436,21 @@ msgid "" "`16290`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2394 +#: ../../whatsnew/3.4.rst:2393 msgid "" "The :class:`int` constructor in 3.2 and 3.3 erroneously accepts :class:" "`float` values for the *base* parameter. It is unlikely anyone was doing " "this, but if so, it will now raise a :exc:`TypeError` (:issue:`16772`)." msgstr "" -#: ../../whatsnew/3.4.rst:2398 +#: ../../whatsnew/3.4.rst:2397 msgid "" "Defaults for keyword-only arguments are now evaluated *after* defaults for " "regular keyword arguments, instead of before. Hopefully no one wrote any " "code that depends on the previous buggy behavior (:issue:`16967`)." msgstr "" -#: ../../whatsnew/3.4.rst:2402 +#: ../../whatsnew/3.4.rst:2401 msgid "" "Stale thread states are now cleared after :func:`~os.fork`. This may cause " "some system resources to be released that previously were incorrectly kept " @@ -3457,21 +3458,21 @@ msgid "" "storage). (:issue:`17094`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2407 +#: ../../whatsnew/3.4.rst:2406 msgid "" "Parameter names in ``__annotations__`` dicts are now mangled properly, " "similarly to :attr:`~function.__kwdefaults__`. (Contributed by Yury " "Selivanov in :issue:`20625`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2411 +#: ../../whatsnew/3.4.rst:2410 msgid "" ":attr:`hashlib.hash.name` now always returns the identifier in lower case. " "Previously some builtin hashes had uppercase names, but now that it is a " "formal public interface the naming has been made consistent (:issue:`18532`)." msgstr "" -#: ../../whatsnew/3.4.rst:2415 +#: ../../whatsnew/3.4.rst:2414 msgid "" "Because :mod:`unittest.TestSuite` now drops references to tests after they " "are run, test harnesses that reuse a :class:`~unittest.TestSuite` to re-run " @@ -3484,7 +3485,7 @@ msgid "" "__iter__`) (:issue:`11798`)." msgstr "" -#: ../../whatsnew/3.4.rst:2425 +#: ../../whatsnew/3.4.rst:2424 msgid "" ":mod:`unittest` now uses :mod:`argparse` for command line parsing. There " "are certain invalid command forms that used to work that are no longer " @@ -3493,7 +3494,7 @@ msgid "" "use." msgstr "" -#: ../../whatsnew/3.4.rst:2430 +#: ../../whatsnew/3.4.rst:2429 msgid "" "The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and " "the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of " @@ -3503,13 +3504,13 @@ msgid "" "say, a ``bytearray``, you will need to change your code." msgstr "" -#: ../../whatsnew/3.4.rst:2437 +#: ../../whatsnew/3.4.rst:2436 msgid "" ":mod:`!audioop` functions now raise an error immediately if passed string " "input, instead of failing randomly later on (:issue:`16685`)." msgstr "" -#: ../../whatsnew/3.4.rst:2440 +#: ../../whatsnew/3.4.rst:2439 msgid "" "The new *convert_charrefs* argument to :class:`~html.parser.HTMLParser` " "currently defaults to ``False`` for backward compatibility, but will " @@ -3518,14 +3519,14 @@ msgid "" "HTMLParser` calls in your code (:issue:`13633`)." msgstr "" -#: ../../whatsnew/3.4.rst:2446 +#: ../../whatsnew/3.4.rst:2445 msgid "" "Since the *digestmod* argument to the :func:`hmac.new` function will in the " "future have no default, all calls to :func:`hmac.new` should be changed to " "explicitly specify a *digestmod* (:issue:`17276`)." msgstr "" -#: ../../whatsnew/3.4.rst:2450 +#: ../../whatsnew/3.4.rst:2449 msgid "" "Calling :func:`sysconfig.get_config_var` with the ``SO`` key, or looking " "``SO`` up in the results of a call to :func:`sysconfig.get_config_vars` is " @@ -3533,7 +3534,7 @@ msgid "" "``SHLIB_SUFFIX``, depending on the context (:issue:`19555`)." msgstr "" -#: ../../whatsnew/3.4.rst:2455 +#: ../../whatsnew/3.4.rst:2454 msgid "" "Any calls to ``open`` functions that specify ``U`` should be modified. ``U`` " "is ineffective in Python3 and will eventually raise an error if used. " @@ -3543,13 +3544,13 @@ msgid "" "`15204`)." msgstr "" -#: ../../whatsnew/3.4.rst:2462 +#: ../../whatsnew/3.4.rst:2461 msgid "" "If you use ``pyvenv`` in a script and desire that pip *not* be installed, " "you must add ``--without-pip`` to your command invocation." msgstr "" -#: ../../whatsnew/3.4.rst:2466 +#: ../../whatsnew/3.4.rst:2465 msgid "" "The default behavior of :func:`json.dump` and :func:`json.dumps` when an " "indent is specified has changed: it no longer produces trailing spaces after " @@ -3558,7 +3559,7 @@ msgid "" "output (:issue:`16333`)." msgstr "" -#: ../../whatsnew/3.4.rst:2472 +#: ../../whatsnew/3.4.rst:2471 msgid "" ":mod:`doctest` now looks for doctests in extension module ``__doc__`` " "strings, so if your doctest test discovery includes extension modules that " @@ -3566,7 +3567,7 @@ msgid "" "never seen before when running your tests (:issue:`3158`)." msgstr "" -#: ../../whatsnew/3.4.rst:2477 +#: ../../whatsnew/3.4.rst:2476 msgid "" "The :mod:`collections.abc` module has been slightly refactored as part of " "the Python startup improvements. As a consequence of this, it is no longer " @@ -3576,11 +3577,11 @@ msgid "" "`20784`)." msgstr "" -#: ../../whatsnew/3.4.rst:2486 +#: ../../whatsnew/3.4.rst:2485 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.4.rst:2488 +#: ../../whatsnew/3.4.rst:2487 msgid "" ":c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, and :c:func:" "`PyObject_Str`, along with some other internal C APIs, now include a " @@ -3594,14 +3595,14 @@ msgid "" "version of Python that is compiled with assertions enabled." msgstr "" -#: ../../whatsnew/3.4.rst:2500 +#: ../../whatsnew/3.4.rst:2499 msgid "" ":c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** " "argument is not set. Previously only ``NULL`` was returned with no exception " "set." msgstr "" -#: ../../whatsnew/3.4.rst:2504 +#: ../../whatsnew/3.4.rst:2503 msgid "" "The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must now " "be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:" @@ -3610,30 +3611,30 @@ msgid "" "`16742`)" msgstr "" -#: ../../whatsnew/3.4.rst:2510 +#: ../../whatsnew/3.4.rst:2509 msgid "" ":c:func:`PyThread_set_key_value` now always set the value. In Python 3.3, " "the function did nothing if the key already exists (if the current value is " "a non-``NULL`` pointer)." msgstr "" -#: ../../whatsnew/3.4.rst:2514 +#: ../../whatsnew/3.4.rst:2513 msgid "" "The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject` " "structure has been removed to fix a bug: see :issue:`14432` for the " "rationale." msgstr "" -#: ../../whatsnew/3.4.rst:2519 +#: ../../whatsnew/3.4.rst:2518 msgid "Changed in 3.4.3" msgstr "3.4.3 中的變更" -#: ../../whatsnew/3.4.rst:2524 +#: ../../whatsnew/3.4.rst:2523 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/3.4.rst:2526 +#: ../../whatsnew/3.4.rst:2525 msgid "" ":mod:`http.client` and modules which use it, such as :mod:`urllib.request` " "and :mod:`xmlrpc.client`, will now verify that the server presents a " @@ -3642,13 +3643,13 @@ msgid "" "improving security for many applications." msgstr "" -#: ../../whatsnew/3.4.rst:2532 +#: ../../whatsnew/3.4.rst:2531 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/3.4.rst:2535 +#: ../../whatsnew/3.4.rst:2534 msgid "" "import urllib.request\n" "import ssl\n" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index c1c198bda7..2d895c796f 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -531,9 +531,9 @@ msgstr "" #: ../../whatsnew/3.7.rst:356 msgid "" -"`Measurements `_ show that on Linux and Windows the resolution of :func:`time." -"time_ns` is approximately 3 times better than that of :func:`time.time`." +":pep:`Measurements <0564#annex-clocks-resolution-in-python>` show that on " +"Linux and Windows the resolution of :func:`time.time_ns` is approximately 3 " +"times better than that of :func:`time.time`." msgstr "" #: ../../whatsnew/3.7.rst:362 diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 15f3d8d588..5603747792 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-09-24 07:20+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-" @@ -2783,7 +2783,7 @@ msgid "" "Starting with Python 3.3, importing ABCs from :mod:`collections` was " "deprecated, and importing should be done from :mod:`collections.abc`. Being " "able to import from collections was marked for removal in 3.8, but has been " -"delayed to 3.9. (See :issue:`36952`.)" +"delayed to 3.9. (See :gh:`81134`.)" msgstr "" #: ../../whatsnew/3.8.rst:1760 From 5a4d6813e6f9a6cf4b15f02bdf2282a74b9cdd67 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Oct 2024 16:21:33 +0000 Subject: [PATCH 02/14] sync with cpython ff0ab0eb --- c-api/buffer.po | 178 +-- c-api/exceptions.po | 8 +- c-api/init.po | 4 +- c-api/long.po | 171 +-- c-api/object.po | 14 +- c-api/type.po | 210 ++-- c-api/typeobj.po | 18 +- c-api/unicode.po | 562 +++++---- deprecations/index.po | 84 +- deprecations/pending-removal-in-3.14.po | 59 +- deprecations/pending-removal-in-3.15.po | 32 +- extending/newtypes.po | 4 +- extending/newtypes_tutorial.po | 6 +- faq/programming.po | 297 ++--- glossary.po | 12 +- howto/annotations.po | 14 +- howto/descriptor.po | 6 +- howto/enum.po | 8 +- howto/free-threading-python.po | 257 ++++ howto/index.po | 56 +- howto/mro.po | 4 +- library/abc.po | 8 +- library/argparse.po | 738 +++++------ library/ast.po | 44 +- library/asyncio-task.po | 446 ++++--- library/calendar.po | 92 +- library/cmdline.po | 35 +- library/collections.po | 80 +- library/contextvars.po | 14 +- library/datetime.po | 1146 ++++++++--------- library/email.contentmanager.po | 62 +- library/email.headerregistry.po | 4 +- library/functions.po | 811 ++++++------ library/functools.po | 151 ++- library/gc.po | 249 ++-- library/importlib.po | 256 ++-- library/inspect.po | 4 +- library/logging.po | 620 +++++----- library/os.po | 14 +- library/pydoc.po | 6 +- library/random.po | 4 +- library/secrets.po | 5 +- library/shutil.po | 211 ++-- library/signal.po | 11 +- library/stdtypes.po | 169 ++- library/string.po | 141 +-- library/test.po | 8 +- library/tomllib.po | 8 +- library/types.po | 7 +- library/typing.po | 1064 ++++++++-------- library/unittest.mock.po | 5 +- library/venv.po | 468 +++---- library/warnings.po | 12 +- reference/compound_stmts.po | 432 +++---- reference/datamodel.po | 1494 ++++++++++++----------- reference/executionmodel.po | 8 +- reference/expressions.po | 805 ++++++------ reference/import.po | 208 ++-- sphinx.po | 96 +- tutorial/classes.po | 14 +- tutorial/controlflow.po | 529 ++++---- using/mac.po | 897 ++++++++++---- whatsnew/2.1.po | 6 +- whatsnew/2.2.po | 373 +++--- whatsnew/2.3.po | 22 +- whatsnew/3.12.po | 94 +- whatsnew/3.13.po | 1476 +++++++++++----------- whatsnew/3.3.po | 1106 ++++++++--------- whatsnew/3.5.po | 11 +- whatsnew/3.6.po | 10 +- whatsnew/3.9.po | 456 +++---- 71 files changed, 9006 insertions(+), 7928 deletions(-) create mode 100644 howto/free-threading-python.po diff --git a/c-api/buffer.po b/c-api/buffer.po index fa0c60391b..1f56873111 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -341,16 +341,17 @@ msgid "" "itemsize`, :c:member:`~Py_buffer.ndim`." msgstr "" -#: ../../c-api/buffer.rst:249 +#: ../../c-api/buffer.rst:248 msgid "readonly, format" msgstr "" -#: ../../c-api/buffer.rst:253 +#: ../../c-api/buffer.rst:252 msgid "" "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " "MUST provide a writable buffer or else report failure. Otherwise, the " "exporter MAY provide either a read-only or writable buffer, but the choice " -"MUST be consistent for all consumers." +"MUST be consistent for all consumers. For example, :c:expr:`PyBUF_SIMPLE | " +"PyBUF_WRITABLE` can be used to request a simple writable buffer." msgstr "" #: ../../c-api/buffer.rst:260 @@ -369,156 +370,157 @@ msgstr "" #: ../../c-api/buffer.rst:268 msgid "" -":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:" -"`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)." +":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:" +"`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned " +"bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." msgstr "" -#: ../../c-api/buffer.rst:273 +#: ../../c-api/buffer.rst:274 msgid "shape, strides, suboffsets" msgstr "" -#: ../../c-api/buffer.rst:275 +#: ../../c-api/buffer.rst:276 msgid "" "The flags that control the logical structure of the memory are listed in " "decreasing order of complexity. Note that each flag contains all bits of the " "flags below it." msgstr "" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307 +#: ../../c-api/buffer.rst:332 msgid "Request" msgstr "" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307 +#: ../../c-api/buffer.rst:332 msgid "shape" msgstr "" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307 +#: ../../c-api/buffer.rst:332 msgid "strides" msgstr "" -#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:283 ../../c-api/buffer.rst:307 +#: ../../c-api/buffer.rst:332 msgid "suboffsets" msgstr "" -#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:286 -#: ../../c-api/buffer.rst:288 ../../c-api/buffer.rst:308 -#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 -#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:333 -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:285 ../../c-api/buffer.rst:287 +#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:309 +#: ../../c-api/buffer.rst:311 ../../c-api/buffer.rst:313 +#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:334 +#: ../../c-api/buffer.rst:336 ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346 +#: ../../c-api/buffer.rst:348 msgid "yes" msgstr "" -#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:333 -#: ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:285 ../../c-api/buffer.rst:334 +#: ../../c-api/buffer.rst:336 msgid "if needed" msgstr "" -#: ../../c-api/buffer.rst:286 ../../c-api/buffer.rst:288 -#: ../../c-api/buffer.rst:290 ../../c-api/buffer.rst:308 -#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 -#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:287 ../../c-api/buffer.rst:289 +#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:309 +#: ../../c-api/buffer.rst:311 ../../c-api/buffer.rst:313 +#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:346 +#: ../../c-api/buffer.rst:348 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:297 +#: ../../c-api/buffer.rst:298 msgid "contiguity requests" msgstr "" -#: ../../c-api/buffer.rst:299 +#: ../../c-api/buffer.rst:300 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " "must be C-contiguous." msgstr "" -#: ../../c-api/buffer.rst:306 ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:307 ../../c-api/buffer.rst:332 msgid "contig" msgstr "" -#: ../../c-api/buffer.rst:308 ../../c-api/buffer.rst:314 -#: ../../c-api/buffer.rst:345 ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:309 ../../c-api/buffer.rst:315 +#: ../../c-api/buffer.rst:346 ../../c-api/buffer.rst:348 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:310 +#: ../../c-api/buffer.rst:311 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:313 msgid "C or F" msgstr "C 或 F" -#: ../../c-api/buffer.rst:314 +#: ../../c-api/buffer.rst:315 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:320 msgid "compound requests" msgstr "" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:322 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " "frequently used combinations as single flags." msgstr "" -#: ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:326 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:332 msgid "readonly" msgstr "" -#: ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:332 msgid "format" msgstr "" -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 ../../c-api/buffer.rst:339 -#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:343 +#: ../../c-api/buffer.rst:334 ../../c-api/buffer.rst:336 +#: ../../c-api/buffer.rst:338 ../../c-api/buffer.rst:340 +#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:344 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 -#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:334 ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:346 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:339 -#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:336 ../../c-api/buffer.rst:340 +#: ../../c-api/buffer.rst:344 ../../c-api/buffer.rst:348 msgid "1 or 0" msgstr "1 或 0" -#: ../../c-api/buffer.rst:352 +#: ../../c-api/buffer.rst:353 msgid "Complex arrays" msgstr "" -#: ../../c-api/buffer.rst:355 +#: ../../c-api/buffer.rst:356 msgid "NumPy-style: shape and strides" msgstr "" -#: ../../c-api/buffer.rst:357 +#: ../../c-api/buffer.rst:358 msgid "" "The logical structure of NumPy-style arrays is defined by :c:member:" "`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." "shape` and :c:member:`~Py_buffer.strides`." msgstr "" -#: ../../c-api/buffer.rst:360 +#: ../../c-api/buffer.rst:361 msgid "" "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer." "buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In " @@ -526,14 +528,14 @@ msgid "" "strides` are ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:365 msgid "" "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " "standard n-dimensional C-array. Otherwise, the consumer must access an n-" "dimensional array as follows:" msgstr "" -#: ../../c-api/buffer.rst:368 +#: ../../c-api/buffer.rst:369 msgid "" "ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " "strides[n-1];\n" @@ -543,14 +545,14 @@ msgstr "" "strides[n-1];\n" "item = *((typeof(item) *)ptr);" -#: ../../c-api/buffer.rst:374 +#: ../../c-api/buffer.rst:375 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " "the actual memory block. An exporter can check the validity of a buffer with " "this function:" msgstr "" -#: ../../c-api/buffer.rst:378 +#: ../../c-api/buffer.rst:379 msgid "" "def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" " \"\"\"Verify that the parameters represent a valid array within\n" @@ -579,11 +581,11 @@ msgid "" " return 0 <= offset+imin and offset+imax+itemsize <= memlen" msgstr "" -#: ../../c-api/buffer.rst:408 +#: ../../c-api/buffer.rst:409 msgid "PIL-style: shape, strides and suboffsets" msgstr "" -#: ../../c-api/buffer.rst:410 +#: ../../c-api/buffer.rst:411 msgid "" "In addition to the regular items, PIL-style arrays can contain pointers that " "must be followed in order to get to the next element in a dimension. For " @@ -594,14 +596,14 @@ msgid "" "x[2][3]`` arrays that can be located anywhere in memory." msgstr "" -#: ../../c-api/buffer.rst:419 +#: ../../c-api/buffer.rst:420 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-``NULL`` " "strides and suboffsets::" msgstr "" -#: ../../c-api/buffer.rst:423 +#: ../../c-api/buffer.rst:424 msgid "" "void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" " Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n" @@ -629,25 +631,25 @@ msgstr "" " return (void*)pointer;\n" "}" -#: ../../c-api/buffer.rst:438 +#: ../../c-api/buffer.rst:439 msgid "Buffer-related functions" msgstr "" -#: ../../c-api/buffer.rst:442 +#: ../../c-api/buffer.rst:443 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. This function always succeeds." msgstr "" -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:450 msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " "the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" "`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/buffer.rst:454 +#: ../../c-api/buffer.rst:455 msgid "" "On success, fill in *view*, set ``view->obj`` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " @@ -655,7 +657,7 @@ msgid "" "instead of *exporter* (See :ref:`Buffer Object Structures `)." msgstr "" -#: ../../c-api/buffer.rst:459 +#: ../../c-api/buffer.rst:460 msgid "" "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " "to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:" @@ -663,7 +665,7 @@ msgid "" "`PyBuffer_Release` must be called exactly once." msgstr "" -#: ../../c-api/buffer.rst:467 +#: ../../c-api/buffer.rst:468 msgid "" "Release the buffer *view* and release the :term:`strong reference` (i.e. " "decrement the reference count) to the view's supporting object, ``view-" @@ -671,19 +673,19 @@ msgid "" "used, otherwise reference leaks may occur." msgstr "" -#: ../../c-api/buffer.rst:472 +#: ../../c-api/buffer.rst:473 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../c-api/buffer.rst:478 +#: ../../c-api/buffer.rst:479 msgid "" "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:486 +#: ../../c-api/buffer.rst:487 msgid "" "Return ``1`` if the memory defined by the *view* is C-style (*order* is " "``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " @@ -691,69 +693,69 @@ msgid "" "succeeds." msgstr "" -#: ../../c-api/buffer.rst:493 +#: ../../c-api/buffer.rst:494 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." msgstr "" -#: ../../c-api/buffer.rst:499 +#: ../../c-api/buffer.rst:500 msgid "" "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " "``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " "success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:506 +#: ../../c-api/buffer.rst:507 msgid "" "Copy *len* bytes from *src* to its contiguous representation in *buf*. " "*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " "ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:510 +#: ../../c-api/buffer.rst:511 msgid "This function fails if *len* != *src->len*." msgstr "" -#: ../../c-api/buffer.rst:515 +#: ../../c-api/buffer.rst:516 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." msgstr "" -#: ../../c-api/buffer.rst:518 +#: ../../c-api/buffer.rst:519 msgid "``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:522 +#: ../../c-api/buffer.rst:523 msgid "" "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " "if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" -#: ../../c-api/buffer.rst:529 +#: ../../c-api/buffer.rst:530 msgid "" "Handle buffer requests for an exporter that wants to expose *buf* of size " "*len* with writability set according to *readonly*. *buf* is interpreted as " "a sequence of unsigned bytes." msgstr "" -#: ../../c-api/buffer.rst:533 +#: ../../c-api/buffer.rst:534 msgid "" "The *flags* argument indicates the request type. This function always fills " "in *view* as specified by flags, unless *buf* has been designated as read-" "only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" -#: ../../c-api/buffer.rst:537 +#: ../../c-api/buffer.rst:538 msgid "" "On success, set ``view->obj`` to a new reference to *exporter* and return 0. " "Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " "return ``-1``;" msgstr "" -#: ../../c-api/buffer.rst:541 +#: ../../c-api/buffer.rst:542 msgid "" "If this function is used as part of a :ref:`getbufferproc `, " "*exporter* MUST be set to the exporting object and *flags* must be passed " @@ -780,14 +782,14 @@ msgstr "buffer object(緩衝物件)" msgid "PyBufferProcs (C type)" msgstr "PyBufferProcs(C 型別)" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:295 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:295 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../c-api/buffer.rst:294 +#: ../../c-api/buffer.rst:295 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 8f5b81bb6c..d742b185ef 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -784,9 +784,9 @@ msgstr "" #: ../../c-api/exceptions.rst:736 msgid "" -"The :attr:`!__module__` attribute of the new class is set to the first part " -"(up to the last dot) of the *name* argument, and the class name is set to " -"the last part (after the last dot). The *base* argument can be used to " +"The :attr:`~type.__module__` attribute of the new class is set to the first " +"part (up to the last dot) of the *name* argument, and the class name is set " +"to the last part (after the last dot). The *base* argument can be used to " "specify alternate base classes; it can either be only one class or a tuple " "of classes. The *dict* argument can be used to specify a dictionary of class " "variables and methods." diff --git a/c-api/init.po b/c-api/init.po index 9ca9aecb98..470d303142 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1470,7 +1470,7 @@ msgstr "" #: ../../c-api/init.rst:1220 msgid "" "Destroy the current thread state and release the global interpreter lock. " -"Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " +"Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" diff --git a/c-api/long.po b/c-api/long.po index 2393cf7855..b09383a50c 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -166,41 +166,52 @@ msgid "" "most-significant bit is not a sign bit. Flags other than endian are ignored." msgstr "" -#: ../../c-api/long.rst:149 ../../c-api/long.rst:175 +#: ../../c-api/long.rst:148 ../../c-api/long.rst:184 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* 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:153 +#: ../../c-api/long.rst:152 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long`." msgstr "" -#: ../../c-api/long.rst:156 ../../c-api/long.rst:184 ../../c-api/long.rst:205 -#: ../../c-api/long.rst:225 ../../c-api/long.rst:248 +#: ../../c-api/long.rst:155 ../../c-api/long.rst:193 ../../c-api/long.rst:214 +#: ../../c-api/long.rst:234 ../../c-api/long.rst:257 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:158 ../../c-api/long.rst:186 ../../c-api/long.rst:207 -#: ../../c-api/long.rst:229 ../../c-api/long.rst:313 ../../c-api/long.rst:333 +#: ../../c-api/long.rst:157 ../../c-api/long.rst:195 ../../c-api/long.rst:216 +#: ../../c-api/long.rst:238 ../../c-api/long.rst:322 ../../c-api/long.rst:342 msgid "Use :meth:`~object.__index__` if available." msgstr "" -#: ../../c-api/long.rst:161 ../../c-api/long.rst:189 ../../c-api/long.rst:210 -#: ../../c-api/long.rst:232 ../../c-api/long.rst:316 ../../c-api/long.rst:336 +#: ../../c-api/long.rst:160 ../../c-api/long.rst:198 ../../c-api/long.rst:219 +#: ../../c-api/long.rst:241 ../../c-api/long.rst:325 ../../c-api/long.rst:345 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" #: ../../c-api/long.rst:167 msgid "" +"A :term:`soft deprecated` alias. Exactly equivalent to the preferred " +"``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or " +"another exception." +msgstr "" + +#: ../../c-api/long.rst:171 +msgid "The function is soft deprecated." +msgstr "" + +#: ../../c-api/long.rst:176 +msgid "" "Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" "`int` instead of a C :c:expr:`long`." msgstr "" -#: ../../c-api/long.rst:179 +#: ../../c-api/long.rst:188 msgid "" "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 " @@ -208,20 +219,20 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:198 ../../c-api/long.rst:216 +#: ../../c-api/long.rst:207 ../../c-api/long.rst:225 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:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:202 +#: ../../c-api/long.rst:211 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long long`." msgstr "" -#: ../../c-api/long.rst:220 +#: ../../c-api/long.rst:229 msgid "" "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 " @@ -229,133 +240,133 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:242 +#: ../../c-api/long.rst:251 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:245 +#: ../../c-api/long.rst:254 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:257 +#: ../../c-api/long.rst:266 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:260 +#: ../../c-api/long.rst:269 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:263 +#: ../../c-api/long.rst:272 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:273 +#: ../../c-api/long.rst:282 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:276 +#: ../../c-api/long.rst:285 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: ../../c-api/long.rst:279 +#: ../../c-api/long.rst:288 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:288 +#: ../../c-api/long.rst:297 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:291 +#: ../../c-api/long.rst:300 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:294 +#: ../../c-api/long.rst:303 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:297 +#: ../../c-api/long.rst:306 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:303 +#: ../../c-api/long.rst:312 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:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:307 +#: ../../c-api/long.rst:316 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:310 +#: ../../c-api/long.rst:319 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:322 +#: ../../c-api/long.rst:331 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:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:327 +#: ../../c-api/long.rst:336 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:330 +#: ../../c-api/long.rst:339 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:342 +#: ../../c-api/long.rst:351 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:345 +#: ../../c-api/long.rst:354 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`double`." msgstr "" -#: ../../c-api/long.rst:348 +#: ../../c-api/long.rst:357 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:353 +#: ../../c-api/long.rst:362 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 " @@ -363,33 +374,33 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:358 +#: ../../c-api/long.rst:367 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:363 +#: ../../c-api/long.rst:372 msgid "" "Copy the Python integer value *pylong* to a native *buffer* of size " "*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, " "or to values documented below to control the behavior." msgstr "" -#: ../../c-api/long.rst:367 +#: ../../c-api/long.rst:376 msgid "" "Returns ``-1`` with an exception raised on error. This may happen if " "*pylong* cannot be interpreted as an integer, or if *pylong* was negative " "and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." msgstr "" -#: ../../c-api/long.rst:371 +#: ../../c-api/long.rst:380 msgid "" "Otherwise, returns the number of bytes required to store the value. If this " "is equal to or less than *n_bytes*, the entire value was copied. All " "*n_bytes* of the buffer are written: large buffers are padded with zeroes." msgstr "" -#: ../../c-api/long.rst:376 +#: ../../c-api/long.rst:385 msgid "" "If the returned value is greater than than *n_bytes*, the value was " "truncated: as many of the lowest bits of the value as could fit are written, " @@ -397,25 +408,25 @@ msgid "" "style downcast." msgstr "" -#: ../../c-api/long.rst:383 +#: ../../c-api/long.rst:392 msgid "" "Overflow is not considered an error. If the returned value is larger than " "*n_bytes*, most significant bits were discarded." msgstr "" -#: ../../c-api/long.rst:386 +#: ../../c-api/long.rst:395 msgid "``0`` will never be returned." msgstr "" -#: ../../c-api/long.rst:388 +#: ../../c-api/long.rst:397 msgid "Values are always copied as two's-complement." msgstr "" -#: ../../c-api/long.rst:390 +#: ../../c-api/long.rst:399 msgid "Usage example::" msgstr "" -#: ../../c-api/long.rst:392 +#: ../../c-api/long.rst:401 msgid "" "int32_t value;\n" "Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n" @@ -432,26 +443,26 @@ msgid "" "}" msgstr "" -#: ../../c-api/long.rst:406 +#: ../../c-api/long.rst:415 msgid "" "Passing zero to *n_bytes* will return the size of a buffer that would be " "large enough to hold the value. This may be larger than technically " "necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``." msgstr "" -#: ../../c-api/long.rst:413 +#: ../../c-api/long.rst:422 msgid "" "Passing *n_bytes=0* to this function is not an accurate way to determine the " "bit length of the value." msgstr "" -#: ../../c-api/long.rst:416 +#: ../../c-api/long.rst:425 msgid "" "To get at the entire Python value of an unknown size, the function can be " "called twice: first to determine the buffer size, then to fill it::" msgstr "" -#: ../../c-api/long.rst:419 +#: ../../c-api/long.rst:428 msgid "" "// Ask how much space we need.\n" "Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n" @@ -482,69 +493,69 @@ msgid "" "free(bignum);" msgstr "" -#: ../../c-api/long.rst:447 +#: ../../c-api/long.rst:456 msgid "" "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " "that behave most like a C cast, or a combintation of the other flags in the " "table below. Note that ``-1`` cannot be combined with other flags." msgstr "" -#: ../../c-api/long.rst:452 +#: ../../c-api/long.rst:461 msgid "" "Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " "Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:467 msgid "Flag" msgstr "" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:467 msgid "Value" msgstr "" -#: ../../c-api/long.rst:460 +#: ../../c-api/long.rst:469 msgid "``-1``" msgstr "" -#: ../../c-api/long.rst:461 +#: ../../c-api/long.rst:470 msgid "``0``" msgstr "" -#: ../../c-api/long.rst:462 +#: ../../c-api/long.rst:471 msgid "``1``" msgstr "" -#: ../../c-api/long.rst:463 +#: ../../c-api/long.rst:472 msgid "``3``" msgstr "" -#: ../../c-api/long.rst:464 +#: ../../c-api/long.rst:473 msgid "``4``" msgstr "" -#: ../../c-api/long.rst:465 +#: ../../c-api/long.rst:474 msgid "``8``" msgstr "" -#: ../../c-api/long.rst:466 +#: ../../c-api/long.rst:475 msgid "``16``" msgstr "" -#: ../../c-api/long.rst:469 +#: ../../c-api/long.rst:478 msgid "" "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " "flags. Passing ``2`` is reserved." msgstr "" -#: ../../c-api/long.rst:472 +#: ../../c-api/long.rst:481 msgid "" "By default, sufficient buffer will be requested to include a sign bit. For " "example, when converting 128 with *n_bytes=1*, the function will return 2 " "(or more) in order to store a zero sign bit." msgstr "" -#: ../../c-api/long.rst:476 +#: ../../c-api/long.rst:485 msgid "" "If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " "be omitted from size calculations. This allows, for example, 128 to fit in a " @@ -554,7 +565,7 @@ msgid "" "requested." msgstr "" -#: ../../c-api/long.rst:483 +#: ../../c-api/long.rst:492 msgid "" "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " "set if *pylong* is negative. Without this flag, negative values will be " @@ -562,7 +573,7 @@ msgid "" "of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" -#: ../../c-api/long.rst:488 +#: ../../c-api/long.rst:497 msgid "" "If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " "passed, its :meth:`~object.__index__` method will be called first. This may " @@ -572,7 +583,7 @@ msgid "" "`TypeError`." msgstr "" -#: ../../c-api/long.rst:497 +#: ../../c-api/long.rst:506 msgid "" "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " "*REJECT_NEGATIVE*), multiple Python integers can map to a single value " @@ -580,22 +591,22 @@ msgid "" "buffer and set all its bits. This matches typical C cast behavior." msgstr "" -#: ../../c-api/long.rst:508 +#: ../../c-api/long.rst:517 msgid "" "On success, return a read only :term:`named tuple`, that holds information " "about Python's internal representation of integers. See :data:`sys.int_info` " "for description of individual fields." msgstr "" -#: ../../c-api/long.rst:512 +#: ../../c-api/long.rst:521 msgid "On failure, return ``NULL`` with an exception set." msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。" -#: ../../c-api/long.rst:519 +#: ../../c-api/long.rst:528 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:521 +#: ../../c-api/long.rst:530 msgid "" "This function makes it possible for performance-critical code to implement a " "“fast path” for small integers. For compact values use :c:func:" @@ -603,23 +614,23 @@ msgid "" "`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." msgstr "" -#: ../../c-api/long.rst:527 +#: ../../c-api/long.rst:536 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:529 +#: ../../c-api/long.rst:538 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:534 +#: ../../c-api/long.rst:543 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:537 +#: ../../c-api/long.rst:546 msgid "Otherwise, the return value is undefined." msgstr "" @@ -635,23 +646,23 @@ msgstr "long integer(長整数)" msgid "integer" msgstr "integer(整数)" -#: ../../c-api/long.rst:145 +#: ../../c-api/long.rst:144 msgid "LONG_MAX (C macro)" msgstr "LONG_MAX(C 巨集)" -#: ../../c-api/long.rst:145 ../../c-api/long.rst:195 ../../c-api/long.rst:238 -#: ../../c-api/long.rst:253 ../../c-api/long.rst:269 ../../c-api/long.rst:285 +#: ../../c-api/long.rst:144 ../../c-api/long.rst:204 ../../c-api/long.rst:247 +#: ../../c-api/long.rst:262 ../../c-api/long.rst:278 ../../c-api/long.rst:294 msgid "OverflowError (built-in exception)" msgstr "OverflowError(内建例外)" -#: ../../c-api/long.rst:238 +#: ../../c-api/long.rst:247 msgid "PY_SSIZE_T_MAX (C macro)" msgstr "PY_SSIZE_T_MAX(C 巨集)" -#: ../../c-api/long.rst:253 +#: ../../c-api/long.rst:262 msgid "ULONG_MAX (C macro)" msgstr "ULONG_MAX(C 巨集)" -#: ../../c-api/long.rst:269 +#: ../../c-api/long.rst:278 msgid "SIZE_MAX (C macro)" msgstr "SIZE_MAX(C 巨集)" diff --git a/c-api/object.po b/c-api/object.po index a672a4c44f..c0cc1ced33 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -477,17 +477,17 @@ msgstr "" #: ../../c-api/object.rst:370 msgid "" -"If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " +"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*derived* is a subclass of *cls* if it is a direct or indirect subclass, i." -"e. contained in ``cls.__mro__``." +"e. contained in :attr:`cls.__mro__ `." msgstr "" #: ../../c-api/object.rst:375 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:`~class.__bases__` attribute (which must be a tuple of base classes)." +"a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." msgstr "" #: ../../c-api/object.rst:382 @@ -498,7 +498,7 @@ msgstr "" #: ../../c-api/object.rst:389 msgid "" -"If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " +"If *cls* has a :meth:`~type.__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 "" @@ -506,13 +506,13 @@ msgstr "" #: ../../c-api/object.rst:393 msgid "" "An instance *inst* can override what is considered its class by having a :" -"attr:`~instance.__class__` attribute." +"attr:`~object.__class__` attribute." msgstr "" #: ../../c-api/object.rst:396 msgid "" "An object *cls* can override if it is considered a class, and what its base " -"classes are, by having a :attr:`~class.__bases__` attribute (which must be a " +"classes are, by having a :attr:`~type.__bases__` attribute (which must be a " "tuple of base classes)." msgstr "" diff --git a/c-api/type.po b/c-api/type.po index 0cba8494b9..d812aec5bf 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -65,32 +65,32 @@ msgstr "" #: ../../c-api/type.rst:55 msgid "" "Return the type object's internal namespace, which is otherwise only exposed " -"via a read-only proxy (``cls.__dict__``). This is a replacement for " -"accessing :c:member:`~PyTypeObject.tp_dict` directly. The returned " -"dictionary must be treated as read-only." +"via a read-only proxy (:attr:`cls.__dict__ `). This is a " +"replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly. The " +"returned dictionary must be treated as read-only." msgstr "" -#: ../../c-api/type.rst:60 +#: ../../c-api/type.rst:61 msgid "" "This function is meant for specific embedding and language-binding cases, " "where direct access to the dict is necessary and indirect access (e.g. via " "the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." msgstr "" -#: ../../c-api/type.rst:64 +#: ../../c-api/type.rst:65 msgid "" "Extension modules should continue to use ``tp_dict``, directly or " "indirectly, when setting up their own types." msgstr "" -#: ../../c-api/type.rst:72 +#: ../../c-api/type.rst:73 msgid "" "Invalidate the internal lookup cache for the type and all of its subtypes. " "This function must be called after any manual modification of the attributes " "or base classes of the type." msgstr "" -#: ../../c-api/type.rst:79 +#: ../../c-api/type.rst:80 msgid "" "Register *callback* as a type watcher. Return a non-negative integer ID " "which must be passed to future calls to :c:func:`PyType_Watch`. In case of " @@ -98,21 +98,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/type.rst:89 +#: ../../c-api/type.rst:90 msgid "" "Clear watcher identified by *watcher_id* (previously returned from :c:func:" "`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " "*watcher_id* was never registered.)" msgstr "" -#: ../../c-api/type.rst:93 +#: ../../c-api/type.rst:94 msgid "" "An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " "that was not returned to it by a previous call to :c:func:" "`PyType_AddWatcher`." msgstr "" -#: ../../c-api/type.rst:102 +#: ../../c-api/type.rst:103 msgid "" "Mark *type* as watched. The callback granted *watcher_id* by :c:func:" "`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " @@ -122,61 +122,61 @@ msgid "" "detail and subject to change.)" msgstr "" -#: ../../c-api/type.rst:109 +#: ../../c-api/type.rst:110 msgid "" "An extension should never call ``PyType_Watch`` with a *watcher_id* that was " "not returned to it by a previous call to :c:func:`PyType_AddWatcher`." msgstr "" -#: ../../c-api/type.rst:117 +#: ../../c-api/type.rst:118 msgid "Type of a type-watcher callback function." msgstr "" -#: ../../c-api/type.rst:119 +#: ../../c-api/type.rst:120 msgid "" "The callback must not modify *type* or cause :c:func:`PyType_Modified` to be " "called on *type* or any type in its MRO; violating this rule could cause " "infinite recursion." msgstr "" -#: ../../c-api/type.rst:128 +#: ../../c-api/type.rst:129 msgid "" "Return non-zero if the type object *o* sets the feature *feature*. Type " "features are denoted by single bit flags." msgstr "" -#: ../../c-api/type.rst:134 +#: ../../c-api/type.rst:135 msgid "" "Return true if the type object includes support for the cycle detector; this " "tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" -#: ../../c-api/type.rst:140 +#: ../../c-api/type.rst:141 msgid "Return true if *a* is a subtype of *b*." msgstr "" -#: ../../c-api/type.rst:142 +#: ../../c-api/type.rst:143 msgid "" -"This function only checks for actual subtypes, which means that :meth:" -"`~class.__subclasscheck__` is not called on *b*. Call :c:func:" -"`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do." +"This function only checks for actual subtypes, which means that :meth:`~type." +"__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` " +"to do the same check that :func:`issubclass` would do." msgstr "" -#: ../../c-api/type.rst:150 +#: ../../c-api/type.rst:151 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " "object. Use Python's default memory allocation mechanism to allocate a new " "instance and initialize all its contents to ``NULL``." msgstr "" -#: ../../c-api/type.rst:156 +#: ../../c-api/type.rst:157 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " "object. Create a new instance using the type's :c:member:`~PyTypeObject." "tp_alloc` slot." msgstr "" -#: ../../c-api/type.rst:161 +#: ../../c-api/type.rst:162 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -184,7 +184,7 @@ msgid "" "and sets an exception on error." msgstr "" -#: ../../c-api/type.rst:167 +#: ../../c-api/type.rst:168 msgid "" "If some of the base classes implements the GC protocol and the provided type " "does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " @@ -195,32 +195,32 @@ msgid "" "handle." msgstr "" -#: ../../c-api/type.rst:177 +#: ../../c-api/type.rst:178 msgid "" -"Return the type's name. Equivalent to getting the type's ``__name__`` " -"attribute." +"Return the type's name. Equivalent to getting the type's :attr:`~type." +"__name__` attribute." msgstr "" -#: ../../c-api/type.rst:183 +#: ../../c-api/type.rst:185 msgid "" -"Return the type's qualified name. Equivalent to getting the type's " -"``__qualname__`` attribute." +"Return the type's qualified name. Equivalent to getting the type's :attr:" +"`~type.__qualname__` attribute." msgstr "" -#: ../../c-api/type.rst:190 +#: ../../c-api/type.rst:192 msgid "" "Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}." -"{type.__qualname__}\"``, or ``type.__qualname__`` if ``type.__module__`` is " -"not a string or is equal to ``\"builtins\"``." +"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type." +"__module__` is not a string or is equal to ``\"builtins\"``." msgstr "" -#: ../../c-api/type.rst:198 +#: ../../c-api/type.rst:200 msgid "" -"Return the type's module name. Equivalent to getting the ``type.__module__`` " -"attribute." +"Return the type's module name. Equivalent to getting the :attr:`type." +"__module__` attribute." msgstr "" -#: ../../c-api/type.rst:205 +#: ../../c-api/type.rst:207 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -228,30 +228,30 @@ msgid "" "result pointer into the appropriate function type." msgstr "" -#: ../../c-api/type.rst:211 +#: ../../c-api/type.rst:213 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: ../../c-api/type.rst:215 +#: ../../c-api/type.rst:217 msgid "" ":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " "limited to :ref:`heap types `." msgstr "" -#: ../../c-api/type.rst:221 +#: ../../c-api/type.rst:223 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/type.rst:224 ../../c-api/type.rst:244 +#: ../../c-api/type.rst:226 ../../c-api/type.rst:246 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:227 +#: ../../c-api/type.rst:229 msgid "" "This function is usually used to get the module in which a method is " "defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " @@ -262,31 +262,31 @@ msgid "" "type:`!PyCMethod` cannot be used." msgstr "" -#: ../../c-api/type.rst:240 +#: ../../c-api/type.rst:242 msgid "" "Return the state of the module object associated with the given type. This " "is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" "func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:247 +#: ../../c-api/type.rst:249 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: ../../c-api/type.rst:254 +#: ../../c-api/type.rst:256 msgid "" "Find the first superclass whose module was created from the given :c:type:" "`PyModuleDef` *def*, and return that module." msgstr "" -#: ../../c-api/type.rst:257 +#: ../../c-api/type.rst:259 msgid "" "If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:259 +#: ../../c-api/type.rst:261 msgid "" "This function is intended to be used together with :c:func:" "`PyModule_GetState()` to get module state from slot methods (such as :c:" @@ -295,40 +295,40 @@ msgid "" "type:`PyCMethod` calling convention." msgstr "" -#: ../../c-api/type.rst:269 +#: ../../c-api/type.rst:271 msgid "Attempt to assign a version tag to the given type." msgstr "" -#: ../../c-api/type.rst:271 +#: ../../c-api/type.rst:273 msgid "" "Returns 1 if the type already had a valid version tag or a new one was " "assigned, or 0 if a new tag could not be assigned." msgstr "" -#: ../../c-api/type.rst:278 +#: ../../c-api/type.rst:280 msgid "Creating Heap-Allocated Types" msgstr "" -#: ../../c-api/type.rst:280 +#: ../../c-api/type.rst:282 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: ../../c-api/type.rst:285 +#: ../../c-api/type.rst:287 msgid "" "Create and return a :ref:`heap type ` from the *spec* (see :c:" "macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" -#: ../../c-api/type.rst:288 +#: ../../c-api/type.rst:290 msgid "" "The metaclass *metaclass* is used to construct the resulting type object. " "When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " "*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." msgstr "" -#: ../../c-api/type.rst:292 +#: ../../c-api/type.rst:294 msgid "" "Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " "supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, " @@ -337,7 +337,7 @@ msgid "" "deprecated and in Python 3.14+ such metaclasses will not be supported.)" msgstr "" -#: ../../c-api/type.rst:299 +#: ../../c-api/type.rst:301 msgid "" "The *bases* argument can be used to specify base classes; it can either be " "only one class or a tuple of classes. If *bases* is ``NULL``, the " @@ -346,7 +346,7 @@ msgid "" "derives from :class:`object`." msgstr "" -#: ../../c-api/type.rst:305 +#: ../../c-api/type.rst:307 msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " @@ -355,11 +355,11 @@ msgid "" "subclasses; it must be specified for each class individually." msgstr "" -#: ../../c-api/type.rst:312 +#: ../../c-api/type.rst:314 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: ../../c-api/type.rst:314 +#: ../../c-api/type.rst:316 msgid "" "Note that this function does *not* fully match the behavior of calling :py:" "class:`type() ` or using the :keyword:`class` statement. With user-" @@ -368,41 +368,41 @@ msgid "" "Specifically:" msgstr "" -#: ../../c-api/type.rst:321 +#: ../../c-api/type.rst:323 msgid "" ":py:meth:`~object.__new__` is not called on the new class (and it must be " "set to ``type.__new__``)." msgstr "" -#: ../../c-api/type.rst:323 +#: ../../c-api/type.rst:325 msgid ":py:meth:`~object.__init__` is not called on the new class." msgstr "" -#: ../../c-api/type.rst:324 +#: ../../c-api/type.rst:326 msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." msgstr "" -#: ../../c-api/type.rst:325 +#: ../../c-api/type.rst:327 msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." msgstr "" -#: ../../c-api/type.rst:331 +#: ../../c-api/type.rst:333 msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, module, spec, bases)``。" -#: ../../c-api/type.rst:337 +#: ../../c-api/type.rst:339 msgid "" "The function now accepts a single class as the *bases* argument and ``NULL`` " "as the ``tp_doc`` slot." msgstr "" -#: ../../c-api/type.rst:342 ../../c-api/type.rst:359 +#: ../../c-api/type.rst:344 ../../c-api/type.rst:361 msgid "" "The function now finds and uses a metaclass corresponding to the provided " "base classes. Previously, only :class:`type` instances were returned." msgstr "" -#: ../../c-api/type.rst:345 ../../c-api/type.rst:362 ../../c-api/type.rst:378 +#: ../../c-api/type.rst:347 ../../c-api/type.rst:364 ../../c-api/type.rst:380 msgid "" "The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " "may result in incomplete initialization. Creating classes whose metaclass " @@ -410,42 +410,42 @@ msgid "" "it will be no longer allowed." msgstr "" -#: ../../c-api/type.rst:353 +#: ../../c-api/type.rst:355 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, bases)``。" -#: ../../c-api/type.rst:370 +#: ../../c-api/type.rst:372 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``。" -#: ../../c-api/type.rst:374 +#: ../../c-api/type.rst:376 msgid "" "The function now finds and uses a metaclass corresponding to the base " "classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " "instances were returned." msgstr "" -#: ../../c-api/type.rst:395 +#: ../../c-api/type.rst:397 msgid "Structure defining a type's behavior." msgstr "" -#: ../../c-api/type.rst:399 +#: ../../c-api/type.rst:401 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: ../../c-api/type.rst:403 +#: ../../c-api/type.rst:405 msgid "" "If positive, specifies the size of the instance in bytes. It is used to set :" "c:member:`PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/type.rst:406 +#: ../../c-api/type.rst:408 msgid "" "If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " "inherited." msgstr "" -#: ../../c-api/type.rst:409 +#: ../../c-api/type.rst:411 msgid "" "If negative, the absolute value specifies how much space instances of the " "class need *in addition* to the superclass. Use :c:func:" @@ -453,17 +453,17 @@ msgid "" "this way." msgstr "" -#: ../../c-api/type.rst:416 +#: ../../c-api/type.rst:418 msgid "Previously, this field could not be negative." msgstr "" -#: ../../c-api/type.rst:420 +#: ../../c-api/type.rst:422 msgid "" "Size of one element of a variable-size type, in bytes. Used to set :c:member:" "`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." msgstr "" -#: ../../c-api/type.rst:424 +#: ../../c-api/type.rst:426 msgid "" "If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " "arbitrary variable-sized classes is dangerous, since some types use a fixed " @@ -472,58 +472,58 @@ msgid "" "only possible in the following situations:" msgstr "" -#: ../../c-api/type.rst:431 +#: ../../c-api/type.rst:433 msgid "" "The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." msgstr "" -#: ../../c-api/type.rst:433 +#: ../../c-api/type.rst:435 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " "the memory layout of the base class is known." msgstr "" -#: ../../c-api/type.rst:435 +#: ../../c-api/type.rst:437 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " "subclass does not access the instance's memory directly." msgstr "" -#: ../../c-api/type.rst:438 +#: ../../c-api/type.rst:440 msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." msgstr "" -#: ../../c-api/type.rst:442 +#: ../../c-api/type.rst:444 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: ../../c-api/type.rst:444 +#: ../../c-api/type.rst:446 msgid "" "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" "`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: ../../c-api/type.rst:449 +#: ../../c-api/type.rst:451 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: ../../c-api/type.rst:452 +#: ../../c-api/type.rst:454 msgid "Each slot ID should be specified at most once." msgstr "" -#: ../../c-api/type.rst:462 +#: ../../c-api/type.rst:464 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: ../../c-api/type.rst:467 +#: ../../c-api/type.rst:469 msgid "A slot ID." msgstr "" -#: ../../c-api/type.rst:469 +#: ../../c-api/type.rst:471 msgid "" "Slot IDs are named like the field names of the structures :c:type:" "`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" @@ -531,30 +531,30 @@ msgid "" "prefix. For example, use:" msgstr "" -#: ../../c-api/type.rst:475 +#: ../../c-api/type.rst:477 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: ../../c-api/type.rst:476 +#: ../../c-api/type.rst:478 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: ../../c-api/type.rst:477 +#: ../../c-api/type.rst:479 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: ../../c-api/type.rst:479 +#: ../../c-api/type.rst:481 msgid "" "The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:481 +#: ../../c-api/type.rst:483 msgid "" ":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" msgstr "" -#: ../../c-api/type.rst:483 +#: ../../c-api/type.rst:485 msgid "" ":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_DICT` instead if possible)" @@ -562,7 +562,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:" "`Py_TPFLAGS_MANAGED_DICT`)" -#: ../../c-api/type.rst:485 +#: ../../c-api/type.rst:487 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " "``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" @@ -570,7 +570,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef " "` 中的 ``\"__vectorcalloffset__\"``)" -#: ../../c-api/type.rst:489 +#: ../../c-api/type.rst:491 msgid "" "If it is not possible to switch to a ``MANAGED`` flag (for example, for " "vectorcall or to support Python older than 3.12), specify the offset in :c:" @@ -578,48 +578,48 @@ msgid "" "documentation ` for details." msgstr "" -#: ../../c-api/type.rst:495 +#: ../../c-api/type.rst:497 msgid "The following fields cannot be set at all when creating a heap type:" msgstr "" -#: ../../c-api/type.rst:497 +#: ../../c-api/type.rst:499 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." "tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" msgstr "" -#: ../../c-api/type.rst:501 +#: ../../c-api/type.rst:503 msgid "" "Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." "tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." "tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/type.rst:508 +#: ../../c-api/type.rst:510 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:515 +#: ../../c-api/type.rst:517 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:517 +#: ../../c-api/type.rst:519 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:524 +#: ../../c-api/type.rst:526 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:527 +#: ../../c-api/type.rst:529 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index a19d40c885..e5bbf105aa 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -1410,15 +1410,15 @@ msgstr "" msgid "" "For :ref:`statically allocated type objects `, the *tp_name* " "field should contain a dot. Everything before the last dot is made " -"accessible as the :attr:`__module__` attribute, and everything after the " -"last dot is made accessible as the :attr:`~definition.__name__` attribute." +"accessible as the :attr:`~type.__module__` attribute, and everything after " +"the last dot is made accessible as the :attr:`~type.__name__` attribute." msgstr "" #: ../../c-api/typeobj.rst:574 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " -"made accessible as the :attr:`~definition.__name__` attribute, and the :attr:" -"`__module__` attribute is undefined (unless explicitly set in the " +"made accessible as the :attr:`~type.__name__` attribute, and the :attr:" +"`~type.__module__` attribute is undefined (unless explicitly set in the " "dictionary, as explained above). This means your type will be impossible to " "pickle. Additionally, it will not be listed in module documentations " "created with pydoc." @@ -2109,7 +2109,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1134 msgid "" -"This bit indicates that instances of the class have a ``__dict__`` " +"This bit indicates that instances of the class have a `~object.__dict__` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" @@ -2310,8 +2310,8 @@ msgstr "" #: ../../c-api/typeobj.rst:1337 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." +"this type object. This is exposed as the :attr:`~type.__doc__` attribute on " +"the type and instances of the type." msgstr "" #: ../../c-api/typeobj.rst:1343 @@ -3231,7 +3231,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2038 msgid "" -"To get a list of subclasses, call the Python method :py:meth:`~class." +"To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__`." msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 44e3e7af19..42e81982ea 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -317,7 +317,7 @@ msgstr "" #: ../../c-api/unicode.rst:320 msgid "" -"Join two surrogate characters and return a single :c:type:`Py_UCS4` value. " +"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " "*high* and *low* are respectively the leading and trailing surrogates in a " "surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " "be in the range [0xDC00; 0xDFFF]." @@ -346,7 +346,11 @@ msgid "" "created using this function are not resizable." msgstr "" -#: ../../c-api/unicode.rst:347 +#: ../../c-api/unicode.rst:341 +msgid "On error, set an exception and return ``NULL``." +msgstr "" + +#: ../../c-api/unicode.rst:349 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -354,7 +358,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: ../../c-api/unicode.rst:352 +#: ../../c-api/unicode.rst:354 msgid "" "If necessary, the input *buffer* is copied and transformed into the " "canonical representation. For example, if the *buffer* is a UCS4 string (:c:" @@ -362,7 +366,7 @@ msgid "" "range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" -#: ../../c-api/unicode.rst:363 +#: ../../c-api/unicode.rst:365 msgid "" "Create a Unicode object from the char buffer *str*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " @@ -370,29 +374,29 @@ msgid "" "data is not allowed." msgstr "" -#: ../../c-api/unicode.rst:369 +#: ../../c-api/unicode.rst:371 msgid "This function raises :exc:`SystemError` when:" msgstr "" -#: ../../c-api/unicode.rst:371 +#: ../../c-api/unicode.rst:373 msgid "*size* < 0," msgstr "" -#: ../../c-api/unicode.rst:372 +#: ../../c-api/unicode.rst:374 msgid "*str* is ``NULL`` and *size* > 0" msgstr "" -#: ../../c-api/unicode.rst:374 +#: ../../c-api/unicode.rst:376 msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." msgstr "" -#: ../../c-api/unicode.rst:380 +#: ../../c-api/unicode.rst:382 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer " "*str*." msgstr "" -#: ../../c-api/unicode.rst:386 +#: ../../c-api/unicode.rst:388 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " @@ -401,23 +405,23 @@ msgid "" "*format* ASCII-encoded string." msgstr "" -#: ../../c-api/unicode.rst:392 +#: ../../c-api/unicode.rst:394 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../c-api/unicode.rst:395 +#: ../../c-api/unicode.rst:397 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../c-api/unicode.rst:397 +#: ../../c-api/unicode.rst:399 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../c-api/unicode.rst:400 +#: ../../c-api/unicode.rst:402 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is given in the next argument, which must be of type :c:expr:" @@ -425,7 +429,7 @@ msgid "" "optional precision." msgstr "" -#: ../../c-api/unicode.rst:405 +#: ../../c-api/unicode.rst:407 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " "specified as ``'*'`` (an asterisk), the actual precision is given in the " @@ -433,317 +437,317 @@ msgid "" "comes after the precision." msgstr "" -#: ../../c-api/unicode.rst:410 +#: ../../c-api/unicode.rst:412 msgid "Length modifier (optional)." msgstr "" -#: ../../c-api/unicode.rst:412 +#: ../../c-api/unicode.rst:414 msgid "Conversion type." msgstr "" -#: ../../c-api/unicode.rst:414 +#: ../../c-api/unicode.rst:416 msgid "The conversion flag characters are:" msgstr "" -#: ../../c-api/unicode.rst:419 +#: ../../c-api/unicode.rst:421 msgid "Flag" msgstr "旗標" -#: ../../c-api/unicode.rst:419 +#: ../../c-api/unicode.rst:421 msgid "Meaning" msgstr "含義" -#: ../../c-api/unicode.rst:421 +#: ../../c-api/unicode.rst:423 msgid "``0``" msgstr "``0``" -#: ../../c-api/unicode.rst:421 +#: ../../c-api/unicode.rst:423 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../c-api/unicode.rst:423 +#: ../../c-api/unicode.rst:425 msgid "``-``" msgstr "``-``" -#: ../../c-api/unicode.rst:423 +#: ../../c-api/unicode.rst:425 msgid "" "The converted value is left adjusted (overrides the ``0`` flag if both are " "given)." msgstr "" -#: ../../c-api/unicode.rst:427 +#: ../../c-api/unicode.rst:429 msgid "" "The length modifiers for following integer conversions (``d``, ``i``, ``o``, " "``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " "default):" msgstr "" -#: ../../c-api/unicode.rst:434 +#: ../../c-api/unicode.rst:436 msgid "Modifier" msgstr "" -#: ../../c-api/unicode.rst:434 +#: ../../c-api/unicode.rst:436 msgid "Types" msgstr "" -#: ../../c-api/unicode.rst:436 +#: ../../c-api/unicode.rst:438 msgid "``l``" msgstr "``l``" -#: ../../c-api/unicode.rst:436 +#: ../../c-api/unicode.rst:438 msgid ":c:expr:`long` or :c:expr:`unsigned long`" msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`" -#: ../../c-api/unicode.rst:438 +#: ../../c-api/unicode.rst:440 msgid "``ll``" msgstr "``ll``" -#: ../../c-api/unicode.rst:438 +#: ../../c-api/unicode.rst:440 msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`" -#: ../../c-api/unicode.rst:440 +#: ../../c-api/unicode.rst:442 msgid "``j``" msgstr "``j``" -#: ../../c-api/unicode.rst:440 +#: ../../c-api/unicode.rst:442 msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`" -#: ../../c-api/unicode.rst:442 +#: ../../c-api/unicode.rst:444 msgid "``z``" msgstr "``z``" -#: ../../c-api/unicode.rst:442 +#: ../../c-api/unicode.rst:444 msgid ":c:type:`size_t` or :c:type:`ssize_t`" msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:446 msgid "``t``" msgstr "``t``" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:446 msgid ":c:type:`ptrdiff_t`" msgstr ":c:type:`ptrdiff_t`" -#: ../../c-api/unicode.rst:447 +#: ../../c-api/unicode.rst:449 msgid "" "The length modifier ``l`` for following conversions ``s`` or ``V`` specify " "that the type of the argument is :c:expr:`const wchar_t*`." msgstr "" -#: ../../c-api/unicode.rst:450 +#: ../../c-api/unicode.rst:452 msgid "The conversion specifiers are:" msgstr "" -#: ../../c-api/unicode.rst:456 +#: ../../c-api/unicode.rst:458 msgid "Conversion Specifier" msgstr "" -#: ../../c-api/unicode.rst:457 +#: ../../c-api/unicode.rst:459 msgid "Type" msgstr "" -#: ../../c-api/unicode.rst:458 +#: ../../c-api/unicode.rst:460 msgid "Comment" msgstr "" -#: ../../c-api/unicode.rst:460 +#: ../../c-api/unicode.rst:462 msgid "``%``" msgstr "``%``" -#: ../../c-api/unicode.rst:461 +#: ../../c-api/unicode.rst:463 msgid "*n/a*" msgstr "*n/a*" -#: ../../c-api/unicode.rst:462 +#: ../../c-api/unicode.rst:464 msgid "The literal ``%`` character." msgstr "" -#: ../../c-api/unicode.rst:464 +#: ../../c-api/unicode.rst:466 msgid "``d``, ``i``" msgstr "``d``, ``i``" -#: ../../c-api/unicode.rst:465 ../../c-api/unicode.rst:469 -#: ../../c-api/unicode.rst:473 ../../c-api/unicode.rst:477 -#: ../../c-api/unicode.rst:481 +#: ../../c-api/unicode.rst:467 ../../c-api/unicode.rst:471 +#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:479 +#: ../../c-api/unicode.rst:483 msgid "Specified by the length modifier" msgstr "" -#: ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:468 msgid "The decimal representation of a signed C integer." msgstr "" -#: ../../c-api/unicode.rst:468 +#: ../../c-api/unicode.rst:470 msgid "``u``" msgstr "``u``" -#: ../../c-api/unicode.rst:470 +#: ../../c-api/unicode.rst:472 msgid "The decimal representation of an unsigned C integer." msgstr "" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:474 msgid "``o``" msgstr "``o``" -#: ../../c-api/unicode.rst:474 +#: ../../c-api/unicode.rst:476 msgid "The octal representation of an unsigned C integer." msgstr "" -#: ../../c-api/unicode.rst:476 +#: ../../c-api/unicode.rst:478 msgid "``x``" msgstr "``x``" -#: ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:480 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." msgstr "" -#: ../../c-api/unicode.rst:480 +#: ../../c-api/unicode.rst:482 msgid "``X``" msgstr "``X``" -#: ../../c-api/unicode.rst:482 +#: ../../c-api/unicode.rst:484 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." msgstr "" -#: ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:486 msgid "``c``" msgstr "``c``" -#: ../../c-api/unicode.rst:485 +#: ../../c-api/unicode.rst:487 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/unicode.rst:486 +#: ../../c-api/unicode.rst:488 msgid "A single character." msgstr "" -#: ../../c-api/unicode.rst:488 +#: ../../c-api/unicode.rst:490 msgid "``s``" msgstr "``s``" -#: ../../c-api/unicode.rst:489 +#: ../../c-api/unicode.rst:491 msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:492 msgid "A null-terminated C character array." msgstr "" -#: ../../c-api/unicode.rst:492 +#: ../../c-api/unicode.rst:494 msgid "``p``" msgstr "``p``" -#: ../../c-api/unicode.rst:493 +#: ../../c-api/unicode.rst:495 msgid ":c:expr:`const void*`" msgstr ":c:expr:`const void*`" -#: ../../c-api/unicode.rst:494 +#: ../../c-api/unicode.rst:496 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." msgstr "" -#: ../../c-api/unicode.rst:499 +#: ../../c-api/unicode.rst:501 msgid "``A``" msgstr "``A``" -#: ../../c-api/unicode.rst:500 ../../c-api/unicode.rst:504 -#: ../../c-api/unicode.rst:514 ../../c-api/unicode.rst:518 -#: ../../c-api/unicode.rst:522 ../../c-api/unicode.rst:527 +#: ../../c-api/unicode.rst:502 ../../c-api/unicode.rst:506 +#: ../../c-api/unicode.rst:516 ../../c-api/unicode.rst:520 +#: ../../c-api/unicode.rst:524 ../../c-api/unicode.rst:529 msgid ":c:expr:`PyObject*`" msgstr ":c:expr:`PyObject*`" -#: ../../c-api/unicode.rst:501 +#: ../../c-api/unicode.rst:503 msgid "The result of calling :func:`ascii`." msgstr "" -#: ../../c-api/unicode.rst:503 +#: ../../c-api/unicode.rst:505 msgid "``U``" msgstr "``U``" -#: ../../c-api/unicode.rst:505 +#: ../../c-api/unicode.rst:507 msgid "A Unicode object." msgstr "一 Unicode 物件。" -#: ../../c-api/unicode.rst:507 +#: ../../c-api/unicode.rst:509 msgid "``V``" msgstr "``V``" -#: ../../c-api/unicode.rst:508 +#: ../../c-api/unicode.rst:510 msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`PyObject*`、:c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:509 +#: ../../c-api/unicode.rst:511 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:513 +#: ../../c-api/unicode.rst:515 msgid "``S``" msgstr "``S``" -#: ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:517 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "" -#: ../../c-api/unicode.rst:517 +#: ../../c-api/unicode.rst:519 msgid "``R``" msgstr "``R``" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:521 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "" -#: ../../c-api/unicode.rst:521 +#: ../../c-api/unicode.rst:523 msgid "``T``" msgstr "" -#: ../../c-api/unicode.rst:523 +#: ../../c-api/unicode.rst:525 msgid "" "Get the fully qualified name of an object type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:526 +#: ../../c-api/unicode.rst:528 msgid "``#T``" msgstr "" -#: ../../c-api/unicode.rst:528 +#: ../../c-api/unicode.rst:530 msgid "" "Similar to ``T`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:531 +#: ../../c-api/unicode.rst:533 msgid "``N``" msgstr "" -#: ../../c-api/unicode.rst:532 ../../c-api/unicode.rst:537 +#: ../../c-api/unicode.rst:534 ../../c-api/unicode.rst:539 #, fuzzy msgid ":c:expr:`PyTypeObject*`" msgstr ":c:expr:`PyObject*`" -#: ../../c-api/unicode.rst:533 +#: ../../c-api/unicode.rst:535 msgid "" "Get the fully qualified name of a type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:536 +#: ../../c-api/unicode.rst:538 msgid "``#N``" msgstr "" -#: ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:540 msgid "" "Similar to ``N`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:542 +#: ../../c-api/unicode.rst:544 msgid "" "The width formatter unit is number of characters rather than bytes. The " "precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " @@ -753,28 +757,28 @@ msgid "" "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:550 +#: ../../c-api/unicode.rst:552 msgid "" "Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " "is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " "``X``)." msgstr "" -#: ../../c-api/unicode.rst:554 +#: ../../c-api/unicode.rst:556 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "" -#: ../../c-api/unicode.rst:557 +#: ../../c-api/unicode.rst:559 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "" -#: ../../c-api/unicode.rst:560 +#: ../../c-api/unicode.rst:562 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" -#: ../../c-api/unicode.rst:564 +#: ../../c-api/unicode.rst:566 msgid "" "Support for conversion specifiers ``o`` and ``X``. Support for length " "modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " @@ -783,40 +787,40 @@ msgid "" "flag ``-``." msgstr "" -#: ../../c-api/unicode.rst:572 +#: ../../c-api/unicode.rst:574 msgid "" "An unrecognized format character now sets a :exc:`SystemError`. In previous " "versions it caused all the rest of the format string to be copied as-is to " "the result string, and any extra arguments discarded." msgstr "" -#: ../../c-api/unicode.rst:576 +#: ../../c-api/unicode.rst:578 msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." msgstr "" -#: ../../c-api/unicode.rst:582 +#: ../../c-api/unicode.rst:584 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/unicode.rst:588 +#: ../../c-api/unicode.rst:590 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 " "a new :term:`strong reference` to the object." msgstr "" -#: ../../c-api/unicode.rst:592 +#: ../../c-api/unicode.rst:594 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: ../../c-api/unicode.rst:598 +#: ../../c-api/unicode.rst:600 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:600 +#: ../../c-api/unicode.rst:602 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -824,23 +828,27 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:606 +#: ../../c-api/unicode.rst:608 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:609 +#: ../../c-api/unicode.rst:611 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:615 +#: ../../c-api/unicode.rst:617 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:626 +#: ../../c-api/unicode.rst:619 +msgid "On error, set an exception and return ``-1``." +msgstr "" + +#: ../../c-api/unicode.rst:630 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:`!" @@ -848,39 +856,43 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:637 +#: ../../c-api/unicode.rst:641 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:" "start+length]``." msgstr "" -#: ../../c-api/unicode.rst:640 +#: ../../c-api/unicode.rst:644 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:643 +#: ../../c-api/unicode.rst:647 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:652 +#: ../../c-api/unicode.rst:656 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:656 +#: ../../c-api/unicode.rst:660 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:665 +#: ../../c-api/unicode.rst:664 +msgid "Return ``0`` on success, ``-1`` on error with an exception set." +msgstr "" + +#: ../../c-api/unicode.rst:671 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:" @@ -888,12 +900,17 @@ msgid "" msgstr "" #: ../../c-api/unicode.rst:675 +msgid "Return character on success, ``-1`` on error with an exception set." +msgstr "" + +#: ../../c-api/unicode.rst:683 msgid "" "Return a substring of *unicode*, from character index *start* (included) to " -"character index *end* (excluded). Negative indices are not supported." +"character index *end* (excluded). Negative indices are not supported. On " +"error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:684 +#: ../../c-api/unicode.rst:693 msgid "" "Copy the string *unicode* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -901,7 +918,7 @@ msgid "" "*unicode*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:694 +#: ../../c-api/unicode.rst:703 msgid "" "Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" "func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -909,17 +926,17 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:703 +#: ../../c-api/unicode.rst:712 msgid "Locale Encoding" msgstr "" -#: ../../c-api/unicode.rst:705 +#: ../../c-api/unicode.rst:714 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: ../../c-api/unicode.rst:712 +#: ../../c-api/unicode.rst:721 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 " @@ -928,21 +945,21 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:719 +#: ../../c-api/unicode.rst:728 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:722 ../../c-api/unicode.rst:757 +#: ../../c-api/unicode.rst:731 ../../c-api/unicode.rst:766 msgid "This function ignores the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/unicode.rst:726 ../../c-api/unicode.rst:823 +#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:832 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" -#: ../../c-api/unicode.rst:730 +#: ../../c-api/unicode.rst:739 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -950,13 +967,13 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:739 +#: ../../c-api/unicode.rst:748 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`!strlen`." msgstr "" -#: ../../c-api/unicode.rst:747 +#: ../../c-api/unicode.rst:756 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 " @@ -965,17 +982,17 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:754 +#: ../../c-api/unicode.rst:763 msgid "" "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:761 ../../c-api/unicode.rst:854 +#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:863 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" -#: ../../c-api/unicode.rst:765 +#: ../../c-api/unicode.rst:774 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -983,24 +1000,24 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:774 +#: ../../c-api/unicode.rst:783 msgid "File System Encoding" msgstr "" -#: ../../c-api/unicode.rst:776 +#: ../../c-api/unicode.rst:785 msgid "" "Functions encoding to and decoding from the :term:`filesystem encoding and " "error handler` (:pep:`383` and :pep:`529`)." msgstr "" -#: ../../c-api/unicode.rst:779 +#: ../../c-api/unicode.rst:788 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " "``\"O&\"`` converter should be used, passing :c:func:`PyUnicode_FSConverter` " "as the conversion function:" msgstr "" -#: ../../c-api/unicode.rst:785 +#: ../../c-api/unicode.rst:794 msgid "" "ParseTuple converter: encode :class:`str` objects -- obtained directly or " "through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" @@ -1009,18 +1026,18 @@ msgid "" "is no longer used." msgstr "" -#: ../../c-api/unicode.rst:793 ../../c-api/unicode.rst:810 +#: ../../c-api/unicode.rst:802 ../../c-api/unicode.rst:819 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../c-api/unicode.rst:796 +#: ../../c-api/unicode.rst:805 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:802 +#: ../../c-api/unicode.rst:811 msgid "" "ParseTuple converter: decode :class:`bytes` objects -- obtained either " "directly or indirectly through the :class:`os.PathLike` interface -- to :" @@ -1029,57 +1046,57 @@ msgid "" "which must be released when it is no longer used." msgstr "" -#: ../../c-api/unicode.rst:816 +#: ../../c-api/unicode.rst:825 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:818 +#: ../../c-api/unicode.rst:827 msgid "" "If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:825 ../../c-api/unicode.rst:838 -#: ../../c-api/unicode.rst:858 +#: ../../c-api/unicode.rst:834 ../../c-api/unicode.rst:847 +#: ../../c-api/unicode.rst:867 msgid "" "The :term:`filesystem error handler ` " "is now used." msgstr "" -#: ../../c-api/unicode.rst:832 +#: ../../c-api/unicode.rst:841 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:835 +#: ../../c-api/unicode.rst:844 msgid "" "If the string length is known, use :c:func:" "`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" -#: ../../c-api/unicode.rst:845 +#: ../../c-api/unicode.rst:854 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:849 +#: ../../c-api/unicode.rst:858 msgid "" "If you need to encode a string to the current locale encoding, use :c:func:" "`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:863 +#: ../../c-api/unicode.rst:872 msgid "wchar_t Support" msgstr "wchar_t 支援" -#: ../../c-api/unicode.rst:865 +#: ../../c-api/unicode.rst:874 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" -#: ../../c-api/unicode.rst:869 +#: ../../c-api/unicode.rst:878 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1087,7 +1104,7 @@ msgid "" "failure." msgstr "" -#: ../../c-api/unicode.rst:877 +#: ../../c-api/unicode.rst:886 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1095,13 +1112,13 @@ msgid "" "`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:882 +#: ../../c-api/unicode.rst:891 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: ../../c-api/unicode.rst:885 +#: ../../c-api/unicode.rst:894 msgid "" "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:" @@ -1111,7 +1128,7 @@ msgid "" "most C functions." msgstr "" -#: ../../c-api/unicode.rst:895 +#: ../../c-api/unicode.rst:904 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 " @@ -1122,37 +1139,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:903 +#: ../../c-api/unicode.rst:912 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (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 failed." msgstr "" -#: ../../c-api/unicode.rst:910 +#: ../../c-api/unicode.rst:919 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:918 +#: ../../c-api/unicode.rst:927 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:920 +#: ../../c-api/unicode.rst:929 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:923 +#: ../../c-api/unicode.rst:932 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:927 +#: ../../c-api/unicode.rst:936 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1160,28 +1177,28 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:932 +#: ../../c-api/unicode.rst:941 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:936 +#: ../../c-api/unicode.rst:945 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:941 +#: ../../c-api/unicode.rst:950 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:943 +#: ../../c-api/unicode.rst:952 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:949 +#: ../../c-api/unicode.rst:958 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1190,7 +1207,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:959 +#: ../../c-api/unicode.rst:968 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1199,21 +1216,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:967 +#: ../../c-api/unicode.rst:976 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:969 +#: ../../c-api/unicode.rst:978 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:974 +#: ../../c-api/unicode.rst:983 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:981 +#: ../../c-api/unicode.rst:990 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1221,14 +1238,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:989 +#: ../../c-api/unicode.rst:998 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:996 +#: ../../c-api/unicode.rst:1002 ../../c-api/unicode.rst:1017 +msgid "" +"The function fails if the string contains surrogate code points (``U+D800`` " +"- ``U+DFFF``)." +msgstr "" + +#: ../../c-api/unicode.rst:1008 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1237,13 +1260,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1002 +#: ../../c-api/unicode.rst:1014 msgid "" "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " "return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:1005 +#: ../../c-api/unicode.rst:1020 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1252,47 +1275,47 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1012 ../../c-api/unicode.rst:1025 +#: ../../c-api/unicode.rst:1027 ../../c-api/unicode.rst:1040 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1015 +#: ../../c-api/unicode.rst:1030 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1021 +#: ../../c-api/unicode.rst:1036 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:1045 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1032 +#: ../../c-api/unicode.rst:1047 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1038 +#: ../../c-api/unicode.rst:1053 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1042 ../../c-api/unicode.rst:1092 +#: ../../c-api/unicode.rst:1057 ../../c-api/unicode.rst:1107 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1045 ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1060 ../../c-api/unicode.rst:1110 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: ../../c-api/unicode.rst:1049 +#: ../../c-api/unicode.rst:1064 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1300,21 +1323,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1054 +#: ../../c-api/unicode.rst:1069 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1057 ../../c-api/unicode.rst:1108 +#: ../../c-api/unicode.rst:1072 ../../c-api/unicode.rst:1123 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1059 ../../c-api/unicode.rst:1110 +#: ../../c-api/unicode.rst:1074 ../../c-api/unicode.rst:1125 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1065 +#: ../../c-api/unicode.rst:1080 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1323,29 +1346,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1074 +#: ../../c-api/unicode.rst:1089 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1080 +#: ../../c-api/unicode.rst:1095 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1082 +#: ../../c-api/unicode.rst:1097 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1088 +#: ../../c-api/unicode.rst:1103 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1099 +#: ../../c-api/unicode.rst:1114 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1354,13 +1377,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1105 +#: ../../c-api/unicode.rst:1120 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1116 +#: ../../c-api/unicode.rst:1131 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1370,28 +1393,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1140 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1131 +#: ../../c-api/unicode.rst:1146 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1133 +#: ../../c-api/unicode.rst:1148 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1138 +#: ../../c-api/unicode.rst:1153 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1145 +#: ../../c-api/unicode.rst:1160 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1399,101 +1422,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1152 +#: ../../c-api/unicode.rst:1167 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1154 +#: ../../c-api/unicode.rst:1169 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1160 +#: ../../c-api/unicode.rst:1175 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1166 +#: ../../c-api/unicode.rst:1181 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1172 +#: ../../c-api/unicode.rst:1187 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1174 +#: ../../c-api/unicode.rst:1189 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1180 +#: ../../c-api/unicode.rst:1195 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1186 +#: ../../c-api/unicode.rst:1201 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1192 +#: ../../c-api/unicode.rst:1207 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1194 +#: ../../c-api/unicode.rst:1209 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1200 +#: ../../c-api/unicode.rst:1215 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1206 +#: ../../c-api/unicode.rst:1221 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1212 +#: ../../c-api/unicode.rst:1227 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1214 +#: ../../c-api/unicode.rst:1229 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1220 +#: ../../c-api/unicode.rst:1235 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1226 +#: ../../c-api/unicode.rst:1241 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1232 +#: ../../c-api/unicode.rst:1247 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1234 +#: ../../c-api/unicode.rst:1249 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1503,18 +1526,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1240 +#: ../../c-api/unicode.rst:1255 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1245 +#: ../../c-api/unicode.rst:1260 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1249 +#: ../../c-api/unicode.rst:1264 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1524,14 +1547,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1260 +#: ../../c-api/unicode.rst:1275 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1264 +#: ../../c-api/unicode.rst:1279 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1539,41 +1562,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1270 +#: ../../c-api/unicode.rst:1285 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1274 +#: ../../c-api/unicode.rst:1289 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1278 +#: ../../c-api/unicode.rst:1293 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: ../../c-api/unicode.rst:1281 +#: ../../c-api/unicode.rst:1296 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1285 +#: ../../c-api/unicode.rst:1300 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: ../../c-api/unicode.rst:1290 +#: ../../c-api/unicode.rst:1305 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1292 +#: ../../c-api/unicode.rst:1307 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1581,13 +1604,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1299 +#: ../../c-api/unicode.rst:1314 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1306 +#: ../../c-api/unicode.rst:1321 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1595,44 +1618,44 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1314 +#: ../../c-api/unicode.rst:1329 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1336 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:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1329 +#: ../../c-api/unicode.rst:1344 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1335 +#: ../../c-api/unicode.rst:1350 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1337 +#: ../../c-api/unicode.rst:1352 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1341 +#: ../../c-api/unicode.rst:1356 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1346 +#: ../../c-api/unicode.rst:1361 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1351 +#: ../../c-api/unicode.rst:1366 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1641,27 +1664,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1359 +#: ../../c-api/unicode.rst:1374 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1366 +#: ../../c-api/unicode.rst:1381 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1373 +#: ../../c-api/unicode.rst:1388 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1381 +#: ../../c-api/unicode.rst:1396 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1670,7 +1693,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1391 +#: ../../c-api/unicode.rst:1406 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1680,56 +1703,57 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1399 +#: ../../c-api/unicode.rst:1414 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1406 +#: ../../c-api/unicode.rst:1421 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1413 +#: ../../c-api/unicode.rst:1428 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1420 +#: ../../c-api/unicode.rst:1435 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1423 +#: ../../c-api/unicode.rst:1438 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1429 +#: ../../c-api/unicode.rst:1444 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " -"(``0``) otherwise. If the Unicode object contains surrogate characters or " -"the C string is not valid UTF-8, false (``0``) is returned." +"(``0``) otherwise. If the Unicode object contains surrogate code points " +"(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) " +"is returned." msgstr "" -#: ../../c-api/unicode.rst:1435 ../../c-api/unicode.rst:1456 +#: ../../c-api/unicode.rst:1451 ../../c-api/unicode.rst:1472 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1442 +#: ../../c-api/unicode.rst:1458 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1451 +#: ../../c-api/unicode.rst:1467 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1737,47 +1761,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1461 +#: ../../c-api/unicode.rst:1477 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1463 +#: ../../c-api/unicode.rst:1479 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1464 +#: ../../c-api/unicode.rst:1480 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1465 +#: ../../c-api/unicode.rst:1481 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1467 +#: ../../c-api/unicode.rst:1483 msgid "" "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:1473 +#: ../../c-api/unicode.rst:1489 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1479 +#: ../../c-api/unicode.rst:1495 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1482 +#: ../../c-api/unicode.rst:1498 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1488 +#: ../../c-api/unicode.rst:1504 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -1788,7 +1812,7 @@ msgid "" "interns it." msgstr "" -#: ../../c-api/unicode.rst:1495 +#: ../../c-api/unicode.rst:1511 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1796,39 +1820,39 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1500 +#: ../../c-api/unicode.rst:1516 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1503 +#: ../../c-api/unicode.rst:1519 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1507 +#: ../../c-api/unicode.rst:1523 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1513 +#: ../../c-api/unicode.rst:1529 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: ../../c-api/unicode.rst:1516 +#: ../../c-api/unicode.rst:1532 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1520 +#: ../../c-api/unicode.rst:1536 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " @@ -1837,6 +1861,6 @@ msgid "" "`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1528 +#: ../../c-api/unicode.rst:1544 msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/deprecations/index.po b/deprecations/index.po index 9b97344091..da4145159a 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -131,46 +131,38 @@ msgstr "" "Alan Williams 於 :gh:`72346` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:55 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:62 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:64 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -181,7 +173,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:72 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -198,7 +190,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:80 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -206,7 +198,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -216,27 +208,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:92 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:94 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -246,7 +238,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -254,7 +246,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:105 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -266,7 +258,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -274,7 +266,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:115 +#: ../../deprecations/pending-removal-in-3.14.rst:112 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -322,11 +314,19 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:20 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" +":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " +"系統考慮。 (:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:22 +#: ../../deprecations/pending-removal-in-3.15.rst:25 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -340,12 +340,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:30 +#: ../../deprecations/pending-removal-in-3.15.rst:33 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-3.15.rst:35 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -354,24 +354,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:39 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:38 +#: ../../deprecations/pending-removal-in-3.15.rst:41 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:45 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:47 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -379,12 +379,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:53 #, fuzzy msgid ":mod:`typing`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:55 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -396,19 +396,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../deprecations/pending-removal-in-3.15.rst:66 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:68 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 2b0e1acbc9..5d13a24b7c 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-17 00:03+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -126,46 +126,38 @@ msgstr "" "Alan Williams 於 :gh:`72346` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:55 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:62 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:64 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -176,7 +168,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:72 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -193,7 +185,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:80 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -201,7 +193,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -211,27 +203,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:92 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:94 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -241,7 +233,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -249,7 +241,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:105 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -261,7 +253,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -269,7 +261,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:115 +#: ../../deprecations/pending-removal-in-3.14.rst:112 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -277,3 +269,10 @@ msgid "" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" + +#~ msgid "" +#~ ":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set " +#~ "or taken into consideration by the import system (:gh:`97879`)." +#~ msgstr "" +#~ ":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 " +#~ "import 系統考慮。 (:gh:`97879`)" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index da018ca7d9..de0e0e3b3c 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,11 +52,17 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:20 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`typing.NamedTuple`:" -#: ../../deprecations/pending-removal-in-3.15.rst:22 +#: ../../deprecations/pending-removal-in-3.15.rst:25 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -70,11 +76,11 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:30 +#: ../../deprecations/pending-removal-in-3.15.rst:33 msgid ":mod:`pathlib`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-3.15.rst:35 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -83,22 +89,22 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:39 msgid ":mod:`platform`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:38 +#: ../../deprecations/pending-removal-in-3.15.rst:41 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:45 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:47 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -106,11 +112,11 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:53 msgid ":mod:`typing`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:55 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -122,18 +128,18 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../deprecations/pending-removal-in-3.15.rst:66 msgid ":mod:`wave`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:68 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/extending/newtypes.po b/extending/newtypes.po index d31c7ef8a7..7cd5d6fe10 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -561,7 +561,7 @@ msgid "" "defined this way can have an associated doc string simply by providing the " "text in the table. An application can use the introspection API to retrieve " "the descriptor from the class object, and get the doc string using its :attr:" -"`!__doc__` attribute." +"`~type.__doc__` attribute." msgstr "" #: ../../extending/newtypes.rst:301 diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 8b1a2a41b9..b707cab931 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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" @@ -289,8 +289,8 @@ msgid "" "If you want your type to be subclassable from Python, and your type has the " "same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have " "problems with multiple inheritance. A Python subclass of your type will " -"have to list your type first in its :attr:`~class.__bases__`, or else it " -"will not be able to call your type's :meth:`~object.__new__` method without " +"have to list your type first in its :attr:`~type.__bases__`, or else it will " +"not be able to call your type's :meth:`~object.__new__` method without " "getting an error. You can avoid this problem by ensuring that your type has " "a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " "does. Most of the time, this will be true anyway, because either your base " diff --git a/faq/programming.po b/faq/programming.po index 4a9bd315fb..1a9a7ceef4 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-04-25 14:17+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3224,25 +3224,44 @@ msgstr "" #: ../../faq/programming.rst:1616 #, fuzzy msgid "" -"Most :meth:`!__setattr__` implementations must modify :meth:`self.__dict__ " -"` to store local state for self without causing an infinite " -"recursion." +"Many :meth:`~object.__setattr__` implementations call :meth:`!object." +"__setattr__` to set an attribute on self without causing infinite recursion::" msgstr "" "大多數 :meth:`!__setattr__` 實作必須修改 :meth:`self.__dict__ ` 以存儲 self 的本地狀態,而不會導致無限遞迴。" -#: ../../faq/programming.rst:1622 +#: ../../faq/programming.rst:1619 +#, fuzzy +msgid "" +"class X:\n" +" def __setattr__(self, name, value):\n" +" # Custom logic here...\n" +" object.__setattr__(self, name, value)" +msgstr "" +"class X:\n" +" ...\n" +" def __setattr__(self, name, value):\n" +" self.__dict__[name] = value\n" +" ..." + +#: ../../faq/programming.rst:1624 +msgid "" +"Alternatively, it is possible to set attributes by inserting entries into :" +"attr:`self.__dict__ ` directly." +msgstr "" + +#: ../../faq/programming.rst:1629 #, fuzzy msgid "" "How do I call a method defined in a base class from a derived class that " "extends it?" msgstr "如何從擴充它的衍生類別呼叫基底類別中定義的方法?" -#: ../../faq/programming.rst:1624 +#: ../../faq/programming.rst:1631 msgid "Use the built-in :func:`super` function::" msgstr "使用內建的 :func:`super` 函式: ::" -#: ../../faq/programming.rst:1626 +#: ../../faq/programming.rst:1633 msgid "" "class Derived(Base):\n" " def meth(self):\n" @@ -3252,7 +3271,7 @@ msgstr "" " def meth(self):\n" " super().meth() # calls Base.meth" -#: ../../faq/programming.rst:1630 +#: ../../faq/programming.rst:1637 #, fuzzy msgid "" "In the example, :func:`super` will automatically determine the instance from " @@ -3263,12 +3282,12 @@ msgstr "" "在示例中,:func:`super` 將自動確定呼叫它的實例(``self`` 值),使用 " "``type(self ).__mro__``,並回傳 MRO 中``Derived`` 之後的下一行:``Base``。" -#: ../../faq/programming.rst:1637 +#: ../../faq/programming.rst:1644 #, fuzzy msgid "How can I organize my code to make it easier to change the base class?" msgstr "我如何組織我的程式碼以便更容易地更改基底類別?" -#: ../../faq/programming.rst:1639 +#: ../../faq/programming.rst:1646 #, fuzzy msgid "" "You could assign the base class to an alias and derive from the alias. Then " @@ -3280,7 +3299,7 @@ msgstr "" "說一句,如果你想動態決定(例如,取決於資源的可用性)使用哪個基底類別,這個技" "巧也很方便。例子: ::" -#: ../../faq/programming.rst:1644 +#: ../../faq/programming.rst:1651 msgid "" "class Base:\n" " ...\n" @@ -3298,19 +3317,19 @@ msgstr "" "class Derived(BaseAlias):\n" " ..." -#: ../../faq/programming.rst:1654 +#: ../../faq/programming.rst:1661 #, fuzzy msgid "How do I create static class data and static class methods?" msgstr "如何建立靜態類別資料和靜態類別方法?" -#: ../../faq/programming.rst:1656 +#: ../../faq/programming.rst:1663 #, fuzzy msgid "" "Both static data and static methods (in the sense of C++ or Java) are " "supported in Python." msgstr "Python 支援靜態資料和靜態方法(在 C++ 或 Java 的意義上)。" -#: ../../faq/programming.rst:1659 +#: ../../faq/programming.rst:1666 #, fuzzy msgid "" "For static data, simply define a class attribute. To assign a new value to " @@ -3319,7 +3338,7 @@ msgstr "" "對於靜態資料,只需定義一個類別屬性即可。要為屬性分配新值,你必須在分配中顯式" "使用類別名: ::" -#: ../../faq/programming.rst:1662 +#: ../../faq/programming.rst:1669 msgid "" "class C:\n" " count = 0 # number of times C.__init__ called\n" @@ -3331,7 +3350,7 @@ msgid "" " return C.count # or return self.count" msgstr "" -#: ../../faq/programming.rst:1671 +#: ../../faq/programming.rst:1678 #, fuzzy msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " @@ -3342,7 +3361,7 @@ msgstr "" "除非被 ``c`` 本身或某些人覆蓋從 ``c.__class__`` 回到 ``C`` 的基底類別搜索路徑" "上的類別。" -#: ../../faq/programming.rst:1675 +#: ../../faq/programming.rst:1682 #, fuzzy msgid "" "Caution: within a method of C, an assignment like ``self.count = 42`` " @@ -3354,15 +3373,15 @@ msgstr "" "一個名為 \"count\" 的新的不相關實例。類別靜態資料名稱的重新綁定必須始終指定類" "別是否在方法內: ::" -#: ../../faq/programming.rst:1680 +#: ../../faq/programming.rst:1687 msgid "C.count = 314" msgstr "C.count = 314" -#: ../../faq/programming.rst:1682 +#: ../../faq/programming.rst:1689 msgid "Static methods are possible::" msgstr "靜態方法是可能的: ::" -#: ../../faq/programming.rst:1684 +#: ../../faq/programming.rst:1691 msgid "" "class C:\n" " @staticmethod\n" @@ -3376,7 +3395,7 @@ msgstr "" " # 沒有 'self' 參數!\n" " ..." -#: ../../faq/programming.rst:1690 +#: ../../faq/programming.rst:1697 #, fuzzy msgid "" "However, a far more straightforward way to get the effect of a static method " @@ -3384,7 +3403,7 @@ msgid "" msgstr "" "然而,獲得靜態方法效果的一種更直接的方法是透過一個簡單的模組級函式: ::" -#: ../../faq/programming.rst:1693 +#: ../../faq/programming.rst:1700 msgid "" "def getcount():\n" " return C.count" @@ -3392,7 +3411,7 @@ msgstr "" "def getcount():\n" " return C.count" -#: ../../faq/programming.rst:1696 +#: ../../faq/programming.rst:1703 #, fuzzy msgid "" "If your code is structured so as to define one class (or tightly related " @@ -3401,12 +3420,12 @@ msgstr "" "如果你的程式碼結構化以便為每個模組定義一個類別(或緊密相關的類別層次結構)," "則這提供了所需的封裝。" -#: ../../faq/programming.rst:1701 +#: ../../faq/programming.rst:1708 #, fuzzy msgid "How can I overload constructors (or methods) in Python?" msgstr "如何在 Python 中重載構造函式(或方法)?" -#: ../../faq/programming.rst:1703 +#: ../../faq/programming.rst:1710 #, fuzzy msgid "" "This answer actually applies to all methods, but the question usually comes " @@ -3414,11 +3433,11 @@ msgid "" msgstr "" "這個答案實際上適用於所有方法,但這個問題通常首先出現在構造函式的上下文中。" -#: ../../faq/programming.rst:1706 +#: ../../faq/programming.rst:1713 msgid "In C++ you'd write" msgstr "在 C++ 中你會寫成" -#: ../../faq/programming.rst:1708 +#: ../../faq/programming.rst:1715 msgid "" "class C {\n" " C() { cout << \"No arguments\\n\"; }\n" @@ -3430,7 +3449,7 @@ msgstr "" " C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" "}" -#: ../../faq/programming.rst:1715 +#: ../../faq/programming.rst:1722 #, fuzzy msgid "" "In Python you have to write a single constructor that catches all cases " @@ -3438,7 +3457,7 @@ msgid "" msgstr "" "在 Python 中,你必須編寫一個構造函式來捕獲所有使用預設引數的情況。例如: ::" -#: ../../faq/programming.rst:1718 +#: ../../faq/programming.rst:1725 msgid "" "class C:\n" " def __init__(self, i=None):\n" @@ -3454,17 +3473,17 @@ msgstr "" " else:\n" " print(\"Argument is\", i)" -#: ../../faq/programming.rst:1725 +#: ../../faq/programming.rst:1732 #, fuzzy msgid "This is not entirely equivalent, but close enough in practice." msgstr "這並不完全等價,但在實踐中足夠接近。" -#: ../../faq/programming.rst:1727 +#: ../../faq/programming.rst:1734 #, fuzzy msgid "You could also try a variable-length argument list, e.g. ::" msgstr "你也可以嘗試可變長度引數 list,例如: ::" -#: ../../faq/programming.rst:1729 +#: ../../faq/programming.rst:1736 msgid "" "def __init__(self, *args):\n" " ..." @@ -3472,17 +3491,17 @@ msgstr "" "def __init__(self, *args):\n" " ..." -#: ../../faq/programming.rst:1732 +#: ../../faq/programming.rst:1739 #, fuzzy msgid "The same approach works for all method definitions." msgstr "相同的方法適用於所有方法定義。" -#: ../../faq/programming.rst:1736 +#: ../../faq/programming.rst:1743 #, fuzzy msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "我嘗試使用 __spam,但收到有關 _SomeClassName__spam 的錯誤。" -#: ../../faq/programming.rst:1738 +#: ../../faq/programming.rst:1745 #, fuzzy msgid "" "Variable names with double leading underscores are \"mangled\" to provide a " @@ -3497,13 +3516,13 @@ msgstr "" "上替換為 ``_classname__spam``,其中 ``classname`` 是當前類別名,所有前導底線" "被去除。" -#: ../../faq/programming.rst:1744 +#: ../../faq/programming.rst:1751 msgid "" "The identifier can be used unchanged within the class, but to access it " "outside the class, the mangled name must be used:" msgstr "" -#: ../../faq/programming.rst:1747 +#: ../../faq/programming.rst:1754 msgid "" "class A:\n" " def __one(self):\n" @@ -3529,7 +3548,7 @@ msgstr "" "\n" "four = 4 * A()._A__one()" -#: ../../faq/programming.rst:1761 +#: ../../faq/programming.rst:1768 #, fuzzy msgid "" "In particular, this does not guarantee privacy since an outside user can " @@ -3539,23 +3558,23 @@ msgstr "" "這並不能保證隱私:外部使用者仍然可以故意存取 \"_classname__spam\" 屬性,並且" "私有值在物件的 __dict__ 中可見。許多 Python 程式員根本懶得使用私有變數名。" -#: ../../faq/programming.rst:1767 +#: ../../faq/programming.rst:1774 msgid "" "The :ref:`private name mangling specifications ` for " "details and special cases." msgstr "" -#: ../../faq/programming.rst:1771 +#: ../../faq/programming.rst:1778 #, fuzzy msgid "My class defines __del__ but it is not called when I delete the object." msgstr "我的類別定義了 __del__ 但是當我刪除物件時它沒有被呼叫。" -#: ../../faq/programming.rst:1773 +#: ../../faq/programming.rst:1780 #, fuzzy msgid "There are several possible reasons for this." msgstr "這有幾個可能的原因。" -#: ../../faq/programming.rst:1775 +#: ../../faq/programming.rst:1782 #, fuzzy msgid "" "The :keyword:`del` statement does not necessarily call :meth:`~object." @@ -3565,7 +3584,7 @@ msgstr "" ":keyword:`del` 陳述式不一定呼叫 :meth:`~object.__del__` -- 它只是減少物件的引" "用計數,如果達到零,則呼叫 :meth:`!__del__`。" -#: ../../faq/programming.rst:1779 +#: ../../faq/programming.rst:1786 #, fuzzy msgid "" "If your data structures contain circular links (e.g. a tree where each child " @@ -3587,7 +3606,7 @@ msgstr "" "行順序是任意的。你可以運行 :func:`gc.collect` 來強制收集,但*存在*永遠不會收" "集物件的病態情況。" -#: ../../faq/programming.rst:1790 +#: ../../faq/programming.rst:1797 #, fuzzy msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " @@ -3602,7 +3621,7 @@ msgstr "" "性。不要直接呼叫 :meth:`!__del__` -- :meth:`!__del__` 應該呼叫 ``close()`` 並" "且 ``close()`` 應該確保它可以多次呼叫同一個物件。" -#: ../../faq/programming.rst:1797 +#: ../../faq/programming.rst:1804 #, fuzzy msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " @@ -3614,7 +3633,7 @@ msgstr "" "的情況下指向物件。例如,樹資料結構應該對其父參照和同級參照使用弱參照(如果需" "要的話!)。" -#: ../../faq/programming.rst:1810 +#: ../../faq/programming.rst:1817 #, fuzzy msgid "" "Finally, if your :meth:`!__del__` method raises an exception, a warning " @@ -3623,12 +3642,12 @@ msgstr "" "最後,如果你的 :meth:`!__del__` 方法引發例外,則會將一條警告消息印出到 :data:" "`sys.stderr`。" -#: ../../faq/programming.rst:1815 +#: ../../faq/programming.rst:1822 #, fuzzy msgid "How do I get a list of all instances of a given class?" msgstr "如何獲取給定類別的所有實例的 list?" -#: ../../faq/programming.rst:1817 +#: ../../faq/programming.rst:1824 #, fuzzy msgid "" "Python does not keep track of all instances of a class (or of a built-in " @@ -3638,12 +3657,12 @@ msgstr "" "Python 不會跟踪類別(或內建型別)的所有實例。你可以對類別的構造函式進行編程," "以透過保留對每個實例的弱參照list來跟踪所有實例。" -#: ../../faq/programming.rst:1823 +#: ../../faq/programming.rst:1830 #, fuzzy msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "為什麼 ``id()`` 的結果看起來不唯一?" -#: ../../faq/programming.rst:1825 +#: ../../faq/programming.rst:1832 #, fuzzy msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " @@ -3656,7 +3675,7 @@ msgstr "" "CPython 中,這是物件的記憶體地址,所以經常發生在從記憶體中刪除一個物件後,下" "一個新建立的物件被分配在記憶體中的相同位置。這個例子說明了這一點:" -#: ../../faq/programming.rst:1836 +#: ../../faq/programming.rst:1843 #, fuzzy msgid "" "The two ids belong to different integer objects that are created before, and " @@ -3667,18 +3686,18 @@ msgstr "" "這兩個 id 屬於之前建立的不同整數物件,並在執行 ``id()`` 呼叫後立即刪除。要確" "保你要檢查其 id 的物件仍然存在,請建立對該物件的另一個參照:" -#: ../../faq/programming.rst:1849 +#: ../../faq/programming.rst:1856 msgid "When can I rely on identity tests with the *is* operator?" msgstr "我什麼時候可以依靠 *is* 運算子進行識別性測試?" -#: ../../faq/programming.rst:1851 +#: ../../faq/programming.rst:1858 msgid "" "The ``is`` operator tests for object identity. The test ``a is b`` is " "equivalent to ``id(a) == id(b)``." msgstr "" "``is`` 運算子測試物件識別性。測試 ``a is b`` 等同於 ``id(a) == id(b)`` 。" -#: ../../faq/programming.rst:1854 +#: ../../faq/programming.rst:1861 msgid "" "The most important property of an identity test is that an object is always " "identical to itself, ``a is a`` always returns ``True``. Identity tests are " @@ -3689,7 +3708,7 @@ msgstr "" "識別性測試通常比相等性測試更快。與相等性測試不同,識別性測試保證回傳布林值 " "``True`` 或 ``False`` 。" -#: ../../faq/programming.rst:1859 +#: ../../faq/programming.rst:1866 msgid "" "However, identity tests can *only* be substituted for equality tests when " "object identity is assured. Generally, there are three circumstances where " @@ -3698,7 +3717,7 @@ msgstr "" "然而,*只有*\\ 當物件識別性得到保證時,識別性測試才能代替相等性測試。一般來" "說,保證識別性的情況有以下三種:" -#: ../../faq/programming.rst:1863 +#: ../../faq/programming.rst:1870 msgid "" "1) Assignments create new names but do not change object identity. After " "the assignment ``new = old``, it is guaranteed that ``new is old``." @@ -3706,7 +3725,7 @@ msgstr "" "1) 賦值建立新名稱但不改變物件識別性。賦值 ``new = old`` 後,保證 ``new is " "old``。" -#: ../../faq/programming.rst:1866 +#: ../../faq/programming.rst:1873 msgid "" "2) Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " @@ -3715,7 +3734,7 @@ msgstr "" "2) 將物件放入存儲物件參照的容器中不會改變物件識別性。在 list 賦值 ``s[0] = " "x`` 之後,保證 ``s[0] 是 x``。" -#: ../../faq/programming.rst:1870 +#: ../../faq/programming.rst:1877 #, fuzzy msgid "" "3) If an object is a singleton, it means that only one instance of that " @@ -3725,7 +3744,7 @@ msgstr "" "3)如果一個物件是單例,則意味著該物件只能存在一個實例。在賦值 ``a = None`` " "和 ``b = None`` 之後,可以保證 ``a is b`` 因為 ``None`` 是單例。" -#: ../../faq/programming.rst:1874 +#: ../../faq/programming.rst:1881 msgid "" "In most other circumstances, identity tests are inadvisable and equality " "tests are preferred. In particular, identity tests should not be used to " @@ -3735,7 +3754,7 @@ msgstr "" "在大多數其他情況下,識別性測試是不可取的,相等性測試是首選。特別是,識別性測" "試不應用於檢查常數,例如不能保證是單例的 :class:`int` 和 :class:`str`: ::" -#: ../../faq/programming.rst:1879 +#: ../../faq/programming.rst:1886 msgid "" ">>> a = 1000\n" ">>> b = 500\n" @@ -3761,12 +3780,12 @@ msgstr "" ">>> a is c\n" "False" -#: ../../faq/programming.rst:1891 +#: ../../faq/programming.rst:1898 #, fuzzy msgid "Likewise, new instances of mutable containers are never identical::" msgstr "同樣,可變容器的新實例永遠不會相同: ::" -#: ../../faq/programming.rst:1893 +#: ../../faq/programming.rst:1900 msgid "" ">>> a = []\n" ">>> b = []\n" @@ -3778,13 +3797,13 @@ msgstr "" ">>> a is b\n" "False" -#: ../../faq/programming.rst:1898 +#: ../../faq/programming.rst:1905 msgid "" "In the standard library code, you will see several common patterns for " "correctly using identity tests:" msgstr "在標準函式庫程式碼中,你將看到幾種正確使用識別性測試的常見模式:" -#: ../../faq/programming.rst:1901 +#: ../../faq/programming.rst:1908 msgid "" "1) As recommended by :pep:`8`, an identity test is the preferred way to " "check for ``None``. This reads like plain English in code and avoids " @@ -3794,7 +3813,7 @@ msgstr "" "1) 正如 :pep:`8` 所推薦的,識別性測試是檢查 ``None`` 的首選方法。這在程式碼中" "讀起來像簡單的英語,並避免與其他可能具有評估為 false 的布林值的物件混淆。" -#: ../../faq/programming.rst:1905 +#: ../../faq/programming.rst:1912 #, fuzzy msgid "" "2) Detecting optional arguments can be tricky when ``None`` is a valid input " @@ -3806,7 +3825,7 @@ msgstr "" "建立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似" "於 :meth:`dict.pop` 的方法: ::" -#: ../../faq/programming.rst:1910 +#: ../../faq/programming.rst:1917 msgid "" "_sentinel = object()\n" "\n" @@ -3830,7 +3849,7 @@ msgstr "" " raise KeyError(key)\n" " return default" -#: ../../faq/programming.rst:1921 +#: ../../faq/programming.rst:1928 msgid "" "3) Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " @@ -3839,14 +3858,14 @@ msgstr "" "3) 容器實作有時需要透過識別性測試來增強相等性測試。這可以防止程式碼被諸如 " "float('NaN') 之類的不等於自身的物件所混淆。" -#: ../../faq/programming.rst:1925 +#: ../../faq/programming.rst:1932 msgid "" "For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" "例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" -#: ../../faq/programming.rst:1928 +#: ../../faq/programming.rst:1935 msgid "" "def __contains__(self, value):\n" " for v in self:\n" @@ -3860,12 +3879,12 @@ msgstr "" " return True\n" " return False" -#: ../../faq/programming.rst:1936 +#: ../../faq/programming.rst:1943 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "子類別如何控制不可變實例中存儲的資料?" -#: ../../faq/programming.rst:1938 +#: ../../faq/programming.rst:1945 #, fuzzy msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " @@ -3877,14 +3896,14 @@ msgstr "" "`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法更改不可變" "實例中的資料。" -#: ../../faq/programming.rst:1943 +#: ../../faq/programming.rst:1950 #, fuzzy msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "所有這些不可變類別都具有與其父類別不同的簽名:" -#: ../../faq/programming.rst:1946 +#: ../../faq/programming.rst:1953 msgid "" "from datetime import date\n" "\n" @@ -3908,11 +3927,11 @@ msgid "" " return super().__new__(cls, s)" msgstr "" -#: ../../faq/programming.rst:1969 +#: ../../faq/programming.rst:1976 msgid "The classes can be used like this:" msgstr "這些類別可以像這樣使用:" -#: ../../faq/programming.rst:1971 +#: ../../faq/programming.rst:1978 msgid "" ">>> FirstOfMonthDate(2012, 2, 14)\n" "FirstOfMonthDate(2012, 2, 1)\n" @@ -3932,11 +3951,11 @@ msgstr "" ">>> TitleStr('Blog: Why Python Rocks')\n" "'blog-why-python-rocks'" -#: ../../faq/programming.rst:1986 +#: ../../faq/programming.rst:1993 msgid "How do I cache method calls?" msgstr "如何快取方法呼叫?" -#: ../../faq/programming.rst:1988 +#: ../../faq/programming.rst:1995 #, fuzzy msgid "" "The two principal tools for caching methods are :func:`functools." @@ -3946,7 +3965,7 @@ msgstr "" "快取方法的兩個主要工具是 func:`functools.cached_property` 和 :func:" "`functools.lru_cache`。前者在實例級別存儲結果,後者在類別級別存儲結果。" -#: ../../faq/programming.rst:1993 +#: ../../faq/programming.rst:2000 #, fuzzy msgid "" "The *cached_property* approach only works with methods that do not take any " @@ -3956,7 +3975,7 @@ msgstr "" "*cached_property* 方法僅適用於不帶任何引數的方法。它不會建立對實例的參照。只" "要實例還活著,快取的方法結果就會被保留。" -#: ../../faq/programming.rst:1997 +#: ../../faq/programming.rst:2004 #, fuzzy msgid "" "The advantage is that when an instance is no longer used, the cached method " @@ -3967,7 +3986,7 @@ msgstr "" "好處是當一個實例不再使用時,快取的方法結果會立即釋放。缺點是如果實例累積,累" "積的方法結果也會累積。他們可以不受限制地成長。" -#: ../../faq/programming.rst:2002 +#: ../../faq/programming.rst:2009 msgid "" "The *lru_cache* approach works with methods that have :term:`hashable` " "arguments. It creates a reference to the instance unless special efforts " @@ -3976,7 +3995,7 @@ msgstr "" "*lru_cache* 方法適用於具有\\ :term:`可雜湊 `\\ 引數的方法。除非特別" "努力傳遞弱參照,否則它會建立對實例的參照。" -#: ../../faq/programming.rst:2006 +#: ../../faq/programming.rst:2013 #, fuzzy msgid "" "The advantage of the least recently used algorithm is that the cache is " @@ -3986,11 +4005,11 @@ msgstr "" "最近最少使用演算法的優點是快取受指定的 *maxsize* 限制。缺點是實例會一直保持活" "動狀態,直到它們從快取中老化或快取被清除。" -#: ../../faq/programming.rst:2011 +#: ../../faq/programming.rst:2018 msgid "This example shows the various techniques::" msgstr "這個例子展示了各種技術: ::" -#: ../../faq/programming.rst:2013 +#: ../../faq/programming.rst:2020 msgid "" "class Weather:\n" " \"Lookup weather information on a government website\"\n" @@ -4015,7 +4034,7 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2035 +#: ../../faq/programming.rst:2042 #, fuzzy msgid "" "The above example assumes that the *station_id* never changes. If the " @@ -4025,7 +4044,7 @@ msgstr "" "上面的例子假設 *station_id* 永遠不會改變。如果相關的實例屬性是可變的,則 " "*cached_property* 方法無法工作,因為它無法檢測到屬性的更改。" -#: ../../faq/programming.rst:2040 +#: ../../faq/programming.rst:2047 #, fuzzy msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " @@ -4036,7 +4055,7 @@ msgstr "" "`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測相關屬性更" "新: ::" -#: ../../faq/programming.rst:2044 +#: ../../faq/programming.rst:2051 msgid "" "class Weather:\n" " \"Example with a mutable station identifier\"\n" @@ -4059,15 +4078,15 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2066 +#: ../../faq/programming.rst:2073 msgid "Modules" msgstr "模組" -#: ../../faq/programming.rst:2069 +#: ../../faq/programming.rst:2076 msgid "How do I create a .pyc file?" msgstr "如何建立 .pyc 檔案?" -#: ../../faq/programming.rst:2071 +#: ../../faq/programming.rst:2078 #, fuzzy msgid "" "When a module is imported for the first time (or when the source file has " @@ -4084,7 +4103,7 @@ msgstr "" "間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參閱 :" "pep:`3147`。)" -#: ../../faq/programming.rst:2079 +#: ../../faq/programming.rst:2086 #, fuzzy msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " @@ -4097,7 +4116,7 @@ msgstr "" "__pycache__ 子目錄。例如,如果你以一個使用者的身份開發但以另一個使用者的身份" "運行,例如你正在使用 Web 服務器進行測試,就會發生這種情況。" -#: ../../faq/programming.rst:2084 +#: ../../faq/programming.rst:2091 #, fuzzy msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " @@ -4110,7 +4129,7 @@ msgstr "" "並且 Python 有能力(權限,空閒空間等)建立一個 .pyc 檔案是自動的建立一個" "``__pycache__ `` 子目錄並將編譯後的模組寫入該子目錄。" -#: ../../faq/programming.rst:2089 +#: ../../faq/programming.rst:2096 #, fuzzy msgid "" "Running Python on a top level script is not considered an import and no ``." @@ -4125,7 +4144,7 @@ msgstr "" "入 ``python foo.py`` 作為一個 shell 命令),將為 xyz 建立一個 .pyc 因為引入" "了 xyz,但是不會為 foo 建立 .pyc 檔案,因為 ` `foo.py`` 沒有被引入。" -#: ../../faq/programming.rst:2096 +#: ../../faq/programming.rst:2103 #, fuzzy msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." @@ -4135,7 +4154,7 @@ msgstr "" "如果你需要為 ``foo`` 建立一個 ``.pyc`` 檔案——也就是說,為一個未引入的模組建立" "一個 ``.pyc`` 檔案——你可以使用 :mod :`py_compile` 和 :mod:`compileall` 模組。" -#: ../../faq/programming.rst:2100 +#: ../../faq/programming.rst:2107 #, fuzzy msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " @@ -4144,7 +4163,7 @@ msgstr "" ":mod:`py_compile` 模組可以手動編譯任何模組。一種方法是在該模組中以交互方式使" "用 ``compile()`` 函式: ::" -#: ../../faq/programming.rst:2103 +#: ../../faq/programming.rst:2110 msgid "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " @@ -4152,7 +4171,7 @@ msgstr "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " -#: ../../faq/programming.rst:2106 +#: ../../faq/programming.rst:2113 #, fuzzy msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " @@ -4162,7 +4181,7 @@ msgstr "" "這會將 .pyc 寫入與 foo.py 相同位置的 __pycache__ 子目錄(或者你可以使用可選參" "數 cfile 覆蓋它)。" -#: ../../faq/programming.rst:2110 +#: ../../faq/programming.rst:2117 #, fuzzy msgid "" "You can also automatically compile all files in a directory or directories " @@ -4173,15 +4192,15 @@ msgstr "" "你還可以使用 :mod:`compileall` 模組自動編譯目錄中的所有檔案。你可以在 shell " "提示符下運行 ``compileall.py`` 並提供包含要編譯的 Python 檔案的目錄路徑: ::" -#: ../../faq/programming.rst:2115 +#: ../../faq/programming.rst:2122 msgid "python -m compileall ." msgstr "python -m compileall ." -#: ../../faq/programming.rst:2119 +#: ../../faq/programming.rst:2126 msgid "How do I find the current module name?" msgstr "如何找到當前模組名稱?" -#: ../../faq/programming.rst:2121 +#: ../../faq/programming.rst:2128 #, fuzzy msgid "" "A module can find out its own module name by looking at the predefined " @@ -4194,7 +4213,7 @@ msgstr "" "值為``'__main__'``,則該程式作為腳本運行。許多通常透過引入使用的模組還提供命" "令行界面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::" -#: ../../faq/programming.rst:2127 +#: ../../faq/programming.rst:2134 msgid "" "def main():\n" " print('Running test...')\n" @@ -4204,20 +4223,20 @@ msgid "" " main()" msgstr "" -#: ../../faq/programming.rst:2136 +#: ../../faq/programming.rst:2143 #, fuzzy msgid "How can I have modules that mutually import each other?" msgstr "我怎樣才能擁有相互引入的模組?" -#: ../../faq/programming.rst:2138 +#: ../../faq/programming.rst:2145 msgid "Suppose you have the following modules:" msgstr "假設你有以下模組:" -#: ../../faq/programming.rst:2140 +#: ../../faq/programming.rst:2147 msgid ":file:`foo.py`::" msgstr ":file:`foo.py`: ::" -#: ../../faq/programming.rst:2142 +#: ../../faq/programming.rst:2149 msgid "" "from bar import bar_var\n" "foo_var = 1" @@ -4225,11 +4244,11 @@ msgstr "" "from bar import bar_var\n" "foo_var = 1" -#: ../../faq/programming.rst:2145 +#: ../../faq/programming.rst:2152 msgid ":file:`bar.py`::" msgstr ":file:`bar.py`: ::" -#: ../../faq/programming.rst:2147 +#: ../../faq/programming.rst:2154 msgid "" "from foo import foo_var\n" "bar_var = 2" @@ -4237,39 +4256,39 @@ msgstr "" "from foo import foo_var\n" "bar_var = 2" -#: ../../faq/programming.rst:2150 +#: ../../faq/programming.rst:2157 #, fuzzy msgid "The problem is that the interpreter will perform the following steps:" msgstr "問題是直譯器將執行以下步驟:" -#: ../../faq/programming.rst:2152 +#: ../../faq/programming.rst:2159 #, fuzzy msgid "main imports ``foo``" msgstr "主要引入 ``foo``" -#: ../../faq/programming.rst:2153 +#: ../../faq/programming.rst:2160 #, fuzzy msgid "Empty globals for ``foo`` are created" msgstr "建立了 ``foo`` 的空全域變數" -#: ../../faq/programming.rst:2154 +#: ../../faq/programming.rst:2161 msgid "``foo`` is compiled and starts executing" msgstr "``foo`` 被編譯並開始執行" -#: ../../faq/programming.rst:2155 +#: ../../faq/programming.rst:2162 msgid "``foo`` imports ``bar``" msgstr "``foo`` 引入 ``bar``" -#: ../../faq/programming.rst:2156 +#: ../../faq/programming.rst:2163 #, fuzzy msgid "Empty globals for ``bar`` are created" msgstr "建立了 ``bar`` 的空全域變數" -#: ../../faq/programming.rst:2157 +#: ../../faq/programming.rst:2164 msgid "``bar`` is compiled and starts executing" msgstr "``bar`` 已被編譯並開始執行" -#: ../../faq/programming.rst:2158 +#: ../../faq/programming.rst:2165 #, fuzzy msgid "" "``bar`` imports ``foo`` (which is a no-op since there already is a module " @@ -4277,7 +4296,7 @@ msgid "" msgstr "" "``bar`` 引入 ``foo``(這是一個空操作,因為已經有一個名為 ``foo`` 的模組)" -#: ../../faq/programming.rst:2159 +#: ../../faq/programming.rst:2166 #, fuzzy msgid "" "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " @@ -4286,7 +4305,7 @@ msgstr "" "引入機制嘗試從 ``foo`` 全域變數中讀取 ``foo_var`` ,以設定 ``bar.foo_var = " "foo.foo_var`` " -#: ../../faq/programming.rst:2161 +#: ../../faq/programming.rst:2168 #, fuzzy msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " @@ -4295,7 +4314,7 @@ msgstr "" "最後一步失敗了,因為 Python 還沒有完成對 ``foo`` 的直譯,而 ``foo`` 的全域符" "號字典仍然是空的。" -#: ../../faq/programming.rst:2164 +#: ../../faq/programming.rst:2171 #, fuzzy msgid "" "The same thing happens when you use ``import foo``, and then try to access " @@ -4304,11 +4323,11 @@ msgstr "" "當你使用 ``import foo``,然後嘗試在全域程式碼中存取 ``foo.foo_var`` 時,也會" "發生同樣的事情。" -#: ../../faq/programming.rst:2167 +#: ../../faq/programming.rst:2174 msgid "There are (at least) three possible workarounds for this problem." msgstr "此問題有(至少)三種可能的解決方法。" -#: ../../faq/programming.rst:2169 +#: ../../faq/programming.rst:2176 #, fuzzy msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." @@ -4321,28 +4340,28 @@ msgstr "" "函式中。全域變數和類別變數的初始化應該只使用常數或內建函式。這意味著來自引入" "模組的所有內容都被參照為 ``.``。" -#: ../../faq/programming.rst:2174 +#: ../../faq/programming.rst:2181 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "Jim Roskind 建議在每個模組中按以下順序執行各個步驟:" -#: ../../faq/programming.rst:2176 +#: ../../faq/programming.rst:2183 #, fuzzy msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "導出(不需要引入基底類別的全域變數、函式和類別)" -#: ../../faq/programming.rst:2178 +#: ../../faq/programming.rst:2185 msgid "``import`` statements" msgstr "``import`` 陳述式" -#: ../../faq/programming.rst:2179 +#: ../../faq/programming.rst:2186 msgid "" "active code (including globals that are initialized from imported values)." msgstr "活躍程式碼(包括從引入值初始化的全域變數)。" -#: ../../faq/programming.rst:2181 +#: ../../faq/programming.rst:2188 #, fuzzy msgid "" "Van Rossum doesn't like this approach much because the imports appear in a " @@ -4350,21 +4369,21 @@ msgid "" msgstr "" "Van Rossum 不太喜歡這種方法,因為引入出現在一個奇怪的地方,但它確實有效。" -#: ../../faq/programming.rst:2184 +#: ../../faq/programming.rst:2191 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "Matthias Urlichs 建議重構你的程式碼,以便打從一開始就不需要遞迴引入。" -#: ../../faq/programming.rst:2187 +#: ../../faq/programming.rst:2194 msgid "These solutions are not mutually exclusive." msgstr "這些方案並不衝突。" -#: ../../faq/programming.rst:2191 +#: ../../faq/programming.rst:2198 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "__import__('x.y.z') 回傳 ,那我怎麼得到 z?" -#: ../../faq/programming.rst:2193 +#: ../../faq/programming.rst:2200 #, fuzzy msgid "" "Consider using the convenience function :func:`~importlib.import_module` " @@ -4373,17 +4392,17 @@ msgstr "" "考慮使用來自 :mod:`importlib` 的便利函式 :func:`~importlib.import_module` 代" "替: ::" -#: ../../faq/programming.rst:2196 +#: ../../faq/programming.rst:2203 msgid "z = importlib.import_module('x.y.z')" msgstr "z = importlib.import_module('x.y.z')" -#: ../../faq/programming.rst:2200 +#: ../../faq/programming.rst:2207 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "當我編輯需要引入的模組並重新引入它時,更動沒有反應出來。為什麼會這樣?" -#: ../../faq/programming.rst:2202 +#: ../../faq/programming.rst:2209 #, fuzzy msgid "" "For reasons of efficiency as well as consistency, Python only reads the " @@ -4396,7 +4415,7 @@ msgstr "" "一個由許多模組組成的程式中,每個模組都引入相同的基本模組,基本模組將被解析和" "重新解析很多次。要強制重新讀取已更改的模組,請執行以下操作: ::" -#: ../../faq/programming.rst:2208 +#: ../../faq/programming.rst:2215 msgid "" "import importlib\n" "import modname\n" @@ -4406,18 +4425,18 @@ msgstr "" "import modname\n" "importlib.reload(modname)" -#: ../../faq/programming.rst:2212 +#: ../../faq/programming.rst:2219 #, fuzzy msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "警告:此技術並非 100% 萬無一失。尤其是,包含像這樣的陳述式的模組: ::" -#: ../../faq/programming.rst:2215 +#: ../../faq/programming.rst:2222 msgid "from modname import some_objects" msgstr "from modname import some_objects" -#: ../../faq/programming.rst:2217 +#: ../../faq/programming.rst:2224 #, fuzzy msgid "" "will continue to work with the old version of the imported objects. If the " @@ -4428,7 +4447,7 @@ msgstr "" "將繼續使用舊版本的引入物件。如果模組包含類別定義,現有的類別實例將*不會*更新" "為使用新的類別定義。這可能會導致以下自相矛盾的行為: ::" -#: ../../faq/programming.rst:2222 +#: ../../faq/programming.rst:2229 msgid "" ">>> import importlib\n" ">>> import cls\n" @@ -4439,13 +4458,13 @@ msgid "" "False" msgstr "" -#: ../../faq/programming.rst:2230 +#: ../../faq/programming.rst:2237 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" msgstr "如果印出類別物件的「識別性」,問題的本質就很清楚了: ::" -#: ../../faq/programming.rst:2233 +#: ../../faq/programming.rst:2240 msgid "" ">>> hex(id(c.__class__))\n" "'0x7352a0'\n" diff --git a/glossary.po b/glossary.po index 302ad5c3c8..d4d86c08f8 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -782,12 +782,13 @@ msgid "docstring" msgstr "docstring(說明字串)" #: ../../glossary.rst:343 +#, fuzzy msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " -"the compiler and put into the :attr:`!__doc__` attribute of the enclosing " -"class, function or module. Since it is available via introspection, it is " -"the canonical place for documentation of the object." +"the compiler and put into the :attr:`~definition.__doc__` attribute of the " +"enclosing class, function or module. Since it is available via " +"introspection, it is the canonical place for documentation of the object." msgstr "" "一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" "時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:`!" @@ -2792,9 +2793,10 @@ msgid "type" msgstr "type(型別)" #: ../../glossary.rst:1232 +#, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " -"object has a type. An object's type is accessible as its :attr:`~instance." +"object has a type. An object's type is accessible as its :attr:`~object." "__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" "一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" diff --git a/howto/annotations.po b/howto/annotations.po index c4450542af..3c01650d00 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-11-08 23:11+0800\n" "Last-Translator: rockleon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -188,13 +188,14 @@ msgid "This will print the annotations dict from ``Base``, not ``Derived``." msgstr "這將印出 (print) 來自 ``Base`` 的註釋字典,而不是 ``Derived``。" #: ../../howto/annotations.rst:101 +#, fuzzy msgid "" "Your code will have to have a separate code path if the object you're " "examining is a class (``isinstance(o, type)``). In that case, best practice " "relies on an implementation detail of Python 3.9 and before: if a class has " -"annotations defined, they are stored in the class's ``__dict__`` " +"annotations defined, they are stored in the class's :attr:`~type.__dict__` " "dictionary. Since the class may or may not have annotations defined, best " -"practice is to call the ``get`` method on the class dict." +"practice is to call the :meth:`~dict.get` method on the class dict." msgstr "" "如果你正在檢查的物件是一個類別 (``isinstance(o, type)``),你的程式碼將必須有" "一個單獨的程式碼路徑。在這種情況下,最佳實踐依賴 Python 3.9 及之前版本的實作" @@ -233,10 +234,11 @@ msgstr "" "用 :func:`isinstance` 仔細檢查 ``ann`` 的型別。" #: ../../howto/annotations.rst:123 +#, fuzzy msgid "" -"Note that some exotic or malformed type objects may not have a ``__dict__`` " -"attribute, so for extra safety you may also wish to use :func:`getattr` to " -"access ``__dict__``." +"Note that some exotic or malformed type objects may not have a :attr:`~type." +"__dict__` attribute, so for extra safety you may also wish to use :func:" +"`getattr` to access :attr:`!__dict__`." msgstr "" "請注意,某些外來 (exotic) 或格式錯誤 (malform) 的型別物件可能沒有 " "``__dict__`` 屬性,因此為了額外的安全,你可能還希望使用 :func:`getattr` 來存" diff --git a/howto/descriptor.po b/howto/descriptor.po index 973d24eabd..23a5569cfa 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -810,8 +810,8 @@ msgstr "" msgid "" "The expression ``obj.x`` looks up the attribute ``x`` in the chain of " "namespaces for ``obj``. If the search finds a descriptor outside of the " -"instance ``__dict__``, its :meth:`__get__` method is invoked according to " -"the precedence rules listed below." +"instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is " +"invoked according to the precedence rules listed below." msgstr "" #: ../../howto/descriptor.rst:568 diff --git a/howto/enum.po b/howto/enum.po index 8e243e281d..ae361cc86a 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1137,9 +1137,9 @@ msgstr "" #: ../../howto/enum.rst:610 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" -"`~definition.__qualname__` being set to the location where pickle will be " -"able to find the class. For example, if the class was made available in " -"class SomeData in the global scope::" +"`~type.__qualname__` being set to the location where pickle will be able to " +"find the class. For example, if the class was made available in class " +"SomeData in the global scope::" msgstr "" #: ../../howto/enum.rst:615 diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po new file mode 100644 index 0000000000..24a20d0c2e --- /dev/null +++ b/howto/free-threading-python.po @@ -0,0 +1,257 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../howto/free-threading-python.rst:5 +msgid "Python experimental support for free threading" +msgstr "" + +#: ../../howto/free-threading-python.rst:7 +msgid "" +"Starting with the 3.13 release, CPython has experimental support for a build " +"of Python called :term:`free threading` where the :term:`global interpreter " +"lock` (GIL) is disabled. Free-threaded execution allows for full " +"utilization of the available processing power by running threads in parallel " +"on available CPU cores. While not all software will benefit from this " +"automatically, programs designed with threading in mind will run faster on " +"multi-core hardware." +msgstr "" + +#: ../../howto/free-threading-python.rst:14 +msgid "" +"**The free-threaded mode is experimental** and work is ongoing to improve " +"it: expect some bugs and a substantial single-threaded performance hit." +msgstr "" + +#: ../../howto/free-threading-python.rst:17 +msgid "" +"This document describes the implications of free threading for Python code. " +"See :ref:`freethreading-extensions-howto` for information on how to write C " +"extensions that support the free-threaded build." +msgstr "" + +#: ../../howto/free-threading-python.rst:23 +msgid "" +":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " +"overall description of free-threaded Python." +msgstr "" + +#: ../../howto/free-threading-python.rst:28 +msgid "Installation" +msgstr "" + +#: ../../howto/free-threading-python.rst:30 +msgid "" +"Starting with Python 3.13, the official macOS and Windows installers " +"optionally support installing free-threaded Python binaries. The installers " +"are available at https://www.python.org/downloads/." +msgstr "" + +#: ../../howto/free-threading-python.rst:34 +msgid "" +"For information on other platforms, see the `Installing a Free-Threaded " +"Python `_, a " +"community-maintained installation guide for installing free-threaded Python." +msgstr "" + +#: ../../howto/free-threading-python.rst:38 +msgid "" +"When building CPython from source, the :option:`--disable-gil` configure " +"option should be used to build a free-threaded Python interpreter." +msgstr "" + +#: ../../howto/free-threading-python.rst:43 +msgid "Identifying free-threaded Python" +msgstr "" + +#: ../../howto/free-threading-python.rst:45 +msgid "" +"To check if the current interpreter supports free-threading, :option:`python " +"-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " +"build\". The new :func:`sys._is_gil_enabled` function can be used to check " +"whether the GIL is actually disabled in the running process." +msgstr "" + +#: ../../howto/free-threading-python.rst:50 +msgid "" +"The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " +"can be used to determine whether the build supports free threading. If the " +"variable is set to ``1``, then the build supports free threading. This is " +"the recommended mechanism for decisions related to the build configuration." +msgstr "" + +#: ../../howto/free-threading-python.rst:57 +msgid "The global interpreter lock in free-threaded Python" +msgstr "" + +#: ../../howto/free-threading-python.rst:59 +msgid "" +"Free-threaded builds of CPython support optionally running with the GIL " +"enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " +"the command-line option :option:`-X gil`." +msgstr "" + +#: ../../howto/free-threading-python.rst:63 +msgid "" +"The GIL may also automatically be enabled when importing a C-API extension " +"module that is not explicitly marked as supporting free threading. A " +"warning will be printed in this case." +msgstr "" + +#: ../../howto/free-threading-python.rst:67 +msgid "" +"In addition to individual package documentation, the following websites " +"track the status of popular packages support for free threading:" +msgstr "" + +#: ../../howto/free-threading-python.rst:70 +msgid "https://py-free-threading.github.io/tracking/" +msgstr "" + +#: ../../howto/free-threading-python.rst:71 +msgid "https://hugovk.github.io/free-threaded-wheels/" +msgstr "" + +#: ../../howto/free-threading-python.rst:75 +msgid "Thread safety" +msgstr "" + +#: ../../howto/free-threading-python.rst:77 +msgid "" +"The free-threaded build of CPython aims to provide similar thread-safety " +"behavior at the Python level to the default GIL-enabled build. Built-in " +"types like :class:`dict`, :class:`list`, and :class:`set` use internal locks " +"to protect against concurrent modifications in ways that behave similarly to " +"the GIL. However, Python has not historically guaranteed specific behavior " +"for concurrent modifications to these built-in types, so this should be " +"treated as a description of the current implementation, not a guarantee of " +"current or future behavior." +msgstr "" + +#: ../../howto/free-threading-python.rst:88 +msgid "" +"It's recommended to use the :class:`threading.Lock` or other synchronization " +"primitives instead of relying on the internal locks of built-in types, when " +"possible." +msgstr "" + +#: ../../howto/free-threading-python.rst:94 +msgid "Known limitations" +msgstr "" + +#: ../../howto/free-threading-python.rst:96 +msgid "" +"This section describes known limitations of the free-threaded CPython build." +msgstr "" + +#: ../../howto/free-threading-python.rst:99 +msgid "Immortalization" +msgstr "" + +#: ../../howto/free-threading-python.rst:101 +msgid "" +"The free-threaded build of the 3.13 release makes some objects :term:" +"`immortal`. Immortal objects are not deallocated and have reference counts " +"that are never modified. This is done to avoid reference count contention " +"that would prevent efficient multi-threaded scaling." +msgstr "" + +#: ../../howto/free-threading-python.rst:106 +msgid "" +"An object will be made immortal when a new thread is started for the first " +"time after the main thread is running. The following objects are " +"immortalized:" +msgstr "" + +#: ../../howto/free-threading-python.rst:109 +msgid "" +":ref:`function ` objects declared at the module level" +msgstr "" + +#: ../../howto/free-threading-python.rst:110 +msgid ":ref:`method ` descriptors" +msgstr "" + +#: ../../howto/free-threading-python.rst:111 +msgid ":ref:`code ` objects" +msgstr "" + +#: ../../howto/free-threading-python.rst:112 +msgid ":term:`module` objects and their dictionaries" +msgstr "" + +#: ../../howto/free-threading-python.rst:113 +msgid ":ref:`classes ` (type objects)" +msgstr "" + +#: ../../howto/free-threading-python.rst:115 +msgid "" +"Because immortal objects are never deallocated, applications that create " +"many objects of these types may see increased memory usage. This is " +"expected to be addressed in the 3.14 release." +msgstr "" + +#: ../../howto/free-threading-python.rst:119 +msgid "" +"Additionally, numeric and string literals in the code as well as strings " +"returned by :func:`sys.intern` are also immortalized. This behavior is " +"expected to remain in the 3.14 free-threaded build." +msgstr "" + +#: ../../howto/free-threading-python.rst:125 +msgid "Frame objects" +msgstr "" + +#: ../../howto/free-threading-python.rst:127 +msgid "" +"It is not safe to access :ref:`frame ` objects from other " +"threads and doing so may cause your program to crash . This means that :" +"func:`sys._current_frames` is generally not safe to use in a free-threaded " +"build. Functions like :func:`inspect.currentframe` and :func:`sys." +"_getframe` are generally safe as long as the resulting frame object is not " +"passed to another thread." +msgstr "" + +#: ../../howto/free-threading-python.rst:135 +msgid "Iterators" +msgstr "" + +#: ../../howto/free-threading-python.rst:137 +msgid "" +"Sharing the same iterator object between multiple threads is generally not " +"safe and threads may see duplicate or missing elements when iterating or " +"crash the interpreter." +msgstr "" + +#: ../../howto/free-threading-python.rst:143 +msgid "Single-threaded performance" +msgstr "" + +#: ../../howto/free-threading-python.rst:145 +msgid "" +"The free-threaded build has additional overhead when executing Python code " +"compared to the default GIL-enabled build. In 3.13, this overhead is about " +"40% on the `pyperformance `_ suite. " +"Programs that spend most of their time in C extensions or I/O will see less " +"of an impact. The largest impact is because the specializing adaptive " +"interpreter (:pep:`659`) is disabled in the free-threaded build. We expect " +"to re-enable it in a thread-safe way in the 3.14 release. This overhead is " +"expected to be reduced in upcoming Python release. We are aiming for an " +"overhead of 10% or less on the pyperformance suite compared to the default " +"GIL-enabled build." +msgstr "" diff --git a/howto/index.po b/howto/index.po index d0d55f2163..ea54ad59f6 100644 --- a/howto/index.po +++ b/howto/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2021-07-05 12:45+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,103 +36,107 @@ msgstr "" "些單一、特定的主題。以 Linux 說明文件專案的 HOWTO 系列為模範,本系列的目標是" "提供比 Python 函式庫參考手冊更實用的說明文件。" -#: ../../howto/index.rst:37 +#: ../../howto/index.rst:38 msgid "General:" msgstr "" -#: ../../howto/index.rst:39 +#: ../../howto/index.rst:40 msgid ":ref:`annotations-howto`" msgstr "" -#: ../../howto/index.rst:40 +#: ../../howto/index.rst:41 msgid ":ref:`argparse-tutorial`" msgstr "" -#: ../../howto/index.rst:41 +#: ../../howto/index.rst:42 msgid ":ref:`descriptorhowto`" msgstr "" -#: ../../howto/index.rst:42 +#: ../../howto/index.rst:43 msgid ":ref:`enum-howto`" msgstr "" -#: ../../howto/index.rst:43 +#: ../../howto/index.rst:44 msgid ":ref:`functional-howto`" msgstr "" -#: ../../howto/index.rst:44 +#: ../../howto/index.rst:45 msgid ":ref:`ipaddress-howto`" msgstr "" -#: ../../howto/index.rst:45 +#: ../../howto/index.rst:46 msgid ":ref:`logging-howto`" msgstr "" -#: ../../howto/index.rst:46 +#: ../../howto/index.rst:47 msgid ":ref:`logging-cookbook`" msgstr "" -#: ../../howto/index.rst:47 +#: ../../howto/index.rst:48 msgid ":ref:`regex-howto`" msgstr "" -#: ../../howto/index.rst:48 +#: ../../howto/index.rst:49 msgid ":ref:`sortinghowto`" msgstr "" -#: ../../howto/index.rst:49 +#: ../../howto/index.rst:50 msgid ":ref:`unicode-howto`" msgstr "" -#: ../../howto/index.rst:50 +#: ../../howto/index.rst:51 msgid ":ref:`urllib-howto`" msgstr "" -#: ../../howto/index.rst:52 +#: ../../howto/index.rst:53 msgid "Advanced development:" msgstr "" -#: ../../howto/index.rst:54 +#: ../../howto/index.rst:55 msgid ":ref:`curses-howto`" msgstr "" -#: ../../howto/index.rst:55 +#: ../../howto/index.rst:56 +msgid ":ref:`freethreading-python-howto`" +msgstr "" + +#: ../../howto/index.rst:57 msgid ":ref:`freethreading-extensions-howto`" msgstr "" -#: ../../howto/index.rst:56 +#: ../../howto/index.rst:58 msgid ":ref:`isolating-extensions-howto`" msgstr "" -#: ../../howto/index.rst:57 +#: ../../howto/index.rst:59 msgid ":ref:`python_2.3_mro`" msgstr "" -#: ../../howto/index.rst:58 +#: ../../howto/index.rst:60 msgid ":ref:`socket-howto`" msgstr "" -#: ../../howto/index.rst:59 +#: ../../howto/index.rst:61 msgid ":ref:`timerfd-howto`" msgstr "" -#: ../../howto/index.rst:60 +#: ../../howto/index.rst:62 msgid ":ref:`cporting-howto`" msgstr "" -#: ../../howto/index.rst:62 +#: ../../howto/index.rst:64 msgid "Debugging and profiling:" msgstr "" -#: ../../howto/index.rst:64 +#: ../../howto/index.rst:66 msgid ":ref:`gdb`" msgstr "" -#: ../../howto/index.rst:65 +#: ../../howto/index.rst:67 msgid ":ref:`instrumentation`" msgstr "" -#: ../../howto/index.rst:66 +#: ../../howto/index.rst:68 msgid ":ref:`perf_profiling`" msgstr "" diff --git a/howto/mro.po b/howto/mro.po index 816adb559d..625bb55f05 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -527,7 +527,7 @@ msgstr "" msgid "" "A lazy programmer can obtain the MRO directly from Python 2.2, since in this " "case it coincides with the Python 2.3 linearization. It is enough to invoke " -"the .mro() method of class A:" +"the :meth:`~type.mro` method of class A:" msgstr "" #: ../../howto/mro.rst:345 diff --git a/library/abc.po b/library/abc.po index e6231cfde5..b8f6fa2e7a 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -183,11 +183,12 @@ msgid "(Must be defined as a class method.)" msgstr "(必須定義為類別方法。)" #: ../../library/abc.rst:98 +#, fuzzy msgid "" "Check whether *subclass* is considered a subclass of this ABC. This means " "that you can customize the behavior of :func:`issubclass` further without " "the need to call :meth:`register` on every class you want to consider a " -"subclass of the ABC. (This class method is called from the :meth:`~class." +"subclass of the ABC. (This class method is called from the :meth:`~type." "__subclasscheck__` method of the ABC.)" msgstr "" "檢查 *subclass* 是否該被認為是該 ABC 的子類別,也就是說你可以直接自訂 :func:" @@ -282,11 +283,12 @@ msgstr "" "是 ``MyIterable`` 抽象基底類別的一部分,但它不必被非抽象衍生類別覆寫。" #: ../../library/abc.rst:149 +#, fuzzy msgid "" "The :meth:`__subclasshook__` class method defined here says that any class " "that has an :meth:`~iterator.__iter__` method in its :attr:`~object." "__dict__` (or in that of one of its base classes, accessed via the :attr:" -"`~class.__mro__` list) is considered a ``MyIterable`` too." +"`~type.__mro__` list) is considered a ``MyIterable`` too." msgstr "" "這裡定義的 :meth:`__subclasshook__` 類別方法說明任何在其 :attr:`~object." "__dict__` (或在其透過 :attr:`~class.__mro__` 列表訪問的基底類別) 中具有 :" diff --git a/library/argparse.po b/library/argparse.po index 8c2959c432..9038af0eac 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,7 +514,7 @@ msgstr "" msgid "*exit_on_error* parameter was added." msgstr "新增 *exit_on_error* 參數。" -#: ../../library/argparse.rst:244 ../../library/argparse.rst:782 +#: ../../library/argparse.rst:244 ../../library/argparse.rst:783 msgid "The following sections describe how each of these are used." msgstr "" @@ -524,14 +524,15 @@ msgstr "" #: ../../library/argparse.rst:252 msgid "" -"By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine " -"how to display the name of the program in help messages. This default is " -"almost always desirable because it will make the help messages match how the " -"program was invoked on the command line. For example, consider a file named " +"By default, :class:`ArgumentParser` objects use the base name (see :func:`os." +"path.basename`) of ``sys.argv[0]`` to determine how to display the name of " +"the program in help messages. This default is almost always desirable " +"because it will make the help messages match the name that was used to " +"invoke the program on the command line. For example, consider a file named " "``myprogram.py`` with the following code::" msgstr "" -#: ../../library/argparse.rst:258 ../../library/argparse.rst:678 +#: ../../library/argparse.rst:259 ../../library/argparse.rst:679 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -543,13 +544,13 @@ msgstr "" "parser.add_argument('--foo', help='foo help')\n" "args = parser.parse_args()" -#: ../../library/argparse.rst:263 +#: ../../library/argparse.rst:264 msgid "" "The help for this program will display ``myprogram.py`` as the program name " "(regardless of where the program was invoked from):" msgstr "" -#: ../../library/argparse.rst:266 +#: ../../library/argparse.rst:267 msgid "" "$ python myprogram.py --help\n" "usage: myprogram.py [-h] [--foo FOO]\n" @@ -579,13 +580,13 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo help" -#: ../../library/argparse.rst:282 +#: ../../library/argparse.rst:283 msgid "" "To change this default behavior, another value can be supplied using the " "``prog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:285 +#: ../../library/argparse.rst:286 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -601,14 +602,14 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:292 +#: ../../library/argparse.rst:293 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " "the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " "format specifier." msgstr "" -#: ../../library/argparse.rst:298 +#: ../../library/argparse.rst:299 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -628,17 +629,17 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" -#: ../../library/argparse.rst:309 +#: ../../library/argparse.rst:310 msgid "usage" msgstr "" -#: ../../library/argparse.rst:311 +#: ../../library/argparse.rst:312 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " "arguments it contains::" msgstr "" -#: ../../library/argparse.rst:314 +#: ../../library/argparse.rst:315 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" @@ -666,12 +667,12 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" -#: ../../library/argparse.rst:327 +#: ../../library/argparse.rst:328 msgid "" "The default message can be overridden with the ``usage=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:329 +#: ../../library/argparse.rst:330 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -701,17 +702,17 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" -#: ../../library/argparse.rst:342 +#: ../../library/argparse.rst:343 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." msgstr "" -#: ../../library/argparse.rst:349 +#: ../../library/argparse.rst:350 msgid "description" msgstr "描述" -#: ../../library/argparse.rst:351 +#: ../../library/argparse.rst:352 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " @@ -720,7 +721,7 @@ msgid "" "messages for the various arguments::" msgstr "" -#: ../../library/argparse.rst:357 +#: ../../library/argparse.rst:358 msgid "" ">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" ">>> parser.print_help()\n" @@ -740,24 +741,24 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:366 +#: ../../library/argparse.rst:367 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." msgstr "" -#: ../../library/argparse.rst:371 +#: ../../library/argparse.rst:372 msgid "epilog" msgstr "" -#: ../../library/argparse.rst:373 +#: ../../library/argparse.rst:374 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:377 +#: ../../library/argparse.rst:378 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -785,18 +786,18 @@ msgstr "" "\n" "And that's how you'd foo a bar" -#: ../../library/argparse.rst:390 +#: ../../library/argparse.rst:391 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:396 +#: ../../library/argparse.rst:397 msgid "parents" msgstr "" -#: ../../library/argparse.rst:398 +#: ../../library/argparse.rst:399 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -807,7 +808,7 @@ msgid "" "object being constructed::" msgstr "" -#: ../../library/argparse.rst:405 +#: ../../library/argparse.rst:406 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -835,32 +836,32 @@ msgstr "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" -#: ../../library/argparse.rst:418 +#: ../../library/argparse.rst:419 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -#: ../../library/argparse.rst:423 +#: ../../library/argparse.rst:424 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " "not be reflected in the child." msgstr "" -#: ../../library/argparse.rst:431 +#: ../../library/argparse.rst:432 msgid "formatter_class" msgstr "formatter_class" -#: ../../library/argparse.rst:433 +#: ../../library/argparse.rst:434 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " "classes:" msgstr "" -#: ../../library/argparse.rst:442 +#: ../../library/argparse.rst:443 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -868,7 +869,7 @@ msgid "" "command-line help messages::" msgstr "" -#: ../../library/argparse.rst:447 +#: ../../library/argparse.rst:448 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -892,14 +893,14 @@ msgid "" "will be wrapped across a couple lines" msgstr "" -#: ../../library/argparse.rst:467 +#: ../../library/argparse.rst:468 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " "should not be line-wrapped::" msgstr "" -#: ../../library/argparse.rst:471 +#: ../../library/argparse.rst:472 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -924,7 +925,7 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: ../../library/argparse.rst:493 +#: ../../library/argparse.rst:494 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " "text, including argument descriptions. However, multiple new lines are " @@ -932,13 +933,13 @@ msgid "" "between the newlines." msgstr "" -#: ../../library/argparse.rst:498 +#: ../../library/argparse.rst:499 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" msgstr "" -#: ../../library/argparse.rst:501 +#: ../../library/argparse.rst:502 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -970,14 +971,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" -#: ../../library/argparse.rst:516 +#: ../../library/argparse.rst:517 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " "dest_ as the regular formatter does)::" msgstr "" -#: ../../library/argparse.rst:520 +#: ../../library/argparse.rst:521 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -1009,11 +1010,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo int" -#: ../../library/argparse.rst:537 +#: ../../library/argparse.rst:538 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:539 +#: ../../library/argparse.rst:540 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " @@ -1021,7 +1022,7 @@ msgid "" "``prefix_chars=`` argument to the ArgumentParser constructor::" msgstr "" -#: ../../library/argparse.rst:545 +#: ../../library/argparse.rst:546 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -1035,18 +1036,18 @@ msgstr "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" -#: ../../library/argparse.rst:551 +#: ../../library/argparse.rst:552 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " "disallowed." msgstr "" -#: ../../library/argparse.rst:557 +#: ../../library/argparse.rst:558 msgid "fromfile_prefix_chars" msgstr "fromfile_prefix_chars" -#: ../../library/argparse.rst:559 +#: ../../library/argparse.rst:560 msgid "" "Sometimes, when dealing with a particularly long argument list, it may make " "sense to keep the list of arguments in a file rather than typing it out at " @@ -1056,7 +1057,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: ../../library/argparse.rst:566 +#: ../../library/argparse.rst:567 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -1074,7 +1075,7 @@ msgstr "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" -#: ../../library/argparse.rst:574 +#: ../../library/argparse.rst:575 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -1084,19 +1085,19 @@ msgid "" "f', 'bar']``." msgstr "" -#: ../../library/argparse.rst:580 +#: ../../library/argparse.rst:581 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" -#: ../../library/argparse.rst:583 +#: ../../library/argparse.rst:584 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: ../../library/argparse.rst:586 +#: ../../library/argparse.rst:587 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) >> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -1139,22 +1140,22 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace()" -#: ../../library/argparse.rst:616 +#: ../../library/argparse.rst:617 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:618 +#: ../../library/argparse.rst:619 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -#: ../../library/argparse.rst:622 +#: ../../library/argparse.rst:623 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:624 +#: ../../library/argparse.rst:625 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -1170,11 +1171,11 @@ msgstr "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" -#: ../../library/argparse.rst:635 +#: ../../library/argparse.rst:636 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:637 +#: ../../library/argparse.rst:638 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -1182,7 +1183,7 @@ msgid "" "that is already in use::" msgstr "" -#: ../../library/argparse.rst:642 +#: ../../library/argparse.rst:643 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -1198,7 +1199,7 @@ msgstr "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" -#: ../../library/argparse.rst:649 +#: ../../library/argparse.rst:650 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -1206,7 +1207,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:654 +#: ../../library/argparse.rst:655 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -1232,7 +1233,7 @@ msgstr "" " -f FOO old foo help\n" " --foo FOO new foo help" -#: ../../library/argparse.rst:665 +#: ../../library/argparse.rst:666 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -1240,24 +1241,24 @@ msgid "" "option string was overridden." msgstr "" -#: ../../library/argparse.rst:672 +#: ../../library/argparse.rst:673 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:674 +#: ../../library/argparse.rst:675 msgid "" "By default, ArgumentParser objects add an option which simply displays the " "parser's help message. For example, consider a file named ``myprogram.py`` " "containing the following code::" msgstr "" -#: ../../library/argparse.rst:683 +#: ../../library/argparse.rst:684 msgid "" "If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser " "help will be printed:" msgstr "" -#: ../../library/argparse.rst:686 +#: ../../library/argparse.rst:687 msgid "" "$ python myprogram.py --help\n" "usage: myprogram.py [-h] [--foo FOO]\n" @@ -1273,14 +1274,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo help" -#: ../../library/argparse.rst:695 +#: ../../library/argparse.rst:696 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:699 +#: ../../library/argparse.rst:700 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -1298,7 +1299,7 @@ msgstr "" "options:\n" " --foo FOO foo help" -#: ../../library/argparse.rst:707 +#: ../../library/argparse.rst:708 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -1306,7 +1307,7 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: ../../library/argparse.rst:713 +#: ../../library/argparse.rst:714 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -1322,24 +1323,24 @@ msgstr "" "options:\n" " +h, ++help show this help message and exit" -#: ../../library/argparse.rst:722 +#: ../../library/argparse.rst:723 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:724 +#: ../../library/argparse.rst:725 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "exit with error info." msgstr "" -#: ../../library/argparse.rst:727 +#: ../../library/argparse.rst:728 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:730 +#: ../../library/argparse.rst:731 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -1365,81 +1366,81 @@ msgstr "" "...\n" "Catching an argumentError" -#: ../../library/argparse.rst:744 +#: ../../library/argparse.rst:745 msgid "The add_argument() method" msgstr "" -#: ../../library/argparse.rst:750 +#: ../../library/argparse.rst:751 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:753 +#: ../../library/argparse.rst:754 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " "or ``-f, --foo``." msgstr "" -#: ../../library/argparse.rst:756 +#: ../../library/argparse.rst:757 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:759 +#: ../../library/argparse.rst:760 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:761 +#: ../../library/argparse.rst:762 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:763 +#: ../../library/argparse.rst:764 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:766 +#: ../../library/argparse.rst:767 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:768 +#: ../../library/argparse.rst:769 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:770 +#: ../../library/argparse.rst:771 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:773 +#: ../../library/argparse.rst:774 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:775 +#: ../../library/argparse.rst:776 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:778 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:780 +#: ../../library/argparse.rst:781 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "" -#: ../../library/argparse.rst:788 +#: ../../library/argparse.rst:789 msgid "name or flags" msgstr "" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:791 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1448,30 +1449,30 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:796 +#: ../../library/argparse.rst:797 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:798 +#: ../../library/argparse.rst:799 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:800 +#: ../../library/argparse.rst:801 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:802 +#: ../../library/argparse.rst:803 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:804 +#: ../../library/argparse.rst:805 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:808 +#: ../../library/argparse.rst:809 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1495,11 +1496,11 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:823 +#: ../../library/argparse.rst:824 msgid "action" msgstr "" -#: ../../library/argparse.rst:825 +#: ../../library/argparse.rst:826 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1509,13 +1510,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:831 +#: ../../library/argparse.rst:832 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action. For example::" msgstr "" -#: ../../library/argparse.rst:834 +#: ../../library/argparse.rst:835 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1527,7 +1528,7 @@ msgstr "" ">>> parser.parse_args('--foo 1'.split())\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:839 +#: ../../library/argparse.rst:840 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1535,7 +1536,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:844 +#: ../../library/argparse.rst:845 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1547,7 +1548,7 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:849 +#: ../../library/argparse.rst:850 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " @@ -1555,7 +1556,7 @@ msgid "" "``True`` respectively. For example::" msgstr "" -#: ../../library/argparse.rst:854 +#: ../../library/argparse.rst:855 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1571,7 +1572,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:861 +#: ../../library/argparse.rst:862 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -1580,7 +1581,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: ../../library/argparse.rst:867 +#: ../../library/argparse.rst:868 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append')\n" @@ -1592,7 +1593,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['1', '2'])" -#: ../../library/argparse.rst:872 +#: ../../library/argparse.rst:873 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -1601,7 +1602,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:878 +#: ../../library/argparse.rst:879 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1619,13 +1620,13 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" -#: ../../library/argparse.rst:884 +#: ../../library/argparse.rst:885 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:888 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1633,11 +1634,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: ../../library/argparse.rst:892 +#: ../../library/argparse.rst:893 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:894 +#: ../../library/argparse.rst:895 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1645,14 +1646,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:899 +#: ../../library/argparse.rst:900 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:903 +#: ../../library/argparse.rst:904 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1668,13 +1669,13 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:909 +#: ../../library/argparse.rst:910 msgid "" "``'extend'`` - This stores a list, and extends each argument value to the " "list. Example usage::" msgstr "" -#: ../../library/argparse.rst:913 +#: ../../library/argparse.rst:914 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1690,7 +1691,7 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:920 +#: ../../library/argparse.rst:921 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " "other object that implements the same interface. The " @@ -1698,7 +1699,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:925 +#: ../../library/argparse.rst:926 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1712,18 +1713,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:933 +#: ../../library/argparse.rst:934 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:937 +#: ../../library/argparse.rst:938 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:939 +#: ../../library/argparse.rst:940 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1744,15 +1745,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:957 +#: ../../library/argparse.rst:958 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:963 +#: ../../library/argparse.rst:964 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:965 +#: ../../library/argparse.rst:966 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " @@ -1760,13 +1761,13 @@ msgid "" "ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" -#: ../../library/argparse.rst:970 +#: ../../library/argparse.rst:971 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:973 +#: ../../library/argparse.rst:974 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1780,13 +1781,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:979 +#: ../../library/argparse.rst:980 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:984 +#: ../../library/argparse.rst:985 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1796,7 +1797,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:991 +#: ../../library/argparse.rst:992 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1818,13 +1819,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:1001 +#: ../../library/argparse.rst:1002 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:1004 +#: ../../library/argparse.rst:1005 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1850,7 +1851,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1018 +#: ../../library/argparse.rst:1019 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1858,7 +1859,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:1023 +#: ../../library/argparse.rst:1024 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1874,14 +1875,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:1032 +#: ../../library/argparse.rst:1033 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1037 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1899,7 +1900,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:1044 +#: ../../library/argparse.rst:1045 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1907,11 +1908,11 @@ msgid "" "be produced." msgstr "" -#: ../../library/argparse.rst:1052 +#: ../../library/argparse.rst:1053 msgid "const" msgstr "" -#: ../../library/argparse.rst:1054 +#: ../../library/argparse.rst:1055 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1919,7 +1920,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:1058 +#: ../../library/argparse.rst:1059 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1929,7 +1930,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:1066 +#: ../../library/argparse.rst:1067 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1939,17 +1940,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:1073 +#: ../../library/argparse.rst:1074 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:1080 +#: ../../library/argparse.rst:1081 msgid "default" msgstr "" -#: ../../library/argparse.rst:1082 +#: ../../library/argparse.rst:1083 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1959,7 +1960,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1089 +#: ../../library/argparse.rst:1090 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1975,13 +1976,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1096 +#: ../../library/argparse.rst:1097 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not over write it::" msgstr "" -#: ../../library/argparse.rst:1099 +#: ../../library/argparse.rst:1100 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1993,7 +1994,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:1104 +#: ../../library/argparse.rst:1105 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -2001,7 +2002,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1109 +#: ../../library/argparse.rst:1110 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -2015,13 +2016,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:1115 +#: ../../library/argparse.rst:1116 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1118 +#: ../../library/argparse.rst:1119 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -2039,11 +2040,18 @@ msgstr "" #: ../../library/argparse.rst:1126 msgid "" +"For required_ arguments, the ``default`` value is ignored. For example, this " +"applies to positional arguments with nargs_ values other than ``?`` or " +"``*``, or optional arguments marked as ``required=True``." +msgstr "" + +#: ../../library/argparse.rst:1130 +msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1129 +#: ../../library/argparse.rst:1133 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -2059,11 +2067,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1140 +#: ../../library/argparse.rst:1144 msgid "type" msgstr "" -#: ../../library/argparse.rst:1142 +#: ../../library/argparse.rst:1146 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -2072,13 +2080,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:1148 +#: ../../library/argparse.rst:1152 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:1151 +#: ../../library/argparse.rst:1155 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -2086,11 +2094,11 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:1156 +#: ../../library/argparse.rst:1160 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:1158 +#: ../../library/argparse.rst:1162 msgid "" "import argparse\n" "import pathlib\n" @@ -2118,11 +2126,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1172 +#: ../../library/argparse.rst:1176 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1174 +#: ../../library/argparse.rst:1178 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -2140,14 +2148,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1184 +#: ../../library/argparse.rst:1188 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1188 +#: ../../library/argparse.rst:1192 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -2155,7 +2163,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1193 +#: ../../library/argparse.rst:1197 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." @@ -2163,7 +2171,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1198 +#: ../../library/argparse.rst:1202 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses *FileType* and then a subsequent " @@ -2172,17 +2180,17 @@ msgid "" "run and then use the :keyword:`with`-statement to manage the files." msgstr "" -#: ../../library/argparse.rst:1204 +#: ../../library/argparse.rst:1208 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1211 +#: ../../library/argparse.rst:1215 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1213 +#: ../../library/argparse.rst:1217 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -2191,7 +2199,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1219 +#: ../../library/argparse.rst:1223 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -2211,14 +2219,14 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1228 +#: ../../library/argparse.rst:1232 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified::" msgstr "" -#: ../../library/argparse.rst:1232 +#: ../../library/argparse.rst:1236 msgid "" ">>> parser = argparse.ArgumentParser(prog='doors.py')\n" ">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" @@ -2236,19 +2244,19 @@ msgstr "" "usage: doors.py [-h] {1,2,3}\n" "doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" -#: ../../library/argparse.rst:1240 +#: ../../library/argparse.rst:1244 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1243 +#: ../../library/argparse.rst:1247 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1246 +#: ../../library/argparse.rst:1250 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -2256,11 +2264,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1255 +#: ../../library/argparse.rst:1259 msgid "required" msgstr "" -#: ../../library/argparse.rst:1257 +#: ../../library/argparse.rst:1261 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -2268,7 +2276,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1262 +#: ../../library/argparse.rst:1266 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2286,24 +2294,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1270 +#: ../../library/argparse.rst:1274 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1276 +#: ../../library/argparse.rst:1280 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1283 +#: ../../library/argparse.rst:1287 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1285 +#: ../../library/argparse.rst:1289 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -2311,7 +2319,7 @@ msgid "" "each argument::" msgstr "" -#: ../../library/argparse.rst:1290 +#: ../../library/argparse.rst:1294 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', action='store_true',\n" @@ -2343,7 +2351,7 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo foo the bars before frobbling" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1309 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -2352,7 +2360,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1310 +#: ../../library/argparse.rst:1314 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2378,19 +2386,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1322 +#: ../../library/argparse.rst:1326 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1325 +#: ../../library/argparse.rst:1329 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1332 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2408,11 +2416,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1340 +#: ../../library/argparse.rst:1344 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1346 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -2424,7 +2432,7 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1351 +#: ../../library/argparse.rst:1355 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2456,11 +2464,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1366 +#: ../../library/argparse.rst:1370 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1368 +#: ../../library/argparse.rst:1372 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2492,21 +2500,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1383 +#: ../../library/argparse.rst:1387 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1387 +#: ../../library/argparse.rst:1391 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1391 +#: ../../library/argparse.rst:1395 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2530,11 +2538,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1406 +#: ../../library/argparse.rst:1410 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1408 +#: ../../library/argparse.rst:1412 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2544,7 +2552,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1415 +#: ../../library/argparse.rst:1419 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2556,7 +2564,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1420 +#: ../../library/argparse.rst:1424 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2568,7 +2576,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1429 +#: ../../library/argparse.rst:1433 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2586,11 +2594,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1437 +#: ../../library/argparse.rst:1441 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1439 +#: ../../library/argparse.rst:1443 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2602,11 +2610,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1448 +#: ../../library/argparse.rst:1452 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1450 +#: ../../library/argparse.rst:1454 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2617,7 +2625,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1460 +#: ../../library/argparse.rst:1464 #, fuzzy msgid "" ">>> import argparse\n" @@ -2636,11 +2644,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1473 +#: ../../library/argparse.rst:1477 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1475 +#: ../../library/argparse.rst:1479 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " @@ -2648,7 +2656,7 @@ msgid "" "add_argument`." msgstr "" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1488 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -2657,7 +2665,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1490 +#: ../../library/argparse.rst:1494 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -2665,91 +2673,91 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1495 +#: ../../library/argparse.rst:1499 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1498 +#: ../../library/argparse.rst:1502 msgid "``parser`` - The ArgumentParser object which contains this action." msgstr "" -#: ../../library/argparse.rst:1500 +#: ../../library/argparse.rst:1504 msgid "" "``namespace`` - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1504 +#: ../../library/argparse.rst:1508 msgid "" "``values`` - The associated command-line arguments, with any type " "conversions applied. Type conversions are specified with the type_ keyword " "argument to :meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1508 +#: ../../library/argparse.rst:1512 msgid "" "``option_string`` - The option string that was used to invoke this action. " "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1512 +#: ../../library/argparse.rst:1516 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1515 +#: ../../library/argparse.rst:1519 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1524 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1524 +#: ../../library/argparse.rst:1528 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1527 +#: ../../library/argparse.rst:1531 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1535 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1538 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1539 +#: ../../library/argparse.rst:1543 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1541 +#: ../../library/argparse.rst:1545 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1545 +#: ../../library/argparse.rst:1549 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2767,14 +2775,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1553 +#: ../../library/argparse.rst:1557 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1557 +#: ../../library/argparse.rst:1561 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2782,13 +2790,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1560 +#: ../../library/argparse.rst:1564 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1563 +#: ../../library/argparse.rst:1567 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2796,13 +2804,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1566 +#: ../../library/argparse.rst:1570 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1569 +#: ../../library/argparse.rst:1573 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2818,11 +2826,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1578 +#: ../../library/argparse.rst:1582 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1580 +#: ../../library/argparse.rst:1584 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2830,7 +2838,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1585 +#: ../../library/argparse.rst:1589 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2852,11 +2860,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1606 +#: ../../library/argparse.rst:1610 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1608 +#: ../../library/argparse.rst:1612 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2868,7 +2876,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1616 +#: ../../library/argparse.rst:1620 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2901,7 +2909,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1646 +#: ../../library/argparse.rst:1650 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2909,7 +2917,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1651 +#: ../../library/argparse.rst:1655 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2917,24 +2925,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1654 +#: ../../library/argparse.rst:1658 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1660 +#: ../../library/argparse.rst:1664 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1666 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1670 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2958,17 +2966,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1677 +#: ../../library/argparse.rst:1681 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1683 +#: ../../library/argparse.rst:1687 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1685 +#: ../../library/argparse.rst:1689 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -2976,7 +2984,7 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1690 +#: ../../library/argparse.rst:1694 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -3002,24 +3010,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1705 +#: ../../library/argparse.rst:1709 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1713 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1712 +#: ../../library/argparse.rst:1716 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1716 +#: ../../library/argparse.rst:1720 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3033,14 +3041,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1722 +#: ../../library/argparse.rst:1726 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1730 msgid "" ">>> class C:\n" "... pass\n" @@ -3062,15 +3070,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1738 +#: ../../library/argparse.rst:1742 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1741 +#: ../../library/argparse.rst:1745 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1748 +#: ../../library/argparse.rst:1752 msgid "" "Many programs split up their functionality into a number of sub-commands, " "for example, the ``svn`` program can invoke sub-commands like ``svn " @@ -3086,69 +3094,69 @@ msgid "" "can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1760 +#: ../../library/argparse.rst:1764 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1762 +#: ../../library/argparse.rst:1766 msgid "" "title - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1766 +#: ../../library/argparse.rst:1770 msgid "" "description - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1769 +#: ../../library/argparse.rst:1773 msgid "" "prog - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1773 +#: ../../library/argparse.rst:1777 msgid "" "parser_class - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1776 +#: ../../library/argparse.rst:1780 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1779 +#: ../../library/argparse.rst:1783 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1782 +#: ../../library/argparse.rst:1786 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1785 +#: ../../library/argparse.rst:1789 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1787 +#: ../../library/argparse.rst:1791 msgid "" "metavar_ - string presenting available sub-commands in help; by default it " "is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1790 +#: ../../library/argparse.rst:1794 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1792 +#: ../../library/argparse.rst:1796 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -3170,7 +3178,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1811 +#: ../../library/argparse.rst:1815 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -3180,7 +3188,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1818 +#: ../../library/argparse.rst:1822 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -3189,7 +3197,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1826 +#: ../../library/argparse.rst:1830 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -3247,14 +3255,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1854 +#: ../../library/argparse.rst:1858 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1862 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3290,7 +3298,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1875 +#: ../../library/argparse.rst:1879 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3298,7 +3306,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1880 +#: ../../library/argparse.rst:1884 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3314,13 +3322,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1887 +#: ../../library/argparse.rst:1891 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1901 +#: ../../library/argparse.rst:1905 msgid "" "One particularly effective way of handling sub-commands is to combine the " "use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " @@ -3328,7 +3336,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1906 +#: ../../library/argparse.rst:1910 msgid "" ">>> # sub-command functions\n" ">>> def foo(args):\n" @@ -3363,7 +3371,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1938 +#: ../../library/argparse.rst:1942 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3373,7 +3381,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1945 +#: ../../library/argparse.rst:1949 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3393,15 +3401,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1958 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1959 +#: ../../library/argparse.rst:1963 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1963 +#: ../../library/argparse.rst:1967 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3410,7 +3418,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1969 +#: ../../library/argparse.rst:1973 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3428,14 +3436,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1975 +#: ../../library/argparse.rst:1979 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1983 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3447,15 +3455,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1984 +#: ../../library/argparse.rst:1988 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1989 +#: ../../library/argparse.rst:1993 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1997 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3464,7 +3472,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1999 +#: ../../library/argparse.rst:2003 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3488,7 +3496,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:2010 +#: ../../library/argparse.rst:2014 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3499,7 +3507,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:2018 +#: ../../library/argparse.rst:2022 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3537,13 +3545,13 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2036 +#: ../../library/argparse.rst:2040 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:2039 +#: ../../library/argparse.rst:2043 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3551,18 +3559,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:2047 +#: ../../library/argparse.rst:2051 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2055 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:2059 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3588,14 +3596,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2067 +#: ../../library/argparse.rst:2071 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:2075 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3613,7 +3621,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2079 +#: ../../library/argparse.rst:2083 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3621,7 +3629,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2085 +#: ../../library/argparse.rst:2089 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3657,7 +3665,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:2106 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3665,11 +3673,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:2110 +#: ../../library/argparse.rst:2114 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2114 +#: ../../library/argparse.rst:2118 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3678,7 +3686,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2120 +#: ../../library/argparse.rst:2124 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3692,12 +3700,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2126 +#: ../../library/argparse.rst:2130 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:2128 +#: ../../library/argparse.rst:2132 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3711,20 +3719,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2134 +#: ../../library/argparse.rst:2138 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2140 +#: ../../library/argparse.rst:2144 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2144 +#: ../../library/argparse.rst:2148 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3736,54 +3744,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2151 +#: ../../library/argparse.rst:2155 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:2153 +#: ../../library/argparse.rst:2157 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2159 +#: ../../library/argparse.rst:2163 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2165 +#: ../../library/argparse.rst:2169 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2169 +#: ../../library/argparse.rst:2173 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2174 +#: ../../library/argparse.rst:2178 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2179 +#: ../../library/argparse.rst:2183 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2184 +#: ../../library/argparse.rst:2188 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2188 +#: ../../library/argparse.rst:2192 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3794,7 +3802,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2197 +#: ../../library/argparse.rst:2201 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3808,7 +3816,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2204 +#: ../../library/argparse.rst:2208 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3816,11 +3824,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2211 +#: ../../library/argparse.rst:2215 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2215 +#: ../../library/argparse.rst:2219 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3828,20 +3836,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2220 +#: ../../library/argparse.rst:2224 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2224 +#: ../../library/argparse.rst:2228 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2227 +#: ../../library/argparse.rst:2231 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3851,18 +3859,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2233 +#: ../../library/argparse.rst:2237 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2237 +#: ../../library/argparse.rst:2241 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2241 +#: ../../library/argparse.rst:2245 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3876,17 +3884,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2249 +#: ../../library/argparse.rst:2253 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2254 +#: ../../library/argparse.rst:2258 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2259 +#: ../../library/argparse.rst:2263 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3894,7 +3902,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2264 +#: ../../library/argparse.rst:2268 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -3902,7 +3910,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2269 +#: ../../library/argparse.rst:2273 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3910,7 +3918,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2275 +#: ../../library/argparse.rst:2279 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3930,7 +3938,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2284 +#: ../../library/argparse.rst:2288 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3938,11 +3946,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2294 +#: ../../library/argparse.rst:2298 msgid "Upgrading optparse code" msgstr "" -#: ../../library/argparse.rst:2296 +#: ../../library/argparse.rst:2300 msgid "" "Originally, the :mod:`argparse` module had attempted to maintain " "compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " @@ -3953,47 +3961,47 @@ msgid "" "compatibility." msgstr "" -#: ../../library/argparse.rst:2303 +#: ../../library/argparse.rst:2307 msgid "" "The :mod:`argparse` module improves on the standard library :mod:`optparse` " "module in a number of ways including:" msgstr "" -#: ../../library/argparse.rst:2306 +#: ../../library/argparse.rst:2310 msgid "Handling positional arguments." msgstr "" -#: ../../library/argparse.rst:2307 +#: ../../library/argparse.rst:2311 msgid "Supporting sub-commands." msgstr "" -#: ../../library/argparse.rst:2308 +#: ../../library/argparse.rst:2312 msgid "Allowing alternative option prefixes like ``+`` and ``/``." msgstr "" -#: ../../library/argparse.rst:2309 +#: ../../library/argparse.rst:2313 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" -#: ../../library/argparse.rst:2310 +#: ../../library/argparse.rst:2314 msgid "Producing more informative usage messages." msgstr "" -#: ../../library/argparse.rst:2311 +#: ../../library/argparse.rst:2315 msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" -#: ../../library/argparse.rst:2313 +#: ../../library/argparse.rst:2317 msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" msgstr "" -#: ../../library/argparse.rst:2315 +#: ../../library/argparse.rst:2319 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" -#: ../../library/argparse.rst:2318 +#: ../../library/argparse.rst:2322 msgid "" "Replace ``(options, args) = parser.parse_args()`` with ``args = parser." "parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " @@ -4001,78 +4009,78 @@ msgid "" "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -#: ../../library/argparse.rst:2323 +#: ../../library/argparse.rst:2327 msgid "" "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" -#: ../../library/argparse.rst:2327 +#: ../../library/argparse.rst:2331 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" -#: ../../library/argparse.rst:2330 +#: ../../library/argparse.rst:2334 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -#: ../../library/argparse.rst:2333 +#: ../../library/argparse.rst:2337 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" -#: ../../library/argparse.rst:2337 +#: ../../library/argparse.rst:2341 msgid "" "Replace strings with implicit arguments such as ``%default`` or ``%prog`` " "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" -#: ../../library/argparse.rst:2341 +#: ../../library/argparse.rst:2345 msgid "" "Replace the OptionParser constructor ``version`` argument with a call to " "``parser.add_argument('--version', action='version', version='')``." msgstr "" -#: ../../library/argparse.rst:2345 +#: ../../library/argparse.rst:2349 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2349 +#: ../../library/argparse.rst:2353 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2351 +#: ../../library/argparse.rst:2355 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2356 +#: ../../library/argparse.rst:2360 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:982 +#: ../../library/argparse.rst:983 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:982 ../../library/argparse.rst:1016 -#: ../../library/argparse.rst:1030 +#: ../../library/argparse.rst:983 ../../library/argparse.rst:1017 +#: ../../library/argparse.rst:1031 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:1016 +#: ../../library/argparse.rst:1017 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:1030 +#: ../../library/argparse.rst:1031 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/ast.po b/library/ast.po index 0eb49e1a68..0d526eb785 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -439,13 +439,15 @@ msgstr "" "parse` 在預設的 ``\"exec\"`` *mode* 下生成的節點型別。" #: ../../library/ast.rst:176 -msgid "*body* is a :class:`list` of the module's :ref:`ast-statements`." +#, fuzzy +msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." msgstr "*body* 是模組的\\ :ref:`ast-statements` 的一個 :class:`list`。" #: ../../library/ast.rst:178 +#, fuzzy msgid "" -"*type_ignores* is a :class:`list` of the module's type ignore comments; see :" -"func:`ast.parse` for more details." +"``type_ignores`` is a :class:`list` of the module's type ignore comments; " +"see :func:`ast.parse` for more details." msgstr "" "*type_ignores* 是模組的忽略型別註解的 :class:`list`;有關更多詳細資訊,請參" "閱 :func:`ast.parse`。" @@ -479,8 +481,9 @@ msgstr "" "時節點型別由 :func:`ast.parse` 生成。" #: ../../library/ast.rst:197 +#, fuzzy msgid "" -"*body* is a single node, one of the :ref:`expression types `." msgstr "" "*body* 是單個節點,是\\ :ref:`運算式型別 `\\ 的其中之一。" @@ -504,7 +507,8 @@ msgstr "" "似。當 *mode* 是 ``\"single\"`` 時節點型別由 :func:`ast.parse` 生成。" #: ../../library/ast.rst:212 -msgid "*body* is a :class:`list` of :ref:`statement nodes `." +#, fuzzy +msgid "``body`` is a :class:`list` of :ref:`statement nodes `." msgstr "" "*body* 是\\ :ref:`陳述式節點 (statement nodes) ` 的 :class:" "`list`。" @@ -559,13 +563,15 @@ msgstr "" " return a + b" #: ../../library/ast.rst:241 +#, fuzzy msgid "" -"*argtypes* is a :class:`list` of :ref:`expression nodes `." +"``argtypes`` is a :class:`list` of :ref:`expression nodes `." msgstr "" "*argtypes* 是\\ :ref:`運算式節點 `\\ 的 :class:`list`。" #: ../../library/ast.rst:243 -msgid "*returns* is a single :ref:`expression node `." +#, fuzzy +msgid "``returns`` is a single :ref:`expression node `." msgstr "*returns* 是單個\\ :ref:`運算式節點 `。" #: ../../library/ast.rst:245 @@ -3174,11 +3180,11 @@ msgstr ":ref:`型別參數 `\\ 可以存在於類別、函式和型 #: ../../library/ast.rst:1769 #, fuzzy msgid "" -"A :class:`typing.TypeVar`. *name* is the name of the type variable. *bound* " -"is the bound or constraints, if any. If *bound* is a :class:`Tuple`, it " -"represents constraints; otherwise it represents the bound. *default_value* " -"is the default value; if the :class:`!TypeVar` has no default, this " -"attribute will be set to ``None``." +"A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " +"``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" +"`Tuple`, it represents constraints; otherwise it represents the bound. " +"``default_value`` is the default value; if the :class:`!TypeVar` has no " +"default, this attribute will be set to ``None``." msgstr "" "一個 :class:`typing.TypeVar`。``name`` 是型別變數的名稱。``bound`` 是(如果有" "存在的)界限 (bound) 或約束 (constraint)。如果 ``bound`` 是一個 :class:" @@ -3225,11 +3231,15 @@ msgid "Added the *default_value* parameter." msgstr "新增 *indent* 選項。" #: ../../library/ast.rst:1799 +#, fuzzy msgid "" -"A :class:`typing.ParamSpec`. *name* is the name of the parameter " -"specification. *default_value* is the default value; if the :class:`!" +"A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " +"specification. ``default_value`` is the default value; if the :class:`!" "ParamSpec` has no default, this attribute will be set to ``None``." msgstr "" +"一個 :class:`typing.TypeVar`。``name`` 是型別變數的名稱。``bound`` 是(如果有" +"存在的)界限 (bound) 或約束 (constraint)。如果 ``bound`` 是一個 :class:" +"`Tuple`,它代表約束;否則它代表界限。" #: ../../library/ast.rst:1803 #, fuzzy @@ -3278,8 +3288,8 @@ msgstr "" #: ../../library/ast.rst:1834 #, fuzzy msgid "" -"A :class:`typing.TypeVarTuple`. *name* is the name of the type variable " -"tuple. *default_value* is the default value; if the :class:`!TypeVarTuple` " +"A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " +"tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` " "has no default, this attribute will be set to ``None``." msgstr "" "一個 :class:`typing.TypeVar`。``name`` 是型別變數的名稱。``bound`` 是(如果有" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 6e293fd3d1..cc3762eb98 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -435,11 +435,11 @@ msgid "" " task.add_done_callback(background_tasks.discard)" msgstr "" -#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1141 +#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1188 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1148 +#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1195 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" @@ -502,9 +502,9 @@ msgstr "" msgid "Close the given coroutine if the task group is not active." msgstr "" -#: ../../library/asyncio-task.rst:345 ../../library/asyncio-task.rst:503 -#: ../../library/asyncio-task.rst:676 ../../library/asyncio-task.rst:734 -#: ../../library/asyncio-task.rst:760 ../../library/asyncio-task.rst:800 +#: ../../library/asyncio-task.rst:345 ../../library/asyncio-task.rst:550 +#: ../../library/asyncio-task.rst:723 ../../library/asyncio-task.rst:781 +#: ../../library/asyncio-task.rst:807 ../../library/asyncio-task.rst:847 msgid "Example::" msgstr "範例: ::" @@ -600,37 +600,93 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:418 +msgid "Terminating a Task Group" +msgstr "" + +#: ../../library/asyncio-task.rst:420 +msgid "" +"While terminating a task group is not natively supported by the standard " +"library, termination can be achieved by adding an exception-raising task to " +"the task group and ignoring the raised exception:" +msgstr "" + +#: ../../library/asyncio-task.rst:424 +msgid "" +"import asyncio\n" +"from asyncio import TaskGroup\n" +"\n" +"class TerminateTaskGroup(Exception):\n" +" \"\"\"Exception raised to terminate a task group.\"\"\"\n" +"\n" +"async def force_terminate_task_group():\n" +" \"\"\"Used to force termination of a task group.\"\"\"\n" +" raise TerminateTaskGroup()\n" +"\n" +"async def job(task_id, sleep_time):\n" +" print(f'Task {task_id}: start')\n" +" await asyncio.sleep(sleep_time)\n" +" print(f'Task {task_id}: done')\n" +"\n" +"async def main():\n" +" try:\n" +" async with TaskGroup() as group:\n" +" # spawn some tasks\n" +" group.create_task(job(1, 0.5))\n" +" group.create_task(job(2, 1.5))\n" +" # sleep for 1 second\n" +" await asyncio.sleep(1)\n" +" # add an exception-raising task to force the group to terminate\n" +" group.create_task(force_terminate_task_group())\n" +" except* TerminateTaskGroup:\n" +" pass\n" +"\n" +"asyncio.run(main())" +msgstr "" + +#: ../../library/asyncio-task.rst:456 +#, fuzzy +msgid "Expected output:" +msgstr "預期的輸出: ::" + +#: ../../library/asyncio-task.rst:458 +msgid "" +"Task 1: start\n" +"Task 2: start\n" +"Task 1: done" +msgstr "" + +#: ../../library/asyncio-task.rst:465 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:422 +#: ../../library/asyncio-task.rst:469 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:424 +#: ../../library/asyncio-task.rst:471 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:427 +#: ../../library/asyncio-task.rst:474 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:430 +#: ../../library/asyncio-task.rst:477 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:436 +#: ../../library/asyncio-task.rst:483 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:439 +#: ../../library/asyncio-task.rst:486 msgid "" "import asyncio\n" "import datetime\n" @@ -660,40 +716,40 @@ msgstr "" "\n" "asyncio.run(display_date())" -#: ../../library/asyncio-task.rst:454 ../../library/asyncio-task.rst:552 -#: ../../library/asyncio-task.rst:651 ../../library/asyncio-task.rst:825 -#: ../../library/asyncio-task.rst:879 ../../library/asyncio-task.rst:936 +#: ../../library/asyncio-task.rst:501 ../../library/asyncio-task.rst:599 +#: ../../library/asyncio-task.rst:698 ../../library/asyncio-task.rst:872 +#: ../../library/asyncio-task.rst:926 ../../library/asyncio-task.rst:983 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:457 +#: ../../library/asyncio-task.rst:504 msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." msgstr "" -#: ../../library/asyncio-task.rst:462 +#: ../../library/asyncio-task.rst:509 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:466 +#: ../../library/asyncio-task.rst:513 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:469 +#: ../../library/asyncio-task.rst:516 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:472 +#: ../../library/asyncio-task.rst:519 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:476 +#: ../../library/asyncio-task.rst:523 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -701,19 +757,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:481 +#: ../../library/asyncio-task.rst:528 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:484 +#: ../../library/asyncio-task.rst:531 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:487 +#: ../../library/asyncio-task.rst:534 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** " @@ -721,7 +777,7 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:494 +#: ../../library/asyncio-task.rst:541 msgid "" "A new alternative to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " @@ -731,7 +787,7 @@ msgid "" "tasks)." msgstr "" -#: ../../library/asyncio-task.rst:505 +#: ../../library/asyncio-task.rst:552 msgid "" "import asyncio\n" "\n" @@ -770,7 +826,7 @@ msgid "" "# [2, 6, 24]" msgstr "" -#: ../../library/asyncio-task.rst:541 +#: ../../library/asyncio-task.rst:588 msgid "" "If *return_exceptions* is false, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -779,28 +835,28 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:548 +#: ../../library/asyncio-task.rst:595 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:555 +#: ../../library/asyncio-task.rst:602 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:564 +#: ../../library/asyncio-task.rst:611 msgid "Eager Task Factory" msgstr "" -#: ../../library/asyncio-task.rst:568 +#: ../../library/asyncio-task.rst:615 msgid "A task factory for eager task execution." msgstr "" -#: ../../library/asyncio-task.rst:570 +#: ../../library/asyncio-task.rst:617 msgid "" "When using this factory (via :meth:`loop.set_task_factory(asyncio." "eager_task_factory) `), coroutines begin execution " @@ -810,13 +866,13 @@ msgid "" "synchronously." msgstr "" -#: ../../library/asyncio-task.rst:576 +#: ../../library/asyncio-task.rst:623 msgid "" "A common example where this is beneficial is coroutines which employ caching " "or memoization to avoid actual I/O when possible." msgstr "" -#: ../../library/asyncio-task.rst:581 +#: ../../library/asyncio-task.rst:628 msgid "" "Immediate execution of the coroutine is a semantic change. If the coroutine " "returns or raises, the task is never scheduled to the event loop. If the " @@ -825,46 +881,46 @@ msgid "" "the application's task execution order is likely to change." msgstr "" -#: ../../library/asyncio-task.rst:592 +#: ../../library/asyncio-task.rst:639 msgid "" "Create an eager task factory, similar to :func:`eager_task_factory`, using " "the provided *custom_task_constructor* when creating a new task instead of " "the default :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:596 +#: ../../library/asyncio-task.rst:643 msgid "" "*custom_task_constructor* must be a *callable* with the signature matching " "the signature of :class:`Task.__init__ `. The callable must return a :" "class:`asyncio.Task`-compatible object." msgstr "" -#: ../../library/asyncio-task.rst:600 +#: ../../library/asyncio-task.rst:647 msgid "" "This function returns a *callable* intended to be used as a task factory of " "an event loop via :meth:`loop.set_task_factory(factory) `)." msgstr "" -#: ../../library/asyncio-task.rst:607 +#: ../../library/asyncio-task.rst:654 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:611 +#: ../../library/asyncio-task.rst:658 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:614 ../../library/asyncio-task.rst:780 +#: ../../library/asyncio-task.rst:661 ../../library/asyncio-task.rst:827 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:616 +#: ../../library/asyncio-task.rst:663 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:618 +#: ../../library/asyncio-task.rst:665 msgid "" "task = asyncio.create_task(something())\n" "res = await shield(task)" @@ -872,15 +928,15 @@ msgstr "" "task = asyncio.create_task(something())\n" "res = await shield(task)" -#: ../../library/asyncio-task.rst:621 +#: ../../library/asyncio-task.rst:668 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:623 +#: ../../library/asyncio-task.rst:670 msgid "res = await something()" msgstr "res = await something()" -#: ../../library/asyncio-task.rst:625 +#: ../../library/asyncio-task.rst:672 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -889,20 +945,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:631 +#: ../../library/asyncio-task.rst:678 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:634 +#: ../../library/asyncio-task.rst:681 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:638 +#: ../../library/asyncio-task.rst:685 msgid "" "task = asyncio.create_task(something())\n" "try:\n" @@ -916,7 +972,7 @@ msgstr "" "except CancelledError:\n" " res = None" -#: ../../library/asyncio-task.rst:646 +#: ../../library/asyncio-task.rst:693 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 " @@ -924,36 +980,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:654 +#: ../../library/asyncio-task.rst:701 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:660 +#: ../../library/asyncio-task.rst:707 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:664 +#: ../../library/asyncio-task.rst:711 msgid "" "Return an :ref:`asynchronous context manager ` that " "can be used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:668 +#: ../../library/asyncio-task.rst:715 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:673 +#: ../../library/asyncio-task.rst:720 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:678 +#: ../../library/asyncio-task.rst:725 msgid "" "async def main():\n" " async with asyncio.timeout(10):\n" @@ -963,7 +1019,7 @@ msgstr "" " async with asyncio.timeout(10):\n" " await long_running_task()" -#: ../../library/asyncio-task.rst:682 +#: ../../library/asyncio-task.rst:729 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." @@ -971,18 +1027,18 @@ msgid "" "can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:689 +#: ../../library/asyncio-task.rst:736 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`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:694 +#: ../../library/asyncio-task.rst:741 msgid "Example of catching :exc:`TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:696 +#: ../../library/asyncio-task.rst:743 msgid "" "async def main():\n" " try:\n" @@ -994,48 +1050,48 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: ../../library/asyncio-task.rst:705 +#: ../../library/asyncio-task.rst:752 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:710 +#: ../../library/asyncio-task.rst:757 msgid "" "An :ref:`asynchronous context manager ` for " "cancelling overdue coroutines." msgstr "" -#: ../../library/asyncio-task.rst:713 +#: ../../library/asyncio-task.rst:760 msgid "" "``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:716 +#: ../../library/asyncio-task.rst:763 msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:764 msgid "" "If ``when < loop.time()``, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: ../../library/asyncio-task.rst:722 +#: ../../library/asyncio-task.rst:769 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:727 +#: ../../library/asyncio-task.rst:774 msgid "Reschedule the timeout." msgstr "" -#: ../../library/asyncio-task.rst:731 +#: ../../library/asyncio-task.rst:778 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:736 +#: ../../library/asyncio-task.rst:783 msgid "" "async def main():\n" " try:\n" @@ -1053,17 +1109,17 @@ msgid "" " print(\"Looks like we haven't finished on time.\")" msgstr "" -#: ../../library/asyncio-task.rst:751 +#: ../../library/asyncio-task.rst:798 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:757 +#: ../../library/asyncio-task.rst:804 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:809 msgid "" "async def main():\n" " loop = get_running_loop()\n" @@ -1077,41 +1133,41 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:824 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:782 +#: ../../library/asyncio-task.rst:829 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:786 +#: ../../library/asyncio-task.rst:833 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:789 +#: ../../library/asyncio-task.rst:836 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:839 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:796 +#: ../../library/asyncio-task.rst:843 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:802 +#: ../../library/asyncio-task.rst:849 msgid "" "async def eternity():\n" " # Sleep for one hour\n" @@ -1132,107 +1188,107 @@ msgid "" "# timeout!" msgstr "" -#: ../../library/asyncio-task.rst:820 +#: ../../library/asyncio-task.rst:867 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:828 +#: ../../library/asyncio-task.rst:875 msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." msgstr "引發 :exc:`TimeoutError` 而不是 :exc:`asyncio.TimeoutError`。" -#: ../../library/asyncio-task.rst:833 +#: ../../library/asyncio-task.rst:880 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:837 +#: ../../library/asyncio-task.rst:884 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:841 +#: ../../library/asyncio-task.rst:888 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:890 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:845 +#: ../../library/asyncio-task.rst:892 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-task.rst:847 +#: ../../library/asyncio-task.rst:894 msgid "done, pending = await asyncio.wait(aws)" msgstr "done, pending = await asyncio.wait(aws)" -#: ../../library/asyncio-task.rst:849 +#: ../../library/asyncio-task.rst:896 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:852 +#: ../../library/asyncio-task.rst:899 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:856 +#: ../../library/asyncio-task.rst:903 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:862 +#: ../../library/asyncio-task.rst:909 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:863 +#: ../../library/asyncio-task.rst:910 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:866 +#: ../../library/asyncio-task.rst:913 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:869 +#: ../../library/asyncio-task.rst:916 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:874 +#: ../../library/asyncio-task.rst:921 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:876 +#: ../../library/asyncio-task.rst:923 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:882 +#: ../../library/asyncio-task.rst:929 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:885 ../../library/asyncio-task.rst:943 +#: ../../library/asyncio-task.rst:932 ../../library/asyncio-task.rst:990 msgid "Added support for generators yielding tasks." msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:938 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. The returned object can be iterated to obtain the results of " "the awaitables as they finish." msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:942 msgid "" "The object returned by ``as_completed()`` can be iterated as an :term:" "`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " @@ -1241,7 +1297,7 @@ msgid "" "tasks with their results. Example::" msgstr "" -#: ../../library/asyncio-task.rst:901 +#: ../../library/asyncio-task.rst:948 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1258,20 +1314,20 @@ msgid "" " print(\"IPv4 connection established.\")" msgstr "" -#: ../../library/asyncio-task.rst:915 +#: ../../library/asyncio-task.rst:962 msgid "" "During asynchronous iteration, implicitly-created tasks will be yielded for " "supplied awaitables that aren't tasks or futures." msgstr "" -#: ../../library/asyncio-task.rst:918 +#: ../../library/asyncio-task.rst:965 msgid "" "When used as a plain iterator, each iteration yields a new coroutine that " "returns the result or raises the exception of the next completed awaitable. " "This pattern is compatible with Python versions older than 3.13::" msgstr "" -#: ../../library/asyncio-task.rst:922 +#: ../../library/asyncio-task.rst:969 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1284,34 +1340,34 @@ msgid "" " reader, writer = await next_connect" msgstr "" -#: ../../library/asyncio-task.rst:932 +#: ../../library/asyncio-task.rst:979 msgid "" "A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " "are done. This is raised by the ``async for`` loop during asynchronous " "iteration or by the coroutines yielded during plain iteration." msgstr "" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:986 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:946 +#: ../../library/asyncio-task.rst:993 msgid "" "The result can now be used as either an :term:`asynchronous iterator` or as " "a plain :term:`iterator` (previously it was only a plain iterator)." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:999 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:956 +#: ../../library/asyncio-task.rst:1003 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:958 +#: ../../library/asyncio-task.rst:1005 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -1319,19 +1375,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:963 +#: ../../library/asyncio-task.rst:1010 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:1012 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:969 +#: ../../library/asyncio-task.rst:1016 msgid "" "def blocking_io():\n" " print(f\"start blocking_io at {time.strftime('%X')}\")\n" @@ -1360,7 +1416,7 @@ msgid "" "# finished main at 19:50:54" msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:1042 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. " @@ -1368,7 +1424,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1002 +#: ../../library/asyncio-task.rst:1049 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 " @@ -1376,27 +1432,27 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:1011 +#: ../../library/asyncio-task.rst:1058 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:1062 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:1017 +#: ../../library/asyncio-task.rst:1064 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:1067 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:1023 +#: ../../library/asyncio-task.rst:1070 msgid "" "# Create a coroutine\n" "coro = asyncio.sleep(1, result=3)\n" @@ -1408,13 +1464,13 @@ msgid "" "assert future.result(timeout) == 3" msgstr "" -#: ../../library/asyncio-task.rst:1032 +#: ../../library/asyncio-task.rst:1079 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:1036 +#: ../../library/asyncio-task.rst:1083 msgid "" "try:\n" " result = future.result(timeout)\n" @@ -1427,59 +1483,59 @@ msgid "" " print(f'The coroutine returned: {result!r}')" msgstr "" -#: ../../library/asyncio-task.rst:1046 +#: ../../library/asyncio-task.rst:1093 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:1049 +#: ../../library/asyncio-task.rst:1096 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:1056 +#: ../../library/asyncio-task.rst:1103 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1108 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1111 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1072 +#: ../../library/asyncio-task.rst:1119 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:1075 +#: ../../library/asyncio-task.rst:1122 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:1130 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:1089 +#: ../../library/asyncio-task.rst:1136 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:1093 +#: ../../library/asyncio-task.rst:1140 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1143 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 " @@ -1487,21 +1543,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:1102 +#: ../../library/asyncio-task.rst:1149 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:1107 +#: ../../library/asyncio-task.rst:1154 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:1112 +#: ../../library/asyncio-task.rst:1159 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 " @@ -1509,20 +1565,20 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1164 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:1122 +#: ../../library/asyncio-task.rst:1169 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:1126 +#: ../../library/asyncio-task.rst:1173 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " @@ -1530,7 +1586,7 @@ msgid "" "in the copied context." msgstr "" -#: ../../library/asyncio-task.rst:1131 +#: ../../library/asyncio-task.rst:1178 msgid "" "An optional keyword-only *eager_start* argument allows eagerly starting the " "execution of the :class:`asyncio.Task` at task creation time. If set to " @@ -1540,96 +1596,96 @@ msgid "" "eagerly and will skip scheduling to the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1138 +#: ../../library/asyncio-task.rst:1185 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1144 +#: ../../library/asyncio-task.rst:1191 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1151 +#: ../../library/asyncio-task.rst:1198 msgid "Added the *eager_start* parameter." msgstr "新增 *eager_start* 參數。" -#: ../../library/asyncio-task.rst:1156 +#: ../../library/asyncio-task.rst:1203 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1158 +#: ../../library/asyncio-task.rst:1205 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:1163 +#: ../../library/asyncio-task.rst:1210 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1165 +#: ../../library/asyncio-task.rst:1212 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:1169 ../../library/asyncio-task.rst:1183 +#: ../../library/asyncio-task.rst:1216 ../../library/asyncio-task.rst:1230 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1172 +#: ../../library/asyncio-task.rst:1219 msgid "" "If the Task's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1177 +#: ../../library/asyncio-task.rst:1224 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1179 +#: ../../library/asyncio-task.rst:1226 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:1186 +#: ../../library/asyncio-task.rst:1233 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1191 +#: ../../library/asyncio-task.rst:1238 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1193 ../../library/asyncio-task.rst:1202 +#: ../../library/asyncio-task.rst:1240 ../../library/asyncio-task.rst:1249 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1195 +#: ../../library/asyncio-task.rst:1242 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1200 +#: ../../library/asyncio-task.rst:1247 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1204 +#: ../../library/asyncio-task.rst:1251 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1209 +#: ../../library/asyncio-task.rst:1256 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1211 +#: ../../library/asyncio-task.rst:1258 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, " @@ -1637,15 +1693,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1217 +#: ../../library/asyncio-task.rst:1264 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1219 +#: ../../library/asyncio-task.rst:1266 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1221 +#: ../../library/asyncio-task.rst:1268 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 " @@ -1654,81 +1710,81 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1230 +#: ../../library/asyncio-task.rst:1277 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1232 +#: ../../library/asyncio-task.rst:1279 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1235 +#: ../../library/asyncio-task.rst:1282 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1237 +#: ../../library/asyncio-task.rst:1284 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:1242 +#: ../../library/asyncio-task.rst:1289 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1246 +#: ../../library/asyncio-task.rst:1293 msgid "" "This will return ``None`` for Tasks which have already completed eagerly. " "See the :ref:`Eager Task Factory `." msgstr "" -#: ../../library/asyncio-task.rst:1253 +#: ../../library/asyncio-task.rst:1300 msgid "Newly added eager task execution means result may be ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1257 +#: ../../library/asyncio-task.rst:1304 msgid "" "Return the :class:`contextvars.Context` object associated with the task." msgstr "" -#: ../../library/asyncio-task.rst:1264 +#: ../../library/asyncio-task.rst:1311 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1266 +#: ../../library/asyncio-task.rst:1313 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:1274 +#: ../../library/asyncio-task.rst:1321 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1276 +#: ../../library/asyncio-task.rst:1323 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1279 +#: ../../library/asyncio-task.rst:1326 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:1286 +#: ../../library/asyncio-task.rst:1333 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1288 +#: ../../library/asyncio-task.rst:1335 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:1291 +#: ../../library/asyncio-task.rst:1338 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1740,21 +1796,21 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1301 +#: ../../library/asyncio-task.rst:1348 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1304 +#: ../../library/asyncio-task.rst:1351 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1309 +#: ../../library/asyncio-task.rst:1356 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1312 +#: ../../library/asyncio-task.rst:1359 msgid "" "async def cancel_me():\n" " print('cancel_me(): before sleep')\n" @@ -1791,32 +1847,32 @@ msgid "" "# main(): cancel_me is cancelled now" msgstr "" -#: ../../library/asyncio-task.rst:1348 +#: ../../library/asyncio-task.rst:1395 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1350 +#: ../../library/asyncio-task.rst:1397 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:1356 +#: ../../library/asyncio-task.rst:1403 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1358 +#: ../../library/asyncio-task.rst:1405 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1360 +#: ../../library/asyncio-task.rst:1407 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1365 +#: ../../library/asyncio-task.rst:1412 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 " @@ -1825,7 +1881,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1372 +#: ../../library/asyncio-task.rst:1419 msgid "" "async def make_request_with_timeout():\n" " try:\n" @@ -1839,7 +1895,7 @@ msgid "" " await unrelated_code()" msgstr "" -#: ../../library/asyncio-task.rst:1383 +#: ../../library/asyncio-task.rst:1430 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1848,14 +1904,14 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1389 +#: ../../library/asyncio-task.rst:1436 msgid "" "If end-user code is, for some reason, suppressing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1393 +#: ../../library/asyncio-task.rst:1440 msgid "" "When this method decrements the cancellation count to zero, the method " "checks if a previous :meth:`cancel` call had arranged for :exc:" @@ -1864,17 +1920,17 @@ msgid "" "``_must_cancel`` flag)." msgstr "" -#: ../../library/asyncio-task.rst:1399 +#: ../../library/asyncio-task.rst:1446 msgid "Changed to rescind pending cancellation requests upon reaching zero." msgstr "" -#: ../../library/asyncio-task.rst:1404 +#: ../../library/asyncio-task.rst:1451 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:1408 +#: ../../library/asyncio-task.rst:1455 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 " @@ -1883,7 +1939,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1414 +#: ../../library/asyncio-task.rst:1461 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/calendar.po b/library/calendar.po index 4365ce363d..1cc98594b4 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -532,22 +532,26 @@ msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" #: ../../library/calendar.rst:396 -msgid "An array that represents the days of the week in the current locale." +#, fuzzy +msgid "" +"A sequence that represents the days of the week in the current locale, where " +"Monday is day number 0." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:401 +#: ../../library/calendar.rst:406 +#, fuzzy msgid "" -"An array that represents the abbreviated days of the week in the current " -"locale." +"A sequence that represents the abbreviated days of the week in the current " +"locale, where Mon is day number 0." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:412 +#: ../../library/calendar.rst:421 msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:420 +#: ../../library/calendar.rst:429 msgid "" "Enumeration defining days of the week as integer constants. The members of " "this enumeration are exported to the module scope as :data:`MONDAY` through :" @@ -556,32 +560,34 @@ msgstr "" "將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` 到 :" "data:`SUNDAY` 匯出到模組作用域。" -#: ../../library/calendar.rst:429 +#: ../../library/calendar.rst:438 +#, fuzzy msgid "" -"An array that represents the months of the year in the current locale. This " -"follows normal convention of January being month number 1, so it has a " +"A sequence that represents the months of the year in the current locale. " +"This follows normal convention of January being month number 1, so it has a " "length of 13 and ``month_name[0]`` is the empty string." msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:436 +#: ../../library/calendar.rst:449 +#, fuzzy msgid "" -"An array that represents the abbreviated months of the year in the current " +"A sequence that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " "it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:454 +#: ../../library/calendar.rst:470 msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." msgstr "" "一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:462 +#: ../../library/calendar.rst:478 msgid "" "Enumeration defining months of the year as integer constants. The members of " "this enumeration are exported to the module scope as :data:`JANUARY` " @@ -590,61 +596,61 @@ msgstr "" "將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` 到 :" "data:`DECEMBER` 匯出到模組作用域。" -#: ../../library/calendar.rst:469 +#: ../../library/calendar.rst:485 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr ":mod:`calendar` 模組定義了以下例外:" -#: ../../library/calendar.rst:473 +#: ../../library/calendar.rst:489 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的月份數字超出 1-12 範圍(含)時引發。" -#: ../../library/calendar.rst:478 +#: ../../library/calendar.rst:494 msgid "The invalid month number." msgstr "無效的月份號。" -#: ../../library/calendar.rst:483 +#: ../../library/calendar.rst:499 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的週幾的數字超出 0-6(含)範圍時引發。" -#: ../../library/calendar.rst:488 +#: ../../library/calendar.rst:504 msgid "The invalid weekday number." msgstr "無效的週幾編號。" -#: ../../library/calendar.rst:493 +#: ../../library/calendar.rst:509 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:494 +#: ../../library/calendar.rst:510 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:497 +#: ../../library/calendar.rst:513 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:498 +#: ../../library/calendar.rst:514 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" -#: ../../library/calendar.rst:504 +#: ../../library/calendar.rst:520 msgid "Command-Line Usage" msgstr "命令列用法" -#: ../../library/calendar.rst:508 +#: ../../library/calendar.rst:524 msgid "" "The :mod:`calendar` module can be executed as a script from the command line " "to interactively print a calendar." msgstr ":mod:`calendar` 模組可以作為腳本從命令列執行,並以互動方式列印日曆。" -#: ../../library/calendar.rst:511 +#: ../../library/calendar.rst:527 #, fuzzy msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" @@ -655,11 +661,11 @@ msgstr "" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" " [year] [month]" -#: ../../library/calendar.rst:518 +#: ../../library/calendar.rst:534 msgid "For example, to print a calendar for the year 2000:" msgstr "例如,要列印 2000 年的日曆:" -#: ../../library/calendar.rst:520 +#: ../../library/calendar.rst:536 msgid "" "$ python -m calendar 2000\n" " 2000\n" @@ -737,42 +743,42 @@ msgstr "" "23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" "30 31" -#: ../../library/calendar.rst:561 +#: ../../library/calendar.rst:577 msgid "The following options are accepted:" msgstr "接受以下選項:" -#: ../../library/calendar.rst:568 +#: ../../library/calendar.rst:584 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/calendar.rst:573 +#: ../../library/calendar.rst:589 msgid "The locale to use for month and weekday names. Defaults to English." msgstr "用於月份和週幾名稱的語系。預設為英語。" -#: ../../library/calendar.rst:579 +#: ../../library/calendar.rst:595 msgid "" "The encoding to use for output. :option:`--encoding` is required if :option:" "`--locale` is set." msgstr "" "用於輸出的編碼。如有設定 :option:`--locale` 則必須給定 :option:`--encoding`。" -#: ../../library/calendar.rst:585 +#: ../../library/calendar.rst:601 msgid "Print the calendar to the terminal as text, or as an HTML document." msgstr "將日曆以文字或 HTML 文件的形式印出到終端機。" -#: ../../library/calendar.rst:591 +#: ../../library/calendar.rst:607 #, fuzzy msgid "" "The weekday to start each week. Must be a number between 0 (Monday) and 6 " "(Sunday). Defaults to 0." msgstr "印出日曆的年份。必須是 1 到 9999 之間的數字。預設為當前年份。" -#: ../../library/calendar.rst:599 +#: ../../library/calendar.rst:615 #, fuzzy msgid "The year to print the calendar for. Defaults to the current year." msgstr "印出日曆的年份。必須是 1 到 9999 之間的數字。預設為當前年份。" -#: ../../library/calendar.rst:605 +#: ../../library/calendar.rst:621 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12, and may only be used in text mode. Defaults to " @@ -781,11 +787,11 @@ msgstr "" "要列印日曆的指定 :option:`year` 的月份。必須是 1 到 12 之間的數字,並且只能在" "文字模式下使用。預設列印全年日曆。" -#: ../../library/calendar.rst:611 +#: ../../library/calendar.rst:627 msgid "*Text-mode options:*" msgstr "*文字模式選項:*" -#: ../../library/calendar.rst:615 +#: ../../library/calendar.rst:631 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." @@ -793,7 +799,7 @@ msgstr "" "終端機行中日期行的寬度。日期印出在行的中央。任何小於 2 的值都會被忽略。預設" "為 2。" -#: ../../library/calendar.rst:623 +#: ../../library/calendar.rst:639 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." @@ -801,21 +807,21 @@ msgstr "" "終端機列中每週的列數。日期印出時頂部會對齊。任何小於 1 的值都會被忽略。預設" "為 1。" -#: ../../library/calendar.rst:631 +#: ../../library/calendar.rst:647 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." msgstr "行中月份之間的間距。任何小於 2 的值都會被忽略。預設為 6。" -#: ../../library/calendar.rst:638 +#: ../../library/calendar.rst:654 msgid "The number of months printed per row. Defaults to 3." msgstr "每列印出的月份數量。預設為 3。" -#: ../../library/calendar.rst:642 +#: ../../library/calendar.rst:658 msgid "*HTML-mode options:*" msgstr "*HTML 模式選項:*" -#: ../../library/calendar.rst:646 +#: ../../library/calendar.rst:662 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." diff --git a/library/cmdline.po b/library/cmdline.po index ed2fd4286f..4ecb85cb44 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-10-14 16:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -171,61 +171,66 @@ msgid ":ref:`sqlite3 `" msgstr ":ref:`sqlite3 `" #: ../../library/cmdline.rst:43 +#, fuzzy +msgid ":ref:`symtable `" +msgstr ":ref:`trace `" + +#: ../../library/cmdline.rst:44 msgid ":ref:`sysconfig `" msgstr ":ref:`sysconfig `" -#: ../../library/cmdline.rst:44 +#: ../../library/cmdline.rst:45 msgid ":mod:`tabnanny`" msgstr ":mod:`tabnanny`" -#: ../../library/cmdline.rst:45 +#: ../../library/cmdline.rst:46 msgid ":ref:`tarfile `" msgstr ":ref:`tarfile `" -#: ../../library/cmdline.rst:46 +#: ../../library/cmdline.rst:47 msgid ":mod:`!this`" msgstr ":mod:`!this`" -#: ../../library/cmdline.rst:47 +#: ../../library/cmdline.rst:48 msgid ":ref:`timeit `" msgstr ":ref:`timeit `" -#: ../../library/cmdline.rst:48 +#: ../../library/cmdline.rst:49 msgid ":ref:`tokenize `" msgstr ":ref:`tokenize `" -#: ../../library/cmdline.rst:49 +#: ../../library/cmdline.rst:50 msgid ":ref:`trace `" msgstr ":ref:`trace `" -#: ../../library/cmdline.rst:50 +#: ../../library/cmdline.rst:51 msgid ":mod:`turtledemo`" msgstr ":mod:`turtledemo`" -#: ../../library/cmdline.rst:51 +#: ../../library/cmdline.rst:52 msgid ":ref:`unittest `" msgstr ":ref:`unittest `" -#: ../../library/cmdline.rst:52 +#: ../../library/cmdline.rst:53 msgid ":ref:`uuid `" msgstr ":ref:`uuid `" -#: ../../library/cmdline.rst:53 +#: ../../library/cmdline.rst:54 msgid ":mod:`venv`" msgstr ":mod:`venv`" -#: ../../library/cmdline.rst:54 +#: ../../library/cmdline.rst:55 msgid ":mod:`webbrowser`" msgstr ":mod:`webbrowser`" -#: ../../library/cmdline.rst:55 +#: ../../library/cmdline.rst:56 msgid ":ref:`zipapp `" msgstr ":ref:`zipapp `" -#: ../../library/cmdline.rst:56 +#: ../../library/cmdline.rst:57 msgid ":ref:`zipfile `" msgstr ":ref:`zipfile `" -#: ../../library/cmdline.rst:58 +#: ../../library/cmdline.rst:59 msgid "See also the :ref:`Python command-line interface `." msgstr "另請見 :ref:`Python 命令列介面 `。" diff --git a/library/collections.po b/library/collections.po index 28d2d79ade..503c0d3f17 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-01-22 21:42+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1207,7 +1207,7 @@ msgstr "" "此屬性為 :meth:`__missing__` 方法所使用。如果有引數被傳入建構函式,則此屬性會" "被初始化成第一個引數,如未提供引數則被初始化為 ``None``。" -#: ../../library/collections.rst:765 ../../library/collections.rst:1188 +#: ../../library/collections.rst:765 ../../library/collections.rst:1191 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "新增合併 (``|``) 和更新 (``|=``) 運算子,請見 :pep:`584`。" @@ -1356,9 +1356,10 @@ msgstr "" "必須被給定一個引數,``y`` 被預設為 ``1``,``z`` 則被預設為 ``2``。" #: ../../library/collections.rst:877 +#, fuzzy msgid "" -"If *module* is defined, the ``__module__`` attribute of the named tuple is " -"set to that value." +"If *module* is defined, the :attr:`~type.__module__` attribute of the named " +"tuple is set to that value." msgstr "" "如果 *module* 值有被定義,named tuple 的 ``__module__`` 屬性就被設定為該值。" @@ -1876,21 +1877,26 @@ msgstr "" "除了普通的對映方法,ordered dictionary 還支援了透過 :func:`reversed` 來做倒序" "疊代。" -#: ../../library/collections.rst:1172 +#: ../../library/collections.rst:1174 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " -"are implemented as ``list(od1.items())==list(od2.items())``. Equality tests " -"between :class:`OrderedDict` objects and other :class:`~collections.abc." -"Mapping` objects are order-insensitive like regular dictionaries. This " -"allows :class:`OrderedDict` objects to be substituted anywhere a regular " -"dictionary is used." +"are roughly equivalent to ``list(od1.items())==list(od2.items())``." +msgstr "" + +#: ../../library/collections.rst:1177 +#, fuzzy +msgid "" +"Equality tests between :class:`OrderedDict` objects and other :class:" +"`~collections.abc.Mapping` objects are order-insensitive like regular " +"dictionaries. This allows :class:`OrderedDict` objects to be substituted " +"anywhere a regular dictionary is used." msgstr "" ":class:`OrderedDict` 物件之間的相等性運算是會檢查順序是否相同的,是透過 " "``list(od1.items())==list(od2.items())`` 來實現。:class:`OrderedDict` 物件和" "其他 :class:`~collections.abc.Mapping` 物件間的相等性運算則像普通字典一樣不考" "慮順序性,這使得 :class:`OrderedDict` 可於任何字典可使用的時機中被替換掉。" -#: ../../library/collections.rst:1179 +#: ../../library/collections.rst:1182 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." @@ -1898,7 +1904,7 @@ msgstr "" ":class:`OrderedDict` 的項 (item)、鍵與值之\\ :term:`視圖 `\\ 現在可透過 :func:`reversed` 來倒序疊代。" -#: ../../library/collections.rst:1183 +#: ../../library/collections.rst:1186 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`update` method." @@ -1906,11 +1912,11 @@ msgstr "" "隨著 :pep:`468` 被核可,被傳入給 :class:`OrderedDict` 建構函式與其 :meth:" "`update` 方法的關鍵字引數之順序被保留了下來。" -#: ../../library/collections.rst:1193 +#: ../../library/collections.rst:1196 msgid ":class:`OrderedDict` Examples and Recipes" msgstr ":class:`OrderedDict` 範例與用法" -#: ../../library/collections.rst:1195 +#: ../../library/collections.rst:1198 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1920,7 +1926,7 @@ msgstr "" "建立一個能夠記住鍵\\ *最後*\\ 插入順序的 ordered dictionary 變體很簡單。如果" "新條目覆蓋了現有條目,則原本插入位置會被更改並移動至末端: ::" -#: ../../library/collections.rst:1200 +#: ../../library/collections.rst:1203 msgid "" "class LastUpdatedOrderedDict(OrderedDict):\n" " 'Store items in the order the keys were last added'\n" @@ -1930,7 +1936,7 @@ msgid "" " self.move_to_end(key)" msgstr "" -#: ../../library/collections.rst:1207 +#: ../../library/collections.rst:1210 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" @@ -1938,7 +1944,7 @@ msgstr "" ":class:`OrderedDict` 在實現一個 :func:`functools.lru_cache` 的變形版本時也非" "常有用:" -#: ../../library/collections.rst:1210 +#: ../../library/collections.rst:1213 msgid "" "from collections import OrderedDict\n" "from time import time\n" @@ -1965,7 +1971,7 @@ msgid "" " return result" msgstr "" -#: ../../library/collections.rst:1237 +#: ../../library/collections.rst:1240 msgid "" "class MultiHitLRUCache:\n" " \"\"\" LRU cache that defers caching a result until\n" @@ -2003,11 +2009,11 @@ msgid "" " return result" msgstr "" -#: ../../library/collections.rst:1306 +#: ../../library/collections.rst:1309 msgid ":class:`UserDict` objects" msgstr ":class:`UserDict` 物件" -#: ../../library/collections.rst:1308 +#: ../../library/collections.rst:1311 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -2018,7 +2024,7 @@ msgstr "" "`dict` 建立子類別,這個類別的需求已部分被滿足,不過這個類別使用起來更方便,因" "為被包裝的字典可以作為其屬性來存取。" -#: ../../library/collections.rst:1316 +#: ../../library/collections.rst:1319 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" @@ -2030,23 +2036,23 @@ msgstr "" "`data` 屬性來做存取。如果有提供 *initialdata*,:attr:`data` 屬性會被初始化為" "其值;要注意指到 *initialdata* 的參照不會被保留,使其可被用於其他目的。" -#: ../../library/collections.rst:1322 +#: ../../library/collections.rst:1325 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" "除了支援作為對映所需的方法與操作,:class:`UserDict` 實例提供了以下屬性:" -#: ../../library/collections.rst:1327 +#: ../../library/collections.rst:1330 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "一個真實的字典,用於儲存 :class:`UserDict` 類別的資料內容。" -#: ../../library/collections.rst:1333 +#: ../../library/collections.rst:1336 msgid ":class:`UserList` objects" msgstr ":class:`UserList` 物件" -#: ../../library/collections.rst:1335 +#: ../../library/collections.rst:1338 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -2057,7 +2063,7 @@ msgstr "" "入新方法來定義你所需的一個類似於 list 的類別。如此一來,我們可以為 list 加入" "新的特性。" -#: ../../library/collections.rst:1340 +#: ../../library/collections.rst:1343 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " @@ -2066,7 +2072,7 @@ msgstr "" "因為已經可以直接自 :class:`list` 建立子類別,這個類別的需求已部分被滿足,不過" "這個類別使用起來更方便,因為被包裝的 list 可以作為其屬性來存取。" -#: ../../library/collections.rst:1346 +#: ../../library/collections.rst:1349 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -2079,20 +2085,20 @@ msgstr "" "list ``[]``。*list* 可以是任何 iterable,例如一個真實的 Python list 或是一" "個 :class:`UserList` 物件。" -#: ../../library/collections.rst:1352 +#: ../../library/collections.rst:1355 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "除了支援可變序列的方法與操作,:class:`UserList` 實例提供了以下屬性:" -#: ../../library/collections.rst:1357 +#: ../../library/collections.rst:1360 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" "一個真實的 :class:`list` 物件,用於儲存 :class:`UserList` 類別的資料內容。" -#: ../../library/collections.rst:1360 +#: ../../library/collections.rst:1363 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -2106,7 +2112,7 @@ msgstr "" "例,為了達成上述目的,它假設建構函式可傳入單一參數來呼叫,該參數即是做為數據" "來源的一個序列物件。" -#: ../../library/collections.rst:1367 +#: ../../library/collections.rst:1370 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -2116,11 +2122,11 @@ msgstr "" "如果希望一個自此獲得的子類別不遵從上述要求,那所有該類別支援的特殊方法則必須" "被覆寫;請參考原始碼來理解在這情況下哪些方法是必須提供的。" -#: ../../library/collections.rst:1373 +#: ../../library/collections.rst:1376 msgid ":class:`UserString` objects" msgstr ":class:`UserString` 物件" -#: ../../library/collections.rst:1375 +#: ../../library/collections.rst:1378 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -2131,7 +2137,7 @@ msgstr "" "建立子類別,這個類別的需求已經部分被滿足,不過這個類別使用起來更方便,因為被" "包裝的字串可以作為其屬性來存取。" -#: ../../library/collections.rst:1383 +#: ../../library/collections.rst:1386 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -2143,21 +2149,21 @@ msgstr "" "的 :attr:`data` 屬性來做存取。實例內容被初始化為 *seq* 的複製,*seq* 引數可以" "是任何可被內建函式 :func:`str` 轉換成字串的物件。" -#: ../../library/collections.rst:1390 +#: ../../library/collections.rst:1393 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" "除了支援字串的方法和操作以外,:class:`UserString` 實例也提供了以下屬性:" -#: ../../library/collections.rst:1395 +#: ../../library/collections.rst:1398 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" "一個真實的 :class:`str` 物件,用來儲存 :class:`UserString` 類別的資料內容。" -#: ../../library/collections.rst:1398 +#: ../../library/collections.rst:1401 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/contextvars.po b/library/contextvars.po index b90483b630..0d55f6ec27 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -329,7 +329,7 @@ msgid "" " # without passing it explicitly to this function.\n" "\n" " client_addr = client_addr_var.get()\n" -" return f'Good bye, client @ {client_addr}\\n'.encode()\n" +" return f'Good bye, client @ {client_addr}\\r\\n'.encode()\n" "\n" "async def handle_request(reader, writer):\n" " addr = writer.transport.get_extra_info('socket').getpeername()\n" @@ -343,9 +343,10 @@ msgid "" " print(line)\n" " if not line.strip():\n" " break\n" -" writer.write(line)\n" "\n" -" writer.write(render_goodbye())\n" +" writer.write(b'HTTP/1.1 200 OK\\r\\n') # status line\n" +" writer.write(b'\\r\\n') # headers\n" +" writer.write(render_goodbye()) # body\n" " writer.close()\n" "\n" "async def main():\n" @@ -357,6 +358,7 @@ msgid "" "\n" "asyncio.run(main())\n" "\n" -"# To test it you can use telnet:\n" -"# telnet 127.0.0.1 8081" +"# To test it you can use telnet or curl:\n" +"# telnet 127.0.0.1 8081\n" +"# curl 127.0.0.1:8081" msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 886165ae86..b0ee3d5312 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -422,9 +422,9 @@ msgstr "" ">>> (d.days, d.seconds, d.microseconds)\n" "(-1, 86399, 999999)" -#: ../../library/datetime.rst:265 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1108 ../../library/datetime.rst:1746 -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:265 ../../library/datetime.rst:566 +#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1760 +#: ../../library/datetime.rst:2365 msgid "Class attributes:" msgstr "類別屬性:" @@ -451,8 +451,8 @@ msgid "" "`timedelta` object." msgstr "" -#: ../../library/datetime.rst:287 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1128 ../../library/datetime.rst:1766 +#: ../../library/datetime.rst:287 ../../library/datetime.rst:584 +#: ../../library/datetime.rst:1142 ../../library/datetime.rst:1780 msgid "Instance attributes (read-only):" msgstr "" @@ -464,194 +464,216 @@ msgstr "在 -999,999,999 到 999,999,999 (含)之間" msgid "Between 0 and 86,399 inclusive." msgstr "在 0 到 86,399 (含)之間" -#: ../../library/datetime.rst:301 +#: ../../library/datetime.rst:300 +msgid "" +"It is a somewhat common bug for code to unintentionally use this attribute " +"when it is actually intended to get a :meth:`~timedelta.total_seconds` value " +"instead:" +msgstr "" + +#: ../../library/datetime.rst:304 +#, fuzzy +msgid "" +">>> from datetime import timedelta\n" +">>> duration = timedelta(seconds=11235813)\n" +">>> duration.days, duration.seconds\n" +"(130, 3813)\n" +">>> duration.total_seconds()\n" +"11235813.0" +msgstr "" +">>> from datetime import timedelta\n" +">>> d = timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" + +#: ../../library/datetime.rst:315 msgid "Between 0 and 999,999 inclusive." msgstr "在 0 到 999,999 (含)之間" -#: ../../library/datetime.rst:304 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:318 ../../library/datetime.rst:601 +#: ../../library/datetime.rst:1195 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:309 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1184 +#: ../../library/datetime.rst:323 ../../library/datetime.rst:604 +#: ../../library/datetime.rst:1198 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:309 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1184 +#: ../../library/datetime.rst:323 ../../library/datetime.rst:604 +#: ../../library/datetime.rst:1198 msgid "Result" msgstr "" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:325 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:325 msgid "" "Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` " "are true. (1)" msgstr "" -#: ../../library/datetime.rst:315 +#: ../../library/datetime.rst:329 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:315 +#: ../../library/datetime.rst:329 msgid "" "Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " "t1 + t3`` are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:319 +#: ../../library/datetime.rst:333 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:319 +#: ../../library/datetime.rst:333 msgid "" "Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:323 +#: ../../library/datetime.rst:337 msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:340 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:340 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:344 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:344 msgid "" "Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:348 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:348 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:352 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:352 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:356 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:356 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:359 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:359 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:350 +#: ../../library/datetime.rst:364 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:350 +#: ../../library/datetime.rst:364 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:367 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:367 msgid "" -"Equivalent to ``timedelta(-t1.days, -t1.seconds*, -t1.microseconds)``, and " -"to ``t1 * -1``. (1)(4)" +"Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to " +"``t1 * -1``. (1)(4)" msgstr "" -#: ../../library/datetime.rst:357 +#: ../../library/datetime.rst:371 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:357 +#: ../../library/datetime.rst:371 msgid "" "Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " "0``. (2)" msgstr "" -#: ../../library/datetime.rst:360 +#: ../../library/datetime.rst:374 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:360 +#: ../../library/datetime.rst:374 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:378 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:378 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:370 ../../library/datetime.rst:609 -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:384 ../../library/datetime.rst:623 +#: ../../library/datetime.rst:2596 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:373 +#: ../../library/datetime.rst:387 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:376 +#: ../../library/datetime.rst:390 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:379 +#: ../../library/datetime.rst:393 msgid "Division by zero raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:382 +#: ../../library/datetime.rst:396 msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:385 +#: ../../library/datetime.rst:399 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:389 +#: ../../library/datetime.rst:403 msgid "" ">>> timedelta(hours=-5)\n" "datetime.timedelta(days=-1, seconds=68400)\n" @@ -663,21 +685,21 @@ msgstr "" ">>> print(_)\n" "-1 day, 19:00:00" -#: ../../library/datetime.rst:395 +#: ../../library/datetime.rst:409 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:413 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:403 +#: ../../library/datetime.rst:417 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -685,43 +707,43 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:409 +#: ../../library/datetime.rst:423 msgid ":class:`timedelta` objects support equality and order comparisons." msgstr "" -#: ../../library/datetime.rst:411 +#: ../../library/datetime.rst:425 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:414 ../../library/datetime.rst:651 -#: ../../library/datetime.rst:1271 ../../library/datetime.rst:1873 +#: ../../library/datetime.rst:428 ../../library/datetime.rst:665 +#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1887 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:418 +#: ../../library/datetime.rst:432 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:422 +#: ../../library/datetime.rst:436 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:428 +#: ../../library/datetime.rst:442 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例::class:`timedelta`" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:444 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:432 +#: ../../library/datetime.rst:446 msgid "" ">>> # Components of another_year add up to exactly 365 days\n" ">>> from datetime import timedelta\n" @@ -734,11 +756,11 @@ msgid "" "31536000.0" msgstr "" -#: ../../library/datetime.rst:442 +#: ../../library/datetime.rst:456 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:444 +#: ../../library/datetime.rst:458 msgid "" ">>> from datetime import timedelta\n" ">>> year = timedelta(days=365)\n" @@ -768,65 +790,65 @@ msgstr "" ">>> three_years, three_years.days // 365\n" "(datetime.timedelta(days=1095), 3)" -#: ../../library/datetime.rst:461 +#: ../../library/datetime.rst:475 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:463 +#: ../../library/datetime.rst:477 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:467 +#: ../../library/datetime.rst:481 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:472 +#: ../../library/datetime.rst:486 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:489 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:476 +#: ../../library/datetime.rst:490 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:477 +#: ../../library/datetime.rst:491 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:479 ../../library/datetime.rst:869 +#: ../../library/datetime.rst:493 ../../library/datetime.rst:883 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:482 ../../library/datetime.rst:874 +#: ../../library/datetime.rst:496 ../../library/datetime.rst:888 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:486 +#: ../../library/datetime.rst:500 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:488 +#: ../../library/datetime.rst:502 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:492 +#: ../../library/datetime.rst:506 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:495 +#: ../../library/datetime.rst:509 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -836,7 +858,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:502 +#: ../../library/datetime.rst:516 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` " @@ -844,45 +866,45 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:511 +#: ../../library/datetime.rst:525 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:514 +#: ../../library/datetime.rst:528 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:521 +#: ../../library/datetime.rst:535 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:524 ../../library/datetime.rst:1030 +#: ../../library/datetime.rst:538 ../../library/datetime.rst:1044 msgid "" "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" -#: ../../library/datetime.rst:526 ../../library/datetime.rst:1032 +#: ../../library/datetime.rst:540 ../../library/datetime.rst:1046 msgid "" "Extended date representations are not currently supported (``±YYYYYY-MM-" "DD``)." msgstr "" -#: ../../library/datetime.rst:528 ../../library/datetime.rst:1034 +#: ../../library/datetime.rst:542 ../../library/datetime.rst:1048 msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" -#: ../../library/datetime.rst:530 ../../library/datetime.rst:1036 -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:544 ../../library/datetime.rst:1050 +#: ../../library/datetime.rst:1516 msgid "Examples::" msgstr "範例: ::" -#: ../../library/datetime.rst:532 +#: ../../library/datetime.rst:546 msgid "" ">>> from datetime import date\n" ">>> date.fromisoformat('2019-12-04')\n" @@ -900,64 +922,64 @@ msgstr "" ">>> date.fromisoformat('2021-W01-1')\n" "datetime.date(2021, 1, 4)" -#: ../../library/datetime.rst:541 +#: ../../library/datetime.rst:555 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:546 +#: ../../library/datetime.rst:560 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:556 +#: ../../library/datetime.rst:570 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:561 +#: ../../library/datetime.rst:575 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:566 +#: ../../library/datetime.rst:580 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1146 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:593 ../../library/datetime.rst:1151 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1142 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1156 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:606 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:606 msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" msgstr "" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:609 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:609 msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:598 +#: ../../library/datetime.rst:612 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:612 ../../library/datetime.rst:1204 msgid "\\(3)" msgstr "\\(3)" @@ -969,7 +991,7 @@ msgstr "``date1 == date2``" msgid "``date1 != date2``" msgstr "``date1 != date2``" -#: ../../library/datetime.rst:600 ../../library/datetime.rst:1192 +#: ../../library/datetime.rst:614 ../../library/datetime.rst:1206 msgid "Equality comparison. (4)" msgstr "" @@ -989,11 +1011,11 @@ msgstr "``date1 <= date2``" msgid "``date1 >= date2``" msgstr "``date1 >= date2``" -#: ../../library/datetime.rst:603 ../../library/datetime.rst:1195 +#: ../../library/datetime.rst:617 ../../library/datetime.rst:1209 msgid "Order comparison. (5)" msgstr "" -#: ../../library/datetime.rst:612 +#: ../../library/datetime.rst:626 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -1002,41 +1024,41 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:619 +#: ../../library/datetime.rst:633 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:622 +#: ../../library/datetime.rst:636 msgid "" "This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." "microseconds`` are 0, and ``date2 + timedelta == date1`` after." msgstr "" -#: ../../library/datetime.rst:626 +#: ../../library/datetime.rst:640 msgid ":class:`date` objects are equal if they represent the same date." msgstr "" -#: ../../library/datetime.rst:628 +#: ../../library/datetime.rst:642 msgid "" ":class:`!date` objects that are not also :class:`.datetime` instances are " "never equal to :class:`!datetime` objects, even if they represent the same " "date." msgstr "" -#: ../../library/datetime.rst:633 +#: ../../library/datetime.rst:647 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " "date2.toordinal()``." msgstr "" -#: ../../library/datetime.rst:637 +#: ../../library/datetime.rst:651 msgid "" "Order comparison between a :class:`!date` object that is not also a :class:`." "datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:641 ../../library/datetime.rst:1263 +#: ../../library/datetime.rst:655 ../../library/datetime.rst:1277 msgid "" "Comparison between :class:`.datetime` object and an instance of the :class:" "`date` subclass that is not a :class:`!datetime` subclass no longer converts " @@ -1045,22 +1067,22 @@ msgid "" "in subclasses." msgstr "" -#: ../../library/datetime.rst:649 +#: ../../library/datetime.rst:663 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:655 +#: ../../library/datetime.rst:669 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:658 ../../library/datetime.rst:1919 +#: ../../library/datetime.rst:672 ../../library/datetime.rst:1933 msgid "Example::" msgstr "範例: ::" -#: ../../library/datetime.rst:660 +#: ../../library/datetime.rst:674 msgid "" ">>> from datetime import date\n" ">>> d = date(2002, 12, 31)\n" @@ -1072,47 +1094,47 @@ msgstr "" ">>> d.replace(day=26)\n" "datetime.date(2002, 12, 26)" -#: ../../library/datetime.rst:665 +#: ../../library/datetime.rst:679 msgid "" ":class:`date` objects are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/datetime.rst:671 ../../library/datetime.rst:1387 +#: ../../library/datetime.rst:685 ../../library/datetime.rst:1401 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:673 +#: ../../library/datetime.rst:687 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:675 ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:689 ../../library/datetime.rst:1403 msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` 等價於: ::" -#: ../../library/datetime.rst:677 +#: ../../library/datetime.rst:691 msgid "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" msgstr "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" -#: ../../library/datetime.rst:679 +#: ../../library/datetime.rst:693 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." msgstr "" -#: ../../library/datetime.rst:685 +#: ../../library/datetime.rst:699 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:692 +#: ../../library/datetime.rst:706 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -1121,25 +1143,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:699 +#: ../../library/datetime.rst:713 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:706 +#: ../../library/datetime.rst:720 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:709 +#: ../../library/datetime.rst:723 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:711 +#: ../../library/datetime.rst:725 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -1148,13 +1170,13 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:716 +#: ../../library/datetime.rst:730 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:719 +#: ../../library/datetime.rst:733 msgid "" ">>> from datetime import date\n" ">>> date(2003, 12, 29).isocalendar()\n" @@ -1168,16 +1190,16 @@ msgstr "" ">>> date(2004, 1, 4).isocalendar()\n" "datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" -#: ../../library/datetime.rst:725 +#: ../../library/datetime.rst:739 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:730 +#: ../../library/datetime.rst:744 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "回傳一以 ISO 8601 格式 ``YYYY-MM-DD`` 表示的日期字串: ::" -#: ../../library/datetime.rst:732 +#: ../../library/datetime.rst:746 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).isoformat()\n" @@ -1187,15 +1209,15 @@ msgstr "" ">>> date(2002, 12, 4).isoformat()\n" "'2002-12-04'" -#: ../../library/datetime.rst:738 +#: ../../library/datetime.rst:752 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:743 +#: ../../library/datetime.rst:757 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:745 +#: ../../library/datetime.rst:759 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).ctime()\n" @@ -1205,22 +1227,22 @@ msgstr "" ">>> date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" -#: ../../library/datetime.rst:749 ../../library/datetime.rst:1573 +#: ../../library/datetime.rst:763 ../../library/datetime.rst:1587 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` 等價於: ::" -#: ../../library/datetime.rst:751 ../../library/datetime.rst:1575 +#: ../../library/datetime.rst:765 ../../library/datetime.rst:1589 msgid "time.ctime(time.mktime(d.timetuple()))" msgstr "time.ctime(time.mktime(d.timetuple()))" -#: ../../library/datetime.rst:753 +#: ../../library/datetime.rst:767 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:760 +#: ../../library/datetime.rst:774 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1228,7 +1250,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:767 +#: ../../library/datetime.rst:781 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 >> import time\n" ">>> from datetime import date\n" @@ -1280,11 +1302,11 @@ msgstr "" ">>> time_to_birthday.days\n" "202" -#: ../../library/datetime.rst:794 +#: ../../library/datetime.rst:808 msgid "More examples of working with :class:`date`:" msgstr "更多 :class:`date` 的用法範例:" -#: ../../library/datetime.rst:796 +#: ../../library/datetime.rst:810 msgid "" ">>> from datetime import date\n" ">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" @@ -1328,17 +1350,17 @@ msgid "" "datetime.date(2005, 3, 11)" msgstr "" -#: ../../library/datetime.rst:843 +#: ../../library/datetime.rst:857 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` 物件" -#: ../../library/datetime.rst:845 +#: ../../library/datetime.rst:859 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:848 +#: ../../library/datetime.rst:862 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1346,81 +1368,81 @@ msgid "" "every day." msgstr "" -#: ../../library/datetime.rst:852 +#: ../../library/datetime.rst:866 msgid "Constructor:" msgstr "" -#: ../../library/datetime.rst:856 +#: ../../library/datetime.rst:870 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:860 +#: ../../library/datetime.rst:874 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "``MINYEAR <= year <= MAXYEAR``," -#: ../../library/datetime.rst:861 +#: ../../library/datetime.rst:875 msgid "``1 <= month <= 12``," msgstr "``1 <= month <= 12``," -#: ../../library/datetime.rst:862 +#: ../../library/datetime.rst:876 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:863 ../../library/datetime.rst:1737 +#: ../../library/datetime.rst:877 ../../library/datetime.rst:1751 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:864 ../../library/datetime.rst:1738 +#: ../../library/datetime.rst:878 ../../library/datetime.rst:1752 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:865 ../../library/datetime.rst:1739 +#: ../../library/datetime.rst:879 ../../library/datetime.rst:1753 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:866 ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:880 ../../library/datetime.rst:1754 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:867 ../../library/datetime.rst:1741 +#: ../../library/datetime.rst:881 ../../library/datetime.rst:1755 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:871 ../../library/datetime.rst:1308 -#: ../../library/datetime.rst:1886 +#: ../../library/datetime.rst:885 ../../library/datetime.rst:1322 +#: ../../library/datetime.rst:1900 msgid "Added the *fold* parameter." msgstr "新增 *fold* 參數。" -#: ../../library/datetime.rst:878 +#: ../../library/datetime.rst:892 msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." msgstr "回傳目前的本地日期與時間,且 :attr:`.tzinfo` 為 ``None``。" -#: ../../library/datetime.rst:880 +#: ../../library/datetime.rst:894 msgid "Equivalent to::" msgstr "等價於: ::" -#: ../../library/datetime.rst:882 +#: ../../library/datetime.rst:896 msgid "datetime.fromtimestamp(time.time())" msgstr "datetime.fromtimestamp(time.time())" -#: ../../library/datetime.rst:884 +#: ../../library/datetime.rst:898 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "也請見 :meth:`now`、:meth:`fromtimestamp`。" -#: ../../library/datetime.rst:886 +#: ../../library/datetime.rst:900 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: ../../library/datetime.rst:891 +#: ../../library/datetime.rst:905 msgid "Return the current local date and time." msgstr "" -#: ../../library/datetime.rst:893 +#: ../../library/datetime.rst:907 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 " @@ -1431,28 +1453,28 @@ msgstr "" "供比透過 :func:`time.time` 取得的時間戳記更多位數的資訊(例如,這在有提供 C :" "c:func:`gettimeofday` 函式的平台上可能可行)。" -#: ../../library/datetime.rst:899 +#: ../../library/datetime.rst:913 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:902 +#: ../../library/datetime.rst:916 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:907 +#: ../../library/datetime.rst:921 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:909 +#: ../../library/datetime.rst:923 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:915 +#: ../../library/datetime.rst:929 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 " @@ -1460,11 +1482,11 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:922 +#: ../../library/datetime.rst:936 msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:927 +#: ../../library/datetime.rst:941 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 " @@ -1472,13 +1494,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:932 +#: ../../library/datetime.rst:946 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:935 +#: ../../library/datetime.rst:949 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` " @@ -1491,7 +1513,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:946 +#: ../../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:`localtime` " @@ -1499,17 +1521,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:953 +#: ../../library/datetime.rst:967 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:958 +#: ../../library/datetime.rst:972 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:961 +#: ../../library/datetime.rst:975 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:" @@ -1517,33 +1539,33 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:966 +#: ../../library/datetime.rst:980 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:968 +#: ../../library/datetime.rst:982 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" -#: ../../library/datetime.rst:970 +#: ../../library/datetime.rst:984 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:973 +#: ../../library/datetime.rst:987 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -#: ../../library/datetime.rst:975 +#: ../../library/datetime.rst:989 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:980 +#: ../../library/datetime.rst:994 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 " @@ -1552,7 +1574,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:986 +#: ../../library/datetime.rst:1000 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` " @@ -1560,11 +1582,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:994 +#: ../../library/datetime.rst:1008 msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:999 +#: ../../library/datetime.rst:1013 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1573,7 +1595,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:1007 +#: ../../library/datetime.rst:1021 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 " @@ -1584,35 +1606,35 @@ msgid "" "attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:1015 +#: ../../library/datetime.rst:1029 msgid "" "For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" -#: ../../library/datetime.rst:1018 +#: ../../library/datetime.rst:1032 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:1024 +#: ../../library/datetime.rst:1038 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1027 ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1041 ../../library/datetime.rst:1851 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1028 +#: ../../library/datetime.rst:1042 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1029 ../../library/datetime.rst:1842 +#: ../../library/datetime.rst:1043 ../../library/datetime.rst:1856 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1038 +#: ../../library/datetime.rst:1052 msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1658,13 +1680,13 @@ msgstr "" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -#: ../../library/datetime.rst:1060 +#: ../../library/datetime.rst:1074 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1067 +#: ../../library/datetime.rst:1081 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 " @@ -1672,23 +1694,23 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1076 +#: ../../library/datetime.rst:1090 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1079 +#: ../../library/datetime.rst:1093 msgid "" "If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" -#: ../../library/datetime.rst:1081 ../../library/datetime.rst:2562 +#: ../../library/datetime.rst:1095 ../../library/datetime.rst:2576 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" -#: ../../library/datetime.rst:1083 +#: ../../library/datetime.rst:1097 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. " @@ -1696,7 +1718,7 @@ msgid "" "fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1090 +#: ../../library/datetime.rst:1104 msgid "" "If *format* specifies a day of month without a year a :exc:" "`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " @@ -1707,7 +1729,7 @@ msgid "" "not have a year, explicitly add a year that is a leap year before parsing:" msgstr "" -#: ../../library/datetime.rst:1099 +#: ../../library/datetime.rst:1113 msgid "" ">>> from datetime import datetime\n" ">>> date_string = \"02/29\"\n" @@ -1717,44 +1739,44 @@ msgid "" "'February 29'" msgstr "" -#: ../../library/datetime.rst:1112 +#: ../../library/datetime.rst:1126 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1118 +#: ../../library/datetime.rst:1132 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1124 +#: ../../library/datetime.rst:1138 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1147 ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1161 ../../library/datetime.rst:1784 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1152 ../../library/datetime.rst:1157 -#: ../../library/datetime.rst:1775 ../../library/datetime.rst:1780 +#: ../../library/datetime.rst:1166 ../../library/datetime.rst:1171 +#: ../../library/datetime.rst:1789 ../../library/datetime.rst:1794 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1162 ../../library/datetime.rst:1785 +#: ../../library/datetime.rst:1176 ../../library/datetime.rst:1799 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1167 +#: ../../library/datetime.rst:1181 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1173 ../../library/datetime.rst:1796 +#: ../../library/datetime.rst:1187 ../../library/datetime.rst:1810 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 " @@ -1764,26 +1786,26 @@ msgid "" "time representation." msgstr "" -#: ../../library/datetime.rst:1186 +#: ../../library/datetime.rst:1200 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1186 ../../library/datetime.rst:2409 -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2426 -#: ../../library/datetime.rst:2431 ../../library/datetime.rst:2491 -#: ../../library/datetime.rst:2496 ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:1200 ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2428 ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2445 ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2510 ../../library/datetime.rst:2514 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1188 +#: ../../library/datetime.rst:1202 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1188 ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:1202 ../../library/datetime.rst:2456 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1204 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" @@ -1811,7 +1833,7 @@ msgstr "``datetime1 <= datetime2``" msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:1216 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " "moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." @@ -1822,7 +1844,7 @@ msgid "" "adjustments are done even if the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1211 +#: ../../library/datetime.rst:1225 msgid "" "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " "As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " @@ -1830,14 +1852,14 @@ msgid "" "input is aware." msgstr "" -#: ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1230 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:1220 +#: ../../library/datetime.rst:1234 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 " @@ -1845,7 +1867,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1239 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. " @@ -1854,17 +1876,17 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1231 +#: ../../library/datetime.rst:1245 msgid "" ":class:`.datetime` objects are equal if they represent the same date and " "time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1248 msgid "Naive and aware :class:`!datetime` objects are never equal." msgstr "" -#: ../../library/datetime.rst:1236 +#: ../../library/datetime.rst:1250 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1875,19 +1897,19 @@ msgid "" "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: ../../library/datetime.rst:1246 +#: ../../library/datetime.rst:1260 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1249 +#: ../../library/datetime.rst:1263 msgid "" "Order comparison between naive and aware :class:`.datetime` objects raises :" "exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1252 +#: ../../library/datetime.rst:1266 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1897,33 +1919,33 @@ msgid "" "implementation never overflows." msgstr "" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:1273 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1275 +#: ../../library/datetime.rst:1289 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1280 +#: ../../library/datetime.rst:1294 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:1283 ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1297 ../../library/datetime.rst:1306 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1289 +#: ../../library/datetime.rst:1303 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1300 +#: ../../library/datetime.rst:1314 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1931,27 +1953,27 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1305 +#: ../../library/datetime.rst:1319 msgid "" ":class:`.datetime` objects are also supported by generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/datetime.rst:1314 +#: ../../library/datetime.rst:1328 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:1318 +#: ../../library/datetime.rst:1332 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 time zone." msgstr "" -#: ../../library/datetime.rst:1322 +#: ../../library/datetime.rst:1336 msgid "" "If called without arguments (or with ``tz=None``) the system local time zone " "is assumed for the target time zone. The ``.tzinfo`` attribute of the " @@ -1959,7 +1981,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:1341 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 " @@ -1968,7 +1990,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1333 +#: ../../library/datetime.rst:1347 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " "*dt* without adjustment of date and time data, use ``dt." @@ -1977,14 +1999,14 @@ msgid "" "use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1338 +#: ../../library/datetime.rst:1352 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:1342 +#: ../../library/datetime.rst:1356 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -1995,49 +2017,49 @@ msgid "" " return tz.fromutc(utc)" msgstr "" -#: ../../library/datetime.rst:1350 +#: ../../library/datetime.rst:1364 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1353 +#: ../../library/datetime.rst:1367 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1360 +#: ../../library/datetime.rst:1374 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:1364 ../../library/datetime.rst:1959 -#: ../../library/datetime.rst:2066 ../../library/datetime.rst:2311 -#: ../../library/datetime.rst:2323 ../../library/datetime.rst:2635 +#: ../../library/datetime.rst:1378 ../../library/datetime.rst:1973 +#: ../../library/datetime.rst:2080 ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2337 ../../library/datetime.rst:2649 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1370 +#: ../../library/datetime.rst:1384 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:1374 ../../library/datetime.rst:1969 -#: ../../library/datetime.rst:2120 +#: ../../library/datetime.rst:1388 ../../library/datetime.rst:1983 +#: ../../library/datetime.rst:2134 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1380 +#: ../../library/datetime.rst:1394 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:1391 +#: ../../library/datetime.rst:1405 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" @@ -2047,7 +2069,7 @@ msgstr "" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" -#: ../../library/datetime.rst:1395 +#: ../../library/datetime.rst:1409 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 :" @@ -2058,7 +2080,7 @@ msgid "" "to 0." msgstr "" -#: ../../library/datetime.rst:1406 +#: ../../library/datetime.rst:1420 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " @@ -2066,7 +2088,7 @@ msgid "" "time." msgstr "" -#: ../../library/datetime.rst:1410 +#: ../../library/datetime.rst:1424 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 " @@ -2075,7 +2097,7 @@ msgid "" "and UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1433 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 " @@ -2085,20 +2107,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1442 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1433 +#: ../../library/datetime.rst:1447 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:1437 +#: ../../library/datetime.rst:1451 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 " @@ -2108,22 +2130,22 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1444 +#: ../../library/datetime.rst:1458 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1447 +#: ../../library/datetime.rst:1461 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -#: ../../library/datetime.rst:1451 +#: ../../library/datetime.rst:1465 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1457 +#: ../../library/datetime.rst:1471 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -2131,57 +2153,57 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1463 +#: ../../library/datetime.rst:1477 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -#: ../../library/datetime.rst:1465 +#: ../../library/datetime.rst:1479 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1467 +#: ../../library/datetime.rst:1481 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -#: ../../library/datetime.rst:1471 +#: ../../library/datetime.rst:1485 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:1477 +#: ../../library/datetime.rst:1491 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:1484 +#: ../../library/datetime.rst:1498 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1490 +#: ../../library/datetime.rst:1504 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1492 +#: ../../library/datetime.rst:1506 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1493 +#: ../../library/datetime.rst:1507 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1495 +#: ../../library/datetime.rst:1509 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1498 +#: ../../library/datetime.rst:1512 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -2189,13 +2211,13 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1514 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1518 msgid "" ">>> from datetime import datetime, timezone\n" ">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2209,13 +2231,13 @@ msgstr "" ">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" -#: ../../library/datetime.rst:1510 +#: ../../library/datetime.rst:1524 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:1513 +#: ../../library/datetime.rst:1527 msgid "" ">>> from datetime import tzinfo, timedelta, datetime\n" ">>> class TZ(tzinfo):\n" @@ -2229,53 +2251,53 @@ msgid "" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" -#: ../../library/datetime.rst:1524 ../../library/datetime.rst:1899 +#: ../../library/datetime.rst:1538 ../../library/datetime.rst:1913 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:1528 ../../library/datetime.rst:1903 +#: ../../library/datetime.rst:1542 ../../library/datetime.rst:1917 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1530 ../../library/datetime.rst:1905 +#: ../../library/datetime.rst:1544 ../../library/datetime.rst:1919 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1531 ../../library/datetime.rst:1906 +#: ../../library/datetime.rst:1545 ../../library/datetime.rst:1920 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1532 ../../library/datetime.rst:1907 +#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1534 ../../library/datetime.rst:1909 +#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1536 ../../library/datetime.rst:1911 +#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1540 ../../library/datetime.rst:1915 +#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1542 +#: ../../library/datetime.rst:1556 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1545 +#: ../../library/datetime.rst:1559 msgid "" ">>> from datetime import datetime\n" ">>> datetime.now().isoformat(timespec='minutes') \n" @@ -2291,21 +2313,21 @@ msgstr "" ">>> dt.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" -#: ../../library/datetime.rst:1552 ../../library/datetime.rst:1930 +#: ../../library/datetime.rst:1566 ../../library/datetime.rst:1944 msgid "Added the *timespec* parameter." msgstr "新增 *timespec* 參數。" -#: ../../library/datetime.rst:1558 +#: ../../library/datetime.rst:1572 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1564 +#: ../../library/datetime.rst:1578 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1566 +#: ../../library/datetime.rst:1580 msgid "" ">>> from datetime import datetime\n" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" @@ -2315,27 +2337,27 @@ msgstr "" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" -#: ../../library/datetime.rst:1570 +#: ../../library/datetime.rst:1584 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1577 +#: ../../library/datetime.rst:1591 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:1584 +#: ../../library/datetime.rst:1598 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:1605 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -2343,15 +2365,15 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1598 +#: ../../library/datetime.rst:1612 msgid "Examples of Usage: :class:`.datetime`" msgstr "用法範例::class:`.datetime`" -#: ../../library/datetime.rst:1600 +#: ../../library/datetime.rst:1614 msgid "Examples of working with :class:`.datetime` objects:" msgstr "更多 :class:`.datetime` 的用法範例:" -#: ../../library/datetime.rst:1602 +#: ../../library/datetime.rst:1616 msgid "" ">>> from datetime import datetime, date, time, timezone\n" "\n" @@ -2405,14 +2427,14 @@ msgid "" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" -#: ../../library/datetime.rst:1653 +#: ../../library/datetime.rst:1667 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:1657 +#: ../../library/datetime.rst:1671 msgid "" "from datetime import timedelta, datetime, tzinfo, timezone\n" "\n" @@ -2459,11 +2481,11 @@ msgid "" " return \"+04\"" msgstr "" -#: ../../library/datetime.rst:1700 +#: ../../library/datetime.rst:1714 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1702 +#: ../../library/datetime.rst:1716 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2487,63 +2509,63 @@ msgid "" "True" msgstr "" -#: ../../library/datetime.rst:1726 +#: ../../library/datetime.rst:1740 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1728 +#: ../../library/datetime.rst:1742 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:1733 +#: ../../library/datetime.rst:1747 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:1743 +#: ../../library/datetime.rst:1757 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" -#: ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:1765 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1756 +#: ../../library/datetime.rst:1770 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1761 +#: ../../library/datetime.rst:1775 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:1790 +#: ../../library/datetime.rst:1804 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:1818 msgid "" ":class:`.time` objects support equality and order comparisons, where *a* is " "considered less than *b* when *a* precedes *b* in time." msgstr "" -#: ../../library/datetime.rst:1807 +#: ../../library/datetime.rst:1821 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1811 +#: ../../library/datetime.rst:1825 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " "attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " @@ -2552,18 +2574,18 @@ msgid "" "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1817 +#: ../../library/datetime.rst:1831 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1835 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1823 +#: ../../library/datetime.rst:1837 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-" @@ -2571,33 +2593,33 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1830 +#: ../../library/datetime.rst:1844 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1848 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1838 +#: ../../library/datetime.rst:1852 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:1840 +#: ../../library/datetime.rst:1854 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1858 msgid "Examples:" msgstr "範例: ::" -#: ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1860 msgid "" ">>> from datetime import time\n" ">>> time.fromisoformat('04:23:01')\n" @@ -2637,13 +2659,13 @@ msgstr "" ">>> time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -#: ../../library/datetime.rst:1868 +#: ../../library/datetime.rst:1882 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1878 +#: ../../library/datetime.rst:1892 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2651,41 +2673,41 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1883 +#: ../../library/datetime.rst:1897 msgid "" ":class:`.time` objects are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/datetime.rst:1892 +#: ../../library/datetime.rst:1906 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1894 +#: ../../library/datetime.rst:1908 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1895 +#: ../../library/datetime.rst:1909 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1896 +#: ../../library/datetime.rst:1910 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1897 +#: ../../library/datetime.rst:1911 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1917 +#: ../../library/datetime.rst:1931 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1921 +#: ../../library/datetime.rst:1935 msgid "" ">>> from datetime import time\n" ">>> time(hour=12, minute=34, second=56, microsecond=123456)." @@ -2707,18 +2729,18 @@ msgstr "" ">>> dt.isoformat(timespec='auto')\n" "'12:34:56'" -#: ../../library/datetime.rst:1936 +#: ../../library/datetime.rst:1950 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1941 +#: ../../library/datetime.rst:1955 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1947 +#: ../../library/datetime.rst:1961 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 >> from datetime import time, tzinfo, timedelta\n" ">>> class TZ1(tzinfo):\n" @@ -2807,18 +2829,18 @@ msgstr "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" -#: ../../library/datetime.rst:2012 +#: ../../library/datetime.rst:2026 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:2016 +#: ../../library/datetime.rst:2030 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:2020 +#: ../../library/datetime.rst:2034 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 " @@ -2828,7 +2850,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:2026 +#: ../../library/datetime.rst:2040 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2838,7 +2860,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:2033 +#: ../../library/datetime.rst:2047 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`~object.__init__` method that can be called with no arguments, " @@ -2846,20 +2868,20 @@ msgid "" "technical requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:2039 +#: ../../library/datetime.rst:2053 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:2046 +#: ../../library/datetime.rst:2060 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:2049 +#: ../../library/datetime.rst:2063 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2870,31 +2892,31 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:2057 +#: ../../library/datetime.rst:2071 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" -#: ../../library/datetime.rst:2060 +#: ../../library/datetime.rst:2074 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:2063 +#: ../../library/datetime.rst:2077 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2072 +#: ../../library/datetime.rst:2086 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:2076 +#: ../../library/datetime.rst:2090 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 " @@ -2907,17 +2929,17 @@ msgid "" "to account for DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2086 +#: ../../library/datetime.rst:2100 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:2089 +#: ../../library/datetime.rst:2103 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2091 +#: ../../library/datetime.rst:2105 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " @@ -2930,24 +2952,24 @@ msgid "" "astimezone` regardless." msgstr "" -#: ../../library/datetime.rst:2100 +#: ../../library/datetime.rst:2114 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2102 +#: ../../library/datetime.rst:2116 msgid "" "def dst(self, dt):\n" " # a fixed-offset class: doesn't account for DST\n" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2106 +#: ../../library/datetime.rst:2120 msgid "or::" msgstr "或是: ::" -#: ../../library/datetime.rst:2108 +#: ../../library/datetime.rst:2122 msgid "" "def dst(self, dt):\n" " # Code to set dston and dstoff to the time zone's DST\n" @@ -2960,12 +2982,12 @@ msgid "" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2118 +#: ../../library/datetime.rst:2132 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2126 +#: ../../library/datetime.rst:2140 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:`!" @@ -2979,13 +3001,13 @@ msgid "" "accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2136 +#: ../../library/datetime.rst:2150 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2139 +#: ../../library/datetime.rst:2153 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 " @@ -2995,7 +3017,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2145 +#: ../../library/datetime.rst:2159 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 " @@ -3004,7 +3026,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2151 +#: ../../library/datetime.rst:2165 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -3014,13 +3036,13 @@ msgid "" "zones." msgstr "" -#: ../../library/datetime.rst:2157 +#: ../../library/datetime.rst:2171 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2162 +#: ../../library/datetime.rst:2176 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -3029,7 +3051,7 @@ msgid "" "datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2168 +#: ../../library/datetime.rst:2182 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -3044,13 +3066,13 @@ msgid "" "offset changes." msgstr "" -#: ../../library/datetime.rst:2179 +#: ../../library/datetime.rst:2193 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2182 +#: ../../library/datetime.rst:2196 msgid "" "def fromutc(self, dt):\n" " # raise ValueError error if dt.tzinfo is not self\n" @@ -3068,13 +3090,13 @@ msgid "" " return dt" msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2211 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:2201 +#: ../../library/datetime.rst:2215 msgid "" "from datetime import tzinfo, timedelta, datetime\n" "\n" @@ -3254,7 +3276,7 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: ../../library/datetime.rst:2203 +#: ../../library/datetime.rst:2217 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 " @@ -3263,7 +3285,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2223 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3281,7 +3303,7 @@ msgstr "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2231 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, " @@ -3290,7 +3312,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2222 +#: ../../library/datetime.rst:2236 msgid "" ">>> from datetime import datetime, timezone\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3318,7 +3340,7 @@ msgstr "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2250 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 " @@ -3333,7 +3355,7 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2247 +#: ../../library/datetime.rst:2261 msgid "" ">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" ">>> for i in range(4):\n" @@ -3357,13 +3379,13 @@ msgstr "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" -#: ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2272 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:2261 +#: ../../library/datetime.rst:2275 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3373,28 +3395,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2269 +#: ../../library/datetime.rst:2283 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2270 +#: ../../library/datetime.rst:2284 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 :class:`!timezone` instance)." msgstr "" -#: ../../library/datetime.rst:2274 +#: ../../library/datetime.rst:2288 msgid "" "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2277 +#: ../../library/datetime.rst:2291 msgid "`IANA time zone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2278 +#: ../../library/datetime.rst:2292 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 " @@ -3403,24 +3425,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2288 +#: ../../library/datetime.rst:2302 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:2304 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a time zone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2308 msgid "" "Objects of this class cannot be used to represent time zone 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:2301 +#: ../../library/datetime.rst:2315 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -3428,25 +3450,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2306 +#: ../../library/datetime.rst:2320 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:2317 ../../library/datetime.rst:2328 +#: ../../library/datetime.rst:2331 ../../library/datetime.rst:2342 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2320 +#: ../../library/datetime.rst:2334 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:2331 +#: ../../library/datetime.rst:2345 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 " @@ -3455,119 +3477,119 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2337 +#: ../../library/datetime.rst:2351 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2358 msgid "Always returns ``None``." msgstr "總是回傳 ``None``。" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2362 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2369 msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "UTC 時區,``timezone(timedelta(0))``。" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2378 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 的行為" -#: ../../library/datetime.rst:2366 +#: ../../library/datetime.rst:2380 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:2370 +#: ../../library/datetime.rst:2384 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:2374 +#: ../../library/datetime.rst:2388 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2392 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2392 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2394 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2394 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2394 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2396 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2396 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2396 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2398 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2398 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2398 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2400 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2400 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2386 +#: ../../library/datetime.rst:2400 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2407 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 格式碼" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2409 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2411 msgid "" ">>> datetime.strptime('31/01/22 23:59:59.999999',\n" "... '%d/%m/%y %H:%M:%S.%f')\n" @@ -3581,33 +3603,33 @@ msgstr "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2417 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:2407 ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 msgid "Meaning" msgstr "含義" -#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2423 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2423 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -3619,11 +3641,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2428 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2428 msgid "Weekday as locale's full name." msgstr "" @@ -3635,42 +3657,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2433 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2433 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2433 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2437 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2437 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2437 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2423 ../../library/datetime.rst:2436 -#: ../../library/datetime.rst:2439 ../../library/datetime.rst:2445 -#: ../../library/datetime.rst:2448 ../../library/datetime.rst:2454 -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2437 ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2453 ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2462 ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2486 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2440 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2440 msgid "Month as locale's abbreviated name." msgstr "" @@ -3682,11 +3704,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2445 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2445 msgid "Month as locale's full name." msgstr "" @@ -3698,67 +3720,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2450 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2450 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2436 ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2450 ../../library/datetime.rst:2462 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2453 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2453 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2453 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2456 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2456 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2442 ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2456 ../../library/datetime.rst:2526 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2459 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2459 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2459 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2462 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2462 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2465 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2465 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -3770,128 +3792,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2465 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2468 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2468 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2454 ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2468 ../../library/datetime.rst:2471 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2471 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2471 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2471 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2474 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2474 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2474 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2474 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2464 ../../library/datetime.rst:2623 +#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2637 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2464 +#: ../../library/datetime.rst:2478 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2464 +#: ../../library/datetime.rst:2478 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2464 ../../library/datetime.rst:2469 -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2540 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2469 ../../library/datetime.rst:2649 +#: ../../library/datetime.rst:2483 ../../library/datetime.rst:2663 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2483 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2483 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2486 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2486 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2486 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2489 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2489 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:2475 ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2489 ../../library/datetime.rst:2497 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2475 ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2489 ../../library/datetime.rst:2497 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2497 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2497 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:2491 +#: ../../library/datetime.rst:2505 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2505 msgid "Locale's appropriate date and time representation." msgstr "" @@ -3903,11 +3925,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2496 +#: ../../library/datetime.rst:2510 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2496 +#: ../../library/datetime.rst:2510 msgid "Locale's appropriate date representation." msgstr "" @@ -3923,11 +3945,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:2514 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:2514 msgid "Locale's appropriate time representation." msgstr "" @@ -3939,83 +3961,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2517 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2517 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2517 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2506 +#: ../../library/datetime.rst:2520 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:2512 +#: ../../library/datetime.rst:2526 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2526 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2526 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2531 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2531 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2531 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2534 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2534 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:2520 +#: ../../library/datetime.rst:2534 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2534 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2526 ../../library/datetime.rst:2645 +#: ../../library/datetime.rst:2540 ../../library/datetime.rst:2659 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2540 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2540 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2546 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -4024,7 +4046,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2537 +#: ../../library/datetime.rst:2551 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -4034,44 +4056,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2543 +#: ../../library/datetime.rst:2557 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``、``%u`` 與 ``%V``。" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2560 msgid "``%:z`` was added." msgstr "新增 ``%:z``。" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2564 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2552 +#: ../../library/datetime.rst:2566 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: ../../library/datetime.rst:2556 +#: ../../library/datetime.rst:2570 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:2560 +#: ../../library/datetime.rst:2574 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2578 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:2582 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 " @@ -4081,7 +4103,7 @@ msgstr "" "time` 物件並沒有這些值。如果使用這些格式碼,年份會以 1900 代替、月及日會以 1 " "代替。" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2586 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 " @@ -4090,7 +4112,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" -#: ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:2590 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 " @@ -4099,7 +4121,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2599 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 " @@ -4107,38 +4129,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2605 msgid "" "The :meth:`~.datetime.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:2594 +#: ../../library/datetime.rst:2608 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2612 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: ../../library/datetime.rst:2603 +#: ../../library/datetime.rst:2617 msgid "" "When used with the :meth:`~.datetime.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:2607 +#: ../../library/datetime.rst:2621 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2611 +#: ../../library/datetime.rst:2625 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -4146,17 +4168,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2618 +#: ../../library/datetime.rst:2632 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2635 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2624 +#: ../../library/datetime.rst:2638 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -4170,7 +4192,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2638 +#: ../../library/datetime.rst:2652 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -4179,53 +4201,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2646 +#: ../../library/datetime.rst:2660 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2650 +#: ../../library/datetime.rst:2664 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: ../../library/datetime.rst:2654 +#: ../../library/datetime.rst:2668 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2656 +#: ../../library/datetime.rst:2670 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2657 +#: ../../library/datetime.rst:2671 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2659 +#: ../../library/datetime.rst:2673 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:2663 +#: ../../library/datetime.rst:2677 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.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:2669 +#: ../../library/datetime.rst:2683 msgid "" "When used with the :meth:`~.datetime.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:2674 +#: ../../library/datetime.rst:2688 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:`~." @@ -4233,7 +4255,7 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2680 +#: ../../library/datetime.rst:2694 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -4241,7 +4263,7 @@ msgid "" "zero." msgstr "" -#: ../../library/datetime.rst:2685 +#: ../../library/datetime.rst:2699 msgid "" "When parsing a month and day using :meth:`~.datetime.strptime`, always " "include a year in the format. If the value you need to parse lacks a year, " @@ -4250,7 +4272,7 @@ msgid "" "parser is not a leap year. Users run into this bug every four years..." msgstr "" -#: ../../library/datetime.rst:2691 +#: ../../library/datetime.rst:2705 msgid "" ">>> month_day = \"02/29\"\n" ">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " @@ -4258,7 +4280,7 @@ msgid "" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" -#: ../../library/datetime.rst:2697 +#: ../../library/datetime.rst:2711 msgid "" ":meth:`~.datetime.strptime` calls using a format string containing a day of " "month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " @@ -4266,15 +4288,15 @@ msgid "" "See :gh:`70647`." msgstr "" -#: ../../library/datetime.rst:2704 +#: ../../library/datetime.rst:2718 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2705 +#: ../../library/datetime.rst:2719 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2707 +#: ../../library/datetime.rst:2721 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4283,23 +4305,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2713 +#: ../../library/datetime.rst:2727 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2717 +#: ../../library/datetime.rst:2731 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " "a leap year." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2372 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2372 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 2c155e66b3..0f16e267a8 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -98,46 +98,46 @@ msgid "" msgstr "" #: ../../library/email.contentmanager.rst:61 -msgid "the type's qualname (``typ.__qualname__``)" +msgid "the type's :attr:`qualname ` (``typ.__qualname__``)" msgstr "" #: ../../library/email.contentmanager.rst:62 -msgid "the type's name (``typ.__name__``)." +msgid "the type's :attr:`name ` (``typ.__name__``)." msgstr "" #: ../../library/email.contentmanager.rst:64 msgid "" "If none of the above match, repeat all of the checks above for each of the " -"types in the :term:`MRO` (``typ.__mro__``). Finally, if no other key yields " -"a handler, check for a handler for the key ``None``. If there is no handler " -"for ``None``, raise a :exc:`KeyError` for the fully qualified name of the " -"type." +"types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if " +"no other key yields a handler, check for a handler for the key ``None``. If " +"there is no handler for ``None``, raise a :exc:`KeyError` for the fully " +"qualified name of the type." msgstr "" -#: ../../library/email.contentmanager.rst:70 +#: ../../library/email.contentmanager.rst:71 msgid "" "Also add a :mailheader:`MIME-Version` header if one is not present (see " "also :class:`.MIMEPart`)." msgstr "" -#: ../../library/email.contentmanager.rst:76 +#: ../../library/email.contentmanager.rst:77 msgid "" "Record the function *handler* as the handler for *key*. For the possible " "values of *key*, see :meth:`get_content`." msgstr "" -#: ../../library/email.contentmanager.rst:82 +#: ../../library/email.contentmanager.rst:83 msgid "" "Record *handler* as the function to call when an object of a type matching " "*typekey* is passed to :meth:`set_content`. For the possible values of " "*typekey*, see :meth:`set_content`." msgstr "" -#: ../../library/email.contentmanager.rst:88 +#: ../../library/email.contentmanager.rst:89 msgid "Content Manager Instances" msgstr "" -#: ../../library/email.contentmanager.rst:90 +#: ../../library/email.contentmanager.rst:91 msgid "" "Currently the email package provides only one concrete content manager, :" "data:`raw_data_manager`, although more may be added in the future. :data:" @@ -145,7 +145,7 @@ msgid "" "provided by :attr:`~email.policy.EmailPolicy` and its derivatives." msgstr "" -#: ../../library/email.contentmanager.rst:99 +#: ../../library/email.contentmanager.rst:100 msgid "" "This content manager provides only a minimum interface beyond that provided " "by :class:`~email.message.Message` itself: it deals only with text, raw " @@ -158,7 +158,7 @@ msgid "" "simplifying the creation of multipart messages." msgstr "" -#: ../../library/email.contentmanager.rst:111 +#: ../../library/email.contentmanager.rst:112 msgid "" "Return the payload of the part as either a string (for ``text`` parts), an :" "class:`~email.message.EmailMessage` object (for ``message/rfc822`` parts), " @@ -168,28 +168,28 @@ msgid "" "to unicode. The default error handler is ``replace``." msgstr "" -#: ../../library/email.contentmanager.rst:130 +#: ../../library/email.contentmanager.rst:131 msgid "Add headers and payload to *msg*:" msgstr "" -#: ../../library/email.contentmanager.rst:132 +#: ../../library/email.contentmanager.rst:133 msgid "" "Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." msgstr "" -#: ../../library/email.contentmanager.rst:135 +#: ../../library/email.contentmanager.rst:136 msgid "" "For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to " "*subtype* if it is specified, or ``plain`` if it is not." msgstr "" -#: ../../library/email.contentmanager.rst:137 +#: ../../library/email.contentmanager.rst:138 msgid "" "For ``bytes``, use the specified *maintype* and *subtype*, or raise a :exc:" "`TypeError` if they are not specified." msgstr "" -#: ../../library/email.contentmanager.rst:139 +#: ../../library/email.contentmanager.rst:140 msgid "" "For :class:`~email.message.EmailMessage` objects, set the maintype to " "``message``, and set the subtype to *subtype* if it is specified or " @@ -197,7 +197,7 @@ msgid "" "(``bytes`` objects must be used to construct ``message/partial`` parts)." msgstr "" -#: ../../library/email.contentmanager.rst:145 +#: ../../library/email.contentmanager.rst:146 msgid "" "If *charset* is provided (which is valid only for ``str``), encode the " "string to bytes using the specified character set. The default is " @@ -205,7 +205,7 @@ msgid "" "charset name, use the standard charset instead." msgstr "" -#: ../../library/email.contentmanager.rst:150 +#: ../../library/email.contentmanager.rst:151 msgid "" "If *cte* is set, encode the payload using the specified content transfer " "encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that " @@ -215,13 +215,13 @@ msgid "" "that contains non-ASCII values), raise a :exc:`ValueError`." msgstr "" -#: ../../library/email.contentmanager.rst:158 +#: ../../library/email.contentmanager.rst:159 msgid "" "For ``str`` objects, if *cte* is not set use heuristics to determine the " "most compact encoding." msgstr "" -#: ../../library/email.contentmanager.rst:160 +#: ../../library/email.contentmanager.rst:161 msgid "" "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " "a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " @@ -230,14 +230,14 @@ msgid "" "For all other values of *subtype*, use ``7bit``." msgstr "" -#: ../../library/email.contentmanager.rst:167 +#: ../../library/email.contentmanager.rst:168 msgid "" "A *cte* of ``binary`` does not actually work correctly yet. The " "``EmailMessage`` object as modified by ``set_content`` is correct, but :" "class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" -#: ../../library/email.contentmanager.rst:172 +#: ../../library/email.contentmanager.rst:173 msgid "" "If *disposition* is set, use it as the value of the :mailheader:`Content-" "Disposition` header. If not specified, and *filename* is specified, add the " @@ -246,37 +246,37 @@ msgid "" "values for *disposition* are ``attachment`` and ``inline``." msgstr "" -#: ../../library/email.contentmanager.rst:179 +#: ../../library/email.contentmanager.rst:180 msgid "" "If *filename* is specified, use it as the value of the ``filename`` " "parameter of the :mailheader:`Content-Disposition` header." msgstr "" -#: ../../library/email.contentmanager.rst:182 +#: ../../library/email.contentmanager.rst:183 msgid "" "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " "its value." msgstr "" -#: ../../library/email.contentmanager.rst:185 +#: ../../library/email.contentmanager.rst:186 msgid "" "If *params* is specified, iterate its ``items`` method and use the resulting " "``(key, value)`` pairs to set additional parameters on the :mailheader:" "`Content-Type` header." msgstr "" -#: ../../library/email.contentmanager.rst:189 +#: ../../library/email.contentmanager.rst:190 msgid "" "If *headers* is specified and is a list of strings of the form ``headername: " "headervalue`` or a list of ``header`` objects (distinguished from strings by " "having a ``name`` attribute), add the headers to *msg*." msgstr "" -#: ../../library/email.contentmanager.rst:196 +#: ../../library/email.contentmanager.rst:197 msgid "Footnotes" msgstr "註解" -#: ../../library/email.contentmanager.rst:197 +#: ../../library/email.contentmanager.rst:198 msgid "" "Originally added in 3.4 as a :term:`provisional module `" msgstr "" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index a55e5e9a83..43e3bde9e7 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -390,7 +390,7 @@ msgid "" "class. When *use_default_map* is ``True`` (the default), the standard " "mapping of header names to classes is copied in to the registry during " "initialization. *base_class* is always the last class in the generated " -"class's ``__bases__`` list." +"class's :class:`~type.__bases__` list." msgstr "" #: ../../library/email.headerregistry.rst:322 diff --git a/library/functions.po b/library/functions.po index 1ac9b3f1e4..6f51cc8aa6 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,8 +514,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:141 ../../library/functions.rst:929 -#: ../../library/functions.rst:1308 +#: ../../library/functions.rst:141 ../../library/functions.rst:931 +#: ../../library/functions.rst:1311 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -535,7 +535,7 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:156 ../../library/functions.rst:794 +#: ../../library/functions.rst:156 ../../library/functions.rst:796 msgid "The parameter is now positional-only." msgstr "現在為僅限位置參數。" @@ -763,16 +763,18 @@ msgstr "" "`property`" #: ../../library/functions.rst:285 +#, fuzzy msgid "" -"Class methods now inherit the method attributes (``__module__``, " -"``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " -"have a new ``__wrapped__`` attribute." +"Class methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a " +"new ``__wrapped__`` attribute." msgstr "" "Class method 現在繼承了 method 屬性(``__module__``、``__name__``、" "``__qualname__``、``__doc__`` 和 ``__annotations__``),並擁有一個新的 " "``__wrapped__`` 屬性。" -#: ../../library/functions.rst:290 +#: ../../library/functions.rst:292 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." @@ -780,7 +782,7 @@ msgstr "" "Class methods 不能再包裝其他的\\ :term:`描述器 `,例如 :func:" "`property`。" -#: ../../library/functions.rst:297 +#: ../../library/functions.rst:299 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 " @@ -791,7 +793,7 @@ msgstr "" "`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" "`ast` module(模組)的說明文件瞭解如何使用 AST 物件。" -#: ../../library/functions.rst:302 +#: ../../library/functions.rst:304 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 (``''`` " @@ -800,7 +802,7 @@ msgstr "" "*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可" "辨識的值(經常會使用 ``''`` 來替代)。" -#: ../../library/functions.rst:306 +#: ../../library/functions.rst:308 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 " @@ -813,7 +815,7 @@ msgstr "" "式,可以是 ``'single'``\\ (在最後一種情況下,如果運算式執行結果不是 " "``None`` 則會被印出來)。" -#: ../../library/functions.rst:312 +#: ../../library/functions.rst:314 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -833,7 +835,7 @@ msgstr "" "引數所指定的編譯器選項和未來陳述式。如果 *dont_inherit* 是一個非零整數,則使" "用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽略。" -#: ../../library/functions.rst:323 +#: ../../library/functions.rst:325 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -848,7 +850,7 @@ msgstr "" "compiler_flag` 屬性來獲得。:ref:`編譯器旗標 `\\ 可以在 :" "mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" -#: ../../library/functions.rst:331 +#: ../../library/functions.rst:333 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -861,7 +863,7 @@ msgstr "" "``__debug__`` 為真值)、``1``\\ (assert 被刪除,``__debug__`` 為假值)或 " "``2``\\ (說明字串 (docstring) 也被刪除)。" -#: ../../library/functions.rst:337 +#: ../../library/functions.rst:339 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -869,13 +871,13 @@ msgstr "" "如果編譯的原始碼無效,此函式會引發 :exc:`SyntaxError`,如果原始碼包含 null " "bytes,則會引發 :exc:`ValueError`。" -#: ../../library/functions.rst:340 +#: ../../library/functions.rst:342 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:343 ../../library/functions.rst:345 +#: ../../library/functions.rst:345 ../../library/functions.rst:347 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " @@ -884,7 +886,7 @@ msgstr "" "引發一個附帶引數 ``source``、``filename`` 的\\ :ref:`稽核事件 ` " "``compile``。此事件也可能由隱式編譯 (implicit compilation) 所引發。" -#: ../../library/functions.rst:351 +#: ../../library/functions.rst:353 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 " @@ -894,7 +896,7 @@ msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" "結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" -#: ../../library/functions.rst:358 +#: ../../library/functions.rst:360 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 " @@ -903,7 +905,7 @@ msgstr "" "如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python " "AST 編譯器的 stack 深度限制而崩潰。" -#: ../../library/functions.rst:362 +#: ../../library/functions.rst:364 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." @@ -911,13 +913,13 @@ msgstr "" "允許使用 Windows 和 Mac 的換行符號。此外,在 ``'exec'`` 模式不需要以換行符號" "結尾。增加了 *optimize* 參數。" -#: ../../library/functions.rst:366 +#: ../../library/functions.rst:368 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." msgstr "在之前的版本,*source* 中包含 null bytes 會引發 :exc:`TypeError`。" -#: ../../library/functions.rst:370 +#: ../../library/functions.rst:372 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``." @@ -925,18 +927,18 @@ msgstr "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` 現在可以傳遞旗標以啟用對頂層 ``await``、" "``async for`` 和 ``async with`` 的支援。" -#: ../../library/functions.rst:379 +#: ../../library/functions.rst:381 msgid "" "Convert a single string or number to a complex number, or create a complex " "number from real and imaginary parts." msgstr "" -#: ../../library/functions.rst:382 ../../library/functions.rst:739 -#: ../../library/functions.rst:985 +#: ../../library/functions.rst:384 ../../library/functions.rst:741 +#: ../../library/functions.rst:987 msgid "Examples:" msgstr "例如: ::" -#: ../../library/functions.rst:384 +#: ../../library/functions.rst:386 msgid "" ">>> complex('+1.23')\n" "(1.23+0j)\n" @@ -972,7 +974,7 @@ msgstr "" ">>> complex(-1.23, 4.5)\n" "(-1.23+4.5j)" -#: ../../library/functions.rst:403 +#: ../../library/functions.rst:405 msgid "" "If the argument is a string, it must contain either a real part (in the same " "format as for :func:`float`) or an imaginary part (in the same format but " @@ -987,7 +989,7 @@ msgid "" "parentheses and leading and trailing whitespace characters are removed:" msgstr "" -#: ../../library/functions.rst:422 +#: ../../library/functions.rst:424 #, fuzzy msgid "" "If the argument is a number, the constructor serves as a numeric conversion " @@ -1002,7 +1004,7 @@ msgstr "" "back) 到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未定義,則會再回" "退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:431 +#: ../../library/functions.rst:433 msgid "" "If two arguments are provided or keyword arguments are used, each argument " "may be any numeric type (including complex). If both arguments are real " @@ -1013,20 +1015,20 @@ msgid "" "number, only its real component is used in the above expressions." msgstr "" -#: ../../library/functions.rst:441 +#: ../../library/functions.rst:443 msgid "If all arguments are omitted, returns ``0j``." msgstr "" -#: ../../library/functions.rst:443 +#: ../../library/functions.rst:445 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:445 ../../library/functions.rst:791 -#: ../../library/functions.rst:1034 +#: ../../library/functions.rst:447 ../../library/functions.rst:793 +#: ../../library/functions.rst:1036 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" -#: ../../library/functions.rst:448 +#: ../../library/functions.rst:450 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" "meth:`~object.__float__` are not defined." @@ -1034,7 +1036,7 @@ msgstr "" "如果 :meth:`~object.__complex__` 和 :meth:`~object.__float__` 未定義,則會回" "退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:455 +#: ../../library/functions.rst:457 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 " @@ -1047,7 +1049,7 @@ msgstr "" "'foobar')`` 等價於 ``del x.foobar``。*name* 不必是個 Python 識別符 " "(identifier)(請見 :func:`setattr`)。" -#: ../../library/functions.rst:468 +#: ../../library/functions.rst:470 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -1055,7 +1057,7 @@ msgstr "" "建立一個新的 dictionary(字典)。:class:`dict` 物件是一個 dictionary class。" "參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" -#: ../../library/functions.rst:471 +#: ../../library/functions.rst:473 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -1063,7 +1065,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" -#: ../../library/functions.rst:478 +#: ../../library/functions.rst:480 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 " @@ -1072,7 +1074,7 @@ msgstr "" "如果沒有引數,則回傳當前區域作用域 (local scope) 中的名稱列表。如果有引數,它" "會嘗試回傳該物件的有效屬性列表。" -#: ../../library/functions.rst:481 +#: ../../library/functions.rst:483 msgid "" "If the object has a method named :meth:`~object.__dir__`, this method will " "be called and must return the list of attributes. This allows objects that " @@ -1085,7 +1087,7 @@ msgstr "" "或 :func:`~object.__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它" "們的屬性。" -#: ../../library/functions.rst:488 +#: ../../library/functions.rst:490 msgid "" "If the object does not provide :meth:`~object.__dir__`, the function tries " "its best to gather information from the object's :attr:`~object.__dict__` " @@ -1097,7 +1099,7 @@ msgstr "" "`~object.__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有" "自定義 :func:`~object.__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:494 +#: ../../library/functions.rst:496 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -1106,13 +1108,13 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" "整的資訊:" -#: ../../library/functions.rst:498 +#: ../../library/functions.rst:500 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" -#: ../../library/functions.rst:501 +#: ../../library/functions.rst:503 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." @@ -1120,7 +1122,7 @@ msgstr "" "如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" "有屬性。" -#: ../../library/functions.rst:504 +#: ../../library/functions.rst:506 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 " @@ -1129,11 +1131,11 @@ msgstr "" "否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" "所有基礎 class 的屬性。" -#: ../../library/functions.rst:508 +#: ../../library/functions.rst:510 msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:528 +#: ../../library/functions.rst:530 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 " @@ -1146,7 +1148,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:538 +#: ../../library/functions.rst:540 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1164,7 +1166,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:550 +#: ../../library/functions.rst:552 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1177,11 +1179,11 @@ msgstr "" "__next__` method 回傳一個 tuple(元組),裡面包含一個計數值(從 *start* 開" "始,預設為 0)和透過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:562 +#: ../../library/functions.rst:564 msgid "Equivalent to::" msgstr "等價於: ::" -#: ../../library/functions.rst:564 +#: ../../library/functions.rst:566 msgid "" "def enumerate(iterable, start=0):\n" " n = start\n" @@ -1199,15 +1201,15 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/functions.rst:574 +#: ../../library/functions.rst:576 msgid "A Python expression." msgstr "" -#: ../../library/functions.rst:578 +#: ../../library/functions.rst:580 msgid "The global namespace (default: ``None``)." msgstr "" -#: ../../library/functions.rst:582 +#: ../../library/functions.rst:584 msgid "The local namespace (default: ``None``)." msgstr "" @@ -1215,7 +1217,7 @@ msgstr "" msgid "Returns" msgstr "" -#: ../../library/functions.rst:586 +#: ../../library/functions.rst:588 msgid "The result of the evaluated expression." msgstr "" @@ -1223,11 +1225,11 @@ msgstr "" msgid "raises" msgstr "引發" -#: ../../library/functions.rst:587 +#: ../../library/functions.rst:589 msgid "Syntax errors are reported as exceptions." msgstr "" -#: ../../library/functions.rst:589 +#: ../../library/functions.rst:591 #, fuzzy msgid "" "The *expression* argument is parsed and evaluated as a Python expression " @@ -1256,11 +1258,11 @@ msgstr "" "func:`eval` 被呼叫的環境中執行運算式。請注意,*eval()* 在封閉 (enclosing) 環" "境中無法存取\\ :term:`巢狀作用域 ` (non-locals)。" -#: ../../library/functions.rst:605 +#: ../../library/functions.rst:607 msgid "Example:" msgstr "範例:" -#: ../../library/functions.rst:611 +#: ../../library/functions.rst:613 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 " @@ -1271,7 +1273,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:616 +#: ../../library/functions.rst:618 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1282,13 +1284,13 @@ msgstr "" "函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :func:" "`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:621 +#: ../../library/functions.rst:623 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "如果給定來源是一個字串,那麼其前後的空格和定位字元會被移除。" -#: ../../library/functions.rst:624 +#: ../../library/functions.rst:626 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1296,8 +1298,8 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:627 ../../library/functions.rst:629 -#: ../../library/functions.rst:683 ../../library/functions.rst:685 +#: ../../library/functions.rst:629 ../../library/functions.rst:631 +#: ../../library/functions.rst:685 ../../library/functions.rst:687 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1305,17 +1307,17 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發程式碼編譯事件。" -#: ../../library/functions.rst:634 ../../library/functions.rst:705 +#: ../../library/functions.rst:636 ../../library/functions.rst:707 msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" -#: ../../library/functions.rst:638 ../../library/functions.rst:709 +#: ../../library/functions.rst:640 ../../library/functions.rst:711 msgid "" "The semantics of the default *locals* namespace have been adjusted as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:645 +#: ../../library/functions.rst:647 #, fuzzy msgid "" "This function supports dynamic execution of Python code. *source* must be " @@ -1336,7 +1338,7 @@ msgstr "" "`nonlocal`、:keyword:`yield` 和 :keyword:`return` 陳述式也不能在函式之外使" "用。該函式回傳值是 ``None``。" -#: ../../library/functions.rst:656 +#: ../../library/functions.rst:658 #, fuzzy msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " @@ -1353,7 +1355,7 @@ msgstr "" "供了 *locals* 引數,則它可以是任何映射物件。請記住在 module 層級中全域性和本" "地變數是相同的 dictionary。" -#: ../../library/functions.rst:666 +#: ../../library/functions.rst:668 msgid "" "When ``exec`` gets two separate objects as *globals* and *locals*, the code " "will be executed as if it were embedded in a class definition. This means " @@ -1362,7 +1364,7 @@ msgid "" "are treated as class variables in a class definition)." msgstr "" -#: ../../library/functions.rst:672 +#: ../../library/functions.rst:674 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:" @@ -1375,7 +1377,7 @@ msgstr "" "dictionary 傳入 :func:`exec` 之前,你可以透過將它插入 *globals* 來控制你需要" "哪些內建函式來執行程式碼。" -#: ../../library/functions.rst:678 +#: ../../library/functions.rst:680 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 " @@ -1386,7 +1388,7 @@ msgstr "" "只有在 *object* 是一個含有自由變數 (free variable) 的程式碼物件時,它才有效。" "Tuple 的長度必須與程式碼物件所引用的自由變數數量完全匹配。" -#: ../../library/functions.rst:690 +#: ../../library/functions.rst:692 #, fuzzy msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " @@ -1396,7 +1398,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:696 +#: ../../library/functions.rst:698 #, fuzzy msgid "" "The default *locals* act as described for function :func:`locals` below. " @@ -1407,11 +1409,11 @@ msgstr "" "預設的 *locals* dictionary。如果你想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:700 +#: ../../library/functions.rst:702 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:715 +#: ../../library/functions.rst:717 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1423,7 +1425,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個識別性函式,即 *iterable* 中所有假值" "元素會被移除。" -#: ../../library/functions.rst:721 +#: ../../library/functions.rst:723 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1434,7 +1436,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:726 +#: ../../library/functions.rst:728 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1442,11 +1444,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:737 +#: ../../library/functions.rst:739 msgid "Return a floating-point number constructed from a number or a string." msgstr "回傳從數字或字串生成的浮點數。" -#: ../../library/functions.rst:741 +#: ../../library/functions.rst:743 msgid "" ">>> float('+1.23')\n" "1.23\n" @@ -1470,7 +1472,7 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../library/functions.rst:754 +#: ../../library/functions.rst:756 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 " @@ -1485,7 +1487,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 :token:`~float:floatvalue` 的生成規則:" -#: ../../library/functions.rst:775 +#: ../../library/functions.rst:777 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1493,7 +1495,7 @@ msgstr "" "字母大小寫不影響,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表" "示正無窮大。" -#: ../../library/functions.rst:778 +#: ../../library/functions.rst:780 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 " @@ -1503,7 +1505,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:783 +#: ../../library/functions.rst:785 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1512,22 +1514,22 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 會委派給 ``x.__float__()``。如果未" "定義 :meth:`~object.__float__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:787 +#: ../../library/functions.rst:789 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:789 +#: ../../library/functions.rst:791 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:797 +#: ../../library/functions.rst:799 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" "如果 :meth:`~object.__float__` 未定義,則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:807 +#: ../../library/functions.rst:809 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1538,7 +1540,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:812 +#: ../../library/functions.rst:814 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1546,7 +1548,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:815 +#: ../../library/functions.rst:817 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1560,7 +1562,7 @@ msgstr "" "實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," "或是 *format_spec* 或回傳值不是字串,則會引發 :exc:`TypeError`。" -#: ../../library/functions.rst:822 +#: ../../library/functions.rst:824 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1568,7 +1570,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:831 +#: ../../library/functions.rst:833 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1578,7 +1580,7 @@ msgstr "" "``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:835 +#: ../../library/functions.rst:837 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." @@ -1586,7 +1588,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:843 +#: ../../library/functions.rst:845 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 " @@ -1601,7 +1603,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:852 +#: ../../library/functions.rst:854 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1612,7 +1614,7 @@ msgstr "" "發生在編譯期,因此你必須手動改編私有屬性(有兩個前導底線的屬性)的名稱,才能" "使用 :func:`getattr` 來取得它。" -#: ../../library/functions.rst:860 +#: ../../library/functions.rst:862 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1621,7 +1623,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:867 +#: ../../library/functions.rst:869 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. " @@ -1632,7 +1634,7 @@ msgstr "" "則回傳 ``False``。(此功能是透過呼叫 ``getattr(object, name)`` 並檢查是否引" "發 :exc:`AttributeError` 來實作的。)" -#: ../../library/functions.rst:875 +#: ../../library/functions.rst:877 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 " @@ -1643,7 +1645,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:882 +#: ../../library/functions.rst:884 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1651,7 +1653,7 @@ msgstr "" "請注意,如果物件帶有自訂的 :meth:`~object.__hash__` 方法,:func:`hash` 將根據" "運行機器的位元長度來截斷回傳值。" -#: ../../library/functions.rst:889 +#: ../../library/functions.rst:891 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 " @@ -1665,7 +1667,7 @@ msgstr "" "關鍵字或說明文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任" "意物件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:896 +#: ../../library/functions.rst:898 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 " @@ -1676,12 +1678,12 @@ msgstr "" "前面的參數是僅限位置 (positional-only) 參數。有關更多資訊,請參閱\\ :ref:`常" "見問答集中的僅限位置參數條目 `。" -#: ../../library/functions.rst:901 +#: ../../library/functions.rst:903 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "此函式會被 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:903 +#: ../../library/functions.rst:905 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1689,7 +1691,7 @@ msgstr "" "對於 :mod:`pydoc` 和 :mod:`inspect` 的變更,使得可呼叫物件回報的的簽名 " "(signature) 更加全面和一致。" -#: ../../library/functions.rst:910 +#: ../../library/functions.rst:912 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 :" @@ -1699,7 +1701,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:919 +#: ../../library/functions.rst:921 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 " @@ -1708,20 +1710,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:931 +#: ../../library/functions.rst:933 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:936 +#: ../../library/functions.rst:938 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:942 +#: ../../library/functions.rst:944 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. " @@ -1731,18 +1733,18 @@ msgstr "" "回傳物件的 \"識別性\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:947 +#: ../../library/functions.rst:949 msgid "This is the address of the object in memory." msgstr "這是該物件在記憶體中的位址。" -#: ../../library/functions.rst:949 +#: ../../library/functions.rst:951 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:955 +#: ../../library/functions.rst:957 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, " @@ -1753,7 +1755,7 @@ msgstr "" "從輸入中讀取一行,將其轉換為字串(去除末尾的換行符)並回傳。當讀取到 EOF 時," "則引發 :exc:`EOFError`。例如: ::" -#: ../../library/functions.rst:960 +#: ../../library/functions.rst:962 msgid "" ">>> s = input('--> ') \n" "--> Monty Python's Flying Circus\n" @@ -1765,7 +1767,7 @@ msgstr "" ">>> s \n" "\"Monty Python's Flying Circus\"" -#: ../../library/functions.rst:965 +#: ../../library/functions.rst:967 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1773,7 +1775,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:968 ../../library/functions.rst:970 +#: ../../library/functions.rst:970 ../../library/functions.rst:972 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1781,7 +1783,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:973 ../../library/functions.rst:975 +#: ../../library/functions.rst:975 ../../library/functions.rst:977 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1789,13 +1791,13 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:982 +#: ../../library/functions.rst:984 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." msgstr "" -#: ../../library/functions.rst:987 +#: ../../library/functions.rst:989 msgid "" ">>> int(123.45)\n" "123\n" @@ -1823,7 +1825,7 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -#: ../../library/functions.rst:1002 +#: ../../library/functions.rst:1004 msgid "" "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." "__int__()``. If the argument defines :meth:`~object.__index__`, it returns " @@ -1836,7 +1838,7 @@ msgstr "" "義了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數,則會向零" "的方向無條件捨去。" -#: ../../library/functions.rst:1008 +#: ../../library/functions.rst:1010 msgid "" "If the argument is not a number or if *base* is given, then it must be a " "string, :class:`bytes`, or :class:`bytearray` instance representing an " @@ -1849,7 +1851,7 @@ msgstr "" "以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、或在" "數字間有單一底線。" -#: ../../library/functions.rst:1014 +#: ../../library/functions.rst:1016 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 " @@ -1871,11 +1873,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:1025 +#: ../../library/functions.rst:1027 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱\\ :ref:`typesnumeric`。" -#: ../../library/functions.rst:1027 +#: ../../library/functions.rst:1029 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 " @@ -1887,22 +1889,22 @@ msgstr "" "的版本使用 :meth:`base.__int__ ` 而不是 :meth:`base." "__index__ `。" -#: ../../library/functions.rst:1037 +#: ../../library/functions.rst:1039 msgid "The first parameter is now positional-only." msgstr "第一個參數為僅限位置參數。" -#: ../../library/functions.rst:1040 +#: ../../library/functions.rst:1042 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" "如果未定義 :meth:`~object.__int__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:1043 +#: ../../library/functions.rst:1045 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "對 :meth:`~object.__trunc__` 的委派已棄用。" -#: ../../library/functions.rst:1046 +#: ../../library/functions.rst:1048 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 " @@ -1916,7 +1918,7 @@ msgstr "" "`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱\\ :ref:`整" "數字串轉換的長度限制 `\\ 說明文件。" -#: ../../library/functions.rst:1056 +#: ../../library/functions.rst:1058 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 " @@ -1956,7 +1958,7 @@ msgstr "" "是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:1088 +#: ../../library/functions.rst:1090 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1980,11 +1982,11 @@ msgstr "" "__next__` 時會不帶引數地呼叫 *object*;如果回傳的結果是 *sentinel* 則引發 :" "exc:`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:1102 +#: ../../library/functions.rst:1104 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1104 +#: ../../library/functions.rst:1106 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 " @@ -1993,7 +1995,7 @@ msgstr "" ":func:`iter` 的第二種形式有一個好用的應用,是能夠建立一個區塊閱讀器 (block-" "reader)。例如,從二進位資料庫檔案中讀取固定寬度的區塊,直到檔案的結尾: ::" -#: ../../library/functions.rst:1108 +#: ../../library/functions.rst:1110 msgid "" "from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" @@ -2005,7 +2007,7 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -#: ../../library/functions.rst:1116 +#: ../../library/functions.rst:1118 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 " @@ -2014,7 +2016,7 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1122 +#: ../../library/functions.rst:1124 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2022,7 +2024,7 @@ msgstr "" "如果物件長度大於 :data:`sys.maxsize`,像是 :class:`range(2 ** 100) `," "則 ``len`` 會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:1131 +#: ../../library/functions.rst:1133 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2030,33 +2032,33 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1137 +#: ../../library/functions.rst:1139 msgid "" "Return a mapping object representing the current local symbol table, with " "variable names as the keys, and their currently bound references as the " "values." msgstr "" -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1143 msgid "" "At module scope, as well as when using :func:`exec` or :func:`eval` with a " "single namespace, this function returns the same namespace as :func:" "`globals`." msgstr "" -#: ../../library/functions.rst:1145 +#: ../../library/functions.rst:1147 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1150 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:1153 msgid "" "In all of the above cases, each call to ``locals()`` in a given frame of " "execution will return the *same* mapping object. Changes made through the " @@ -2066,7 +2068,7 @@ msgid "" "returned mapping object." msgstr "" -#: ../../library/functions.rst:1158 +#: ../../library/functions.rst:1160 msgid "" "In an :term:`optimized scope` (including functions, generators, and " "coroutines), each call to ``locals()`` instead returns a fresh dictionary " @@ -2078,7 +2080,7 @@ msgid "" "previously returned dictionaries." msgstr "" -#: ../../library/functions.rst:1167 +#: ../../library/functions.rst:1169 msgid "" "Calling ``locals()`` as part of a comprehension in a function, generator, or " "coroutine is equivalent to calling it in the containing scope, except that " @@ -2087,19 +2089,19 @@ msgid "" "function." msgstr "" -#: ../../library/functions.rst:1173 +#: ../../library/functions.rst:1175 msgid "" "Calling ``locals()`` as part of a generator expression is equivalent to " "calling it in a nested generator function." msgstr "" -#: ../../library/functions.rst:1176 +#: ../../library/functions.rst:1178 msgid "" "The behaviour of ``locals()`` in a comprehension has been updated as " "described in :pep:`709`." msgstr "" -#: ../../library/functions.rst:1180 +#: ../../library/functions.rst:1182 msgid "" "As part of :pep:`667`, the semantics of mutating the mapping objects " "returned from this function are now defined. The behavior in :term:" @@ -2108,7 +2110,7 @@ msgid "" "versions." msgstr "" -#: ../../library/functions.rst:1190 +#: ../../library/functions.rst:1192 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2123,13 +2125,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經被編排為引數的 tuple," "請參閱 :func:`itertools.starmap`。" -#: ../../library/functions.rst:1202 +#: ../../library/functions.rst:1204 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個以上的引數中最大的。" -#: ../../library/functions.rst:1205 +#: ../../library/functions.rst:1207 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 " @@ -2138,7 +2140,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1210 ../../library/functions.rst:1248 +#: ../../library/functions.rst:1212 ../../library/functions.rst:1250 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 " @@ -2151,7 +2153,7 @@ msgstr "" "的物件。如果 iterable 為空,並且沒有提供 *default*,則會引發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:1216 +#: ../../library/functions.rst:1218 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2162,15 +2164,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1221 ../../library/functions.rst:1259 +#: ../../library/functions.rst:1223 ../../library/functions.rst:1261 msgid "Added the *default* keyword-only parameter." msgstr "新增 *default* 僅限關鍵字參數。" -#: ../../library/functions.rst:1224 ../../library/functions.rst:1262 +#: ../../library/functions.rst:1226 ../../library/functions.rst:1264 msgid "The *key* can be ``None``." msgstr "*key* 可以為 ``None``。" -#: ../../library/functions.rst:1232 +#: ../../library/functions.rst:1234 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2178,13 +2180,13 @@ msgstr "" "回傳由給定的引數所建立之「memory view(記憶體檢視)」物件。有關詳細資訊,請參" "閱\\ :ref:`typememoryview`。" -#: ../../library/functions.rst:1240 +#: ../../library/functions.rst:1242 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個以上的引數中最小的。" -#: ../../library/functions.rst:1243 +#: ../../library/functions.rst:1245 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 " @@ -2193,7 +2195,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1254 +#: ../../library/functions.rst:1256 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2204,7 +2206,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1269 +#: ../../library/functions.rst:1271 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 " @@ -2214,7 +2216,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1276 +#: ../../library/functions.rst:1278 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 " @@ -2223,15 +2225,16 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1282 +#: ../../library/functions.rst:1284 +#, fuzzy 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." +":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " +"so you can't assign arbitrary attributes to an instance of :class:`object`." msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1288 +#: ../../library/functions.rst:1291 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` " @@ -2242,7 +2245,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1298 +#: ../../library/functions.rst:1301 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." @@ -2250,7 +2253,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1315 +#: ../../library/functions.rst:1318 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 " @@ -2260,7 +2263,7 @@ msgstr "" "啟,則引發 :exc:`OSError`。關於使用此函式的更多方法,請參閱\\ :ref:`tut-" "files`。" -#: ../../library/functions.rst:1319 +#: ../../library/functions.rst:1322 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 " @@ -2273,7 +2276,7 @@ msgstr "" "器 (file descriptor)。(如果有給定檔案描述器,它會隨著回傳的 I/O 物件關閉而關" "閉,除非 *closefd* 被設為 ``False``。)" -#: ../../library/functions.rst:1325 +#: ../../library/functions.rst:1328 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. " @@ -2294,71 +2297,71 @@ msgstr "" "getencoding` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模" "式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1345 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1345 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1347 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1347 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1348 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1348 msgid "open for writing, truncating the file first" msgstr "寫入,會先清除檔案內容" -#: ../../library/functions.rst:1346 +#: ../../library/functions.rst:1349 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1346 +#: ../../library/functions.rst:1349 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性建立,如果文件已存在則會失敗" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1350 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1350 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果檔案存在則在其末端附加內容" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1351 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1348 ../../library/functions.rst:1492 +#: ../../library/functions.rst:1351 ../../library/functions.rst:1495 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1352 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1352 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1353 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1353 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1356 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 " @@ -2368,7 +2371,7 @@ msgstr "" "``'w+b'`` 模式會開啟並清除檔案。``'r+'`` 和 ``'r+b'`` 模式會開啟且保留檔案內" "容。" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1360 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* " @@ -2384,7 +2387,7 @@ msgstr "" "``'t'``),檔案的內容會以 :class:`str` 回傳,其位元組已經先被解碼,使用的是取" "決於平台的編碼系統或是給定的 *encoding*。" -#: ../../library/functions.rst:1367 +#: ../../library/functions.rst:1370 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 " @@ -2393,7 +2396,7 @@ msgstr "" "Python 不會使用底層作業系統對於文字檔案的操作概念;所有的處理都是由 Python 獨" "自完成的,因此能獨立於不同平台。" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1374 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 " @@ -2414,7 +2417,7 @@ msgstr "" "``write_through`` 旗標。若未給定 *buffering* 引數,則預設的緩衝策略會運作如" "下:" -#: ../../library/functions.rst:1381 +#: ../../library/functions.rst:1384 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 " @@ -2426,7 +2429,7 @@ msgstr "" "DEFAULT_BUFFER_SIZE`。在許多系統上,緩衝區的長度通常為 4096 或 8192 個位元" "組。" -#: ../../library/functions.rst:1386 +#: ../../library/functions.rst:1389 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2435,7 +2438,7 @@ msgstr "" "「互動式」文字檔(:meth:`~io.IOBase.isatty` 回傳 ``True`` 的檔案)會使用列緩" "衝。其他文字檔則使用上述的二進制檔案緩衝策略。" -#: ../../library/functions.rst:1390 +#: ../../library/functions.rst:1393 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 " @@ -2448,7 +2451,7 @@ msgstr "" "Python 支援的任何 :term:`text encoding`\\ (文字編碼)都是可以使用的。關於支" "援的編碼系統清單,請參閱 :mod:`codecs` module。" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1399 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 " @@ -2461,7 +2464,7 @@ msgstr "" "handlers`\\ 有列出清單),不過任何已註冊到 :func:`codecs.register_error` 的錯" "誤處理程式名稱也都是有效的。標準的名稱包括:" -#: ../../library/functions.rst:1404 +#: ../../library/functions.rst:1407 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2469,20 +2472,20 @@ msgstr "" "``'strict'`` 如果發生編碼錯誤,則引發 :exc:`ValueError` 例外。預設值 " "``None`` 也有相同的效果。" -#: ../../library/functions.rst:1408 +#: ../../library/functions.rst:1411 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "``'ignore'`` 忽略錯誤。請注意,忽略編碼錯誤可能導致資料遺失。" -#: ../../library/functions.rst:1411 +#: ../../library/functions.rst:1414 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" "``'replace'`` 會在格式不正確的資料位置插入一個替換標誌(像是 ``'?'``)。" -#: ../../library/functions.rst:1414 +#: ../../library/functions.rst:1417 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2495,7 +2498,7 @@ msgstr "" "被還原回 ``surrogateescape`` 錯誤處理程式當時所處理的那些相同位元組。這對於處" "理未知編碼方式的檔案會很好用。" -#: ../../library/functions.rst:1421 +#: ../../library/functions.rst:1424 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2504,7 +2507,7 @@ msgstr "" "``'xmlcharrefreplace'`` 僅在寫入檔案時可支援。編碼系統不支援的字元會被替換為" "適當的 XML 字元參考 (character reference) ``&#nnn;``。" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1428 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2512,7 +2515,7 @@ msgstr "" "``'backslashreplace'`` 會用 Python 的反斜線跳脫序列 (backslashed escape " "sequence) 替換格式不正確的資料。" -#: ../../library/functions.rst:1428 +#: ../../library/functions.rst:1431 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2520,7 +2523,7 @@ msgstr "" "``'namereplace'``\\ (也僅在寫入時支援)會將不支援的字元替換為 ``\\N{...}`` " "跳脫序列。" -#: ../../library/functions.rst:1436 +#: ../../library/functions.rst:1439 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2529,7 +2532,7 @@ msgstr "" "*newline* 會決定如何剖析資料串流 (stream) 中的換行字元。它可以是 ``None``、" "``''``、``'\\n'``、``'\\r'`` 或 ``'\\r\\n'``。它的運作規則如下:" -#: ../../library/functions.rst:1440 +#: ../../library/functions.rst:1443 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2545,7 +2548,7 @@ msgstr "" "傳給呼叫方時,行尾符號不會被轉換。如果它是任何其他有效的值,則輸入資料的行只" "會由給定的字串做結尾,且在回傳給呼叫方時,行尾符號不會被轉換。" -#: ../../library/functions.rst:1448 +#: ../../library/functions.rst:1451 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2558,7 +2561,7 @@ msgstr "" "``''`` 或 ``'\\n'``,則不做任何轉換。如果 *newline* 是任何其他有效的值,則寫" "入的任何 ``'\\n'`` 字元都將轉換為給定的字串。" -#: ../../library/functions.rst:1454 +#: ../../library/functions.rst:1457 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 " @@ -2569,7 +2572,7 @@ msgstr "" "則當檔案關閉時,底層的檔案描述器會保持開啟狀態。如果有給定一個檔名,則 " "*closefd* 必須是 ``True``\\ (預設值);否則將引發錯誤。" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1462 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 " @@ -2582,11 +2585,11 @@ msgstr "" "必須回傳一個開啟的檔案描述器(將 :mod:`os.open` 作為 *opener* 傳入,在功能上" "的結果會相當於傳入 ``None``)。" -#: ../../library/functions.rst:1465 +#: ../../library/functions.rst:1468 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1467 +#: ../../library/functions.rst:1470 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::" @@ -2594,7 +2597,7 @@ msgstr "" "下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," "從給定的目錄中用相對路徑開啟檔案: ::" -#: ../../library/functions.rst:1470 +#: ../../library/functions.rst:1473 msgid "" ">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" @@ -2607,7 +2610,7 @@ msgid "" ">>> os.close(dir_fd) # don't leak a file descriptor" msgstr "" -#: ../../library/functions.rst:1480 +#: ../../library/functions.rst:1483 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 " @@ -2631,7 +2634,7 @@ msgstr "" "BufferedRandom`。當緩衝被停用時,會回傳原始資料串流 :class:`io.FileIO`,它" "是 :class:`io.RawIOBase` 的一個 subclass。" -#: ../../library/functions.rst:1501 +#: ../../library/functions.rst:1504 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2641,7 +2644,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1505 +#: ../../library/functions.rst:1508 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2649,25 +2652,25 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1510 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推論 (infer)。" -#: ../../library/functions.rst:1512 +#: ../../library/functions.rst:1515 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1513 +#: ../../library/functions.rst:1516 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1514 +#: ../../library/functions.rst:1517 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去引發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1515 +#: ../../library/functions.rst:1518 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2675,11 +2678,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1520 +#: ../../library/functions.rst:1523 msgid "The file is now non-inheritable." msgstr "檔案在此版本開始是不可繼承的。" -#: ../../library/functions.rst:1524 +#: ../../library/functions.rst:1527 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 :" @@ -2688,15 +2691,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有引發例外,此函式現在會重試系統呼叫,而" "不是引發 :exc:`InterruptedError` 例外(原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1527 +#: ../../library/functions.rst:1530 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1534 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對於實作 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1532 +#: ../../library/functions.rst:1535 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2704,11 +2707,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1538 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1543 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2719,7 +2722,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1548 +#: ../../library/functions.rst:1551 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) % " @@ -2730,7 +2733,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1553 +#: ../../library/functions.rst:1556 #, fuzzy msgid "" "The arguments must have numeric types. With mixed operand types, the " @@ -2753,7 +2756,7 @@ msgstr "" "數,且指數 (exponent) 不是整數,則會得到一個複數的結果。例如,``pow(-9, " "0.5)`` 會回傳一個接近 ``3j`` 的值。" -#: ../../library/functions.rst:1565 +#: ../../library/functions.rst:1568 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 " @@ -2766,11 +2769,11 @@ msgstr "" "與 *mod* 互質。在這種情況下,會回傳 ``pow(inv_base, -exp, mod)``,其中 " "*inv_base* 是 *base* 對 *mod* 的模倒數 (inverse modulo)。" -#: ../../library/functions.rst:1571 +#: ../../library/functions.rst:1574 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "以下是一個計算 ``38`` 對 ``97`` 取模倒數的範例: ::" -#: ../../library/functions.rst:1573 +#: ../../library/functions.rst:1576 msgid "" ">>> pow(38, -1, mod=97)\n" "23\n" @@ -2782,7 +2785,7 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -#: ../../library/functions.rst:1578 +#: ../../library/functions.rst:1581 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2790,12 +2793,12 @@ msgstr "" "對於 :class:`int` 運算元,現在 ``pow`` 的三引數形式允許第二個引數為負數,也容" "許模倒數的計算。" -#: ../../library/functions.rst:1583 +#: ../../library/functions.rst:1586 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "允許關鍵字引數。在此之前只支援位置引數。" -#: ../../library/functions.rst:1590 +#: ../../library/functions.rst:1593 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 " @@ -2804,7 +2807,7 @@ msgstr "" "將 *objects* 列印到文字資料串流 *file*,用 *sep* 分隔並以 *end* 結尾。如果有" "給定 *sep*、*end*、*file* 和 *flush*,那麼它們必須是關鍵字引數的形式。" -#: ../../library/functions.rst:1594 +#: ../../library/functions.rst:1597 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* " @@ -2817,7 +2820,7 @@ msgstr "" "以是 ``None``,這表示使用預設值。如果沒有給定 *objects*,:func:`print` 就只會" "寫入 *end*。" -#: ../../library/functions.rst:1600 +#: ../../library/functions.rst:1603 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 " @@ -2829,7 +2832,7 @@ msgstr "" "串,所以 :func:`print` 不能用於二進位模式的檔案物件。對於此類物件,請改用 " "``file.write(...)``。" -#: ../../library/functions.rst:1605 +#: ../../library/functions.rst:1608 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2837,15 +2840,15 @@ msgstr "" "輸出緩衝通常會由 *file* 決定。但是如果 *flush* 為 true,則資料串流會被強制清" "除。" -#: ../../library/functions.rst:1609 +#: ../../library/functions.rst:1612 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1615 +#: ../../library/functions.rst:1618 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1617 +#: ../../library/functions.rst:1620 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 " @@ -2854,11 +2857,11 @@ msgstr "" "*fget* 是一個用於取得屬性值的函式,*fset* 是一個用於設定屬性值的函式,*fdel* " "是一個用於刪除屬性值的函式,而 *doc* 會為該屬性建立一個說明字串。" -#: ../../library/functions.rst:1621 +#: ../../library/functions.rst:1624 msgid "A typical use is to define a managed attribute ``x``::" msgstr "一個典型的用途是定義一個受管理的屬性 ``x``: ::" -#: ../../library/functions.rst:1623 +#: ../../library/functions.rst:1626 msgid "" "class C:\n" " def __init__(self):\n" @@ -2890,7 +2893,7 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../library/functions.rst:1638 +#: ../../library/functions.rst:1641 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." @@ -2898,7 +2901,7 @@ msgstr "" "如果 *c* 是 *C* 的一個實例,則 ``c.x`` 將會呼叫取得器 (getter),``c.x = " "value`` 會呼叫設定器 (setter),而 ``del c.x`` 會呼叫刪除器 (deleter)。" -#: ../../library/functions.rst:1641 +#: ../../library/functions.rst:1644 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 " @@ -2909,7 +2912,7 @@ msgstr "" "*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使用 :func:" "`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1648 msgid "" "class Parrot:\n" " def __init__(self):\n" @@ -2921,14 +2924,14 @@ msgid "" " return self._voltage" msgstr "" -#: ../../library/functions.rst:1654 +#: ../../library/functions.rst:1657 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:1662 +#: ../../library/functions.rst:1665 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2936,7 +2939,7 @@ msgid "" "with an example:" msgstr "" -#: ../../library/functions.rst:1667 +#: ../../library/functions.rst:1670 msgid "" "class C:\n" " def __init__(self):\n" @@ -2972,36 +2975,36 @@ msgstr "" " def x(self):\n" " del self._x" -#: ../../library/functions.rst:1686 +#: ../../library/functions.rst:1689 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:1690 +#: ../../library/functions.rst:1693 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1693 +#: ../../library/functions.rst:1696 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1698 +#: ../../library/functions.rst:1701 msgid "" "Attribute holding the name of the property. The name of the property can be " "changed at runtime." msgstr "" -#: ../../library/functions.rst:1709 +#: ../../library/functions.rst:1712 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:1715 +#: ../../library/functions.rst:1718 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 " @@ -3014,11 +3017,11 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1726 +#: ../../library/functions.rst:1729 msgid "This class has a custom representation that can be evaluated::" msgstr "" -#: ../../library/functions.rst:1728 +#: ../../library/functions.rst:1731 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3036,7 +3039,7 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -#: ../../library/functions.rst:1739 +#: ../../library/functions.rst:1742 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -3044,14 +3047,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1747 +#: ../../library/functions.rst:1750 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:1751 +#: ../../library/functions.rst:1754 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 " @@ -3062,13 +3065,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1760 +#: ../../library/functions.rst:1763 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1765 +#: ../../library/functions.rst:1768 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 " @@ -3077,21 +3080,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1777 +#: ../../library/functions.rst:1780 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:1781 +#: ../../library/functions.rst:1784 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:1788 +#: ../../library/functions.rst:1791 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 " @@ -3100,7 +3103,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1794 +#: ../../library/functions.rst:1797 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:" @@ -3109,21 +3112,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1802 +#: ../../library/functions.rst:1805 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:1811 +#: ../../library/functions.rst:1814 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``." msgstr "" -#: ../../library/functions.rst:1819 +#: ../../library/functions.rst:1822 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3131,48 +3134,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1824 +#: ../../library/functions.rst:1827 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" "`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1832 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1835 +#: ../../library/functions.rst:1838 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1837 +#: ../../library/functions.rst:1840 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1839 +#: ../../library/functions.rst:1842 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:1843 +#: ../../library/functions.rst:1846 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:1846 +#: ../../library/functions.rst:1849 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1849 +#: ../../library/functions.rst:1852 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 " @@ -3180,7 +3183,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1854 +#: ../../library/functions.rst:1857 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3192,22 +3195,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1863 +#: ../../library/functions.rst:1866 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1870 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1869 +#: ../../library/functions.rst:1872 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1872 +#: ../../library/functions.rst:1875 msgid "" "class C:\n" " @staticmethod\n" @@ -3217,7 +3220,7 @@ msgstr "" " @staticmethod\n" " def f(arg1, arg2, argN): ..." -#: ../../library/functions.rst:1876 +#: ../../library/functions.rst:1879 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3225,7 +3228,7 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1879 +#: ../../library/functions.rst:1882 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3233,14 +3236,14 @@ msgid "" "(such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1884 +#: ../../library/functions.rst:1887 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:1888 +#: ../../library/functions.rst:1891 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 " @@ -3249,7 +3252,7 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1897 msgid "" "def regular_function():\n" " ...\n" @@ -3263,36 +3266,41 @@ msgstr "" "class C:\n" " method = staticmethod(regular_function)" -#: ../../library/functions.rst:1900 +#: ../../library/functions.rst:1903 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1905 +#, fuzzy 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." +"Static methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " +"``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" +"Class method 現在繼承了 method 屬性(``__module__``、``__name__``、" +"``__qualname__``、``__doc__`` 和 ``__annotations__``),並擁有一個新的 " +"``__wrapped__`` 屬性。" -#: ../../library/functions.rst:1917 +#: ../../library/functions.rst:1921 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1919 +#: ../../library/functions.rst:1923 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1925 +#: ../../library/functions.rst:1929 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:1929 +#: ../../library/functions.rst:1933 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 ``''." @@ -3301,45 +3309,45 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1935 +#: ../../library/functions.rst:1939 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1938 +#: ../../library/functions.rst:1942 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -#: ../../library/functions.rst:1945 +#: ../../library/functions.rst:1949 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:1949 +#: ../../library/functions.rst:1953 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:1953 +#: ../../library/functions.rst:1957 msgid "" -"For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" +"For example, if :attr:`~type.__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:1957 +#: ../../library/functions.rst:1961 msgid "" -"The :attr:`~class.__mro__` attribute of the class corresponding to " +"The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" "`getattr` and :func:`super`. The attribute is dynamic and can change " "whenever the inheritance hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1962 +#: ../../library/functions.rst:1966 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. " @@ -3347,7 +3355,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1967 +#: ../../library/functions.rst:1971 msgid "" "When called directly within an ordinary method of a class, both arguments " "may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " @@ -3357,7 +3365,7 @@ msgid "" "including generator expressions, which implicitly create nested functions.)" msgstr "" -#: ../../library/functions.rst:1974 +#: ../../library/functions.rst:1978 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 " @@ -3365,7 +3373,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1979 +#: ../../library/functions.rst:1983 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 " @@ -3378,11 +3386,11 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1993 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1991 +#: ../../library/functions.rst:1995 msgid "" "class C(B):\n" " def method(self, arg):\n" @@ -3390,14 +3398,14 @@ msgid "" " # super(C, self).method(arg)" msgstr "" -#: ../../library/functions.rst:1996 +#: ../../library/functions.rst:2000 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:2000 +#: ../../library/functions.rst:2004 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3407,7 +3415,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:2008 +#: ../../library/functions.rst:2012 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 " @@ -3417,50 +3425,61 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2019 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:2025 +#: ../../library/functions.rst:2029 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:2034 +#: ../../library/functions.rst:2038 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__ `." +"__class__`." msgstr "" -#: ../../library/functions.rst:2038 +#: ../../library/functions.rst:2042 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:2042 +#: ../../library/functions.rst:2045 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 " -"class name and becomes the :attr:`~definition.__name__` attribute. The " -"*bases* tuple contains the base classes and becomes the :attr:`~class." -"__bases__` attribute; if empty, :class:`object`, the ultimate base of all " -"classes, is added. The *dict* dictionary contains attribute and method " -"definitions for the class body; it may be copied or wrapped before becoming " -"the :attr:`~object.__dict__` attribute. The following two statements create " -"identical :class:`type` objects:" +"class name and becomes the :attr:`~type.__name__` attribute. The *bases* " +"tuple contains the base classes and becomes the :attr:`~type.__bases__` " +"attribute; if empty, :class:`object`, the ultimate base of all classes, is " +"added. The *dict* dictionary contains attribute and method definitions for " +"the class body; it may be copied or wrapped before becoming the :attr:`~type." +"__dict__` attribute. The following two statements create identical :class:`!" +"type` objects:" msgstr "" -#: ../../library/functions.rst:2057 -msgid "See also :ref:`bltin-type-objects`." +#: ../../library/functions.rst:2060 +msgid "See also:" +msgstr "" + +#: ../../library/functions.rst:2062 +msgid "" +":ref:`Documentation on attributes and methods on classes `." +msgstr "" + +#: ../../library/functions.rst:2063 +#, fuzzy +msgid ":ref:`bltin-type-objects`" msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:2059 +#: ../../library/functions.rst:2065 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3468,58 +3487,58 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:2064 +#: ../../library/functions.rst:2070 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:2066 +#: ../../library/functions.rst:2072 msgid "" -"Subclasses of :class:`type` which don't override ``type.__new__`` may no " +"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:2073 +#: ../../library/functions.rst:2079 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " -"or any other object with a :attr:`~object.__dict__` attribute." +"or any other object with a :attr:`!__dict__` attribute." msgstr "" -#: ../../library/functions.rst:2076 +#: ../../library/functions.rst:2082 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " -"their :attr:`~object.__dict__` attributes (for example, classes use a :class:" -"`types.MappingProxyType` to prevent direct dictionary updates)." +"their :attr:`!__dict__` attributes (for example, classes use a :class:`types." +"MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:2081 +#: ../../library/functions.rst:2087 msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "" -#: ../../library/functions.rst:2083 +#: ../../library/functions.rst:2089 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:2089 +#: ../../library/functions.rst:2095 msgid "" "The result of calling this function without an argument has been updated as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:2095 +#: ../../library/functions.rst:2101 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:2098 +#: ../../library/functions.rst:2104 msgid "Example::" msgstr "例如: ::" -#: ../../library/functions.rst:2100 +#: ../../library/functions.rst:2106 msgid "" ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" @@ -3535,27 +3554,27 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -#: ../../library/functions.rst:2107 +#: ../../library/functions.rst:2113 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:2110 +#: ../../library/functions.rst:2116 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:2114 +#: ../../library/functions.rst:2120 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:2118 +#: ../../library/functions.rst:2124 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 " @@ -3563,14 +3582,14 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:2123 +#: ../../library/functions.rst:2129 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:2127 +#: ../../library/functions.rst:2133 msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" @@ -3578,14 +3597,14 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -#: ../../library/functions.rst:2130 +#: ../../library/functions.rst:2136 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:2134 +#: ../../library/functions.rst:2140 msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" @@ -3593,37 +3612,37 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../library/functions.rst:2137 +#: ../../library/functions.rst:2143 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:2155 +#: ../../library/functions.rst:2161 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:2159 +#: ../../library/functions.rst:2165 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:2163 +#: ../../library/functions.rst:2169 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:2166 +#: ../../library/functions.rst:2172 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:2168 +#: ../../library/functions.rst:2174 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 " @@ -3632,13 +3651,13 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:2174 +#: ../../library/functions.rst:2180 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2177 +#: ../../library/functions.rst:2183 msgid "" ">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" @@ -3656,17 +3675,17 @@ msgstr "" ">>> x == list(x2) and y == list(y2)\n" "True" -#: ../../library/functions.rst:2185 +#: ../../library/functions.rst:2191 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2203 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2200 +#: ../../library/functions.rst:2206 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3678,7 +3697,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2209 +#: ../../library/functions.rst:2215 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3688,7 +3707,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2216 +#: ../../library/functions.rst:2222 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3697,7 +3716,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2222 +#: ../../library/functions.rst:2228 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 " @@ -3705,37 +3724,37 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2227 +#: ../../library/functions.rst:2233 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2230 +#: ../../library/functions.rst:2236 msgid "spam = __import__('spam', globals(), locals(), [], 0)" msgstr "spam = __import__('spam', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2232 +#: ../../library/functions.rst:2238 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2234 +#: ../../library/functions.rst:2240 msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2236 +#: ../../library/functions.rst:2242 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:2239 +#: ../../library/functions.rst:2245 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2242 +#: ../../library/functions.rst:2248 msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" @@ -3745,36 +3764,36 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -#: ../../library/functions.rst:2246 +#: ../../library/functions.rst:2252 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:2250 +#: ../../library/functions.rst:2256 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2253 +#: ../../library/functions.rst:2259 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2257 +#: ../../library/functions.rst:2263 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:2262 +#: ../../library/functions.rst:2268 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2263 +#: ../../library/functions.rst:2269 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 " @@ -3787,107 +3806,107 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:154 ../../library/functions.rst:2032 +#: ../../library/functions.rst:154 ../../library/functions.rst:2036 msgid "type" msgstr "type(型別)" -#: ../../library/functions.rst:641 +#: ../../library/functions.rst:643 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/functions.rst:641 +#: ../../library/functions.rst:643 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:733 +#: ../../library/functions.rst:735 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:733 +#: ../../library/functions.rst:735 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:801 +#: ../../library/functions.rst:803 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:801 ../../library/functions.rst:1909 +#: ../../library/functions.rst:803 ../../library/functions.rst:1913 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:801 +#: ../../library/functions.rst:803 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1313 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1310 ../../library/functions.rst:1431 +#: ../../library/functions.rst:1313 ../../library/functions.rst:1434 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1338 +#: ../../library/functions.rst:1341 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1338 +#: ../../library/functions.rst:1341 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1431 +#: ../../library/functions.rst:1434 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "line-buffered I/O" msgstr "line-buffered I/O(行緩衝 I/O)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1492 ../../library/functions.rst:2191 +#: ../../library/functions.rst:1495 ../../library/functions.rst:2197 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1909 +#: ../../library/functions.rst:1913 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:2032 +#: ../../library/functions.rst:2036 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2191 +#: ../../library/functions.rst:2197 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2191 +#: ../../library/functions.rst:2197 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2191 +#: ../../library/functions.rst:2197 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/functools.po b/library/functools.po index 7032ad9def..c5113ff4be 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -878,7 +878,46 @@ msgstr "" "... print(arg.real, arg.imag)\n" "..." -#: ../../library/functools.rst:496 +#: ../../library/functools.rst:495 +msgid "" +"For code that dispatches on a collections type (e.g., ``list``), but wants " +"to typehint the items of the collection (e.g., ``list[int]``), the dispatch " +"type should be passed explicitly to the decorator itself with the typehint " +"going into the function definition::" +msgstr "" + +#: ../../library/functools.rst:500 +#, fuzzy +msgid "" +">>> @fun.register(list)\n" +"... def _(arg: list[int], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" +msgstr "" +">>> @fun.register\n" +"... def _(arg: int, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> @fun.register\n" +"... def _(arg: list, verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" + +#: ../../library/functools.rst:509 +msgid "" +"At runtime the function will dispatch on an instance of a list regardless of " +"the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " +"same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in this " +"example is for static type checkers only and has no runtime impact." +msgstr "" + +#: ../../library/functools.rst:515 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" @@ -886,7 +925,7 @@ msgstr "" "若要啟用註冊 :term:`lambdas` 和預先存在的函式,:func:`register` 屬性" "也能以函式形式使用: ::" -#: ../../library/functools.rst:499 +#: ../../library/functools.rst:518 msgid "" ">>> def nothing(arg, verbose=False):\n" "... print(\"Nothing.\")\n" @@ -898,7 +937,7 @@ msgstr "" "...\n" ">>> fun.register(type(None), nothing)" -#: ../../library/functools.rst:504 +#: ../../library/functools.rst:523 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " @@ -907,7 +946,7 @@ msgstr "" ":func:`register` 屬性回傳未加裝飾器的函式。這讓使得裝飾器堆疊 (decorator " "stacking)、:mod:`pickling` 以及為每個變體獨立建立單元測試成為可能:" -#: ../../library/functools.rst:508 +#: ../../library/functools.rst:527 msgid "" ">>> @fun.register(float)\n" "... @fun.register(Decimal)\n" @@ -929,13 +968,13 @@ msgstr "" ">>> fun_num is fun\n" "False" -#: ../../library/functools.rst:518 +#: ../../library/functools.rst:537 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "呼叫時,泛型函式會分派第一個引數的型別: ::" -#: ../../library/functools.rst:521 +#: ../../library/functools.rst:540 msgid "" ">>> fun(\"Hello, world.\")\n" "Hello, world.\n" @@ -971,7 +1010,7 @@ msgstr "" ">>> fun(1.23)\n" "0.615" -#: ../../library/functools.rst:538 +#: ../../library/functools.rst:557 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 " @@ -983,7 +1022,7 @@ msgstr "" "尋找更通用的實作。用 ``@singledispatch`` 裝飾的原始函式是為基底 :class:" "`object` 型別註冊的,這意味著如果沒有找到更好的實作就會使用它。" -#: ../../library/functools.rst:544 +#: ../../library/functools.rst:563 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " @@ -992,7 +1031,7 @@ msgstr "" "如果一個實作有被註冊到一個\\ :term:`抽象基底類別 `,則基" "底類別的虛擬子類別將被分派到該實作: ::" -#: ../../library/functools.rst:548 +#: ../../library/functools.rst:567 msgid "" ">>> from collections.abc import Mapping\n" ">>> @fun.register\n" @@ -1016,14 +1055,14 @@ msgstr "" ">>> fun({\"a\": \"b\"})\n" "a => b" -#: ../../library/functools.rst:559 +#: ../../library/functools.rst:578 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" "若要檢查泛型函式將為給定型別選擇哪種實作,請使用 ``dispatch()`` 屬性: ::" -#: ../../library/functools.rst:562 +#: ../../library/functools.rst:581 msgid "" ">>> fun.dispatch(float)\n" "\n" @@ -1031,13 +1070,13 @@ msgid "" "" msgstr "" -#: ../../library/functools.rst:567 +#: ../../library/functools.rst:586 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "若要存取所有已註冊的實作,請使用唯讀 ``registry`` 屬性: ::" -#: ../../library/functools.rst:570 +#: ../../library/functools.rst:589 msgid "" ">>> fun.registry.keys()\n" "dict_keys([, , ,\n" @@ -1057,11 +1096,11 @@ msgstr "" ">>> fun.registry[object]\n" "" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:600 msgid "The :func:`register` attribute now supports using type annotations." msgstr ":func:`register` 屬性現在支援使用型別註釋。" -#: ../../library/functools.rst:584 +#: ../../library/functools.rst:603 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." @@ -1069,7 +1108,7 @@ msgstr "" ":func:`register` 屬性現在支援以 :data:`types.UnionType` 和 :data:`typing." "Union` 作為型別註釋。" -#: ../../library/functools.rst:591 +#: ../../library/functools.rst:610 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." @@ -1077,7 +1116,7 @@ msgstr "" "將方法轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" -#: ../../library/functools.rst:594 +#: ../../library/functools.rst:613 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -1088,7 +1127,7 @@ msgstr "" "用 ``@singledispatchmethod`` 定義函式時,分派調度是發生在第一個非 *self* 或" "非 *cls* 引數的型別上: ::" -#: ../../library/functools.rst:599 +#: ../../library/functools.rst:618 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1116,7 +1155,7 @@ msgstr "" " def _(self, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:612 +#: ../../library/functools.rst:631 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -1129,7 +1168,7 @@ msgstr "" "``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " "``Negator`` 類別,其 ``neg`` 方法繫結到該類別,而不是該類別的實例: ::" -#: ../../library/functools.rst:618 +#: ../../library/functools.rst:637 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -1163,7 +1202,7 @@ msgstr "" " def _(cls, arg: bool):\n" " return not arg" -#: ../../library/functools.rst:634 +#: ../../library/functools.rst:653 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " @@ -1172,7 +1211,8 @@ msgstr "" "相同的模式可用於其他類似的裝飾器::func:`@staticmethod`、:func:" "`@abstractmethod` 等。" -#: ../../library/functools.rst:643 +#: ../../library/functools.rst:662 +#, fuzzy msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1180,10 +1220,12 @@ msgid "" "function and which attributes of the wrapper function are updated with the " "corresponding attributes from the original function. The default values for " "these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " -"(which assigns to the wrapper function's ``__module__``, ``__name__``, " -"``__qualname__``, ``__annotations__``, ``__type_params__``, and ``__doc__``, " -"the documentation string) and ``WRAPPER_UPDATES`` (which updates the wrapper " -"function's ``__dict__``, i.e. the instance dictionary)." +"(which assigns to the wrapper function's :attr:`~function.__module__`, :attr:" +"`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function." +"__annotations__`, :attr:`~function.__type_params__`, and :attr:`~function." +"__doc__`, the documentation string) and ``WRAPPER_UPDATES`` (which updates " +"the wrapper function's :attr:`~function.__dict__`, i.e. the instance " +"dictionary)." msgstr "" "更新 *wrapper* 函式,使其看起來像 *wrapped* 函式。可選引數是元組,用於指定原" "始函式的哪些屬性直接賦值給包裝函式上的匹配屬性,以及包裝函式的哪些屬性使用原" @@ -1192,7 +1234,7 @@ msgstr "" "``__qualname__``、``__annotations__`` 和 ``__doc__`` 文件字串 (docstring)和 " "``WRAPPER_UPDATES``\\ (更新包裝器函式的 ``__dict__``,即實例字典)。" -#: ../../library/functools.rst:654 +#: ../../library/functools.rst:674 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -1203,7 +1245,7 @@ msgstr "" "飾器,如 :func:`lru_cache`),此函式會自動向包裝器新增 ``__wrapped__`` 屬性," "該包裝器參照被包裝的函式。" -#: ../../library/functools.rst:659 +#: ../../library/functools.rst:679 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 " @@ -1215,7 +1257,7 @@ msgstr "" "裝器函式未更新,則回傳函式的元資料 (metadata) 將反映包裝器定義而非原始函式定" "義,這通常不太會有幫助。" -#: ../../library/functools.rst:665 +#: ../../library/functools.rst:685 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 " @@ -1228,16 +1270,17 @@ msgstr "" "器函式上設定它們)。如果包裝函式本身缺少 *updated* 中指定的任何屬性,仍然會引" "發 :exc:`AttributeError`。" -#: ../../library/functools.rst:671 +#: ../../library/functools.rst:691 +#, fuzzy msgid "" -"The ``__wrapped__`` attribute is now automatically added. The " -"``__annotations__`` attribute is now copied by default. Missing attributes " -"no longer trigger an :exc:`AttributeError`." +"The ``__wrapped__`` attribute is now automatically added. The :attr:" +"`~function.__annotations__` attribute is now copied by default. Missing " +"attributes no longer trigger an :exc:`AttributeError`." msgstr "" "現在會自動新增 ``__wrapped__`` 屬性。現在預設會複製 ``__annotations__`` 屬" "性。缺少的屬性不再觸發 :exc:`AttributeError`。" -#: ../../library/functools.rst:676 +#: ../../library/functools.rst:696 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" @@ -1246,11 +1289,13 @@ msgstr "" "``__wrapped__`` 屬性現在都會參照包裝函式,即便函式有定義 ``__wrapped__`` 屬" "性。(參見 :issue:`17482`)" -#: ../../library/functools.rst:681 -msgid "The ``__type_params__`` attribute is now copied by default." +#: ../../library/functools.rst:701 +#, fuzzy +msgid "" +"The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "現在預設會複製 ``__type_params__`` 屬性。" -#: ../../library/functools.rst:687 +#: ../../library/functools.rst:707 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -1261,7 +1306,7 @@ msgstr "" "式裝飾器。它相當於 ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)``。例如: ::" -#: ../../library/functools.rst:692 +#: ../../library/functools.rst:712 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -1285,7 +1330,7 @@ msgid "" "'Docstring'" msgstr "" -#: ../../library/functools.rst:713 +#: ../../library/functools.rst:733 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:" @@ -1294,11 +1339,11 @@ msgstr "" "如果不使用這個裝飾器工廠 (decorator factory),範例函式的名稱將會是 " "``'wrapper'``,並且原始 :func:`example` 的文件字串將會遺失。" -#: ../../library/functools.rst:721 +#: ../../library/functools.rst:741 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:723 +#: ../../library/functools.rst:743 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" @@ -1306,7 +1351,7 @@ msgstr "" ":class:`partial` 物件是由 :func:`partial` 所建立的可呼叫物件。它們有三個唯讀" "屬性:" -#: ../../library/functools.rst:729 +#: ../../library/functools.rst:749 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." @@ -1314,7 +1359,7 @@ msgstr "" "一個可呼叫的物件或函式。對 :class:`partial` 物件的呼叫將被轉送到帶有新引數和" "關鍵字的 :attr:`func`。" -#: ../../library/functools.rst:735 +#: ../../library/functools.rst:755 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." @@ -1322,20 +1367,22 @@ msgstr "" "最左邊的位置引數將會被加入到提供給 :class:`partial` 物件呼叫的位置引數的前" "面。" -#: ../../library/functools.rst:741 +#: ../../library/functools.rst:761 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "呼叫 :class:`partial` 物件時將提供的關鍵字引數。" -#: ../../library/functools.rst:744 +#: ../../library/functools.rst:764 +#, fuzzy msgid "" -":class:`partial` objects are like :class:`function` objects in that they are " -"callable, weak referenceable, and can have attributes. There are some " -"important differences. For instance, the :attr:`~definition.__name__` and :" -"attr:`__doc__` attributes are not created automatically. Also, :class:" -"`partial` objects defined in classes behave like static methods and do not " -"transform into bound methods during instance attribute look-up." +":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " +"attributes. There are some important differences. For instance, the :attr:" +"`~function.__name__` and :attr:`function.__doc__` attributes are not created " +"automatically. Also, :class:`partial` objects defined in classes behave " +"like static methods and do not transform into bound methods during instance " +"attribute look-up." msgstr "" ":class:`partial` 物件與 :class:`function` 物件類似,因為它們是可呼叫的、可弱" "參照的 (weak referencable) 且可以具有屬性。有一些重要的區別,例如,:attr:" diff --git a/library/gc.po b/library/gc.po index 9e8bf39153..9d218d0f89 100644 --- a/library/gc.po +++ b/library/gc.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,10 +66,10 @@ msgstr "如果啟用了自動回收則回傳 ``True``。" #: ../../library/gc.rst:43 #, fuzzy msgid "" -"Perform a collection. The optional argument *generation* may be an integer " -"specifying which generation to collect (from 0 to 2). A :exc:`ValueError` " -"is raised if the generation number is invalid. The sum of collected objects " -"and uncollectable objects is returned." +"With no arguments, run a full collection. The optional argument " +"*generation* may be an integer specifying which generation to collect (from " +"0 to 2). A :exc:`ValueError` is raised if the generation number is invalid. " +"The sum of collected objects and uncollectable objects is returned." msgstr "" "若被呼叫時沒有引數,則啟動完整垃圾回收。可選的引數 *generation* 可以是一個指" "明需要回收哪一代垃圾的整數(從 0 到 2)。當引數 *generation* 無效時,會引發 :" @@ -77,23 +77,6 @@ msgstr "" #: ../../library/gc.rst:48 msgid "" -"Calling ``gc.collect(0)`` will perform a GC collection on the young " -"generation." -msgstr "" - -#: ../../library/gc.rst:50 -msgid "" -"Calling ``gc.collect(1)`` will perform a GC collection on the young " -"generation and an increment of the old generation." -msgstr "" - -#: ../../library/gc.rst:53 -msgid "" -"Calling ``gc.collect(2)`` or ``gc.collect()`` performs a full collection" -msgstr "" - -#: ../../library/gc.rst:55 -msgid "" "The free lists maintained for a number of built-in types are cleared " "whenever a full collection or collection of the highest generation (2) is " "run. Not all items in some free lists may be freed due to the particular " @@ -103,17 +86,13 @@ msgstr "" "為了特定型別的實現,特別是 :class:`float`,在某些空閒列表中並非所有項目都會被" "釋放。" -#: ../../library/gc.rst:60 +#: ../../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:63 -msgid "``generation=1`` performs an increment of collection." -msgstr "" - -#: ../../library/gc.rst:69 +#: ../../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 " @@ -122,43 +101,25 @@ msgstr "" "設定垃圾回收器的除錯旗標。除錯資訊會被寫入 ``sys.stderr``。請見下方的除錯旗標" "列表,可以使用位元操作 (bit operation) 進行設定以控制除錯程式。" -#: ../../library/gc.rst:76 +#: ../../library/gc.rst:66 msgid "Return the debugging flags currently set." msgstr "回傳當前設置的除錯旗標。" -#: ../../library/gc.rst:82 +#: ../../library/gc.rst:71 #, fuzzy msgid "" "Returns a list of all objects tracked by the collector, excluding the list " -"returned. If *generation* is not ``None``, return only the objects as " -"follows:" +"returned. If *generation* is not ``None``, return only the objects tracked " +"by the collector that are in that generation." msgstr "" "回傳一個包含回收器正在追蹤的所有物件的 list,除去所回傳的 list。如果 " "*generation* 不為 None,只回傳回收器正在追蹤且屬於該代的物件。" -#: ../../library/gc.rst:85 -#, fuzzy -msgid "0: All objects in the young generation" -msgstr "回傳永久代中的物件數量。" - -#: ../../library/gc.rst:86 -msgid "1: No objects, as there is no generation 1 (as of Python 3.13)" -msgstr "" - -#: ../../library/gc.rst:87 -#, fuzzy -msgid "2: All objects in the old generation" -msgstr "回傳永久代中的物件數量。" - -#: ../../library/gc.rst:89 +#: ../../library/gc.rst:75 msgid "New *generation* parameter." msgstr "新增 *generation* 參數。" -#: ../../library/gc.rst:92 -msgid "Generation 1 is removed" -msgstr "" - -#: ../../library/gc.rst:95 +#: ../../library/gc.rst:78 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." @@ -166,7 +127,7 @@ msgstr "" "引發一個附帶引數 ``generation`` 的\\ :ref:`稽核事件 (auditing event) " "` ``gc.get_objects``。" -#: ../../library/gc.rst:99 +#: ../../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 " @@ -176,17 +137,17 @@ msgstr "" "的垃圾回收統計資料。字典的鍵的數目在將來可能會改變,但目前每個字典包含以下項" "目:" -#: ../../library/gc.rst:104 +#: ../../library/gc.rst:87 msgid "``collections`` is the number of times this generation was collected;" msgstr "``collections`` 是該代被回收的次數;" -#: ../../library/gc.rst:106 +#: ../../library/gc.rst:89 msgid "" "``collected`` is the total number of objects collected inside this " "generation;" msgstr "``collected`` 是該代中被回收的物件總數;" -#: ../../library/gc.rst:109 +#: ../../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 " @@ -195,64 +156,54 @@ msgstr "" "``uncollectable`` 是在這一代中被發現無法回收的物件總數(因此被移到 :data:" "`garbage` list 中)。" -#: ../../library/gc.rst:118 +#: ../../library/gc.rst:101 msgid "" "Set the garbage collection thresholds (the collection frequency). Setting " "*threshold0* to zero disables collection." msgstr "設定垃圾回收閾值(回收頻率)。 將 *threshold0* 設為零會停止回收。" -#: ../../library/gc.rst:121 -msgid "" -"The GC classifies objects into two generations depending on whether they " -"have survived a collection. New objects are placed in the young generation. " -"If an object survives a collection it is moved into the old generation." -msgstr "" - -#: ../../library/gc.rst:125 -msgid "" -"In order to decide when to run, the collector keeps track of the number of " -"object allocations and deallocations since the last collection. When the " -"number of allocations minus the number of deallocations exceeds " -"*threshold0*, collection starts. For each collection, all the objects in the " -"young generation and some fraction of the old generation is collected." -msgstr "" - -#: ../../library/gc.rst:131 -msgid "" -"The fraction of the old generation that is collected is **inversely** " -"proportional to *threshold1*. The larger *threshold1* is, the slower objects " -"in the old generation are collected. For the default value of 10, 1% of the " -"old generation is scanned during each collection." -msgstr "" - -#: ../../library/gc.rst:136 -msgid "*threshold2* is ignored." -msgstr "" - -#: ../../library/gc.rst:138 +#: ../../library/gc.rst:104 msgid "" -"See `Garbage collector design `_ for more information." -msgstr "" - -#: ../../library/gc.rst:140 -msgid "*threshold2* is ignored" -msgstr "" +"The GC classifies objects into three generations depending on how many " +"collection sweeps they have survived. New objects are placed in the " +"youngest generation (generation ``0``). If an object survives a collection " +"it is moved into the next older generation. Since generation ``2`` is the " +"oldest generation, objects in that generation remain there after a " +"collection. In order to decide when to run, the collector keeps track of " +"the number object allocations and deallocations since the last collection. " +"When the number of allocations minus the number of deallocations exceeds " +"*threshold0*, collection starts. Initially only generation ``0`` is " +"examined. If generation ``0`` has been examined more than *threshold1* " +"times since generation ``1`` has been examined, then generation ``1`` is " +"examined as well. With the third generation, things are a bit more " +"complicated, see `Collecting the oldest generation `_ for more " +"information." +msgstr "" +"垃圾回收器會根據物件在多少次垃圾回收後仍倖存來把所有物件分類為三代。新建物件" +"會被放在最年輕代(第 ``0`` 代)。 如果一個物件在一次垃圾回收後倖存,它會被移" +"入下一個較老代。由於第 ``2`` 代是最老代,這一代的物件在一次垃圾回收後仍會保留" +"原樣。為了確定何時要執行,垃圾回收器會追蹤自上一次回收後物件分配和釋放的數" +"量。當分配數量減去釋放數量的結果大於 *threshold0* 時,垃圾回收就會開始。初始" +"時只有第 ``0`` 代會被檢查。如果自第 ``1`` 代被檢查後第 ``0`` 代已被檢查超過 " +"*threshold1* 次,則第 ``1`` 代也會被檢查。對於第三代來說,情況還會更復雜一" +"些,請參閱 `Collecting the oldest generation `_ 來了解詳情。" -#: ../../library/gc.rst:146 +#: ../../library/gc.rst:121 msgid "" "Return the current collection counts as a tuple of ``(count0, count1, " "count2)``." msgstr "將當前回收計數以 ``(count0, count1, count2)`` 形式的 tuple 回傳。" -#: ../../library/gc.rst:152 +#: ../../library/gc.rst:127 msgid "" "Return the current collection thresholds as a tuple of ``(threshold0, " "threshold1, threshold2)``." msgstr "" "將當前回收閾值以 ``(threshold0, threshold1, threshold2)`` 形式的 tuple 回傳。" -#: ../../library/gc.rst:158 +#: ../../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; " @@ -262,7 +213,7 @@ msgstr "" "回傳包含直接參照 objs 中任一個物件的物件 list。這個函式只定位支援垃圾回收的容" "器;參照了其它物件但不支援垃圾回收的擴充套件型別無法被找到。" -#: ../../library/gc.rst:163 +#: ../../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 " @@ -273,7 +224,7 @@ msgstr "" "會被作為參照者出現在回傳的 list 中。若只要獲取當前正在參照的物件,需要在呼" "叫 :func:`get_referrers` 之前呼叫 :func:`collect`。" -#: ../../library/gc.rst:169 +#: ../../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 " @@ -284,7 +235,7 @@ msgstr "" "在建構中而處於暫時無效的狀態。不要把 :func:`get_referrers` 用於除錯以外的其它" "目的。" -#: ../../library/gc.rst:174 +#: ../../library/gc.rst:149 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." @@ -292,7 +243,7 @@ msgstr "" "引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` ``gc." "get_referrers``。" -#: ../../library/gc.rst:179 +#: ../../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:" @@ -310,7 +261,7 @@ msgstr "" "此,可以有以下例子:一個整數對於一個引數是直接可達的,這個整數物件有可能出現" "或不出現在結果的 list 當中。" -#: ../../library/gc.rst:187 +#: ../../library/gc.rst:162 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." @@ -318,7 +269,7 @@ msgstr "" "引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` ``gc." "get_referents``。" -#: ../../library/gc.rst:191 +#: ../../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 " @@ -332,7 +283,7 @@ msgstr "" "件)會被追蹤。然而,有一些特定型別最佳化會被用來減少垃圾回收器在簡單實例(如" "只含有原子性的鍵和值的字典)上的足跡: ::" -#: ../../library/gc.rst:198 +#: ../../library/gc.rst:173 msgid "" ">>> gc.is_tracked(0)\n" "False\n" @@ -360,14 +311,14 @@ msgstr "" ">>> gc.is_tracked({\"a\": []})\n" "True" -#: ../../library/gc.rst:216 +#: ../../library/gc.rst:191 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " "collector, ``False`` otherwise. ::" msgstr "" "如果給定物件已被垃圾回收器終結則回傳 ``True``,否則回傳 ``False``。: ::" -#: ../../library/gc.rst:219 +#: ../../library/gc.rst:194 msgid "" ">>> x = None\n" ">>> class Lazarus:\n" @@ -395,7 +346,7 @@ msgstr "" ">>> gc.is_finalized(x)\n" "True" -#: ../../library/gc.rst:237 +#: ../../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." @@ -403,7 +354,7 @@ msgstr "" "凍結 (freeze) 垃圾回收器所追蹤的所有物件;將它們移至永久代並忽略所有未來的收" "集動作。" -#: ../../library/gc.rst:240 +#: ../../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 " @@ -421,23 +372,23 @@ msgstr "" "disable()``,在 ``fork()`` 之前呼叫 ``gc.freeze()``,並儘早在子行程中呼叫 " "``gc.enable()``。" -#: ../../library/gc.rst:254 +#: ../../library/gc.rst:229 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." msgstr "解凍 (unfreeze) 永久代中的物件,並將它們放回到最年老代中。" -#: ../../library/gc.rst:262 +#: ../../library/gc.rst:237 msgid "Return the number of objects in the permanent generation." msgstr "回傳永久代中的物件數量。" -#: ../../library/gc.rst:267 +#: ../../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 "以下變數僅供唯讀存取(你可以修改其值但不應該重新繫結 (rebind) 它們):" -#: ../../library/gc.rst:272 +#: ../../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 " @@ -448,7 +399,7 @@ msgstr "" "開始,該 list 在大多數時候都應該是空的,除非使用了有非 ``NULL`` ``tp_del`` 槽" "位的 C 擴充套件型別的實例。" -#: ../../library/gc.rst:277 +#: ../../library/gc.rst:252 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." @@ -456,7 +407,7 @@ msgstr "" "如果設定了 :const:`DEBUG_SAVEALL`,則所有不可達物件將被加進該 list 而不會被釋" "放。" -#: ../../library/gc.rst:280 +#: ../../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:" @@ -467,7 +418,7 @@ msgstr "" "`ResourceWarning`,在預設情況下此警告不會被提醒。如果設定了 :const:" "`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" -#: ../../library/gc.rst:286 +#: ../../library/gc.rst:261 msgid "" "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " "end up in :data:`gc.garbage` anymore." @@ -475,7 +426,7 @@ msgstr "" "根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會在 :data:" "`gc.garbage` 內。" -#: ../../library/gc.rst:292 +#: ../../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* " @@ -484,29 +435,29 @@ msgstr "" "會被垃圾回收器在回收開始前和完成後呼叫的一系列回呼函式 (callback) 。這些回呼" "函式在被呼叫時附帶兩個引數:*phase* 和 *info*。" -#: ../../library/gc.rst:296 +#: ../../library/gc.rst:271 msgid "*phase* can be one of two values:" msgstr "*phase* 可為以下兩者之一:" -#: ../../library/gc.rst:298 +#: ../../library/gc.rst:273 msgid "\"start\": The garbage collection is about to start." msgstr "\"start\":垃圾回收即將開始。" -#: ../../library/gc.rst:300 +#: ../../library/gc.rst:275 msgid "\"stop\": The garbage collection has finished." msgstr "\"stop\":垃圾回收已結束。" -#: ../../library/gc.rst:302 +#: ../../library/gc.rst:277 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" msgstr "*info* 是一個字典,提供回呼函式更多資訊。已有定義的鍵有:" -#: ../../library/gc.rst:305 +#: ../../library/gc.rst:280 msgid "\"generation\": The oldest generation being collected." msgstr "\"generation\"(代):正在被回收的最年老的一代。" -#: ../../library/gc.rst:307 +#: ../../library/gc.rst:282 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." @@ -514,7 +465,7 @@ msgstr "" "\"collected\"(已回收的):當 *phase* 為 \"stop\" 時,被成功回收的物件的數" "目。" -#: ../../library/gc.rst:310 +#: ../../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`." @@ -522,40 +473,40 @@ msgstr "" "\"uncollectable\"(不可回收的):當 *phase* 為 \"stop\" 時,不能被回收並被放" "入 :data:`garbage` 的物件的數目。" -#: ../../library/gc.rst:313 +#: ../../library/gc.rst:288 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" msgstr "應用程式可以把他們自己的回呼函式加入此 list。主要的使用場景有:" -#: ../../library/gc.rst:316 +#: ../../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:320 +#: ../../library/gc.rst:295 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." msgstr "" "讓應用程式可以識別和清理他們自己在 :data:`garbage` 中的不可回收型別物件。" -#: ../../library/gc.rst:326 +#: ../../library/gc.rst:301 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "以下常數是為了和 :func:`set_debug` 一起使用所提供:" -#: ../../library/gc.rst:331 +#: ../../library/gc.rst:306 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "在回收完成後印出統計資訊。當調校回收頻率設定時,這些資訊會很有用。" -#: ../../library/gc.rst:337 +#: ../../library/gc.rst:312 msgid "Print information on collectable objects found." msgstr "當發現可回收物件時印出資訊。" -#: ../../library/gc.rst:342 +#: ../../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 " @@ -564,7 +515,7 @@ msgstr "" "印出找到的不可回收物件的資訊(指不能被回收器回收的不可達物件)。這些物件會被" "新增到 ``garbage`` list 中。" -#: ../../library/gc.rst:346 +#: ../../library/gc.rst:321 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." @@ -572,7 +523,7 @@ msgstr "" "當 :term:`interpreter shutdown`\\ (直譯器關閉)時,若 :data:`garbage` list " "不是空的,那這些內容也會被印出。" -#: ../../library/gc.rst:352 +#: ../../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." @@ -580,7 +531,7 @@ msgstr "" "設定後,所有回收器找到的不可達物件會被加進 *garbage* 而不是直接被釋放。這在為" "一個記憶體流失的程式除錯時會很有用。" -#: ../../library/gc.rst:358 +#: ../../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 | " @@ -589,30 +540,10 @@ msgstr "" "要印出記憶體流失程式之相關資訊時,回收器所需的除錯旗標。(等同於 " "``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``)。" -#~ msgid "" -#~ "The GC classifies objects into three generations depending on how many " -#~ "collection sweeps they have survived. New objects are placed in the " -#~ "youngest generation (generation ``0``). If an object survives a " -#~ "collection it is moved into the next older generation. Since generation " -#~ "``2`` is the oldest generation, objects in that generation remain there " -#~ "after a collection. In order to decide when to run, the collector keeps " -#~ "track of the number object allocations and deallocations since the last " -#~ "collection. When the number of allocations minus the number of " -#~ "deallocations exceeds *threshold0*, collection starts. Initially only " -#~ "generation ``0`` is examined. If generation ``0`` has been examined more " -#~ "than *threshold1* times since generation ``1`` has been examined, then " -#~ "generation ``1`` is examined as well. With the third generation, things " -#~ "are a bit more complicated, see `Collecting the oldest generation " -#~ "`_ for more information." -#~ msgstr "" -#~ "垃圾回收器會根據物件在多少次垃圾回收後仍倖存來把所有物件分類為三代。新建物" -#~ "件會被放在最年輕代(第 ``0`` 代)。 如果一個物件在一次垃圾回收後倖存,它會" -#~ "被移入下一個較老代。由於第 ``2`` 代是最老代,這一代的物件在一次垃圾回收後" -#~ "仍會保留原樣。為了確定何時要執行,垃圾回收器會追蹤自上一次回收後物件分配和" -#~ "釋放的數量。當分配數量減去釋放數量的結果大於 *threshold0* 時,垃圾回收就會" -#~ "開始。初始時只有第 ``0`` 代會被檢查。如果自第 ``1`` 代被檢查後第 ``0`` 代" -#~ "已被檢查超過 *threshold1* 次,則第 ``1`` 代也會被檢查。對於第三代來說,情" -#~ "況還會更復雜一些,請參閱 `Collecting the oldest generation `_ 來了解詳情。" +#, fuzzy +#~ msgid "0: All objects in the young generation" +#~ msgstr "回傳永久代中的物件數量。" + +#, fuzzy +#~ msgid "2: All objects in the old generation" +#~ msgstr "回傳永久代中的物件數量。" diff --git a/library/importlib.po b/library/importlib.po index 77865d2b32..21e83d7803 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -1366,7 +1366,7 @@ msgstr "" msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1109 ../../library/importlib.rst:1300 +#: ../../library/importlib.rst:1109 ../../library/importlib.rst:1293 msgid "Name of the module the loader supports." msgstr "" @@ -1426,109 +1426,85 @@ msgstr "" #: ../../library/importlib.rst:1168 msgid "" "A specification for a module's import-system-related state. This is " -"typically exposed as the module's :attr:`__spec__` attribute. In the " -"descriptions below, the names in parentheses give the corresponding " -"attribute available directly on the module object, e.g. ``module.__spec__." -"origin == module.__file__``. Note, however, that while the *values* are " -"usually equivalent, they can differ since there is no synchronization " -"between the two objects. For example, it is possible to update the " -"module's :attr:`__file__` at runtime and this will not be automatically " -"reflected in the module's :attr:`__spec__.origin`, and vice versa." +"typically exposed as the module's :attr:`__spec__` attribute. Many of these " +"attributes are also available directly on a module: for example, ``module." +"__spec__.origin == module.__file__``. Note, however, that while the " +"*values* are usually equivalent, they can differ since there is no " +"synchronization between the two objects. For example, it is possible to " +"update the module's :attr:`__file__` at runtime and this will not be " +"automatically reflected in the module's :attr:`__spec__.origin`, and vice " +"versa." msgstr "" -#: ../../library/importlib.rst:1182 -msgid "(:attr:`__name__`)" -msgstr "(:attr:`__name__`)" - -#: ../../library/importlib.rst:1184 +#: ../../library/importlib.rst:1181 msgid "" -"The module's fully qualified name. The :term:`finder` should always set this " -"attribute to a non-empty string." +"The module's fully qualified name (see :attr:`__name__` attributes on " +"modules). The :term:`finder` should always set this attribute to a non-empty " +"string." msgstr "" -#: ../../library/importlib.rst:1189 -msgid "(:attr:`__loader__`)" -msgstr "(:attr:`__loader__`)" - -#: ../../library/importlib.rst:1191 +#: ../../library/importlib.rst:1187 msgid "" -"The :term:`loader` used to load the module. The :term:`finder` should always " -"set this attribute." +"The :term:`loader` used to load the module (see :attr:`__loader__` " +"attributes on modules). The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1196 -msgid "(:attr:`__file__`)" -msgstr "(:attr:`__file__`)" - -#: ../../library/importlib.rst:1198 +#: ../../library/importlib.rst:1193 msgid "" -"The location the :term:`loader` should use to load the module. For example, " -"for modules loaded from a .py file this is the filename. The :term:`finder` " -"should always set this attribute to a meaningful value for the :term:" -"`loader` to use. In the uncommon case that there is not one (like for " -"namespace packages), it should be set to ``None``." +"The location the :term:`loader` should use to load the module (see :attr:" +"`__file__` attributes on modules). For example, for modules loaded from a ." +"py file this is the filename. The :term:`finder` should always set this " +"attribute to a meaningful value for the :term:`loader` to use. In the " +"uncommon case that there is not one (like for namespace packages), it should " +"be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1206 -msgid "(:attr:`__path__`)" -msgstr "(:attr:`__path__`)" - -#: ../../library/importlib.rst:1208 +#: ../../library/importlib.rst:1202 msgid "" -"The list of locations where the package's submodules will be found. Most of " -"the time this is a single directory. The :term:`finder` should set this " -"attribute to a list, even an empty one, to indicate to the import system " -"that the module is a package. It should be set to ``None`` for non-package " -"modules. It is set automatically later to a special object for namespace " -"packages." +"The list of locations where the package's submodules will be found (see :" +"attr:`__path__` attributes on modules). Most of the time this is a single " +"directory. The :term:`finder` should set this attribute to a list, even an " +"empty one, to indicate to the import system that the module is a package. " +"It should be set to ``None`` for non-package modules. It is set " +"automatically later to a special object for namespace packages." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1212 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1223 -msgid "(:attr:`__cached__`)" -msgstr "(:attr:`__cached__`)" - -#: ../../library/importlib.rst:1225 +#: ../../library/importlib.rst:1218 msgid "" -"The filename of a compiled version of the module's code. The :term:`finder` " -"should always set this attribute but it may be ``None`` for modules that do " -"not need compiled code stored." +"The filename of a compiled version of the module's code (see :attr:" +"`__cached__` attributes on modules). The :term:`finder` should always set " +"this attribute but it may be ``None`` for modules that do not need compiled " +"code stored." msgstr "" -#: ../../library/importlib.rst:1231 -msgid "(:attr:`__package__`)" -msgstr "(:attr:`__package__`)" - -#: ../../library/importlib.rst:1233 +#: ../../library/importlib.rst:1225 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " -"empty string for a top-level module). If the module is a package then this " -"is the same as :attr:`name`." -msgstr "" - -#: ../../library/importlib.rst:1239 -msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," +"empty string for a top-level module). See :attr:`__package__` attributes on " +"modules. If the module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1232 msgid "" +"``True`` if the spec's :attr:`origin` refers to a loadable location, " "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1246 +#: ../../library/importlib.rst:1239 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1249 +#: ../../library/importlib.rst:1242 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1537,7 +1513,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1255 +#: ../../library/importlib.rst:1248 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1551,7 +1527,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1266 +#: ../../library/importlib.rst:1259 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1567,7 +1543,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1280 +#: ../../library/importlib.rst:1273 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1576,7 +1552,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1286 +#: ../../library/importlib.rst:1279 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1587,35 +1563,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1296 +#: ../../library/importlib.rst:1289 msgid ":ref:`Availability `: iOS." msgstr "" -#: ../../library/importlib.rst:1304 +#: ../../library/importlib.rst:1297 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1308 +#: ../../library/importlib.rst:1301 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1314 +#: ../../library/importlib.rst:1307 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1318 +#: ../../library/importlib.rst:1311 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1323 +#: ../../library/importlib.rst:1316 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1330 +#: ../../library/importlib.rst:1323 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1625,7 +1601,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1337 +#: ../../library/importlib.rst:1330 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1638,7 +1614,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1347 +#: ../../library/importlib.rst:1340 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1647,18 +1623,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1355 +#: ../../library/importlib.rst:1348 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1359 ../../library/importlib.rst:1375 -#: ../../library/importlib.rst:1464 +#: ../../library/importlib.rst:1352 ../../library/importlib.rst:1368 +#: ../../library/importlib.rst:1457 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1365 +#: ../../library/importlib.rst:1358 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1668,25 +1644,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1380 +#: ../../library/importlib.rst:1373 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1388 +#: ../../library/importlib.rst:1381 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1390 +#: ../../library/importlib.rst:1383 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1395 +#: ../../library/importlib.rst:1388 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1694,13 +1670,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1403 +#: ../../library/importlib.rst:1396 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1410 +#: ../../library/importlib.rst:1403 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1710,30 +1686,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1417 +#: ../../library/importlib.rst:1410 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1420 +#: ../../library/importlib.rst:1413 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1424 +#: ../../library/importlib.rst:1417 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1431 +#: ../../library/importlib.rst:1424 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1434 +#: ../../library/importlib.rst:1427 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1741,14 +1717,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1439 +#: ../../library/importlib.rst:1432 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1440 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1757,7 +1733,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1457 +#: ../../library/importlib.rst:1450 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1765,14 +1741,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1469 +#: ../../library/importlib.rst:1462 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1477 +#: ../../library/importlib.rst:1470 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1781,33 +1757,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1484 +#: ../../library/importlib.rst:1477 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1488 +#: ../../library/importlib.rst:1481 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1493 +#: ../../library/importlib.rst:1486 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1501 +#: ../../library/importlib.rst:1494 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1504 +#: ../../library/importlib.rst:1497 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1820,7 +1796,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1515 +#: ../../library/importlib.rst:1508 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1829,21 +1805,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1523 +#: ../../library/importlib.rst:1516 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1530 +#: ../../library/importlib.rst:1523 msgid "" "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 "" -#: ../../library/importlib.rst:1535 +#: ../../library/importlib.rst:1528 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1855,20 +1831,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1543 +#: ../../library/importlib.rst:1536 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1546 +#: ../../library/importlib.rst:1539 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1548 +#: ../../library/importlib.rst:1541 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1551 +#: ../../library/importlib.rst:1544 msgid "" "import importlib\n" "\n" @@ -1878,23 +1854,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1557 +#: ../../library/importlib.rst:1550 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1559 +#: ../../library/importlib.rst:1552 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1562 +#: ../../library/importlib.rst:1555 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1566 +#: ../../library/importlib.rst:1559 msgid "" "import importlib.util\n" "import sys\n" @@ -1914,11 +1890,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1585 +#: ../../library/importlib.rst:1578 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1587 +#: ../../library/importlib.rst:1580 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1928,13 +1904,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1587 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1596 +#: ../../library/importlib.rst:1589 msgid "" "import importlib.util\n" "import sys\n" @@ -1957,15 +1933,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1618 +#: ../../library/importlib.rst:1611 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1620 +#: ../../library/importlib.rst:1613 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1622 +#: ../../library/importlib.rst:1615 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1985,11 +1961,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1641 +#: ../../library/importlib.rst:1634 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1643 +#: ../../library/importlib.rst:1636 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -2003,7 +1979,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1654 +#: ../../library/importlib.rst:1647 msgid "" "import importlib.machinery\n" "import sys\n" @@ -2027,11 +2003,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1675 +#: ../../library/importlib.rst:1668 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1677 +#: ../../library/importlib.rst:1670 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -2039,7 +2015,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1683 +#: ../../library/importlib.rst:1676 msgid "" "import importlib.util\n" "import sys\n" @@ -2079,3 +2055,21 @@ msgstr "universal newlines" #: ../../library/importlib.rst:443 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" + +#~ msgid "(:attr:`__name__`)" +#~ msgstr "(:attr:`__name__`)" + +#~ msgid "(:attr:`__loader__`)" +#~ msgstr "(:attr:`__loader__`)" + +#~ msgid "(:attr:`__file__`)" +#~ msgstr "(:attr:`__file__`)" + +#~ msgid "(:attr:`__path__`)" +#~ msgstr "(:attr:`__path__`)" + +#~ msgid "(:attr:`__cached__`)" +#~ msgstr "(:attr:`__cached__`)" + +#~ msgid "(:attr:`__package__`)" +#~ msgstr "(:attr:`__package__`)" diff --git a/library/inspect.po b/library/inspect.po index 3744b86614..022ec620bd 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -841,7 +841,7 @@ msgid "" "has a :meth:`~object.__get__` method, but not a :meth:`~object.__set__` " "method or a :meth:`~object.__delete__` method. Beyond that, the set of " "attributes varies. A :attr:`~definition.__name__` attribute is usually " -"sensible, and :attr:`!__doc__` often is." +"sensible, and :attr:`~definition.__doc__` often is." msgstr "" #: ../../library/inspect.rst:525 diff --git a/library/logging.po b/library/logging.po index dbfd2969fc..7084312e2d 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,7 +346,7 @@ msgid "" "level." msgstr "" -#: ../../library/logging.rst:211 ../../library/logging.rst:554 +#: ../../library/logging.rst:211 ../../library/logging.rst:555 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`。" @@ -464,13 +464,13 @@ msgstr "" #: ../../library/logging.rst:306 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " -"dictionary which is used to populate the __dict__ of the :class:`LogRecord` " -"created for the logging event with user-defined attributes. These custom " -"attributes can then be used as you like. For example, they could be " -"incorporated into logged messages. For example::" +"dictionary which is used to populate the :attr:`~object.__dict__` of the :" +"class:`LogRecord` created for the logging event with user-defined " +"attributes. These custom attributes can then be used as you like. For " +"example, they could be incorporated into logged messages. For example::" msgstr "" -#: ../../library/logging.rst:312 +#: ../../library/logging.rst:313 msgid "" "FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s'\n" "logging.basicConfig(format=FORMAT)\n" @@ -484,24 +484,24 @@ msgstr "" "logger = logging.getLogger('tcpserver')\n" "logger.warning('Protocol problem: %s', 'connection reset', extra=d)" -#: ../../library/logging.rst:318 +#: ../../library/logging.rst:319 msgid "would print something like" msgstr "" -#: ../../library/logging.rst:320 +#: ../../library/logging.rst:321 msgid "" "2006-02-08 22:20:02,165 192.168.0.1 fbloggs Protocol problem: connection " "reset" msgstr "" -#: ../../library/logging.rst:324 +#: ../../library/logging.rst:325 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the section on :ref:`logrecord-attributes` " "for more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:328 +#: ../../library/logging.rst:329 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:" @@ -512,7 +512,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:335 +#: ../../library/logging.rst:336 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -523,32 +523,32 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:342 +#: ../../library/logging.rst:343 msgid "" "If no handler is attached to this logger (or any of its ancestors, taking " "into account the relevant :attr:`Logger.propagate` attributes), the message " "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:346 +#: ../../library/logging.rst:347 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:349 +#: ../../library/logging.rst:350 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:352 +#: ../../library/logging.rst:353 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:358 +#: ../../library/logging.rst:359 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:364 +#: ../../library/logging.rst:365 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." @@ -556,47 +556,47 @@ msgstr "" "在此記錄器上記錄一條層級為 :const:`WARNING` 的訊息。這些引數被直譯的方式與 :" "meth:`debug` 相同。" -#: ../../library/logging.rst:367 +#: ../../library/logging.rst:368 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:373 +#: ../../library/logging.rst:374 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:379 +#: ../../library/logging.rst:380 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:385 +#: ../../library/logging.rst:386 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:391 +#: ../../library/logging.rst:392 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:398 +#: ../../library/logging.rst:399 msgid "Adds the specified filter *filter* to this logger." msgstr "在該 logger 內增加指定的 filter *filter*。" -#: ../../library/logging.rst:403 +#: ../../library/logging.rst:404 msgid "Removes the specified filter *filter* from this logger." msgstr "在該 logger 內移除指定的 filter *filter*。" -#: ../../library/logging.rst:408 +#: ../../library/logging.rst:409 msgid "" "Apply this logger's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -605,22 +605,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:417 +#: ../../library/logging.rst:418 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:422 +#: ../../library/logging.rst:423 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:427 +#: ../../library/logging.rst:428 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:431 +#: ../../library/logging.rst:432 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -630,7 +630,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:441 +#: ../../library/logging.rst:442 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -639,13 +639,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:449 +#: ../../library/logging.rst:450 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:455 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -655,15 +655,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:463 +#: ../../library/logging.rst:464 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:469 +#: ../../library/logging.rst:470 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:471 +#: ../../library/logging.rst:472 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 " @@ -672,83 +672,83 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:478 +#: ../../library/logging.rst:479 msgid "Level" msgstr "" -#: ../../library/logging.rst:478 +#: ../../library/logging.rst:479 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:478 +#: ../../library/logging.rst:479 msgid "What it means / When to use it" msgstr "" -#: ../../library/logging.rst:480 +#: ../../library/logging.rst:481 msgid "0" msgstr "0" -#: ../../library/logging.rst:480 +#: ../../library/logging.rst:481 msgid "" "When set on a logger, indicates that ancestor loggers are to be consulted to " "determine the effective level. If that still resolves to :const:`!NOTSET`, " "then all events are logged. When set on a handler, all events are handled." msgstr "" -#: ../../library/logging.rst:488 +#: ../../library/logging.rst:489 msgid "10" msgstr "10" -#: ../../library/logging.rst:488 +#: ../../library/logging.rst:489 msgid "" "Detailed information, typically only of interest to a developer trying to " "diagnose a problem." msgstr "" -#: ../../library/logging.rst:492 +#: ../../library/logging.rst:493 msgid "20" msgstr "20" -#: ../../library/logging.rst:492 +#: ../../library/logging.rst:493 msgid "Confirmation that things are working as expected." msgstr "" -#: ../../library/logging.rst:495 +#: ../../library/logging.rst:496 msgid "30" msgstr "30" -#: ../../library/logging.rst:495 +#: ../../library/logging.rst:496 msgid "" "An indication that something unexpected happened, or that a problem might " "occur in the near future (e.g. 'disk space low'). The software is still " "working as expected." msgstr "" -#: ../../library/logging.rst:502 +#: ../../library/logging.rst:503 msgid "40" msgstr "40" -#: ../../library/logging.rst:502 +#: ../../library/logging.rst:503 msgid "" "Due to a more serious problem, the software has not been able to perform " "some function." msgstr "" -#: ../../library/logging.rst:506 +#: ../../library/logging.rst:507 msgid "50" msgstr "50" -#: ../../library/logging.rst:506 +#: ../../library/logging.rst:507 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." msgstr "" -#: ../../library/logging.rst:515 +#: ../../library/logging.rst:516 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:517 +#: ../../library/logging.rst:518 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -756,53 +756,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:526 +#: ../../library/logging.rst:527 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:533 +#: ../../library/logging.rst:534 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:539 +#: ../../library/logging.rst:540 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:544 +#: ../../library/logging.rst:545 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:549 +#: ../../library/logging.rst:550 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:556 +#: ../../library/logging.rst:557 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:564 +#: ../../library/logging.rst:565 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:569 +#: ../../library/logging.rst:570 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:574 +#: ../../library/logging.rst:575 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:579 +#: ../../library/logging.rst:580 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -811,13 +811,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:588 +#: ../../library/logging.rst:589 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:594 +#: ../../library/logging.rst:595 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -825,14 +825,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:602 +#: ../../library/logging.rst:603 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:609 +#: ../../library/logging.rst:610 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute :data:" @@ -845,20 +845,20 @@ msgid "" "is more useful during development)." msgstr "" -#: ../../library/logging.rst:622 +#: ../../library/logging.rst:623 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:628 +#: ../../library/logging.rst:629 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:632 +#: ../../library/logging.rst:633 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -867,13 +867,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:638 +#: ../../library/logging.rst:639 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:641 +#: ../../library/logging.rst:642 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -883,16 +883,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:648 +#: ../../library/logging.rst:649 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:653 +#: ../../library/logging.rst:654 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:659 +#: ../../library/logging.rst:660 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -902,7 +902,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:662 +#: ../../library/logging.rst:663 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -910,14 +910,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:670 +#: ../../library/logging.rst:671 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:675 +#: ../../library/logging.rst:676 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -928,32 +928,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:685 +#: ../../library/logging.rst:686 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:690 +#: ../../library/logging.rst:691 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:695 +#: ../../library/logging.rst:696 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:698 +#: ../../library/logging.rst:699 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:701 +#: ../../library/logging.rst:702 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:707 +#: ../../library/logging.rst:708 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -972,13 +972,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:723 +#: ../../library/logging.rst:724 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:729 +#: ../../library/logging.rst:730 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -991,7 +991,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:739 +#: ../../library/logging.rst:740 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -1001,7 +1001,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:747 +#: ../../library/logging.rst:748 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -1016,11 +1016,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:760 +#: ../../library/logging.rst:761 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:765 +#: ../../library/logging.rst:766 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -1028,14 +1028,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:772 +#: ../../library/logging.rst:773 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:778 +#: ../../library/logging.rst:779 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -1044,7 +1044,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:787 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -1052,14 +1052,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:793 +#: ../../library/logging.rst:794 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:800 +#: ../../library/logging.rst:801 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -1067,11 +1067,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:808 +#: ../../library/logging.rst:809 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:810 +#: ../../library/logging.rst:811 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -1081,7 +1081,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:821 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -1089,7 +1089,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:827 +#: ../../library/logging.rst:828 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -1097,7 +1097,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:832 +#: ../../library/logging.rst:833 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -1107,13 +1107,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:839 +#: ../../library/logging.rst:840 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:843 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -1124,7 +1124,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:853 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -1132,7 +1132,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:858 +#: ../../library/logging.rst:859 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -1144,11 +1144,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:871 +#: ../../library/logging.rst:872 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:874 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -1156,17 +1156,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:882 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:884 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:888 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1174,7 +1174,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:896 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -1182,46 +1182,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:911 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:915 +#: ../../library/logging.rst:916 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:920 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:924 +#: ../../library/logging.rst:925 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:929 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:935 +#: ../../library/logging.rst:936 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1230,7 +1230,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:943 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 " @@ -1238,13 +1238,13 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:949 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:951 +#: ../../library/logging.rst:952 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -1264,18 +1264,18 @@ msgstr "" "\n" "logging.setLogRecordFactory(record_factory)" -#: ../../library/logging.rst:960 +#: ../../library/logging.rst:961 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:969 +#: ../../library/logging.rst:970 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:971 +#: ../../library/logging.rst:972 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 " @@ -1286,7 +1286,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:979 +#: ../../library/logging.rst:980 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 (:" @@ -1294,7 +1294,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:985 +#: ../../library/logging.rst:986 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: " @@ -1303,318 +1303,318 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:993 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:992 ../../library/logging.rst:1362 +#: ../../library/logging.rst:993 ../../library/logging.rst:1363 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:992 ../../library/logging.rst:1362 +#: ../../library/logging.rst:993 ../../library/logging.rst:1363 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:994 +#: ../../library/logging.rst:0 ../../library/logging.rst:995 msgid "args" msgstr "" -#: ../../library/logging.rst:994 ../../library/logging.rst:1008 -#: ../../library/logging.rst:1036 ../../library/logging.rst:1054 +#: ../../library/logging.rst:995 ../../library/logging.rst:1009 +#: ../../library/logging.rst:1037 ../../library/logging.rst:1055 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" -#: ../../library/logging.rst:994 +#: ../../library/logging.rst:995 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:999 +#: ../../library/logging.rst:1000 msgid "asctime" msgstr "" -#: ../../library/logging.rst:999 +#: ../../library/logging.rst:1000 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:999 +#: ../../library/logging.rst:1000 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:1005 +#: ../../library/logging.rst:1006 msgid "created" msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:1006 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:1006 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time_ns` / 1e9)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1008 +#: ../../library/logging.rst:0 ../../library/logging.rst:1009 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:1008 +#: ../../library/logging.rst:1009 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:1011 +#: ../../library/logging.rst:1012 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1011 +#: ../../library/logging.rst:1012 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1011 +#: ../../library/logging.rst:1012 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:1014 msgid "funcName" msgstr "" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:1014 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:1014 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1016 msgid "levelname" msgstr "" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1016 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1016 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1020 msgid "levelno" msgstr "" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1020 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1020 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1024 +#: ../../library/logging.rst:1025 msgid "lineno" msgstr "" -#: ../../library/logging.rst:1024 +#: ../../library/logging.rst:1025 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1024 +#: ../../library/logging.rst:1025 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "message" msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1032 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1032 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1032 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:1033 +#: ../../library/logging.rst:1034 msgid "msecs" msgstr "" -#: ../../library/logging.rst:1033 +#: ../../library/logging.rst:1034 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1033 +#: ../../library/logging.rst:1034 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1036 +#: ../../library/logging.rst:0 ../../library/logging.rst:1037 msgid "msg" msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1037 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:1041 +#: ../../library/logging.rst:0 ../../library/logging.rst:1042 msgid "name" msgstr "name" -#: ../../library/logging.rst:1041 +#: ../../library/logging.rst:1042 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1041 +#: ../../library/logging.rst:1042 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1044 msgid "pathname" msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1044 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1044 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "process" msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:1048 +#: ../../library/logging.rst:1049 msgid "processName" msgstr "" -#: ../../library/logging.rst:1048 +#: ../../library/logging.rst:1049 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1048 +#: ../../library/logging.rst:1049 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1051 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1051 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1051 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1055 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1055 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:1060 +#: ../../library/logging.rst:1061 msgid "thread" msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1061 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1061 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1063 msgid "threadName" msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1063 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1063 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1065 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1065 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1065 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1068 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1071 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1076 +#: ../../library/logging.rst:1077 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1078 +#: ../../library/logging.rst:1079 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:1084 +#: ../../library/logging.rst:1085 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, a dict-like object (*extra*), and a " @@ -1624,7 +1624,7 @@ msgid "" "calls and only use the one of the :class:`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1093 +#: ../../library/logging.rst:1094 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1633,15 +1633,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1101 -msgid "Delegates to the underlying :attr:`!manager`` on *logger*." +#: ../../library/logging.rst:1102 +msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1105 -msgid "Delegates to the underlying :meth:`!_log`` method on *logger*." +#: ../../library/logging.rst:1106 +msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1107 +#: ../../library/logging.rst:1108 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1653,29 +1653,29 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1118 +#: ../../library/logging.rst:1119 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:1124 +#: ../../library/logging.rst:1125 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:1129 +#: ../../library/logging.rst:1130 #, fuzzy msgid "The *merge_extra* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1133 +#: ../../library/logging.rst:1134 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1135 +#: ../../library/logging.rst:1136 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 " @@ -1684,7 +1684,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1140 +#: ../../library/logging.rst:1141 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 " @@ -1692,17 +1692,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1147 +#: ../../library/logging.rst:1148 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1149 +#: ../../library/logging.rst:1150 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1155 +#: ../../library/logging.rst:1156 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1712,14 +1712,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1162 +#: ../../library/logging.rst:1163 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:1169 +#: ../../library/logging.rst:1170 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 " @@ -1728,43 +1728,43 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1175 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1181 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1183 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:1187 +#: ../../library/logging.rst:1188 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1193 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1197 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1199 +#: ../../library/logging.rst:1200 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1774,38 +1774,38 @@ msgid "" "described at the beginnning of this documentation." msgstr "" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1210 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1215 +#: ../../library/logging.rst:1216 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1218 +#: ../../library/logging.rst:1219 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:1225 +#: ../../library/logging.rst:1226 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1231 +#: ../../library/logging.rst:1232 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1237 +#: ../../library/logging.rst:1238 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1813,13 +1813,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1243 +#: ../../library/logging.rst:1244 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1248 +#: ../../library/logging.rst:1249 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 " @@ -1833,7 +1833,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1259 +#: ../../library/logging.rst:1260 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 " @@ -1841,13 +1841,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1264 +#: ../../library/logging.rst:1265 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1270 +#: ../../library/logging.rst:1271 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1857,24 +1857,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1278 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1282 +#: ../../library/logging.rst:1283 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:1290 +#: ../../library/logging.rst:1291 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1292 +#: ../../library/logging.rst:1293 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1884,20 +1884,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1300 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:1303 +#: ../../library/logging.rst:1304 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1307 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 " @@ -1906,7 +1906,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1312 +#: ../../library/logging.rst:1313 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. " @@ -1914,17 +1914,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1321 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1327 +#: ../../library/logging.rst:1328 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1334 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1932,7 +1932,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1342 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1941,13 +1941,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1347 +#: ../../library/logging.rst:1348 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:1350 +#: ../../library/logging.rst:1351 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 " @@ -1956,54 +1956,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1358 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1365 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1365 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1369 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1369 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1373 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1373 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1378 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1378 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1381 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1381 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 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:1397 +#: ../../library/logging.rst:1398 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1397 +#: ../../library/logging.rst:1398 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 " @@ -2043,33 +2043,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1406 +#: ../../library/logging.rst:1407 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1406 +#: ../../library/logging.rst:1407 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:1412 +#: ../../library/logging.rst:1413 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1412 +#: ../../library/logging.rst:1413 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:1417 +#: ../../library/logging.rst:1418 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1417 +#: ../../library/logging.rst:1418 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 " @@ -2078,39 +2078,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1429 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1431 +#: ../../library/logging.rst:1432 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:1437 +#: ../../library/logging.rst:1438 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1440 +#: ../../library/logging.rst:1441 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1446 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:1449 +#: ../../library/logging.rst:1450 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:1456 +#: ../../library/logging.rst:1457 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 " @@ -2122,32 +2122,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1467 +#: ../../library/logging.rst:1468 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1469 +#: ../../library/logging.rst:1470 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1471 +#: ../../library/logging.rst:1472 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:1476 +#: ../../library/logging.rst:1477 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1478 +#: ../../library/logging.rst:1479 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1480 +#: ../../library/logging.rst:1481 msgid "The logger name." msgstr "" @@ -2155,7 +2155,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1482 msgid "The logging level (numeric)." msgstr "" @@ -2163,7 +2163,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1483 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2171,19 +2171,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1484 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1485 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1486 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1487 msgid "An exception tuple, or ``None``." msgstr "" @@ -2191,7 +2191,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1488 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2199,7 +2199,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1490 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2209,15 +2209,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1491 +#: ../../library/logging.rst:1492 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1495 +#: ../../library/logging.rst:1496 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1499 +#: ../../library/logging.rst:1500 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``, " @@ -2228,15 +2228,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1511 +#: ../../library/logging.rst:1512 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1513 +#: ../../library/logging.rst:1514 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1515 +#: ../../library/logging.rst:1516 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2244,22 +2244,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1522 +#: ../../library/logging.rst:1523 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1524 +#: ../../library/logging.rst:1525 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1529 +#: ../../library/logging.rst:1530 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1532 +#: ../../library/logging.rst:1533 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2268,46 +2268,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1537 +#: ../../library/logging.rst:1538 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:1544 +#: ../../library/logging.rst:1545 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1545 +#: ../../library/logging.rst:1546 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1547 +#: ../../library/logging.rst:1548 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1548 +#: ../../library/logging.rst:1549 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1550 +#: ../../library/logging.rst:1551 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1551 +#: ../../library/logging.rst:1552 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1554 +#: ../../library/logging.rst:1555 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1556 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/os.po b/library/os.po index 50c5b2ff1a..cd584ddc17 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -5253,8 +5253,13 @@ msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" #: ../../library/os.rst:4575 -msgid ":ref:`Availability `: Linux >= 5.3" -msgstr ":ref:`適用 `:Linux 5.3 以上" +#, fuzzy +msgid "" +":ref:`Availability `: Linux >= 5.3, Android >= :func:`build-" +"time ` API level 31" +msgstr "" +":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " +"以上、AIX 7.1 以上。" #: ../../library/os.rst:4580 msgid "" @@ -6791,6 +6796,9 @@ msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" msgid "; (semicolon)" msgstr "; (分號)" +#~ msgid ":ref:`Availability `: Linux >= 5.3" +#~ msgstr ":ref:`適用 `:Linux 5.3 以上" + #~ msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." #~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" diff --git a/library/pydoc.po b/library/pydoc.po index 405db7041e..49c034420c 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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,8 +36,8 @@ msgstr "" #: ../../library/pydoc.rst:23 msgid "" "For modules, classes, functions and methods, the displayed documentation is " -"derived from the docstring (i.e. the :attr:`!__doc__` attribute) of the " -"object, and recursively of its documentable members. If there is no " +"derived from the docstring (i.e. the :attr:`~definition.__doc__` attribute) " +"of the object, and recursively of its documentable members. If there is no " "docstring, :mod:`!pydoc` tries to obtain a description from the block of " "comment lines just above the definition of the class, function or method in " "the source file, or at the top of the module (see :func:`inspect." diff --git a/library/random.po b/library/random.po index 470f0084d7..07c2a84d23 100644 --- a/library/random.po +++ b/library/random.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -1162,7 +1162,7 @@ msgstr "" #: ../../library/random.rst:744 msgid "" -"Print a random floating-point number between 1 and N inclusive, using :meth:" +"Print a random floating-point number between 0 and N inclusive, using :meth:" "`uniform`." msgstr "" diff --git a/library/secrets.po b/library/secrets.po index 2a0d0b4b79..e7b27fe3f1 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2022-11-30 13:42+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,8 @@ msgid "Return a random int in the range [0, *exclusive_upper_bound*)." msgstr "回傳一個 [0, *exclusive_upper_bound*) 範圍之內的隨機整數。" #: ../../library/secrets.rst:55 -msgid "Return an int with *k* random bits." +#, fuzzy +msgid "Return a non-negative int with *k* random bits." msgstr "回傳一個具 *k* 個隨機位元的非負整數。" #: ../../library/secrets.rst:59 diff --git a/library/shutil.po b/library/shutil.po index ab9054224c..ce2dab280b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -590,12 +590,13 @@ msgstr "" #: ../../library/shutil.rst:452 msgid "" -"*path* is a \"``PATH`` string\" specifying the lookup directory list. When " -"no *path* is specified, the results of :func:`os.environ` are used, " -"returning either the \"PATH\" value or a fallback of :data:`os.defpath`." +"*path* is a \"``PATH`` string\" specifying the directories to look in, " +"delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:" +"`PATH` environment variable is read from :data:`os.environ`, falling back " +"to :data:`os.defpath` if it is not set." msgstr "" -#: ../../library/shutil.rst:456 +#: ../../library/shutil.rst:457 msgid "" "On Windows, the current directory is prepended to the *path* if *mode* does " "not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " @@ -605,16 +606,16 @@ msgid "" "environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" -#: ../../library/shutil.rst:463 +#: ../../library/shutil.rst:464 msgid "" -"Also on Windows, the ``PATHEXT`` variable is used to resolve commands that " -"may not already include an extension. For example, if you call ``shutil." -"which(\"python\")``, :func:`which` will search ``PATHEXT`` to know that it " -"should look for ``python.exe`` within the *path* directories. For example, " -"on Windows::" +"Also on Windows, the :envvar:`PATHEXT` environment variable is used to " +"resolve commands that may not already include an extension. For example, if " +"you call ``shutil.which(\"python\")``, :func:`which` will search ``PATHEXT`` " +"to know that it should look for ``python.exe`` within the *path* " +"directories. For example, on Windows::" msgstr "" -#: ../../library/shutil.rst:469 +#: ../../library/shutil.rst:470 msgid "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" @@ -622,25 +623,25 @@ msgstr "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" -#: ../../library/shutil.rst:472 +#: ../../library/shutil.rst:473 msgid "" "This is also applied when *cmd* is a path that contains a directory " "component::" msgstr "" -#: ../../library/shutil.rst:475 +#: ../../library/shutil.rst:476 msgid "" ">> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" -#: ../../library/shutil.rst:480 +#: ../../library/shutil.rst:481 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:484 +#: ../../library/shutil.rst:485 msgid "" "On Windows, the current directory is no longer prepended to the search path " "if *mode* includes ``os.X_OK`` and WinAPI " @@ -651,25 +652,25 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:493 +#: ../../library/shutil.rst:494 msgid "" "On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " "``PATHEXT`` will be preferred over executables without a matching extension. " "This brings behavior closer to that of Python 3.11." msgstr "" -#: ../../library/shutil.rst:501 +#: ../../library/shutil.rst:502 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:508 +#: ../../library/shutil.rst:509 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:510 +#: ../../library/shutil.rst:511 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -679,37 +680,37 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:518 +#: ../../library/shutil.rst:519 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:520 +#: ../../library/shutil.rst:521 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:522 +#: ../../library/shutil.rst:523 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:526 +#: ../../library/shutil.rst:527 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:535 +#: ../../library/shutil.rst:536 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:538 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:539 +#: ../../library/shutil.rst:540 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" @@ -719,17 +720,17 @@ msgstr "" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:544 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:546 +#: ../../library/shutil.rst:547 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:548 +#: ../../library/shutil.rst:549 msgid "" "from shutil import copytree\n" "import logging\n" @@ -741,11 +742,11 @@ msgid "" "copytree(source, destination, ignore=_logpath)" msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:562 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:563 +#: ../../library/shutil.rst:564 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 onexc callback to clear " @@ -753,7 +754,7 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:568 +#: ../../library/shutil.rst:569 msgid "" "import os, stat\n" "import shutil\n" @@ -766,31 +767,31 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: ../../library/shutil.rst:581 +#: ../../library/shutil.rst:582 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:585 +#: ../../library/shutil.rst:586 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:589 +#: ../../library/shutil.rst:590 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:594 +#: ../../library/shutil.rst:595 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:596 +#: ../../library/shutil.rst:597 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: ../../library/shutil.rst:599 +#: ../../library/shutil.rst:600 msgid "" "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is " "available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " @@ -798,14 +799,14 @@ msgid "" "`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:604 +#: ../../library/shutil.rst:605 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:608 +#: ../../library/shutil.rst:609 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. " @@ -813,33 +814,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:614 +#: ../../library/shutil.rst:615 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:616 +#: ../../library/shutil.rst:617 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:619 +#: ../../library/shutil.rst:620 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:622 +#: ../../library/shutil.rst:623 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:626 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:627 +#: ../../library/shutil.rst:628 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -847,7 +848,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:632 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -855,60 +856,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:637 +#: ../../library/shutil.rst:638 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:641 +#: ../../library/shutil.rst:642 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:647 +#: ../../library/shutil.rst:648 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:650 ../../library/shutil.rst:761 +#: ../../library/shutil.rst:651 ../../library/shutil.rst:762 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:652 +#: ../../library/shutil.rst:653 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:653 +#: ../../library/shutil.rst:654 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:654 ../../library/shutil.rst:766 +#: ../../library/shutil.rst:655 ../../library/shutil.rst:767 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:655 ../../library/shutil.rst:767 +#: ../../library/shutil.rst:656 ../../library/shutil.rst:768 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:656 ../../library/shutil.rst:768 +#: ../../library/shutil.rst:657 ../../library/shutil.rst:769 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:658 +#: ../../library/shutil.rst:659 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:664 +#: ../../library/shutil.rst:665 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:666 +#: ../../library/shutil.rst:667 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 " @@ -917,7 +918,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:672 +#: ../../library/shutil.rst:673 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -926,37 +927,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:678 +#: ../../library/shutil.rst:679 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:681 +#: ../../library/shutil.rst:682 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:684 +#: ../../library/shutil.rst:685 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:690 +#: ../../library/shutil.rst:691 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:695 +#: ../../library/shutil.rst:696 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:697 +#: ../../library/shutil.rst:698 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:700 +#: ../../library/shutil.rst:701 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -965,7 +966,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:707 +#: ../../library/shutil.rst:708 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -975,7 +976,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:715 +#: ../../library/shutil.rst:716 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -983,7 +984,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:720 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -991,91 +992,91 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:725 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:727 +#: ../../library/shutil.rst:728 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:732 +#: ../../library/shutil.rst:733 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:736 +#: ../../library/shutil.rst:737 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:739 +#: ../../library/shutil.rst:740 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:740 +#: ../../library/shutil.rst:741 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:742 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:743 +#: ../../library/shutil.rst:744 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:746 +#: ../../library/shutil.rst:747 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:752 +#: ../../library/shutil.rst:753 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:757 +#: ../../library/shutil.rst:758 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:763 +#: ../../library/shutil.rst:764 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:765 +#: ../../library/shutil.rst:766 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:770 +#: ../../library/shutil.rst:771 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:777 +#: ../../library/shutil.rst:778 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:779 +#: ../../library/shutil.rst:780 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:782 +#: ../../library/shutil.rst:783 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1085,11 +1086,11 @@ msgid "" "'/Users/tarek/myarchive.tar.gz'" msgstr "" -#: ../../library/shutil.rst:789 +#: ../../library/shutil.rst:790 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:791 +#: ../../library/shutil.rst:792 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1111,18 +1112,18 @@ msgstr "" "-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" -#: ../../library/shutil.rst:807 +#: ../../library/shutil.rst:808 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:809 +#: ../../library/shutil.rst:810 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:813 +#: ../../library/shutil.rst:814 msgid "" "$ tree tmp\n" "tmp\n" @@ -1140,13 +1141,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:823 +#: ../../library/shutil.rst:824 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:826 +#: ../../library/shutil.rst:827 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1170,11 +1171,11 @@ msgstr "" "... )\n" "'/Users/tarek/my_archive.tar'" -#: ../../library/shutil.rst:837 +#: ../../library/shutil.rst:838 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:839 +#: ../../library/shutil.rst:840 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" @@ -1184,29 +1185,29 @@ msgstr "" "structure/content/\n" "structure/content/please_add.txt" -#: ../../library/shutil.rst:847 +#: ../../library/shutil.rst:848 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:851 +#: ../../library/shutil.rst:852 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:853 +#: ../../library/shutil.rst:854 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:857 +#: ../../library/shutil.rst:858 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:861 +#: ../../library/shutil.rst:862 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 " @@ -1215,17 +1216,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:867 +#: ../../library/shutil.rst:868 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:869 +#: ../../library/shutil.rst:870 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:874 +#: ../../library/shutil.rst:875 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 12239bc8b0..bf2ed3970b 100644 --- a/library/signal.po +++ b/library/signal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -469,8 +469,10 @@ msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 手冊頁。" #: ../../library/signal.rst:414 -msgid ":ref:`Availability `: Linux >= 5.1" -msgstr ":ref:`適用 `:Linux 5.1 以上" +msgid "" +":ref:`Availability `: Linux >= 5.1, Android >= :func:`build-" +"time ` API level 31" +msgstr "" #: ../../library/signal.rst:420 msgid "" @@ -950,3 +952,6 @@ msgid "" "serve_forever(httpd)\n" "print(\"Shutdown...\")" msgstr "" + +#~ msgid ":ref:`Availability `: Linux >= 5.1" +#~ msgstr ":ref:`適用 `:Linux 5.1 以上" diff --git a/library/stdtypes.po b/library/stdtypes.po index d677d5a401..a83aab5f32 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -7671,9 +7671,9 @@ msgstr "" #: ../../library/stdtypes.rst:5305 msgid "" -"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" #: ../../library/stdtypes.rst:5313 @@ -7894,76 +7894,36 @@ msgstr "" #: ../../library/stdtypes.rst:5491 msgid "" -"A dictionary or other mapping object used to store an object's (writable) " -"attributes." -msgstr "" - -#: ../../library/stdtypes.rst:5497 -msgid "The class to which a class instance belongs." -msgstr "" - -#: ../../library/stdtypes.rst:5502 -msgid "The tuple of base classes of a class object." -msgstr "" - -#: ../../library/stdtypes.rst:5507 -msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5497 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5521 -msgid "" -"The :ref:`type parameters ` of generic classes, functions, and :" -"ref:`type aliases `." +#: ../../library/stdtypes.rst:5505 +msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5510 msgid "" -"This attribute is a tuple of classes that are considered when looking for " -"base classes during method resolution." +"The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5535 +#: ../../library/stdtypes.rst:5515 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:5542 -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:5546 -msgid "" -">>> int.__subclasses__()\n" -"[, , , ]" -msgstr "" -">>> int.__subclasses__()\n" -"[, , , ]" - -#: ../../library/stdtypes.rst:5552 -msgid "" -"A tuple containing names of attributes of this class which are accessed " -"through ``self.X`` from any function in its body." +"The :ref:`type parameters ` of generic classes, functions, and :" +"ref:`type aliases `. For classes and functions that are not " +"generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5525 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5527 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 " @@ -7971,7 +7931,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5532 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 " @@ -7981,24 +7941,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5539 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5541 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:5580 +#: ../../library/stdtypes.rst:5545 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5547 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -8022,7 +7982,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5567 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -8030,11 +7990,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5607 +#: ../../library/stdtypes.rst:5572 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5574 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8045,84 +8005,84 @@ msgid "" "..." msgstr "" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5587 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:5624 +#: ../../library/stdtypes.rst:5589 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5627 +#: ../../library/stdtypes.rst:5592 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5593 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5594 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5630 +#: ../../library/stdtypes.rst:5595 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5631 +#: ../../library/stdtypes.rst:5596 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5599 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5601 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5637 +#: ../../library/stdtypes.rst:5602 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5603 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5604 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5640 +#: ../../library/stdtypes.rst:5605 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5641 +#: ../../library/stdtypes.rst:5606 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5609 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:5646 +#: ../../library/stdtypes.rst:5611 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:5649 +#: ../../library/stdtypes.rst:5614 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:5652 +#: ../../library/stdtypes.rst:5617 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8130,7 +8090,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5654 +#: ../../library/stdtypes.rst:5619 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 " @@ -8139,38 +8099,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5660 +#: ../../library/stdtypes.rst:5625 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5663 +#: ../../library/stdtypes.rst:5628 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:5667 +#: ../../library/stdtypes.rst:5632 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5669 +#: ../../library/stdtypes.rst:5634 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5671 +#: ../../library/stdtypes.rst:5636 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:5678 +#: ../../library/stdtypes.rst:5643 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 " @@ -8182,7 +8142,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5687 +#: ../../library/stdtypes.rst:5652 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 " @@ -8190,11 +8150,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5658 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5660 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 " @@ -8202,11 +8162,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5700 +#: ../../library/stdtypes.rst:5665 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:5702 +#: ../../library/stdtypes.rst:5667 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -8219,38 +8179,38 @@ msgid "" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" -#: ../../library/stdtypes.rst:5712 +#: ../../library/stdtypes.rst:5677 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5716 +#: ../../library/stdtypes.rst:5681 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:5717 +#: ../../library/stdtypes.rst:5682 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5720 +#: ../../library/stdtypes.rst:5685 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5723 +#: ../../library/stdtypes.rst:5688 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5725 +#: ../../library/stdtypes.rst:5690 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:5728 +#: ../../library/stdtypes.rst:5693 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9002,3 +8962,12 @@ msgstr "..." #: ../../library/stdtypes.rst:5442 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" + +#~ msgid "" +#~ ">>> int.__subclasses__()\n" +#~ "[, , , ]" +#~ msgstr "" +#~ ">>> int.__subclasses__()\n" +#~ "[, , , ]" diff --git a/library/string.po b/library/string.po index acd1fea713..a51a99ac4d 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -884,36 +884,37 @@ msgstr "" #: ../../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 " -"past the decimal point. The precision used is as large as needed to " -"represent the given value faithfully." +"For :class:`float` this is like the ``'g'`` type, except that when fixed-" +"point notation is used to format the result, it always includes at least one " +"digit past the decimal point, and switches to the scientific notation when " +"``exp >= p - 1``. When the precision is not specified, the latter will be " +"as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:583 +#: ../../library/string.rst:585 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:587 +#: ../../library/string.rst:589 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:595 +#: ../../library/string.rst:597 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:597 +#: ../../library/string.rst:599 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:600 +#: ../../library/string.rst:602 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 " @@ -922,17 +923,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:604 +#: ../../library/string.rst:606 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:607 +#: ../../library/string.rst:609 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:609 +#: ../../library/string.rst:611 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -947,11 +948,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:620 +#: ../../library/string.rst:622 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:622 +#: ../../library/string.rst:624 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -961,11 +962,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:628 +#: ../../library/string.rst:630 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:630 +#: ../../library/string.rst:632 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -982,22 +983,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:643 +#: ../../library/string.rst:645 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:645 +#: ../../library/string.rst:647 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:649 +#: ../../library/string.rst:651 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:651 +#: ../../library/string.rst:653 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1007,11 +1008,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:654 +#: ../../library/string.rst:656 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:656 +#: ../../library/string.rst:658 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1023,11 +1024,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:665 +#: ../../library/string.rst:667 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:667 +#: ../../library/string.rst:669 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1038,12 +1039,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:674 +#: ../../library/string.rst:676 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:676 +#: ../../library/string.rst:678 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1053,11 +1054,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:683 +#: ../../library/string.rst:685 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:685 +#: ../../library/string.rst:687 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1065,11 +1066,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:688 +#: ../../library/string.rst:690 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:690 +#: ../../library/string.rst:692 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1081,11 +1082,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:695 +#: ../../library/string.rst:697 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:697 +#: ../../library/string.rst:699 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1097,11 +1098,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:702 +#: ../../library/string.rst:704 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:704 +#: ../../library/string.rst:706 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1159,11 +1160,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:736 +#: ../../library/string.rst:738 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:738 +#: ../../library/string.rst:740 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1177,17 +1178,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:748 +#: ../../library/string.rst:750 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:750 +#: ../../library/string.rst:752 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:752 +#: ../../library/string.rst:754 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1197,30 +1198,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:759 +#: ../../library/string.rst:761 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:763 +#: ../../library/string.rst:765 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:766 +#: ../../library/string.rst:768 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:772 +#: ../../library/string.rst:774 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:777 +#: ../../library/string.rst:779 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1232,7 +1233,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:786 +#: ../../library/string.rst:788 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1245,7 +1246,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:792 +#: ../../library/string.rst:794 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 " @@ -1259,7 +1260,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:802 +#: ../../library/string.rst:804 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1267,18 +1268,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:810 +#: ../../library/string.rst:812 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:815 +#: ../../library/string.rst:817 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:819 +#: ../../library/string.rst:821 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." @@ -1286,11 +1287,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:822 +#: ../../library/string.rst:824 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:824 +#: ../../library/string.rst:826 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1324,7 +1325,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:840 +#: ../../library/string.rst:842 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1334,7 +1335,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:845 +#: ../../library/string.rst:847 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1348,7 +1349,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:852 +#: ../../library/string.rst:854 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1356,19 +1357,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:859 +#: ../../library/string.rst:861 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:863 +#: ../../library/string.rst:865 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:867 +#: ../../library/string.rst:869 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1377,7 +1378,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:875 +#: ../../library/string.rst:877 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1386,7 +1387,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:883 +#: ../../library/string.rst:885 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1395,13 +1396,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:889 +#: ../../library/string.rst:891 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:892 +#: ../../library/string.rst:894 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1409,7 +1410,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:895 +#: ../../library/string.rst:897 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1417,7 +1418,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:898 +#: ../../library/string.rst:900 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1425,7 +1426,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:901 +#: ../../library/string.rst:903 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1433,11 +1434,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:906 +#: ../../library/string.rst:908 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:910 +#: ../../library/string.rst:912 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1518,10 +1519,10 @@ msgstr ", (逗號)" msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:746 +#: ../../library/string.rst:748 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:746 +#: ../../library/string.rst:748 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/test.po b/library/test.po index a3d5c4d723..82100ff959 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -1156,9 +1156,9 @@ msgstr "" #: ../../library/test.rst:948 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " -"automatically detected as \"public\", like objects without a proper " -"``__module__`` attribute. If provided, it will be added to the automatically " -"detected ones." +"automatically detected as \"public\", like objects without a proper :attr:" +"`~definition.__module__` attribute. If provided, it will be added to the " +"automatically detected ones." msgstr "" #: ../../library/test.rst:952 diff --git a/library/tomllib.po b/library/tomllib.po index 438b4e5eb0..867053e80b 100644 --- a/library/tomllib.po +++ b/library/tomllib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2022-11-18 01:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,9 +29,9 @@ msgstr "**原始碼:**\\ :source:`Lib/tomllib`" #: ../../library/tomllib.rst:16 #, fuzzy msgid "" -"This module provides an interface for parsing TOML (Tom's Obvious Minimal " -"Language, `https://toml.io `_). This module does not " -"support writing TOML." +"This module provides an interface for parsing TOML 1.0.0 (Tom's Obvious " +"Minimal Language, `https://toml.io `_). This module " +"does not support writing TOML." msgstr "" "此模組提供了剖析 TOML 1.0.0 (Tom's Obvious Minimal Language, `https://toml." "io `_) 的一個介面,此模組並不支援寫入 TOML。" diff --git a/library/types.po b/library/types.po index 6cae9bb452..64c5f320eb 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -141,7 +141,8 @@ msgstr "" msgid "" "For classes that have an ``__orig_bases__`` attribute, this function returns " "the value of ``cls.__orig_bases__``. For classes without the " -"``__orig_bases__`` attribute, ``cls.__bases__`` is returned." +"``__orig_bases__`` attribute, :attr:`cls.__bases__ ` is " +"returned." msgstr "" #: ../../library/types.rst:97 @@ -510,7 +511,7 @@ msgid "" "In addition, when a class is defined with a :attr:`~object.__slots__` " "attribute, then for each slot, an instance of :class:`!MemberDescriptorType` " "will be added as an attribute on the class. This allows the slot to appear " -"in the class's :attr:`~object.__dict__`." +"in the class's :attr:`~type.__dict__`." msgstr "" #: ../../library/types.rst:399 diff --git a/library/typing.po b/library/typing.po index d379333c16..9277c0665d 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-07-11 11:12+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -387,8 +387,8 @@ msgstr "" "str]`` 象徵為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :" "class:`str`。" -#: ../../library/typing.rst:215 ../../library/typing.rst:3109 -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:215 ../../library/typing.rst:3128 +#: ../../library/typing.rst:3308 msgid "For example:" msgstr "舉例來說:" @@ -492,7 +492,7 @@ msgstr "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` 的形式。" -#: ../../library/typing.rst:285 ../../library/typing.rst:3777 +#: ../../library/typing.rst:285 ../../library/typing.rst:3798 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -1434,8 +1434,8 @@ msgstr "" #: ../../library/typing.rst:868 ../../library/typing.rst:986 #: ../../library/typing.rst:1043 ../../library/typing.rst:1209 #: ../../library/typing.rst:1270 ../../library/typing.rst:1312 -#: ../../library/typing.rst:1510 ../../library/typing.rst:1571 -#: ../../library/typing.rst:3046 ../../library/typing.rst:3272 +#: ../../library/typing.rst:1527 ../../library/typing.rst:1588 +#: ../../library/typing.rst:3065 ../../library/typing.rst:3293 msgid "For example::" msgstr "舉例來說: ::" @@ -1502,7 +1502,7 @@ msgstr "" "此。然而,若是一個型別僅為 ``str`` 的物件則不相容。一個字串若是透過組合多個 " "``LiteralString`` 型別的物件建立,則此字串也可以視為 ``LiteralString``。" -#: ../../library/typing.rst:912 ../../library/typing.rst:2142 +#: ../../library/typing.rst:912 ../../library/typing.rst:2159 msgid "Example:" msgstr "舉例來說: ::" @@ -1957,7 +1957,7 @@ msgid "" "sum_threadsafe([1.1, 2.2, 3.3])" msgstr "" -#: ../../library/typing.rst:1196 ../../library/typing.rst:2110 +#: ../../library/typing.rst:1196 ../../library/typing.rst:2127 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" @@ -1967,7 +1967,7 @@ msgstr ":pep:`612` -- 參數技術規範變數" msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`" -#: ../../library/typing.rst:1199 ../../library/typing.rst:2113 +#: ../../library/typing.rst:1199 ../../library/typing.rst:2130 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" @@ -2088,7 +2088,7 @@ msgid "" " TIMEOUT = 1 # Error reported by type checker" msgstr "" -#: ../../library/typing.rst:1281 ../../library/typing.rst:3062 +#: ../../library/typing.rst:1281 ../../library/typing.rst:3081 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -2388,21 +2388,45 @@ msgstr "" ">>> X.__metadata__\n" "('very', 'important', 'metadata')" -#: ../../library/typing.rst:1463 -msgid ":pep:`593` - Flexible function and variable annotations" +#: ../../library/typing.rst:1461 +msgid "" +"At runtime, if you want to retrieve the original type wrapped by " +"``Annotated``, use the :attr:`!__origin__` attribute:" msgstr "" #: ../../library/typing.rst:1464 +msgid "" +">>> from typing import Annotated, get_origin\n" +">>> Password = Annotated[str, \"secret\"]\n" +">>> Password.__origin__\n" +"" +msgstr "" + +#: ../../library/typing.rst:1471 +msgid "Note that using :func:`get_origin` will return ``Annotated`` itself:" +msgstr "" + +#: ../../library/typing.rst:1473 +msgid "" +">>> get_origin(Password)\n" +"typing.Annotated" +msgstr "" + +#: ../../library/typing.rst:1480 +msgid ":pep:`593` - Flexible function and variable annotations" +msgstr "" + +#: ../../library/typing.rst:1481 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1471 ../../library/typing.rst:1555 +#: ../../library/typing.rst:1488 ../../library/typing.rst:1572 #, fuzzy msgid "" "Special typing construct for marking user-defined type predicate functions." msgstr "特殊型別建構,用來指出最終名稱給型別檢查器。" -#: ../../library/typing.rst:1473 +#: ../../library/typing.rst:1490 msgid "" "``TypeIs`` can be used to annotate the return type of a user-defined type " "predicate function. ``TypeIs`` only accepts a single type argument. At " @@ -2410,7 +2434,7 @@ msgid "" "one positional argument." msgstr "" -#: ../../library/typing.rst:1478 +#: ../../library/typing.rst:1495 msgid "" "``TypeIs`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -2420,7 +2444,7 @@ msgid "" "predicate\"::" msgstr "" -#: ../../library/typing.rst:1484 +#: ../../library/typing.rst:1501 msgid "" "def is_str(val: str | float):\n" " # \"isinstance\" type predicate\n" @@ -2432,7 +2456,7 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1510 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type predicate. Such a function should use ``TypeIs[...]`` or :data:" @@ -2443,29 +2467,29 @@ msgid "" "does not return ``True`` for all instances of the narrowed type." msgstr "" -#: ../../library/typing.rst:1501 +#: ../../library/typing.rst:1518 msgid "" "Using ``-> TypeIs[NarrowedType]`` tells the static type checker that for a " "given function:" msgstr "" -#: ../../library/typing.rst:1504 ../../library/typing.rst:1565 +#: ../../library/typing.rst:1521 ../../library/typing.rst:1582 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1522 msgid "" "If the return value is ``True``, the type of its argument is the " "intersection of the argument's original type and ``NarrowedType``." msgstr "" -#: ../../library/typing.rst:1507 +#: ../../library/typing.rst:1524 msgid "" "If the return value is ``False``, the type of its argument is narrowed to " "exclude ``NarrowedType``." msgstr "" -#: ../../library/typing.rst:1512 +#: ../../library/typing.rst:1529 msgid "" "from typing import assert_type, final, TypeIs\n" "\n" @@ -2489,7 +2513,7 @@ msgid "" " assert_type(arg, Unrelated)" msgstr "" -#: ../../library/typing.rst:1533 +#: ../../library/typing.rst:1550 msgid "" "The type inside ``TypeIs`` must be consistent with the type of the " "function's argument; if it is not, static type checkers will raise an " @@ -2498,27 +2522,27 @@ msgid "" "functions in a type-safe manner." msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1556 msgid "" "If a ``TypeIs`` function is a class or instance method, then the type in " "``TypeIs`` maps to the type of the second parameter (after ``cls`` or " "``self``)." msgstr "" -#: ../../library/typing.rst:1543 +#: ../../library/typing.rst:1560 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``, means that " "if ``foo(arg)`` returns ``True``, then ``arg`` is an instance of ``TypeB``, " "and if it returns ``False``, it is not an instance of ``TypeB``." msgstr "" -#: ../../library/typing.rst:1547 +#: ../../library/typing.rst:1564 msgid "" "``TypeIs`` also works with type variables. For more information, see :pep:" "`742` (Narrowing types with ``TypeIs``)." msgstr "" -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1574 msgid "" "Type predicate functions are user-defined functions that return whether " "their argument is an instance of a particular type. ``TypeGuard`` works " @@ -2526,25 +2550,25 @@ msgid "" "checking behavior (see below)." msgstr "" -#: ../../library/typing.rst:1562 +#: ../../library/typing.rst:1579 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1566 +#: ../../library/typing.rst:1583 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1569 +#: ../../library/typing.rst:1586 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1573 +#: ../../library/typing.rst:1590 msgid "" "def is_str_list(val: list[object]) -> TypeGuard[list[str]]:\n" " '''Determines whether all objects in the list are strings'''\n" @@ -2559,11 +2583,11 @@ msgid "" " print(\"Not a list of strings!\")" msgstr "" -#: ../../library/typing.rst:1585 +#: ../../library/typing.rst:1602 msgid "``TypeIs`` and ``TypeGuard`` differ in the following ways:" msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1604 msgid "" "``TypeIs`` requires the narrowed type to be a subtype of the input type, " "while ``TypeGuard`` does not. The main reason is to allow for things like " @@ -2571,7 +2595,7 @@ msgid "" "subtype of the former, since ``list`` is invariant." msgstr "" -#: ../../library/typing.rst:1591 +#: ../../library/typing.rst:1608 msgid "" "When a ``TypeGuard`` function returns ``True``, type checkers narrow the " "type of the variable to exactly the ``TypeGuard`` type. When a ``TypeIs`` " @@ -2580,7 +2604,7 @@ msgid "" "type. (Technically, this is known as an intersection type.)" msgstr "" -#: ../../library/typing.rst:1595 +#: ../../library/typing.rst:1612 msgid "" "When a ``TypeGuard`` function returns ``False``, type checkers cannot narrow " "the type of the variable at all. When a ``TypeIs`` function returns " @@ -2588,18 +2612,18 @@ msgid "" "``TypeIs`` type." msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1621 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1606 +#: ../../library/typing.rst:1623 msgid "" "For example, using the unpack operator ``*`` on a :ref:`type variable tuple " "` is equivalent to using ``Unpack`` to mark the type variable " "tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1610 +#: ../../library/typing.rst:1627 msgid "" "Ts = TypeVarTuple('Ts')\n" "tup: tuple[*Ts]\n" @@ -2607,7 +2631,7 @@ msgid "" "tup: tuple[Unpack[Ts]]" msgstr "" -#: ../../library/typing.rst:1615 +#: ../../library/typing.rst:1632 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -2615,7 +2639,7 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1621 +#: ../../library/typing.rst:1638 msgid "" "# In older versions of Python, TypeVarTuple and Unpack\n" "# are located in the `typing_extensions` backports package.\n" @@ -2626,13 +2650,13 @@ msgid "" "tup: tuple[Unpack[Ts]] # Semantically equivalent, and backwards-compatible" msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1646 msgid "" "``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " "``**kwargs`` in a function signature::" msgstr "" -#: ../../library/typing.rst:1632 +#: ../../library/typing.rst:1649 msgid "" "from typing import TypedDict, Unpack\n" "\n" @@ -2645,23 +2669,23 @@ msgid "" "def foo(**kwargs: Unpack[Movie]): ..." msgstr "" -#: ../../library/typing.rst:1642 +#: ../../library/typing.rst:1659 msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." msgstr "" -#: ../../library/typing.rst:1647 +#: ../../library/typing.rst:1664 msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1649 +#: ../../library/typing.rst:1666 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1653 +#: ../../library/typing.rst:1670 msgid "" "These objects can be created through special syntax (:ref:`type parameter " "lists ` and the :keyword:`type` statement). For compatibility " @@ -2669,17 +2693,17 @@ msgid "" "syntax, as documented below." msgstr "" -#: ../../library/typing.rst:1660 +#: ../../library/typing.rst:1677 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1662 +#: ../../library/typing.rst:1679 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1682 msgid "" "class Mapping[KT, VT]:\n" " def __getitem__(self, key: KT) -> VT:\n" @@ -2687,17 +2711,17 @@ msgid "" " # Etc." msgstr "" -#: ../../library/typing.rst:1670 +#: ../../library/typing.rst:1687 msgid "" "Such a class implicitly inherits from ``Generic``. The runtime semantics of " "this syntax are discussed in the :ref:`Language Reference `." msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1691 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1693 msgid "" "def lookup_name[X, Y](mapping: Mapping[X, Y], key: X, default: Y) -> Y:\n" " try:\n" @@ -2711,20 +2735,20 @@ msgstr "" " except KeyError:\n" " return default" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1699 msgid "" "Here the brackets after the function name indicate a :ref:`generic function " "`." msgstr "" -#: ../../library/typing.rst:1685 +#: ../../library/typing.rst:1702 msgid "" "For backwards compatibility, generic classes can also be declared by " "explicitly inheriting from ``Generic``. In this case, the type parameters " "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1707 msgid "" "KT = TypeVar('KT')\n" "VT = TypeVar('VT')\n" @@ -2742,18 +2766,18 @@ msgstr "" " ...\n" " # Etc." -#: ../../library/typing.rst:1702 +#: ../../library/typing.rst:1719 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1704 +#: ../../library/typing.rst:1721 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1726 msgid "" "class Sequence[T]: # T is a TypeVar\n" " ..." @@ -2761,12 +2785,12 @@ msgstr "" "class Sequence[T]: # T 是一個 TypeVar\n" " ..." -#: ../../library/typing.rst:1712 +#: ../../library/typing.rst:1729 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1732 msgid "" "class StrSequence[S: str]: # S is a TypeVar bound to str\n" " ...\n" @@ -2777,20 +2801,20 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:1722 +#: ../../library/typing.rst:1739 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1724 +#: ../../library/typing.rst:1741 msgid "" "T = TypeVar('T') # Can be anything\n" "S = TypeVar('S', bound=str) # Can be any subtype of str\n" "A = TypeVar('A', str, bytes) # Must be exactly str or bytes" msgstr "" -#: ../../library/typing.rst:1728 +#: ../../library/typing.rst:1745 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 " @@ -2798,7 +2822,7 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1734 +#: ../../library/typing.rst:1751 msgid "" "def repeat[T](x: T, n: int) -> Sequence[T]:\n" " \"\"\"Return a list containing n references to x.\"\"\"\n" @@ -2816,13 +2840,13 @@ msgid "" " return x + y" msgstr "" -#: ../../library/typing.rst:1749 +#: ../../library/typing.rst:1766 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1752 +#: ../../library/typing.rst:1769 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -2832,14 +2856,14 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1760 +#: ../../library/typing.rst:1777 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:1764 +#: ../../library/typing.rst:1781 msgid "" "x = print_capitalized('a string')\n" "reveal_type(x) # revealed type is str\n" @@ -2853,13 +2877,13 @@ msgid "" "z = print_capitalized(45) # error: int is not a subtype of str" msgstr "" -#: ../../library/typing.rst:1775 +#: ../../library/typing.rst:1792 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1795 msgid "" "# Can be anything with an __abs__ method\n" "def print_abs[T: SupportsAbs](arg: T) -> None:\n" @@ -2870,13 +2894,13 @@ msgid "" "V = TypeVar('V', bound=SupportsAbs) # Can be anything with an __abs__ method" msgstr "" -#: ../../library/typing.rst:1787 +#: ../../library/typing.rst:1804 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:1790 +#: ../../library/typing.rst:1807 msgid "" "a = concatenate('one', 'two')\n" "reveal_type(a) # revealed type is str\n" @@ -2889,56 +2913,56 @@ msgid "" "or bytes in a function call, but not both" msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1815 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1819 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1806 +#: ../../library/typing.rst:1823 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1810 +#: ../../library/typing.rst:1827 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1831 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1820 +#: ../../library/typing.rst:1837 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:1841 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1847 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1834 +#: ../../library/typing.rst:1851 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1857 msgid "" "The default value of the type variable, or :data:`typing.NoDefault` if it " "has no default." msgstr "" -#: ../../library/typing.rst:1847 +#: ../../library/typing.rst:1864 msgid "" "Return whether or not the type variable has a default value. This is " "equivalent to checking whether :attr:`__default__` is not the :data:`typing." @@ -2946,31 +2970,31 @@ msgid "" "`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:1873 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1862 ../../library/typing.rst:2001 -#: ../../library/typing.rst:2103 +#: ../../library/typing.rst:1879 ../../library/typing.rst:2018 +#: ../../library/typing.rst:2120 msgid "Support for default values was added." msgstr "" -#: ../../library/typing.rst:1868 +#: ../../library/typing.rst:1885 msgid "" "Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1888 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1891 msgid "" "def move_first_element_to_last[T, *Ts](tup: tuple[T, *Ts]) -> tuple[*Ts, " "T]:\n" @@ -2980,11 +3004,11 @@ msgstr "" "T]:\n" " return (*tup[1:], tup[0])" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:1894 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1879 +#: ../../library/typing.rst:1896 msgid "" "T = TypeVar(\"T\")\n" "Ts = TypeVarTuple(\"Ts\")\n" @@ -2998,7 +3022,7 @@ msgstr "" "def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]:\n" " return (*tup[1:], tup[0])" -#: ../../library/typing.rst:1885 +#: ../../library/typing.rst:1902 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -3006,7 +3030,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1890 +#: ../../library/typing.rst:1907 msgid "" "# T is bound to int, Ts is bound to ()\n" "# Return value is (1,), which has type tuple[int]\n" @@ -3026,7 +3050,7 @@ msgid "" "move_first_element_to_last(tup=())" msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1924 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, " @@ -3036,26 +3060,26 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1915 +#: ../../library/typing.rst:1932 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1935 msgid "" "x: Ts # Not valid\n" "x: tuple[Ts] # Not valid\n" "x: tuple[*Ts] # The correct way to do it" msgstr "" -#: ../../library/typing.rst:1922 +#: ../../library/typing.rst:1939 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:1925 +#: ../../library/typing.rst:1942 msgid "" "class Array[*Shape]:\n" " def __getitem__(self, key: tuple[*Shape]) -> float: ...\n" @@ -3067,12 +3091,12 @@ msgstr "" " def __abs__(self) -> \"Array[*Shape]\": ...\n" " def get_shape(self) -> tuple[*Shape]: ..." -#: ../../library/typing.rst:1930 +#: ../../library/typing.rst:1947 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1932 +#: ../../library/typing.rst:1949 msgid "" "class Array[DType, *Shape]: # This is fine\n" " pass\n" @@ -3087,26 +3111,26 @@ msgid "" "int_array_2d: Array[int, Height, Width] = Array() # Yup, fine too" msgstr "" -#: ../../library/typing.rst:1946 +#: ../../library/typing.rst:1963 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:1949 +#: ../../library/typing.rst:1966 msgid "" "x: tuple[*Ts, *Ts] # Not valid\n" "class Array[*Shape, *Shape]: # Not valid\n" " pass" msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1970 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1956 +#: ../../library/typing.rst:1973 msgid "" "def call_soon[*Ts](\n" " callback: Callable[[*Ts], None],\n" @@ -3122,7 +3146,7 @@ msgstr "" " ...\n" " callback(*args)" -#: ../../library/typing.rst:1963 +#: ../../library/typing.rst:1980 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -3131,21 +3155,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1970 +#: ../../library/typing.rst:1987 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1991 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1978 +#: ../../library/typing.rst:1995 msgid "" "The default value of the type variable tuple, or :data:`typing.NoDefault` if " "it has no default." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2002 msgid "" "Return whether or not the type variable tuple has a default value. This is " "equivalent to checking whether :attr:`__default__` is not the :data:`typing." @@ -3153,39 +3177,39 @@ msgid "" "`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2013 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:2005 +#: ../../library/typing.rst:2022 msgid "" "Parameter specification variable. A specialized version of :ref:`type " "variables `." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2025 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2028 msgid "type IntFunc[**P] = Callable[P, int]" msgstr "type IntFunc[**P] = Callable[P, int]" -#: ../../library/typing.rst:2013 +#: ../../library/typing.rst:2030 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:2016 +#: ../../library/typing.rst:2033 msgid "P = ParamSpec('P')" msgstr "P = ParamSpec('P')" -#: ../../library/typing.rst:2018 +#: ../../library/typing.rst:2035 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -3195,7 +3219,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2042 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 " @@ -3203,7 +3227,7 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2047 msgid "" "from collections.abc import Callable\n" "import logging\n" @@ -3221,27 +3245,27 @@ msgid "" " return x + y" msgstr "" -#: ../../library/typing.rst:2045 +#: ../../library/typing.rst:2062 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:2049 +#: ../../library/typing.rst:2066 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:2051 +#: ../../library/typing.rst:2068 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:2058 +#: ../../library/typing.rst:2075 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -3254,17 +3278,17 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2087 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2091 msgid "" "The default value of the parameter specification, or :data:`typing." "NoDefault` if it has no default." msgstr "" -#: ../../library/typing.rst:2081 +#: ../../library/typing.rst:2098 msgid "" "Return whether or not the parameter specification has a default value. This " "is equivalent to checking whether :attr:`__default__` is not the :data:" @@ -3272,7 +3296,7 @@ msgid "" "the :ref:`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2105 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -3281,23 +3305,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:2098 +#: ../../library/typing.rst:2115 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:2106 +#: ../../library/typing.rst:2123 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2129 msgid ":data:`Concatenate`" msgstr ":data:`Concatenate`" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2135 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -3305,13 +3329,13 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2140 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:2126 +#: ../../library/typing.rst:2143 msgid "" ">>> from typing import ParamSpec, get_origin\n" ">>> P = ParamSpec(\"P\")\n" @@ -3327,11 +3351,11 @@ msgstr "" ">>> get_origin(P.kwargs) is P\n" "True" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2157 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:2144 +#: ../../library/typing.rst:2161 msgid "" ">>> type Alias = int\n" ">>> type(Alias)\n" @@ -3341,11 +3365,11 @@ msgstr "" ">>> type(Alias)\n" "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2171 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2173 msgid "" ">>> type Alias = int\n" ">>> Alias.__name__\n" @@ -3355,11 +3379,11 @@ msgstr "" ">>> Alias.__name__\n" "'Alias'" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2181 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2183 msgid "" ">>> type Alias = int\n" ">>> Alias.__module__\n" @@ -3369,13 +3393,13 @@ msgstr "" ">>> Alias.__module__\n" "'__main__'" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2189 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2175 +#: ../../library/typing.rst:2192 msgid "" ">>> type ListOrSet[T] = list[T] | set[T]\n" ">>> ListOrSet.__type_params__\n" @@ -3391,14 +3415,14 @@ msgstr "" ">>> NotGeneric.__type_params__\n" "()" -#: ../../library/typing.rst:2186 +#: ../../library/typing.rst:2203 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2190 +#: ../../library/typing.rst:2207 msgid "" ">>> type Mutually = Recursive\n" ">>> type Recursive = Mutually\n" @@ -3422,27 +3446,27 @@ msgstr "" ">>> Recursive.__value__\n" "Mutually" -#: ../../library/typing.rst:2204 +#: ../../library/typing.rst:2221 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2206 +#: ../../library/typing.rst:2223 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:2212 +#: ../../library/typing.rst:2229 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2214 ../../library/typing.rst:2304 -#: ../../library/typing.rst:3343 +#: ../../library/typing.rst:2231 ../../library/typing.rst:2323 +#: ../../library/typing.rst:3364 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2233 msgid "" "class Employee(NamedTuple):\n" " name: str\n" @@ -3452,20 +3476,20 @@ msgstr "" " name: str\n" " id: int" -#: ../../library/typing.rst:2220 +#: ../../library/typing.rst:2237 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../library/typing.rst:2222 +#: ../../library/typing.rst:2239 msgid "Employee = collections.namedtuple('Employee', ['name', 'id'])" msgstr "Employee = collections.namedtuple('Employee', ['name', 'id'])" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2241 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2226 +#: ../../library/typing.rst:2243 msgid "" "class Employee(NamedTuple):\n" " name: str\n" @@ -3481,12 +3505,12 @@ msgstr "" "employee = Employee('Guido')\n" "assert employee.id == 3" -#: ../../library/typing.rst:2233 +#: ../../library/typing.rst:2250 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2252 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 " @@ -3495,11 +3519,11 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2241 +#: ../../library/typing.rst:2258 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2243 +#: ../../library/typing.rst:2260 msgid "" "class Employee(NamedTuple):\n" " \"\"\"Represents an employee.\"\"\"\n" @@ -3510,11 +3534,11 @@ msgid "" " return f''" msgstr "" -#: ../../library/typing.rst:2251 +#: ../../library/typing.rst:2268 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2270 msgid "" "class Group[T](NamedTuple):\n" " key: T\n" @@ -3524,13 +3548,15 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2274 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2259 +#: ../../library/typing.rst:2276 msgid "" -"# For creating a generic NamedTuple on Python 3.11 or lower\n" +"# For creating a generic NamedTuple on Python 3.11\n" +"T = TypeVar(\"T\")\n" +"\n" "class Group(NamedTuple, Generic[T]):\n" " key: T\n" " group: list[T]\n" @@ -3539,38 +3565,38 @@ msgid "" "Employee = NamedTuple('Employee', [('name', str), ('id', int)])" msgstr "" -#: ../../library/typing.rst:2267 +#: ../../library/typing.rst:2286 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2289 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2292 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2277 +#: ../../library/typing.rst:2296 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2300 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2303 msgid "" "The undocumented keyword argument syntax for creating NamedTuple classes " "(``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be disallowed " "in 3.15. Use the class-based syntax or the functional syntax instead." msgstr "" -#: ../../library/typing.rst:2289 +#: ../../library/typing.rst:2308 msgid "" "When using the functional syntax to create a NamedTuple class, failing to " "pass a value to the 'fields' parameter (``NT = NamedTuple(\"NT\")``) is " @@ -3580,48 +3606,48 @@ msgid "" "NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", [])``." msgstr "" -#: ../../library/typing.rst:2299 +#: ../../library/typing.rst:2318 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2301 +#: ../../library/typing.rst:2320 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:2306 +#: ../../library/typing.rst:2325 msgid "" "UserId = NewType('UserId', int) # Declare the NewType \"UserId\"\n" "first_user = UserId(1) # \"UserId\" returns the argument unchanged at " "runtime" msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2330 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2334 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2338 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2323 +#: ../../library/typing.rst:2342 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2328 +#: ../../library/typing.rst:2347 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2330 +#: ../../library/typing.rst:2349 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2332 +#: ../../library/typing.rst:2351 msgid "" "class Proto(Protocol):\n" " def meth(self) -> int:\n" @@ -3631,13 +3657,13 @@ msgstr "" " def meth(self) -> int:\n" " ..." -#: ../../library/typing.rst:2336 +#: ../../library/typing.rst:2355 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2339 +#: ../../library/typing.rst:2358 msgid "" "class C:\n" " def meth(self) -> int:\n" @@ -3649,7 +3675,7 @@ msgid "" "func(C()) # Passes static type check" msgstr "" -#: ../../library/typing.rst:2348 +#: ../../library/typing.rst:2367 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -3657,11 +3683,11 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2353 +#: ../../library/typing.rst:2372 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2355 +#: ../../library/typing.rst:2374 msgid "" "class GenProto[T](Protocol):\n" " def meth(self) -> T:\n" @@ -3671,13 +3697,13 @@ msgstr "" " def meth(self) -> T:\n" " ..." -#: ../../library/typing.rst:2359 +#: ../../library/typing.rst:2378 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2381 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -3691,11 +3717,11 @@ msgstr "" " def meth(self) -> T:\n" " ..." -#: ../../library/typing.rst:2372 +#: ../../library/typing.rst:2391 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2374 +#: ../../library/typing.rst:2393 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 " @@ -3704,7 +3730,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2379 +#: ../../library/typing.rst:2398 msgid "" "@runtime_checkable\n" "class Closable(Protocol):\n" @@ -3732,7 +3758,7 @@ msgstr "" "import threading\n" "assert isinstance(threading.Thread(name='Bob'), Named)" -#: ../../library/typing.rst:2394 +#: ../../library/typing.rst:2413 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -3743,7 +3769,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2405 +#: ../../library/typing.rst:2424 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -3751,7 +3777,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2413 +#: ../../library/typing.rst:2432 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -3761,7 +3787,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2422 +#: ../../library/typing.rst:2441 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -3770,13 +3796,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2433 +#: ../../library/typing.rst:2452 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2436 +#: ../../library/typing.rst:2455 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 " @@ -3784,7 +3810,7 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2442 +#: ../../library/typing.rst:2461 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -3797,24 +3823,24 @@ msgid "" "assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')" msgstr "" -#: ../../library/typing.rst:2452 +#: ../../library/typing.rst:2471 msgid "" "An alternative way to create a ``TypedDict`` is by using function-call " "syntax. The second argument must be a literal :class:`dict`::" msgstr "" -#: ../../library/typing.rst:2455 +#: ../../library/typing.rst:2474 msgid "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})" msgstr "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2476 msgid "" "This functional syntax allows defining keys which are not valid :ref:" "`identifiers `, for example because they are keywords or " "contain hyphens::" msgstr "" -#: ../../library/typing.rst:2461 +#: ../../library/typing.rst:2480 msgid "" "# raises SyntaxError\n" "class Point2D(TypedDict):\n" @@ -3825,13 +3851,13 @@ msgid "" "Point2D = TypedDict('Point2D', {'in': int, 'x-y': int})" msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2488 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:2472 +#: ../../library/typing.rst:2491 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -3843,19 +3869,19 @@ msgid "" "NotRequired[str]})" msgstr "" -#: ../../library/typing.rst:2480 +#: ../../library/typing.rst:2499 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2483 +#: ../../library/typing.rst:2502 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2505 msgid "" "class Point2D(TypedDict, total=False):\n" " x: int\n" @@ -3865,7 +3891,7 @@ msgid "" "Point2D = TypedDict('Point2D', {'x': int, 'y': int}, total=False)" msgstr "" -#: ../../library/typing.rst:2493 +#: ../../library/typing.rst:2512 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 " @@ -3873,13 +3899,13 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2517 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2520 msgid "" "class Point2D(TypedDict, total=False):\n" " x: Required[int]\n" @@ -3894,13 +3920,13 @@ msgid "" "}, total=False)" msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2532 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:2517 +#: ../../library/typing.rst:2536 msgid "" "class Point3D(Point2D):\n" " z: int" @@ -3908,13 +3934,13 @@ msgstr "" "class Point3D(Point2D):\n" " z: int" -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2539 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2523 +#: ../../library/typing.rst:2542 msgid "" "class Point3D(TypedDict):\n" " x: int\n" @@ -3926,13 +3952,13 @@ msgstr "" " y: int\n" " z: int" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2547 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2550 msgid "" "class X(TypedDict):\n" " x: int\n" @@ -3947,11 +3973,11 @@ msgid "" "class XZ(X, Z): pass # raises TypeError" msgstr "" -#: ../../library/typing.rst:2543 +#: ../../library/typing.rst:2562 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2545 +#: ../../library/typing.rst:2564 msgid "" "class Group[T](TypedDict):\n" " key: T\n" @@ -3961,13 +3987,13 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2568 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2552 +#: ../../library/typing.rst:2571 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -3981,19 +4007,19 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2579 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:2566 +#: ../../library/typing.rst:2585 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2569 +#: ../../library/typing.rst:2588 msgid "" ">>> from typing import TypedDict\n" ">>> class Point2D(TypedDict): pass\n" @@ -4017,7 +4043,7 @@ msgstr "" ">>> Point3D.__total__\n" "True" -#: ../../library/typing.rst:2582 +#: ../../library/typing.rst:2601 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -4028,21 +4054,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2595 +#: ../../library/typing.rst:2614 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2598 +#: ../../library/typing.rst:2617 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:2601 +#: ../../library/typing.rst:2620 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 " @@ -4051,7 +4077,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2608 +#: ../../library/typing.rst:2627 msgid "" ">>> class Point2D(TypedDict, total=False):\n" "... x: int\n" @@ -4077,7 +4103,7 @@ msgstr "" ">>> Point3D.__optional_keys__ == frozenset({'x', 'y'})\n" "True" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2645 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -4086,48 +4112,48 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2632 +#: ../../library/typing.rst:2651 msgid "Support for :data:`ReadOnly` is reflected in the following attributes:" msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2655 msgid "" "A :class:`frozenset` containing the names of all read-only keys. Keys are " "read-only if they carry the :data:`ReadOnly` qualifier." msgstr "" -#: ../../library/typing.rst:2643 +#: ../../library/typing.rst:2662 msgid "" "A :class:`frozenset` containing the names of all mutable keys. Keys are " "mutable if they do not carry the :data:`ReadOnly` qualifier." msgstr "" -#: ../../library/typing.rst:2648 +#: ../../library/typing.rst:2667 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2652 +#: ../../library/typing.rst:2671 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2656 +#: ../../library/typing.rst:2675 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2659 +#: ../../library/typing.rst:2678 msgid "" "Removed support for the keyword-argument method of creating ``TypedDict``\\ " "s." msgstr "" -#: ../../library/typing.rst:2662 +#: ../../library/typing.rst:2681 msgid "Support for the :data:`ReadOnly` qualifier was added." msgstr "" -#: ../../library/typing.rst:2665 +#: ../../library/typing.rst:2684 msgid "" "When using the functional syntax to create a TypedDict class, failing to " "pass a value to the 'fields' parameter (``TD = TypedDict(\"TD\")``) is " @@ -4137,106 +4163,106 @@ msgid "" "TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." msgstr "" -#: ../../library/typing.rst:2674 +#: ../../library/typing.rst:2693 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2676 +#: ../../library/typing.rst:2695 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2681 +#: ../../library/typing.rst:2700 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2686 +#: ../../library/typing.rst:2705 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2690 +#: ../../library/typing.rst:2709 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2694 +#: ../../library/typing.rst:2713 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:2717 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2704 +#: ../../library/typing.rst:2723 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2708 +#: ../../library/typing.rst:2727 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2731 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2718 +#: ../../library/typing.rst:2737 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:2724 +#: ../../library/typing.rst:2743 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2728 +#: ../../library/typing.rst:2747 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2749 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:2737 +#: ../../library/typing.rst:2756 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2739 +#: ../../library/typing.rst:2758 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:2742 +#: ../../library/typing.rst:2761 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:2745 +#: ../../library/typing.rst:2764 msgid "" "def greet(name: str) -> None:\n" " assert_type(name, str) # OK, inferred type of `name` is `str`\n" " assert_type(name, int) # type checker error" msgstr "" -#: ../../library/typing.rst:2749 +#: ../../library/typing.rst:2768 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:2752 +#: ../../library/typing.rst:2771 msgid "" "def complex_function(arg: object):\n" " # Do some complex type-narrowing logic,\n" @@ -4246,16 +4272,16 @@ msgid "" " assert_type(arg, int)" msgstr "" -#: ../../library/typing.rst:2763 +#: ../../library/typing.rst:2782 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2784 msgid "Example::" msgstr "舉例來說: ::" -#: ../../library/typing.rst:2767 +#: ../../library/typing.rst:2786 msgid "" "def int_or_str(arg: int | str) -> None:\n" " match arg:\n" @@ -4275,14 +4301,14 @@ msgstr "" " case _ as unreachable:\n" " assert_never(unreachable)" -#: ../../library/typing.rst:2776 +#: ../../library/typing.rst:2795 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:2781 +#: ../../library/typing.rst:2800 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 " @@ -4292,47 +4318,47 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2789 +#: ../../library/typing.rst:2808 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:2811 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2819 msgid "Ask a static type checker to reveal the inferred type of an expression." msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2821 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the inferred type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2824 msgid "" "x: int = 1\n" "reveal_type(x) # Revealed type is \"builtins.int\"" msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:2827 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2811 +#: ../../library/typing.rst:2830 msgid "" "At runtime, this function prints the runtime type of its argument to :data:" "`sys.stderr` and returns the argument unchanged (allowing the call to be " "used within an expression)::" msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2834 msgid "" "x = reveal_type(1) # prints \"Runtime type is int\"\n" "print(x) # prints \"1\"" @@ -4340,13 +4366,13 @@ msgstr "" "x = reveal_type(1) # 印出 \"Runtime type is int\"\n" "print(x) # 印出 \"1\"" -#: ../../library/typing.rst:2818 +#: ../../library/typing.rst:2837 msgid "" "Note that the runtime type may be different from (more or less specific " "than) the type statically inferred by a type checker." msgstr "" -#: ../../library/typing.rst:2821 +#: ../../library/typing.rst:2840 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing``, however, " @@ -4354,13 +4380,13 @@ msgid "" "clearly." msgstr "" -#: ../../library/typing.rst:2832 +#: ../../library/typing.rst:2851 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2835 +#: ../../library/typing.rst:2854 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -4369,11 +4395,11 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:2861 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2844 +#: ../../library/typing.rst:2863 msgid "" "@dataclass_transform()\n" "def create_model[T](cls: type[T]) -> type[T]:\n" @@ -4395,11 +4421,11 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2875 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2877 msgid "" "@dataclass_transform()\n" "class ModelBase: ...\n" @@ -4415,11 +4441,11 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2884 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2867 +#: ../../library/typing.rst:2886 msgid "" "@dataclass_transform()\n" "class ModelMeta(type): ...\n" @@ -4439,7 +4465,7 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:2876 +#: ../../library/typing.rst:2895 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass None:\n" @@ -4645,24 +4671,24 @@ msgid "" " ... # actual implementation goes here" msgstr "" -#: ../../library/typing.rst:3004 +#: ../../library/typing.rst:3023 msgid "" "See :pep:`484` for more details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:3006 +#: ../../library/typing.rst:3025 msgid "" "Overloaded functions can now be introspected at runtime using :func:" "`get_overloads`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3032 msgid "" "Return a sequence of :func:`@overload `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3035 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -4672,32 +4698,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:3023 +#: ../../library/typing.rst:3042 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:3031 +#: ../../library/typing.rst:3050 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:3033 +#: ../../library/typing.rst:3052 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:3040 +#: ../../library/typing.rst:3059 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:3042 +#: ../../library/typing.rst:3061 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:3048 +#: ../../library/typing.rst:3067 msgid "" "class Base:\n" " @final\n" @@ -4714,7 +4740,7 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3086 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__\", " @@ -4724,11 +4750,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:3078 +#: ../../library/typing.rst:3097 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:3080 +#: ../../library/typing.rst:3099 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 " @@ -4736,40 +4762,40 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:3086 +#: ../../library/typing.rst:3105 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:3090 +#: ../../library/typing.rst:3109 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:3092 +#: ../../library/typing.rst:3111 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:3095 +#: ../../library/typing.rst:3114 msgid "" "No type checker ever added support for ``@no_type_check_decorator``. It is " "therefore deprecated, and will be removed in Python 3.15." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3120 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:3104 +#: ../../library/typing.rst:3123 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3130 msgid "" "class Base:\n" " def log_status(self) -> None:\n" @@ -4785,11 +4811,11 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:3126 +#: ../../library/typing.rst:3145 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3147 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -4799,22 +4825,22 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:3135 +#: ../../library/typing.rst:3154 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:3142 +#: ../../library/typing.rst:3161 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3163 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:3148 +#: ../../library/typing.rst:3167 msgid "" "@type_check_only\n" "class Response: # private or not available at runtime\n" @@ -4824,29 +4850,29 @@ msgid "" "def fetch_response() -> Response: ..." msgstr "" -#: ../../library/typing.rst:3155 +#: ../../library/typing.rst:3174 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:3159 +#: ../../library/typing.rst:3178 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3182 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:3166 +#: ../../library/typing.rst:3185 msgid "" "This is often the same as ``obj.__annotations__``, but this function makes " "the following changes to the annotations dictionary:" msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3188 msgid "" "Forward references encoded as string literals or :class:`ForwardRef` objects " "are handled by evaluating them in *globalns*, *localns*, and (where " @@ -4855,40 +4881,40 @@ msgid "" "inferred from *obj*." msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3193 msgid "``None`` is replaced with :class:`types.NoneType`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3194 msgid "" "If :func:`@no_type_check ` has been applied to *obj*, an " "empty dictionary is returned." msgstr "" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3196 msgid "" "If *obj* is a class ``C``, the function returns a dictionary that merges " "annotations from ``C``'s base classes with those on ``C`` directly. This is " -"done by traversing ``C.__mro__`` and iteratively combining " -"``__annotations__`` dictionaries. Annotations on classes appearing earlier " -"in the :term:`method resolution order` always take precedence over " +"done by traversing :attr:`C.__mro__ ` and iteratively " +"combining ``__annotations__`` dictionaries. Annotations on classes appearing " +"earlier in the :term:`method resolution order` always take precedence over " "annotations on classes appearing later in the method resolution order." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3203 msgid "" "The function recursively replaces all occurrences of ``Annotated[T, ...]`` " "with ``T``, unless *include_extras* is set to ``True`` (see :class:" "`Annotated` for more information)." msgstr "" -#: ../../library/typing.rst:3187 +#: ../../library/typing.rst:3207 msgid "" "See also :func:`inspect.get_annotations`, a lower-level function that " "returns annotations more directly." msgstr "" -#: ../../library/typing.rst:3192 +#: ../../library/typing.rst:3212 msgid "" "If any forward references in the annotations of *obj* are not resolvable or " "are not valid Python code, this function will raise an exception such as :" @@ -4897,7 +4923,7 @@ msgid "" "imported under :data:`if TYPE_CHECKING `." msgstr "" -#: ../../library/typing.rst:3198 +#: ../../library/typing.rst:3218 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -4905,20 +4931,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3222 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:3209 +#: ../../library/typing.rst:3229 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3232 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 :" @@ -4926,15 +4952,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:3218 ../../library/typing.rst:3241 +#: ../../library/typing.rst:3238 ../../library/typing.rst:3262 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3240 +#, fuzzy msgid "" "assert get_origin(str) is None\n" "assert get_origin(Dict[str, int]) is dict\n" "assert get_origin(Union[int, str]) is Union\n" +"assert get_origin(Annotated[str, \"metadata\"]) is Annotated\n" "P = ParamSpec('P')\n" "assert get_origin(P.args) is P\n" "assert get_origin(P.kwargs) is P" @@ -4946,13 +4974,13 @@ msgstr "" "assert get_origin(P.args) is P\n" "assert get_origin(P.kwargs) is P" -#: ../../library/typing.rst:3233 +#: ../../library/typing.rst:3254 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:3236 +#: ../../library/typing.rst:3257 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 " @@ -4960,7 +4988,7 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3243 +#: ../../library/typing.rst:3264 msgid "" "assert get_args(int) == ()\n" "assert get_args(Dict[int, str]) == (int, str)\n" @@ -4970,11 +4998,11 @@ msgstr "" "assert get_args(Dict[int, str]) == (int, str)\n" "assert get_args(Union[int, str]) == (int, str)" -#: ../../library/typing.rst:3253 +#: ../../library/typing.rst:3274 msgid "Return the set of members defined in a :class:`Protocol`." msgstr "" -#: ../../library/typing.rst:3255 +#: ../../library/typing.rst:3276 msgid "" ">>> from typing import Protocol, get_protocol_members\n" ">>> class P(Protocol):\n" @@ -4984,16 +5012,16 @@ msgid "" "True" msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3285 msgid "Raise :exc:`TypeError` for arguments that are not Protocols." msgstr "" -#: ../../library/typing.rst:3270 +#: ../../library/typing.rst:3291 #, fuzzy msgid "Determine if a type is a :class:`Protocol`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3295 msgid "" "class P(Protocol):\n" " def a(self) -> str: ...\n" @@ -5003,11 +5031,11 @@ msgid "" "is_protocol(int) # => False" msgstr "" -#: ../../library/typing.rst:3285 +#: ../../library/typing.rst:3306 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3310 msgid "" "class Film(TypedDict):\n" " title: str\n" @@ -5021,32 +5049,32 @@ msgid "" "assert not is_typeddict(TypedDict)" msgstr "" -#: ../../library/typing.rst:3306 +#: ../../library/typing.rst:3327 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3308 +#: ../../library/typing.rst:3329 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:3313 +#: ../../library/typing.rst:3334 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:3321 +#: ../../library/typing.rst:3342 msgid "" "A sentinel object used to indicate that a type parameter has no default " "value. For example:" msgstr "" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3345 msgid "" ">>> T = TypeVar(\"T\")\n" ">>> T.__default__ is typing.NoDefault\n" @@ -5056,17 +5084,17 @@ msgid "" "True" msgstr "" -#: ../../library/typing.rst:3336 +#: ../../library/typing.rst:3357 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3340 +#: ../../library/typing.rst:3361 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:3345 +#: ../../library/typing.rst:3366 msgid "" "if TYPE_CHECKING:\n" " import expensive_mod\n" @@ -5080,7 +5108,7 @@ msgstr "" "def fun(arg: 'expensive_mod.SomeType') -> None:\n" " local_var: expensive_mod.AnotherType = other_fun()" -#: ../../library/typing.rst:3351 +#: ../../library/typing.rst:3372 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -5088,7 +5116,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3358 +#: ../../library/typing.rst:3379 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -5096,11 +5124,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3391 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3393 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -5109,7 +5137,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3379 +#: ../../library/typing.rst:3400 msgid "" "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 " @@ -5117,7 +5145,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3384 +#: ../../library/typing.rst:3405 msgid "" "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 " @@ -5125,38 +5153,38 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3389 +#: ../../library/typing.rst:3410 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:3395 +#: ../../library/typing.rst:3416 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3399 +#: ../../library/typing.rst:3420 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3401 +#: ../../library/typing.rst:3422 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`~collections.abc.Mapping` rather than to " "use :class:`dict` or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3405 +#: ../../library/typing.rst:3426 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3411 +#: ../../library/typing.rst:3432 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3413 +#: ../../library/typing.rst:3434 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`~collections.abc.Sequence` or :class:" @@ -5164,136 +5192,136 @@ msgid "" "typing.List`." msgstr "" -#: ../../library/typing.rst:3418 +#: ../../library/typing.rst:3439 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3424 +#: ../../library/typing.rst:3445 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3426 +#: ../../library/typing.rst:3447 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`collections.abc.Set` rather than to use :" "class:`set` or :class:`typing.Set`." msgstr "" -#: ../../library/typing.rst:3430 +#: ../../library/typing.rst:3451 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3436 +#: ../../library/typing.rst:3457 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3438 +#: ../../library/typing.rst:3459 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3445 +#: ../../library/typing.rst:3466 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3447 +#: ../../library/typing.rst:3468 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3450 +#: ../../library/typing.rst:3471 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3456 +#: ../../library/typing.rst:3477 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3458 +#: ../../library/typing.rst:3479 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3463 +#: ../../library/typing.rst:3484 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3470 +#: ../../library/typing.rst:3491 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3474 +#: ../../library/typing.rst:3495 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3478 +#: ../../library/typing.rst:3499 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3484 +#: ../../library/typing.rst:3505 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3488 +#: ../../library/typing.rst:3509 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3494 +#: ../../library/typing.rst:3515 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3519 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3504 +#: ../../library/typing.rst:3525 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3508 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3514 +#: ../../library/typing.rst:3535 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3518 +#: ../../library/typing.rst:3539 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3525 +#: ../../library/typing.rst:3546 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3530 +#: ../../library/typing.rst:3551 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3533 +#: ../../library/typing.rst:3554 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -5301,343 +5329,343 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3538 +#: ../../library/typing.rst:3559 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3544 +#: ../../library/typing.rst:3565 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3546 +#: ../../library/typing.rst:3567 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:3550 +#: ../../library/typing.rst:3571 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:3553 +#: ../../library/typing.rst:3574 msgid "" "def add_unicode_checkmark(text: Text) -> Text:\n" " return text + u' \\u2713'" msgstr "" -#: ../../library/typing.rst:3558 +#: ../../library/typing.rst:3579 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:3568 +#: ../../library/typing.rst:3589 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3572 +#: ../../library/typing.rst:3593 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3574 +#: ../../library/typing.rst:3595 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3580 +#: ../../library/typing.rst:3601 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3583 +#: ../../library/typing.rst:3604 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3588 +#: ../../library/typing.rst:3609 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3592 +#: ../../library/typing.rst:3613 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3598 +#: ../../library/typing.rst:3619 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3600 +#: ../../library/typing.rst:3621 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3606 +#: ../../library/typing.rst:3627 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3608 +#: ../../library/typing.rst:3629 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3614 +#: ../../library/typing.rst:3635 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3616 +#: ../../library/typing.rst:3637 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3622 +#: ../../library/typing.rst:3643 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3624 +#: ../../library/typing.rst:3645 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3630 +#: ../../library/typing.rst:3651 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3632 +#: ../../library/typing.rst:3653 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3638 +#: ../../library/typing.rst:3659 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3640 +#: ../../library/typing.rst:3661 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3647 +#: ../../library/typing.rst:3668 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3649 +#: ../../library/typing.rst:3670 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3677 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3658 +#: ../../library/typing.rst:3679 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3685 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3687 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3693 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3674 +#: ../../library/typing.rst:3695 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3681 +#: ../../library/typing.rst:3702 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3685 +#: ../../library/typing.rst:3706 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3708 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Coroutine` and ``typing.Coroutine`` in type annotations." msgstr "" -#: ../../library/typing.rst:3693 +#: ../../library/typing.rst:3714 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3699 +#: ../../library/typing.rst:3720 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3701 +#: ../../library/typing.rst:3722 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.AsyncGenerator` and ``typing.AsyncGenerator`` in type " "annotations." msgstr "" -#: ../../library/typing.rst:3707 +#: ../../library/typing.rst:3728 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3712 +#: ../../library/typing.rst:3733 msgid "The ``SendType`` parameter now has a default." msgstr "" -#: ../../library/typing.rst:3717 +#: ../../library/typing.rst:3738 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3721 +#: ../../library/typing.rst:3742 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3727 +#: ../../library/typing.rst:3748 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3731 +#: ../../library/typing.rst:3752 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3737 +#: ../../library/typing.rst:3758 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3741 +#: ../../library/typing.rst:3762 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3748 +#: ../../library/typing.rst:3769 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3752 +#: ../../library/typing.rst:3773 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3754 +#: ../../library/typing.rst:3775 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3760 +#: ../../library/typing.rst:3781 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3762 +#: ../../library/typing.rst:3783 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3768 +#: ../../library/typing.rst:3789 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3770 +#: ../../library/typing.rst:3791 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:3773 +#: ../../library/typing.rst:3794 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3783 +#: ../../library/typing.rst:3804 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3785 +#: ../../library/typing.rst:3806 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Generator` and ``typing.Generator`` in type annotations." msgstr "" -#: ../../library/typing.rst:3789 +#: ../../library/typing.rst:3810 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3793 +#: ../../library/typing.rst:3814 msgid "Default values for the send and return types were added." msgstr "" -#: ../../library/typing.rst:3798 +#: ../../library/typing.rst:3819 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3800 +#: ../../library/typing.rst:3821 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3805 +#: ../../library/typing.rst:3826 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3807 +#: ../../library/typing.rst:3828 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3813 +#: ../../library/typing.rst:3834 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3815 +#: ../../library/typing.rst:3836 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3821 +#: ../../library/typing.rst:3842 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3825 +#: ../../library/typing.rst:3846 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3827 +#: ../../library/typing.rst:3848 msgid "" "The first type parameter, ``T_co``, represents the type returned by the :" "meth:`~object.__enter__` method. The optional second type parameter, " @@ -5645,21 +5673,21 @@ msgid "" "returned by the :meth:`~object.__exit__` method." msgstr "" -#: ../../library/typing.rst:3834 +#: ../../library/typing.rst:3855 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3839 +#: ../../library/typing.rst:3860 msgid "Added the optional second type parameter, ``ExitT_co``." msgstr "" -#: ../../library/typing.rst:3844 +#: ../../library/typing.rst:3865 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3846 +#: ../../library/typing.rst:3867 msgid "" "The first type parameter, ``T_co``, represents the type returned by the :" "meth:`~object.__aenter__` method. The optional second type parameter, " @@ -5667,21 +5695,21 @@ msgid "" "returned by the :meth:`~object.__aexit__` method." msgstr "" -#: ../../library/typing.rst:3853 +#: ../../library/typing.rst:3874 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3858 +#: ../../library/typing.rst:3879 msgid "Added the optional second type parameter, ``AExitT_co``." msgstr "" -#: ../../library/typing.rst:3862 +#: ../../library/typing.rst:3883 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3864 +#: ../../library/typing.rst:3885 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -5689,114 +5717,114 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3871 +#: ../../library/typing.rst:3892 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3872 +#: ../../library/typing.rst:3893 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3873 +#: ../../library/typing.rst:3894 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3874 +#: ../../library/typing.rst:3895 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3875 +#: ../../library/typing.rst:3896 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3876 ../../library/typing.rst:3880 +#: ../../library/typing.rst:3897 ../../library/typing.rst:3901 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3877 +#: ../../library/typing.rst:3898 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3878 +#: ../../library/typing.rst:3899 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3879 +#: ../../library/typing.rst:3900 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3881 +#: ../../library/typing.rst:3902 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3882 +#: ../../library/typing.rst:3903 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3883 +#: ../../library/typing.rst:3904 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3884 +#: ../../library/typing.rst:3905 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3885 ../../library/typing.rst:3889 -#: ../../library/typing.rst:3893 +#: ../../library/typing.rst:3906 ../../library/typing.rst:3910 +#: ../../library/typing.rst:3914 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3886 +#: ../../library/typing.rst:3907 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3887 +#: ../../library/typing.rst:3908 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`" -#: ../../library/typing.rst:3888 ../../library/typing.rst:3892 +#: ../../library/typing.rst:3909 ../../library/typing.rst:3913 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3890 +#: ../../library/typing.rst:3911 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3891 +#: ../../library/typing.rst:3912 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3894 +#: ../../library/typing.rst:3915 msgid ":pep:`695`" msgstr ":pep:`695`" -#: ../../library/typing.rst:3895 +#: ../../library/typing.rst:3916 msgid ":func:`@typing.no_type_check_decorator `" msgstr "" -#: ../../library/typing.rst:3896 ../../library/typing.rst:3900 +#: ../../library/typing.rst:3917 ../../library/typing.rst:3921 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3897 +#: ../../library/typing.rst:3918 msgid "3.15" msgstr "" -#: ../../library/typing.rst:3898 +#: ../../library/typing.rst:3919 #, fuzzy msgid ":gh:`106309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3899 +#: ../../library/typing.rst:3920 #, fuzzy msgid ":data:`typing.AnyStr`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3901 +#: ../../library/typing.rst:3922 msgid "3.18" msgstr "" -#: ../../library/typing.rst:3902 +#: ../../library/typing.rst:3923 #, fuzzy msgid ":gh:`105578`" msgstr ":gh:`91896`" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 46210eedbc..45fb032f8e 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -303,8 +303,9 @@ msgstr "" "`AttributeError`。" #: ../../library/unittest.mock.rst:241 +#, fuzzy msgid "" -"If *spec* is an object (rather than a list of strings) then :attr:`~instance." +"If *spec* is an object (rather than a list of strings) then :attr:`~object." "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" diff --git a/library/venv.po b/library/venv.po index 25b042169f..e78a34e10c 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,8 +59,8 @@ msgstr "" #: ../../library/venv.rst:40 msgid "" -"Contained in a directory, conventionally either named ``venv`` or ``.venv`` " -"in the project directory, or under a container directory for lots of virtual " +"Contained in a directory, conventionally named ``.venv`` or ``venv`` in the " +"project directory, or under a container directory for lots of virtual " "environments, such as ``~/.virtualenvs``." msgstr "" @@ -71,7 +71,7 @@ msgstr "" #: ../../library/venv.rst:46 msgid "" "Considered as disposable -- it should be simple to delete and recreate it " -"from scratch. You don't place any project code in the environment" +"from scratch. You don't place any project code in the environment." msgstr "" #: ../../library/venv.rst:49 @@ -105,28 +105,28 @@ msgstr "" msgid "Creating virtual environments" msgstr "建立虛擬環境" -#: ../../using/venv-create.inc:1 +#: ../../library/venv.rst:64 +#, fuzzy msgid "" -"Creation of :ref:`virtual environments ` is done by executing the " -"command ``venv``::" +":ref:`Virtual environments ` are created by executing the ``venv`` " +"module:" msgstr "建立\\ :ref:`虛擬環境 `\\ 的方法是透過執行指令 ``venv``:" -#: ../../using/venv-create.inc:4 +#: ../../library/venv.rst:67 msgid "python -m venv /path/to/new/virtual/environment" msgstr "python -m venv /path/to/new/virtual/environment" -#: ../../using/venv-create.inc:6 +#: ../../library/venv.rst:71 +#, fuzzy msgid "" -"Running this command creates the target directory (creating any parent " -"directories that don't exist already) and places a ``pyvenv.cfg`` file in it " -"with a ``home`` key pointing to the Python installation from which the " -"command was run (a common name for the target directory is ``.venv``). It " -"also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a " -"copy/symlink of the Python binary/binaries (as appropriate for the platform " -"or arguments used at environment creation time). It also creates an " -"(initially empty) ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, " -"this is ``Lib\\site-packages``). If an existing directory is specified, it " -"will be re-used." +"This creates the target directory (including parent directories as needed) " +"and places a :file:`pyvenv.cfg` file in it with a ``home`` key pointing to " +"the Python installation from which the command was run. It also creates a :" +"file:`bin` (or :file:`Scripts` on Windows) subdirectory containing a copy or " +"symlink of the Python executable (as appropriate for the platform or " +"arguments used at environment creation time). It also creates a :file:`lib/" +"pythonX.Y/site-packages` subdirectory (on Windows, this is :file:`Lib\\site-" +"packages`). If an existing directory is specified, it will be re-used." msgstr "" "執行此命令會建立目標目錄(同時也會建立任何還不存在的父目錄)並在目錄中放置一" "個名為 ``pyvenv.cfg`` 的檔案,其中包含一個指向執行該命令的 Python 安裝路徑的 " @@ -136,81 +136,70 @@ msgstr "" "空的) ``lib/pythonX.Y/site-packages`` 子目錄(在 Windows 上為 ``Lib\\site-" "packages``)。如果指定的目錄已存在,則將重新使用該目錄。" -#: ../../using/venv-create.inc:17 +#: ../../library/venv.rst:81 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." msgstr "目前建議使用 ``venv`` 來建立虛擬環境。" -#: ../../using/venv-create.inc:20 +#: ../../library/venv.rst:84 +#, fuzzy msgid "" -"``pyvenv`` was the recommended tool for creating virtual environments for " -"Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." +":program:`pyvenv` was the recommended tool for creating virtual environments " +"for Python 3.3 and 3.4, and replaced in 3.5 by executing ``venv`` directly." msgstr "" "``pyvenv`` 是在 Python 3.3 和 3.4 中建立虛擬環境的推薦工具,但在 Python 3.6 " "中已被\\ :ref:`棄用 `。" -#: ../../using/venv-create.inc:27 -msgid "On Windows, invoke the ``venv`` command as follows::" +#: ../../library/venv.rst:90 +#, fuzzy +msgid "On Windows, invoke the ``venv`` command as follows:" msgstr "在 Windows 上,執行以下命令以使用 ``venv``:" -#: ../../using/venv-create.inc:29 -msgid "c:\\>Python35\\python -m venv c:\\path\\to\\myenv" -msgstr "c:\\>Python35\\python -m venv c:\\path\\to\\myenv" - -#: ../../using/venv-create.inc:31 -msgid "" -"Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables for " -"your :ref:`Python installation `::" -msgstr "" -"或者,如你已經為你的 :ref:`Python 安裝 `\\ 配置了 ``PATH`` " -"和 ``PATHEXT`` 變數,則可以執行以下命令:" - -#: ../../using/venv-create.inc:34 -msgid "c:\\>python -m venv c:\\path\\to\\myenv" -msgstr "c:\\>python -m venv c:\\path\\to\\myenv" +#: ../../library/venv.rst:92 +#, fuzzy +msgid "PS> python -m venv C:\\path\\to\\new\\virtual\\environment" +msgstr "python -m venv /path/to/new/virtual/environment" -#: ../../using/venv-create.inc:36 +#: ../../library/venv.rst:96 msgid "The command, if run with ``-h``, will show the available options::" msgstr "如果使用 ``-h`` 選項執行該命令,將會顯示可用的選項:" -#: ../../using/venv-create.inc:38 +#: ../../library/venv.rst:98 #, fuzzy msgid "" "usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]\n" " [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]\n" -" [--without-scm-ignore-file]\n" +" [--without-scm-ignore-files]\n" " ENV_DIR [ENV_DIR ...]\n" "\n" "Creates virtual Python environments in one or more target directories.\n" "\n" "positional arguments:\n" -"ENV_DIR A directory to create the environment in.\n" +" ENV_DIR A directory to create the environment in.\n" "\n" "options:\n" -"-h, --help show this help message and exit\n" -"--system-site-packages\n" +" -h, --help show this help message and exit\n" +" --system-site-packages\n" " Give the virtual environment access to the system\n" " site-packages dir.\n" -"--symlinks Try to use symlinks rather than copies, when\n" +" --symlinks Try to use symlinks rather than copies, when\n" " symlinks are not the default for the platform.\n" -"--copies Try to use copies rather than symlinks, even when\n" +" --copies Try to use copies rather than symlinks, even when\n" " symlinks are the default for the platform.\n" -"--clear Delete the contents of the environment directory if\n" -" it already exists, before environment creation.\n" -"--upgrade Upgrade the environment directory to use this\n" -" version of Python, assuming Python has been " -"upgraded\n" -" in-place.\n" -"--without-pip Skips installing or upgrading pip in the virtual\n" +" --clear Delete the contents of the environment directory\n" +" if it already exists, before environment creation.\n" +" --upgrade Upgrade the environment directory to use this\n" +" version of Python, assuming Python has been\n" +" upgraded in-place.\n" +" --without-pip Skips installing or upgrading pip in the virtual\n" " environment (pip is bootstrapped by default)\n" -"--prompt PROMPT Provides an alternative prompt prefix for this\n" +" --prompt PROMPT Provides an alternative prompt prefix for this\n" " environment.\n" -"--upgrade-deps Upgrade core dependencies (pip) to the latest\n" +" --upgrade-deps Upgrade core dependencies (pip) to the latest\n" " version in PyPI\n" -"--without-scm-ignore-file\n" -" Skips adding the default SCM ignore file to the\n" -" environment directory (the default is a .gitignore\n" -" file).\n" +" --without-scm-ignore-files\n" +" Skips adding SCM ignore files to the environment\n" +" directory (Git is supported by default).\n" "\n" "Once an environment has been created, you may wish to activate it, e.g. by\n" "sourcing an activate script in its bin directory." @@ -251,38 +240,43 @@ msgstr "" "Once an environment has been created, you may wish to activate it, e.g. by\n" "sourcing an activate script in its bin directory." -#: ../../using/venv-create.inc:78 +#: ../../library/venv.rst:136 +#, fuzzy msgid "" -"``--without-scm-ignore-file`` was added along with creating an ignore file " -"for ``git`` by default." -msgstr "" +"Installs pip by default, added the ``--without-pip`` and ``--copies`` " +"options." +msgstr "預設情況下安裝 pip,並新增了 ``--without-pip`` 和 ``--copies`` 選項" -#: ../../library/venv.rst:323 ../../using/venv-create.inc:83 -msgid "``setuptools`` is no longer a core venv dependency." +#: ../../library/venv.rst:140 +msgid "" +"In earlier versions, if the target directory already existed, an error was " +"raised, unless the ``--clear`` or ``--upgrade`` option was provided." msgstr "" +"在較早的版本中,如果目標目錄已存在,除非提供了 ``--clear`` 或 ``--upgrade`` " +"選項,否則會引發錯誤。" -#: ../../using/venv-create.inc:85 +#: ../../library/venv.rst:144 +#, fuzzy msgid "" "Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " -"PyPI" +"PyPI." msgstr "" "新增 ``--upgrade-deps`` 選項以將 pip 和 setuptools 升級至 PyPI 上的最新版本" -#: ../../using/venv-create.inc:88 -msgid "" -"Installs pip by default, added the ``--without-pip`` and ``--copies`` " -"options" -msgstr "預設情況下安裝 pip,並新增了 ``--without-pip`` 和 ``--copies`` 選項" +#: ../../library/venv.rst:149 +msgid "``setuptools`` is no longer a core venv dependency." +msgstr "" -#: ../../using/venv-create.inc:92 -msgid "" -"In earlier versions, if the target directory already existed, an error was " -"raised, unless the ``--clear`` or ``--upgrade`` option was provided." +#: ../../library/venv.rst:153 +#, fuzzy +msgid "Added the ``--without-scm-ignore-files`` option." +msgstr "新增 ``upgrade_deps`` 參數" + +#: ../../library/venv.rst:154 +msgid "``venv`` now creates a :file:`.gitignore` file for Git by default." msgstr "" -"在較早的版本中,如果目標目錄已存在,除非提供了 ``--clear`` 或 ``--upgrade`` " -"選項,否則會引發錯誤。" -#: ../../using/venv-create.inc:97 +#: ../../library/venv.rst:158 msgid "" "While symlinks are supported on Windows, they are not recommended. Of " "particular note is that double-clicking ``python.exe`` in File Explorer will " @@ -291,7 +285,7 @@ msgstr "" "雖然在 Windows 上支援符號連結,但並不建議使用。特別需要注意的是,在檔案總管中" "按兩下 ``python.exe`` 會急切地解析符號連結並忽略虛擬環境。" -#: ../../using/venv-create.inc:102 +#: ../../library/venv.rst:163 msgid "" "On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " "script by setting the execution policy for the user. You can do this by " @@ -300,12 +294,12 @@ msgstr "" "在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 ``Activate." "ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" -#: ../../using/venv-create.inc:106 +#: ../../library/venv.rst:167 msgid "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" msgstr "" -#: ../../using/venv-create.inc:108 +#: ../../library/venv.rst:171 msgid "" "See `About Execution Policies `_ for more information." @@ -313,9 +307,10 @@ msgstr "" "有關更多資訊,請參閱\\ `關於執行策略 `_。" -#: ../../using/venv-create.inc:112 +#: ../../library/venv.rst:175 +#, fuzzy msgid "" -"The created ``pyvenv.cfg`` file also includes the ``include-system-site-" +"The created :file:`pyvenv.cfg` file also includes the ``include-system-site-" "packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" "packages`` option, ``false`` otherwise." msgstr "" @@ -323,7 +318,7 @@ msgstr "" "如果使用 ``venv`` 執行時帶有 ``--system-site-packages`` 選項,則設置為 " "``true``,否則設置為 ``false``。" -#: ../../using/venv-create.inc:116 +#: ../../library/venv.rst:179 msgid "" "Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " "invoked to bootstrap ``pip`` into the virtual environment." @@ -331,7 +326,7 @@ msgstr "" "除非 ``--without-pip`` 選項被提供,否則將調用 :mod:`ensurepip` 來啟動 " "``pip`` 到虛擬環境中。" -#: ../../using/venv-create.inc:119 +#: ../../library/venv.rst:182 msgid "" "Multiple paths can be given to ``venv``, in which case an identical virtual " "environment will be created, according to the given options, at each " @@ -340,11 +335,11 @@ msgstr "" "可以向 ``venv`` 提供多個路徑,這樣每個提供的路徑都將根據給定的選項建立一個相" "同的虛擬環境。" -#: ../../library/venv.rst:69 +#: ../../library/venv.rst:189 msgid "How venvs work" msgstr "虛擬環境如何運作" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:191 msgid "" "When a Python interpreter is running from a virtual environment, :data:`sys." "prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " @@ -358,7 +353,7 @@ msgstr "" "base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix !" "= sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" -#: ../../library/venv.rst:80 +#: ../../library/venv.rst:200 msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " @@ -374,81 +369,81 @@ msgstr "" "用完整的路徑。啟動腳本的方式因平台而異(:samp:`{}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:90 +#: ../../library/venv.rst:210 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:90 +#: ../../library/venv.rst:210 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:90 +#: ../../library/venv.rst:210 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:92 +#: ../../library/venv.rst:212 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:92 +#: ../../library/venv.rst:212 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:92 +#: ../../library/venv.rst:212 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:94 +#: ../../library/venv.rst:214 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:94 +#: ../../library/venv.rst:214 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:96 +#: ../../library/venv.rst:216 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:96 +#: ../../library/venv.rst:216 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:98 ../../library/venv.rst:102 +#: ../../library/venv.rst:218 ../../library/venv.rst:222 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:98 +#: ../../library/venv.rst:218 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:100 +#: ../../library/venv.rst:220 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:100 +#: ../../library/venv.rst:220 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:100 +#: ../../library/venv.rst:220 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:102 +#: ../../library/venv.rst:222 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:105 +#: ../../library/venv.rst:225 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:108 +#: ../../library/venv.rst:228 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:112 +#: ../../library/venv.rst:232 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -459,12 +454,13 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:118 +#: ../../library/venv.rst:238 +#, fuzzy 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 which points to the environment's Python interpreter, :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 " @@ -477,7 +473,7 @@ msgstr "" "(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :" "envvar:`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:127 +#: ../../library/venv.rst:247 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -489,7 +485,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:133 +#: ../../library/venv.rst:253 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -512,7 +508,7 @@ msgstr "" "位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" "該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:147 +#: ../../library/venv.rst:267 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -521,11 +517,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:155 +#: ../../library/venv.rst:275 msgid "API" msgstr "API" -#: ../../library/venv.rst:159 +#: ../../library/venv.rst:279 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -535,58 +531,63 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:168 +#: ../../library/venv.rst:288 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:171 +#: ../../library/venv.rst:291 +#, fuzzy msgid "" -"``system_site_packages`` -- a Boolean value indicating that the system " -"Python site-packages should be available to the environment (defaults to " -"``False``)." +"*system_site_packages* -- a boolean value indicating that the system Python " +"site-packages should be available to the environment (defaults to ``False``)." msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:174 +#: ../../library/venv.rst:294 +#, fuzzy msgid "" -"``clear`` -- a Boolean value which, if true, will delete the contents of any " +"*clear* -- a boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." msgstr "" "``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目標目錄內所" "有存在的內容。" -#: ../../library/venv.rst:177 +#: ../../library/venv.rst:297 +#, fuzzy msgid "" -"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " +"*symlinks* -- a boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." msgstr "" "``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建立符號連" "結而不是複製該檔案。" -#: ../../library/venv.rst:180 +#: ../../library/venv.rst:300 +#, fuzzy msgid "" -"``upgrade`` -- a Boolean value which, if true, will upgrade an existing " +"*upgrade* -- a boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " "upgraded in-place (defaults to ``False``)." msgstr "" "``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現有的環境進" "行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:184 +#: ../../library/venv.rst:304 +#, fuzzy msgid "" -"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " +"*with_pip* -- a boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" "pip`` option." msgstr "" "``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。" "當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:188 +#: ../../library/venv.rst:308 +#, fuzzy msgid "" -"``prompt`` -- a String to be used after virtual environment is activated " +"*prompt* -- a string to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " "used). If the special string ``\".\"`` is provided, the basename of the " "current directory is used as the prompt." @@ -595,48 +596,41 @@ msgstr "" "為 ``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則當" "前目錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:193 -msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" +#: ../../library/venv.rst:313 +#, fuzzy +msgid "*upgrade_deps* -- Update the base venv modules to the latest on PyPI" msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:195 +#: ../../library/venv.rst:315 msgid "" -"``scm_ignore_files`` -- Create ignore files based for the specified source " +"*scm_ignore_files* -- Create ignore files based for the specified source " "control managers (SCM) in the iterable. Support is defined by having a " "method named ``create_{scm}_ignore_file``. The only value supported by " "default is ``\"git\"`` via :meth:`create_git_ignore_file`." msgstr "" -#: ../../library/venv.rst:201 ../../library/venv.rst:389 +#: ../../library/venv.rst:321 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:204 ../../library/venv.rst:392 +#: ../../library/venv.rst:324 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:207 ../../library/venv.rst:395 +#: ../../library/venv.rst:327 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:210 ../../library/venv.rst:398 +#: ../../library/venv.rst:330 #, fuzzy msgid "Added the ``scm_ignore_files`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:213 -msgid "" -"Creators of third-party virtual environment tools will be free to use the " -"provided :class:`EnvBuilder` class as a base class." +#: ../../library/venv.rst:333 +msgid ":class:`EnvBuilder` may be used as a base class." msgstr "" -"第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 base " -"class(基底類別)使用." - -#: ../../library/venv.rst:216 -msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" -#: ../../library/venv.rst:220 +#: ../../library/venv.rst:337 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -647,7 +641,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:226 +#: ../../library/venv.rst:343 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -655,7 +649,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:229 +#: ../../library/venv.rst:346 msgid "" "def create(self, env_dir):\n" " \"\"\"\n" @@ -670,7 +664,7 @@ msgid "" " self.post_setup(context)" msgstr "" -#: ../../library/venv.rst:241 +#: ../../library/venv.rst:358 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -679,7 +673,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:364 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -693,7 +687,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:254 +#: ../../library/venv.rst:371 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -701,81 +695,81 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:257 +#: ../../library/venv.rst:374 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:260 +#: ../../library/venv.rst:377 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:263 +#: ../../library/venv.rst:380 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:266 +#: ../../library/venv.rst:383 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " "created from another virtual environment." msgstr "" -#: ../../library/venv.rst:270 +#: ../../library/venv.rst:387 msgid "``inc_path`` - The include path for the virtual environment." msgstr "" -#: ../../library/venv.rst:272 +#: ../../library/venv.rst:389 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "" -#: ../../library/venv.rst:274 +#: ../../library/venv.rst:391 msgid "``bin_path`` - The script path for the virtual environment." msgstr "" -#: ../../library/venv.rst:276 +#: ../../library/venv.rst:393 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " "(see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:280 +#: ../../library/venv.rst:397 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" "`install_scripts`)." msgstr "" -#: ../../library/venv.rst:284 +#: ../../library/venv.rst:401 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " "environment." msgstr "" -#: ../../library/venv.rst:289 +#: ../../library/venv.rst:406 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." msgstr "" -#: ../../library/venv.rst:294 +#: ../../library/venv.rst:411 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "" -#: ../../library/venv.rst:300 +#: ../../library/venv.rst:417 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "" -#: ../../library/venv.rst:304 +#: ../../library/venv.rst:421 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -783,120 +777,144 @@ msgid "" "unless files with those names already exist." msgstr "" -#: ../../library/venv.rst:311 +#: ../../library/venv.rst:428 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "" -#: ../../library/venv.rst:316 +#: ../../library/venv.rst:433 msgid "" -"Upgrades the core venv dependency packages (currently ``pip``) in the " +"Upgrades the core venv dependency packages (currently :pypi:`pip`) in the " "environment. This is done by shelling out to the ``pip`` executable in the " "environment." msgstr "" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:440 +msgid ":pypi:`setuptools` is no longer a core venv dependency." +msgstr "" + +#: ../../library/venv.rst:444 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:331 -msgid "" -"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " -"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " -"running from a build in the source tree." -msgstr "" - -#: ../../library/venv.rst:336 +#: ../../library/venv.rst:450 msgid "" -"Windows copies the redirector scripts as part of :meth:`setup_python` " -"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " -"symlinks, the original executables will be linked." -msgstr "" - -#: ../../library/venv.rst:341 -msgid "" -"In addition, :class:`EnvBuilder` provides this utility method that can be " -"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " -"assist in installing custom scripts into the virtual environment." +"This method can be called from :meth:`setup_scripts` or :meth:`post_setup` " +"in subclasses to assist in installing custom scripts into the virtual " +"environment." msgstr "" -#: ../../library/venv.rst:347 +#: ../../library/venv.rst:454 msgid "" "*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:" +"``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:" msgstr "" -#: ../../library/venv.rst:353 +#: ../../library/venv.rst:460 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:356 +#: ../../library/venv.rst:463 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:359 +#: ../../library/venv.rst:466 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:362 +#: ../../library/venv.rst:469 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:365 +#: ../../library/venv.rst:472 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:368 +#: ../../library/venv.rst:475 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:373 +#: ../../library/venv.rst:480 msgid "" "Creates a ``.gitignore`` file within the virtual environment that causes the " -"entire directory to be ignored by the ``git`` source control manager." +"entire directory to be ignored by the Git source control manager." msgstr "" -#: ../../library/venv.rst:378 +#: ../../library/venv.rst:485 +msgid "" +"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " +"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " +"running from a build in the source tree." +msgstr "" + +#: ../../library/venv.rst:490 +msgid "" +"Windows copies the redirector scripts as part of :meth:`setup_python` " +"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " +"symlinks, the original executables will be linked." +msgstr "" + +#: ../../library/venv.rst:495 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:384 +#: ../../library/venv.rst:501 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:402 +#: ../../library/venv.rst:506 +#, fuzzy +msgid "Added the *with_pip* parameter" +msgstr "新增 ``with_pip`` 參數" + +#: ../../library/venv.rst:509 +#, fuzzy +msgid "Added the *prompt* parameter" +msgstr "新增 ``prompt`` 參數" + +#: ../../library/venv.rst:512 +#, fuzzy +msgid "Added the *upgrade_deps* parameter" +msgstr "新增 ``upgrade_deps`` 參數" + +#: ../../library/venv.rst:515 +#, fuzzy +msgid "Added the *scm_ignore_files* parameter" +msgstr "新增 ``upgrade_deps`` 參數" + +#: ../../library/venv.rst:519 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:404 +#: ../../library/venv.rst:521 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:407 +#: ../../library/venv.rst:524 msgid "" "import os\n" "import os.path\n" @@ -1112,7 +1130,7 @@ msgid "" " sys.exit(rc)" msgstr "" -#: ../../library/venv.rst:615 +#: ../../library/venv.rst:732 msgid "" "This script is also available for download `online `_." @@ -1126,6 +1144,30 @@ msgstr "Environments (環境)" msgid "virtual" msgstr "virtual (虛擬)" +#~ msgid "c:\\>Python35\\python -m venv c:\\path\\to\\myenv" +#~ msgstr "c:\\>Python35\\python -m venv c:\\path\\to\\myenv" + +#~ msgid "" +#~ "Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables " +#~ "for your :ref:`Python installation `::" +#~ msgstr "" +#~ "或者,如你已經為你的 :ref:`Python 安裝 `\\ 配置了 " +#~ "``PATH`` 和 ``PATHEXT`` 變數,則可以執行以下命令:" + +#~ msgid "c:\\>python -m venv c:\\path\\to\\myenv" +#~ msgstr "c:\\>python -m venv c:\\path\\to\\myenv" + +#~ msgid "" +#~ "Creators of third-party virtual environment tools will be free to use the " +#~ "provided :class:`EnvBuilder` class as a base class." +#~ msgstr "" +#~ "第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 " +#~ "base class(基底類別)使用." + +#~ msgid "" +#~ "The returned env-builder is an object which has a method, ``create``:" +#~ msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" + #, fuzzy #~ msgid "" #~ "This module does not work or is not available on WebAssembly platforms, " diff --git a/library/warnings.po b/library/warnings.po index 702e2744ea..478f1f072c 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -912,7 +912,13 @@ msgid "" "context." msgstr "" -#: ../../library/warnings.rst:600 +#: ../../library/warnings.rst:598 +msgid "" +"See :ref:`warning-filter` for the meaning of the *category* and *lineno* " +"parameters." +msgstr "" + +#: ../../library/warnings.rst:603 msgid "" "The :class:`catch_warnings` manager works by replacing and then later " "restoring the module's :func:`showwarning` function and internal list of " @@ -920,7 +926,7 @@ msgid "" "state and therefore is not thread-safe." msgstr "" -#: ../../library/warnings.rst:608 +#: ../../library/warnings.rst:611 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." msgstr "新增 *action*、*category*、*lineno* 和 *append* 參數。" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 442b455961..54d29a5210 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -610,8 +610,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1541 -#: ../../reference/compound_stmts.rst:1582 +#: ../../reference/compound_stmts.rst:1547 +#: ../../reference/compound_stmts.rst:1588 msgid "The following code::" msgstr "" @@ -625,7 +625,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:531 #: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1587 +#: ../../reference/compound_stmts.rst:1593 msgid "is semantically equivalent to::" msgstr "" @@ -1543,7 +1543,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1878 msgid ":class:`list`" msgstr ":class:`list`" @@ -1556,7 +1556,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1875 +#: ../../reference/compound_stmts.rst:1881 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1606,7 +1606,7 @@ msgid "" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1227 +#: ../../reference/compound_stmts.rst:1228 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 " @@ -1615,13 +1615,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1233 +#: ../../reference/compound_stmts.rst:1234 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1240 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1632,7 +1632,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1246 +#: ../../reference/compound_stmts.rst:1247 msgid "" "@f1(arg)\n" "@f2\n" @@ -1642,12 +1642,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1250 -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1251 +#: ../../reference/compound_stmts.rst:1446 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1252 +#: ../../reference/compound_stmts.rst:1253 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1655,20 +1655,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1255 +#: ../../reference/compound_stmts.rst:1256 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1257 +#: ../../reference/compound_stmts.rst:1258 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:1263 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1678,12 +1678,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1269 -#: ../../reference/compound_stmts.rst:1459 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1465 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1277 +#: ../../reference/compound_stmts.rst:1278 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1694,7 +1694,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1285 +#: ../../reference/compound_stmts.rst:1286 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1707,7 +1707,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1295 +#: ../../reference/compound_stmts.rst:1296 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1716,7 +1716,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1306 +#: ../../reference/compound_stmts.rst:1307 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1732,31 +1732,39 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1319 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1327 +#: ../../reference/compound_stmts.rst:1328 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " -"an annotation, even those of the form ``*identifier`` or ``**identifier``. " -"Functions may have \"return\" annotation of the form \"``-> expression``\" " -"after the parameter list. These annotations can be any valid Python " -"expression. The presence of annotations does not change the semantics of a " -"function. The annotation values are available as values of a dictionary " -"keyed by the parameters' names in the :attr:`__annotations__` attribute of " -"the function object. If the ``annotations`` import from :mod:`__future__` " -"is used, annotations are preserved as strings at runtime which enables " -"postponed evaluation. Otherwise, they are evaluated when the function " -"definition is executed. In this case annotations may be evaluated in a " -"different order than they appear in the source code." +"an annotation, even those of the form ``*identifier`` or ``**identifier``. " +"(As a special case, parameters of the form ``*identifier`` may have an " +"annotation \"``: *expression``\".) Functions may have \"return\" annotation " +"of the form \"``-> expression``\" after the parameter list. These " +"annotations can be any valid Python expression. The presence of annotations " +"does not change the semantics of a function. The annotation values are " +"available as values of a dictionary keyed by the parameters' names in the :" +"attr:`__annotations__` attribute of the function object. If the " +"``annotations`` import from :mod:`__future__` is used, annotations are " +"preserved as strings at runtime which enables postponed evaluation. " +"Otherwise, they are evaluated when the function definition is executed. In " +"this case annotations may be evaluated in a different order than they appear " +"in the source code." msgstr "" #: ../../reference/compound_stmts.rst:1342 msgid "" +"Parameters of the form \"``*identifier``\" may have an annotation \"``: " +"*expression``\". See :pep:`646`." +msgstr "" + +#: ../../reference/compound_stmts.rst:1348 +msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " "described in section :ref:`lambda`. Note that the lambda expression is " @@ -1767,7 +1775,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1356 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1776,61 +1784,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1359 +#: ../../reference/compound_stmts.rst:1365 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1362 +#: ../../reference/compound_stmts.rst:1368 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1370 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1371 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1374 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1369 +#: ../../reference/compound_stmts.rst:1375 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:1372 +#: ../../reference/compound_stmts.rst:1378 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1373 +#: ../../reference/compound_stmts.rst:1379 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1385 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1394 +#: ../../reference/compound_stmts.rst:1400 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1401 +#: ../../reference/compound_stmts.rst:1407 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1839,7 +1847,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1407 +#: ../../reference/compound_stmts.rst:1413 msgid "" "class Foo:\n" " pass" @@ -1847,11 +1855,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1410 +#: ../../reference/compound_stmts.rst:1416 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1412 +#: ../../reference/compound_stmts.rst:1418 msgid "" "class Foo(object):\n" " pass" @@ -1859,7 +1867,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1415 +#: ../../reference/compound_stmts.rst:1421 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 " @@ -1871,25 +1879,25 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1430 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 " -"the class is created and only for classes that were defined using the " -"definition syntax." +"the new class's :attr:`~type.__dict__`. Note that this is reliable only " +"right after the class is created and only for classes that were defined " +"using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1429 +#: ../../reference/compound_stmts.rst:1435 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1434 +#: ../../reference/compound_stmts.rst:1440 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1436 +#: ../../reference/compound_stmts.rst:1442 msgid "" "@f1(arg)\n" "@f2\n" @@ -1899,7 +1907,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1448 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1907,29 +1915,29 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1445 +#: ../../reference/compound_stmts.rst:1451 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:1448 +#: ../../reference/compound_stmts.rst:1454 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:1453 +#: ../../reference/compound_stmts.rst:1459 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " "checkers that the class is generic. At runtime, the type parameters can be " -"retrieved from the class's ``__type_params__`` attribute. See :ref:`generic-" -"classes` for more." +"retrieved from the class's :attr:`~type.__type_params__` attribute. See :ref:" +"`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1462 +#: ../../reference/compound_stmts.rst:1468 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1942,35 +1950,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1474 +#: ../../reference/compound_stmts.rst:1480 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1475 +#: ../../reference/compound_stmts.rst:1481 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:1479 +#: ../../reference/compound_stmts.rst:1485 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1486 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1487 +#: ../../reference/compound_stmts.rst:1493 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1495 +#: ../../reference/compound_stmts.rst:1501 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1511 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1978,23 +1986,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1509 +#: ../../reference/compound_stmts.rst:1515 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:1512 +#: ../../reference/compound_stmts.rst:1518 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1521 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1517 +#: ../../reference/compound_stmts.rst:1523 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2004,30 +2012,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1527 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:1529 +#: ../../reference/compound_stmts.rst:1535 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1534 +#: ../../reference/compound_stmts.rst:1540 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:1538 +#: ../../reference/compound_stmts.rst:1544 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1543 +#: ../../reference/compound_stmts.rst:1549 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2039,11 +2047,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1548 +#: ../../reference/compound_stmts.rst:1554 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1550 +#: ../../reference/compound_stmts.rst:1556 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2073,28 +2081,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1564 +#: ../../reference/compound_stmts.rst:1570 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1566 +#: ../../reference/compound_stmts.rst:1572 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1574 +#: ../../reference/compound_stmts.rst:1580 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1579 +#: ../../reference/compound_stmts.rst:1585 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:1584 +#: ../../reference/compound_stmts.rst:1590 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2102,7 +2110,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1589 +#: ../../reference/compound_stmts.rst:1595 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2138,44 +2146,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1606 +#: ../../reference/compound_stmts.rst:1612 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1608 +#: ../../reference/compound_stmts.rst:1614 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1619 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1620 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1626 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1630 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1637 +#: ../../reference/compound_stmts.rst:1643 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1641 +#: ../../reference/compound_stmts.rst:1647 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2207,7 +2215,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1656 +#: ../../reference/compound_stmts.rst:1662 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2215,7 +2223,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1661 +#: ../../reference/compound_stmts.rst:1667 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2227,36 +2235,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1670 +#: ../../reference/compound_stmts.rst:1676 msgid "" -"Generic functions, classes, and type aliases have a :attr:`!__type_params__` " -"attribute listing their type parameters." +"Generic functions, classes, and type aliases have a :attr:`~definition." +"__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1679 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1675 +#: ../../reference/compound_stmts.rst:1681 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1677 +#: ../../reference/compound_stmts.rst:1683 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1680 +#: ../../reference/compound_stmts.rst:1686 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1683 +#: ../../reference/compound_stmts.rst:1689 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2268,7 +2276,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1692 +#: ../../reference/compound_stmts.rst:1698 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2278,13 +2286,13 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1698 +#: ../../reference/compound_stmts.rst:1704 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1701 +#: ../../reference/compound_stmts.rst:1707 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2297,13 +2305,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1711 +#: ../../reference/compound_stmts.rst:1717 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1713 +#: ../../reference/compound_stmts.rst:1719 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2335,24 +2343,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1731 +#: ../../reference/compound_stmts.rst:1737 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1733 +#: ../../reference/compound_stmts.rst:1739 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1735 +#: ../../reference/compound_stmts.rst:1741 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1737 -#: ../../reference/compound_stmts.rst:1797 +#: ../../reference/compound_stmts.rst:1743 +#: ../../reference/compound_stmts.rst:1803 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1739 +#: ../../reference/compound_stmts.rst:1745 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2368,7 +2376,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1746 +#: ../../reference/compound_stmts.rst:1752 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -2377,20 +2385,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1752 +#: ../../reference/compound_stmts.rst:1758 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1756 +#: ../../reference/compound_stmts.rst:1762 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1759 +#: ../../reference/compound_stmts.rst:1765 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2400,13 +2408,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1763 +#: ../../reference/compound_stmts.rst:1769 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1766 +#: ../../reference/compound_stmts.rst:1772 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2428,25 +2436,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1785 +#: ../../reference/compound_stmts.rst:1791 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1791 +#: ../../reference/compound_stmts.rst:1797 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1793 +#: ../../reference/compound_stmts.rst:1799 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1795 +#: ../../reference/compound_stmts.rst:1801 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1799 +#: ../../reference/compound_stmts.rst:1805 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2464,14 +2472,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1807 +#: ../../reference/compound_stmts.rst:1813 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1811 +#: ../../reference/compound_stmts.rst:1817 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2479,7 +2487,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1823 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2487,11 +2495,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1820 +#: ../../reference/compound_stmts.rst:1826 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1822 +#: ../../reference/compound_stmts.rst:1828 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2509,27 +2517,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1833 +#: ../../reference/compound_stmts.rst:1839 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1835 +#: ../../reference/compound_stmts.rst:1841 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1837 +#: ../../reference/compound_stmts.rst:1843 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1845 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1848 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2542,109 +2550,109 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1851 +#: ../../reference/compound_stmts.rst:1857 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1856 +#: ../../reference/compound_stmts.rst:1862 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1857 +#: ../../reference/compound_stmts.rst:1863 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:1861 +#: ../../reference/compound_stmts.rst:1867 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1869 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1864 +#: ../../reference/compound_stmts.rst:1870 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1865 +#: ../../reference/compound_stmts.rst:1871 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1866 -#: ../../reference/compound_stmts.rst:1885 +#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1891 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1874 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1870 +#: ../../reference/compound_stmts.rst:1876 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1877 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1873 +#: ../../reference/compound_stmts.rst:1879 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1880 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1883 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1886 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1882 +#: ../../reference/compound_stmts.rst:1888 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1889 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1884 +#: ../../reference/compound_stmts.rst:1890 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1887 +#: ../../reference/compound_stmts.rst:1893 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1896 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1894 +#: ../../reference/compound_stmts.rst:1900 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 :" -"term:`docstring`." +"transformed into the namespace's :attr:`~type.__doc__` item and therefore " +"the class's :term:`docstring`." msgstr "" #: ../../reference/compound_stmts.rst:7 @@ -2662,10 +2670,10 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 -#: ../../reference/compound_stmts.rst:1491 -#: ../../reference/compound_stmts.rst:1525 -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1576 msgid "statement" msgstr "statement(陳述式)" @@ -2713,7 +2721,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1507 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2727,8 +2735,8 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1322 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1387 msgid ": (colon)" msgstr ": (冒號)" @@ -2738,7 +2746,7 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2784,7 +2792,7 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "object" msgstr "object(物件)" @@ -2855,7 +2863,7 @@ msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid ", (comma)" msgstr ", (逗號)" @@ -2896,15 +2904,15 @@ msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" #: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1273 msgid "parameter" msgstr "parameter(參數)" #: ../../reference/compound_stmts.rst:1186 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1236 -#: ../../reference/compound_stmts.rst:1272 -#: ../../reference/compound_stmts.rst:1301 +#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1302 msgid "function definition" msgstr "function definition(函式定義)" @@ -2913,22 +2921,22 @@ msgid "def" msgstr "def" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1322 +#: ../../reference/compound_stmts.rst:1323 msgid "function" msgstr "function (函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "definition" msgstr "definition(定義)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "name" msgstr "name(名稱)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "binding" msgstr "binding(綁定)" @@ -2937,7 +2945,7 @@ msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2945,108 +2953,108 @@ msgstr "() (圓括號)" msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1236 -#: ../../reference/compound_stmts.rst:1431 +#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1437 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1273 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1273 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1273 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1273 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1301 +#: ../../reference/compound_stmts.rst:1302 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1301 +#: ../../reference/compound_stmts.rst:1302 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1301 +#: ../../reference/compound_stmts.rst:1302 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1322 +#: ../../reference/compound_stmts.rst:1323 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1322 +#: ../../reference/compound_stmts.rst:1323 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1322 +#: ../../reference/compound_stmts.rst:1323 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1340 +#: ../../reference/compound_stmts.rst:1346 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1340 +#: ../../reference/compound_stmts.rst:1346 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1381 -#: ../../reference/compound_stmts.rst:1431 +#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1437 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1381 +#: ../../reference/compound_stmts.rst:1387 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1491 +#: ../../reference/compound_stmts.rst:1497 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1507 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1507 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1525 +#: ../../reference/compound_stmts.rst:1531 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1576 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1633 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index d9ac935995..145ac09302 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -604,16 +604,18 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1133 -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1206 +#: ../../reference/datamodel.rst:1403 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" #: ../../reference/datamodel.rst:555 ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:981 msgid "Attribute" msgstr "屬性" #: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:982 msgid "Meaning" msgstr "含義" @@ -636,7 +638,7 @@ msgid "" "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:571 ../../reference/datamodel.rst:1372 +#: ../../reference/datamodel.rst:571 ../../reference/datamodel.rst:1445 msgid "Special writable attributes" msgstr "特殊可寫屬性" @@ -645,49 +647,50 @@ msgid "Most of these attributes check the type of the assigned value:" msgstr "" #: ../../reference/datamodel.rst:593 -msgid "" -"The function's documentation string, or ``None`` if unavailable. Not " -"inherited by subclasses." +#, fuzzy +msgid "The function's documentation string, or ``None`` if unavailable." msgstr "" +":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" +"`function.__doc__`。" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:596 msgid "" "The function's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:601 +#: ../../reference/datamodel.rst:600 msgid "" "The function's :term:`qualified name`. See also: :attr:`__qualname__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:607 +#: ../../reference/datamodel.rst:606 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:611 +#: ../../reference/datamodel.rst:610 msgid "" "A :class:`tuple` containing default :term:`parameter` values for those " "parameters that have defaults, or ``None`` if no parameters have a default " "value." msgstr "" -#: ../../reference/datamodel.rst:616 +#: ../../reference/datamodel.rst:615 msgid "" "The :ref:`code object ` representing the compiled function " "body." msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" -#: ../../reference/datamodel.rst:620 +#: ../../reference/datamodel.rst:619 msgid "" "The namespace supporting arbitrary function attributes. See also: :attr:" "`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:624 +#: ../../reference/datamodel.rst:623 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " @@ -695,88 +698,88 @@ msgid "" "`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:631 +#: ../../reference/datamodel.rst:630 msgid "" "A :class:`dictionary ` containing defaults for keyword-only :term:" "`parameters `." msgstr "" -#: ../../reference/datamodel.rst:635 +#: ../../reference/datamodel.rst:634 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic function `." msgstr "" -#: ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:639 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " "attribute dot-notation is used to get and set such attributes." msgstr "" -#: ../../reference/datamodel.rst:646 +#: ../../reference/datamodel.rst:645 msgid "" "CPython's current implementation only supports function attributes on user-" "defined functions. Function attributes on :ref:`built-in functions ` may be supported in the future." msgstr "" -#: ../../reference/datamodel.rst:651 +#: ../../reference/datamodel.rst:650 msgid "" "Additional information about a function's definition can be retrieved from " "its :ref:`code object ` (accessible via the :attr:`~function." "__code__` attribute)." msgstr "" -#: ../../reference/datamodel.rst:659 +#: ../../reference/datamodel.rst:658 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:666 +#: ../../reference/datamodel.rst:665 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:676 ../../reference/datamodel.rst:1468 +#: ../../reference/datamodel.rst:675 ../../reference/datamodel.rst:1541 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:680 msgid "" "Refers to the class instance object to which the method is :ref:`bound " "`" msgstr "" -#: ../../reference/datamodel.rst:685 +#: ../../reference/datamodel.rst:684 msgid "Refers to the original :ref:`function object `" msgstr "" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:687 msgid "" "The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" -#: ../../reference/datamodel.rst:694 +#: ../../reference/datamodel.rst:693 msgid "" "The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" -#: ../../reference/datamodel.rst:698 +#: ../../reference/datamodel.rst:697 msgid "" "The name of the module the method was defined in, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:701 +#: ../../reference/datamodel.rst:700 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:704 +#: ../../reference/datamodel.rst:703 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" @@ -784,7 +787,7 @@ msgid "" "`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:711 +#: ../../reference/datamodel.rst:710 msgid "" "When an instance method object is created by retrieving a user-defined :ref:" "`function object ` from a class via one of its " @@ -793,7 +796,7 @@ msgid "" "__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:716 msgid "" "When an instance method object is created by retrieving a :class:" "`classmethod` object from a class or instance, its :attr:`~method.__self__` " @@ -801,7 +804,7 @@ msgid "" "the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:722 +#: ../../reference/datamodel.rst:721 msgid "" "When an instance method object is called, the underlying function (:attr:" "`~method.__func__`) is called, inserting the class instance (:attr:`~method." @@ -811,7 +814,7 @@ msgid "" "f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:728 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " @@ -820,18 +823,18 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:734 +#: ../../reference/datamodel.rst:733 msgid "" "It is important to note that user-defined functions which are attributes of " "a class instance are not converted to bound methods; this *only* happens " "when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:741 +#: ../../reference/datamodel.rst:740 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:747 +#: ../../reference/datamodel.rst:746 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -844,11 +847,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:759 +#: ../../reference/datamodel.rst:758 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:764 +#: ../../reference/datamodel.rst:763 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -857,11 +860,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:772 +#: ../../reference/datamodel.rst:771 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:777 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -870,7 +873,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:784 +#: ../../reference/datamodel.rst:783 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -881,11 +884,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:797 +#: ../../reference/datamodel.rst:796 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:804 +#: ../../reference/datamodel.rst:803 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -893,7 +896,7 @@ msgid "" "determined by the C function. Special read-only attributes:" msgstr "" -#: ../../reference/datamodel.rst:809 +#: ../../reference/datamodel.rst:808 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." @@ -901,26 +904,26 @@ msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:810 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" -#: ../../reference/datamodel.rst:812 +#: ../../reference/datamodel.rst:811 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." msgstr "" -#: ../../reference/datamodel.rst:813 +#: ../../reference/datamodel.rst:812 msgid "" ":attr:`!__module__` is the name of the module the function was defined in or " "``None`` if unavailable. See :attr:`function.__module__`." msgstr "" -#: ../../reference/datamodel.rst:821 +#: ../../reference/datamodel.rst:820 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:828 +#: ../../reference/datamodel.rst:827 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -991,7 +994,7 @@ msgstr ":attr:`__name__`" msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:888 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:888 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" @@ -1012,7 +1015,7 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:901 ../../reference/datamodel.rst:991 +#: ../../reference/datamodel.rst:901 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" @@ -1037,11 +1040,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:921 +#: ../../reference/datamodel.rst:923 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:923 +#: ../../reference/datamodel.rst:925 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1056,7 +1059,7 @@ msgid "" "found at :ref:`python_2.3_mro`." msgstr "" -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:946 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1067,104 +1070,137 @@ msgid "" "contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:955 +#: ../../reference/datamodel.rst:957 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:960 +#: ../../reference/datamodel.rst:962 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:973 -msgid "Special attributes:" -msgstr "" - -#: ../../reference/datamodel.rst:975 -msgid ":attr:`~definition.__name__`" -msgstr ":attr:`~definition.__name__`" +#: ../../reference/datamodel.rst:965 ../../reference/datamodel.rst:1112 +#, fuzzy +msgid "Special attributes" +msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:976 -msgid "The class name." +#: ../../reference/datamodel.rst:985 +msgid "" +"The class's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:978 -msgid ":attr:`__module__`" -msgstr ":attr:`__module__`" +#: ../../reference/datamodel.rst:989 +msgid "" +"The class's :term:`qualified name`. See also: :attr:`__qualname__ attributes " +"`." +msgstr "" -#: ../../reference/datamodel.rst:979 +#: ../../reference/datamodel.rst:993 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:981 -msgid ":attr:`~object.__dict__`" -msgstr ":attr:`~object.__dict__`" +#: ../../reference/datamodel.rst:996 +msgid "" +"A :class:`mapping proxy ` providing a read-only view " +"of the class's namespace. See also: :attr:`__dict__ attributes `." +msgstr "" -#: ../../reference/datamodel.rst:982 -msgid "The dictionary containing the class's namespace." +#: ../../reference/datamodel.rst:1001 +msgid "" +"A :class:`tuple` containing the class's bases. In most cases, for a class " +"defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to " +"``(A, B, C)``." msgstr "" -#: ../../reference/datamodel.rst:984 -msgid ":attr:`~class.__bases__`" -msgstr ":attr:`~class.__bases__`" +#: ../../reference/datamodel.rst:1006 +msgid "" +"The class's documentation string, or ``None`` if undefined. Not inherited by " +"subclasses." +msgstr "" -#: ../../reference/datamodel.rst:985 +#: ../../reference/datamodel.rst:1010 msgid "" -"A tuple containing the base classes, in the order of their occurrence in the " -"base class list." +"A dictionary containing :term:`variable annotations ` " +"collected during class body execution. For best practices on working with :" +"attr:`!__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:989 -msgid "The class's documentation string, or ``None`` if undefined." +#: ../../reference/datamodel.rst:1017 +msgid "" +"Accessing the :attr:`!__annotations__` attribute of a class object directly " +"may yield incorrect results in the presence of metaclasses. In addition, the " +"attribute may not exist for some classes. Use :func:`inspect." +"get_annotations` to retrieve class annotations safely." msgstr "" -#: ../../reference/datamodel.rst:992 +#: ../../reference/datamodel.rst:1024 msgid "" -"A dictionary containing :term:`variable annotations ` " -"collected during class body execution. For best practices on working with :" -"attr:`__annotations__`, please see :ref:`annotations-howto`." +"A :class:`tuple` containing the :ref:`type parameters ` of a :" +"ref:`generic class `." +msgstr "" + +#: ../../reference/datamodel.rst:1030 +msgid "" +"A :class:`tuple` containing names of attributes of this class which are " +"assigned through ``self.X`` from any function in its body." msgstr "" -#: ../../reference/datamodel.rst:998 -msgid ":attr:`__type_params__`" -msgstr ":attr:`__type_params__`" +#: ../../reference/datamodel.rst:1036 +msgid "" +"The line number of the first line of the class definition, including " +"decorators. Setting the :attr:`__module__` attribute removes the :attr:`!" +"__firstlineno__` item from the type's dictionary." +msgstr "" -#: ../../reference/datamodel.rst:999 +#: ../../reference/datamodel.rst:1044 msgid "" -"A tuple containing the :ref:`type parameters ` of a :ref:" -"`generic class `." +"The :class:`tuple` of classes that are considered when looking for base " +"classes during method resolution." msgstr "" -#: ../../reference/datamodel.rst:1002 +#: ../../reference/datamodel.rst:1049 #, fuzzy -msgid ":attr:`~class.__static_attributes__`" -msgstr ":attr:`~class.__bases__`" +msgid "Special methods" +msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:1003 +#: ../../reference/datamodel.rst:1051 msgid "" -"A tuple containing names of attributes of this class which are assigned " -"through ``self.X`` from any function in its body." +"In addition to the special attributes described above, all Python classes " +"also have the following two methods available:" msgstr "" -#: ../../reference/datamodel.rst:1006 -#, fuzzy -msgid ":attr:`__firstlineno__`" -msgstr ":attr:`__file__`" +#: ../../reference/datamodel.rst:1056 +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:`~type.__mro__`." +msgstr "" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1062 msgid "" -"The line number of the first line of the class definition, including " -"decorators." +"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 "" + +#: ../../reference/datamodel.rst:1066 +msgid "" +">>> class A: pass\n" +">>> class B(A): pass\n" +">>> A.__subclasses__()\n" +"[]" msgstr "" -#: ../../reference/datamodel.rst:1011 +#: ../../reference/datamodel.rst:1074 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:1019 +#: ../../reference/datamodel.rst:1082 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1181,7 +1217,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:1035 +#: ../../reference/datamodel.rst:1098 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1189,23 +1225,28 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1045 +#: ../../reference/datamodel.rst:1108 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1052 +#: ../../reference/datamodel.rst:1120 +msgid "The class to which a class instance belongs." +msgstr "" + +#: ../../reference/datamodel.rst:1124 msgid "" -"Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" -"attr:`~instance.__class__` is the instance's class." +"A dictionary or other mapping object used to store an object's (writable) " +"attributes. Not all instances have a :attr:`!__dict__` attribute; see the " +"section on :ref:`slots` for more details." msgstr "" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1130 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1072 +#: ../../reference/datamodel.rst:1145 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1214,7 +1255,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1078 +#: ../../reference/datamodel.rst:1151 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1222,22 +1263,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1086 +#: ../../reference/datamodel.rst:1159 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1165 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:1173 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:1177 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1249,103 +1290,103 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1211 msgid "The function name" msgstr "函式名稱" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1214 msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1146 +#: ../../reference/datamodel.rst:1219 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1224 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1155 +#: ../../reference/datamodel.rst:1228 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1159 +#: ../../reference/datamodel.rst:1232 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1163 +#: ../../reference/datamodel.rst:1236 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1240 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " "that are referenced by nested functions inside the function" msgstr "" -#: ../../reference/datamodel.rst:1171 +#: ../../reference/datamodel.rst:1244 msgid "A :class:`tuple` containing the names of free variables in the function" msgstr "" -#: ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1247 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1178 +#: ../../reference/datamodel.rst:1251 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1182 +#: ../../reference/datamodel.rst:1255 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1259 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1262 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1192 +#: ../../reference/datamodel.rst:1265 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1268 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.14." msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1273 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1203 +#: ../../reference/datamodel.rst:1276 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1281 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1356,7 +1397,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1216 +#: ../../reference/datamodel.rst:1289 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`~codeobject.co_flags` to indicate whether a code object was " @@ -1365,29 +1406,29 @@ msgid "" "``0x1000`` were used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1222 +#: ../../reference/datamodel.rst:1295 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1226 +#: ../../reference/datamodel.rst:1299 msgid "" "If a code object represents a function, the first item in :attr:`~codeobject." "co_consts` is the documentation string of the function, or ``None`` if " "undefined." msgstr "" -#: ../../reference/datamodel.rst:1231 +#: ../../reference/datamodel.rst:1304 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1235 +#: ../../reference/datamodel.rst:1308 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1238 +#: ../../reference/datamodel.rst:1311 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1395,37 +1436,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1244 +#: ../../reference/datamodel.rst:1317 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1320 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1248 +#: ../../reference/datamodel.rst:1321 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1249 +#: ../../reference/datamodel.rst:1322 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1250 +#: ../../reference/datamodel.rst:1323 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:1326 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1332 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1435,100 +1476,100 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1268 +#: ../../reference/datamodel.rst:1341 msgid "" "Returns an iterator that yields information about successive ranges of :term:" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1345 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1274 +#: ../../reference/datamodel.rst:1347 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1349 msgid "" "``lineno`` is an :class:`int` representing the line number of the :term:" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" -#: ../../reference/datamodel.rst:1280 +#: ../../reference/datamodel.rst:1353 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1355 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1283 +#: ../../reference/datamodel.rst:1356 msgid "" "The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" -#: ../../reference/datamodel.rst:1286 +#: ../../reference/datamodel.rst:1359 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1287 +#: ../../reference/datamodel.rst:1360 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1363 msgid "" "Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" -#: ../../reference/datamodel.rst:1298 +#: ../../reference/datamodel.rst:1371 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1372 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1303 +#: ../../reference/datamodel.rst:1376 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1378 msgid "" "Code objects are also supported by the generic function :func:`copy.replace`." msgstr "" -#: ../../reference/datamodel.rst:1313 +#: ../../reference/datamodel.rst:1386 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1317 +#: ../../reference/datamodel.rst:1390 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1335 +#: ../../reference/datamodel.rst:1408 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1339 +#: ../../reference/datamodel.rst:1412 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1538,55 +1579,55 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1417 msgid "" "The mapping used by the frame to look up :ref:`local variables `. If " "the frame refers to an :term:`optimized scope`, this may return a write-" "through proxy object." msgstr "" -#: ../../reference/datamodel.rst:1349 +#: ../../reference/datamodel.rst:1422 msgid "Return a proxy for optimized scopes." msgstr "" -#: ../../reference/datamodel.rst:1353 +#: ../../reference/datamodel.rst:1426 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1357 +#: ../../reference/datamodel.rst:1430 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1361 +#: ../../reference/datamodel.rst:1434 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1377 +#: ../../reference/datamodel.rst:1450 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1455 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1386 +#: ../../reference/datamodel.rst:1459 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1392 +#: ../../reference/datamodel.rst:1465 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1594,15 +1635,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1398 +#: ../../reference/datamodel.rst:1471 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1400 +#: ../../reference/datamodel.rst:1473 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1404 +#: ../../reference/datamodel.rst:1477 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1611,34 +1652,34 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1410 +#: ../../reference/datamodel.rst:1483 msgid "" ":exc:`RuntimeError` is raised if the frame is currently executing or " "suspended." msgstr "" -#: ../../reference/datamodel.rst:1415 +#: ../../reference/datamodel.rst:1488 msgid "" "Attempting to clear a suspended frame raises :exc:`RuntimeError` (as has " "always been the case for executing frames)." msgstr "" -#: ../../reference/datamodel.rst:1423 +#: ../../reference/datamodel.rst:1496 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1509 msgid "" "Traceback objects represent the stack trace of an :ref:`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:1441 +#: ../../reference/datamodel.rst:1514 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:1517 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1649,7 +1690,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1526 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1657,19 +1698,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1458 +#: ../../reference/datamodel.rst:1531 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1546 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1476 +#: ../../reference/datamodel.rst:1549 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1677,15 +1718,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1481 +#: ../../reference/datamodel.rst:1554 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1484 +#: ../../reference/datamodel.rst:1557 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1486 +#: ../../reference/datamodel.rst:1559 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1693,39 +1734,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1497 +#: ../../reference/datamodel.rst:1570 msgid "" "The 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:1501 +#: ../../reference/datamodel.rst:1574 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1506 +#: ../../reference/datamodel.rst:1579 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1510 +#: ../../reference/datamodel.rst:1583 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:1519 +#: ../../reference/datamodel.rst:1592 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:1523 +#: ../../reference/datamodel.rst:1596 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1527 +#: ../../reference/datamodel.rst:1600 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1735,11 +1776,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1536 +#: ../../reference/datamodel.rst:1609 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1538 +#: ../../reference/datamodel.rst:1611 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1750,11 +1791,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1548 +#: ../../reference/datamodel.rst:1621 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1550 +#: ../../reference/datamodel.rst:1623 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 " @@ -1764,11 +1805,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1560 +#: ../../reference/datamodel.rst:1633 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1566 +#: ../../reference/datamodel.rst:1639 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1782,7 +1823,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1650 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1791,7 +1832,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1656 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 " @@ -1801,11 +1842,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1667 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1600 +#: ../../reference/datamodel.rst:1673 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 " @@ -1815,7 +1856,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1607 +#: ../../reference/datamodel.rst:1680 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1823,7 +1864,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1612 +#: ../../reference/datamodel.rst:1685 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 " @@ -1832,13 +1873,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1617 +#: ../../reference/datamodel.rst:1690 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:1620 +#: ../../reference/datamodel.rst:1693 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1846,7 +1887,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1629 +#: ../../reference/datamodel.rst:1702 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 " @@ -1856,7 +1897,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1636 +#: ../../reference/datamodel.rst:1709 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1864,7 +1905,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1649 +#: ../../reference/datamodel.rst:1722 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:" @@ -1873,7 +1914,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1655 +#: ../../reference/datamodel.rst:1728 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. " @@ -1883,7 +1924,7 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1735 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits. :class:`weakref.finalize` " @@ -1891,14 +1932,14 @@ msgid "" "when an object is garbage collected." msgstr "" -#: ../../reference/datamodel.rst:1669 +#: ../../reference/datamodel.rst:1742 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:1674 +#: ../../reference/datamodel.rst:1747 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 " @@ -1909,18 +1950,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1684 +#: ../../reference/datamodel.rst:1757 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1688 +#: ../../reference/datamodel.rst:1761 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:1692 +#: ../../reference/datamodel.rst:1765 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1929,7 +1970,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1698 +#: ../../reference/datamodel.rst:1771 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1940,7 +1981,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1713 +#: ../../reference/datamodel.rst:1786 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 " @@ -1952,13 +1993,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1722 +#: ../../reference/datamodel.rst:1795 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1733 +#: ../../reference/datamodel.rst:1806 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1966,26 +2007,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1738 +#: ../../reference/datamodel.rst:1811 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:1742 +#: ../../reference/datamodel.rst:1815 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1752 +#: ../../reference/datamodel.rst:1825 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:1763 +#: ../../reference/datamodel.rst:1836 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1997,28 +2038,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1846 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1775 +#: ../../reference/datamodel.rst:1848 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:1850 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1854 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1797 +#: ../../reference/datamodel.rst:1870 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:1889 +#: ../../reference/datamodel.rst:1962 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 " @@ -2152,7 +2193,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1898 +#: ../../reference/datamodel.rst:1971 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2160,7 +2201,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1903 +#: ../../reference/datamodel.rst:1976 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 " @@ -2168,22 +2209,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1908 +#: ../../reference/datamodel.rst:1981 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:1912 +#: ../../reference/datamodel.rst:1985 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:1914 +#: ../../reference/datamodel.rst:1987 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1995 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2192,18 +2233,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1933 +#: ../../reference/datamodel.rst:2006 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:2008 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:1943 +#: ../../reference/datamodel.rst:2016 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2213,7 +2254,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1950 +#: ../../reference/datamodel.rst:2023 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2226,7 +2267,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1963 +#: ../../reference/datamodel.rst:2036 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2238,64 +2279,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1974 +#: ../../reference/datamodel.rst:2047 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1979 ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2052 ../../reference/datamodel.rst:2054 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:2061 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:1992 +#: ../../reference/datamodel.rst:2065 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." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1996 ../../reference/datamodel.rst:1998 +#: ../../reference/datamodel.rst:2069 ../../reference/datamodel.rst:2071 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2005 +#: ../../reference/datamodel.rst:2078 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:2008 ../../reference/datamodel.rst:2010 +#: ../../reference/datamodel.rst:2081 ../../reference/datamodel.rst:2083 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2017 +#: ../../reference/datamodel.rst:2090 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2022 +#: ../../reference/datamodel.rst:2095 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2102 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2307,21 +2348,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2038 +#: ../../reference/datamodel.rst:2111 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "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:2042 +#: ../../reference/datamodel.rst:2115 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:2046 +#: ../../reference/datamodel.rst:2119 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2349,7 +2390,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2060 +#: ../../reference/datamodel.rst:2133 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2357,27 +2398,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2065 +#: ../../reference/datamodel.rst:2138 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2141 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2146 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2074 +#: ../../reference/datamodel.rst:2147 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2153 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2082 +#: ../../reference/datamodel.rst:2155 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 " @@ -2387,7 +2428,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2165 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 " @@ -2396,13 +2437,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2171 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2174 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2412,31 +2453,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2183 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2186 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:2119 +#: ../../reference/datamodel.rst:2192 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2194 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2199 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2447,11 +2488,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2137 +#: ../../reference/datamodel.rst:2210 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2212 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2460,7 +2501,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2218 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 " @@ -2468,7 +2509,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2223 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 " @@ -2476,54 +2517,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2228 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2158 +#: ../../reference/datamodel.rst:2231 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2159 +#: ../../reference/datamodel.rst:2232 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2162 +#: ../../reference/datamodel.rst:2235 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2163 +#: ../../reference/datamodel.rst:2236 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:2166 +#: ../../reference/datamodel.rst:2239 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2167 +#: ../../reference/datamodel.rst:2240 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2243 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2244 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:2208 +#: ../../reference/datamodel.rst:2281 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2541,7 +2582,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2296 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2550,30 +2591,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2302 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2309 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2311 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:2242 +#: ../../reference/datamodel.rst:2315 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:2247 +#: ../../reference/datamodel.rst:2320 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2581,18 +2622,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2329 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2331 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:2262 +#: ../../reference/datamodel.rst:2335 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2601,7 +2642,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2342 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2609,7 +2650,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2348 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2617,16 +2658,16 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2354 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. " -"However, child subclasses will get a :attr:`~object.__dict__` and " -"*__weakref__* unless they also define *__slots__* (which should only contain " -"names of any *additional* slots)." +"However, instances of a child subclass will get a :attr:`~object.__dict__` " +"and *__weakref__* unless the subclass also defines *__slots__* (which should " +"only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2287 +#: ../../reference/datamodel.rst:2360 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 " @@ -2635,7 +2676,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2365 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2643,11 +2684,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2370 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2299 +#: ../../reference/datamodel.rst:2372 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 " @@ -2655,13 +2696,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2304 +#: ../../reference/datamodel.rst:2377 msgid "" -":attr:`~instance.__class__` assignment works only if both classes have the " +":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2380 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2669,18 +2710,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2386 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:2321 +#: ../../reference/datamodel.rst:2394 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2396 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2690,14 +2731,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2332 +#: ../../reference/datamodel.rst:2405 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:2336 +#: ../../reference/datamodel.rst:2409 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2705,7 +2746,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2342 +#: ../../reference/datamodel.rst:2415 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -2723,13 +2764,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2350 +#: ../../reference/datamodel.rst:2423 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2355 +#: ../../reference/datamodel.rst:2428 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2737,19 +2778,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2363 +#: ../../reference/datamodel.rst:2436 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:2368 +#: ../../reference/datamodel.rst:2441 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:2371 +#: ../../reference/datamodel.rst:2444 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -2757,14 +2798,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2374 +#: ../../reference/datamodel.rst:2447 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:2378 +#: ../../reference/datamodel.rst:2451 msgid "" "class A:\n" " pass\n" @@ -2774,22 +2815,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2385 +#: ../../reference/datamodel.rst:2458 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2393 +#: ../../reference/datamodel.rst:2466 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2400 +#: ../../reference/datamodel.rst:2473 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:2404 +#: ../../reference/datamodel.rst:2477 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2797,7 +2838,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2482 msgid "" "class Meta(type):\n" " pass\n" @@ -2817,41 +2858,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2491 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:2421 +#: ../../reference/datamodel.rst:2494 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2496 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2497 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2425 +#: ../../reference/datamodel.rst:2498 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2499 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:2500 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2504 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2435 +#: ../../reference/datamodel.rst:2508 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2863,59 +2904,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2446 +#: ../../reference/datamodel.rst:2519 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2447 +#: ../../reference/datamodel.rst:2520 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2449 +#: ../../reference/datamodel.rst:2522 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2450 +#: ../../reference/datamodel.rst:2523 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2453 +#: ../../reference/datamodel.rst:2526 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2527 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2531 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2462 +#: ../../reference/datamodel.rst:2535 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2464 +#: ../../reference/datamodel.rst:2537 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2465 +#: ../../reference/datamodel.rst:2538 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:2467 +#: ../../reference/datamodel.rst:2540 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:2470 +#: ../../reference/datamodel.rst:2543 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2924,11 +2965,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2553 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2485 +#: ../../reference/datamodel.rst:2558 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2940,25 +2981,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2494 +#: ../../reference/datamodel.rst:2567 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2572 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2573 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2577 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2509 +#: ../../reference/datamodel.rst:2582 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2967,7 +3008,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2515 +#: ../../reference/datamodel.rst:2588 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. " @@ -2976,11 +3017,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2597 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2531 +#: ../../reference/datamodel.rst:2604 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2988,7 +3029,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2536 +#: ../../reference/datamodel.rst:2609 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 " @@ -2999,7 +3040,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2619 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 " @@ -3008,59 +3049,59 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2552 +#: ../../reference/datamodel.rst:2625 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:2556 +#: ../../reference/datamodel.rst:2629 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:2558 +#: ../../reference/datamodel.rst:2631 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2560 +#: ../../reference/datamodel.rst:2633 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:2563 +#: ../../reference/datamodel.rst:2636 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:2567 +#: ../../reference/datamodel.rst:2640 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 " "object is discarded. The new copy is wrapped in a read-only proxy, which " -"becomes the :attr:`~object.__dict__` attribute of the class object." +"becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2574 +#: ../../reference/datamodel.rst:2647 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2575 +#: ../../reference/datamodel.rst:2648 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:2652 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2581 +#: ../../reference/datamodel.rst:2654 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3068,17 +3109,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2661 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2590 +#: ../../reference/datamodel.rst:2663 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:2593 +#: ../../reference/datamodel.rst:2666 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3086,21 +3127,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2673 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:2607 +#: ../../reference/datamodel.rst:2680 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:2612 +#: ../../reference/datamodel.rst:2685 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 " @@ -3108,24 +3149,24 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2619 +#: ../../reference/datamodel.rst:2692 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2620 +#: ../../reference/datamodel.rst:2693 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" -"`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" -"`~class.__subclasscheck__`, with motivation for this functionality in the " +"`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" +"`~type.__subclasscheck__`, with motivation for this functionality in the " "context of adding Abstract Base Classes (see the :mod:`abc` module) to the " "language." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2701 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2630 +#: ../../reference/datamodel.rst:2703 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3133,65 +3174,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2637 +#: ../../reference/datamodel.rst:2710 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2711 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2640 +#: ../../reference/datamodel.rst:2713 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2641 +#: ../../reference/datamodel.rst:2714 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2643 +#: ../../reference/datamodel.rst:2716 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2644 +#: ../../reference/datamodel.rst:2717 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2647 +#: ../../reference/datamodel.rst:2720 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2725 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2655 +#: ../../reference/datamodel.rst:2728 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:2661 +#: ../../reference/datamodel.rst:2734 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2663 +#: ../../reference/datamodel.rst:2736 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:2667 +#: ../../reference/datamodel.rst:2740 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3200,7 +3241,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:2746 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3208,11 +3249,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2683 +#: ../../reference/datamodel.rst:2756 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2685 +#: ../../reference/datamodel.rst:2758 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3222,14 +3263,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2692 +#: ../../reference/datamodel.rst:2765 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:2697 +#: ../../reference/datamodel.rst:2770 msgid "" "from inspect import isclass\n" "\n" @@ -3255,7 +3296,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2793 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 " @@ -3265,7 +3306,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2727 +#: ../../reference/datamodel.rst:2800 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3280,14 +3321,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2739 +#: ../../reference/datamodel.rst:2812 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:2743 +#: ../../reference/datamodel.rst:2816 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3307,33 +3348,33 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2835 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2763 +#: ../../reference/datamodel.rst:2836 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:2771 +#: ../../reference/datamodel.rst:2844 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2778 +#: ../../reference/datamodel.rst:2851 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:2785 +#: ../../reference/datamodel.rst:2858 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2860 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3369,7 +3410,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2828 +#: ../../reference/datamodel.rst:2901 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 " @@ -3377,7 +3418,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:2908 msgid "" "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:" @@ -3386,7 +3427,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2917 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). " @@ -3396,28 +3437,28 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2931 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2933 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:2862 +#: ../../reference/datamodel.rst:2935 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2864 +#: ../../reference/datamodel.rst:2937 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2939 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2871 +#: ../../reference/datamodel.rst:2944 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3429,20 +3470,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2883 +#: ../../reference/datamodel.rst:2956 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:2888 +#: ../../reference/datamodel.rst:2961 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:2896 +#: ../../reference/datamodel.rst:2969 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3451,7 +3492,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2905 +#: ../../reference/datamodel.rst:2978 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3460,13 +3501,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2914 +#: ../../reference/datamodel.rst:2987 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:2920 +#: ../../reference/datamodel.rst:2993 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 " @@ -3474,14 +3515,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2928 +#: ../../reference/datamodel.rst:3001 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:2932 +#: ../../reference/datamodel.rst:3005 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 :" @@ -3490,7 +3531,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2939 +#: ../../reference/datamodel.rst:3012 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3498,14 +3539,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2946 +#: ../../reference/datamodel.rst:3019 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:2950 +#: ../../reference/datamodel.rst:3023 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3513,11 +3554,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2959 +#: ../../reference/datamodel.rst:3032 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2961 +#: ../../reference/datamodel.rst:3034 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3525,7 +3566,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2987 +#: ../../reference/datamodel.rst:3060 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3539,13 +3580,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3071 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3094 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3558,13 +3599,13 @@ msgid "" "`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3106 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3038 +#: ../../reference/datamodel.rst:3111 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 " @@ -3573,7 +3614,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3132 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3591,19 +3632,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3082 +#: ../../reference/datamodel.rst:3155 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3095 +#: ../../reference/datamodel.rst:3168 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:3102 +#: ../../reference/datamodel.rst:3175 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3612,14 +3653,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3181 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:3120 +#: ../../reference/datamodel.rst:3193 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3628,21 +3669,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3126 +#: ../../reference/datamodel.rst:3199 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:3129 +#: ../../reference/datamodel.rst:3202 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3136 +#: ../../reference/datamodel.rst:3209 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3138 +#: ../../reference/datamodel.rst:3211 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 " @@ -3652,32 +3693,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3149 +#: ../../reference/datamodel.rst:3222 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:3152 +#: ../../reference/datamodel.rst:3225 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3157 +#: ../../reference/datamodel.rst:3230 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:3164 +#: ../../reference/datamodel.rst:3237 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:3168 +#: ../../reference/datamodel.rst:3241 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. " @@ -3685,27 +3726,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3172 +#: ../../reference/datamodel.rst:3245 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3178 +#: ../../reference/datamodel.rst:3251 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3179 +#: ../../reference/datamodel.rst:3252 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3186 +#: ../../reference/datamodel.rst:3259 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3188 +#: ../../reference/datamodel.rst:3261 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 " @@ -3713,7 +3754,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3195 +#: ../../reference/datamodel.rst:3268 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 " @@ -3722,7 +3763,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3201 +#: ../../reference/datamodel.rst:3274 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3732,19 +3773,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3211 +#: ../../reference/datamodel.rst:3284 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3285 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3291 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3220 +#: ../../reference/datamodel.rst:3293 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3752,13 +3793,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3225 +#: ../../reference/datamodel.rst:3298 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3303 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3768,7 +3809,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3239 +#: ../../reference/datamodel.rst:3312 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3777,28 +3818,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3250 +#: ../../reference/datamodel.rst:3323 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3324 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3253 +#: ../../reference/datamodel.rst:3326 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3254 +#: ../../reference/datamodel.rst:3327 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3259 +#: ../../reference/datamodel.rst:3332 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3261 +#: ../../reference/datamodel.rst:3334 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 " @@ -3806,7 +3847,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3266 +#: ../../reference/datamodel.rst:3339 msgid "" ">>> class C:\n" "... pass\n" @@ -3828,7 +3869,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3276 +#: ../../reference/datamodel.rst:3349 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3837,7 +3878,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3283 +#: ../../reference/datamodel.rst:3356 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -3853,14 +3894,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3290 +#: ../../reference/datamodel.rst:3363 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:3294 +#: ../../reference/datamodel.rst:3367 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -3872,14 +3913,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3299 +#: ../../reference/datamodel.rst:3372 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:3303 +#: ../../reference/datamodel.rst:3376 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -3904,7 +3945,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3325 +#: ../../reference/datamodel.rst:3398 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3913,36 +3954,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3336 +#: ../../reference/datamodel.rst:3409 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3340 +#: ../../reference/datamodel.rst:3413 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3342 +#: ../../reference/datamodel.rst:3415 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:3348 +#: ../../reference/datamodel.rst:3421 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:3354 +#: ../../reference/datamodel.rst:3427 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:3360 +#: ../../reference/datamodel.rst:3433 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 " @@ -3950,15 +3991,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3368 +#: ../../reference/datamodel.rst:3441 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3374 +#: ../../reference/datamodel.rst:3447 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3376 +#: ../../reference/datamodel.rst:3449 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3969,18 +4010,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3384 +#: ../../reference/datamodel.rst:3457 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:3388 +#: ../../reference/datamodel.rst:3461 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3394 +#: ../../reference/datamodel.rst:3467 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3991,7 +4032,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3405 +#: ../../reference/datamodel.rst:3478 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4002,13 +4043,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3416 +#: ../../reference/datamodel.rst:3489 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3421 +#: ../../reference/datamodel.rst:3494 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4018,42 +4059,42 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3429 +#: ../../reference/datamodel.rst:3502 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3435 +#: ../../reference/datamodel.rst:3508 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3437 +#: ../../reference/datamodel.rst:3510 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3440 +#: ../../reference/datamodel.rst:3513 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3444 +#: ../../reference/datamodel.rst:3517 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3448 +#: ../../reference/datamodel.rst:3521 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:3451 +#: ../../reference/datamodel.rst:3524 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3453 +#: ../../reference/datamodel.rst:3526 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4081,53 +4122,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3468 +#: ../../reference/datamodel.rst:3541 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:3473 +#: ../../reference/datamodel.rst:3546 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:3481 +#: ../../reference/datamodel.rst:3554 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3483 +#: ../../reference/datamodel.rst:3556 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:3486 +#: ../../reference/datamodel.rst:3559 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3490 +#: ../../reference/datamodel.rst:3563 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3495 +#: ../../reference/datamodel.rst:3568 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3498 +#: ../../reference/datamodel.rst:3571 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3500 +#: ../../reference/datamodel.rst:3573 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4143,18 +4184,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3511 +#: ../../reference/datamodel.rst:3584 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3512 +#: ../../reference/datamodel.rst:3585 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:3516 +#: ../../reference/datamodel.rst:3589 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4163,7 +4204,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3523 +#: ../../reference/datamodel.rst:3596 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4171,7 +4212,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3529 +#: ../../reference/datamodel.rst:3602 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 " @@ -4188,13 +4229,13 @@ msgstr "" #: ../../reference/datamodel.rst:427 ../../reference/datamodel.rst:447 #: ../../reference/datamodel.rst:455 ../../reference/datamodel.rst:466 #: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:519 -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 -#: ../../reference/datamodel.rst:799 ../../reference/datamodel.rst:823 -#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:935 -#: ../../reference/datamodel.rst:1013 ../../reference/datamodel.rst:1040 -#: ../../reference/datamodel.rst:1102 ../../reference/datamodel.rst:1206 -#: ../../reference/datamodel.rst:1315 ../../reference/datamodel.rst:1425 -#: ../../reference/datamodel.rst:1839 ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:798 ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:1175 ../../reference/datamodel.rst:1279 +#: ../../reference/datamodel.rst:1388 ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2927 msgid "object" msgstr "object(物件)" @@ -4204,14 +4245,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:296 #: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:799 -#: ../../reference/datamodel.rst:1059 ../../reference/datamodel.rst:1508 -#: ../../reference/datamodel.rst:1750 ../../reference/datamodel.rst:1755 -#: ../../reference/datamodel.rst:1839 ../../reference/datamodel.rst:2395 -#: ../../reference/datamodel.rst:2824 ../../reference/datamodel.rst:2982 -#: ../../reference/datamodel.rst:3017 ../../reference/datamodel.rst:3031 -#: ../../reference/datamodel.rst:3080 ../../reference/datamodel.rst:3090 -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:1132 ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1823 ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2897 ../../reference/datamodel.rst:3055 +#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3153 ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3191 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4220,7 +4261,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:126 -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2468 msgid "type" msgstr "type(型別)" @@ -4256,7 +4297,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:935 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:937 msgid "container" msgstr "container(容器)" @@ -4271,23 +4312,23 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:400 #: ../../reference/datamodel.rst:401 ../../reference/datamodel.rst:502 #: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:876 -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:798 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:798 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:935 -#: ../../reference/datamodel.rst:953 ../../reference/datamodel.rst:1013 -#: ../../reference/datamodel.rst:1033 +#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:955 ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1096 msgid "attribute" msgstr "attribute(屬性)" @@ -4307,7 +4348,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1040 +#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1103 msgid "numeric" msgstr "numeric(數值)" @@ -4344,16 +4385,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3163 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:2824 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:2897 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1040 +#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1103 msgid "sequence" msgstr "sequence(序列)" @@ -4382,8 +4423,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1725 -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1828 msgid "string" msgstr "string(字串)" @@ -4419,7 +4460,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:1750 +#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:1823 msgid "bytes" msgstr "bytes(位元組)" @@ -4435,14 +4476,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:953 -#: ../../reference/datamodel.rst:1033 +#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:955 +#: ../../reference/datamodel.rst:1096 msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1462 ../../reference/datamodel.rst:1644 -#: ../../reference/datamodel.rst:3145 +#: ../../reference/datamodel.rst:1535 ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:3218 msgid "statement" msgstr "statement(陳述式)" @@ -4474,12 +4515,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1040 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1103 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:935 -#: ../../reference/datamodel.rst:1839 +#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:1912 msgid "dictionary" msgstr "dictionary(字典)" @@ -4496,13 +4537,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:534 -#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:761 -#: ../../reference/datamodel.rst:774 ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:773 ../../reference/datamodel.rst:798 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:935 -#: ../../reference/datamodel.rst:958 ../../reference/datamodel.rst:2776 +#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:960 ../../reference/datamodel.rst:2849 msgid "call" msgstr "call(呼叫)" @@ -4514,7 +4555,7 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -4574,59 +4615,59 @@ msgstr "__kwdefaults__ (函式屬性)" msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:661 ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:822 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:661 +#: ../../reference/datamodel.rst:660 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:669 +#: ../../reference/datamodel.rst:668 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:669 +#: ../../reference/datamodel.rst:668 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:669 +#: ../../reference/datamodel.rst:668 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:669 +#: ../../reference/datamodel.rst:668 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:669 +#: ../../reference/datamodel.rst:668 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:1206 +#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:1279 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:743 +#: ../../reference/datamodel.rst:742 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3332 +#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:3405 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:774 +#: ../../reference/datamodel.rst:773 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:774 +#: ../../reference/datamodel.rst:773 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:822 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:822 msgid "built-in" msgstr "built-in(內建)" @@ -4654,489 +4695,512 @@ msgstr "__annotations__ (模組屬性)" msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:935 ../../reference/datamodel.rst:953 -#: ../../reference/datamodel.rst:1013 ../../reference/datamodel.rst:1627 -#: ../../reference/datamodel.rst:2506 +#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:955 +#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:2579 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:935 ../../reference/datamodel.rst:1013 -#: ../../reference/datamodel.rst:1033 +#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1096 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:935 ../../reference/datamodel.rst:1013 -#: ../../reference/datamodel.rst:2776 +#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:2849 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:935 ../../reference/datamodel.rst:958 +#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:960 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 #, fuzzy msgid "__static_attributes__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:967 #, fuzzy msgid "__firstlineno__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1114 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1114 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1059 +#: ../../reference/datamodel.rst:1132 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1088 +#: ../../reference/datamodel.rst:1161 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1088 +#: ../../reference/datamodel.rst:1161 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1175 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1175 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1175 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1186 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1297 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1315 +#: ../../reference/datamodel.rst:1388 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1394 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1438 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1438 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1438 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1438 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1498 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1535 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1535 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1535 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1535 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1492 +#: ../../reference/datamodel.rst:1565 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1508 ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:2927 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1514 +#: ../../reference/datamodel.rst:1587 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1514 +#: ../../reference/datamodel.rst:1587 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1514 +#: ../../reference/datamodel.rst:1587 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1635 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1635 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1635 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1598 +#: ../../reference/datamodel.rst:1671 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1598 +#: ../../reference/datamodel.rst:1671 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1627 +#: ../../reference/datamodel.rst:1700 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1644 +#: ../../reference/datamodel.rst:1717 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1644 +#: ../../reference/datamodel.rst:1717 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1644 +#: ../../reference/datamodel.rst:1717 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1708 +#: ../../reference/datamodel.rst:1781 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1708 +#: ../../reference/datamodel.rst:1781 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1725 +#: ../../reference/datamodel.rst:1798 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1725 +#: ../../reference/datamodel.rst:1798 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1725 +#: ../../reference/datamodel.rst:1798 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1828 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1828 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1828 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1794 +#: ../../reference/datamodel.rst:1867 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1839 +#: ../../reference/datamodel.rst:1912 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1920 +#: ../../reference/datamodel.rst:1993 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2024 +#: ../../reference/datamodel.rst:2097 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2024 +#: ../../reference/datamodel.rst:2097 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2024 +#: ../../reference/datamodel.rst:2097 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2468 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2468 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2468 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2459 +#: ../../reference/datamodel.rst:2532 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2482 +#: ../../reference/datamodel.rst:2555 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2506 +#: ../../reference/datamodel.rst:2579 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2599 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2599 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2824 +#: ../../reference/datamodel.rst:2897 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2982 ../../reference/datamodel.rst:3017 +#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2982 ../../reference/datamodel.rst:3017 -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3104 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3153 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3163 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3163 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3191 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3145 +#: ../../reference/datamodel.rst:3218 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3145 +#: ../../reference/datamodel.rst:3218 msgid "context manager" msgstr "context manager(情境管理器)" + +#~ msgid ":attr:`~definition.__name__`" +#~ msgstr ":attr:`~definition.__name__`" + +#~ msgid ":attr:`__module__`" +#~ msgstr ":attr:`__module__`" + +#~ msgid ":attr:`~object.__dict__`" +#~ msgstr ":attr:`~object.__dict__`" + +#~ msgid ":attr:`~class.__bases__`" +#~ msgstr ":attr:`~class.__bases__`" + +#~ msgid ":attr:`__type_params__`" +#~ msgstr ":attr:`__type_params__`" + +#, fuzzy +#~ msgid ":attr:`~class.__static_attributes__`" +#~ msgstr ":attr:`~class.__bases__`" + +#, fuzzy +#~ msgid ":attr:`__firstlineno__`" +#~ msgstr ":attr:`__file__`" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 63aff5c713..05143b6156 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -347,9 +347,9 @@ msgstr "" #: ../../reference/executionmodel.rst:227 msgid "" "While annotation scopes have an internal name, that name is not reflected in " -"the :term:`__qualname__ ` of objects defined within the " -"scope. Instead, the :attr:`!__qualname__` of such objects is as if the " -"object were defined in the enclosing scope." +"the :term:`qualified name` of objects defined within the scope. Instead, " +"the :attr:`~definition.__qualname__` of such objects is as if the object " +"were defined in the enclosing scope." msgstr "" #: ../../reference/executionmodel.rst:232 diff --git a/reference/expressions.po b/reference/expressions.po index 366629e070..fc336df342 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -138,8 +138,8 @@ msgstr "" #: ../../reference/expressions.rst:107 msgid "" -"The ``__name__`` attribute of nested functions, classes, and type aliases is " -"however not mangled." +"The :attr:`~definition.__name__` attribute of nested functions, classes, and " +"type aliases is however not mangled." msgstr "" #: ../../reference/expressions.rst:110 @@ -541,9 +541,9 @@ msgid "" "function. The execution starts when one of the generator's methods is " "called. At that time, the execution proceeds to the first yield expression, " "where it is suspended again, returning the value of :token:`~python-grammar:" -"expression_list` to the generator's caller, or ``None`` if :token:`~python-" -"grammar:expression_list` is omitted. By suspended, we mean that all local " -"state is retained, including the current bindings of local variables, the " +"yield_list` to the generator's caller, or ``None`` if :token:`~python-" +"grammar:yield_list` is omitted. By suspended, we mean that all local state " +"is retained, including the current bindings of local variables, the " "instruction pointer, the internal evaluation stack, and the state of any " "exception handling. When the execution is resumed by calling one of the " "generator's methods, the function can proceed exactly as if the yield " @@ -667,7 +667,7 @@ msgid "" "meth:`~generator.__next__` method, the current yield expression always " "evaluates to :const:`None`. The execution then continues to the next yield " "expression, where the generator is suspended again, and the value of the :" -"token:`~python-grammar:expression_list` is returned to :meth:`__next__`'s " +"token:`~python-grammar:yield_list` is returned to :meth:`__next__`'s " "caller. If the generator exits without yielding another value, a :exc:" "`StopIteration` exception is raised." msgstr "" @@ -811,17 +811,16 @@ msgid "" "`awaitable` object, and the execution starts when this object is awaited on. " "At that time, the execution proceeds to the first yield expression, where it " "is suspended again, returning the value of :token:`~python-grammar:" -"expression_list` to the awaiting coroutine. As with a generator, suspension " -"means that all local state is retained, including the current bindings of " -"local variables, the instruction pointer, the internal evaluation stack, and " -"the state of any exception handling. When the execution is resumed by " -"awaiting on the next object returned by the asynchronous generator's " -"methods, the function can proceed exactly as if the yield expression were " -"just another external call. The value of the yield expression after resuming " -"depends on the method which resumed the execution. If :meth:`~agen." -"__anext__` is used then the result is :const:`None`. Otherwise, if :meth:" -"`~agen.asend` is used, then the result will be the value passed in to that " -"method." +"yield_list` to the awaiting coroutine. As with a generator, suspension means " +"that all local state is retained, including the current bindings of local " +"variables, the instruction pointer, the internal evaluation stack, and the " +"state of any exception handling. When the execution is resumed by awaiting " +"on the next object returned by the asynchronous generator's methods, the " +"function can proceed exactly as if the yield expression were just another " +"external call. The value of the yield expression after resuming depends on " +"the method which resumed the execution. If :meth:`~agen.__anext__` is used " +"then the result is :const:`None`. Otherwise, if :meth:`~agen.asend` is used, " +"then the result will be the value passed in to that method." msgstr "" #: ../../reference/expressions.rst:710 @@ -886,7 +885,7 @@ msgid "" "asynchronous generator function is resumed with an :meth:`~agen.__anext__` " "method, the current yield expression always evaluates to :const:`None` in " "the returned awaitable, which when run will continue to the next yield " -"expression. The value of the :token:`~python-grammar:expression_list` of the " +"expression. The value of the :token:`~python-grammar:yield_list` of the " "yield expression is the value of the :exc:`StopIteration` exception raised " "by the completing coroutine. If the asynchronous generator exits without " "yielding another value, the awaitable instead raises a :exc:" @@ -1013,18 +1012,23 @@ msgstr "" #: ../../reference/expressions.rst:907 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 " +"If the expression list contains at least one comma, or if any of the " +"expressions are starred, the expression list 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:911 +#: ../../reference/expressions.rst:912 +msgid "Expressions in an expression list may be starred. See :pep:`646`." +msgstr "" + +#: ../../reference/expressions.rst:915 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:918 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 " @@ -1032,7 +1036,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:918 +#: ../../reference/expressions.rst:922 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 " @@ -1040,7 +1044,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:923 +#: ../../reference/expressions.rst:927 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences `. However, built-in sequences all provide a :meth:" @@ -1054,25 +1058,25 @@ msgid "" "explicitly add that support." msgstr "" -#: ../../reference/expressions.rst:937 +#: ../../reference/expressions.rst:941 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:945 +#: ../../reference/expressions.rst:949 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:959 +#: ../../reference/expressions.rst:963 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:972 +#: ../../reference/expressions.rst:976 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 " @@ -1082,7 +1086,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:984 +#: ../../reference/expressions.rst:988 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`~object.__getitem__` method as normal subscription) with a " @@ -1097,23 +1101,23 @@ msgid "" "missing expressions." msgstr "" -#: ../../reference/expressions.rst:1008 +#: ../../reference/expressions.rst:1012 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:1010 +#: ../../reference/expressions.rst:1014 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:1027 +#: ../../reference/expressions.rst:1031 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:1033 +#: ../../reference/expressions.rst:1037 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -1123,7 +1127,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:1041 +#: ../../reference/expressions.rst:1045 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 " @@ -1144,7 +1148,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1061 +#: ../../reference/expressions.rst:1065 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1153,7 +1157,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1067 +#: ../../reference/expressions.rst:1071 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1162,7 +1166,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1073 +#: ../../reference/expressions.rst:1077 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 " @@ -1172,7 +1176,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1084 +#: ../../reference/expressions.rst:1088 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1182,14 +1186,14 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1091 +#: ../../reference/expressions.rst:1095 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:1095 +#: ../../reference/expressions.rst:1099 msgid "" ">>> def f(a, b):\n" "... print(a, b)\n" @@ -1215,13 +1219,13 @@ msgstr "" ">>> f(1, *(2,))\n" "1 2" -#: ../../reference/expressions.rst:1107 +#: ../../reference/expressions.rst:1111 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:1113 +#: ../../reference/expressions.rst:1117 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1230,7 +1234,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1119 +#: ../../reference/expressions.rst:1123 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 " @@ -1242,35 +1246,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1129 +#: ../../reference/expressions.rst:1133 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:1132 +#: ../../reference/expressions.rst:1136 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:1138 +#: ../../reference/expressions.rst:1142 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:1142 +#: ../../reference/expressions.rst:1146 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1144 +#: ../../reference/expressions.rst:1148 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1151 +#: ../../reference/expressions.rst:1155 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 " @@ -1279,73 +1283,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1157 +#: ../../reference/expressions.rst:1161 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1168 +#: ../../reference/expressions.rst:1172 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:1171 +#: ../../reference/expressions.rst:1175 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1180 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1178 +#: ../../reference/expressions.rst:1182 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1184 +#: ../../reference/expressions.rst:1188 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:1188 +#: ../../reference/expressions.rst:1192 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1197 msgid "" "The class must define a :meth:`~object.__call__` method; the effect is then " "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1201 ../../reference/expressions.rst:1994 +#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2004 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1203 +#: ../../reference/expressions.rst:1207 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:1215 +#: ../../reference/expressions.rst:1219 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1225 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:1227 +#: ../../reference/expressions.rst:1231 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:1231 +#: ../../reference/expressions.rst:1235 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 " @@ -1353,7 +1357,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1236 +#: ../../reference/expressions.rst:1240 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 " @@ -1361,41 +1365,41 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1241 +#: ../../reference/expressions.rst:1245 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:1245 +#: ../../reference/expressions.rst:1249 msgid "" "This operation can be customized using the special :meth:`~object.__pow__` " "and :meth:`~object.__rpow__` methods." msgstr "" -#: ../../reference/expressions.rst:1251 +#: ../../reference/expressions.rst:1255 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1261 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1268 +#: ../../reference/expressions.rst:1272 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`~object.__neg__` " "special method." msgstr "" -#: ../../reference/expressions.rst:1276 +#: ../../reference/expressions.rst:1280 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1287 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1403,17 +1407,17 @@ msgid "" "meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1292 +#: ../../reference/expressions.rst:1296 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1299 +#: ../../reference/expressions.rst:1303 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1307 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1421,7 +1425,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1322 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1431,25 +1435,25 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1324 +#: ../../reference/expressions.rst:1328 msgid "" "This operation can be customized using the special :meth:`~object.__mul__` " "and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1335 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1334 +#: ../../reference/expressions.rst:1338 msgid "" "This operation can be customized using the special :meth:`~object." "__matmul__` and :meth:`~object.__rmatmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1345 +#: ../../reference/expressions.rst:1349 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1459,7 +1463,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1352 +#: ../../reference/expressions.rst:1356 msgid "" "The division operation can be customized using the special :meth:`~object." "__truediv__` and :meth:`~object.__rtruediv__` methods. The floor division " @@ -1467,7 +1471,7 @@ msgid "" "and :meth:`~object.__rfloordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1365 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1479,7 +1483,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1374 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 " @@ -1487,7 +1491,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1375 +#: ../../reference/expressions.rst:1379 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1496,20 +1500,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1384 msgid "" "The *modulo* operation can be customized using the special :meth:`~object." "__mod__` and :meth:`~object.__rmod__` methods." msgstr "" -#: ../../reference/expressions.rst:1383 +#: ../../reference/expressions.rst:1387 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:1392 +#: ../../reference/expressions.rst:1396 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1517,40 +1521,40 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1401 msgid "" "This operation can be customized using the special :meth:`~object.__add__` " "and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1409 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1412 msgid "" "This operation can be customized using the special :meth:`~object.__sub__` " "and :meth:`~object.__rsub__` methods." msgstr "" -#: ../../reference/expressions.rst:1415 +#: ../../reference/expressions.rst:1419 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1426 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1427 +#: ../../reference/expressions.rst:1431 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:1430 +#: ../../reference/expressions.rst:1434 msgid "" "The left shift operation can be customized using the special :meth:`~object." "__lshift__` and :meth:`~object.__rlshift__` methods. The right shift " @@ -1558,46 +1562,46 @@ msgid "" "and :meth:`~object.__rrshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1437 +#: ../../reference/expressions.rst:1441 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:1444 +#: ../../reference/expressions.rst:1448 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1448 +#: ../../reference/expressions.rst:1452 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1459 +#: ../../reference/expressions.rst:1463 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:`~object." "__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1472 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:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1481 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:" "`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1485 +#: ../../reference/expressions.rst:1489 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1497 +#: ../../reference/expressions.rst:1501 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 " @@ -1605,14 +1609,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1507 +#: ../../reference/expressions.rst:1511 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:1513 +#: ../../reference/expressions.rst:1517 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 " @@ -1620,7 +1624,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1517 +#: ../../reference/expressions.rst:1521 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 " @@ -1628,24 +1632,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1522 +#: ../../reference/expressions.rst:1526 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:1529 +#: ../../reference/expressions.rst:1533 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1531 +#: ../../reference/expressions.rst:1535 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1534 +#: ../../reference/expressions.rst:1538 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 " @@ -1657,7 +1661,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1543 +#: ../../reference/expressions.rst:1547 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1665,7 +1669,7 @@ msgid "" "methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1549 +#: ../../reference/expressions.rst:1553 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1675,14 +1679,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1556 +#: ../../reference/expressions.rst:1560 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:1560 +#: ../../reference/expressions.rst:1564 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1691,13 +1695,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1570 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1569 +#: ../../reference/expressions.rst:1573 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1707,7 +1711,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1576 +#: ../../reference/expressions.rst:1580 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 " @@ -1717,32 +1721,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1583 +#: ../../reference/expressions.rst:1587 msgid "" "``None`` and :data:`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:1587 +#: ../../reference/expressions.rst:1591 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:1591 +#: ../../reference/expressions.rst:1595 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:1595 +#: ../../reference/expressions.rst:1599 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1597 +#: ../../reference/expressions.rst:1601 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1751,7 +1755,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1603 +#: ../../reference/expressions.rst:1607 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1759,19 +1763,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1608 +#: ../../reference/expressions.rst:1612 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1610 +#: ../../reference/expressions.rst:1614 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:1615 +#: ../../reference/expressions.rst:1619 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 " @@ -1780,25 +1784,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1621 +#: ../../reference/expressions.rst:1625 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:1625 +#: ../../reference/expressions.rst:1629 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1627 +#: ../../reference/expressions.rst:1631 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1630 +#: ../../reference/expressions.rst:1634 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1809,110 +1813,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1638 +#: ../../reference/expressions.rst:1642 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1640 +#: ../../reference/expressions.rst:1644 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1643 +#: ../../reference/expressions.rst:1647 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1646 +#: ../../reference/expressions.rst:1650 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1649 +#: ../../reference/expressions.rst:1653 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1651 +#: ../../reference/expressions.rst:1655 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1654 +#: ../../reference/expressions.rst:1658 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1656 +#: ../../reference/expressions.rst:1660 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1658 +#: ../../reference/expressions.rst:1662 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1664 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1662 +#: ../../reference/expressions.rst:1666 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1665 +#: ../../reference/expressions.rst:1669 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1667 +#: ../../reference/expressions.rst:1671 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1673 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1672 +#: ../../reference/expressions.rst:1676 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1674 +#: ../../reference/expressions.rst:1678 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1676 +#: ../../reference/expressions.rst:1680 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1678 +#: ../../reference/expressions.rst:1682 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:1682 +#: ../../reference/expressions.rst:1686 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:1686 +#: ../../reference/expressions.rst:1690 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:1695 +#: ../../reference/expressions.rst:1699 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1697 +#: ../../reference/expressions.rst:1701 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`` " @@ -1923,7 +1927,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1705 +#: ../../reference/expressions.rst:1709 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 " @@ -1931,14 +1935,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1710 +#: ../../reference/expressions.rst:1714 msgid "" "For user-defined classes which define the :meth:`~object.__contains__` " "method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " "value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1714 +#: ../../reference/expressions.rst:1718 msgid "" "For user-defined classes which do not define :meth:`~object.__contains__` " "but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " @@ -1947,7 +1951,7 @@ msgid "" "it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1720 +#: ../../reference/expressions.rst:1724 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1956,17 +1960,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1732 +#: ../../reference/expressions.rst:1736 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1745 +#: ../../reference/expressions.rst:1749 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1747 +#: ../../reference/expressions.rst:1751 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 " @@ -1974,11 +1978,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1759 +#: ../../reference/expressions.rst:1763 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1770 +#: ../../reference/expressions.rst:1774 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1989,25 +1993,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1779 +#: ../../reference/expressions.rst:1783 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1788 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:1789 +#: ../../reference/expressions.rst:1793 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:1792 +#: ../../reference/expressions.rst:1796 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 " @@ -2018,11 +2022,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1808 +#: ../../reference/expressions.rst:1813 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1813 +#: ../../reference/expressions.rst:1818 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2030,11 +2034,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1818 +#: ../../reference/expressions.rst:1823 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1820 +#: ../../reference/expressions.rst:1825 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2042,11 +2046,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1830 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1827 +#: ../../reference/expressions.rst:1832 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2054,7 +2058,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1832 +#: ../../reference/expressions.rst:1837 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2064,36 +2068,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1845 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:1852 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1859 +#: ../../reference/expressions.rst:1864 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1862 +#: ../../reference/expressions.rst:1867 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:1866 +#: ../../reference/expressions.rst:1871 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1873 +#: ../../reference/expressions.rst:1878 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1884 +#: ../../reference/expressions.rst:1889 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2101,7 +2105,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1888 +#: ../../reference/expressions.rst:1893 msgid "" "def (parameters):\n" " return expression" @@ -2109,25 +2113,25 @@ msgstr "" "def (parameters):\n" " return expression" -#: ../../reference/expressions.rst:1893 +#: ../../reference/expressions.rst:1898 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:1901 +#: ../../reference/expressions.rst:1906 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1922 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:1924 +#: ../../reference/expressions.rst:1931 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2135,12 +2139,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1936 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1939 +msgid "Any item in an expression list may be starred. See :pep:`646`." +msgstr "" + +#: ../../reference/expressions.rst:1944 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2149,24 +2157,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1955 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1949 +#: ../../reference/expressions.rst:1959 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:1952 +#: ../../reference/expressions.rst:1962 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1965 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2182,11 +2190,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1966 +#: ../../reference/expressions.rst:1976 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1971 +#: ../../reference/expressions.rst:1981 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2196,176 +2204,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1977 +#: ../../reference/expressions.rst:1987 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:1983 +#: ../../reference/expressions.rst:1993 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1983 +#: ../../reference/expressions.rst:1993 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1985 +#: ../../reference/expressions.rst:1995 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1987 +#: ../../reference/expressions.rst:1997 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1985 +#: ../../reference/expressions.rst:1995 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1991 +#: ../../reference/expressions.rst:2001 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1991 +#: ../../reference/expressions.rst:2001 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1994 +#: ../../reference/expressions.rst:2004 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1996 +#: ../../reference/expressions.rst:2006 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1996 +#: ../../reference/expressions.rst:2006 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:2008 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:2008 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2000 +#: ../../reference/expressions.rst:2010 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2000 +#: ../../reference/expressions.rst:2010 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2014 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2014 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2016 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2016 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2018 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2018 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2020 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2020 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2022 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2022 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2024 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2024 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2028 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2028 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2030 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2030 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2032 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2032 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2034 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2034 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2036 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2036 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2038 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2038 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2033 +#: ../../reference/expressions.rst:2043 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2044 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 " @@ -2377,7 +2385,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2043 +#: ../../reference/expressions.rst:2053 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, " @@ -2385,7 +2393,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2048 +#: ../../reference/expressions.rst:2058 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 " @@ -2399,7 +2407,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2059 +#: ../../reference/expressions.rst:2069 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2407,13 +2415,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2064 +#: ../../reference/expressions.rst:2074 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:2067 +#: ../../reference/expressions.rst:2077 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2421,22 +2429,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2072 +#: ../../reference/expressions.rst:2082 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:2075 +#: ../../reference/expressions.rst:2085 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1761 -#: ../../reference/expressions.rst:1849 ../../reference/expressions.rst:1875 -#: ../../reference/expressions.rst:1903 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:1908 msgid "expression" msgstr "" @@ -2444,8 +2452,8 @@ msgstr "" msgid "BNF" msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1253 -#: ../../reference/expressions.rst:1301 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1305 msgid "arithmetic" msgstr "" @@ -2468,8 +2476,8 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:569 #: ../../reference/expressions.rst:624 ../../reference/expressions.rst:753 #: ../../reference/expressions.rst:805 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:1290 ../../reference/expressions.rst:1339 -#: ../../reference/expressions.rst:1435 +#: ../../reference/expressions.rst:1294 ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1439 msgid "exception" msgstr "" @@ -2510,10 +2518,10 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:372 ../../reference/expressions.rst:393 #: ../../reference/expressions.rst:557 ../../reference/expressions.rst:743 #: ../../reference/expressions.rst:851 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:953 ../../reference/expressions.rst:997 -#: ../../reference/expressions.rst:1145 ../../reference/expressions.rst:1158 -#: ../../reference/expressions.rst:1172 ../../reference/expressions.rst:1179 -#: ../../reference/expressions.rst:1726 ../../reference/expressions.rst:1913 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1176 ../../reference/expressions.rst:1183 +#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1920 msgid "object" msgstr "object(物件)" @@ -2522,7 +2530,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:162 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:1001 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2535,18 +2543,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:953 ../../reference/expressions.rst:1913 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1920 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1942 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 -#: ../../reference/expressions.rst:947 ../../reference/expressions.rst:997 -#: ../../reference/expressions.rst:1903 +#: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1908 msgid ", (comma)" msgstr ", (逗號)" @@ -2563,7 +2571,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1854 msgid "if" msgstr "if" @@ -2571,13 +2579,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1201 msgid "await" msgstr "await" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:953 -#: ../../reference/expressions.rst:1903 +#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 +#: ../../reference/expressions.rst:1908 msgid "list" msgstr "list(串列)" @@ -2595,7 +2603,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1903 +#: ../../reference/expressions.rst:1908 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2632,8 +2640,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:329 ../../reference/expressions.rst:947 -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 +#: ../../reference/expressions.rst:1880 msgid ": (colon)" msgstr ": (冒號)" @@ -2645,13 +2653,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1080 -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 +#: ../../reference/expressions.rst:1927 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1110 -#: ../../reference/expressions.rst:1217 +#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1114 +#: ../../reference/expressions.rst:1221 msgid "**" msgstr "**" @@ -2668,7 +2676,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1201 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2680,8 +2688,8 @@ msgstr "yield" msgid "from" msgstr "from" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1145 -#: ../../reference/expressions.rst:1158 ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1880 msgid "function" msgstr "function (函式)" @@ -2745,8 +2753,8 @@ msgstr "module(模組)" msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:953 -#: ../../reference/expressions.rst:1726 +#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 +#: ../../reference/expressions.rst:1730 msgid "sequence" msgstr "sequence(序列)" @@ -2754,443 +2762,448 @@ msgstr "sequence(序列)" msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:933 -#: ../../reference/expressions.rst:953 +#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:937 +#: ../../reference/expressions.rst:957 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:933 +#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:937 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:933 +#: ../../reference/expressions.rst:937 msgid "character" msgstr "character(字元)" -#: ../../reference/expressions.rst:947 +#: ../../reference/expressions.rst:951 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:947 +#: ../../reference/expressions.rst:951 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:979 +#: ../../reference/expressions.rst:983 msgid "start (slice object attribute)" msgstr "start(切片物件屬性)" -#: ../../reference/expressions.rst:979 +#: ../../reference/expressions.rst:983 msgid "stop (slice object attribute)" msgstr "stop(切片物件屬性)" -#: ../../reference/expressions.rst:979 +#: ../../reference/expressions.rst:983 msgid "step (slice object attribute)" msgstr "step(切片物件屬性)" -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:1001 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:997 ../../reference/expressions.rst:1145 -#: ../../reference/expressions.rst:1158 ../../reference/expressions.rst:1172 -#: ../../reference/expressions.rst:1179 ../../reference/expressions.rst:1189 +#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1149 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:1001 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:997 ../../reference/expressions.rst:1030 +#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1034 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:1001 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:997 +#: ../../reference/expressions.rst:1001 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/expressions.rst:997 ../../reference/expressions.rst:1080 -#: ../../reference/expressions.rst:1110 +#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1084 +#: ../../reference/expressions.rst:1114 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:1030 +#: ../../reference/expressions.rst:1034 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1080 ../../reference/expressions.rst:1314 -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1927 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1145 +#: ../../reference/expressions.rst:1149 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1145 +#: ../../reference/expressions.rst:1149 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:1162 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:1162 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:1162 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1176 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1176 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1179 +#: ../../reference/expressions.rst:1183 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1179 ../../reference/expressions.rst:1189 +#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1189 +#: ../../reference/expressions.rst:1193 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1217 +#: ../../reference/expressions.rst:1221 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1217 ../../reference/expressions.rst:1253 -#: ../../reference/expressions.rst:1301 ../../reference/expressions.rst:1417 -#: ../../reference/expressions.rst:1446 ../../reference/expressions.rst:1761 +#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1450 ../../reference/expressions.rst:1765 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1217 ../../reference/expressions.rst:1262 -#: ../../reference/expressions.rst:1271 ../../reference/expressions.rst:1279 -#: ../../reference/expressions.rst:1314 ../../reference/expressions.rst:1327 -#: ../../reference/expressions.rst:1339 ../../reference/expressions.rst:1357 -#: ../../reference/expressions.rst:1387 ../../reference/expressions.rst:1400 -#: ../../reference/expressions.rst:1417 ../../reference/expressions.rst:1455 -#: ../../reference/expressions.rst:1463 ../../reference/expressions.rst:1472 -#: ../../reference/expressions.rst:1487 ../../reference/expressions.rst:1726 -#: ../../reference/expressions.rst:1735 ../../reference/expressions.rst:1777 -#: ../../reference/expressions.rst:1782 ../../reference/expressions.rst:1787 -#: ../../reference/expressions.rst:1849 ../../reference/expressions.rst:1968 +#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1266 +#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1318 ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1343 ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1421 ../../reference/expressions.rst:1459 +#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1491 ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1739 ../../reference/expressions.rst:1781 +#: ../../reference/expressions.rst:1786 ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1854 ../../reference/expressions.rst:1978 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1253 +#: ../../reference/expressions.rst:1257 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1253 ../../reference/expressions.rst:1446 -#: ../../reference/expressions.rst:1455 ../../reference/expressions.rst:1463 -#: ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1257 ../../reference/expressions.rst:1450 +#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1476 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1266 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1266 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1262 ../../reference/expressions.rst:1400 +#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1404 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1262 ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1275 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1275 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1271 ../../reference/expressions.rst:1387 +#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1391 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1283 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1279 +#: ../../reference/expressions.rst:1283 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1294 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1301 ../../reference/expressions.rst:1446 +#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1450 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1314 +#: ../../reference/expressions.rst:1318 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1327 +#: ../../reference/expressions.rst:1331 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1327 +#: ../../reference/expressions.rst:1331 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1339 +#: ../../reference/expressions.rst:1343 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1339 +#: ../../reference/expressions.rst:1343 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1339 +#: ../../reference/expressions.rst:1343 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1339 +#: ../../reference/expressions.rst:1343 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1357 +#: ../../reference/expressions.rst:1361 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1357 +#: ../../reference/expressions.rst:1361 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1387 +#: ../../reference/expressions.rst:1391 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1387 ../../reference/expressions.rst:1400 +#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1400 +#: ../../reference/expressions.rst:1404 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1421 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1421 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1421 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1435 +#: ../../reference/expressions.rst:1439 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1455 ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1786 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1455 +#: ../../reference/expressions.rst:1459 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1467 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1467 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1463 ../../reference/expressions.rst:1472 -#: ../../reference/expressions.rst:1787 +#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1791 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1467 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1476 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1476 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1487 +#: ../../reference/expressions.rst:1491 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1515 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1515 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1726 +#: ../../reference/expressions.rst:1730 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1726 +#: ../../reference/expressions.rst:1730 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1726 +#: ../../reference/expressions.rst:1730 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1726 ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1739 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1739 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1739 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1739 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1761 +#: ../../reference/expressions.rst:1765 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1761 +#: ../../reference/expressions.rst:1765 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1777 +#: ../../reference/expressions.rst:1781 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1801 +#: ../../reference/expressions.rst:1805 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1801 +#: ../../reference/expressions.rst:1805 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1801 +#: ../../reference/expressions.rst:1805 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1801 +#: ../../reference/expressions.rst:1805 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1805 +#, fuzzy +msgid "assignment" +msgstr "argument(引數)" + +#: ../../reference/expressions.rst:1854 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1854 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1854 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1854 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:1880 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:1880 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:1880 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:1880 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1927 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1927 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1942 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1957 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1957 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1968 +#: ../../reference/expressions.rst:1978 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/reference/import.po b/reference/import.po index 9a98a69bd1..27ee9f46ec 100644 --- a/reference/import.po +++ b/reference/import.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -830,7 +830,13 @@ msgid "" "back to ``__package__``." msgstr "" -#: ../../reference/import.rst:602 +#: ../../reference/import.rst:599 +msgid "" +"``__package__`` will cease to be set or taken into consideration by the " +"import system or standard library." +msgstr "" + +#: ../../reference/import.rst:606 msgid "" "The ``__spec__`` attribute must be set to the module spec that was used when " "importing the module. Setting ``__spec__`` appropriately applies equally to :" @@ -839,18 +845,18 @@ msgid "" "cases `." msgstr "" -#: ../../reference/import.rst:608 +#: ../../reference/import.rst:612 msgid "" "When ``__spec__.parent`` is not set, ``__package__`` is used as a fallback." msgstr "" -#: ../../reference/import.rst:613 +#: ../../reference/import.rst:617 msgid "" "``__spec__.parent`` is used as a fallback when ``__package__`` is not " "defined." msgstr "" -#: ../../reference/import.rst:619 +#: ../../reference/import.rst:623 msgid "" "If the module is a package (either regular or namespace), the module " "object's ``__path__`` attribute must be set. The value must be iterable, " @@ -860,11 +866,11 @@ msgid "" "rules>`." msgstr "" -#: ../../reference/import.rst:626 +#: ../../reference/import.rst:630 msgid "Non-package modules should not have a ``__path__`` attribute." msgstr "" -#: ../../reference/import.rst:631 +#: ../../reference/import.rst:635 msgid "" "``__file__`` is optional (if set, value must be a string). It indicates the " "pathname of the file from which the module was loaded (if loaded from a " @@ -875,7 +881,7 @@ msgid "" "semantic meaning (e.g. a module loaded from a database)." msgstr "" -#: ../../reference/import.rst:640 +#: ../../reference/import.rst:644 msgid "" "If ``__file__`` is set then the ``__cached__`` attribute might also be set, " "which is the path to any compiled version of the code (e.g. byte-compiled " @@ -883,7 +889,7 @@ msgid "" "simply point to where the compiled file would exist (see :pep:`3147`)." msgstr "" -#: ../../reference/import.rst:646 +#: ../../reference/import.rst:650 msgid "" "Note that ``__cached__`` may be set even if ``__file__`` is not set. " "However, that scenario is quite atypical. Ultimately, the loader is what " @@ -893,22 +899,28 @@ msgid "" "be appropriate." msgstr "" -#: ../../reference/import.rst:653 +#: ../../reference/import.rst:657 msgid "" "It is **strongly** recommended that you rely on :attr:`__spec__` instead of " "``__cached__``." msgstr "" -#: ../../reference/import.rst:659 +#: ../../reference/import.rst:660 +msgid "" +"``__cached__`` will cease to be set or taken into consideration by the " +"import system or standard library." +msgstr "" + +#: ../../reference/import.rst:667 msgid "module.__path__" msgstr "module.__path__" -#: ../../reference/import.rst:661 +#: ../../reference/import.rst:669 msgid "" "By definition, if a module has a ``__path__`` attribute, it is a package." msgstr "" -#: ../../reference/import.rst:663 +#: ../../reference/import.rst:671 msgid "" "A package's ``__path__`` attribute is used during imports of its " "subpackages. Within the import machinery, it functions much the same as :" @@ -917,7 +929,7 @@ msgid "" "than :data:`sys.path`." msgstr "" -#: ../../reference/import.rst:669 +#: ../../reference/import.rst:677 msgid "" "``__path__`` must be an iterable of strings, but it may be empty. The same " "rules used for :data:`sys.path` also apply to a package's ``__path__``, and :" @@ -925,7 +937,7 @@ msgid "" "package's ``__path__``." msgstr "" -#: ../../reference/import.rst:674 +#: ../../reference/import.rst:682 msgid "" "A package's ``__init__.py`` file may set or alter the package's ``__path__`` " "attribute, and this was typically the way namespace packages were " @@ -935,18 +947,18 @@ msgid "" "``__path__`` correctly for the namespace package." msgstr "" -#: ../../reference/import.rst:682 +#: ../../reference/import.rst:690 msgid "Module reprs" msgstr "" -#: ../../reference/import.rst:684 +#: ../../reference/import.rst:692 msgid "" "By default, all modules have a usable repr, however depending on the " "attributes set above, and in the module's spec, you can more explicitly " "control the repr of module objects." msgstr "" -#: ../../reference/import.rst:688 +#: ../../reference/import.rst:696 msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " @@ -956,45 +968,45 @@ msgid "" "for whatever information is missing." msgstr "" -#: ../../reference/import.rst:695 +#: ../../reference/import.rst:703 msgid "Here are the exact rules used:" msgstr "" -#: ../../reference/import.rst:697 +#: ../../reference/import.rst:705 msgid "" "If the module has a ``__spec__`` attribute, the information in the spec is " "used to generate the repr. The \"name\", \"loader\", \"origin\", and " "\"has_location\" attributes are consulted." msgstr "" -#: ../../reference/import.rst:701 +#: ../../reference/import.rst:709 msgid "" "If the module has a ``__file__`` attribute, this is used as part of the " "module's repr." msgstr "" -#: ../../reference/import.rst:704 +#: ../../reference/import.rst:712 msgid "" "If the module has no ``__file__`` but does have a ``__loader__`` that is not " "``None``, then the loader's repr is used as part of the module's repr." msgstr "" -#: ../../reference/import.rst:707 +#: ../../reference/import.rst:715 msgid "Otherwise, just use the module's ``__name__`` in the repr." msgstr "" -#: ../../reference/import.rst:709 +#: ../../reference/import.rst:717 msgid "" "Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was " "removed in Python 3.12 and is no longer called during the resolution of a " "module's repr." msgstr "" -#: ../../reference/import.rst:717 +#: ../../reference/import.rst:725 msgid "Cached bytecode invalidation" msgstr "" -#: ../../reference/import.rst:719 +#: ../../reference/import.rst:727 msgid "" "Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " @@ -1004,7 +1016,7 @@ msgid "" "source's metadata." msgstr "" -#: ../../reference/import.rst:726 +#: ../../reference/import.rst:734 msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " @@ -1018,17 +1030,17 @@ msgid "" "option:`--check-hash-based-pycs` flag." msgstr "" -#: ../../reference/import.rst:737 +#: ../../reference/import.rst:745 msgid "" "Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-" "based invalidation of bytecode caches." msgstr "" -#: ../../reference/import.rst:743 +#: ../../reference/import.rst:751 msgid "The Path Based Finder" msgstr "" -#: ../../reference/import.rst:748 +#: ../../reference/import.rst:756 msgid "" "As mentioned previously, Python comes with several default meta path " "finders. One of these, called the :term:`path based finder` (:class:" @@ -1037,14 +1049,14 @@ msgid "" "a location to search for modules." msgstr "" -#: ../../reference/import.rst:754 +#: ../../reference/import.rst:762 msgid "" "The path based finder itself doesn't know how to import anything. Instead, " "it traverses the individual path entries, associating each of them with a " "path entry finder that knows how to handle that particular kind of path." msgstr "" -#: ../../reference/import.rst:758 +#: ../../reference/import.rst:766 msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " @@ -1055,14 +1067,14 @@ msgid "" "from zipfiles." msgstr "" -#: ../../reference/import.rst:765 +#: ../../reference/import.rst:773 msgid "" "Path entries need not be limited to file system locations. They can refer " "to URLs, database queries, or any other location that can be specified as a " "string." msgstr "" -#: ../../reference/import.rst:769 +#: ../../reference/import.rst:777 msgid "" "The path based finder provides additional hooks and protocols so that you " "can extend and customize the types of searchable path entries. For example, " @@ -1073,7 +1085,7 @@ msgid "" "from the web." msgstr "" -#: ../../reference/import.rst:777 +#: ../../reference/import.rst:785 msgid "" "A word of warning: this section and the previous both use the term *finder*, " "distinguishing between them by using the terms :term:`meta path finder` and :" @@ -1084,7 +1096,7 @@ msgid "" "process, as keyed off the :data:`sys.meta_path` traversal." msgstr "" -#: ../../reference/import.rst:785 +#: ../../reference/import.rst:793 msgid "" "By contrast, path entry finders are in a sense an implementation detail of " "the path based finder, and in fact, if the path based finder were to be " @@ -1092,11 +1104,11 @@ msgid "" "would be invoked." msgstr "" -#: ../../reference/import.rst:792 +#: ../../reference/import.rst:800 msgid "Path entry finders" msgstr "" -#: ../../reference/import.rst:800 +#: ../../reference/import.rst:808 msgid "" "The :term:`path based finder` is responsible for finding and loading Python " "modules and packages whose location is specified with a string :term:`path " @@ -1104,7 +1116,7 @@ msgid "" "not be limited to this." msgstr "" -#: ../../reference/import.rst:805 +#: ../../reference/import.rst:813 msgid "" "As a meta path finder, the :term:`path based finder` implements the :meth:" "`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " @@ -1112,7 +1124,7 @@ msgid "" "modules are found and loaded from the :term:`import path`." msgstr "" -#: ../../reference/import.rst:810 +#: ../../reference/import.rst:818 msgid "" "Three variables are used by the :term:`path based finder`, :data:`sys." "path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " @@ -1120,7 +1132,7 @@ msgid "" "additional ways that the import machinery can be customized." msgstr "" -#: ../../reference/import.rst:815 +#: ../../reference/import.rst:823 msgid "" ":data:`sys.path` contains a list of strings providing search locations for " "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " @@ -1132,7 +1144,7 @@ msgid "" "other data types are ignored." msgstr "" -#: ../../reference/import.rst:824 +#: ../../reference/import.rst:832 msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " @@ -1144,7 +1156,7 @@ msgid "" "top level import and :data:`sys.path` is used." msgstr "" -#: ../../reference/import.rst:833 +#: ../../reference/import.rst:841 msgid "" "The path based finder iterates over every entry in the search path, and for " "each of these, looks for an appropriate :term:`path entry finder` (:class:" @@ -1160,7 +1172,7 @@ msgid "" "finder to perform the path entry search again." msgstr "" -#: ../../reference/import.rst:846 +#: ../../reference/import.rst:854 msgid "" "If the path entry is not present in the cache, the path based finder " "iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" @@ -1176,7 +1188,7 @@ msgid "" "decode the argument, it should raise :exc:`ImportError`." msgstr "" -#: ../../reference/import.rst:860 +#: ../../reference/import.rst:868 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " "being returned, then the path based finder's :meth:`~importlib.machinery." @@ -1186,7 +1198,7 @@ msgid "" "could not find the module." msgstr "" -#: ../../reference/import.rst:867 +#: ../../reference/import.rst:875 msgid "" "If a :term:`path entry finder` *is* returned by one of the :term:`path entry " "hook` callables on :data:`sys.path_hooks`, then the following protocol is " @@ -1194,7 +1206,7 @@ msgid "" "the module." msgstr "" -#: ../../reference/import.rst:872 +#: ../../reference/import.rst:880 msgid "" "The current working directory -- denoted by an empty string -- is handled " "slightly differently from other entries on :data:`sys.path`. First, if the " @@ -1206,18 +1218,18 @@ msgid "" "and not the empty string." msgstr "" -#: ../../reference/import.rst:882 +#: ../../reference/import.rst:890 msgid "Path entry finder protocol" msgstr "" -#: ../../reference/import.rst:884 +#: ../../reference/import.rst:892 msgid "" "In order to support imports of modules and initialized packages and also to " "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" -#: ../../reference/import.rst:888 +#: ../../reference/import.rst:896 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` takes two arguments: the " "fully qualified name of the module being imported, and the (optional) target " @@ -1225,21 +1237,21 @@ msgid "" "spec will always have \"loader\" set (with one exception)." msgstr "" -#: ../../reference/import.rst:893 +#: ../../reference/import.rst:901 msgid "" "To indicate to the import machinery that the spec represents a namespace :" "term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" -#: ../../reference/import.rst:897 +#: ../../reference/import.rst:905 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`!" "find_loader` and :meth:`!find_module`, both of which are now deprecated, but " "will be used if ``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:903 +#: ../../reference/import.rst:911 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1247,14 +1259,14 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:908 +#: ../../reference/import.rst:916 msgid "" ":meth:`!find_loader` takes one argument, the fully qualified name of the " "module being imported. ``find_loader()`` returns a 2-tuple where the first " "item is the loader and the second item is a namespace :term:`portion`." msgstr "" -#: ../../reference/import.rst:913 +#: ../../reference/import.rst:921 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1264,7 +1276,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:920 +#: ../../reference/import.rst:928 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1273,28 +1285,28 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:926 +#: ../../reference/import.rst:934 msgid "" "Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " "will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:931 +#: ../../reference/import.rst:939 msgid "``find_module()`` and ``find_loader()`` have been removed." msgstr "" -#: ../../reference/import.rst:936 +#: ../../reference/import.rst:944 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:938 +#: ../../reference/import.rst:946 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:942 +#: ../../reference/import.rst:950 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1303,7 +1315,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:948 +#: ../../reference/import.rst:956 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1313,11 +1325,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:958 +#: ../../reference/import.rst:966 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:960 +#: ../../reference/import.rst:968 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1325,7 +1337,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:965 +#: ../../reference/import.rst:973 msgid "" "package/\n" " __init__.py\n" @@ -1349,13 +1361,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:976 +#: ../../reference/import.rst:984 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:979 +#: ../../reference/import.rst:987 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1371,28 +1383,28 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:986 +#: ../../reference/import.rst:994 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:990 +#: ../../reference/import.rst:998 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:992 +#: ../../reference/import.rst:1000 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:999 +#: ../../reference/import.rst:1007 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:1001 +#: ../../reference/import.rst:1009 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " @@ -1403,17 +1415,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:1012 +#: ../../reference/import.rst:1020 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:1014 +#: ../../reference/import.rst:1022 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:1017 +#: ../../reference/import.rst:1025 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1421,30 +1433,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:1022 +#: ../../reference/import.rst:1030 msgid "" "In :ref:`the remaining cases ` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:1026 +#: ../../reference/import.rst:1034 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:1027 +#: ../../reference/import.rst:1035 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:1028 +#: ../../reference/import.rst:1036 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:1029 +#: ../../reference/import.rst:1037 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:1031 +#: ../../reference/import.rst:1039 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1452,7 +1464,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:1036 +#: ../../reference/import.rst:1044 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1461,11 +1473,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:1044 +#: ../../reference/import.rst:1052 msgid "References" msgstr "" -#: ../../reference/import.rst:1046 +#: ../../reference/import.rst:1054 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:1058 +#: ../../reference/import.rst:1066 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1061 +#: ../../reference/import.rst:1069 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1065 +#: ../../reference/import.rst:1073 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1067 +#: ../../reference/import.rst:1075 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1512,15 +1524,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1074 +#: ../../reference/import.rst:1082 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1075 +#: ../../reference/import.rst:1083 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:1077 +#: ../../reference/import.rst:1085 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1602,22 +1614,22 @@ msgstr "sys.meta_path" msgid "find_spec" msgstr "find_spec" -#: ../../reference/import.rst:745 +#: ../../reference/import.rst:753 msgid "path based finder" msgstr "path based finder(基於路徑的搜尋器)" -#: ../../reference/import.rst:794 +#: ../../reference/import.rst:802 msgid "sys.path" msgstr "sys.path" -#: ../../reference/import.rst:794 +#: ../../reference/import.rst:802 msgid "sys.path_hooks" msgstr "sys.path_hooks" -#: ../../reference/import.rst:794 +#: ../../reference/import.rst:802 msgid "sys.path_importer_cache" msgstr "sys.path_importer_cache" -#: ../../reference/import.rst:794 +#: ../../reference/import.rst:802 msgid "PYTHONPATH" msgstr "PYTHONPATH" diff --git a/sphinx.po b/sphinx.po index d0a08b7cd3..624ab422c9 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,15 +37,16 @@ msgstr "顯示原始碼" msgid "Download" msgstr "下載" -#: ../../tools/templates/download.html:14 -msgid "Download Python %(release)s Documentation" +#: ../../tools/templates/download.html:16 +#, fuzzy +msgid "Download Python %(dl_version)s Documentation" msgstr "下載 Python %(release)s 說明文件" -#: ../../tools/templates/download.html:16 +#: ../../tools/templates/download.html:18 msgid "Last updated on: %(last_updated)s." msgstr "最後更新時間:%(last_updated)s。" -#: ../../tools/templates/download.html:18 +#: ../../tools/templates/download.html:20 msgid "" "To download an archive containing all the documents for this version of\n" "Python in one of various formats, follow one of links in this table." @@ -53,119 +54,128 @@ msgstr "" "要下載包含這個 Python 版本所有文件的歸檔,可以遵循這個表格中的其中一個連結," "以取得各種格式的文件。" -#: ../../tools/templates/download.html:23 +#: ../../tools/templates/download.html:25 msgid "Format" msgstr "格式" -#: ../../tools/templates/download.html:24 +#: ../../tools/templates/download.html:26 msgid "Packed as .zip" msgstr "打包成 .zip" -#: ../../tools/templates/download.html:25 +#: ../../tools/templates/download.html:27 msgid "Packed as .tar.bz2" msgstr "打包成 .tar.bz2" -#: ../../tools/templates/download.html:28 +#: ../../tools/templates/download.html:30 msgid "PDF" msgstr "" -#: ../../tools/templates/download.html:29 +#: ../../tools/templates/download.html:31 +#, fuzzy msgid "" -"Download (ca. " -"%(download_size)s MiB)" +"Download " +"(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:30 +#: ../../tools/templates/download.html:32 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download (ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:33 +#: ../../tools/templates/download.html:35 msgid "HTML" msgstr "HTML" -#: ../../tools/templates/download.html:34 +#: ../../tools/templates/download.html:36 +#, fuzzy msgid "" -"Download (ca. " -"%(download_size)s MiB)" +"Download " +"(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:35 +#: ../../tools/templates/download.html:37 +#, fuzzy msgid "" -"Download " +"Download " "(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:38 +#: ../../tools/templates/download.html:40 msgid "Plain text" msgstr "純文字" -#: ../../tools/templates/download.html:39 +#: ../../tools/templates/download.html:41 +#, fuzzy msgid "" -"Download (ca. " -"%(download_size)s MiB)" +"Download " +"(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:40 +#: ../../tools/templates/download.html:42 +#, fuzzy msgid "" -"Download " +"Download " "(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:43 +#: ../../tools/templates/download.html:45 msgid "Texinfo" msgstr "Texinfo" -#: ../../tools/templates/download.html:44 +#: ../../tools/templates/download.html:46 +#, fuzzy msgid "" -"Download (ca. " -"%(download_size)s MiB)" +"Download " +"(ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:45 +#: ../../tools/templates/download.html:47 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download (ca. %(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:48 +#: ../../tools/templates/download.html:50 msgid "EPUB" msgstr "EPUB" -#: ../../tools/templates/download.html:49 +#: ../../tools/templates/download.html:51 +#, fuzzy msgid "" -"Download (ca. " +"Download (ca. " "%(download_size)s MiB)" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:54 +#: ../../tools/templates/download.html:56 msgid "These archives contain all the content in the documentation." msgstr "這些歸檔包含了說明文件中的所有內容。" -#: ../../tools/templates/download.html:57 +#: ../../tools/templates/download.html:59 msgid "Unpacking" msgstr "解壓縮" -#: ../../tools/templates/download.html:59 +#: ../../tools/templates/download.html:61 msgid "" "Unix users should download the .tar.bz2 archives; these are bzipped tar\n" "archives and can be handled in the usual way using tar and the bzip2\n" @@ -180,7 +190,7 @@ msgstr "" "net\">Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸檔提供最佳壓縮率和最" "快的下載時間。" -#: ../../tools/templates/download.html:65 +#: ../../tools/templates/download.html:67 msgid "" "Windows users can use the ZIP archives since those are customary on that\n" "platform. These are created on Unix using the Info-ZIP zip program." @@ -188,11 +198,11 @@ msgstr "" "Windows 使用者可以使用 ZIP 歸檔,因為這在該平台上是常見的。這些是在 Unix 上使" "用 Info-ZIP zip 程式建立的。" -#: ../../tools/templates/download.html:69 +#: ../../tools/templates/download.html:71 msgid "Problems" msgstr "問題" -#: ../../tools/templates/download.html:71 +#: ../../tools/templates/download.html:73 msgid "" "If you have comments or suggestions for the Python documentation, please " "send\n" diff --git a/tutorial/classes.po b/tutorial/classes.po index f102da185e..4341d855f9 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -529,11 +529,12 @@ msgstr "" " return 'hello world'" #: ../../tutorial/classes.rst:276 +#, fuzzy msgid "" "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " "returning an integer and a function object, respectively. Class attributes " "can also be assigned to, so you can change the value of ``MyClass.i`` by " -"assignment. :attr:`!__doc__` is also a valid attribute, returning the " +"assignment. :attr:`~type.__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" @@ -1699,13 +1700,14 @@ msgid "Footnotes" msgstr "註解" #: ../../tutorial/classes.rst:933 +#, fuzzy msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " -"implement the module's namespace; the name :attr:`~object.__dict__` is an " -"attribute but not a global name. Obviously, using this violates the " -"abstraction of namespace implementation, and should be restricted to things " -"like post-mortem debuggers." +"implement the module's namespace; the name ``__dict__`` is an attribute but " +"not a global name. Obviously, using this violates the abstraction of " +"namespace implementation, and should be restricted to things like post-" +"mortem debuggers." msgstr "" "有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`,它回" "傳用於實作模組命名空間的 dictionary;:attr:`~object.__dict__` 這個名稱是一個" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 58684f4aa7..a87bcb53cc 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -293,56 +293,122 @@ msgstr "" "`tut-structures`\\ 章節中,我們會討論更多關於 :func:`list` 的細節。" #: ../../tutorial/controlflow.rst:164 -msgid "" -":keyword:`!break` and :keyword:`!continue` Statements, and :keyword:`!else` " -"Clauses on Loops" +#, fuzzy +msgid ":keyword:`!break` and :keyword:`!continue` Statements" msgstr "" "迴圈內的 :keyword:`!break` 和 :keyword:`!continue` 陳述式及 :keyword:`!else` " "子句" #: ../../tutorial/controlflow.rst:166 +#, fuzzy msgid "" "The :keyword:`break` statement breaks out of the innermost enclosing :" -"keyword:`for` or :keyword:`while` loop." +"keyword:`for` or :keyword:`while` loop::" msgstr "" ":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :keyword:" "`while` 迴圈。" #: ../../tutorial/controlflow.rst:169 msgid "" -"A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " -"clause." +">>> for n in range(2, 10):\n" +"... for x in range(2, n):\n" +"... if n % x == 0:\n" +"... print(f\"{n} equals {x} * {n//x}\")\n" +"... break\n" +"...\n" +"4 equals 2 * 2\n" +"6 equals 2 * 3\n" +"8 equals 2 * 4\n" +"9 equals 3 * 3" msgstr "" -":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` 子句" -#: ../../tutorial/controlflow.rst:171 +#: ../../tutorial/controlflow.rst:180 +#, fuzzy +msgid "" +"The :keyword:`continue` statement continues with the next iteration of the " +"loop::" +msgstr "" +":keyword:`continue` 陳述式,亦承襲於 C 語言,讓所屬的迴圈繼續執行下個疊" +"代: ::" + +#: ../../tutorial/controlflow.rst:183 +#, fuzzy +msgid "" +">>> for num in range(2, 10):\n" +"... if num % 2 == 0:\n" +"... print(f\"Found an even number {num}\")\n" +"... continue\n" +"... print(f\"Found an odd number {num}\")\n" +"...\n" +"Found an even number 2\n" +"Found an odd number 3\n" +"Found an even number 4\n" +"Found an odd number 5\n" +"Found an even number 6\n" +"Found an odd number 7\n" +"Found an even number 8\n" +"Found an odd number 9" +msgstr "" +">>> for num in range(2, 10):\n" +"... if num % 2 == 0:\n" +"... print(\"Found an even number\", num)\n" +"... continue\n" +"... print(\"Found an odd number\", num)\n" +"...\n" +"Found an even number 2\n" +"Found an odd number 3\n" +"Found an even number 4\n" +"Found an odd number 5\n" +"Found an even number 6\n" +"Found an odd number 7\n" +"Found an even number 8\n" +"Found an odd number 9" + +#: ../../tutorial/controlflow.rst:201 +#, fuzzy +msgid ":keyword:`!else` Clauses on Loops" +msgstr ":keyword:`!pass` 陳述式" + +#: ../../tutorial/controlflow.rst:203 +msgid "" +"In a :keyword:`!for` or :keyword:`!while` loop the :keyword:`!break` " +"statement may be paired with an :keyword:`!else` clause. If the loop " +"finishes without executing the :keyword:`!break`, the :keyword:`!else` " +"clause executes." +msgstr "" + +#: ../../tutorial/controlflow.rst:207 +#, fuzzy msgid "" "In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " -"loop reaches its final iteration." +"loop finishes its final iteration, that is, if no break occurred." msgstr "" "在 :keyword:`for` 迴圈中,:keyword:`!else` 子句會在迴圈到達最終的疊代後執行。" -#: ../../tutorial/controlflow.rst:174 +#: ../../tutorial/controlflow.rst:210 msgid "" "In a :keyword:`while` loop, it's executed after the loop's condition becomes " "false." msgstr "在 :keyword:`while` 迴圈中,它會在迴圈條件變為 false 後執行。" -#: ../../tutorial/controlflow.rst:176 +#: ../../tutorial/controlflow.rst:212 +#, fuzzy msgid "" "In either kind of loop, the :keyword:`!else` clause is **not** executed if " -"the loop was terminated by a :keyword:`break`." +"the loop was terminated by a :keyword:`break`. Of course, other ways of " +"ending the loop early, such as a :keyword:`return` or a raised exception, " +"will also skip execution of the :keyword:`else` clause." msgstr "" "在任何一種迴圈中,如果迴圈由 :keyword:`break` 終止,則不會執行 :keyword:`!" "else` 子句。" -#: ../../tutorial/controlflow.rst:179 +#: ../../tutorial/controlflow.rst:217 msgid "" "This is exemplified in the following :keyword:`!for` loop, which searches " "for prime numbers::" msgstr "下面的 :keyword:`!for` 迴圈對此進行了舉例說明,該迴圈用以搜索質數: ::" -#: ../../tutorial/controlflow.rst:182 +#: ../../tutorial/controlflow.rst:220 msgid "" ">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" @@ -363,22 +429,33 @@ msgid "" "9 equals 3 * 3" msgstr "" -#: ../../tutorial/controlflow.rst:200 +#: ../../tutorial/controlflow.rst:238 +#, fuzzy msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " -"to the :keyword:`for` loop, **not** the :keyword:`if` statement.)" +"to the ``for`` loop, **not** the ``if`` statement.)" msgstr "" "(沒錯,這是正確的程式碼。請看仔細:``else`` 子句屬於 :keyword:`for` 迴圈,**" "並非** :keyword:`if` 陳述式。)" -#: ../../tutorial/controlflow.rst:203 +#: ../../tutorial/controlflow.rst:241 +msgid "" +"One way to think of the else clause is to imagine it paired with the ``if`` " +"inside the loop. As the loop executes, it will run a sequence like if/if/if/" +"else. The ``if`` is inside the loop, encountered a number of times. If the " +"condition is ever true, a ``break`` will happen. If the condition is never " +"true, the ``else`` clause outside the loop will execute." +msgstr "" + +#: ../../tutorial/controlflow.rst:247 +#, fuzzy 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 :" -"keyword:`if` statements: a :keyword:`try` statement's ``else`` clause runs " -"when no exception occurs, and a loop's ``else`` clause runs when no " -"``break`` occurs. For more on the :keyword:`!try` statement and exceptions, " -"see :ref:`tut-handling`." +"``else`` clause of a :keyword:`try` statement than it does with that of " +"``if`` statements: a ``try`` statement's ``else`` clause runs when no " +"exception occurs, and a loop's ``else`` clause runs when no ``break`` " +"occurs. For more on the ``try`` statement and exceptions, see :ref:`tut-" +"handling`." msgstr "" "當 ``else`` 子句用於迴圈時,相較於搭配 :keyword:`if` 陳述式使用,它的行為與 :" "keyword:`try` 陳述式中的 ``else`` 子句更為相似::keyword:`try` 陳述式的 " @@ -386,51 +463,11 @@ msgstr "" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" "\\ :ref:`tut-handling`。" -#: ../../tutorial/controlflow.rst:210 -msgid "" -"The :keyword:`continue` statement, also borrowed from C, continues with the " -"next iteration of the loop::" -msgstr "" -":keyword:`continue` 陳述式,亦承襲於 C 語言,讓所屬的迴圈繼續執行下個疊" -"代: ::" - -#: ../../tutorial/controlflow.rst:213 -msgid "" -">>> for num in range(2, 10):\n" -"... if num % 2 == 0:\n" -"... print(\"Found an even number\", num)\n" -"... continue\n" -"... print(\"Found an odd number\", num)\n" -"...\n" -"Found an even number 2\n" -"Found an odd number 3\n" -"Found an even number 4\n" -"Found an odd number 5\n" -"Found an even number 6\n" -"Found an odd number 7\n" -"Found an even number 8\n" -"Found an odd number 9" -msgstr "" -">>> for num in range(2, 10):\n" -"... if num % 2 == 0:\n" -"... print(\"Found an even number\", num)\n" -"... continue\n" -"... print(\"Found an odd number\", num)\n" -"...\n" -"Found an even number 2\n" -"Found an odd number 3\n" -"Found an even number 4\n" -"Found an odd number 5\n" -"Found an even number 6\n" -"Found an odd number 7\n" -"Found an even number 8\n" -"Found an odd number 9" - -#: ../../tutorial/controlflow.rst:231 +#: ../../tutorial/controlflow.rst:256 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:233 +#: ../../tutorial/controlflow.rst:258 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::" @@ -438,18 +475,18 @@ msgstr "" ":keyword:`pass` 陳述式不執行任何動作。它可用在語法上需要一個陳述式但程式不需" "要執行任何動作的時候。例如: ::" -#: ../../tutorial/controlflow.rst:236 +#: ../../tutorial/controlflow.rst:261 msgid "" ">>> while True:\n" "... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n" "..." msgstr "" -#: ../../tutorial/controlflow.rst:240 +#: ../../tutorial/controlflow.rst:265 msgid "This is commonly used for creating minimal classes::" msgstr "這經常用於建立簡單的 class(類別): ::" -#: ../../tutorial/controlflow.rst:242 +#: ../../tutorial/controlflow.rst:267 msgid "" ">>> class MyEmptyClass:\n" "... pass\n" @@ -459,7 +496,7 @@ msgstr "" "... pass\n" "..." -#: ../../tutorial/controlflow.rst:246 +#: ../../tutorial/controlflow.rst:271 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 " @@ -469,18 +506,18 @@ msgstr "" ":keyword:`pass` 亦可作為一個函式或條件判斷主體的預留位置,在你撰寫新的程式碼" "時讓你保持在更抽象的思維層次。:keyword:`!pass` 會直接被忽略: ::" -#: ../../tutorial/controlflow.rst:250 +#: ../../tutorial/controlflow.rst:275 msgid "" ">>> def initlog(*args):\n" "... pass # Remember to implement this!\n" "..." msgstr "" -#: ../../tutorial/controlflow.rst:258 +#: ../../tutorial/controlflow.rst:283 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 陳述式" -#: ../../tutorial/controlflow.rst:260 +#: ../../tutorial/controlflow.rst:285 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 " @@ -496,14 +533,14 @@ msgstr "" "言中的模式匹配 (pattern matching) 更為相近。只有第一個匹配成功的模式會被執" "行,而它也可以將成分(序列元素或物件屬性)從值中提取到變數中。" -#: ../../tutorial/controlflow.rst:268 +#: ../../tutorial/controlflow.rst:293 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" "最簡單的形式,是將一個主題值 (subject value) 與一個或多個字面值 (literal) 進" "行比較: ::" -#: ../../tutorial/controlflow.rst:270 +#: ../../tutorial/controlflow.rst:295 msgid "" "def http_error(status):\n" " match status:\n" @@ -527,7 +564,7 @@ msgstr "" " case _:\n" " return \"Something's wrong with the internet\"" -#: ../../tutorial/controlflow.rst:281 +#: ../../tutorial/controlflow.rst:306 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." @@ -535,12 +572,12 @@ msgstr "" "請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角" "色,且永遠不會匹配失敗。如果沒有 case 匹配成功,則不會執行任何的分支。" -#: ../../tutorial/controlflow.rst:284 +#: ../../tutorial/controlflow.rst:309 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|``\\ (「或」)來將多個字面值組合在單一模式中: ::" -#: ../../tutorial/controlflow.rst:286 +#: ../../tutorial/controlflow.rst:311 msgid "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" @@ -548,14 +585,14 @@ msgstr "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" -#: ../../tutorial/controlflow.rst:289 +#: ../../tutorial/controlflow.rst:314 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" msgstr "" "模式可以看起來像是拆解賦值 (unpacking assignment),且可以用來連結變數: ::" -#: ../../tutorial/controlflow.rst:292 +#: ../../tutorial/controlflow.rst:317 msgid "" "# point is an (x, y) tuple\n" "match point:\n" @@ -571,7 +608,7 @@ msgid "" " raise ValueError(\"Not a point\")" msgstr "" -#: ../../tutorial/controlflow.rst:305 +#: ../../tutorial/controlflow.rst:330 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 " @@ -585,7 +622,7 @@ msgstr "" "(bind)* 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在概" "念上類似於拆解賦值 ``(x, y) = point``。" -#: ../../tutorial/controlflow.rst:312 +#: ../../tutorial/controlflow.rst:337 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 " @@ -594,7 +631,7 @@ msgstr "" "如果你要用 class 來結構化你的資料,你可以使用該 class 的名稱加上一個引數列" "表,類似一個建構式 (constructor),但它能夠將屬性擷取到變數中: ::" -#: ../../tutorial/controlflow.rst:316 +#: ../../tutorial/controlflow.rst:341 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -632,7 +669,7 @@ msgstr "" " case _:\n" " print(\"Not a point\")" -#: ../../tutorial/controlflow.rst:334 +#: ../../tutorial/controlflow.rst:359 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 " @@ -646,7 +683,7 @@ msgstr "" "``__match_args__``,來定義模式中屬性們的特定位置。如果它被設定為 (\"x\", " "\"y\"),則以下的模式都是等價的(且都會將屬性 ``y`` 連結到變數 ``var``): ::" -#: ../../tutorial/controlflow.rst:340 +#: ../../tutorial/controlflow.rst:365 msgid "" "Point(1, var)\n" "Point(1, y=var)\n" @@ -658,7 +695,7 @@ msgstr "" "Point(x=1, y=var)\n" "Point(y=var, x=1)" -#: ../../tutorial/controlflow.rst:345 +#: ../../tutorial/controlflow.rst:370 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 " @@ -674,7 +711,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:352 +#: ../../tutorial/controlflow.rst:377 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" @@ -682,7 +719,7 @@ msgstr "" "模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 " "list,我們就可以像這樣加入 ``__match_args__`` 來對它進行匹配: ::" -#: ../../tutorial/controlflow.rst:355 +#: ../../tutorial/controlflow.rst:380 msgid "" "class Point:\n" " __match_args__ = ('x', 'y')\n" @@ -720,7 +757,7 @@ msgstr "" " case _:\n" " print(\"Something else\")" -#: ../../tutorial/controlflow.rst:373 +#: ../../tutorial/controlflow.rst:398 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 " @@ -730,7 +767,7 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的擷取會發生在防護的評估之" "前: ::" -#: ../../tutorial/controlflow.rst:377 +#: ../../tutorial/controlflow.rst:402 msgid "" "match point:\n" " case Point(x, y) if x == y:\n" @@ -744,11 +781,11 @@ msgstr "" " case Point(x, y):\n" " print(f\"Not on the diagonal\")" -#: ../../tutorial/controlflow.rst:383 +#: ../../tutorial/controlflow.rst:408 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:385 +#: ../../tutorial/controlflow.rst:410 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -757,7 +794,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:389 +#: ../../tutorial/controlflow.rst:414 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -769,7 +806,7 @@ msgstr "" "``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外的其" "餘項。" -#: ../../tutorial/controlflow.rst:394 +#: ../../tutorial/controlflow.rst:419 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -781,15 +818,15 @@ msgstr "" "式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支援" "的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:399 +#: ../../tutorial/controlflow.rst:424 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "使用關鍵字 ``as`` 可以擷取子模式 (subpattern): ::" -#: ../../tutorial/controlflow.rst:401 +#: ../../tutorial/controlflow.rst:426 msgid "case (Point(x1, y1), Point(x2, y2) as p2): ..." msgstr "case (Point(x1, y1), Point(x2, y2) as p2): ..." -#: ../../tutorial/controlflow.rst:403 +#: ../../tutorial/controlflow.rst:428 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -797,7 +834,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:406 +#: ../../tutorial/controlflow.rst:431 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -805,7 +842,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``、``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:409 +#: ../../tutorial/controlflow.rst:434 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -813,7 +850,7 @@ msgstr "" "模式可以使用附名常數 (named constant)。這些模式必須是點分隔名稱,以免它們被解" "釋為擷取變數: ::" -#: ../../tutorial/controlflow.rst:412 +#: ../../tutorial/controlflow.rst:437 msgid "" "from enum import Enum\n" "class Color(Enum):\n" @@ -847,24 +884,24 @@ msgstr "" " case Color.BLUE:\n" " print(\"I'm feeling the blues :(\")" -#: ../../tutorial/controlflow.rst:428 +#: ../../tutorial/controlflow.rst:453 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:434 +#: ../../tutorial/controlflow.rst:459 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:436 +#: ../../tutorial/controlflow.rst:461 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" msgstr "我們可以建立一個函式來產生費式數列到任何一個上界: ::" -#: ../../tutorial/controlflow.rst:439 +#: ../../tutorial/controlflow.rst:464 msgid "" ">>> def fib(n): # write Fibonacci series up to n\n" "... \"\"\"Print a Fibonacci series up to n.\"\"\"\n" @@ -879,7 +916,7 @@ msgid "" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" msgstr "" -#: ../../tutorial/controlflow.rst:456 +#: ../../tutorial/controlflow.rst:481 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -889,7 +926,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*。它之後必須連著該函式的名稱和置" "於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:486 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:" @@ -905,7 +942,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:468 +#: ../../tutorial/controlflow.rst:493 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -926,7 +963,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:479 +#: ../../tutorial/controlflow.rst:504 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 " @@ -940,7 +977,7 @@ msgstr "" "永遠是一個物件的\\ *參照 (reference)*,而不是該物件的值)。 [#]_ 當一個函式呼" "叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號表。" -#: ../../tutorial/controlflow.rst:486 +#: ../../tutorial/controlflow.rst:511 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -951,7 +988,7 @@ msgstr "" "直譯器辨識為使用者自定函式 (user-defined function)。該值可以被指定給別的變數" "名,使該變數名也可以被當作函式使用。這是常見的重新命名方式: ::" -#: ../../tutorial/controlflow.rst:491 +#: ../../tutorial/controlflow.rst:516 msgid "" ">>> fib\n" "\n" @@ -965,7 +1002,7 @@ msgstr "" ">>> f(100)\n" "0 1 1 2 3 5 8 13 21 34 55 89" -#: ../../tutorial/controlflow.rst:497 +#: ../../tutorial/controlflow.rst:522 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 " @@ -980,7 +1017,7 @@ msgstr "" "亦有一個固定的回傳值。這個值稱為 ``None``\\ (它是一個內建名稱)。在直譯器中" "單獨使用 ``None`` 時,通常不會被顯示。你可以使用 :func:`print` 來看到它: ::" -#: ../../tutorial/controlflow.rst:504 +#: ../../tutorial/controlflow.rst:529 msgid "" ">>> fib(0)\n" ">>> print(fib(0))\n" @@ -990,13 +1027,13 @@ msgstr "" ">>> print(fib(0))\n" "None" -#: ../../tutorial/controlflow.rst:508 +#: ../../tutorial/controlflow.rst:533 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" msgstr "如果要寫一個函式回傳費式數列的 list 而不是直接印出它,這也很容易: ::" -#: ../../tutorial/controlflow.rst:511 +#: ../../tutorial/controlflow.rst:536 msgid "" ">>> def fib2(n): # return Fibonacci series up to n\n" "... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" @@ -1012,11 +1049,11 @@ msgid "" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" msgstr "" -#: ../../tutorial/controlflow.rst:524 +#: ../../tutorial/controlflow.rst:549 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:526 +#: ../../tutorial/controlflow.rst:551 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -1026,7 +1063,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``。一個函式執行到結束也會回傳 " "``None``。" -#: ../../tutorial/controlflow.rst:530 +#: ../../tutorial/controlflow.rst:555 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 " @@ -1049,22 +1086,22 @@ msgstr "" "義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同於 " "``result = result + [a]``,但更有效率。" -#: ../../tutorial/controlflow.rst:545 +#: ../../tutorial/controlflow.rst:570 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:547 +#: ../../tutorial/controlflow.rst:572 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:554 +#: ../../tutorial/controlflow.rst:579 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:556 +#: ../../tutorial/controlflow.rst:581 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 " @@ -1073,7 +1110,7 @@ msgstr "" "為一個或多個引數指定預設值是很有用的方式。函式建立後,可以用比定義時更少的引" "數呼叫該函式。例如: ::" -#: ../../tutorial/controlflow.rst:560 +#: ../../tutorial/controlflow.rst:585 msgid "" "def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" " while True:\n" @@ -1099,22 +1136,22 @@ msgstr "" " raise ValueError('invalid user response')\n" " print(reminder)" -#: ../../tutorial/controlflow.rst:572 +#: ../../tutorial/controlflow.rst:597 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:574 +#: ../../tutorial/controlflow.rst:599 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:576 +#: ../../tutorial/controlflow.rst:601 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:578 +#: ../../tutorial/controlflow.rst:603 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -1122,19 +1159,19 @@ msgstr "" "給予所有引數:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or " "no!')``" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:606 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:584 +#: ../../tutorial/controlflow.rst:609 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" msgstr "預設值是在函式定義當下,於\\ *定義時*\\ 的作用域中求值,所以: ::" -#: ../../tutorial/controlflow.rst:587 +#: ../../tutorial/controlflow.rst:612 msgid "" "i = 5\n" "\n" @@ -1152,11 +1189,11 @@ msgstr "" "i = 6\n" "f()" -#: ../../tutorial/controlflow.rst:595 +#: ../../tutorial/controlflow.rst:620 msgid "will print ``5``." msgstr "將會輸出 ``5``。" -#: ../../tutorial/controlflow.rst:597 +#: ../../tutorial/controlflow.rst:622 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, " @@ -1167,7 +1204,7 @@ msgstr "" "(字典)或許多類別實例時,會產生不同的結果。例如,以下函式於後續呼叫時會累積" "曾經傳遞的引數: ::" -#: ../../tutorial/controlflow.rst:602 +#: ../../tutorial/controlflow.rst:627 msgid "" "def f(a, L=[]):\n" " L.append(a)\n" @@ -1185,11 +1222,11 @@ msgstr "" "print(f(2))\n" "print(f(3))" -#: ../../tutorial/controlflow.rst:610 +#: ../../tutorial/controlflow.rst:635 msgid "This will print ::" msgstr "將會輸出: ::" -#: ../../tutorial/controlflow.rst:612 +#: ../../tutorial/controlflow.rst:637 msgid "" "[1]\n" "[1, 2]\n" @@ -1199,13 +1236,13 @@ msgstr "" "[1, 2]\n" "[1, 2, 3]" -#: ../../tutorial/controlflow.rst:616 +#: ../../tutorial/controlflow.rst:641 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:619 +#: ../../tutorial/controlflow.rst:644 msgid "" "def f(a, L=None):\n" " if L is None:\n" @@ -1219,11 +1256,11 @@ msgstr "" " L.append(a)\n" " return L" -#: ../../tutorial/controlflow.rst:629 +#: ../../tutorial/controlflow.rst:654 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:631 +#: ../../tutorial/controlflow.rst:656 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -1232,7 +1269,7 @@ msgstr "" "函式也可以使用\\ :term:`關鍵字引數 `,以 ``kwarg=value`` 的" "形式呼叫。舉例來說,以下函式: ::" -#: ../../tutorial/controlflow.rst:634 +#: ../../tutorial/controlflow.rst:659 msgid "" "def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" " print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -1246,7 +1283,7 @@ msgstr "" " print(\"-- Lovely plumage, the\", type)\n" " print(\"-- It's\", state, \"!\")" -#: ../../tutorial/controlflow.rst:640 +#: ../../tutorial/controlflow.rst:665 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -1255,7 +1292,7 @@ msgstr "" "接受一個必要引數 (``voltage``) 和三個選擇性引數 (``state``,``action``,和 " "``type``)。該函式可用下列任一方式呼叫: ::" -#: ../../tutorial/controlflow.rst:644 +#: ../../tutorial/controlflow.rst:669 msgid "" "parrot(1000) # 1 positional " "argument\n" @@ -1268,11 +1305,11 @@ msgid "" "keyword" msgstr "" -#: ../../tutorial/controlflow.rst:651 +#: ../../tutorial/controlflow.rst:676 msgid "but all the following calls would be invalid::" msgstr "但以下呼叫方式都無效: ::" -#: ../../tutorial/controlflow.rst:653 +#: ../../tutorial/controlflow.rst:678 msgid "" "parrot() # required argument missing\n" "parrot(voltage=5.0, 'dead') # non-keyword argument after a keyword " @@ -1281,7 +1318,7 @@ msgid "" "parrot(actor='John Cleese') # unknown keyword argument" msgstr "" -#: ../../tutorial/controlflow.rst:658 +#: ../../tutorial/controlflow.rst:683 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 " @@ -1297,7 +1334,7 @@ msgstr "" "則也包括必要引數,(\\ ``parrot(voltage=1000)`` 也有效)。一個引數不可多次被" "賦值,下面就是一個因此限制而無效的例子: ::" -#: ../../tutorial/controlflow.rst:666 +#: ../../tutorial/controlflow.rst:691 msgid "" ">>> def function(a):\n" "... pass\n" @@ -1315,7 +1352,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: function() got multiple values for argument 'a'" -#: ../../tutorial/controlflow.rst:674 +#: ../../tutorial/controlflow.rst:699 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -1331,7 +1368,7 @@ msgstr "" "個 :ref:`tuple `,該 tuple 包含一般參數以外的位置引數(\\ " "``*name`` 必須出現在 ``**name`` 前面)。例如,若我們定義這樣的函式: ::" -#: ../../tutorial/controlflow.rst:682 +#: ../../tutorial/controlflow.rst:707 msgid "" "def cheeseshop(kind, *arguments, **keywords):\n" " print(\"-- Do you have any\", kind, \"?\")\n" @@ -1351,11 +1388,11 @@ msgstr "" " for kw in keywords:\n" " print(kw, \":\", keywords[kw])" -#: ../../tutorial/controlflow.rst:691 +#: ../../tutorial/controlflow.rst:716 msgid "It could be called like this::" msgstr "它可以被如此呼叫: ::" -#: ../../tutorial/controlflow.rst:693 +#: ../../tutorial/controlflow.rst:718 msgid "" "cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" " \"It's really very, VERY runny, sir.\",\n" @@ -1369,11 +1406,11 @@ msgstr "" " client=\"John Cleese\",\n" " sketch=\"Cheese Shop Sketch\")" -#: ../../tutorial/controlflow.rst:699 +#: ../../tutorial/controlflow.rst:724 msgid "and of course it would print:" msgstr "輸出結果如下: ::" -#: ../../tutorial/controlflow.rst:701 +#: ../../tutorial/controlflow.rst:726 msgid "" "-- Do you have any Limburger ?\n" "-- I'm sorry, we're all out of Limburger\n" @@ -1393,17 +1430,17 @@ msgstr "" "client : John Cleese\n" "sketch : Cheese Shop Sketch" -#: ../../tutorial/controlflow.rst:712 +#: ../../tutorial/controlflow.rst:737 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:716 +#: ../../tutorial/controlflow.rst:741 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:718 +#: ../../tutorial/controlflow.rst:743 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 " @@ -1415,11 +1452,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:724 +#: ../../tutorial/controlflow.rst:749 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:726 +#: ../../tutorial/controlflow.rst:751 msgid "" "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" " ----------- ---------- ----------\n" @@ -1435,7 +1472,7 @@ msgstr "" " | - Keyword only\n" " -- Positional only" -#: ../../tutorial/controlflow.rst:735 +#: ../../tutorial/controlflow.rst:760 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-" @@ -1446,22 +1483,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:742 +#: ../../tutorial/controlflow.rst:767 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:744 +#: ../../tutorial/controlflow.rst:769 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:749 +#: ../../tutorial/controlflow.rst:774 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:751 +#: ../../tutorial/controlflow.rst:776 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 " @@ -1476,17 +1513,17 @@ msgstr "" "``\\ (斜線)之前。``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函式定義" "中沒有 ``/``,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:759 +#: ../../tutorial/controlflow.rst:784 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:763 +#: ../../tutorial/controlflow.rst:788 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:765 +#: ../../tutorial/controlflow.rst:790 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -1495,17 +1532,17 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*,表明參數必須以關鍵字引數傳遞,必須在引數列表中" "第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``。" -#: ../../tutorial/controlflow.rst:771 +#: ../../tutorial/controlflow.rst:796 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:773 +#: ../../tutorial/controlflow.rst:798 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" msgstr "請看以下的函式定義範例,注意 ``/`` 和 ``*`` 記號: ::" -#: ../../tutorial/controlflow.rst:776 +#: ../../tutorial/controlflow.rst:801 msgid "" ">>> def standard_arg(arg):\n" "... print(arg)\n" @@ -1531,7 +1568,7 @@ msgstr "" ">>> def combined_example(pos_only, /, standard, *, kwd_only):\n" "... print(pos_only, standard, kwd_only)" -#: ../../tutorial/controlflow.rst:789 +#: ../../tutorial/controlflow.rst:814 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -1540,7 +1577,7 @@ msgstr "" "第一個函式定義 ``standard_arg`` 是我們最熟悉的形式,對呼叫方式沒有任何限制," "可以按位置或關鍵字傳遞引數: ::" -#: ../../tutorial/controlflow.rst:793 +#: ../../tutorial/controlflow.rst:818 msgid "" ">>> standard_arg(2)\n" "2\n" @@ -1554,14 +1591,14 @@ msgstr "" ">>> standard_arg(arg=2)\n" "2" -#: ../../tutorial/controlflow.rst:799 +#: ../../tutorial/controlflow.rst:824 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" "第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``,因此僅限使用位置參數: ::" -#: ../../tutorial/controlflow.rst:802 +#: ../../tutorial/controlflow.rst:827 msgid "" ">>> pos_only_arg(1)\n" "1\n" @@ -1581,14 +1618,14 @@ msgstr "" "TypeError: pos_only_arg() got some positional-only arguments passed as " "keyword arguments: 'arg'" -#: ../../tutorial/controlflow.rst:810 +#: ../../tutorial/controlflow.rst:835 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" msgstr "" "第三個函式 ``kwd_only_args`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:813 +#: ../../tutorial/controlflow.rst:838 msgid "" ">>> kwd_only_arg(3)\n" "Traceback (most recent call last):\n" @@ -1606,13 +1643,13 @@ msgstr "" ">>> kwd_only_arg(arg=3)\n" "3" -#: ../../tutorial/controlflow.rst:821 +#: ../../tutorial/controlflow.rst:846 msgid "" "And the last uses all three calling conventions in the same function " "definition::" msgstr "最後一個函式在同一個函式定義中,使用了全部三種呼叫方式: ::" -#: ../../tutorial/controlflow.rst:824 +#: ../../tutorial/controlflow.rst:849 msgid "" ">>> combined_example(1, 2, 3)\n" "Traceback (most recent call last):\n" @@ -1648,7 +1685,7 @@ msgstr "" "TypeError: combined_example() got some positional-only arguments passed as " "keyword arguments: 'pos_only'" -#: ../../tutorial/controlflow.rst:841 +#: ../../tutorial/controlflow.rst:866 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -1657,7 +1694,7 @@ msgstr "" "最後,請看這個函式定義,如果 ``**kwds`` 內有 ``name`` 這個鍵,可能與位置引數 " "``name`` 產生潛在衝突: ::" -#: ../../tutorial/controlflow.rst:843 +#: ../../tutorial/controlflow.rst:868 msgid "" "def foo(name, **kwds):\n" " return 'name' in kwds" @@ -1665,7 +1702,7 @@ msgstr "" "def foo(name, **kwds):\n" " return 'name' in kwds" -#: ../../tutorial/controlflow.rst:846 +#: ../../tutorial/controlflow.rst:871 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::" @@ -1673,7 +1710,7 @@ msgstr "" "呼叫該函式不可能回傳 ``True``,因為關鍵字 ``'name'`` 永遠是連結在第一個參數。" "例如: ::" -#: ../../tutorial/controlflow.rst:849 +#: ../../tutorial/controlflow.rst:874 msgid "" ">>> foo(1, **{'name': 2})\n" "Traceback (most recent call last):\n" @@ -1687,7 +1724,7 @@ msgstr "" "TypeError: foo() got multiple values for argument 'name'\n" ">>>" -#: ../../tutorial/controlflow.rst:855 +#: ../../tutorial/controlflow.rst:880 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 " @@ -1696,7 +1733,7 @@ msgstr "" "使用 ``/``\\ (僅限位置引數)後,就可以了。函式定義會允許 ``name`` 當作位置引" "數,而 ``'name'`` 也可以當作關鍵字引數中的鍵: ::" -#: ../../tutorial/controlflow.rst:857 +#: ../../tutorial/controlflow.rst:882 msgid "" ">>> def foo(name, /, **kwds):\n" "... return 'name' in kwds\n" @@ -1710,31 +1747,31 @@ msgstr "" ">>> foo(1, **{'name': 2})\n" "True" -#: ../../tutorial/controlflow.rst:863 +#: ../../tutorial/controlflow.rst:888 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:868 +#: ../../tutorial/controlflow.rst:893 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:870 +#: ../../tutorial/controlflow.rst:895 msgid "" "The use case will determine which parameters to use in the function " "definition::" msgstr "此用例決定哪些參數可以用於函式定義: ::" -#: ../../tutorial/controlflow.rst:872 +#: ../../tutorial/controlflow.rst:897 msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" msgstr "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" -#: ../../tutorial/controlflow.rst:874 +#: ../../tutorial/controlflow.rst:899 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:876 +#: ../../tutorial/controlflow.rst:901 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 " @@ -1746,7 +1783,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:881 +#: ../../tutorial/controlflow.rst:906 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 " @@ -1755,7 +1792,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:884 +#: ../../tutorial/controlflow.rst:909 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1763,11 +1800,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:890 +#: ../../tutorial/controlflow.rst:915 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:895 +#: ../../tutorial/controlflow.rst:920 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 " @@ -1778,7 +1815,7 @@ msgstr "" "數會被包裝進一個 tuple 中(詳見 :ref:`tut-tuples`\\ )。在可變數量的引數之" "前,可能有零個或多個普通引數: ::" -#: ../../tutorial/controlflow.rst:900 +#: ../../tutorial/controlflow.rst:925 msgid "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" @@ -1786,7 +1823,7 @@ msgstr "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" -#: ../../tutorial/controlflow.rst:904 +#: ../../tutorial/controlflow.rst:929 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1800,7 +1837,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:910 +#: ../../tutorial/controlflow.rst:935 msgid "" ">>> def concat(*args, sep=\"/\"):\n" "... return sep.join(args)\n" @@ -1818,11 +1855,11 @@ msgstr "" ">>> concat(\"earth\", \"mars\", \"venus\", sep=\".\")\n" "'earth.mars.venus'" -#: ../../tutorial/controlflow.rst:921 +#: ../../tutorial/controlflow.rst:946 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:923 +#: ../../tutorial/controlflow.rst:948 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 " @@ -1836,7 +1873,7 @@ msgstr "" "的 *start* 和 *stop* 引數。如果這些引數不是分開的,則要在呼叫函式時,用 " "``*`` 運算子把引數們從 list 或 tuple 中拆解出來: ::" -#: ../../tutorial/controlflow.rst:930 +#: ../../tutorial/controlflow.rst:955 msgid "" ">>> list(range(3, 6)) # normal call with separate arguments\n" "[3, 4, 5]\n" @@ -1846,13 +1883,13 @@ msgid "" "[3, 4, 5]" msgstr "" -#: ../../tutorial/controlflow.rst:939 +#: ../../tutorial/controlflow.rst:964 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" msgstr "同樣地,dictionary(字典)可以用 ``**`` 運算子傳遞關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:942 +#: ../../tutorial/controlflow.rst:967 msgid "" ">>> def parrot(voltage, state='a stiff', action='voom'):\n" "... print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -1876,11 +1913,11 @@ msgstr "" "-- This parrot wouldn't VOOM if you put four million volts through it. E's " "bleedin' demised !" -#: ../../tutorial/controlflow.rst:955 +#: ../../tutorial/controlflow.rst:980 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:957 +#: ../../tutorial/controlflow.rst:982 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``. " @@ -1895,7 +1932,7 @@ msgstr "" "能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic sugar)。" "與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數: ::" -#: ../../tutorial/controlflow.rst:965 +#: ../../tutorial/controlflow.rst:990 msgid "" ">>> def make_incrementor(n):\n" "... return lambda x: x + n\n" @@ -1915,7 +1952,7 @@ msgstr "" ">>> f(1)\n" "43" -#: ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:999 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1923,7 +1960,7 @@ msgstr "" "上面的例子用 lambda 運算式回傳了一個函式。另外的用法是傳遞一個小函式當作引" "數: ::" -#: ../../tutorial/controlflow.rst:977 +#: ../../tutorial/controlflow.rst:1002 msgid "" ">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" ">>> pairs.sort(key=lambda pair: pair[1])\n" @@ -1935,17 +1972,17 @@ msgstr "" ">>> pairs\n" "[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]" -#: ../../tutorial/controlflow.rst:986 +#: ../../tutorial/controlflow.rst:1011 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:993 +#: ../../tutorial/controlflow.rst:1018 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:996 +#: ../../tutorial/controlflow.rst:1021 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 " @@ -1957,7 +1994,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:1002 +#: ../../tutorial/controlflow.rst:1027 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. " @@ -1967,7 +2004,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:1007 +#: ../../tutorial/controlflow.rst:1032 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 " @@ -1989,11 +2026,11 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1019 +#: ../../tutorial/controlflow.rst:1044 msgid "Here is an example of a multi-line docstring::" msgstr "下面是多行說明字串的一個範例: ::" -#: ../../tutorial/controlflow.rst:1021 +#: ../../tutorial/controlflow.rst:1046 msgid "" ">>> def my_function():\n" "... \"\"\"Do nothing, but document it.\n" @@ -2008,11 +2045,11 @@ msgid "" " No, really, it doesn't do anything." msgstr "" -#: ../../tutorial/controlflow.rst:1037 +#: ../../tutorial/controlflow.rst:1062 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1045 +#: ../../tutorial/controlflow.rst:1070 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -2021,7 +2058,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1049 +#: ../../tutorial/controlflow.rst:1074 msgid "" ":term:`Annotations ` are stored in the :attr:`!" "__annotations__` attribute of the function as a dictionary and have no " @@ -2039,7 +2076,7 @@ msgstr "" ">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" "值: ::" -#: ../../tutorial/controlflow.rst:1058 +#: ../../tutorial/controlflow.rst:1083 msgid "" ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "... print(\"Annotations:\", f.__annotations__)\n" @@ -2063,11 +2100,11 @@ msgstr "" "Arguments: spam eggs\n" "'spam and eggs'" -#: ../../tutorial/controlflow.rst:1071 +#: ../../tutorial/controlflow.rst:1096 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1076 +#: ../../tutorial/controlflow.rst:1101 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 " @@ -2080,7 +2117,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1082 +#: ../../tutorial/controlflow.rst:1107 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 " @@ -2090,11 +2127,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1087 +#: ../../tutorial/controlflow.rst:1112 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1089 +#: ../../tutorial/controlflow.rst:1114 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -2103,11 +2140,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1093 +#: ../../tutorial/controlflow.rst:1118 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1095 +#: ../../tutorial/controlflow.rst:1120 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -2115,21 +2152,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1098 +#: ../../tutorial/controlflow.rst:1123 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1101 +#: ../../tutorial/controlflow.rst:1126 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1103 +#: ../../tutorial/controlflow.rst:1128 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1105 +#: ../../tutorial/controlflow.rst:1130 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -2137,7 +2174,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:``a = f(1, 2) + g(3, " "4)``。" -#: ../../tutorial/controlflow.rst:1108 +#: ../../tutorial/controlflow.rst:1133 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -2149,7 +2186,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1113 +#: ../../tutorial/controlflow.rst:1138 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 " @@ -2158,7 +2195,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1117 +#: ../../tutorial/controlflow.rst:1142 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 " @@ -2167,11 +2204,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1123 +#: ../../tutorial/controlflow.rst:1148 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1124 +#: ../../tutorial/controlflow.rst:1149 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 " @@ -2189,54 +2226,60 @@ msgstr "statement(陳述式)" msgid "for" msgstr "for" -#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 +#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 msgid "documentation strings" msgstr "ddocumentation strings(說明字串)" -#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 +#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 msgid "docstrings" msgstr "docstrings(說明字串)" -#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 +#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 msgid "strings, documentation" msgstr "strings(字串), documentation(說明文件)" -#: ../../tutorial/controlflow.rst:892 +#: ../../tutorial/controlflow.rst:917 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../tutorial/controlflow.rst:892 ../../tutorial/controlflow.rst:936 +#: ../../tutorial/controlflow.rst:917 ../../tutorial/controlflow.rst:961 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../tutorial/controlflow.rst:936 +#: ../../tutorial/controlflow.rst:961 msgid "**" msgstr "**" -#: ../../tutorial/controlflow.rst:1040 +#: ../../tutorial/controlflow.rst:1065 msgid "function" msgstr "function(函式)" -#: ../../tutorial/controlflow.rst:1040 +#: ../../tutorial/controlflow.rst:1065 msgid "annotations" msgstr "annotations(註釋)" -#: ../../tutorial/controlflow.rst:1040 +#: ../../tutorial/controlflow.rst:1065 msgid "->" msgstr "->" -#: ../../tutorial/controlflow.rst:1040 +#: ../../tutorial/controlflow.rst:1065 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../tutorial/controlflow.rst:1040 +#: ../../tutorial/controlflow.rst:1065 msgid ": (colon)" msgstr ": (冒號)" -#: ../../tutorial/controlflow.rst:1074 +#: ../../tutorial/controlflow.rst:1099 msgid "coding" msgstr "coding(程式編寫)" -#: ../../tutorial/controlflow.rst:1074 +#: ../../tutorial/controlflow.rst:1099 msgid "style" msgstr "style(風格)" + +#~ msgid "" +#~ "A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!" +#~ "else` clause." +#~ msgstr "" +#~ ":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` 子句" diff --git a/using/mac.po b/using/mac.po index 8654f0c004..8511d3309d 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -23,85 +23,174 @@ msgstr "" "X-Generator: Poedit 3.1.1\n" #: ../../using/mac.rst:6 -msgid "Using Python on a Mac" +#, fuzzy +msgid "Using Python on macOS" msgstr "在 Mac 系統使用 Python" -#: ../../using/mac.rst:0 -msgid "Author" -msgstr "作者" +#: ../../using/mac.rst:11 +msgid "" +"This document aims to give an overview of macOS-specific behavior you should " +"know about to get started with Python on Mac computers. Python on a Mac " +"running macOS is very similar to Python on other Unix-derived platforms, but " +"there are some differences in installation and some features." +msgstr "" -#: ../../using/mac.rst:8 -msgid "Bob Savage " -msgstr "Bob Savage " +#: ../../using/mac.rst:16 +msgid "" +"There are various ways to obtain and install Python for macOS. Pre-built " +"versions of the most recent versions of Python are available from a number " +"of distributors. Much of this document describes use of the Pythons provided " +"by the CPython release team for download from the `python.org website " +"`_. See :ref:`alternative_bundles` for " +"some other options." +msgstr "" -#: ../../using/mac.rst:11 +#: ../../using/mac.rst:34 +msgid "Using Python for macOS from ``python.org``" +msgstr "" + +#: ../../using/mac.rst:37 +msgid "Installation steps" +msgstr "" + +#: ../../using/mac.rst:39 +msgid "" +"For `current Python versions `_ (other " +"than those in ``security`` status), the release team produces a **Python for " +"macOS** installer package for each new release. A list of available " +"installers is available `here `_. " +"We recommend using the most recent supported Python version where possible. " +"Current installers provide a `universal2 binary `_ build of Python which runs natively on all Macs " +"(Apple Silicon and Intel) that are supported by a wide range of macOS " +"versions, currently typically from at least **macOS 10.13 High Sierra** on." +msgstr "" + +#: ../../using/mac.rst:51 +msgid "" +"The downloaded file is a standard macOS installer package file (``.pkg``). " +"File integrity information (checksum, size, sigstore signature, etc) for " +"each file is included on the release download page. Installer packages and " +"their contents are signed and notarized with ``Python Software Foundation`` " +"Apple Developer ID certificates to meet `macOS Gatekeeper requirements " +"`_." +msgstr "" + +#: ../../using/mac.rst:57 +msgid "" +"For a default installation, double-click on the downloaded installer package " +"file. This should launch the standard macOS Installer app and display the " +"first of several installer windows steps." +msgstr "" + +#: ../../using/mac.rst:63 +msgid "" +"Clicking on the **Continue** button brings up the **Read Me** for this " +"installer. Besides other important information, the **Read Me** documents " +"which Python version is going to be installed and on what versions of macOS " +"it is supported. You may need to scroll through to read the whole file. By " +"default, this **Read Me** will also be installed in |" +"usemac_applications_folder_version| and available to read anytime." +msgstr "" + +#: ../../using/mac.rst:71 +msgid "" +"Clicking on **Continue** proceeds to display the license for Python and for " +"other included software. You will then need to **Agree** to the license " +"terms before proceeding to the next step. This license file will also be " +"installed and available to be read later." +msgstr "" + +#: ../../using/mac.rst:78 msgid "" -"Python on a Mac running macOS is in principle very similar to Python on any " -"other Unix platform, but there are a number of additional features such as " -"the integrated development environment (IDE) and the Package Manager that " -"are worth pointing out." +"After the license terms are accepted, the next step is the **Installation " +"Type** display. For most uses, the standard set of installation operations " +"is appropriate." msgstr "" -"Python 在 Mac 的 macOS 上執行和在其他 Unix 平台上執行的原理非常相似,但值得一" -"提的是在 macOS 上有其他額外的功能,例如整合開發環境 (IDE) 與套件管理。" -#: ../../using/mac.rst:21 -msgid "Getting and Installing Python" -msgstr "取得和安裝 Python" +#: ../../using/mac.rst:83 +msgid "" +"By pressing the **Customize** button, you can choose to omit or select " +"certain package components of the installer. Click on each package name to " +"see a description of what it installs. To also install support for the " +"optional experimental free-threaded feature, see :ref:`install-freethreaded-" +"macos`." +msgstr "" -#: ../../using/mac.rst:23 +#: ../../using/mac.rst:91 msgid "" -"macOS used to come with Python 2.7 pre-installed between versions 10.8 and " -"`12.3 `_. You are invited to install the most " -"recent version of Python 3 from the `Python website `__. A current \"universal2 binary\" build of Python, which " -"runs natively on the Mac's new Apple Silicon and legacy Intel processors, is " -"available there." +"In either case, clicking **Install** will begin the install process by " +"asking permission to install new software. A macOS user name with " +"``Administrator`` privilege is needed as the installed Python will be " +"available to all users of the Mac." msgstr "" -"macOS 自 10.8 版本開始至 `12.3 版本 `_\\ 之間預" -"設安裝 Python 2.7。你也可以到 `Python 網站 `__\\ 安裝最新的 Python 3 版本。你可以找到建立在\"通用二進位 " -"(universal2 binary)\" 上的 Python 建置版本,它能夠原生地運行在 Mac 新的 " -"Apple Silicon CPU 與過去的 Intel CPU 上。" -#: ../../using/mac.rst:30 -msgid "What you get after installing is a number of things:" -msgstr "在安裝後你必須要做幾件事:" +#: ../../using/mac.rst:95 +msgid "When the installation is complete, the **Summary** window will appear." +msgstr "" -#: ../../using/mac.rst:32 +#: ../../using/mac.rst:99 msgid "" -"A |python_version_literal| folder in your :file:`Applications` folder. In " -"here you find IDLE, the development environment that is a standard part of " -"official Python distributions; and :program:`Python Launcher`, which handles " -"double-clicking Python scripts from the Finder." +"Double-click on the :command:`Install Certificates.command` icon or file in " +"the |usemac_applications_folder_version| window to complete the installation." +msgstr "" + +#: ../../using/mac.rst:105 +msgid "" +"This will open a temporary :program:`Terminal` shell window that will use " +"the new Python to download and install SSL root certificates for its use." +msgstr "" + +#: ../../using/mac.rst:111 +msgid "" +"If ``Successfully installed certifi`` and ``update complete`` appears in the " +"terminal window, the installation is complete. Close this terminal window " +"and the installer window." +msgstr "" + +#: ../../using/mac.rst:115 +msgid "A default install will include:" +msgstr "" + +#: ../../using/mac.rst:117 +#, fuzzy +msgid "" +"A |usemac_applications_folder_name| folder in your :file:`Applications` " +"folder. In here you find :program:`IDLE`, the development environment that " +"is a standard part of official Python distributions; and :program:`Python " +"Launcher`, which handles double-clicking Python scripts from the macOS " +"`Finder `_." msgstr "" "會有一個 |python_version_literal| 資料夾在你的 :file:`Applications` 資料夾" "中。在這裡你可以找到 IDLE,它是作為官方 Python 發行版標準組成的開發環境;以" "及 :program:`Python Launcher`,它負責處理在 Finder 中雙擊 Python 腳本的操作。" -#: ../../using/mac.rst:37 +#: ../../using/mac.rst:122 +#, fuzzy msgid "" "A framework :file:`/Library/Frameworks/Python.framework`, which includes the " "Python executable and libraries. The installer adds this location to your " -"shell path. To uninstall Python, you can remove these three things. A " -"symlink to the Python executable is placed in :file:`/usr/local/bin/`." +"shell path. To uninstall Python, you can remove these three things. Symlinks " +"to the Python executable are placed in :file:`/usr/local/bin/`." msgstr "" ":file:`/Library/Frameworks/Python.framework` 框架,包括 Python 可執行檔案 " "(executable) 和函式庫 (library)。安裝程式將此位置新增到 shell 路徑。要解除安" "裝 Python ,你可以移除這三個專案。Python 可執行檔案的符號連結 (symlink) 則放" "在 :file:`/usr/local/bin/` 中。" -#: ../../using/mac.rst:44 +#: ../../using/mac.rst:129 +#, fuzzy msgid "" -"On macOS 10.8-12.3, the Apple-provided build of Python is installed in :file:" -"`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`, " -"respectively. You should never modify or delete these, as they are Apple-" -"controlled and are used by Apple- or third-party software. Remember that if " -"you choose to install a newer Python version from python.org, you will have " -"two different but functional Python installations on your computer, so it " -"will be important that your paths and usages are consistent with what you " -"want to do." +"Recent versions of macOS include a :command:`python3` command in :file:`/usr/" +"bin/python3` that links to a usually older and incomplete version of Python " +"provided by and for use by the Apple development tools, :program:`Xcode` or " +"the :program:`Command Line Tools for Xcode`. You should never modify or " +"attempt to delete this installation, as it is Apple-controlled and is used " +"by Apple-provided or third-party software. If you choose to install a newer " +"Python version from ``python.org``, you will have two different but " +"functional Python installations on your computer that can co-exist. The " +"default installer options should ensure that its :command:`python3` will be " +"used instead of the system :command:`python3`." msgstr "" "在 macOS 10.8-12.3,Apple 提供的 Python 建置版本分別安裝在 :file:`/System/" "Library/Frameworks/Python.framework` 和 :file:`/usr/bin/python` 中。你不應該" @@ -110,260 +199,509 @@ msgstr "" "兩個不同但都可運作的 Python,因此你的路徑和用法與你想要執行的操作一致非常重" "要。" -#: ../../using/mac.rst:52 +#: ../../using/mac.rst:140 +msgid "How to run a Python script" +msgstr "如何執行 Python 腳本" + +#: ../../using/mac.rst:142 msgid "" -"IDLE includes a Help menu that allows you to access Python documentation. If " -"you are completely new to Python you should start reading the tutorial " -"introduction in that document." +"There are two ways to invoke the Python interpreter. If you are familiar " +"with using a Unix shell in a terminal window, you can invoke |" +"usemac_python_x_dot_y_literal| or ``python3`` optionally followed by one or " +"more command line options (described in :ref:`using-on-general`). The Python " +"tutorial also has a useful section on :ref:`using Python interactively from " +"a shell `." msgstr "" -"IDLE 包含一個幫助 (Help) 選單,讓你可以參閱 Python 文件。如果你是 Python 的新" -"手,你應該開始閱讀該文件中的教學介紹。" -#: ../../using/mac.rst:56 +#: ../../using/mac.rst:149 msgid "" -"If you are familiar with Python on other Unix platforms you should read the " -"section on running Python scripts from the Unix shell." +"You can also invoke the interpreter through an integrated development " +"environment. :ref:`idle` is a basic editor and interpreter environment which " +"is included with the standard distribution of Python. :program:`IDLE` " +"includes a Help menu that allows you to access Python documentation. If you " +"are completely new to Python, you can read the tutorial introduction in that " +"document." msgstr "" -"如果你熟悉其他 Unix 平臺上的 Python,那麼你應該閱讀有關從 Unix shell 執行 " -"Python 腳本的部分。" -#: ../../using/mac.rst:61 -msgid "How to run a Python script" -msgstr "如何執行 Python 腳本" - -#: ../../using/mac.rst:63 +#: ../../using/mac.rst:157 msgid "" -"Your best way to get started with Python on macOS is through the IDLE " -"integrated development environment; see section :ref:`ide` and use the Help " -"menu when the IDE is running." +"There are many other editors and IDEs available, see :ref:`editors` for more " +"information." msgstr "" -"在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境;參見 :ref:" -"`ide` 部分,並在 IDE 執行時使用幫助選單。" -#: ../../using/mac.rst:67 +#: ../../using/mac.rst:160 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 " -"with a number of standard Unix command line editors, :program:`vim` :program:" -"`nano` among them. If you want a more Mac-like editor, :program:`BBEdit` " -"from Bare Bones Software (see https://www.barebones.com/products/bbedit/" -"index.html) are good choices, as is :program:`TextMate` (see https://" -"macromates.com). Other editors include :program:`MacVim` (https://macvim." -"org) and :program:`Aquamacs` (https://aquamacs.org)." +"To run a Python script file from the terminal window, you can invoke the " +"interpreter with the name of the script file:" msgstr "" -"如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建立" -"腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" -"program:`nano`。如果你想要一個更 Mac 化的編輯器,那麼來自 Bare Bones " -"Software 的 :program:`BBEdit`\\ (參見 http://www.barebones.com/products/" -"bbedit/index.html) 是不錯的選擇,:program:`TextMate` (參見 https://" -"macromates.com/)也是個選擇。其他編輯器包括 :program:`MacVim` (https://" -"macvim.org) 和 :program:`Aquamacs` (https://aquamacs.org/)。" -#: ../../using/mac.rst:77 -msgid "" -"To run your script from the Terminal window you must make sure that :file:`/" -"usr/local/bin` is in your shell search path." +#: ../../using/mac.rst:163 +msgid "|usemac_python_x_dot_y_literal| ``myscript.py``" msgstr "" -"要從終端機視窗執行腳本,你必須確保 :file:`/usr/local/bin` 位於 shell 搜尋路徑" -"中。" -#: ../../using/mac.rst:80 -msgid "To run your script from the Finder you have two options:" +#: ../../using/mac.rst:165 +#, fuzzy +msgid "To run your script from the Finder, you can either:" msgstr "從 Finder 執行你的腳本時,你有兩個選項:" -#: ../../using/mac.rst:82 +#: ../../using/mac.rst:167 msgid "Drag it to :program:`Python Launcher`." msgstr "把它拖曳到 :program:`Python Launcher`" -#: ../../using/mac.rst:84 +#: ../../using/mac.rst:169 +#, fuzzy msgid "" "Select :program:`Python Launcher` as the default application to open your " -"script (or any ``.py`` script) through the finder Info window and double-" +"script (or any ``.py`` script) through the Finder Info window and double-" "click it. :program:`Python Launcher` has various preferences to control how " "your script is launched. Option-dragging allows you to change these for one " -"invocation, or use its Preferences menu to change things globally." +"invocation, or use its ``Preferences`` menu to change things globally." msgstr "" "透過 finder Info 視窗選擇 :program:`Python Launcher` 作為開啟腳本(或任何 ``." "py`` 腳本)的預設應用程式,然後雙擊腳本。:program:`Python Launcher` 有各種用" "來控制腳本啟動方式的選項。拖曳選項可以讓你一次更改多個選項,或使用其偏好設定" "選單以全域性地更改內容。" -#: ../../using/mac.rst:94 -msgid "Running scripts with a GUI" -msgstr "透過 GUI 執行腳本" - -#: ../../using/mac.rst:96 +#: ../../using/mac.rst:175 msgid "" -"With older versions of Python, there is one macOS quirk that you need to be " -"aware of: programs that talk to the Aqua window manager (in other words, " -"anything that has a GUI) need to be run in a special way. Use :program:" -"`pythonw` instead of :program:`python` to start such scripts." +"Be aware that running the script directly from the macOS Finder might " +"produce different results than when running from a terminal window as the " +"script will not be run in the usual shell environment including any setting " +"of environment variables in shell profiles. And, as with any other script or " +"program, be certain of what you are about to run." +msgstr "" + +#: ../../using/mac.rst:185 +msgid "Alternative Distributions" msgstr "" -"對於舊版本的 Python,你需要注意一個 macOS 的怪異之處:與 Aqua 視窗管理器溝通" -"的程式(換而言之,任何具有 GUI(圖形化使用者介面)的程式)需要以特殊方式執" -"行。使用 :program:`pythonw` 而不是 :program:`python` 來啟動這樣的腳本。" -#: ../../using/mac.rst:101 +#: ../../using/mac.rst:187 msgid "" -"With Python 3.9, you can use either :program:`python` or :program:`pythonw`." -msgstr "Python 3.9 上,你可以使用 :program:`python` 或者 :program:`pythonw`。" +"Besides the standard ``python.org`` for macOS installer, there are third-" +"party distributions for macOS that may include additional functionality. " +"Some popular distributions and their key features:" +msgstr "" -#: ../../using/mac.rst:105 -msgid "Configuration" -msgstr "設定" +#: ../../using/mac.rst:191 +msgid "`ActivePython `_" +msgstr "" + +#: ../../using/mac.rst:192 +msgid "Installer with multi-platform compatibility, documentation" +msgstr "" -#: ../../using/mac.rst:107 +#: ../../using/mac.rst:194 +msgid "`Anaconda `_" +msgstr "" + +#: ../../using/mac.rst:195 msgid "" -"Python on macOS honors all standard Unix environment variables such as :" -"envvar:`PYTHONPATH`, but setting these variables for programs started from " -"the Finder is non-standard as the Finder does not read your :file:`.profile` " -"or :file:`.cshrc` at startup. You need to create a file :file:`~/.MacOSX/" -"environment.plist`. See Apple's `Technical Q&A QA1067 `__ for details." +"Popular scientific modules (such as numpy, scipy, and pandas) and the " +"``conda`` package manager." msgstr "" -"macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:`PYTHONPATH`,但" -"是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 Finder 在啟動時不會讀" -"取你的 :file:`.profile` 或 :file:`.cshrc`。你需要建立一個檔案 :file:`~/." -"MacOSX/environment.plist`。相關資訊請參閱 Apple 的\\ `技術問答集 QA1067 " -"`__。" -#: ../../using/mac.rst:115 +#: ../../using/mac.rst:198 +msgid "`Homebrew `_" +msgstr "" + +#: ../../using/mac.rst:199 msgid "" -"For more information on installation Python packages, see section :ref:`mac-" -"package-manager`." -msgstr "更多關於安裝 Python 套件的資訊,參閱 :ref:`mac-package-manager` 部分。" +"Package manager for macOS including multiple versions of Python and many " +"third-party Python-based packages (including numpy, scipy, and pandas)." +msgstr "" -#: ../../using/mac.rst:122 -msgid "The IDE" -msgstr "整合化開發工具 (IDE)" +#: ../../using/mac.rst:202 +msgid "`MacPorts `_" +msgstr "" + +#: ../../using/mac.rst:203 +msgid "" +"Another package manager for macOS including multiple versions of Python and " +"many third-party Python-based packages. May include pre-built versions of " +"Python and many packages for older versions of macOS." +msgstr "" -#: ../../using/mac.rst:124 +#: ../../using/mac.rst:207 msgid "" -"Python ships with the standard IDLE development environment. A good " -"introduction to using IDLE can be found at https://www.hashcollision.org/hkn/" -"python/idle_intro/index.html." +"Note that distributions might not include the latest versions of Python or " +"other libraries, and are not maintained or supported by the core Python team." msgstr "" -"Python 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 https://www." -"hashcollision.org/hkn/python/idle_intro/index.html。" -#: ../../using/mac.rst:132 +#: ../../using/mac.rst:213 msgid "Installing Additional Python Packages" msgstr "安裝額外的 Python 套件" -#: ../../using/mac.rst:134 -msgid "This section has moved to the `Python Packaging User Guide`_." +#: ../../using/mac.rst:215 +#, fuzzy +msgid "Refer to the `Python Packaging User Guide`_ for more information." msgstr "這個章節已經被移動到 `Python Packaging User Guide`_。" -#: ../../using/mac.rst:142 +#: ../../using/mac.rst:225 msgid "GUI Programming" msgstr "開發 GUI 程式" -#: ../../using/mac.rst:144 +#: ../../using/mac.rst:227 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "於 Mac 上使用 Python 來建立 GUI 應用程式有許多選項。" -#: ../../using/mac.rst:146 -msgid "" -"*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " -"is the foundation of most modern Mac development. Information on PyObjC is " -"available from :pypi:`pyobjc`." -msgstr "" -"*PyObjC* 是一個 Apple Objective-C/Cocoa 框架的 Python 繫結 (binding),這是大" -"多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 :pypi:`pyobjc`。" - -#: ../../using/mac.rst:150 +#: ../../using/mac.rst:229 +#, fuzzy msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" -"platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " -"bundled with macOS by Apple, and the latest version can be downloaded and " -"installed from https://www.activestate.com; it can also be built from source." +"platform Tk toolkit (https://www.tcl.tk). A macOS-native version of Tk is " +"included with the installer." msgstr "" "標準的 Python GUI 工具套件是 :mod:`tkinter`,基於跨平臺的 Tk 工具套件 " "(https://www.tcl.tk)。Apple 的 macOS 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" -#: ../../using/mac.rst:155 -msgid "A number of alternative macOS GUI toolkits are available:" +#: ../../using/mac.rst:233 +#, fuzzy +msgid "" +"*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework. " +"Information on PyObjC is available from :pypi:`pyobjc`." +msgstr "" +"*PyObjC* 是一個 Apple Objective-C/Cocoa 框架的 Python 繫結 (binding),這是大" +"多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 :pypi:`pyobjc`。" + +#: ../../using/mac.rst:236 +#, fuzzy +msgid "A number of alternative macOS GUI toolkits are available including:" msgstr "有許多替代 macOS GUI 工具套件可用:" -#: ../../using/mac.rst:157 +#: ../../using/mac.rst:238 #, fuzzy msgid "" -"`PySide `__: Official Python bindings to " -"the `Qt GUI toolkit `__." +"`PySide `_: Official Python bindings to the " +"`Qt GUI toolkit `_." msgstr "" "`PySide `__:`Qt GUI 工具包 `__\\ 的官方 Python 繫結。" -#: ../../using/mac.rst:160 +#: ../../using/mac.rst:241 +#, fuzzy msgid "" -"`PyQt `__: Alternative " -"Python bindings to Qt." +"`PyQt `_: Alternative Python " +"bindings to Qt." msgstr "" "`PyQt `__:Qt 的替代 " "Python 繫結。" -#: ../../using/mac.rst:163 +#: ../../using/mac.rst:244 +#, fuzzy msgid "" -"`Kivy `__: A cross-platform GUI toolkit that supports " +"`Kivy `_: A cross-platform GUI toolkit that supports " "desktop and mobile platforms." msgstr "" "`Kivy `__:一個支援桌面和行動平臺的跨平臺 GUI 工具包。" -#: ../../using/mac.rst:166 +#: ../../using/mac.rst:247 +#, fuzzy msgid "" -"`Toga `__: Part of the `BeeWare Project " -"`__; supports desktop, mobile, web and console apps." +"`Toga `_: Part of the `BeeWare Project `_; supports desktop, mobile, web and console apps." msgstr "" "`Toga `__:`BeeWare 專案 `__\\ 的一部分;支援桌面、行動、網頁和控制台應用程式。" -#: ../../using/mac.rst:169 +#: ../../using/mac.rst:250 +#, fuzzy msgid "" -"`wxPython `__: A cross-platform toolkit that " -"supports desktop operating systems." +"`wxPython `_: A cross-platform toolkit that supports " +"desktop operating systems." msgstr "" "`wxPython `__:一個支援桌面作業系統的跨平臺工具包。" -#: ../../using/mac.rst:175 +#: ../../using/mac.rst:255 +msgid "Advanced Topics" +msgstr "" + +#: ../../using/mac.rst:260 +msgid "Installing Free-threaded Binaries" +msgstr "" + +#: ../../using/mac.rst:262 +msgid "(Experimental)" +msgstr "" + +#: ../../using/mac.rst:266 +msgid "" +"Everything described in this section is considered experimental, and should " +"be expected to change in future releases." +msgstr "" + +#: ../../using/mac.rst:269 +msgid "" +"The ``python.org`` :ref:`Python for macOS ` installer package can optionally install an additional build of " +"Python |usemac_x_dot_y| that supports :pep:`703`, the experimental free-" +"threading feature (running with the :term:`global interpreter lock` " +"disabled). Check the release page on ``python.org`` for possible updated " +"information." +msgstr "" + +#: ../../using/mac.rst:275 +msgid "" +"Because this feature is still considered experimental, the support for it is " +"not installed by default. It is packaged as a separate install option, " +"available by clicking the **Customize** button on the **Installation Type** " +"step of the installer as described above." +msgstr "" + +#: ../../using/mac.rst:282 +msgid "" +"If the box next to the **Free-threaded Python** package name is checked, a " +"separate :file:`PythonT.framework` will also be installed alongside the " +"normal :file:`Python.framework` in :file:`/Library/Frameworks`. This " +"configuration allows a free-threaded Python |usemac_x_dot_y| build to co-" +"exist on your system with a traditional (GIL only) Python |usemac_x_dot_y| " +"build with minimal risk while installing or testing. This installation " +"layout is itself experimental and is subject to change in future releases." +msgstr "" + +#: ../../using/mac.rst:290 +msgid "Known cautions and limitations:" +msgstr "" + +#: ../../using/mac.rst:292 +msgid "" +"The **UNIX command-line tools** package, which is selected by default, will " +"install links in :file:`/usr/local/bin` for |" +"usemac_python_x_dot_y_t_literal|, the free-threaded interpreter, and |" +"usemac_python_x_dot_y_t_literal_config|, a configuration utility which may " +"be useful for package builders. Since :file:`/usr/local/bin` is typically " +"included in your shell ``PATH``, in most cases no changes to your ``PATH`` " +"environment variables should be needed to use |" +"usemac_python_x_dot_y_t_literal|." +msgstr "" + +#: ../../using/mac.rst:300 +msgid "" +"For this release, the **Shell profile updater** package and the :file:" +"`Update Shell Profile.command` in |usemac_applications_folder_version| do " +"not support the free-threaded package." +msgstr "" + +#: ../../using/mac.rst:304 +msgid "" +"The free-threaded build and the traditional build have separate search paths " +"and separate :file:`site-packages` directories so, by default, if you need a " +"package available in both builds, it may need to be installed in both. The " +"free-threaded package will install a separate instance of :program:`pip` for " +"use with |usemac_python_x_dot_y_t_literal|." +msgstr "" + +#: ../../using/mac.rst:310 +msgid "To install a package using :command:`pip` without a :command:`venv`:" +msgstr "" + +#: ../../using/mac.rst:312 +msgid "|usemac_python_x_dot_y_t_literal| ``-m pip install ``" +msgstr "" + +#: ../../using/mac.rst:314 +msgid "" +"When working with multiple Python environments, it is usually safest and " +"easiest to :ref:`create and use virtual environments `. This can " +"avoid possible command name conflicts and confusion about which Python is in " +"use:" +msgstr "" + +#: ../../using/mac.rst:318 +msgid "|usemac_python_x_dot_y_t_literal| ``-m venv ``" +msgstr "" + +#: ../../using/mac.rst:320 +msgid "then :command:`activate`." +msgstr "" + +#: ../../using/mac.rst:322 +msgid "To run a free-threaded version of IDLE:" +msgstr "" + +#: ../../using/mac.rst:324 +msgid "|usemac_python_x_dot_y_t_literal| ``-m idlelib``" +msgstr "" + +#: ../../using/mac.rst:326 +msgid "" +"The interpreters in both builds respond to the same :ref:`PYTHON environment " +"variables ` which may have unexpected results, for " +"example, if you have ``PYTHONPATH`` set in a shell profile. If necessary, " +"there are :ref:`command line options ` like ``-" +"E`` to ignore these environment variables." +msgstr "" + +#: ../../using/mac.rst:333 +msgid "" +"The free-threaded build links to the third-party shared libraries, such as " +"``OpenSSL`` and ``Tk``, installed in the traditional framework. This means " +"that both builds also share one set of trust certificates as installed by " +"the :command:`Install Certificates.command` script, thus it only needs to be " +"run once." +msgstr "" + +#: ../../using/mac.rst:339 +msgid "" +"If you cannot depend on the link in ``/usr/local/bin`` pointing to the " +"``python.org`` free-threaded |usemac_python_x_dot_y_t_literal| (for example, " +"if you want to install your own version there or some other distribution " +"does), you can explicitly set your shell ``PATH`` environment variable to " +"include the ``PythonT`` framework ``bin`` directory:" +msgstr "" + +#: ../../using/mac.rst:345 +msgid "" +"export PATH=\"/Library/Frameworks/PythonT.framework/Versions/3.13/bin\":" +"\"$PATH\"" +msgstr "" + +#: ../../using/mac.rst:349 +msgid "" +"The traditional framework installation by default does something similar, " +"except for :file:`Python.framework`. Be aware that having both framework " +"``bin`` directories in ``PATH`` can lead to confusion if there are duplicate " +"names like ``python3.13`` in both; which one is actually used depends on the " +"order they appear in ``PATH``. The ``which python3.x`` or ``which python3." +"xt`` commands can show which path is being used. Using virtual environments " +"can help avoid such ambiguities. Another option might be to create a shell :" +"command:`alias` to the desired interpreter, like:" +msgstr "" + +#: ../../using/mac.rst:358 +msgid "" +"alias py3.13=\"/Library/Frameworks/Python.framework/Versions/3.13/bin/" +"python3.13\"\n" +"alias py3.13t=\"/Library/Frameworks/PythonT.framework/Versions/3.13/bin/" +"python3.13t\"" +msgstr "" + +#: ../../using/mac.rst:364 +msgid "Installing using the command line" +msgstr "" + +#: ../../using/mac.rst:366 +msgid "" +"If you want to use automation to install the ``python.org`` installer " +"package (rather than by using the familiar macOS :program:`Installer` GUI " +"app), the macOS command line :command:`installer` utility lets you select " +"non-default options, too. If you are not familiar with :command:`installer`, " +"it can be somewhat cryptic (see :command:`man installer` for more " +"information). As an example, the following shell snippet shows one way to do " +"it, using the ``3.13.0b2`` release and selecting the free-threaded " +"interpreter option:" +msgstr "" + +#: ../../using/mac.rst:375 +msgid "" +"RELEASE=\"python-3.13.0b2-macos11.pkg\"\n" +"\n" +"# download installer pkg\n" +"curl -O https://www.python.org/ftp/python/3.13.0/${RELEASE}\n" +"\n" +"# create installer choicechanges to customize the install:\n" +"# enable the PythonTFramework-3.13 package\n" +"# while accepting the other defaults (install all other packages)\n" +"cat > ./choicechanges.plist <\n" +"\n" +"\n" +"\n" +" \n" +" attributeSetting\n" +" 1\n" +" choiceAttribute\n" +" selected\n" +" choiceIdentifier\n" +" org.python.Python.PythonTFramework-3.13\n" +" \n" +"\n" +"\n" +"EOF\n" +"\n" +"sudo installer -pkg ./${RELEASE} -applyChoiceChangesXML ./choicechanges." +"plist -target /" +msgstr "" + +#: ../../using/mac.rst:405 +msgid "" +"You can then test that both installer builds are now available with " +"something like:" +msgstr "" + +#: ../../using/mac.rst:407 +msgid "" +"$ # test that the free-threaded interpreter was installed if the Unix " +"Command Tools package was enabled\n" +"$ /usr/local/bin/python3.13t -VV\n" +"Python 3.13.0b2 experimental free-threading build (v3.13.0b2:3a83b172af, " +"Jun 5 2024, 12:57:31) [Clang 15.0.0 (clang-1500.3.9.4)]\n" +"$ # and the traditional interpreter\n" +"$ /usr/local/bin/python3.13 -VV\n" +"Python 3.13.0b2 (v3.13.0b2:3a83b172af, Jun 5 2024, 12:50:24) [Clang 15.0.0 " +"(clang-1500.3.9.4)]\n" +"$ # test that they are also available without the prefix if /usr/local/bin " +"is on $PATH\n" +"$ python3.13t -VV\n" +"Python 3.13.0b2 experimental free-threading build (v3.13.0b2:3a83b172af, " +"Jun 5 2024, 12:57:31) [Clang 15.0.0 (clang-1500.3.9.4)]\n" +"$ python3.13 -VV\n" +"Python 3.13.0b2 (v3.13.0b2:3a83b172af, Jun 5 2024, 12:50:24) [Clang 15.0.0 " +"(clang-1500.3.9.4)]" +msgstr "" + +#: ../../using/mac.rst:423 +msgid "" +"Current ``python.org`` installers only install to fixed locations like :file:" +"`/Library/Frameworks/`, :file:`/Applications`, and :file:`/usr/local/bin`. " +"You cannot use the :command:`installer` ``-domain`` option to install to " +"other locations." +msgstr "" + +#: ../../using/mac.rst:431 msgid "Distributing Python Applications" msgstr "發行 Python 應用程式" -#: ../../using/mac.rst:177 +#: ../../using/mac.rst:433 msgid "" "A range of tools exist for converting your Python code into a standalone " "distributable application:" msgstr "" -#: ../../using/mac.rst:180 +#: ../../using/mac.rst:436 msgid "" ":pypi:`py2app`: Supports creating macOS ``.app`` bundles from a Python " "project." msgstr ":pypi:`py2app`:支援從 Python 專案打包成 macOS ``.app``。" -#: ../../using/mac.rst:183 +#: ../../using/mac.rst:439 +#, fuzzy msgid "" -"`Briefcase `__: Part of the `BeeWare " -"Project `__; a cross-platform packaging tool that " +"`Briefcase `_: Part of the `BeeWare " +"Project `_; a cross-platform packaging tool that " "supports creation of ``.app`` bundles on macOS, as well as managing signing " "and notarization." msgstr "" +"`Toga `__:`BeeWare 專案 `__\\ 的一部分;支援桌面、行動、網頁和控制台應用程式。" -#: ../../using/mac.rst:188 +#: ../../using/mac.rst:444 +#, fuzzy msgid "" -"`PyInstaller `__: A cross-platform packaging tool " +"`PyInstaller `_: A cross-platform packaging tool " "that creates a single file or folder as a distributable artifact." msgstr "" "`PyInstaller `__:一個跨平臺打包工具,可以將單一檔" "案或資料夾打包成可分發的檔案。" -#: ../../using/mac.rst:192 +#: ../../using/mac.rst:448 msgid "App Store Compliance" msgstr "" -#: ../../using/mac.rst:194 +#: ../../using/mac.rst:450 msgid "" "Apps submitted for distribution through the macOS App Store must pass " "Apple's app review process. This process includes a set of automated " @@ -371,7 +709,7 @@ msgid "" "problematic code." msgstr "" -#: ../../using/mac.rst:198 +#: ../../using/mac.rst:454 msgid "" "The Python standard library contains some code that is known to violate " "these automated rules. While these violations appear to be false positives, " @@ -379,7 +717,7 @@ msgid "" "modify the Python standard library for an app to pass App Store review." msgstr "" -#: ../../using/mac.rst:203 +#: ../../using/mac.rst:459 msgid "" "The Python source tree contains :source:`a patch file ` that will remove all code that is known to cause " @@ -388,7 +726,7 @@ msgid "" "compliance` option." msgstr "" -#: ../../using/mac.rst:209 +#: ../../using/mac.rst:465 msgid "" "This patch is not normally required to use CPython on a Mac; nor is it " "required if you are distributing an app *outside* the macOS App Store. It is " @@ -396,26 +734,169 @@ msgid "" "channel." msgstr "" -#: ../../using/mac.rst:214 +#: ../../using/mac.rst:470 msgid "Other Resources" msgstr "其他資源" -#: ../../using/mac.rst:216 +#: ../../using/mac.rst:472 msgid "" -"The Pythonmac-SIG mailing list is an excellent support resource for Python " -"users and developers on the Mac:" +"The `python.org Help page `_ has links " +"to many useful resources. The `Pythonmac-SIG mailing list `_ is another support " +"resource specifically for Python users and developers on the Mac." msgstr "" -"Pythonmac-SIG 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資" -"源:" - -#: ../../using/mac.rst:219 -msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" -msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" - -#: ../../using/mac.rst:221 -msgid "Another useful resource is the MacPython wiki:" -msgstr "另一個好用資源是 MacPython wiki:" -#: ../../using/mac.rst:223 -msgid "https://wiki.python.org/moin/MacPython" -msgstr "https://wiki.python.org/moin/MacPython" +#~ msgid "Author" +#~ msgstr "作者" + +#~ msgid "Bob Savage " +#~ msgstr "Bob Savage " + +#~ msgid "" +#~ "Python on a Mac running macOS is in principle very similar to Python on " +#~ "any other Unix platform, but there are a number of additional features " +#~ "such as the integrated development environment (IDE) and the Package " +#~ "Manager that are worth pointing out." +#~ msgstr "" +#~ "Python 在 Mac 的 macOS 上執行和在其他 Unix 平台上執行的原理非常相似,但值" +#~ "得一提的是在 macOS 上有其他額外的功能,例如整合開發環境 (IDE) 與套件管理。" + +#~ msgid "Getting and Installing Python" +#~ msgstr "取得和安裝 Python" + +#~ msgid "" +#~ "macOS used to come with Python 2.7 pre-installed between versions 10.8 " +#~ "and `12.3 `_. You are invited to install the most " +#~ "recent version of Python 3 from the `Python website `__. A current \"universal2 binary\" build of " +#~ "Python, which runs natively on the Mac's new Apple Silicon and legacy " +#~ "Intel processors, is available there." +#~ msgstr "" +#~ "macOS 自 10.8 版本開始至 `12.3 版本 `_\\ 之" +#~ "間預設安裝 Python 2.7。你也可以到 `Python 網站 `__\\ 安裝最新的 Python 3 版本。你可以找到建立在\"通用二" +#~ "進位 (universal2 binary)\" 上的 Python 建置版本,它能夠原生地運行在 Mac 新" +#~ "的 Apple Silicon CPU 與過去的 Intel CPU 上。" + +#~ msgid "What you get after installing is a number of things:" +#~ msgstr "在安裝後你必須要做幾件事:" + +#~ msgid "" +#~ "IDLE includes a Help menu that allows you to access Python documentation. " +#~ "If you are completely new to Python you should start reading the tutorial " +#~ "introduction in that document." +#~ msgstr "" +#~ "IDLE 包含一個幫助 (Help) 選單,讓你可以參閱 Python 文件。如果你是 Python " +#~ "的新手,你應該開始閱讀該文件中的教學介紹。" + +#~ msgid "" +#~ "If you are familiar with Python on other Unix platforms you should read " +#~ "the section on running Python scripts from the Unix shell." +#~ msgstr "" +#~ "如果你熟悉其他 Unix 平臺上的 Python,那麼你應該閱讀有關從 Unix shell 執行 " +#~ "Python 腳本的部分。" + +#~ msgid "" +#~ "Your best way to get started with Python on macOS is through the IDLE " +#~ "integrated development environment; see section :ref:`ide` and use the " +#~ "Help menu when the IDE is running." +#~ msgstr "" +#~ "在 macOS 上開始使用 Python 的最佳方法是透過 IDLE 整合開發環境;參見 :ref:" +#~ "`ide` 部分,並在 IDE 執行時使用幫助選單。" + +#~ 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 with a number of standard Unix command line editors, :program:" +#~ "`vim` :program:`nano` among them. If you want a more Mac-like editor, :" +#~ "program:`BBEdit` from Bare Bones Software (see https://www.barebones.com/" +#~ "products/bbedit/index.html) are good choices, as is :program:`TextMate` " +#~ "(see https://macromates.com). Other editors include :program:`MacVim` " +#~ "(https://macvim.org) and :program:`Aquamacs` (https://aquamacs.org)." +#~ msgstr "" +#~ "如果要從終端機視窗命令列或 Finder 執行 Python 腳本,首先需要一個編輯器來建" +#~ "立腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" +#~ "program:`nano`。如果你想要一個更 Mac 化的編輯器,那麼來自 Bare Bones " +#~ "Software 的 :program:`BBEdit`\\ (參見 http://www.barebones.com/products/" +#~ "bbedit/index.html) 是不錯的選擇,:program:`TextMate` (參見 https://" +#~ "macromates.com/)也是個選擇。其他編輯器包括 :program:`MacVim` (https://" +#~ "macvim.org) 和 :program:`Aquamacs` (https://aquamacs.org/)。" + +#~ msgid "" +#~ "To run your script from the Terminal window you must make sure that :file:" +#~ "`/usr/local/bin` is in your shell search path." +#~ msgstr "" +#~ "要從終端機視窗執行腳本,你必須確保 :file:`/usr/local/bin` 位於 shell 搜尋" +#~ "路徑中。" + +#~ msgid "Running scripts with a GUI" +#~ msgstr "透過 GUI 執行腳本" + +#~ msgid "" +#~ "With older versions of Python, there is one macOS quirk that you need to " +#~ "be aware of: programs that talk to the Aqua window manager (in other " +#~ "words, anything that has a GUI) need to be run in a special way. Use :" +#~ "program:`pythonw` instead of :program:`python` to start such scripts." +#~ msgstr "" +#~ "對於舊版本的 Python,你需要注意一個 macOS 的怪異之處:與 Aqua 視窗管理器溝" +#~ "通的程式(換而言之,任何具有 GUI(圖形化使用者介面)的程式)需要以特殊方式" +#~ "執行。使用 :program:`pythonw` 而不是 :program:`python` 來啟動這樣的腳本。" + +#~ msgid "" +#~ "With Python 3.9, you can use either :program:`python` or :program:" +#~ "`pythonw`." +#~ msgstr "" +#~ "Python 3.9 上,你可以使用 :program:`python` 或者 :program:`pythonw`。" + +#~ msgid "Configuration" +#~ msgstr "設定" + +#~ msgid "" +#~ "Python on macOS honors all standard Unix environment variables such as :" +#~ "envvar:`PYTHONPATH`, but setting these variables for programs started " +#~ "from the Finder is non-standard as the Finder does not read your :file:`." +#~ "profile` or :file:`.cshrc` at startup. You need to create a file :file:" +#~ "`~/.MacOSX/environment.plist`. See Apple's `Technical Q&A QA1067 `__ for details." +#~ msgstr "" +#~ "macOS 上的 Python 遵循所有標準的 Unix 環境變數,例如 :envvar:" +#~ "`PYTHONPATH`,但是為 Finder 啟動的程式設定這些變數並非是標準做法,因為 " +#~ "Finder 在啟動時不會讀取你的 :file:`.profile` 或 :file:`.cshrc`。你需要建立" +#~ "一個檔案 :file:`~/.MacOSX/environment.plist`。相關資訊請參閱 Apple 的\\ `" +#~ "技術問答集 QA1067 `__。" + +#~ msgid "" +#~ "For more information on installation Python packages, see section :ref:" +#~ "`mac-package-manager`." +#~ msgstr "" +#~ "更多關於安裝 Python 套件的資訊,參閱 :ref:`mac-package-manager` 部分。" + +#~ msgid "The IDE" +#~ msgstr "整合化開發工具 (IDE)" + +#~ msgid "" +#~ "Python ships with the standard IDLE development environment. A good " +#~ "introduction to using IDLE can be found at https://www.hashcollision.org/" +#~ "hkn/python/idle_intro/index.html." +#~ msgstr "" +#~ "Python 附帶標準的 IDLE 開發環境。有關使用 IDLE 的詳細介紹,請見 https://" +#~ "www.hashcollision.org/hkn/python/idle_intro/index.html。" + +#~ msgid "" +#~ "The Pythonmac-SIG mailing list is an excellent support resource for " +#~ "Python users and developers on the Mac:" +#~ msgstr "" +#~ "Pythonmac-SIG 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援" +#~ "資源:" + +#~ msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" +#~ msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" + +#~ msgid "Another useful resource is the MacPython wiki:" +#~ msgstr "另一個好用資源是 MacPython wiki:" + +#~ msgid "https://wiki.python.org/moin/MacPython" +#~ msgstr "https://wiki.python.org/moin/MacPython" diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index bdb865bf96..3d79c7dbef 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -705,9 +705,9 @@ msgstr "" #: ../../whatsnew/2.1.rst:445 msgid "" "The dictionary containing attributes can be accessed as the function's :attr:" -"`~object.__dict__`. Unlike the :attr:`~object.__dict__` attribute of class " +"`~function.__dict__`. Unlike the :attr:`~type.__dict__` attribute of class " "instances, in functions you can actually assign a new dictionary to :attr:" -"`~object.__dict__`, though the new value is restricted to a regular Python " +"`~function.__dict__`, though the new value is restricted to a regular Python " "dictionary; you *can't* be tricky and set it to a :class:`!UserDict` " "instance, or any other random object that behaves like a mapping." msgstr "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 337bc0870a..c7dfa7d92c 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,7 +266,8 @@ msgid ":attr:`~definition.__name__` is the attribute's name." msgstr ":attr:`~definition.__name__` 是屬性的名稱。" #: ../../whatsnew/2.2.rst:174 -msgid ":attr:`!__doc__` is the attribute's docstring." +#, fuzzy +msgid ":attr:`~definition.__doc__` is the attribute's docstring." msgstr ":attr:`!__doc__` 是屬性的文件字串 (docstring)。" #: ../../whatsnew/2.2.rst:176 @@ -298,17 +299,17 @@ msgstr "" #: ../../whatsnew/2.2.rst:189 msgid "" -"For methods, :meth:`!descriptor.__get__` returns a temporary object that's " -"callable, and wraps up the instance and the method to be called on it. This " -"is also why static methods and class methods are now possible; they have " -"descriptors that wrap up just the method, or the method and the class. As a " -"brief explanation of these new kinds of methods, static methods aren't " -"passed the instance, and therefore resemble regular functions. Class " -"methods are passed the class of the object, but not the object itself. " -"Static and class methods are defined like this::" +"For methods, :meth:`descriptor.__get__ ` returns a temporary " +"object that's callable, and wraps up the instance and the method to be " +"called on it. This is also why static methods and class methods are now " +"possible; they have descriptors that wrap up just the method, or the method " +"and the class. As a brief explanation of these new kinds of methods, static " +"methods aren't passed the instance, and therefore resemble regular " +"functions. Class methods are passed the class of the object, but not the " +"object itself. Static and class methods are defined like this::" msgstr "" -#: ../../whatsnew/2.2.rst:198 +#: ../../whatsnew/2.2.rst:199 msgid "" "class C(object):\n" " def f(arg1, arg2):\n" @@ -320,7 +321,7 @@ msgid "" " g = classmethod(g)" msgstr "" -#: ../../whatsnew/2.2.rst:207 +#: ../../whatsnew/2.2.rst:208 msgid "" "The :func:`staticmethod` function takes the function :func:`!f`, and returns " "it wrapped up in a descriptor so it can be stored in the class object. You " @@ -329,7 +330,7 @@ msgid "" "has been defined yet; that's been left for future versions of Python." msgstr "" -#: ../../whatsnew/2.2.rst:213 +#: ../../whatsnew/2.2.rst:214 msgid "" "More new features, such as slots and properties, are also implemented as new " "kinds of descriptors, and it's not difficult to write a descriptor class " @@ -339,7 +340,7 @@ msgid "" "defined like this::" msgstr "" -#: ../../whatsnew/2.2.rst:220 +#: ../../whatsnew/2.2.rst:221 msgid "" "from eiffel import eiffelmethod\n" "\n" @@ -357,7 +358,7 @@ msgid "" " f = eiffelmethod(f, pre_f, post_f)" msgstr "" -#: ../../whatsnew/2.2.rst:235 +#: ../../whatsnew/2.2.rst:236 msgid "" "Note that a person using the new :func:`!eiffelmethod` doesn't have to " "understand anything about descriptors. This is why I think the new features " @@ -367,18 +368,18 @@ msgid "" "resulting libraries and ignore the implementation details." msgstr "" -#: ../../whatsnew/2.2.rst:244 +#: ../../whatsnew/2.2.rst:245 msgid "Multiple Inheritance: The Diamond Rule" msgstr "" -#: ../../whatsnew/2.2.rst:246 +#: ../../whatsnew/2.2.rst:247 msgid "" "Multiple inheritance has also been made more useful through changing the " "rules under which names are resolved. Consider this set of classes (diagram " "taken from :pep:`253` by Guido van Rossum)::" msgstr "" -#: ../../whatsnew/2.2.rst:250 +#: ../../whatsnew/2.2.rst:251 msgid "" " class A:\n" " ^ ^ def save(self): ...\n" @@ -395,7 +396,7 @@ msgid "" " class D" msgstr "" -#: ../../whatsnew/2.2.rst:264 +#: ../../whatsnew/2.2.rst:265 msgid "" "The lookup rule for classic classes is simple but not very smart; the base " "classes are searched depth-first, going from left to right. A reference to :" @@ -406,7 +407,7 @@ msgid "" "not calling it will result in that state never getting saved." msgstr "" -#: ../../whatsnew/2.2.rst:272 +#: ../../whatsnew/2.2.rst:273 msgid "" "New-style classes follow a different algorithm that's a bit more complicated " "to explain, but does the right thing in this situation. (Note that Python " @@ -415,7 +416,7 @@ msgid "" "graphs.)" msgstr "" -#: ../../whatsnew/2.2.rst:277 +#: ../../whatsnew/2.2.rst:278 msgid "" "List all the base classes, following the classic lookup rule and include a " "class multiple times if it's visited repeatedly. In the above example, the " @@ -423,7 +424,7 @@ msgid "" "C`, :class:`!A`]." msgstr "" -#: ../../whatsnew/2.2.rst:282 +#: ../../whatsnew/2.2.rst:283 msgid "" "Scan the list for duplicated classes. If any are found, remove all but one " "occurrence, leaving the *last* one in the list. In the above example, the " @@ -431,7 +432,7 @@ msgid "" "dropping duplicates." msgstr "" -#: ../../whatsnew/2.2.rst:287 +#: ../../whatsnew/2.2.rst:288 msgid "" "Following this rule, referring to :meth:`!D.save` will return :meth:`!C." "save`, which is the behaviour we're after. This lookup rule is the same as " @@ -444,7 +445,7 @@ msgid "" "like this::" msgstr "" -#: ../../whatsnew/2.2.rst:296 +#: ../../whatsnew/2.2.rst:297 msgid "" "class D (B,C):\n" " def save (self):\n" @@ -454,18 +455,18 @@ msgid "" " ..." msgstr "" -#: ../../whatsnew/2.2.rst:303 +#: ../../whatsnew/2.2.rst:304 msgid "" ":func:`super` can also return unbound superclass objects when called as " "``super(class)`` or ``super(class1, class2)``, but this probably won't often " "be useful." msgstr "" -#: ../../whatsnew/2.2.rst:309 +#: ../../whatsnew/2.2.rst:310 msgid "Attribute Access" msgstr "" -#: ../../whatsnew/2.2.rst:311 +#: ../../whatsnew/2.2.rst:312 msgid "" "A fair number of sophisticated Python classes define hooks for attribute " "access using :meth:`~object.__getattr__`; most commonly this is done for " @@ -474,7 +475,7 @@ msgid "" "get_parent``. Python 2.2 adds some new ways of controlling attribute access." msgstr "" -#: ../../whatsnew/2.2.rst:317 +#: ../../whatsnew/2.2.rst:318 msgid "" "First, ``__getattr__(attr_name)`` is still supported by new-style classes, " "and nothing about it has changed. As before, it will be called when an " @@ -482,7 +483,7 @@ msgid "" "found in the instance's dictionary." msgstr "" -#: ../../whatsnew/2.2.rst:322 +#: ../../whatsnew/2.2.rst:323 msgid "" "New-style classes also support a new method, " "``__getattribute__(attr_name)``. The difference between the two methods is " @@ -491,7 +492,7 @@ msgid "" "called if ``foo`` isn't found in the instance's dictionary." msgstr "" -#: ../../whatsnew/2.2.rst:328 +#: ../../whatsnew/2.2.rst:329 msgid "" "However, Python 2.2's support for :dfn:`properties` will often be a simpler " "way to trap attribute references. Writing a :meth:`!__getattr__` method is " @@ -504,7 +505,7 @@ msgid "" "in a sizable performance loss." msgstr "" -#: ../../whatsnew/2.2.rst:337 +#: ../../whatsnew/2.2.rst:338 msgid "" ":class:`property` is a new built-in type that packages up three functions " "that get, set, or delete an attribute, and a docstring. For example, if you " @@ -512,7 +513,7 @@ msgid "" "you could write::" msgstr "" -#: ../../whatsnew/2.2.rst:342 +#: ../../whatsnew/2.2.rst:343 msgid "" "class C(object):\n" " def get_size (self):\n" @@ -530,7 +531,7 @@ msgid "" " \"Storage size of this instance\")" msgstr "" -#: ../../whatsnew/2.2.rst:357 +#: ../../whatsnew/2.2.rst:358 msgid "" "That is certainly clearer and easier to write than a pair of :meth:`!" "__getattr__`/:meth:`!__setattr__` methods that check for the :attr:`!size` " @@ -540,7 +541,7 @@ msgid "" "references to other attributes run at their usual speed." msgstr "" -#: ../../whatsnew/2.2.rst:364 +#: ../../whatsnew/2.2.rst:365 msgid "" "Finally, it's possible to constrain the list of attributes that can be " "referenced on an object using the new :attr:`~object.__slots__` class " @@ -551,7 +552,7 @@ msgid "" "names. An example will make this clear::" msgstr "" -#: ../../whatsnew/2.2.rst:371 +#: ../../whatsnew/2.2.rst:372 msgid "" ">>> class C(object):\n" "... __slots__ = ('template', 'name')\n" @@ -568,17 +569,17 @@ msgid "" "AttributeError: 'C' object has no attribute 'newattr'" msgstr "" -#: ../../whatsnew/2.2.rst:385 +#: ../../whatsnew/2.2.rst:386 msgid "" "Note how you get an :exc:`AttributeError` on the attempt to assign to an " "attribute not listed in :attr:`~object.__slots__`." msgstr "" -#: ../../whatsnew/2.2.rst:392 +#: ../../whatsnew/2.2.rst:393 msgid "Related Links" msgstr "相關連結" -#: ../../whatsnew/2.2.rst:394 +#: ../../whatsnew/2.2.rst:395 msgid "" "This section has just been a quick overview of the new features, giving " "enough of an explanation to start you programming, but many details have " @@ -586,7 +587,7 @@ msgid "" "picture?" msgstr "" -#: ../../whatsnew/2.2.rst:398 +#: ../../whatsnew/2.2.rst:399 msgid "" "The :ref:`descriptorhowto` is a lengthy tutorial introduction to the " "descriptor features, written by Guido van Rossum. If my description has " @@ -594,7 +595,7 @@ msgid "" "more detail about the new features while still remaining quite easy to read." msgstr "" -#: ../../whatsnew/2.2.rst:403 +#: ../../whatsnew/2.2.rst:404 msgid "" "Next, there are two relevant PEPs, :pep:`252` and :pep:`253`. :pep:`252` is " "titled \"Making Types Look More Like Classes\", and covers the descriptor " @@ -606,7 +607,7 @@ msgid "" "substantial assistance from the rest of the Zope Corp. team." msgstr "" -#: ../../whatsnew/2.2.rst:412 +#: ../../whatsnew/2.2.rst:413 msgid "" "Finally, there's the ultimate authority: the source code. Most of the " "machinery for the type handling is in :file:`Objects/typeobject.c`, but you " @@ -614,31 +615,31 @@ msgid "" "including posting a question to python-list or python-dev." msgstr "" -#: ../../whatsnew/2.2.rst:421 +#: ../../whatsnew/2.2.rst:422 msgid "PEP 234: Iterators" msgstr "PEP 234:疊代器" -#: ../../whatsnew/2.2.rst:423 +#: ../../whatsnew/2.2.rst:424 msgid "" "Another significant addition to 2.2 is an iteration interface at both the C " "and Python levels. Objects can define how they can be looped over by " "callers." msgstr "" -#: ../../whatsnew/2.2.rst:426 +#: ../../whatsnew/2.2.rst:427 msgid "" "In Python versions up to 2.1, the usual way to make ``for item in obj`` work " "is to define a :meth:`~object.__getitem__` method that looks something like " "this::" msgstr "" -#: ../../whatsnew/2.2.rst:429 +#: ../../whatsnew/2.2.rst:430 msgid "" "def __getitem__(self, index):\n" " return " msgstr "" -#: ../../whatsnew/2.2.rst:432 +#: ../../whatsnew/2.2.rst:433 msgid "" ":meth:`~object.__getitem__` is more properly used to define an indexing " "operation on an object so that you can write ``obj[5]`` to retrieve the " @@ -652,7 +653,7 @@ msgid "" "really should." msgstr "" -#: ../../whatsnew/2.2.rst:442 +#: ../../whatsnew/2.2.rst:443 msgid "" "In Python 2.2, iteration can be implemented separately, and :meth:`~object." "__getitem__` methods can be limited to classes that really do support random " @@ -663,7 +664,7 @@ msgid "" "until it returns *sentinel* to signal that the iterator is done." msgstr "" -#: ../../whatsnew/2.2.rst:450 +#: ../../whatsnew/2.2.rst:451 msgid "" "Python classes can define an :meth:`!__iter__` method, which should create " "and return a new iterator for the object; if the object is its own iterator, " @@ -674,7 +675,7 @@ msgid "" "`~PyTypeObject.tp_iternext` function." msgstr "" -#: ../../whatsnew/2.2.rst:457 +#: ../../whatsnew/2.2.rst:458 msgid "" "So, after all this, what do iterators actually do? They have one required " "method, :meth:`next`, which takes no arguments and returns the next value. " @@ -682,7 +683,7 @@ msgid "" "raise the :exc:`StopIteration` exception. ::" msgstr "" -#: ../../whatsnew/2.2.rst:462 +#: ../../whatsnew/2.2.rst:463 msgid "" ">>> L = [1,2,3]\n" ">>> i = iter(L)\n" @@ -701,7 +702,7 @@ msgid "" ">>>" msgstr "" -#: ../../whatsnew/2.2.rst:478 +#: ../../whatsnew/2.2.rst:479 msgid "" "In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it " "expects something for which :func:`iter` will return an iterator. For " @@ -713,7 +714,7 @@ msgid "" "this::" msgstr "" -#: ../../whatsnew/2.2.rst:486 +#: ../../whatsnew/2.2.rst:487 msgid "" ">>> L = [1,2,3]\n" ">>> i = iter(L)\n" @@ -722,14 +723,14 @@ msgid "" "(1, 2, 3)" msgstr "" -#: ../../whatsnew/2.2.rst:492 +#: ../../whatsnew/2.2.rst:493 msgid "" "Iterator support has been added to some of Python's basic types. Calling :" "func:`iter` on a dictionary will return an iterator which loops over its " "keys::" msgstr "" -#: ../../whatsnew/2.2.rst:495 +#: ../../whatsnew/2.2.rst:496 msgid "" ">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" "... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" @@ -749,7 +750,7 @@ msgid "" "Oct 10" msgstr "" -#: ../../whatsnew/2.2.rst:512 +#: ../../whatsnew/2.2.rst:513 msgid "" "That's just the default behaviour. If you want to iterate over keys, " "values, or key/value pairs, you can explicitly call the :meth:`!iterkeys`, :" @@ -758,21 +759,21 @@ msgid "" "dictionaries, so ``key in dict`` is now equivalent to ``dict.has_key(key)``." msgstr "" -#: ../../whatsnew/2.2.rst:518 +#: ../../whatsnew/2.2.rst:519 msgid "" "Files also provide an iterator, which calls the :meth:`readline` method " "until there are no more lines in the file. This means you can now read each " "line of a file using code like this::" msgstr "" -#: ../../whatsnew/2.2.rst:522 +#: ../../whatsnew/2.2.rst:523 msgid "" "for line in file:\n" " # do something for each line\n" " ..." msgstr "" -#: ../../whatsnew/2.2.rst:526 +#: ../../whatsnew/2.2.rst:527 msgid "" "Note that you can only go forward in an iterator; there's no way to get the " "previous element, reset the iterator, or make a copy of it. An iterator " @@ -780,11 +781,11 @@ msgid "" "only requires a :meth:`next` method." msgstr "" -#: ../../whatsnew/2.2.rst:534 +#: ../../whatsnew/2.2.rst:535 msgid ":pep:`234` - Iterators" msgstr ":pep:`234` - 疊代器" -#: ../../whatsnew/2.2.rst:535 +#: ../../whatsnew/2.2.rst:536 msgid "" "Written by Ka-Ping Yee and GvR; implemented by the Python Labs crew, mostly " "by GvR and Tim Peters." @@ -792,17 +793,17 @@ msgstr "" "由 Ka-Ping Yee 和 GvR 撰寫;由 Python Labs 團隊實作,主要為 GvR 和 Tim " "Peters 所貢獻。" -#: ../../whatsnew/2.2.rst:542 +#: ../../whatsnew/2.2.rst:543 msgid "PEP 255: Simple Generators" msgstr "" -#: ../../whatsnew/2.2.rst:544 +#: ../../whatsnew/2.2.rst:545 msgid "" "Generators are another new feature, one that interacts with the introduction " "of iterators." msgstr "" -#: ../../whatsnew/2.2.rst:547 +#: ../../whatsnew/2.2.rst:548 msgid "" "You're doubtless familiar with how function calls work in Python or C. When " "you call a function, it gets a private namespace where its local variables " @@ -815,18 +816,18 @@ msgid "" "functions." msgstr "" -#: ../../whatsnew/2.2.rst:556 +#: ../../whatsnew/2.2.rst:557 msgid "Here's the simplest example of a generator function::" msgstr "" -#: ../../whatsnew/2.2.rst:558 +#: ../../whatsnew/2.2.rst:559 msgid "" "def generate_ints(N):\n" " for i in range(N):\n" " yield i" msgstr "" -#: ../../whatsnew/2.2.rst:562 +#: ../../whatsnew/2.2.rst:563 msgid "" "A new keyword, :keyword:`yield`, was introduced for generators. Any " "function containing a :keyword:`!yield` statement is a generator function; " @@ -837,7 +838,7 @@ msgid "" "Python 2.3 this statement will become unnecessary." msgstr "" -#: ../../whatsnew/2.2.rst:570 +#: ../../whatsnew/2.2.rst:571 msgid "" "When you call a generator function, it doesn't return a single value; " "instead it returns a generator object that supports the iterator protocol. " @@ -853,11 +854,11 @@ msgid "" "explanation of the interaction between :keyword:`!yield` and exceptions.)" msgstr "" -#: ../../whatsnew/2.2.rst:583 +#: ../../whatsnew/2.2.rst:584 msgid "Here's a sample usage of the :func:`!generate_ints` generator::" msgstr "" -#: ../../whatsnew/2.2.rst:585 +#: ../../whatsnew/2.2.rst:586 msgid "" ">>> gen = generate_ints(3)\n" ">>> gen\n" @@ -875,13 +876,13 @@ msgid "" "StopIteration" msgstr "" -#: ../../whatsnew/2.2.rst:600 +#: ../../whatsnew/2.2.rst:601 msgid "" "You could equally write ``for i in generate_ints(5)``, or ``a,b,c = " "generate_ints(3)``." msgstr "" -#: ../../whatsnew/2.2.rst:603 +#: ../../whatsnew/2.2.rst:604 msgid "" "Inside a generator function, the :keyword:`return` statement can only be " "used without a value, and signals the end of the procession of values; " @@ -892,7 +893,7 @@ msgid "" "flow of execution fall off the bottom of the function." msgstr "" -#: ../../whatsnew/2.2.rst:611 +#: ../../whatsnew/2.2.rst:612 msgid "" "You could achieve the effect of generators manually by writing your own " "class and storing all the local variables of the generator as instance " @@ -905,7 +906,7 @@ msgid "" "recursively. ::" msgstr "" -#: ../../whatsnew/2.2.rst:620 +#: ../../whatsnew/2.2.rst:621 msgid "" "# A recursive generator that generates Tree leaves in in-order.\n" "def inorder(t):\n" @@ -917,7 +918,7 @@ msgid "" " yield x" msgstr "" -#: ../../whatsnew/2.2.rst:629 +#: ../../whatsnew/2.2.rst:630 msgid "" "Two other examples in :file:`Lib/test/test_generators.py` produce solutions " "for the N-Queens problem (placing $N$ queens on an $NxN$ chess board so that " @@ -926,7 +927,7 @@ msgid "" "twice)." msgstr "" -#: ../../whatsnew/2.2.rst:634 +#: ../../whatsnew/2.2.rst:635 msgid "" "The idea of generators comes from other programming languages, especially " "Icon (https://www2.cs.arizona.edu/icon/), where the idea of generators is " @@ -936,13 +937,13 @@ msgid "" "of what this looks like::" msgstr "" -#: ../../whatsnew/2.2.rst:641 +#: ../../whatsnew/2.2.rst:642 msgid "" "sentence := \"Store it in the neighboring harbor\"\n" "if (i := find(\"or\", sentence)) > 5 then write(i)" msgstr "" -#: ../../whatsnew/2.2.rst:644 +#: ../../whatsnew/2.2.rst:645 msgid "" "In Icon the :func:`!find` function returns the indexes at which the " "substring \"or\" is found: 3, 23, 33. In the :keyword:`if` statement, ``i`` " @@ -952,7 +953,7 @@ msgid "" "screen." msgstr "" -#: ../../whatsnew/2.2.rst:650 +#: ../../whatsnew/2.2.rst:651 msgid "" "Python doesn't go nearly as far as Icon in adopting generators as a central " "concept. Generators are considered a new part of the core Python language, " @@ -963,22 +964,22 @@ msgid "" "other functions or stored in a data structure." msgstr "" -#: ../../whatsnew/2.2.rst:661 +#: ../../whatsnew/2.2.rst:662 msgid ":pep:`255` - Simple Generators" msgstr "" -#: ../../whatsnew/2.2.rst:662 +#: ../../whatsnew/2.2.rst:663 msgid "" "Written by Neil Schemenauer, Tim Peters, Magnus Lie Hetland. Implemented " "mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python " "Labs crew." msgstr "" -#: ../../whatsnew/2.2.rst:669 +#: ../../whatsnew/2.2.rst:670 msgid "PEP 237: Unifying Long Integers and Integers" msgstr "" -#: ../../whatsnew/2.2.rst:671 +#: ../../whatsnew/2.2.rst:672 msgid "" "In recent versions, the distinction between regular integers, which are 32-" "bit values on most machines, and long integers, which can be of arbitrary " @@ -991,7 +992,7 @@ msgid "" "exception with the message 'slice index must be int'." msgstr "" -#: ../../whatsnew/2.2.rst:681 +#: ../../whatsnew/2.2.rst:682 msgid "" "Python 2.2 will shift values from short to long integers as required. The " "'L' suffix is no longer needed to indicate a long integer literal, as now " @@ -1002,7 +1003,7 @@ msgid "" "result. For example::" msgstr "" -#: ../../whatsnew/2.2.rst:689 +#: ../../whatsnew/2.2.rst:690 msgid "" ">>> 1234567890123\n" "1234567890123L\n" @@ -1010,28 +1011,28 @@ msgid "" "18446744073709551616L" msgstr "" -#: ../../whatsnew/2.2.rst:694 +#: ../../whatsnew/2.2.rst:695 msgid "" "In most cases, integers and long integers will now be treated identically. " "You can still distinguish them with the :func:`type` built-in function, but " "that's rarely needed." msgstr "" -#: ../../whatsnew/2.2.rst:701 +#: ../../whatsnew/2.2.rst:702 msgid ":pep:`237` - Unifying Long Integers and Integers" msgstr "" -#: ../../whatsnew/2.2.rst:702 +#: ../../whatsnew/2.2.rst:703 msgid "" "Written by Moshe Zadka and Guido van Rossum. Implemented mostly by Guido " "van Rossum." msgstr "" -#: ../../whatsnew/2.2.rst:709 +#: ../../whatsnew/2.2.rst:710 msgid "PEP 238: Changing the Division Operator" msgstr "" -#: ../../whatsnew/2.2.rst:711 +#: ../../whatsnew/2.2.rst:712 msgid "" "The most controversial change in Python 2.2 heralds the start of an effort " "to fix an old design flaw that's been in Python from the beginning. " @@ -1044,7 +1045,7 @@ msgid "" "difficult to determine the possible types of the operands." msgstr "" -#: ../../whatsnew/2.2.rst:721 +#: ../../whatsnew/2.2.rst:722 msgid "" "(The controversy is over whether this is *really* a design flaw, and whether " "it's worth breaking existing code to fix this. It's caused endless " @@ -1054,14 +1055,14 @@ msgid "" "Read :pep:`238` for a summary of arguments and counter-arguments.)" msgstr "" -#: ../../whatsnew/2.2.rst:728 +#: ../../whatsnew/2.2.rst:729 msgid "" "Because this change might break code, it's being introduced very gradually. " "Python 2.2 begins the transition, but the switch won't be complete until " "Python 3.0." msgstr "" -#: ../../whatsnew/2.2.rst:732 +#: ../../whatsnew/2.2.rst:733 msgid "" "First, I'll borrow some terminology from :pep:`238`. \"True division\" is " "the division that most non-programmers are familiar with: 3/2 is 1.5, 1/4 is " @@ -1073,11 +1074,11 @@ msgid "" "the operands is a floating-point number." msgstr "" -#: ../../whatsnew/2.2.rst:740 +#: ../../whatsnew/2.2.rst:741 msgid "Here are the changes 2.2 introduces:" msgstr "" -#: ../../whatsnew/2.2.rst:742 +#: ../../whatsnew/2.2.rst:743 msgid "" "A new operator, ``//``, is the floor division operator. (Yes, we know it " "looks like C++'s comment symbol.) ``//`` *always* performs floor division " @@ -1085,13 +1086,13 @@ msgid "" "``1.0 // 2.0`` is also 0.0." msgstr "" -#: ../../whatsnew/2.2.rst:747 +#: ../../whatsnew/2.2.rst:748 msgid "" "``//`` is always available in Python 2.2; you don't need to enable it using " "a ``__future__`` statement." msgstr "" -#: ../../whatsnew/2.2.rst:750 +#: ../../whatsnew/2.2.rst:751 msgid "" "By including a ``from __future__ import division`` in a module, the ``/`` " "operator will be changed to return the result of true division, so ``1/2`` " @@ -1099,7 +1100,7 @@ msgid "" "division. The default meaning of ``/`` will not change until Python 3.0." msgstr "" -#: ../../whatsnew/2.2.rst:755 +#: ../../whatsnew/2.2.rst:756 msgid "" "Classes can define methods called :meth:`~object.__truediv__` and :meth:" "`~object.__floordiv__` to overload the two division operators. At the C " @@ -1107,7 +1108,7 @@ msgid "" "extension types can define the two operators." msgstr "" -#: ../../whatsnew/2.2.rst:760 +#: ../../whatsnew/2.2.rst:761 msgid "" "Python 2.2 supports some command-line arguments for testing whether code " "will work with the changed division semantics. Running python with :option:" @@ -1117,21 +1118,21 @@ msgid "" "without a warning; the warning will be turned on by default in Python 2.3." msgstr "" -#: ../../whatsnew/2.2.rst:770 +#: ../../whatsnew/2.2.rst:771 msgid ":pep:`238` - Changing the Division Operator" msgstr "" -#: ../../whatsnew/2.2.rst:771 +#: ../../whatsnew/2.2.rst:772 msgid "" "Written by Moshe Zadka and Guido van Rossum. Implemented by Guido van " "Rossum.." msgstr "" -#: ../../whatsnew/2.2.rst:777 +#: ../../whatsnew/2.2.rst:778 msgid "Unicode Changes" msgstr "Unicode 變更" -#: ../../whatsnew/2.2.rst:779 +#: ../../whatsnew/2.2.rst:780 msgid "" "Python's Unicode support has been enhanced a bit in 2.2. Unicode strings " "are usually stored as UCS-2, as 16-bit unsigned integers. Python 2.2 can " @@ -1141,7 +1142,7 @@ msgid "" "completely disable Unicode support.)" msgstr "" -#: ../../whatsnew/2.2.rst:786 +#: ../../whatsnew/2.2.rst:787 msgid "" "When built to use UCS-4 (a \"wide Python\"), the interpreter can natively " "handle Unicode characters from U+000000 to U+110000, so the range of legal " @@ -1152,7 +1153,7 @@ msgid "" "characters\"; consult it for further details." msgstr "" -#: ../../whatsnew/2.2.rst:794 +#: ../../whatsnew/2.2.rst:795 msgid "" "Another change is simpler to explain. Since their introduction, Unicode " "strings have supported an :meth:`!encode` method to convert the string to a " @@ -1163,14 +1164,14 @@ msgid "" "codec." msgstr "" -#: ../../whatsnew/2.2.rst:801 +#: ../../whatsnew/2.2.rst:802 msgid "" "Using this new feature, codecs have been added for tasks not directly " "related to Unicode. For example, codecs have been added for uu-encoding, " "MIME's base64 encoding, and compression with the :mod:`zlib` module::" msgstr "" -#: ../../whatsnew/2.2.rst:805 +#: ../../whatsnew/2.2.rst:806 msgid "" ">>> s = \"\"\"Here is a lengthy piece of redundant, overly verbose,\n" "... and repetitive text.\n" @@ -1191,32 +1192,32 @@ msgid "" "'furrfu'" msgstr "" -#: ../../whatsnew/2.2.rst:822 +#: ../../whatsnew/2.2.rst:823 msgid "" "To convert a class instance to Unicode, a :meth:`!__unicode__` method can be " "defined by a class, analogous to :meth:`!__str__`." msgstr "" -#: ../../whatsnew/2.2.rst:825 +#: ../../whatsnew/2.2.rst:826 msgid "" ":meth:`!encode`, :meth:`!decode`, and :meth:`!__unicode__` were implemented " "by Marc-André Lemburg. The changes to support using UCS-4 internally were " "implemented by Fredrik Lundh and Martin von Löwis." msgstr "" -#: ../../whatsnew/2.2.rst:832 +#: ../../whatsnew/2.2.rst:833 msgid ":pep:`261` - Support for 'wide' Unicode characters" msgstr ":pep:`261` - 支援 'wide' Unicode 字元" -#: ../../whatsnew/2.2.rst:833 +#: ../../whatsnew/2.2.rst:834 msgid "Written by Paul Prescod." msgstr "由 Paul Prescod 撰寫。" -#: ../../whatsnew/2.2.rst:839 +#: ../../whatsnew/2.2.rst:840 msgid "PEP 227: Nested Scopes" msgstr "" -#: ../../whatsnew/2.2.rst:841 +#: ../../whatsnew/2.2.rst:842 msgid "" "In Python 2.1, statically nested scopes were added as an optional feature, " "to be enabled by a ``from __future__ import nested_scopes`` directive. In " @@ -1226,7 +1227,7 @@ msgid "" "2.1 came out, you can skip the rest of this section." msgstr "" -#: ../../whatsnew/2.2.rst:848 +#: ../../whatsnew/2.2.rst:849 msgid "" "The largest change introduced in Python 2.1, and made complete in 2.2, is to " "Python's scoping rules. In Python 2.0, at any given time there are at most " @@ -1236,7 +1237,7 @@ msgid "" "definition doesn't work::" msgstr "" -#: ../../whatsnew/2.2.rst:855 +#: ../../whatsnew/2.2.rst:856 msgid "" "def f():\n" " ...\n" @@ -1246,7 +1247,7 @@ msgid "" " ..." msgstr "" -#: ../../whatsnew/2.2.rst:862 +#: ../../whatsnew/2.2.rst:863 msgid "" "The function :func:`!g` will always raise a :exc:`NameError` exception, " "because the binding of the name ``g`` isn't in either its local namespace or " @@ -1258,7 +1259,7 @@ msgid "" "arguments. ::" msgstr "" -#: ../../whatsnew/2.2.rst:870 +#: ../../whatsnew/2.2.rst:871 msgid "" "def find(self, name):\n" " \"Return list of any entries equal to 'name'\"\n" @@ -1267,13 +1268,13 @@ msgid "" " return L" msgstr "" -#: ../../whatsnew/2.2.rst:876 +#: ../../whatsnew/2.2.rst:877 msgid "" "The readability of Python code written in a strongly functional style " "suffers greatly as a result." msgstr "" -#: ../../whatsnew/2.2.rst:879 +#: ../../whatsnew/2.2.rst:880 msgid "" "The most significant change to Python 2.2 is that static scoping has been " "added to the language to fix this problem. As a first effect, the " @@ -1285,7 +1286,7 @@ msgid "" "rules, and a dissection of the implementation, can be found in the PEP." msgstr "" -#: ../../whatsnew/2.2.rst:888 +#: ../../whatsnew/2.2.rst:889 msgid "" "This change may cause some compatibility problems for code where the same " "variable name is used both at the module level and as a local variable " @@ -1294,7 +1295,7 @@ msgid "" "read in the first place." msgstr "" -#: ../../whatsnew/2.2.rst:894 +#: ../../whatsnew/2.2.rst:895 msgid "" "One side effect of the change is that the ``from module import *`` and " "``exec`` statements have been made illegal inside a function scope under " @@ -1310,11 +1311,11 @@ msgid "" "the compiler will flag this by raising a :exc:`SyntaxError` exception." msgstr "" -#: ../../whatsnew/2.2.rst:907 +#: ../../whatsnew/2.2.rst:908 msgid "To make the preceding explanation a bit clearer, here's an example::" msgstr "" -#: ../../whatsnew/2.2.rst:909 +#: ../../whatsnew/2.2.rst:910 msgid "" "x = 1\n" "def f():\n" @@ -1324,33 +1325,33 @@ msgid "" " return x" msgstr "" -#: ../../whatsnew/2.2.rst:916 +#: ../../whatsnew/2.2.rst:917 msgid "" "Line 4 containing the ``exec`` statement is a syntax error, since ``exec`` " "would define a new local variable named ``x`` whose value should be accessed " "by :func:`!g`." msgstr "" -#: ../../whatsnew/2.2.rst:920 +#: ../../whatsnew/2.2.rst:921 msgid "" "This shouldn't be much of a limitation, since ``exec`` is rarely used in " "most Python code (and when it is used, it's often a sign of a poor design " "anyway)." msgstr "" -#: ../../whatsnew/2.2.rst:927 +#: ../../whatsnew/2.2.rst:928 msgid ":pep:`227` - Statically Nested Scopes" msgstr "" -#: ../../whatsnew/2.2.rst:928 +#: ../../whatsnew/2.2.rst:929 msgid "Written and implemented by Jeremy Hylton." msgstr "" -#: ../../whatsnew/2.2.rst:934 +#: ../../whatsnew/2.2.rst:935 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.2.rst:936 +#: ../../whatsnew/2.2.rst:937 msgid "" "The :mod:`xmlrpclib ` module was contributed to the standard " "library by Fredrik Lundh, providing support for writing XML-RPC clients. " @@ -1360,7 +1361,7 @@ msgid "" "channel::" msgstr "" -#: ../../whatsnew/2.2.rst:942 +#: ../../whatsnew/2.2.rst:943 msgid "" "import xmlrpclib\n" "s = xmlrpclib.Server(\n" @@ -1380,20 +1381,20 @@ msgid "" "# 'title': 'html2fo 0.3 (Default)'}, ... ]" msgstr "" -#: ../../whatsnew/2.2.rst:959 +#: ../../whatsnew/2.2.rst:960 msgid "" "The :mod:`SimpleXMLRPCServer ` module makes it easy to create " "straightforward XML-RPC servers. See http://xmlrpc.scripting.com/ for more " "information about XML-RPC." msgstr "" -#: ../../whatsnew/2.2.rst:962 +#: ../../whatsnew/2.2.rst:963 msgid "" "The new :mod:`hmac` module implements the HMAC algorithm described by :rfc:" "`2104`. (Contributed by Gerhard Häring.)" msgstr "" -#: ../../whatsnew/2.2.rst:965 +#: ../../whatsnew/2.2.rst:966 msgid "" "Several functions that originally returned lengthy tuples now return pseudo-" "sequences that still behave like tuples but also have mnemonic attributes " @@ -1404,7 +1405,7 @@ msgid "" "`time` module." msgstr "" -#: ../../whatsnew/2.2.rst:972 +#: ../../whatsnew/2.2.rst:973 msgid "" "For example, to obtain a file's size using the old tuples, you'd end up " "writing something like ``file_size = os.stat(filename)[stat.ST_SIZE]``, but " @@ -1412,25 +1413,25 @@ msgid "" "st_size``." msgstr "" -#: ../../whatsnew/2.2.rst:976 +#: ../../whatsnew/2.2.rst:977 msgid "The original patch for this feature was contributed by Nick Mathewson." msgstr "" -#: ../../whatsnew/2.2.rst:978 +#: ../../whatsnew/2.2.rst:979 msgid "" "The Python profiler has been extensively reworked and various errors in its " "output have been corrected. (Contributed by Fred L. Drake, Jr. and Tim " "Peters.)" msgstr "" -#: ../../whatsnew/2.2.rst:981 +#: ../../whatsnew/2.2.rst:982 msgid "" "The :mod:`socket` module can be compiled to support IPv6; specify the :" "option:`!--enable-ipv6` option to Python's configure script. (Contributed " "by Jun-ichiro \"itojun\" Hagino.)" msgstr "" -#: ../../whatsnew/2.2.rst:985 +#: ../../whatsnew/2.2.rst:986 msgid "" "Two new format characters were added to the :mod:`struct` module for 64-bit " "integers on platforms that support the C :c:expr:`long long` type. ``q`` is " @@ -1438,7 +1439,7 @@ msgid "" "returned in Python's long integer type. (Contributed by Tim Peters.)" msgstr "" -#: ../../whatsnew/2.2.rst:990 +#: ../../whatsnew/2.2.rst:991 msgid "" "In the interpreter's interactive mode, there's a new built-in function :func:" "`help` that uses the :mod:`pydoc` module introduced in Python 2.1 to provide " @@ -1449,7 +1450,7 @@ msgid "" "`pydoc` module.)" msgstr "" -#: ../../whatsnew/2.2.rst:998 +#: ../../whatsnew/2.2.rst:999 msgid "" "Various bugfixes and performance improvements have been made to the SRE " "engine underlying the :mod:`re` module. For example, the :func:`re.sub` " @@ -1460,7 +1461,7 @@ msgid "" "Fredrik Lundh. The BIGCHARSET patch was contributed by Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.2.rst:1006 +#: ../../whatsnew/2.2.rst:1007 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 " @@ -1468,7 +1469,7 @@ msgid "" "also supports SMTP authentication. (Contributed by Gerhard Häring.)" msgstr "" -#: ../../whatsnew/2.2.rst:1011 +#: ../../whatsnew/2.2.rst:1012 msgid "" "The :mod:`imaplib` module, maintained by Piers Lauder, has support for " "several new extensions: the NAMESPACE extension defined in :rfc:`2342`, " @@ -1476,7 +1477,7 @@ msgid "" "Pelletier.)" msgstr "" -#: ../../whatsnew/2.2.rst:1015 +#: ../../whatsnew/2.2.rst:1016 msgid "" "The :mod:`!rfc822` module's parsing of email addresses is now compliant " "with :rfc:`2822`, an update to :rfc:`822`. (The module's name is *not* " @@ -1485,7 +1486,7 @@ msgid "" "Barry Warsaw, and arising out of his work on Mailman.)" msgstr "" -#: ../../whatsnew/2.2.rst:1021 +#: ../../whatsnew/2.2.rst:1022 msgid "" "The :mod:`difflib` module now contains a new :class:`!Differ` class for " "producing human-readable lists of changes (a \"delta\") between two " @@ -1496,7 +1497,7 @@ msgid "" "the generatorization.)" msgstr "" -#: ../../whatsnew/2.2.rst:1028 +#: ../../whatsnew/2.2.rst:1029 msgid "" "New constants :const:`!ascii_letters`, :const:`!ascii_lowercase`, and :const:" "`!ascii_uppercase` were added to the :mod:`string` module. There were " @@ -1508,25 +1509,25 @@ msgid "" "person; fixed by Fred L. Drake, Jr.)" msgstr "" -#: ../../whatsnew/2.2.rst:1037 +#: ../../whatsnew/2.2.rst:1038 msgid "" "The :mod:`mimetypes` module now makes it easier to use alternative MIME-type " "databases by the addition of a :class:`~mimetypes.MimeTypes` class, which " "takes a list of filenames to be parsed. (Contributed by Fred L. Drake, Jr.)" msgstr "" -#: ../../whatsnew/2.2.rst:1041 +#: ../../whatsnew/2.2.rst:1042 msgid "" "A :class:`~threading.Timer` class was added to the :mod:`threading` module " "that allows scheduling an activity to happen at some future time. " "(Contributed by Itamar Shtull-Trauring.)" msgstr "" -#: ../../whatsnew/2.2.rst:1049 +#: ../../whatsnew/2.2.rst:1050 msgid "Interpreter Changes and Fixes" msgstr "直譯器的變更與修正" -#: ../../whatsnew/2.2.rst:1051 +#: ../../whatsnew/2.2.rst:1052 msgid "" "Some of the changes only affect people who deal with the Python interpreter " "at the C level because they're writing Python extension modules, embedding " @@ -1535,7 +1536,7 @@ msgid "" "much." msgstr "" -#: ../../whatsnew/2.2.rst:1056 +#: ../../whatsnew/2.2.rst:1057 msgid "" "Profiling and tracing functions can now be implemented in C, which can " "operate at much higher speeds than Python-based functions and should reduce " @@ -1547,7 +1548,7 @@ msgid "" "(Contributed by Fred L. Drake, Jr.)" msgstr "" -#: ../../whatsnew/2.2.rst:1065 +#: ../../whatsnew/2.2.rst:1066 msgid "" "Another low-level API, primarily of interest to implementers of Python " "debuggers and development tools, was added. :c:func:" @@ -1558,7 +1559,7 @@ msgid "" "David Beazley.)" msgstr "" -#: ../../whatsnew/2.2.rst:1072 +#: ../../whatsnew/2.2.rst:1073 msgid "" "The C-level interface to the garbage collector has been changed to make it " "easier to write extension types that support garbage collection and to debug " @@ -1569,41 +1570,41 @@ msgid "" "priority." msgstr "" -#: ../../whatsnew/2.2.rst:1079 +#: ../../whatsnew/2.2.rst:1080 msgid "" "To upgrade an extension module to the new API, perform the following steps:" msgstr "" -#: ../../whatsnew/2.2.rst:1081 +#: ../../whatsnew/2.2.rst:1082 msgid "Rename :c:macro:`!Py_TPFLAGS_GC` to :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" "將 :c:macro:`!Py_TPFLAGS_GC` 重新命名為 :c:macro:`Py_TPFLAGS_HAVE_GC`。" -#: ../../whatsnew/2.2.rst:1083 +#: ../../whatsnew/2.2.rst:1084 msgid "" "Use :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar` to allocate" msgstr "" -#: ../../whatsnew/2.2.rst:1084 +#: ../../whatsnew/2.2.rst:1085 msgid "objects, and :c:func:`PyObject_GC_Del` to deallocate them." msgstr "" -#: ../../whatsnew/2.2.rst:1086 +#: ../../whatsnew/2.2.rst:1087 msgid "" "Rename :c:func:`!PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and :c:" "func:`!PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." msgstr "" -#: ../../whatsnew/2.2.rst:1089 +#: ../../whatsnew/2.2.rst:1090 msgid "Remove :c:macro:`!PyGC_HEAD_SIZE` from object size calculations." msgstr "" -#: ../../whatsnew/2.2.rst:1091 +#: ../../whatsnew/2.2.rst:1092 msgid "" "Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`." msgstr "" -#: ../../whatsnew/2.2.rst:1093 +#: ../../whatsnew/2.2.rst:1094 msgid "" "A new ``et`` format sequence was added to :c:func:`PyArg_ParseTuple`; ``et`` " "takes both a parameter and an encoding name, and converts the parameter to " @@ -1615,7 +1616,7 @@ msgid "" "and used for the MBCS support on Windows described in the following section.)" msgstr "" -#: ../../whatsnew/2.2.rst:1102 +#: ../../whatsnew/2.2.rst:1103 msgid "" "A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been " "added that's simpler and presumably faster. Instead of specifying a format " @@ -1624,7 +1625,7 @@ msgid "" "be filled in with argument values." msgstr "" -#: ../../whatsnew/2.2.rst:1108 +#: ../../whatsnew/2.2.rst:1109 msgid "" "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 " @@ -1634,7 +1635,7 @@ msgid "" "methods is now officially deprecated." msgstr "" -#: ../../whatsnew/2.2.rst:1114 +#: ../../whatsnew/2.2.rst:1115 msgid "" "Two new wrapper functions, :c:func:`PyOS_snprintf` and :c:func:" "`PyOS_vsnprintf` were added to provide cross-platform implementations for " @@ -1644,7 +1645,7 @@ msgid "" "protect against buffer overruns. (Contributed by M.-A. Lemburg.)" msgstr "" -#: ../../whatsnew/2.2.rst:1121 +#: ../../whatsnew/2.2.rst:1122 msgid "" "The :c:func:`_PyTuple_Resize` function has lost an unused parameter, so now " "it takes 2 parameters instead of 3. The third argument was never used, and " @@ -1652,11 +1653,11 @@ msgid "" "2.2." msgstr "" -#: ../../whatsnew/2.2.rst:1129 +#: ../../whatsnew/2.2.rst:1130 msgid "Other Changes and Fixes" msgstr "其他改動與修正" -#: ../../whatsnew/2.2.rst:1131 +#: ../../whatsnew/2.2.rst:1132 msgid "" "As usual there were a bunch of other improvements and bugfixes scattered " "throughout the source tree. A search through the CVS change logs finds " @@ -1665,18 +1666,18 @@ msgid "" "and fixed 82 bugs. These figures are likely to be underestimates." msgstr "" -#: ../../whatsnew/2.2.rst:1137 +#: ../../whatsnew/2.2.rst:1138 msgid "Some of the more notable changes are:" msgstr "一些較顯著的變更為:" -#: ../../whatsnew/2.2.rst:1139 +#: ../../whatsnew/2.2.rst:1140 msgid "" "The code for the MacOS port for Python, maintained by Jack Jansen, is now " "kept in the main Python CVS tree, and many changes have been made to support " "MacOS X." msgstr "" -#: ../../whatsnew/2.2.rst:1142 +#: ../../whatsnew/2.2.rst:1143 msgid "" "The most significant change is the ability to build Python as a framework, " "enabled by supplying the :option:`!--enable-framework` option to the " @@ -1690,7 +1691,7 @@ msgid "" "OSA scripting language and much more.\"" msgstr "" -#: ../../whatsnew/2.2.rst:1153 +#: ../../whatsnew/2.2.rst:1154 msgid "" "Most of the MacPython toolbox modules, which interface to MacOS APIs such as " "windowing, QuickTime, scripting, etc. have been ported to OS X, but they've " @@ -1698,14 +1699,14 @@ msgid "" "with these modules can uncomment them manually." msgstr "" -#: ../../whatsnew/2.2.rst:1176 +#: ../../whatsnew/2.2.rst:1177 msgid "" "Keyword arguments passed to built-in functions that don't take them now " "cause a :exc:`TypeError` exception to be raised, with the message " "\"*function* takes no keyword arguments\"." msgstr "" -#: ../../whatsnew/2.2.rst:1180 +#: ../../whatsnew/2.2.rst:1181 msgid "" "Weak references, added in Python 2.1 as an extension module, are now part of " "the core because they're used in the implementation of new-style classes. " @@ -1713,14 +1714,14 @@ msgid "" "`weakref` module to become a built-in exception." msgstr "" -#: ../../whatsnew/2.2.rst:1185 +#: ../../whatsnew/2.2.rst:1186 msgid "" "A new script, :file:`Tools/scripts/cleanfuture.py` by Tim Peters, " "automatically removes obsolete ``__future__`` statements from Python source " "code." msgstr "" -#: ../../whatsnew/2.2.rst:1189 +#: ../../whatsnew/2.2.rst:1190 msgid "" "An additional *flags* argument has been added to the built-in function :func:" "`compile`, so the behaviour of ``__future__`` statements can now be " @@ -1729,7 +1730,7 @@ msgid "" "(Contributed by Michael Hudson.)" msgstr "" -#: ../../whatsnew/2.2.rst:1195 +#: ../../whatsnew/2.2.rst:1196 msgid "" "The new license introduced with Python 1.6 wasn't GPL-compatible. This is " "fixed by some minor textual changes to the 2.2 license, so it's now legal to " @@ -1739,7 +1740,7 @@ msgid "" "to the Python 2.0.1 and 2.1.1 releases." msgstr "" -#: ../../whatsnew/2.2.rst:1202 +#: ../../whatsnew/2.2.rst:1203 msgid "" "When presented with a Unicode filename on Windows, Python will now convert " "it to an MBCS encoded string, as used by the Microsoft file APIs. As MBCS " @@ -1750,18 +1751,18 @@ msgid "" "Unix support was added by Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.2.rst:1210 +#: ../../whatsnew/2.2.rst:1211 msgid "" "Large file support is now enabled on Windows. (Contributed by Tim Peters.)" msgstr "" -#: ../../whatsnew/2.2.rst:1212 +#: ../../whatsnew/2.2.rst:1213 msgid "" "The :file:`Tools/scripts/ftpmirror.py` script now parses a :file:`.netrc` " "file, if you have one. (Contributed by Mike Romberg.)" msgstr "" -#: ../../whatsnew/2.2.rst:1215 +#: ../../whatsnew/2.2.rst:1216 msgid "" "Some features of the object returned by the :func:`!xrange` function are now " "deprecated, and trigger warnings when they're accessed; they'll disappear in " @@ -1774,7 +1775,7 @@ msgid "" "been deprecated." msgstr "" -#: ../../whatsnew/2.2.rst:1224 +#: ../../whatsnew/2.2.rst:1225 msgid "" "There were a bunch of patches to the dictionary implementation, mostly to " "fix potential core dumps if a dictionary contains objects that sneakily " @@ -1784,14 +1785,14 @@ msgid "" "case, and round and round it went." msgstr "" -#: ../../whatsnew/2.2.rst:1231 +#: ../../whatsnew/2.2.rst:1232 msgid "" "On Windows, Python can now be compiled with Borland C thanks to a number of " "patches contributed by Stephen Hansen, though the result isn't fully " "functional yet. (But this *is* progress...)" msgstr "" -#: ../../whatsnew/2.2.rst:1235 +#: ../../whatsnew/2.2.rst:1236 msgid "" "Another Windows enhancement: Wise Solutions generously offered PythonLabs " "use of their InstallerMaster 8.1 system. Earlier PythonLabs Windows " @@ -1799,7 +1800,7 @@ msgid "" "up by Tim Peters.)" msgstr "" -#: ../../whatsnew/2.2.rst:1239 +#: ../../whatsnew/2.2.rst:1240 msgid "" "Files ending in ``.pyw`` can now be imported on Windows. ``.pyw`` is a " "Windows-only thing, used to indicate that a script needs to be run using " @@ -1809,7 +1810,7 @@ msgid "" "Bolen.)" msgstr "" -#: ../../whatsnew/2.2.rst:1245 +#: ../../whatsnew/2.2.rst:1246 msgid "" "On platforms where Python uses the C :c:func:`dlopen` function to load " "extension modules, it's now possible to set the flags used by :c:func:" @@ -1817,7 +1818,7 @@ msgid "" "functions. (Contributed by Bram Stolk.)" msgstr "" -#: ../../whatsnew/2.2.rst:1250 +#: ../../whatsnew/2.2.rst:1251 msgid "" "The :func:`pow` built-in function no longer supports 3 arguments when " "floating-point numbers are supplied. ``pow(x, y, z)`` returns ``(x**y) % " @@ -1826,11 +1827,11 @@ msgid "" "``pow(2.0, 8.0, 7.0)`` will now raise a :exc:`TypeError` exception." msgstr "" -#: ../../whatsnew/2.2.rst:1260 +#: ../../whatsnew/2.2.rst:1261 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.2.rst:1262 +#: ../../whatsnew/2.2.rst:1263 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 6e32c82426..c46877f1e0 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -874,9 +874,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." @@ -1663,11 +1663,11 @@ msgstr "" #: ../../whatsnew/2.3.rst:1115 msgid "" "One of the noted incompatibilities between old- and new-style classes has " -"been removed: you can now assign to the :attr:`~definition.__name__` and :" -"attr:`~class.__bases__` attributes of new-style classes. There are some " -"restrictions on what can be assigned to :attr:`~class.__bases__` along the " -"lines of those relating to assigning to an instance's :attr:`~instance." -"__class__` attribute." +"been removed: you can now assign to the :attr:`~type.__name__` and :attr:" +"`~type.__bases__` attributes of new-style classes. There are some " +"restrictions on what can be assigned to :attr:`!__bases__` along the lines " +"of those relating to assigning to an instance's :attr:`~object.__class__` " +"attribute." msgstr "" #: ../../whatsnew/2.3.rst:1125 @@ -2892,8 +2892,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1927 msgid "" "If you dynamically allocate type objects in your extension, you should be " -"aware of a change in the rules relating to the :attr:`!__module__` and :attr:" -"`~definition.__name__` attributes. In summary, you will want to ensure the " +"aware of a change in the rules relating to the :attr:`~type.__module__` and :" +"attr:`~type.__name__` attributes. In summary, you will want to ensure the " "type's dictionary contains a ``'__module__'`` key; making the module name " "the part of the type name leading up to the final period will no longer have " "the desired effect. For more detail, read the API reference documentation " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 455bd09e90..96311cb157 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -1844,37 +1844,37 @@ msgid "" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" #: ../../whatsnew/3.12.rst:1205 -#: ../../deprecations/pending-removal-in-3.14.rst:55 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1206 -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1207 -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1209 -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" #: ../../whatsnew/3.12.rst:1211 -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1212 -#: ../../deprecations/pending-removal-in-3.14.rst:62 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1214 -#: ../../deprecations/pending-removal-in-3.14.rst:64 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" @@ -1958,7 +1958,7 @@ msgstr "" "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1267 -#: ../../deprecations/pending-removal-in-3.14.rst:94 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" @@ -1994,7 +1994,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:53 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2281,18 +2281,10 @@ msgstr "" "Alan Williams 於 :gh:`72346` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2303,7 +2295,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:72 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2320,7 +2312,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:80 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -2328,7 +2320,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -2338,23 +2330,23 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:92 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -2364,7 +2356,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -2372,7 +2364,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:105 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -2384,7 +2376,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -2392,7 +2384,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:115 +#: ../../deprecations/pending-removal-in-3.14.rst:112 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -2440,11 +2432,19 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:20 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" +":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " +"系統考慮。 (:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:22 +#: ../../deprecations/pending-removal-in-3.15.rst:25 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -2458,12 +2458,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:30 +#: ../../deprecations/pending-removal-in-3.15.rst:33 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-3.15.rst:35 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -2472,24 +2472,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../deprecations/pending-removal-in-3.15.rst:39 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:38 +#: ../../deprecations/pending-removal-in-3.15.rst:41 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:45 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:47 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -2497,7 +2497,7 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:55 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -2509,19 +2509,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../deprecations/pending-removal-in-3.15.rst:66 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:68 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -4085,8 +4085,8 @@ msgstr "" msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " -"classes to support object ``__dict__`` and weakrefs with less bookkeeping, " -"using less memory and with faster access." +"classes to support object :attr:`~object.__dict__` and weakrefs with less " +"bookkeeping, using less memory and with faster access." msgstr "" #: ../../whatsnew/3.12.rst:1893 @@ -4295,7 +4295,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:2008 msgid "" -"To get a list of subclasses, call the Python method :py:meth:`~class." +"To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" @@ -4325,8 +4325,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:2028 msgid "" -"Extension classes wanting to add a ``__dict__`` or weak reference slot " -"should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" +"Extension classes wanting to add a :attr:`~object.__dict__` or weak " +"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " "``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " "``tp_weaklistoffset`` is still supported, but does not fully support " diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 0f78043e87..74edc87bd3 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-04 16:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,7 +32,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:48 msgid "" "This article explains the new features in Python 3.13, compared to 3.12. " -"Python 3.13 will be released on October 1, 2024. For full details, see the :" +"Python 3.13 will be released on October 7, 2024. For full details, see the :" "ref:`changelog `." msgstr "" @@ -132,157 +132,158 @@ msgstr "" #: ../../whatsnew/3.13.rst:124 msgid "" -":attr:`~class.__static_attributes__` stores the names of attributes accessed " +":attr:`~type.__static_attributes__` stores the names of attributes accessed " "through ``self.X`` in any function in a class body." msgstr "" #: ../../whatsnew/3.13.rst:126 msgid "" -":attr:`!__firstlineno__` records the first line number of a class definition." +":attr:`~type.__firstlineno__` records the first line number of a class " +"definition." msgstr "" -#: ../../whatsnew/3.13.rst:128 +#: ../../whatsnew/3.13.rst:129 msgid "Significant improvements in the standard library:" msgstr "" -#: ../../whatsnew/3.13.rst:130 +#: ../../whatsnew/3.13.rst:131 msgid "" "Add a new :exc:`PythonFinalizationError` exception, raised when an operation " "is blocked during :term:`finalization `." msgstr "" -#: ../../whatsnew/3.13.rst:132 +#: ../../whatsnew/3.13.rst:133 msgid "" "The :mod:`argparse` module now supports deprecating command-line options, " "positional arguments, and subcommands." msgstr "" -#: ../../whatsnew/3.13.rst:134 +#: ../../whatsnew/3.13.rst:135 msgid "" "The new functions :func:`base64.z85encode` and :func:`base64.z85decode` " "support encoding and decoding `Z85 data`_." msgstr "" -#: ../../whatsnew/3.13.rst:136 +#: ../../whatsnew/3.13.rst:137 msgid "" "The :mod:`copy` module now has a :func:`copy.replace` function, with support " "for many builtin types and any class defining the :func:`~object." "__replace__` method." msgstr "" -#: ../../whatsnew/3.13.rst:139 +#: ../../whatsnew/3.13.rst:140 msgid "" "The new :mod:`dbm.sqlite3` module is now the default :mod:`dbm` backend." msgstr "" -#: ../../whatsnew/3.13.rst:140 +#: ../../whatsnew/3.13.rst:141 msgid "" "The :mod:`os` module has a :ref:`suite of new functions ` for " "working with Linux's timer notification file descriptors." msgstr "" -#: ../../whatsnew/3.13.rst:142 +#: ../../whatsnew/3.13.rst:143 msgid "" "The :mod:`random` module now has a :ref:`command-line interface `." msgstr "" -#: ../../whatsnew/3.13.rst:144 +#: ../../whatsnew/3.13.rst:145 msgid "Security improvements:" msgstr "" -#: ../../whatsnew/3.13.rst:146 +#: ../../whatsnew/3.13.rst:147 msgid "" ":func:`ssl.create_default_context` sets :data:`ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`ssl.VERIFY_X509_STRICT` as default " "flags." msgstr "" -#: ../../whatsnew/3.13.rst:149 +#: ../../whatsnew/3.13.rst:150 msgid "C API improvements:" msgstr "" -#: ../../whatsnew/3.13.rst:151 +#: ../../whatsnew/3.13.rst:152 msgid "" "The :c:data:`Py_mod_gil` slot is now used to indicate that an extension " "module supports running with the :term:`GIL` disabled." msgstr "" -#: ../../whatsnew/3.13.rst:153 +#: ../../whatsnew/3.13.rst:154 msgid "" "The :doc:`PyTime C API ` has been added, providing access to " "system clocks." msgstr "" -#: ../../whatsnew/3.13.rst:155 +#: ../../whatsnew/3.13.rst:156 msgid "" ":c:type:`PyMutex` is a new lightweight mutex that occupies a single byte." msgstr "" -#: ../../whatsnew/3.13.rst:156 +#: ../../whatsnew/3.13.rst:157 msgid "" "There is a new :ref:`suite of functions ` for generating :" "pep:`669` monitoring events in the C API." msgstr "" -#: ../../whatsnew/3.13.rst:159 +#: ../../whatsnew/3.13.rst:160 msgid "New typing features:" msgstr "" -#: ../../whatsnew/3.13.rst:161 +#: ../../whatsnew/3.13.rst:162 msgid "" ":pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing." "ParamSpec`, and :data:`typing.TypeVarTuple`) now support defaults." msgstr "" -#: ../../whatsnew/3.13.rst:163 +#: ../../whatsnew/3.13.rst:164 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator adds support for " "marking deprecations in the type system and at runtime." msgstr "" -#: ../../whatsnew/3.13.rst:165 +#: ../../whatsnew/3.13.rst:166 msgid "" ":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of a :class:" "`typing.TypedDict` as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:167 +#: ../../whatsnew/3.13.rst:168 msgid "" ":pep:`742`: :data:`typing.TypeIs` provides more intuitive type narrowing " "behavior, as an alternative to :data:`typing.TypeGuard`." msgstr "" -#: ../../whatsnew/3.13.rst:170 +#: ../../whatsnew/3.13.rst:171 msgid "Platform support:" msgstr "" -#: ../../whatsnew/3.13.rst:172 +#: ../../whatsnew/3.13.rst:173 msgid "" ":pep:`730`: Apple's iOS is now an :ref:`officially supported platform " "`, at :pep:`tier 3 <11#tier-3>`." msgstr "" -#: ../../whatsnew/3.13.rst:174 +#: ../../whatsnew/3.13.rst:175 msgid "" ":pep:`738`: Android is now an :ref:`officially supported platform " "`, at :pep:`tier 3 <11#tier-3>`." msgstr "" -#: ../../whatsnew/3.13.rst:176 +#: ../../whatsnew/3.13.rst:177 msgid "" "``wasm32-wasi`` is now supported as a :pep:`tier 2 <11#tier-2>` platform." msgstr "" -#: ../../whatsnew/3.13.rst:177 +#: ../../whatsnew/3.13.rst:178 msgid "``wasm32-emscripten`` is no longer an officially supported platform." msgstr "" -#: ../../whatsnew/3.13.rst:179 +#: ../../whatsnew/3.13.rst:180 msgid "Important removals:" msgstr "" -#: ../../whatsnew/3.13.rst:181 +#: ../../whatsnew/3.13.rst:182 msgid "" ":ref:`PEP 594 `: The remaining 19 \"dead " "batteries\" (legacy stdlib modules) have been removed from the standard " @@ -293,117 +294,117 @@ msgid "" "`!xdrlib`." msgstr "" -#: ../../whatsnew/3.13.rst:187 +#: ../../whatsnew/3.13.rst:188 msgid "" "Remove the :program:`2to3` tool and :mod:`!lib2to3` module (deprecated in " "Python 3.11)." msgstr "" -#: ../../whatsnew/3.13.rst:189 +#: ../../whatsnew/3.13.rst:190 msgid "Remove the :mod:`!tkinter.tix` module (deprecated in Python 3.6)." msgstr "" -#: ../../whatsnew/3.13.rst:190 +#: ../../whatsnew/3.13.rst:191 msgid "Remove the :func:`!locale.resetlocale` function." msgstr "" -#: ../../whatsnew/3.13.rst:191 +#: ../../whatsnew/3.13.rst:192 msgid "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces." msgstr "" -#: ../../whatsnew/3.13.rst:192 +#: ../../whatsnew/3.13.rst:193 msgid "Remove chained :class:`classmethod` descriptors." msgstr "" -#: ../../whatsnew/3.13.rst:194 +#: ../../whatsnew/3.13.rst:195 msgid "Release schedule changes:" msgstr "" -#: ../../whatsnew/3.13.rst:196 +#: ../../whatsnew/3.13.rst:197 msgid "" ":pep:`602` (\"Annual Release Cycle for Python\") has been updated to extend " "the full support ('bugfix') period for new releases to two years. This " "updated policy means that:" msgstr "" -#: ../../whatsnew/3.13.rst:200 +#: ../../whatsnew/3.13.rst:201 msgid "" "Python 3.9--3.12 have one and a half years of full support, followed by " "three and a half years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:202 +#: ../../whatsnew/3.13.rst:203 msgid "" "Python 3.13 and later have two years of full support, followed by three " "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:207 ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1964 msgid "New Features" msgstr "" -#: ../../whatsnew/3.13.rst:213 +#: ../../whatsnew/3.13.rst:214 msgid "A better interactive interpreter" msgstr "" -#: ../../whatsnew/3.13.rst:215 +#: ../../whatsnew/3.13.rst:216 msgid "" "Python now uses a new :term:`interactive` shell by default, based on code " "from the `PyPy project`_. When the user starts the :term:`REPL` from an " "interactive terminal, the following new features are now supported:" msgstr "" -#: ../../whatsnew/3.13.rst:220 +#: ../../whatsnew/3.13.rst:221 msgid "Multiline editing with history preservation." msgstr "" -#: ../../whatsnew/3.13.rst:221 +#: ../../whatsnew/3.13.rst:222 msgid "" "Direct support for REPL-specific commands like :kbd:`help`, :kbd:`exit`, " "and :kbd:`quit`, without the need to call them as functions." msgstr "" -#: ../../whatsnew/3.13.rst:223 +#: ../../whatsnew/3.13.rst:224 msgid "" "Prompts and tracebacks with :ref:`color enabled by default `." msgstr "" -#: ../../whatsnew/3.13.rst:225 +#: ../../whatsnew/3.13.rst:226 msgid "" "Interactive help browsing using :kbd:`F1` with a separate command history." msgstr "" -#: ../../whatsnew/3.13.rst:227 +#: ../../whatsnew/3.13.rst:228 msgid "" "History browsing using :kbd:`F2` that skips output as well as the :term:" "`>>>` and :term:`...` prompts." msgstr "" -#: ../../whatsnew/3.13.rst:229 +#: ../../whatsnew/3.13.rst:230 msgid "" "\"Paste mode\" with :kbd:`F3` that makes pasting larger blocks of code " "easier (press :kbd:`F3` again to return to the regular prompt)." msgstr "" -#: ../../whatsnew/3.13.rst:232 +#: ../../whatsnew/3.13.rst:233 msgid "" "To disable the new interactive shell, set the :envvar:`PYTHON_BASIC_REPL` " "environment variable. For more on interactive mode, see :ref:`tut-interac`." msgstr "" -#: ../../whatsnew/3.13.rst:236 +#: ../../whatsnew/3.13.rst:237 msgid "" "(Contributed by Pablo Galindo Salgado, Łukasz Langa, and Lysandros Nikolaou " "in :gh:`111201` based on code from the PyPy project. Windows support " "contributed by Dino Viehland and Anthony Shaw.)" msgstr "" -#: ../../whatsnew/3.13.rst:246 +#: ../../whatsnew/3.13.rst:247 msgid "Improved error messages" msgstr "" -#: ../../whatsnew/3.13.rst:248 +#: ../../whatsnew/3.13.rst:249 msgid "" "The interpreter now uses color by default when displaying tracebacks in the " "terminal. This feature :ref:`can be controlled ` " @@ -412,14 +413,14 @@ msgid "" "by Pablo Galindo Salgado in :gh:`112730`.)" msgstr "" -#: ../../whatsnew/3.13.rst:263 +#: ../../whatsnew/3.13.rst:264 msgid "" "A common mistake is to write a script with the same name as a standard " "library module. When this results in errors, we now display a more helpful " "error message:" msgstr "" -#: ../../whatsnew/3.13.rst:267 +#: ../../whatsnew/3.13.rst:268 msgid "" "$ python random.py\n" "Traceback (most recent call last):\n" @@ -433,14 +434,14 @@ msgid "" "library module named 'random' and the import system gives it precedence)" msgstr "" -#: ../../whatsnew/3.13.rst:278 +#: ../../whatsnew/3.13.rst:279 msgid "" "Similarly, if a script has the same name as a third-party module that it " "attempts to import and this results in errors, we also display a more " "helpful error message:" msgstr "" -#: ../../whatsnew/3.13.rst:282 +#: ../../whatsnew/3.13.rst:283 msgid "" "$ python numpy.py\n" "Traceback (most recent call last):\n" @@ -454,17 +455,17 @@ msgid "" "intended to import)" msgstr "" -#: ../../whatsnew/3.13.rst:293 +#: ../../whatsnew/3.13.rst:294 msgid "(Contributed by Shantanu Jain in :gh:`95754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:295 +#: ../../whatsnew/3.13.rst:296 msgid "" "The error message now tries to suggest the correct keyword argument when an " "incorrect keyword argument is passed to a function." msgstr "" -#: ../../whatsnew/3.13.rst:298 +#: ../../whatsnew/3.13.rst:299 msgid "" ">>> \"Better error messages!\".split(max_split=1)\n" "Traceback (most recent call last):\n" @@ -475,16 +476,16 @@ msgid "" "mean 'maxsplit'?" msgstr "" -#: ../../whatsnew/3.13.rst:307 +#: ../../whatsnew/3.13.rst:308 msgid "" "(Contributed by Pablo Galindo Salgado and Shantanu Jain in :gh:`107944`.)" msgstr "" -#: ../../whatsnew/3.13.rst:313 +#: ../../whatsnew/3.13.rst:314 msgid "Free-threaded CPython" msgstr "" -#: ../../whatsnew/3.13.rst:315 +#: ../../whatsnew/3.13.rst:316 msgid "" "CPython now has experimental support for running in a free-threaded mode, " "with the :term:`global interpreter lock` (GIL) disabled. This is an " @@ -492,12 +493,12 @@ msgid "" "threaded mode requires a different executable, usually called " "``python3.13t`` or ``python3.13t.exe``. Pre-built binaries marked as *free-" "threaded* can be installed as part of the official :ref:`Windows ` and :ref:`macOS ` " +"freethreaded-windows>` and :ref:`macOS ` " "installers, or CPython can be built from source with the :option:`--disable-" "gil` option." msgstr "" -#: ../../whatsnew/3.13.rst:328 +#: ../../whatsnew/3.13.rst:326 msgid "" "Free-threaded execution allows for full utilization of the available " "processing power by running threads in parallel on available CPU cores. " @@ -510,7 +511,7 @@ msgid "" "command-line option :option:`-X gil=1`." msgstr "" -#: ../../whatsnew/3.13.rst:338 +#: ../../whatsnew/3.13.rst:336 msgid "" "To check if the current interpreter supports free-threading, :option:`python " "-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " @@ -518,7 +519,7 @@ msgid "" "whether the GIL is actually disabled in the running process." msgstr "" -#: ../../whatsnew/3.13.rst:343 +#: ../../whatsnew/3.13.rst:341 msgid "" "C-API extension modules need to be built specifically for the free-threaded " "build. Extensions that support running with the :term:`GIL` disabled should " @@ -531,24 +532,35 @@ msgid "" "extensions in the free-threaded build." msgstr "" -#: ../../whatsnew/3.13.rst:356 +#: ../../whatsnew/3.13.rst:352 +msgid "" +"This work was made possible thanks to many individuals and organizations, " +"including the large community of contributors to Python and third-party " +"projects to test and enable free-threading support. Notable contributors " +"include: Sam Gross, Ken Jin, Donghee Na, Itamar Oren, Matt Page, Brett " +"Simmers, Dino Viehland, Carl Meyer, Nathan Goldbaum, Ralf Gommers, Lysandros " +"Nikolaou, and many others. Many of these contributors are employed by Meta, " +"which has provided significant engineering resources to support this project." +msgstr "" + +#: ../../whatsnew/3.13.rst:364 msgid "" ":pep:`703` \"Making the Global Interpreter Lock Optional in CPython\" " "contains rationale and information surrounding this work." msgstr "" -#: ../../whatsnew/3.13.rst:359 +#: ../../whatsnew/3.13.rst:367 msgid "" "`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " "extension authors." msgstr "" -#: ../../whatsnew/3.13.rst:367 +#: ../../whatsnew/3.13.rst:375 msgid "An experimental just-in-time (JIT) compiler" msgstr "" -#: ../../whatsnew/3.13.rst:369 +#: ../../whatsnew/3.13.rst:377 msgid "" "When CPython is configured and built using the :option:`!--enable-" "experimental-jit` option, a just-in-time (JIT) compiler is added which may " @@ -558,100 +570,100 @@ msgid "" "information `are contained at`__ :file:`Tools/jit/README.md`." msgstr "" -#: ../../whatsnew/3.13.rst:379 +#: ../../whatsnew/3.13.rst:387 msgid "" "The :option:`!--enable-experimental-jit` option takes these (optional) " "values, defaulting to ``yes`` if :option:`!--enable-experimental-jit` is " "present without the optional value." msgstr "" -#: ../../whatsnew/3.13.rst:383 +#: ../../whatsnew/3.13.rst:391 msgid "``no``: Disable the entire Tier 2 and JIT pipeline." msgstr "" -#: ../../whatsnew/3.13.rst:384 +#: ../../whatsnew/3.13.rst:392 msgid "" "``yes``: Enable the JIT. To disable the JIT at runtime, pass the environment " "variable ``PYTHON_JIT=0``." msgstr "" -#: ../../whatsnew/3.13.rst:386 +#: ../../whatsnew/3.13.rst:394 msgid "" "``yes-off``: Build the JIT but disable it by default. To enable the JIT at " "runtime, pass the environment variable ``PYTHON_JIT=1``." msgstr "" -#: ../../whatsnew/3.13.rst:388 +#: ../../whatsnew/3.13.rst:396 msgid "" "``interpreter``: Enable the Tier 2 interpreter but disable the JIT. The " "interpreter can be disabled by running with ``PYTHON_JIT=0``." msgstr "" -#: ../../whatsnew/3.13.rst:391 +#: ../../whatsnew/3.13.rst:399 msgid "The internal architecture is roughly as follows:" msgstr "" -#: ../../whatsnew/3.13.rst:393 +#: ../../whatsnew/3.13.rst:401 msgid "" "We start with specialized *Tier 1 bytecode*. See :ref:`What's new in 3.11 " "` for details." msgstr "" -#: ../../whatsnew/3.13.rst:395 +#: ../../whatsnew/3.13.rst:403 msgid "" "When the Tier 1 bytecode gets hot enough, it gets translated to a new purely " "internal intermediate representation (IR), called the *Tier 2 IR*, and " "sometimes referred to as micro-ops (\"uops\")." msgstr "" -#: ../../whatsnew/3.13.rst:398 +#: ../../whatsnew/3.13.rst:406 msgid "" "The Tier 2 IR uses the same stack-based virtual machine as Tier 1, but the " "instruction format is better suited to translation to machine code." msgstr "" -#: ../../whatsnew/3.13.rst:400 +#: ../../whatsnew/3.13.rst:408 msgid "" "We have several optimization passes for Tier 2 IR, which are applied before " "it is interpreted or translated to machine code." msgstr "" -#: ../../whatsnew/3.13.rst:402 +#: ../../whatsnew/3.13.rst:410 msgid "" "There is a Tier 2 interpreter, but it is mostly intended for debugging the " "earlier stages of the optimization pipeline. The Tier 2 interpreter can be " "enabled by configuring Python with ``--enable-experimental-jit=interpreter``." msgstr "" -#: ../../whatsnew/3.13.rst:406 +#: ../../whatsnew/3.13.rst:414 msgid "" "When the JIT is enabled, the optimized Tier 2 IR is translated to machine " "code, which is then executed." msgstr "" -#: ../../whatsnew/3.13.rst:408 +#: ../../whatsnew/3.13.rst:416 msgid "" "The machine code translation process uses a technique called *copy-and-" "patch*. It has no runtime dependencies, but there is a new build-time " "dependency on LLVM." msgstr "" -#: ../../whatsnew/3.13.rst:412 +#: ../../whatsnew/3.13.rst:420 msgid ":pep:`744`" msgstr "" -#: ../../whatsnew/3.13.rst:414 +#: ../../whatsnew/3.13.rst:422 msgid "" "(JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik " "Kjolstad. Tier 2 IR by Mark Shannon and Guido van Rossum. Tier 2 optimizer " "by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.13.rst:422 +#: ../../whatsnew/3.13.rst:430 msgid "Defined mutation semantics for :py:func:`locals`" msgstr "" -#: ../../whatsnew/3.13.rst:424 +#: ../../whatsnew/3.13.rst:432 msgid "" "Historically, the expected result of mutating the return value of :func:" "`locals` has been left to individual Python implementations to define. " @@ -663,7 +675,7 @@ msgid "" "referenced nonlocal variables captured in closures." msgstr "" -#: ../../whatsnew/3.13.rst:433 +#: ../../whatsnew/3.13.rst:441 msgid "" "This change to the semantics of :func:`locals` in optimized scopes also " "affects the default behavior of code execution functions that implicitly " @@ -684,7 +696,7 @@ msgid "" "disk)." msgstr "" -#: ../../whatsnew/3.13.rst:452 +#: ../../whatsnew/3.13.rst:460 msgid "" "To ensure debuggers and similar tools can reliably update local variables in " "scopes affected by this change, :attr:`FrameType.f_locals ` " @@ -694,7 +706,7 @@ msgid "" "semantics." msgstr "" -#: ../../whatsnew/3.13.rst:458 +#: ../../whatsnew/3.13.rst:466 msgid "" "See :pep:`667` for more details, including related C API changes and " "deprecations. Porting notes are also provided below for the affected :ref:" @@ -702,18 +714,18 @@ msgid "" "notes-c>`." msgstr "" -#: ../../whatsnew/3.13.rst:463 +#: ../../whatsnew/3.13.rst:471 msgid "" "(PEP and implementation contributed by Mark Shannon and Tian Gao in :gh:" "`74929`. Documentation updates provided by Guido van Rossum and Alyssa " "Coghlan.)" msgstr "" -#: ../../whatsnew/3.13.rst:471 +#: ../../whatsnew/3.13.rst:479 msgid "Support for mobile platforms" msgstr "" -#: ../../whatsnew/3.13.rst:473 +#: ../../whatsnew/3.13.rst:481 msgid "" ":pep:`730`: iOS is now a :pep:`11` supported platform, with the ``arm64-" "apple-ios`` and ``arm64-apple-ios-simulator`` targets at tier 3 (iPhone and " @@ -724,7 +736,7 @@ msgid "" "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:483 +#: ../../whatsnew/3.13.rst:491 msgid "" ":pep:`738`: Android is now a :pep:`11` supported platform, with the " "``aarch64-linux-android`` and ``x86_64-linux-android`` targets at tier 3. " @@ -733,51 +745,15 @@ msgid "" "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:490 -msgid ":pep:`730`, :pep:`738`" -msgstr "" - -#: ../../whatsnew/3.13.rst:496 -msgid "Incremental garbage collection" -msgstr "" - #: ../../whatsnew/3.13.rst:498 -msgid "" -"The cycle garbage collector is now incremental. This means that maximum " -"pause times are reduced by an order of magnitude or more for larger heaps." +msgid ":pep:`730`, :pep:`738`" msgstr "" #: ../../whatsnew/3.13.rst:502 -msgid "" -"There are now only two generations: young and old. When :func:`gc.collect` " -"is not called directly, the GC is invoked a little less frequently. When " -"invoked, it collects the young generation and an increment of the old " -"generation, instead of collecting one or more generations." -msgstr "" - -#: ../../whatsnew/3.13.rst:508 -msgid "The behavior of :func:`!gc.collect` changes slightly:" -msgstr "" - -#: ../../whatsnew/3.13.rst:510 ../../whatsnew/3.13.rst:2617 -msgid "" -"``gc.collect(1)``: Performs an increment of garbage collection, rather than " -"collecting generation 1." -msgstr "" - -#: ../../whatsnew/3.13.rst:512 ../../whatsnew/3.13.rst:2619 -msgid "Other calls to :func:`!gc.collect` are unchanged." -msgstr "" - -#: ../../whatsnew/3.13.rst:514 -msgid "(Contributed by Mark Shannon in :gh:`108362`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:518 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.13.rst:520 +#: ../../whatsnew/3.13.rst:504 msgid "" "The compiler now strips common leading whitespace from every line in a " "docstring. This reduces the size of the :term:`bytecode cache ` " @@ -786,7 +762,7 @@ msgid "" "affects tools that use docstrings, such as :mod:`doctest`." msgstr "" -#: ../../whatsnew/3.13.rst:527 +#: ../../whatsnew/3.13.rst:511 msgid "" ">>> def spam():\n" "... \"\"\"\n" @@ -801,28 +777,28 @@ msgid "" "multiple paragraphs!\\n'" msgstr "" -#: ../../whatsnew/3.13.rst:540 +#: ../../whatsnew/3.13.rst:524 msgid "(Contributed by Inada Naoki in :gh:`81283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:542 +#: ../../whatsnew/3.13.rst:526 msgid "" ":ref:`Annotation scopes ` within class scopes can now " "contain lambdas and comprehensions. Comprehensions that are located within " "class scopes are not inlined into their parent scope." msgstr "" -#: ../../whatsnew/3.13.rst:547 +#: ../../whatsnew/3.13.rst:531 msgid "" "class C[T]:\n" " type Alias = lambda: T" msgstr "" -#: ../../whatsnew/3.13.rst:552 +#: ../../whatsnew/3.13.rst:536 msgid "(Contributed by Jelle Zijlstra in :gh:`109118` and :gh:`118160`.)" msgstr "" -#: ../../whatsnew/3.13.rst:554 +#: ../../whatsnew/3.13.rst:538 msgid "" ":ref:`Future statements ` are no longer triggered by relative " "imports of the :mod:`__future__` module, meaning that statements of the form " @@ -831,7 +807,7 @@ msgid "" "in :gh:`118216`.)" msgstr "" -#: ../../whatsnew/3.13.rst:560 +#: ../../whatsnew/3.13.rst:544 msgid "" ":keyword:`global` declarations are now permitted in :keyword:`except` blocks " "when that global is used in the :keyword:`else` block. Previously this " @@ -839,7 +815,7 @@ msgid "" "`111123`.)" msgstr "" -#: ../../whatsnew/3.13.rst:565 +#: ../../whatsnew/3.13.rst:549 msgid "" "Add :envvar:`PYTHON_FROZEN_MODULES`, a new environment variable that " "determines whether frozen modules are ignored by the import machinery, " @@ -847,7 +823,7 @@ msgid "" "(Contributed by Yilei Yang in :gh:`111374`.)" msgstr "" -#: ../../whatsnew/3.13.rst:570 +#: ../../whatsnew/3.13.rst:554 msgid "" "Add :ref:`support for the perf profiler ` working without " "`frame pointers `_ through the new " @@ -856,36 +832,36 @@ msgid "" "`118518`.)" msgstr "" -#: ../../whatsnew/3.13.rst:576 +#: ../../whatsnew/3.13.rst:560 msgid "" "The location of a :file:`.python_history` file can be changed via the new :" "envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi Sabah, " "Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" msgstr "" -#: ../../whatsnew/3.13.rst:581 +#: ../../whatsnew/3.13.rst:565 msgid "" -"Classes have a new :attr:`~class.__static_attributes__` attribute. This is " +"Classes have a new :attr:`~type.__static_attributes__` attribute. This is " "populated by the compiler with a tuple of the class's attribute names which " "are assigned through ``self.`` from any function in its body. " "(Contributed by Irit Katriel in :gh:`115775`.)" msgstr "" -#: ../../whatsnew/3.13.rst:586 +#: ../../whatsnew/3.13.rst:570 msgid "" "The compiler now creates a :attr:`!__firstlineno__` attribute on classes " "with the line number of the first line of the class definition. (Contributed " "by Serhiy Storchaka in :gh:`118465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:590 +#: ../../whatsnew/3.13.rst:574 msgid "" "The :func:`exec` and :func:`eval` builtins now accept the *globals* and " "*locals* arguments as keywords. (Contributed by Raphael Gaschignard in :gh:" "`105879`)" msgstr "" -#: ../../whatsnew/3.13.rst:594 +#: ../../whatsnew/3.13.rst:578 msgid "" "The :func:`compile` builtin now accepts a new flag, ``ast." "PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except that " @@ -893,13 +869,13 @@ msgid "" "argument. (Contributed by Irit Katriel in :gh:`108113`)." msgstr "" -#: ../../whatsnew/3.13.rst:600 +#: ../../whatsnew/3.13.rst:584 msgid "" "Add a :attr:`~property.__name__` attribute on :class:`property` objects. " "(Contributed by Eugene Toder in :gh:`101860`.)" msgstr "" -#: ../../whatsnew/3.13.rst:603 +#: ../../whatsnew/3.13.rst:587 msgid "" "Add :exc:`PythonFinalizationError`, a new exception derived from :exc:" "`RuntimeError` and used to signal when operations are blocked during :term:" @@ -907,65 +883,65 @@ msgid "" "exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" msgstr "" -#: ../../whatsnew/3.13.rst:609 +#: ../../whatsnew/3.13.rst:593 msgid ":func:`_thread.start_new_thread`" msgstr "" -#: ../../whatsnew/3.13.rst:610 +#: ../../whatsnew/3.13.rst:594 msgid ":func:`os.fork`" msgstr "" -#: ../../whatsnew/3.13.rst:611 +#: ../../whatsnew/3.13.rst:595 msgid ":func:`os.forkpty`" msgstr "" -#: ../../whatsnew/3.13.rst:612 +#: ../../whatsnew/3.13.rst:596 msgid ":class:`subprocess.Popen`" msgstr "" -#: ../../whatsnew/3.13.rst:614 +#: ../../whatsnew/3.13.rst:598 msgid "(Contributed by Victor Stinner in :gh:`114570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:616 +#: ../../whatsnew/3.13.rst:600 msgid "" "Allow the *count* argument of :meth:`str.replace` to be a keyword. " "(Contributed by Hugo van Kemenade in :gh:`106487`.)" msgstr "" -#: ../../whatsnew/3.13.rst:619 +#: ../../whatsnew/3.13.rst:603 msgid "" "Many functions now emit a warning if a boolean value is passed as a file " "descriptor argument. This can help catch some errors earlier. (Contributed " "by Serhiy Storchaka in :gh:`82626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:624 +#: ../../whatsnew/3.13.rst:608 msgid "" "Added :attr:`!name` and :attr:`!mode` attributes for compressed and archived " "file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, and :mod:" "`zipfile` modules. (Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:631 +#: ../../whatsnew/3.13.rst:615 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.13.rst:633 +#: ../../whatsnew/3.13.rst:617 msgid "" ":mod:`dbm.sqlite3`: An SQLite backend for :mod:`dbm`. (Contributed by " "Raymond Hettinger and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:638 +#: ../../whatsnew/3.13.rst:622 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.13.rst:642 +#: ../../whatsnew/3.13.rst:626 msgid "argparse" msgstr "" -#: ../../whatsnew/3.13.rst:644 +#: ../../whatsnew/3.13.rst:628 msgid "" "Add the *deprecated* parameter to the :meth:`~argparse.ArgumentParser." "add_argument` and :meth:`!add_parser` methods, to enable deprecating command-" @@ -973,36 +949,36 @@ msgid "" "Storchaka in :gh:`83648`.)" msgstr "" -#: ../../whatsnew/3.13.rst:652 +#: ../../whatsnew/3.13.rst:636 msgid "array" msgstr "" -#: ../../whatsnew/3.13.rst:654 +#: ../../whatsnew/3.13.rst:638 msgid "" "Add the ``'w'`` type code (``Py_UCS4``) for Unicode characters. It should be " "used instead of the deprecated ``'u'`` type code. (Contributed by Inada " "Naoki in :gh:`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:658 +#: ../../whatsnew/3.13.rst:642 msgid "" "Register :class:`array.array` as a :class:`~collections.abc.MutableSequence` " "by implementing the :meth:`~array.array.clear` method. (Contributed by Mike " "Zimin in :gh:`114894`.)" msgstr "" -#: ../../whatsnew/3.13.rst:664 +#: ../../whatsnew/3.13.rst:648 msgid "ast" msgstr "" -#: ../../whatsnew/3.13.rst:666 +#: ../../whatsnew/3.13.rst:650 msgid "" "The constructors of node types in the :mod:`ast` module are now stricter in " "the arguments they accept, with more intuitive behavior when arguments are " "omitted." msgstr "" -#: ../../whatsnew/3.13.rst:670 +#: ../../whatsnew/3.13.rst:654 msgid "" "If an optional field on an AST node is not included as an argument when " "constructing an instance, the field will now be set to ``None``. Similarly, " @@ -1012,7 +988,7 @@ msgid "" "the newly constructed AST node instance.)" msgstr "" -#: ../../whatsnew/3.13.rst:678 +#: ../../whatsnew/3.13.rst:662 msgid "" "In all other cases, where a required argument is omitted, the node " "constructor will emit a :exc:`DeprecationWarning`. This will raise an " @@ -1021,31 +997,31 @@ msgid "" "and will raise an exception in Python 3.15." msgstr "" -#: ../../whatsnew/3.13.rst:685 +#: ../../whatsnew/3.13.rst:669 msgid "" "These changes do not apply to user-defined subclasses of :class:`ast.AST` " "unless the class opts in to the new behavior by defining the :attr:`.AST." "_field_types` mapping." msgstr "" -#: ../../whatsnew/3.13.rst:689 +#: ../../whatsnew/3.13.rst:673 msgid "" "(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, and :gh:" "`118851`.)" msgstr "" -#: ../../whatsnew/3.13.rst:691 +#: ../../whatsnew/3.13.rst:675 msgid "" ":func:`ast.parse` now accepts an optional argument *optimize* which is " "passed on to :func:`compile`. This makes it possible to obtain an optimized " "AST. (Contributed by Irit Katriel in :gh:`108113`.)" msgstr "" -#: ../../whatsnew/3.13.rst:698 +#: ../../whatsnew/3.13.rst:682 msgid "asyncio" msgstr "" -#: ../../whatsnew/3.13.rst:700 +#: ../../whatsnew/3.13.rst:684 msgid "" ":func:`asyncio.as_completed` now returns an object that is both an :term:" "`asynchronous iterator` and a plain :term:`iterator` of :term:`awaitables " @@ -1055,14 +1031,14 @@ msgid "" "Arthur in :gh:`77714`.)" msgstr "" -#: ../../whatsnew/3.13.rst:708 +#: ../../whatsnew/3.13.rst:692 msgid "" ":meth:`asyncio.loop.create_unix_server` will now automatically remove the " "Unix socket when the server is closed. (Contributed by Pierre Ossman in :gh:" "`111246`.)" msgstr "" -#: ../../whatsnew/3.13.rst:712 +#: ../../whatsnew/3.13.rst:696 msgid "" ":meth:`.DatagramTransport.sendto` will now send zero-length datagrams if " "called with an empty bytes object. The transport flow control also now " @@ -1070,28 +1046,28 @@ msgid "" "(Contributed by Jamie Phan in :gh:`115199`.)" msgstr "" -#: ../../whatsnew/3.13.rst:718 +#: ../../whatsnew/3.13.rst:702 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~asyncio." "QueueShutDown` to manage queue termination. (Contributed by Laurie Opperman " "and Yves Duprat in :gh:`104228`.)" msgstr "" -#: ../../whatsnew/3.13.rst:722 +#: ../../whatsnew/3.13.rst:706 msgid "" "Add the :meth:`.Server.close_clients` and :meth:`.Server.abort_clients` " "methods, which more forcefully close an asyncio server. (Contributed by " "Pierre Ossman in :gh:`113538`.)" msgstr "" -#: ../../whatsnew/3.13.rst:726 +#: ../../whatsnew/3.13.rst:710 msgid "" "Accept a tuple of separators in :meth:`.StreamReader.readuntil`, stopping " "when any one of them is encountered. (Contributed by Bruce Merry in :gh:" "`81322`.)" msgstr "" -#: ../../whatsnew/3.13.rst:730 +#: ../../whatsnew/3.13.rst:714 msgid "" "Improve the behavior of :class:`~asyncio.TaskGroup` when an external " "cancellation collides with an internal cancellation. For example, when two " @@ -1100,7 +1076,7 @@ msgid "" "because its internal cancellation was swallowed by the inner task group." msgstr "" -#: ../../whatsnew/3.13.rst:737 +#: ../../whatsnew/3.13.rst:721 msgid "" "In the case where a task group is cancelled externally and also must raise " "an :exc:`ExceptionGroup`, it will now call the parent task's :meth:`~asyncio." @@ -1108,24 +1084,24 @@ msgid "" "be raised at the next :keyword:`await`, so the cancellation is not lost." msgstr "" -#: ../../whatsnew/3.13.rst:743 +#: ../../whatsnew/3.13.rst:727 msgid "" "An added benefit of these changes is that task groups now preserve the " "cancellation count (:meth:`~asyncio.Task.cancelling`)." msgstr "" -#: ../../whatsnew/3.13.rst:746 +#: ../../whatsnew/3.13.rst:730 msgid "" "In order to handle some corner cases, :meth:`~asyncio.Task.uncancel` may now " "reset the undocumented ``_must_cancel`` flag when the cancellation count " "reaches zero." msgstr "" -#: ../../whatsnew/3.13.rst:750 +#: ../../whatsnew/3.13.rst:734 msgid "(Inspired by an issue reported by Arthur Tacca in :gh:`116720`.)" msgstr "" -#: ../../whatsnew/3.13.rst:752 +#: ../../whatsnew/3.13.rst:736 msgid "" "When :meth:`.TaskGroup.create_task` is called on an inactive :class:" "`~asyncio.TaskGroup`, the given coroutine will be closed (which prevents a :" @@ -1133,46 +1109,38 @@ msgid "" "(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)" msgstr "" -#: ../../whatsnew/3.13.rst:760 +#: ../../whatsnew/3.13.rst:744 msgid "base64" msgstr "" -#: ../../whatsnew/3.13.rst:762 +#: ../../whatsnew/3.13.rst:746 msgid "" "Add :func:`~base64.z85encode` and :func:`~base64.z85decode` functions for " "encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data to :" "class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" msgstr "" -#: ../../whatsnew/3.13.rst:771 +#: ../../whatsnew/3.13.rst:755 msgid "compileall" msgstr "" -#: ../../whatsnew/3.13.rst:773 ../../whatsnew/3.13.rst:789 -#: ../../whatsnew/3.13.rst:1049 +#: ../../whatsnew/3.13.rst:757 ../../whatsnew/3.13.rst:765 +#: ../../whatsnew/3.13.rst:1013 msgid "" "The default number of worker threads and processes is now selected using :" "func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:779 ../../whatsnew/3.13.rst:795 -#: ../../whatsnew/3.13.rst:1649 -msgid "configparser" -msgstr "" - -#: ../../whatsnew/3.13.rst:781 -msgid "" -"The :class:`configparser.ConfigParser` now accepts unnamed sections before " -"named ones if configured to do so. (Contributed by Pedro Sousa Lacerda in :" -"gh:`66449`.)" +#: ../../whatsnew/3.13.rst:763 +msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:787 -msgid "concurrent.futures" +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1608 +msgid "configparser" msgstr "" -#: ../../whatsnew/3.13.rst:797 +#: ../../whatsnew/3.13.rst:773 msgid "" ":class:`~configparser.ConfigParser` now has support for unnamed sections, " "which allows for top-level key-value pairs. This can be enabled with the new " @@ -1180,11 +1148,11 @@ msgid "" "gh:`66449`.)" msgstr "" -#: ../../whatsnew/3.13.rst:804 +#: ../../whatsnew/3.13.rst:780 msgid "copy" msgstr "" -#: ../../whatsnew/3.13.rst:806 +#: ../../whatsnew/3.13.rst:782 msgid "" "The new :func:`~copy.replace` function and the :meth:`replace protocol " "` make creating modified copies of objects much simpler. " @@ -1193,61 +1161,91 @@ msgid "" "protocol:" msgstr "" -#: ../../whatsnew/3.13.rst:812 +#: ../../whatsnew/3.13.rst:788 msgid ":func:`collections.namedtuple`" msgstr "" -#: ../../whatsnew/3.13.rst:813 +#: ../../whatsnew/3.13.rst:789 msgid ":class:`dataclasses.dataclass`" msgstr "" -#: ../../whatsnew/3.13.rst:814 +#: ../../whatsnew/3.13.rst:790 msgid "" ":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" msgstr "" -#: ../../whatsnew/3.13.rst:815 +#: ../../whatsnew/3.13.rst:791 msgid ":class:`inspect.Signature`, :class:`inspect.Parameter`" msgstr "" -#: ../../whatsnew/3.13.rst:816 +#: ../../whatsnew/3.13.rst:792 msgid ":class:`types.SimpleNamespace`" msgstr "" -#: ../../whatsnew/3.13.rst:817 +#: ../../whatsnew/3.13.rst:793 msgid ":ref:`code objects `" msgstr "" -#: ../../whatsnew/3.13.rst:819 +#: ../../whatsnew/3.13.rst:795 msgid "" "Any user-defined class can also support :func:`copy.replace` by defining " "the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka in :" "gh:`108751`.)" msgstr "" -#: ../../whatsnew/3.13.rst:825 +#: ../../whatsnew/3.13.rst:801 +msgid "ctypes" +msgstr "" + +#: ../../whatsnew/3.13.rst:803 +msgid "" +"As a consequence of necessary internal refactoring, initialization of " +"internal metaclasses now happens in ``__init__`` rather than in ``__new__``. " +"This affects projects that subclass these internal metaclasses to provide " +"custom initialization. Generally:" +msgstr "" + +#: ../../whatsnew/3.13.rst:809 +msgid "" +"Custom logic that was done in ``__new__`` after calling ``super().__new__`` " +"should be moved to ``__init__``." +msgstr "" + +#: ../../whatsnew/3.13.rst:811 +msgid "" +"To create a class, call the metaclass, not only the metaclass's ``__new__`` " +"method." +msgstr "" + +#: ../../whatsnew/3.13.rst:814 +msgid "" +"See :gh:`124520` for discussion and links to changes in some affected " +"projects." +msgstr "" + +#: ../../whatsnew/3.13.rst:819 msgid "dbm" msgstr "" -#: ../../whatsnew/3.13.rst:827 +#: ../../whatsnew/3.13.rst:821 msgid "" "Add :mod:`dbm.sqlite3`, a new module which implements an SQLite backend, and " "make it the default :mod:`!dbm` backend. (Contributed by Raymond Hettinger " "and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:831 +#: ../../whatsnew/3.13.rst:825 msgid "" "Allow removing all items from the database through the new :meth:`.gdbm." "clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" "`107122`.)" msgstr "" -#: ../../whatsnew/3.13.rst:837 +#: ../../whatsnew/3.13.rst:831 msgid "dis" msgstr "" -#: ../../whatsnew/3.13.rst:839 +#: ../../whatsnew/3.13.rst:833 msgid "" "Change the output of :mod:`dis` module functions to show logical labels for " "jump targets and exception handlers, rather than offsets. The offsets can be " @@ -1255,7 +1253,7 @@ msgid "" "the *show_offsets* argument. (Contributed by Irit Katriel in :gh:`112137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:846 +#: ../../whatsnew/3.13.rst:840 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " "instructions. Instead, it returns them as part of the :class:`~dis." @@ -1264,11 +1262,11 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:858 +#: ../../whatsnew/3.13.rst:852 msgid "doctest" msgstr "" -#: ../../whatsnew/3.13.rst:860 +#: ../../whatsnew/3.13.rst:854 msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " @@ -1277,18 +1275,18 @@ msgid "" "`117225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:867 +#: ../../whatsnew/3.13.rst:861 msgid "" "The :meth:`.DocTestRunner.run` method now counts the number of skipped " "tests. Add the :attr:`.DocTestRunner.skips` and :attr:`.TestResults.skipped` " "attributes. (Contributed by Victor Stinner in :gh:`108794`.)" msgstr "" -#: ../../whatsnew/3.13.rst:873 +#: ../../whatsnew/3.13.rst:867 msgid "email" msgstr "" -#: ../../whatsnew/3.13.rst:875 +#: ../../whatsnew/3.13.rst:869 msgid "" "Headers with embedded newlines are now quoted on output. The :mod:`~email." "generator` will now refuse to serialize (write) headers that are improperly " @@ -1298,7 +1296,7 @@ msgid "" "Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" -#: ../../whatsnew/3.13.rst:883 +#: ../../whatsnew/3.13.rst:877 msgid "" ":func:`~email.utils.getaddresses` and :func:`~email.utils.parseaddr` now " "return ``('', '')`` pairs in more situations where invalid email addresses " @@ -1310,11 +1308,11 @@ msgid "" "Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" -#: ../../whatsnew/3.13.rst:895 +#: ../../whatsnew/3.13.rst:889 msgid "fractions" msgstr "" -#: ../../whatsnew/3.13.rst:897 +#: ../../whatsnew/3.13.rst:891 msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " @@ -1322,61 +1320,22 @@ msgid "" "`111320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:904 -msgid "gc" -msgstr "" - -#: ../../whatsnew/3.13.rst:906 -msgid "" -"The cyclic garbage collector is now incremental, which changes the meaning " -"of the results of :meth:`~gc.get_threshold` and :meth:`~gc.set_threshold` as " -"well as :meth:`~gc.get_count` and :meth:`~gc.get_stats`." -msgstr "" - -#: ../../whatsnew/3.13.rst:911 -msgid "" -"For backwards compatibility, :meth:`~gc.get_threshold` continues to return a " -"three-item tuple. The first value is the threshold for young collections, as " -"before; the second value determines the rate at which the old collection is " -"scanned (the default is 10, and higher values mean that the old collection " -"is scanned more slowly). The third value is meaningless and is always zero." -msgstr "" - -#: ../../whatsnew/3.13.rst:919 -msgid ":meth:`~gc.set_threshold` ignores any items after the second." -msgstr "" - -#: ../../whatsnew/3.13.rst:921 -msgid "" -":meth:`~gc.get_count` and :meth:`~gc.get_stats` continue to return the same " -"format of results. The only difference is that instead of the results " -"referring to the young, aging and old generations, the results refer to the " -"young generation and the aging and collecting spaces of the old generation." -msgstr "" - -#: ../../whatsnew/3.13.rst:928 -msgid "" -"In summary, code that attempted to manipulate the behavior of the cycle GC " -"may not work exactly as intended, but it is very unlikely to be harmful. All " -"other code will work just fine." -msgstr "" - -#: ../../whatsnew/3.13.rst:934 +#: ../../whatsnew/3.13.rst:898 msgid "glob" msgstr "" -#: ../../whatsnew/3.13.rst:936 +#: ../../whatsnew/3.13.rst:900 msgid "" "Add :func:`~glob.translate`, a function to convert a path specification with " "shell-style wildcards to a regular expression. (Contributed by Barney Gale " "in :gh:`72904`.)" msgstr "" -#: ../../whatsnew/3.13.rst:942 +#: ../../whatsnew/3.13.rst:906 msgid "importlib" msgstr "" -#: ../../whatsnew/3.13.rst:944 +#: ../../whatsnew/3.13.rst:908 msgid "" "The following functions in :mod:`importlib.resources` now allow accessing a " "directory (or tree) of resources, using multiple positional arguments (the " @@ -1384,37 +1343,37 @@ msgid "" "keyword-only):" msgstr "" -#: ../../whatsnew/3.13.rst:949 +#: ../../whatsnew/3.13.rst:913 msgid ":func:`~importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.13.rst:950 +#: ../../whatsnew/3.13.rst:914 msgid ":func:`~importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:951 +#: ../../whatsnew/3.13.rst:915 msgid ":func:`~importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.13.rst:952 +#: ../../whatsnew/3.13.rst:916 msgid ":func:`~importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.13.rst:953 +#: ../../whatsnew/3.13.rst:917 msgid ":func:`~importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:954 +#: ../../whatsnew/3.13.rst:918 msgid ":func:`~importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.13.rst:956 +#: ../../whatsnew/3.13.rst:920 msgid "" "These functions are no longer deprecated and are not scheduled for removal. " "(Contributed by Petr Viktorin in :gh:`106532`.)" msgstr "" -#: ../../whatsnew/3.13.rst:959 +#: ../../whatsnew/3.13.rst:923 msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " @@ -1422,11 +1381,11 @@ msgid "" "`106532`.)" msgstr "" -#: ../../whatsnew/3.13.rst:966 +#: ../../whatsnew/3.13.rst:930 msgid "io" msgstr "" -#: ../../whatsnew/3.13.rst:968 +#: ../../whatsnew/3.13.rst:932 msgid "" "The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" "`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " @@ -1435,17 +1394,17 @@ msgid "" "build>`. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:977 +#: ../../whatsnew/3.13.rst:941 msgid "ipaddress" msgstr "" -#: ../../whatsnew/3.13.rst:979 +#: ../../whatsnew/3.13.rst:943 msgid "" "Add the :attr:`.IPv4Address.ipv6_mapped` property, which returns the IPv4-" "mapped IPv6 address. (Contributed by Charles Machalow in :gh:`109466`.)" msgstr "" -#: ../../whatsnew/3.13.rst:983 +#: ../../whatsnew/3.13.rst:947 msgid "" "Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." "IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." @@ -1453,22 +1412,22 @@ msgid "" "Stasiak in :gh:`113171`.)" msgstr "" -#: ../../whatsnew/3.13.rst:990 +#: ../../whatsnew/3.13.rst:954 msgid "itertools" msgstr "" -#: ../../whatsnew/3.13.rst:992 +#: ../../whatsnew/3.13.rst:956 msgid "" ":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" "`ValueError` if the final batch is shorter than the specified batch size. " "(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" -#: ../../whatsnew/3.13.rst:999 +#: ../../whatsnew/3.13.rst:963 msgid "marshal" msgstr "" -#: ../../whatsnew/3.13.rst:1001 +#: ../../whatsnew/3.13.rst:965 msgid "" "Add the *allow_code* parameter in module functions. Passing " "``allow_code=False`` prevents serialization and de-serialization of code " @@ -1476,11 +1435,11 @@ msgid "" "Serhiy Storchaka in :gh:`113626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1008 +#: ../../whatsnew/3.13.rst:972 msgid "math" msgstr "" -#: ../../whatsnew/3.13.rst:1010 +#: ../../whatsnew/3.13.rst:974 msgid "" "The new function :func:`~math.fma` performs fused multiply-add operations. " "This computes ``x * y + z`` with only a single round, and so avoids any " @@ -1490,11 +1449,11 @@ msgid "" "Stinner in :gh:`73468`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1020 +#: ../../whatsnew/3.13.rst:984 msgid "mimetypes" msgstr "" -#: ../../whatsnew/3.13.rst:1022 +#: ../../whatsnew/3.13.rst:986 msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " @@ -1502,18 +1461,18 @@ msgid "" "`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1029 +#: ../../whatsnew/3.13.rst:993 msgid "mmap" msgstr "" -#: ../../whatsnew/3.13.rst:1031 +#: ../../whatsnew/3.13.rst:995 msgid "" ":class:`~mmap.mmap` is now protected from crashing on Windows when the " "mapped memory is inaccessible due to file system errors or access " "violations. (Contributed by Jannis Weigend in :gh:`118209`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1035 +#: ../../whatsnew/3.13.rst:999 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " "used when a seekable file-like object is required. The :meth:`~mmap.mmap." @@ -1521,7 +1480,7 @@ msgid "" "Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1040 +#: ../../whatsnew/3.13.rst:1004 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " @@ -1529,22 +1488,22 @@ msgid "" "gh:`78502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1047 +#: ../../whatsnew/3.13.rst:1011 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.13.rst:1055 +#: ../../whatsnew/3.13.rst:1019 msgid "os" msgstr "" -#: ../../whatsnew/3.13.rst:1057 +#: ../../whatsnew/3.13.rst:1021 msgid "" "Add :func:`~os.process_cpu_count` function to get the number of logical CPU " "cores usable by the calling thread of the current process. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1061 +#: ../../whatsnew/3.13.rst:1025 msgid "" ":func:`~os.cpu_count` and :func:`~os.process_cpu_count` can be overridden " "through the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new " @@ -1554,7 +1513,7 @@ msgid "" "Na in :gh:`109595`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1069 +#: ../../whatsnew/3.13.rst:1033 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " "file descriptors ` via :func:`~os.timerfd_create`, :func:" @@ -1565,7 +1524,7 @@ msgid "" "in :gh:`108277`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1078 +#: ../../whatsnew/3.13.rst:1042 msgid "" ":func:`~os.lchmod` and the *follow_symlinks* argument of :func:`~os.chmod` " "are both now available on Windows. Note that the default value of " @@ -1573,14 +1532,14 @@ msgid "" "by Serhiy Storchaka in :gh:`59616`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1084 +#: ../../whatsnew/3.13.rst:1048 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " "both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" "`113191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1088 +#: ../../whatsnew/3.13.rst:1052 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " @@ -1589,14 +1548,14 @@ msgid "" "Steve Dower in :gh:`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1095 +#: ../../whatsnew/3.13.rst:1059 msgid "" ":func:`~os.posix_spawn` now accepts ``None`` for the *env* argument, which " "makes the newly spawned process use the current process environment. " "(Contributed by Jakub Kulik in :gh:`113119`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1099 +#: ../../whatsnew/3.13.rst:1063 msgid "" ":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" @@ -1604,76 +1563,76 @@ msgid "" "gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1106 +#: ../../whatsnew/3.13.rst:1070 msgid "os.path" msgstr "" -#: ../../whatsnew/3.13.rst:1108 +#: ../../whatsnew/3.13.rst:1072 msgid "" "Add :func:`~os.path.isreserved` to check if a path is reserved on the " "current system. This function is only available on Windows. (Contributed by " "Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1113 +#: ../../whatsnew/3.13.rst:1077 msgid "" "On Windows, :func:`~os.path.isabs` no longer considers paths starting with " "exactly one slash (``\\`` or ``/``) to be absolute. (Contributed by Barney " "Gale and Jon Foster in :gh:`44626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1117 +#: ../../whatsnew/3.13.rst:1081 msgid "" ":func:`~os.path.realpath` now resolves MS-DOS style file names even if the " "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1123 ../../whatsnew/3.13.rst:1689 +#: ../../whatsnew/3.13.rst:1087 ../../whatsnew/3.13.rst:1648 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.13.rst:1125 +#: ../../whatsnew/3.13.rst:1089 msgid "" "Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" "`NotImplementedError` when a path operation isn't supported. (Contributed by " "Barney Gale in :gh:`89812`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1129 +#: ../../whatsnew/3.13.rst:1093 msgid "" "Add a new constructor for creating :class:`~pathlib.Path` objects from " "'file' URIs (``file:///``), :meth:`.Path.from_uri`. (Contributed by Barney " "Gale in :gh:`107465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1133 +#: ../../whatsnew/3.13.rst:1097 msgid "" "Add :meth:`.PurePath.full_match` for matching paths with shell-style " "wildcards, including the recursive wildcard \"``**``\". (Contributed by " "Barney Gale in :gh:`73435`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1137 +#: ../../whatsnew/3.13.rst:1101 msgid "" "Add the :attr:`.PurePath.parser` class attribute to store the implementation " "of :mod:`os.path` used for low-level path parsing and joining. This will be " "either :mod:`!posixpath` or :mod:`!ntpath`." msgstr "" -#: ../../whatsnew/3.13.rst:1142 +#: ../../whatsnew/3.13.rst:1106 msgid "" "Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" "`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1146 +#: ../../whatsnew/3.13.rst:1110 msgid "" ":meth:`.Path.glob` and :meth:`~pathlib.Path.rglob` now return files and " "directories when given a pattern that ends with \"``**``\". Previously, only " "directories were returned. (Contributed by Barney Gale in :gh:`70303`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1151 +#: ../../whatsnew/3.13.rst:1115 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " "`, :meth:`Path.is_dir `, :meth:`." @@ -1681,11 +1640,11 @@ msgid "" "`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1159 +#: ../../whatsnew/3.13.rst:1123 msgid "pdb" msgstr "" -#: ../../whatsnew/3.13.rst:1161 +#: ../../whatsnew/3.13.rst:1125 msgid "" ":func:`breakpoint` and :func:`~pdb.set_trace` now enter the debugger " "immediately rather than on the next line of code to be executed. This change " @@ -1694,20 +1653,20 @@ msgid "" "Gao in :gh:`118579`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1167 +#: ../../whatsnew/3.13.rst:1131 msgid "" "``sys.path[0]`` is no longer replaced by the directory of the script being " "debugged when :attr:`sys.flags.safe_path` is set. (Contributed by Tian Gao " "and Christian Walther in :gh:`111762`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1171 +#: ../../whatsnew/3.13.rst:1135 msgid "" ":mod:`zipapp` is now supported as a debugging target. (Contributed by Tian " "Gao in :gh:`118501`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1174 +#: ../../whatsnew/3.13.rst:1138 msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " @@ -1715,101 +1674,101 @@ msgid "" "`106676`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1179 +#: ../../whatsnew/3.13.rst:1143 msgid "" "Expressions and statements whose prefix is a pdb command are now correctly " "identified and executed. (Contributed by Tian Gao in :gh:`108464`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1185 +#: ../../whatsnew/3.13.rst:1149 msgid "queue" msgstr "" -#: ../../whatsnew/3.13.rst:1187 +#: ../../whatsnew/3.13.rst:1151 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~queue.ShutDown` " "to manage queue termination. (Contributed by Laurie Opperman and Yves Duprat " "in :gh:`104750`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1193 +#: ../../whatsnew/3.13.rst:1157 msgid "random" msgstr "" -#: ../../whatsnew/3.13.rst:1195 +#: ../../whatsnew/3.13.rst:1159 msgid "" "Add a :ref:`command-line interface `. (Contributed by Hugo van " "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1200 ../../whatsnew/3.13.rst:1697 +#: ../../whatsnew/3.13.rst:1164 ../../whatsnew/3.13.rst:1656 msgid "re" msgstr "" -#: ../../whatsnew/3.13.rst:1202 +#: ../../whatsnew/3.13.rst:1166 msgid "" "Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" "exc:`!re.error` is kept for backward compatibility." msgstr "" -#: ../../whatsnew/3.13.rst:1207 +#: ../../whatsnew/3.13.rst:1171 msgid "shutil" msgstr "" -#: ../../whatsnew/3.13.rst:1209 +#: ../../whatsnew/3.13.rst:1173 msgid "" "Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" "`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" -#: ../../whatsnew/3.13.rst:1215 +#: ../../whatsnew/3.13.rst:1179 msgid "site" msgstr "" -#: ../../whatsnew/3.13.rst:1217 +#: ../../whatsnew/3.13.rst:1181 msgid "" ":file:`.pth` files are now decoded using UTF-8 first, and then with the :" "term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " "in :gh:`117802`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1223 +#: ../../whatsnew/3.13.rst:1187 msgid "sqlite3" msgstr "" -#: ../../whatsnew/3.13.rst:1225 +#: ../../whatsnew/3.13.rst:1189 msgid "" "A :exc:`ResourceWarning` is now emitted if a :class:`~sqlite3.Connection` " "object is not :meth:`closed ` explicitly. " "(Contributed by Erlend E. Aasland in :gh:`105539`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1229 +#: ../../whatsnew/3.13.rst:1193 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " "filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" "`91602`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1235 +#: ../../whatsnew/3.13.rst:1199 msgid "ssl" msgstr "" -#: ../../whatsnew/3.13.rst:1237 +#: ../../whatsnew/3.13.rst:1201 msgid "" "The :func:`~ssl.create_default_context` API now includes :data:`~ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " "default flags." msgstr "" -#: ../../whatsnew/3.13.rst:1243 +#: ../../whatsnew/3.13.rst:1207 msgid "" ":data:`~ssl.VERIFY_X509_STRICT` may reject pre-:rfc:`5280` or malformed " "certificates that the underlying OpenSSL implementation might otherwise " "accept. Whilst disabling this is not recommended, you can do so using:" msgstr "" -#: ../../whatsnew/3.13.rst:1248 +#: ../../whatsnew/3.13.rst:1212 msgid "" "import ssl\n" "\n" @@ -1817,15 +1776,15 @@ msgid "" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgstr "" -#: ../../whatsnew/3.13.rst:1255 +#: ../../whatsnew/3.13.rst:1219 msgid "(Contributed by William Woodruff in :gh:`112389`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1259 +#: ../../whatsnew/3.13.rst:1223 msgid "statistics" msgstr "" -#: ../../whatsnew/3.13.rst:1261 +#: ../../whatsnew/3.13.rst:1225 msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " @@ -1833,24 +1792,24 @@ msgid "" "`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1266 +#: ../../whatsnew/3.13.rst:1230 msgid "" "Add :func:`~statistics.kde_random` for sampling from an estimated " "probability density function created by :func:`~statistics.kde`. " "(Contributed by Raymond Hettinger in :gh:`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1274 +#: ../../whatsnew/3.13.rst:1238 msgid "subprocess" msgstr "" -#: ../../whatsnew/3.13.rst:1276 +#: ../../whatsnew/3.13.rst:1240 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations." msgstr "" -#: ../../whatsnew/3.13.rst:1279 +#: ../../whatsnew/3.13.rst:1243 msgid "" "Notably, when *close_fds* is ``True`` (the default), :func:`~os.posix_spawn` " "will be used when the C library provides :c:func:`!" @@ -1859,7 +1818,7 @@ msgid "" "existing Linux :c:func:`!vfork` based code." msgstr "" -#: ../../whatsnew/3.13.rst:1286 +#: ../../whatsnew/3.13.rst:1250 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " "``False`` if you need to force :mod:`subprocess` to never use :func:`~os." @@ -1869,22 +1828,22 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1296 +#: ../../whatsnew/3.13.rst:1260 msgid "sys" msgstr "" -#: ../../whatsnew/3.13.rst:1298 +#: ../../whatsnew/3.13.rst:1262 msgid "" "Add the :func:`~sys._is_interned` function to test if a string was interned. " "This function is not guaranteed to exist in all implementations of Python. " "(Contributed by Serhiy Storchaka in :gh:`78573`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1304 +#: ../../whatsnew/3.13.rst:1268 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.13.rst:1306 +#: ../../whatsnew/3.13.rst:1270 msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " @@ -1892,11 +1851,11 @@ msgid "" "`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1313 +#: ../../whatsnew/3.13.rst:1277 msgid "time" msgstr "" -#: ../../whatsnew/3.13.rst:1315 +#: ../../whatsnew/3.13.rst:1279 msgid "" "On Windows, :func:`~time.monotonic` now uses the " "``QueryPerformanceCounter()`` clock for a resolution of 1 microsecond, " @@ -1904,7 +1863,7 @@ msgid "" "milliseconds. (Contributed by Victor Stinner in :gh:`88494`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1321 +#: ../../whatsnew/3.13.rst:1285 msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " @@ -1913,11 +1872,11 @@ msgid "" "`63207`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1329 +#: ../../whatsnew/3.13.rst:1293 msgid "tkinter" msgstr "" -#: ../../whatsnew/3.13.rst:1331 +#: ../../whatsnew/3.13.rst:1295 msgid "" "Add :mod:`tkinter` widget methods: :meth:`!tk_busy_hold`, :meth:`!" "tk_busy_configure`, :meth:`!tk_busy_cget`, :meth:`!tk_busy_forget`, :meth:`!" @@ -1925,7 +1884,7 @@ msgid "" "klappnase and Serhiy Storchaka in :gh:`72684`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1337 +#: ../../whatsnew/3.13.rst:1301 msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " @@ -1934,14 +1893,14 @@ msgid "" "wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1344 +#: ../../whatsnew/3.13.rst:1308 msgid "" ":meth:`!wm_attributes` can now return attributes as a :class:`dict`, by " "using the new optional keyword-only parameter *return_python_dict*. " "(Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1348 +#: ../../whatsnew/3.13.rst:1312 msgid "" ":meth:`!Text.count` can now return a simple :class:`int` when the new " "optional keyword-only parameter *return_ints* is used. Otherwise, the single " @@ -1949,27 +1908,27 @@ msgid "" "in :gh:`97928`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1353 +#: ../../whatsnew/3.13.rst:1317 msgid "" "Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." "element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " "Storchaka in :gh:`68166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1358 +#: ../../whatsnew/3.13.rst:1322 msgid "" "Add the :meth:`!after_info` method for Tkinter widgets. (Contributed by " "Cheryl Sabella in :gh:`77020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1361 +#: ../../whatsnew/3.13.rst:1325 msgid "" "Add a new :meth:`!copy_replace` method to :class:`!PhotoImage` to copy a " "region from one image to another, possibly with pixel zooming, subsampling, " "or both. (Contributed by Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1366 +#: ../../whatsnew/3.13.rst:1330 msgid "" "Add *from_coords* parameter to the :class:`!PhotoImage` methods :meth:`!" "copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* " @@ -1977,7 +1936,7 @@ msgid "" "Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1372 +#: ../../whatsnew/3.13.rst:1336 msgid "" "Add the :class:`!PhotoImage` methods :meth:`!read` to read an image from a " "file and :meth:`!data` to get the image data. Add *background* and " @@ -1985,11 +1944,11 @@ msgid "" "Storchaka in :gh:`118271`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1380 +#: ../../whatsnew/3.13.rst:1344 msgid "traceback" msgstr "" -#: ../../whatsnew/3.13.rst:1382 +#: ../../whatsnew/3.13.rst:1346 msgid "" "Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" "class:`~traceback.TracebackException`, which holds a string display of the " @@ -1999,7 +1958,7 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1391 +#: ../../whatsnew/3.13.rst:1355 msgid "" "Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." "format_exception_only` to (recursively) format the nested exceptions of a :" @@ -2007,11 +1966,11 @@ msgid "" "`105292`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1398 +#: ../../whatsnew/3.13.rst:1362 msgid "types" msgstr "" -#: ../../whatsnew/3.13.rst:1400 +#: ../../whatsnew/3.13.rst:1364 msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " @@ -2019,63 +1978,63 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1407 ../../whatsnew/3.13.rst:1722 +#: ../../whatsnew/3.13.rst:1371 ../../whatsnew/3.13.rst:1681 msgid "typing" msgstr "" -#: ../../whatsnew/3.13.rst:1409 +#: ../../whatsnew/3.13.rst:1373 msgid "" ":pep:`705`: Add :data:`~typing.ReadOnly`, a special typing construct to mark " "a :class:`~typing.TypedDict` item as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:1412 +#: ../../whatsnew/3.13.rst:1376 msgid "" ":pep:`742`: Add :data:`~typing.TypeIs`, a typing construct that can be used " "to instruct a type checker how to narrow a type." msgstr "" -#: ../../whatsnew/3.13.rst:1415 +#: ../../whatsnew/3.13.rst:1379 msgid "" "Add :data:`~typing.NoDefault`, a sentinel object used to represent the " "defaults of some parameters in the :mod:`typing` module. (Contributed by " "Jelle Zijlstra in :gh:`116126`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1419 +#: ../../whatsnew/3.13.rst:1383 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " "defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" "`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1423 +#: ../../whatsnew/3.13.rst:1387 msgid "" "Add :func:`~typing.is_protocol` to check whether a class is a :class:" "`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1427 +#: ../../whatsnew/3.13.rst:1391 msgid "" ":data:`~typing.ClassVar` can now be nested in :data:`~typing.Final`, and " "vice versa. (Contributed by Mehdi Drissi in :gh:`89547`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1433 +#: ../../whatsnew/3.13.rst:1397 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.13.rst:1435 +#: ../../whatsnew/3.13.rst:1399 msgid "" "Update the Unicode database to `version 15.1.0`__. (Contributed by James " "Gerity in :gh:`109559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1442 +#: ../../whatsnew/3.13.rst:1406 msgid "venv" msgstr "" -#: ../../whatsnew/3.13.rst:1444 +#: ../../whatsnew/3.13.rst:1408 msgid "" "Add support for creating source control management (SCM) ignore files in a " "virtual environment's directory. By default, Git is supported. This is " @@ -2085,11 +2044,11 @@ msgid "" "Cannon in :gh:`108125`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1455 +#: ../../whatsnew/3.13.rst:1419 msgid "warnings" msgstr "" -#: ../../whatsnew/3.13.rst:1457 +#: ../../whatsnew/3.13.rst:1421 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator provides a way to " "communicate deprecations to a :term:`static type checker` and to warn on " @@ -2098,69 +2057,62 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`104003`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1466 +#: ../../whatsnew/3.13.rst:1430 msgid "xml" msgstr "" -#: ../../whatsnew/3.13.rst:1468 +#: ../../whatsnew/3.13.rst:1432 msgid "" "Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by " "adding five new methods:" msgstr "" -#: ../../whatsnew/3.13.rst:1471 +#: ../../whatsnew/3.13.rst:1435 msgid ":meth:`xml.etree.ElementTree.XMLParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1472 +#: ../../whatsnew/3.13.rst:1436 msgid ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1473 +#: ../../whatsnew/3.13.rst:1437 msgid ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1474 +#: ../../whatsnew/3.13.rst:1438 msgid ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1475 +#: ../../whatsnew/3.13.rst:1439 msgid ":meth:`!xml.sax.expatreader.ExpatParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1477 +#: ../../whatsnew/3.13.rst:1441 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1479 +#: ../../whatsnew/3.13.rst:1443 msgid "" "Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." "ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " "Storchaka in :gh:`69893`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1485 +#: ../../whatsnew/3.13.rst:1449 msgid "zipimport" msgstr "" -#: ../../whatsnew/3.13.rst:1487 +#: ../../whatsnew/3.13.rst:1451 msgid "" "Add support for ZIP64_ format files. Everybody loves huge data, right? " "(Contributed by Tim Hatch in :gh:`94146`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1495 +#: ../../whatsnew/3.13.rst:1459 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.13.rst:1497 -msgid "" -"The new :ref:`incremental garbage collector ` " -"means that maximum pause times are reduced by an order of magnitude or more " -"for larger heaps. (Contributed by Mark Shannon in :gh:`108362`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:1502 +#: ../../whatsnew/3.13.rst:1461 msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " @@ -2171,13 +2123,13 @@ msgid "" "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1513 +#: ../../whatsnew/3.13.rst:1472 msgid "" ":func:`textwrap.indent` is now around 30% faster than before for large " "input. (Contributed by Inada Naoki in :gh:`107369`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1516 +#: ../../whatsnew/3.13.rst:1475 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations, including when *close_fds* is ``True`` (the default) on " @@ -2187,15 +2139,15 @@ msgid "" "Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1526 +#: ../../whatsnew/3.13.rst:1485 msgid "Removed Modules And APIs" msgstr "" -#: ../../whatsnew/3.13.rst:1532 +#: ../../whatsnew/3.13.rst:1491 msgid "PEP 594: Remove \"dead batteries\" from the standard library" msgstr "" -#: ../../whatsnew/3.13.rst:1534 +#: ../../whatsnew/3.13.rst:1493 msgid "" ":pep:`594` proposed removing 19 modules from the standard library, " "colloquially referred to as 'dead batteries' due to their historic, " @@ -2203,23 +2155,23 @@ msgid "" "in Python 3.11, and are now removed:" msgstr "" -#: ../../whatsnew/3.13.rst:1540 +#: ../../whatsnew/3.13.rst:1499 msgid ":mod:`!aifc`" msgstr "" -#: ../../whatsnew/3.13.rst:1541 +#: ../../whatsnew/3.13.rst:1500 msgid ":mod:`!audioop`" msgstr "" -#: ../../whatsnew/3.13.rst:1542 +#: ../../whatsnew/3.13.rst:1501 msgid ":mod:`!chunk`" msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1502 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr "" -#: ../../whatsnew/3.13.rst:1545 +#: ../../whatsnew/3.13.rst:1504 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2227,7 +2179,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1550 +#: ../../whatsnew/3.13.rst:1509 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2235,14 +2187,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1555 +#: ../../whatsnew/3.13.rst:1514 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1559 +#: ../../whatsnew/3.13.rst:1518 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2251,7 +2203,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1567 +#: ../../whatsnew/3.13.rst:1526 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2259,41 +2211,41 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1573 +#: ../../whatsnew/3.13.rst:1532 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1578 +#: ../../whatsnew/3.13.rst:1537 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1580 +#: ../../whatsnew/3.13.rst:1539 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1582 +#: ../../whatsnew/3.13.rst:1541 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1584 +#: ../../whatsnew/3.13.rst:1543 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1587 +#: ../../whatsnew/3.13.rst:1546 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1592 +#: ../../whatsnew/3.13.rst:1551 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2301,83 +2253,83 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1598 +#: ../../whatsnew/3.13.rst:1557 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1600 +#: ../../whatsnew/3.13.rst:1559 msgid ":mod:`!msilib`" msgstr "" -#: ../../whatsnew/3.13.rst:1601 +#: ../../whatsnew/3.13.rst:1560 msgid ":mod:`!nis`" msgstr "" -#: ../../whatsnew/3.13.rst:1602 +#: ../../whatsnew/3.13.rst:1561 msgid ":mod:`!nntplib`: Use the :pypi:`nntplib` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1604 +#: ../../whatsnew/3.13.rst:1563 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1606 +#: ../../whatsnew/3.13.rst:1565 msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1608 +#: ../../whatsnew/3.13.rst:1567 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1611 +#: ../../whatsnew/3.13.rst:1570 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1613 +#: ../../whatsnew/3.13.rst:1572 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1614 +#: ../../whatsnew/3.13.rst:1573 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1616 +#: ../../whatsnew/3.13.rst:1575 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1618 +#: ../../whatsnew/3.13.rst:1577 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1620 +#: ../../whatsnew/3.13.rst:1579 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1624 +#: ../../whatsnew/3.13.rst:1583 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1626 +#: ../../whatsnew/3.13.rst:1585 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1632 +#: ../../whatsnew/3.13.rst:1591 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1634 +#: ../../whatsnew/3.13.rst:1593 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2387,47 +2339,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1643 +#: ../../whatsnew/3.13.rst:1602 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1651 +#: ../../whatsnew/3.13.rst:1610 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1658 +#: ../../whatsnew/3.13.rst:1617 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1660 +#: ../../whatsnew/3.13.rst:1619 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1666 +#: ../../whatsnew/3.13.rst:1625 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1668 +#: ../../whatsnew/3.13.rst:1627 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1674 +#: ../../whatsnew/3.13.rst:1633 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1676 +#: ../../whatsnew/3.13.rst:1635 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2435,7 +2387,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1681 +#: ../../whatsnew/3.13.rst:1640 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2443,43 +2395,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1691 +#: ../../whatsnew/3.13.rst:1650 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1699 +#: ../../whatsnew/3.13.rst:1658 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1664 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1666 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1713 +#: ../../whatsnew/3.13.rst:1672 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1715 +#: ../../whatsnew/3.13.rst:1674 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1724 +#: ../../whatsnew/3.13.rst:1683 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2487,66 +2439,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1730 +#: ../../whatsnew/3.13.rst:1689 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1695 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1697 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1740 +#: ../../whatsnew/3.13.rst:1699 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1741 +#: ../../whatsnew/3.13.rst:1700 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1742 +#: ../../whatsnew/3.13.rst:1701 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1744 +#: ../../whatsnew/3.13.rst:1703 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1705 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1747 +#: ../../whatsnew/3.13.rst:1706 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1707 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1750 +#: ../../whatsnew/3.13.rst:1709 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1752 +#: ../../whatsnew/3.13.rst:1711 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1758 +#: ../../whatsnew/3.13.rst:1717 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1760 +#: ../../whatsnew/3.13.rst:1719 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2557,33 +2509,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1771 +#: ../../whatsnew/3.13.rst:1730 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1732 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1778 +#: ../../whatsnew/3.13.rst:1737 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1785 +#: ../../whatsnew/3.13.rst:1744 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1787 +#: ../../whatsnew/3.13.rst:1746 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1789 +#: ../../whatsnew/3.13.rst:1748 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2591,12 +2543,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1795 +#: ../../whatsnew/3.13.rst:1754 #: ../../deprecations/pending-removal-in-3.16.rst:13 msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1797 +#: ../../whatsnew/3.13.rst:1756 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2605,50 +2557,50 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1804 +#: ../../whatsnew/3.13.rst:1763 #: ../../deprecations/pending-removal-in-3.15.rst:4 msgid ":mod:`ctypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1806 +#: ../../whatsnew/3.13.rst:1765 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1810 +#: ../../whatsnew/3.13.rst:1769 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1814 +#: ../../whatsnew/3.13.rst:1773 msgid ":mod:`decimal`:" msgstr "" -#: ../../whatsnew/3.13.rst:1816 +#: ../../whatsnew/3.13.rst:1775 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1821 +#: ../../whatsnew/3.13.rst:1780 msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1823 +#: ../../whatsnew/3.13.rst:1782 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1827 +#: ../../whatsnew/3.13.rst:1786 msgid ":mod:`getopt` and :mod:`optparse`:" msgstr "" -#: ../../whatsnew/3.13.rst:1829 +#: ../../whatsnew/3.13.rst:1788 msgid "" "Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " "for new projects. This is a new soft-deprecation for the :mod:`!getopt` " @@ -2656,22 +2608,22 @@ msgid "" "deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1835 +#: ../../whatsnew/3.13.rst:1794 msgid ":mod:`gettext`:" msgstr "" -#: ../../whatsnew/3.13.rst:1837 +#: ../../whatsnew/3.13.rst:1796 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1842 +#: ../../whatsnew/3.13.rst:1801 msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1844 +#: ../../whatsnew/3.13.rst:1803 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2679,12 +2631,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1849 +#: ../../whatsnew/3.13.rst:1808 #: ../../deprecations/pending-removal-in-3.15.rst:9 msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1851 +#: ../../whatsnew/3.13.rst:1810 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2693,29 +2645,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1858 +#: ../../whatsnew/3.13.rst:1817 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1863 +#: ../../whatsnew/3.13.rst:1822 msgid ":mod:`mimetypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1865 +#: ../../whatsnew/3.13.rst:1824 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1870 +#: ../../whatsnew/3.13.rst:1829 msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1872 +#: ../../whatsnew/3.13.rst:1831 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2724,46 +2676,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1879 -#: ../../deprecations/pending-removal-in-3.15.rst:30 +#: ../../whatsnew/3.13.rst:1838 +#: ../../deprecations/pending-removal-in-3.15.rst:33 msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1881 +#: ../../whatsnew/3.13.rst:1840 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1886 -#: ../../deprecations/pending-removal-in-3.15.rst:36 +#: ../../whatsnew/3.13.rst:1845 +#: ../../deprecations/pending-removal-in-3.15.rst:39 msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1888 +#: ../../whatsnew/3.13.rst:1847 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1894 +#: ../../whatsnew/3.13.rst:1853 msgid ":mod:`pydoc`:" msgstr "" -#: ../../whatsnew/3.13.rst:1896 +#: ../../whatsnew/3.13.rst:1855 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1899 -#: ../../deprecations/pending-removal-in-3.14.rst:94 +#: ../../whatsnew/3.13.rst:1858 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1860 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2771,7 +2723,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1907 +#: ../../whatsnew/3.13.rst:1866 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2779,7 +2731,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1913 +#: ../../whatsnew/3.13.rst:1872 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2789,46 +2741,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1921 +#: ../../whatsnew/3.13.rst:1880 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1923 +#: ../../whatsnew/3.13.rst:1882 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1928 +#: ../../whatsnew/3.13.rst:1887 #: ../../deprecations/pending-removal-in-3.16.rst:39 msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1930 +#: ../../whatsnew/3.13.rst:1889 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1934 +#: ../../whatsnew/3.13.rst:1893 msgid ":mod:`traceback`:" msgstr "" -#: ../../whatsnew/3.13.rst:1936 +#: ../../whatsnew/3.13.rst:1895 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1940 -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../whatsnew/3.13.rst:1899 +#: ../../deprecations/pending-removal-in-3.15.rst:53 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1942 +#: ../../whatsnew/3.13.rst:1901 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2836,7 +2788,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1949 +#: ../../whatsnew/3.13.rst:1908 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2848,7 +2800,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1959 +#: ../../whatsnew/3.13.rst:1918 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2856,7 +2808,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1965 +#: ../../whatsnew/3.13.rst:1924 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2865,12 +2817,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1973 -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../whatsnew/3.13.rst:1932 +#: ../../deprecations/pending-removal-in-3.15.rst:66 msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1934 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -2966,44 +2918,38 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:55 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:62 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:64 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -3011,7 +2957,7 @@ msgid "" "burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:72 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -3022,49 +2968,49 @@ msgid "" "``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:80 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:92 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " "a sequence instead of a :class:`dict`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:105 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -3072,13 +3018,13 @@ msgid "" "in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:115 +#: ../../deprecations/pending-removal-in-3.14.rst:112 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -3110,10 +3056,16 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:20 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid ":class:`locale`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:22 +#: ../../deprecations/pending-removal-in-3.15.rst:25 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -3122,24 +3074,24 @@ msgid "" "instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-3.15.rst:35 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:38 +#: ../../deprecations/pending-removal-in-3.15.rst:41 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:45 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:47 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -3147,7 +3099,7 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:55 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -3155,14 +3107,14 @@ msgid "" "functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:68 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3588,11 +3540,11 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1992 +#: ../../whatsnew/3.13.rst:1951 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1994 +#: ../../whatsnew/3.13.rst:1953 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3601,97 +3553,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:1961 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:1966 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:1969 msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:1970 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:1971 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2013 +#: ../../whatsnew/3.13.rst:1972 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2014 +#: ../../whatsnew/3.13.rst:1973 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2015 +#: ../../whatsnew/3.13.rst:1974 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2016 +#: ../../whatsnew/3.13.rst:1975 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2017 +#: ../../whatsnew/3.13.rst:1976 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2018 +#: ../../whatsnew/3.13.rst:1977 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2019 +#: ../../whatsnew/3.13.rst:1978 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2020 +#: ../../whatsnew/3.13.rst:1979 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2021 +#: ../../whatsnew/3.13.rst:1980 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2022 +#: ../../whatsnew/3.13.rst:1981 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2023 +#: ../../whatsnew/3.13.rst:1982 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2024 +#: ../../whatsnew/3.13.rst:1983 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2025 +#: ../../whatsnew/3.13.rst:1984 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2026 +#: ../../whatsnew/3.13.rst:1985 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2027 +#: ../../whatsnew/3.13.rst:1986 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2028 +#: ../../whatsnew/3.13.rst:1987 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2030 +#: ../../whatsnew/3.13.rst:1989 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:2032 +#: ../../whatsnew/3.13.rst:1991 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3699,52 +3651,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2038 +#: ../../whatsnew/3.13.rst:1997 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2040 +#: ../../whatsnew/3.13.rst:1999 msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2041 +#: ../../whatsnew/3.13.rst:2000 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2042 +#: ../../whatsnew/3.13.rst:2001 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2043 +#: ../../whatsnew/3.13.rst:2002 msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2044 +#: ../../whatsnew/3.13.rst:2003 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2045 +#: ../../whatsnew/3.13.rst:2004 msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2047 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2048 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2050 +#: ../../whatsnew/3.13.rst:2009 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2052 +#: ../../whatsnew/3.13.rst:2011 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3752,7 +3704,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2058 +#: ../../whatsnew/3.13.rst:2017 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3762,7 +3714,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2066 +#: ../../whatsnew/3.13.rst:2025 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3771,7 +3723,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2074 +#: ../../whatsnew/3.13.rst:2033 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3780,7 +3732,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2040 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3791,7 +3743,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2050 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3802,37 +3754,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2101 +#: ../../whatsnew/3.13.rst:2060 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2106 +#: ../../whatsnew/3.13.rst:2065 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2110 +#: ../../whatsnew/3.13.rst:2069 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2111 +#: ../../whatsnew/3.13.rst:2070 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2112 +#: ../../whatsnew/3.13.rst:2071 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2114 +#: ../../whatsnew/3.13.rst:2073 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2116 +#: ../../whatsnew/3.13.rst:2075 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -3841,7 +3793,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2123 +#: ../../whatsnew/3.13.rst:2082 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3849,35 +3801,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2128 +#: ../../whatsnew/3.13.rst:2087 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2133 +#: ../../whatsnew/3.13.rst:2092 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2097 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2101 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2147 +#: ../../whatsnew/3.13.rst:2106 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -3885,27 +3837,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2112 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2158 +#: ../../whatsnew/3.13.rst:2117 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2162 +#: ../../whatsnew/3.13.rst:2121 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2165 +#: ../../whatsnew/3.13.rst:2124 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -3914,7 +3866,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2173 +#: ../../whatsnew/3.13.rst:2132 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -3922,14 +3874,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2138 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2184 +#: ../../whatsnew/3.13.rst:2143 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -3937,22 +3889,22 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2190 +#: ../../whatsnew/3.13.rst:2149 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " -"fully qualified name. The module name is prepended if ``type.__module__`` is " -"a string and is not equal to either ``'builtins'`` or ``'__main__'``. " -"(Contributed by Victor Stinner in :gh:`111696`.)" +"fully qualified name. The module name is prepended if :attr:`type." +"__module__` is a string and is not equal to either ``'builtins'`` or " +"``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2196 +#: ../../whatsnew/3.13.rst:2155 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " -"name. This is equivalent to getting the ``type.__module__`` attribute. " +"name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2201 +#: ../../whatsnew/3.13.rst:2160 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -3961,7 +3913,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2208 +#: ../../whatsnew/3.13.rst:2167 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -3969,47 +3921,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2214 +#: ../../whatsnew/3.13.rst:2173 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2216 +#: ../../whatsnew/3.13.rst:2175 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2217 +#: ../../whatsnew/3.13.rst:2176 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2219 +#: ../../whatsnew/3.13.rst:2178 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2220 +#: ../../whatsnew/3.13.rst:2179 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2223 +#: ../../whatsnew/3.13.rst:2182 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2226 +#: ../../whatsnew/3.13.rst:2185 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2230 +#: ../../whatsnew/3.13.rst:2189 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2191 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4022,20 +3974,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2244 +#: ../../whatsnew/3.13.rst:2203 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2248 +#: ../../whatsnew/3.13.rst:2207 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2252 +#: ../../whatsnew/3.13.rst:2211 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4046,35 +3998,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2261 +#: ../../whatsnew/3.13.rst:2220 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2264 +#: ../../whatsnew/3.13.rst:2223 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2265 +#: ../../whatsnew/3.13.rst:2224 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2266 +#: ../../whatsnew/3.13.rst:2225 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2267 +#: ../../whatsnew/3.13.rst:2226 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2269 +#: ../../whatsnew/3.13.rst:2228 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2272 +#: ../../whatsnew/3.13.rst:2231 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4083,7 +4035,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2278 +#: ../../whatsnew/3.13.rst:2237 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4091,60 +4043,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2286 +#: ../../whatsnew/3.13.rst:2245 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2288 +#: ../../whatsnew/3.13.rst:2247 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2290 +#: ../../whatsnew/3.13.rst:2249 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2291 +#: ../../whatsnew/3.13.rst:2250 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2292 +#: ../../whatsnew/3.13.rst:2251 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2293 +#: ../../whatsnew/3.13.rst:2252 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2294 +#: ../../whatsnew/3.13.rst:2253 msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2295 +#: ../../whatsnew/3.13.rst:2254 msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2296 +#: ../../whatsnew/3.13.rst:2255 msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2298 +#: ../../whatsnew/3.13.rst:2257 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2300 +#: ../../whatsnew/3.13.rst:2259 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2306 +#: ../../whatsnew/3.13.rst:2265 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2308 +#: ../../whatsnew/3.13.rst:2267 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4154,13 +4106,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2316 +#: ../../whatsnew/3.13.rst:2275 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2319 +#: ../../whatsnew/3.13.rst:2278 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4169,13 +4121,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2327 +#: ../../whatsnew/3.13.rst:2286 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2330 +#: ../../whatsnew/3.13.rst:2289 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4186,13 +4138,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2340 +#: ../../whatsnew/3.13.rst:2299 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2343 +#: ../../whatsnew/3.13.rst:2302 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4202,21 +4154,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2311 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2313 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2356 +#: ../../whatsnew/3.13.rst:2315 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2361 +#: ../../whatsnew/3.13.rst:2320 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4227,106 +4179,106 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2330 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2332 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2334 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2378 +#: ../../whatsnew/3.13.rst:2337 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2380 +#: ../../whatsnew/3.13.rst:2339 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2383 +#: ../../whatsnew/3.13.rst:2342 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2385 +#: ../../whatsnew/3.13.rst:2344 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2387 +#: ../../whatsnew/3.13.rst:2346 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2389 +#: ../../whatsnew/3.13.rst:2348 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2391 +#: ../../whatsnew/3.13.rst:2350 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2393 +#: ../../whatsnew/3.13.rst:2352 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2395 +#: ../../whatsnew/3.13.rst:2354 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2398 +#: ../../whatsnew/3.13.rst:2357 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2401 +#: ../../whatsnew/3.13.rst:2360 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2405 +#: ../../whatsnew/3.13.rst:2364 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2369 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2411 +#: ../../whatsnew/3.13.rst:2370 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2371 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2373 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2375 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4335,7 +4287,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2423 +#: ../../whatsnew/3.13.rst:2382 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4344,26 +4296,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2389 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2435 +#: ../../whatsnew/3.13.rst:2394 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2439 +#: ../../whatsnew/3.13.rst:2398 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2442 +#: ../../whatsnew/3.13.rst:2401 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4371,79 +4323,79 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2449 +#: ../../whatsnew/3.13.rst:2408 msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2410 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2453 +#: ../../whatsnew/3.13.rst:2412 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2455 +#: ../../whatsnew/3.13.rst:2414 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2416 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2459 +#: ../../whatsnew/3.13.rst:2418 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2461 +#: ../../whatsnew/3.13.rst:2420 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2463 +#: ../../whatsnew/3.13.rst:2422 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2465 +#: ../../whatsnew/3.13.rst:2424 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2469 +#: ../../whatsnew/3.13.rst:2428 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2471 +#: ../../whatsnew/3.13.rst:2430 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2477 +#: ../../whatsnew/3.13.rst:2436 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2481 +#: ../../whatsnew/3.13.rst:2440 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2487 +#: ../../whatsnew/3.13.rst:2446 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4452,7 +4404,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2453 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4763,55 +4715,55 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2514 +#: ../../whatsnew/3.13.rst:2473 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2516 +#: ../../whatsnew/3.13.rst:2475 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2521 +#: ../../whatsnew/3.13.rst:2480 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2526 +#: ../../whatsnew/3.13.rst:2485 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2529 +#: ../../whatsnew/3.13.rst:2488 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2532 +#: ../../whatsnew/3.13.rst:2491 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2535 +#: ../../whatsnew/3.13.rst:2494 msgid "" "Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2539 +#: ../../whatsnew/3.13.rst:2498 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2543 +#: ../../whatsnew/3.13.rst:2502 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -4819,28 +4771,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2551 +#: ../../whatsnew/3.13.rst:2510 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2555 +#: ../../whatsnew/3.13.rst:2514 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2560 +#: ../../whatsnew/3.13.rst:2519 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2564 +#: ../../whatsnew/3.13.rst:2523 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -4850,27 +4802,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2573 +#: ../../whatsnew/3.13.rst:2532 msgid "Porting to Python 3.13" msgstr "" -#: ../../whatsnew/3.13.rst:2575 +#: ../../whatsnew/3.13.rst:2534 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2579 +#: ../../whatsnew/3.13.rst:2538 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.13.rst:2583 +#: ../../whatsnew/3.13.rst:2542 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2586 +#: ../../whatsnew/3.13.rst:2545 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -4882,7 +4834,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2595 +#: ../../whatsnew/3.13.rst:2554 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -4892,7 +4844,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2602 +#: ../../whatsnew/3.13.rst:2561 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -4901,7 +4853,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2608 +#: ../../whatsnew/3.13.rst:2567 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -4909,20 +4861,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2614 -msgid "" -"The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" -msgstr "" - -#: ../../whatsnew/3.13.rst:2621 +#: ../../whatsnew/3.13.rst:2573 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2626 +#: ../../whatsnew/3.13.rst:2578 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -4931,13 +4877,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2632 +#: ../../whatsnew/3.13.rst:2584 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2635 +#: ../../whatsnew/3.13.rst:2587 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -4945,25 +4891,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2640 +#: ../../whatsnew/3.13.rst:2592 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2645 +#: ../../whatsnew/3.13.rst:2597 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2652 +#: ../../whatsnew/3.13.rst:2604 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.13.rst:2654 +#: ../../whatsnew/3.13.rst:2606 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -4972,7 +4918,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2660 +#: ../../whatsnew/3.13.rst:2612 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -4983,7 +4929,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2620 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -4993,7 +4939,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2675 +#: ../../whatsnew/3.13.rst:2627 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5001,18 +4947,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2680 +#: ../../whatsnew/3.13.rst:2632 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2684 +#: ../../whatsnew/3.13.rst:2636 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2686 +#: ../../whatsnew/3.13.rst:2638 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5024,11 +4970,11 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2695 +#: ../../whatsnew/3.13.rst:2647 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2697 +#: ../../whatsnew/3.13.rst:2649 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5040,7 +4986,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2706 +#: ../../whatsnew/3.13.rst:2658 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5048,13 +4994,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2713 +#: ../../whatsnew/3.13.rst:2665 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2716 +#: ../../whatsnew/3.13.rst:2668 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5068,7 +5014,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2729 +#: ../../whatsnew/3.13.rst:2681 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5077,25 +5023,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2736 +#: ../../whatsnew/3.13.rst:2688 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2741 +#: ../../whatsnew/3.13.rst:2693 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2746 +#: ../../whatsnew/3.13.rst:2698 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2748 +#: ../../whatsnew/3.13.rst:2700 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index bba85bbba6..82c60a3dce 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -216,7 +216,7 @@ msgid "" "dimensional NumPy-style arrays is explained." msgstr "" -#: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1123 +#: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1125 msgid "Features" msgstr "功能" @@ -253,7 +253,7 @@ msgid "" "now possible to reverse a memoryview in *O*\\ (1) by using a negative step." msgstr "" -#: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1133 +#: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1135 msgid "API changes" msgstr "API 變更" @@ -872,19 +872,19 @@ msgstr "" #: ../../whatsnew/3.3.rst:552 msgid "" -"Functions and class objects have a new ``__qualname__`` attribute " -"representing the \"path\" from the module top-level to their definition. " -"For global functions and classes, this is the same as ``__name__``. For " -"other functions and classes, it provides better information about where they " -"were actually defined, and how they might be accessible from the global " -"scope." +"Functions and class objects have a new :attr:`~definition.__qualname__` " +"attribute representing the \"path\" from the module top-level to their " +"definition. For global functions and classes, this is the same as :attr:" +"`~definition.__name__`. For other functions and classes, it provides better " +"information about where they were actually defined, and how they might be " +"accessible from the global scope." msgstr "" -#: ../../whatsnew/3.3.rst:558 +#: ../../whatsnew/3.3.rst:560 msgid "Example with (non-bound) methods::" msgstr "" -#: ../../whatsnew/3.3.rst:560 +#: ../../whatsnew/3.3.rst:562 msgid "" ">>> class C:\n" "... def meth(self):\n" @@ -904,11 +904,11 @@ msgstr "" ">>> C.meth.__qualname__\n" "'C.meth'" -#: ../../whatsnew/3.3.rst:569 +#: ../../whatsnew/3.3.rst:571 msgid "Example with nested classes::" msgstr "巢狀類別範例: ::" -#: ../../whatsnew/3.3.rst:571 +#: ../../whatsnew/3.3.rst:573 msgid "" ">>> class C:\n" "... class D:\n" @@ -938,11 +938,11 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../whatsnew/3.3.rst:585 +#: ../../whatsnew/3.3.rst:587 msgid "Example with nested functions::" msgstr "巢狀函式範例: ::" -#: ../../whatsnew/3.3.rst:587 +#: ../../whatsnew/3.3.rst:589 msgid "" ">>> def outer():\n" "... def inner():\n" @@ -964,13 +964,13 @@ msgstr "" ">>> outer().__qualname__\n" "'outer..inner'" -#: ../../whatsnew/3.3.rst:597 +#: ../../whatsnew/3.3.rst:599 msgid "" "The string representation of those objects is also changed to include the " "new, more precise information::" msgstr "" -#: ../../whatsnew/3.3.rst:600 +#: ../../whatsnew/3.3.rst:602 msgid "" ">>> str(C.D)\n" "\"\"\n" @@ -982,19 +982,19 @@ msgstr "" ">>> str(C.D.meth)\n" "''" -#: ../../whatsnew/3.3.rst:607 +#: ../../whatsnew/3.3.rst:609 msgid ":pep:`3155` - Qualified name for classes and functions" msgstr "" -#: ../../whatsnew/3.3.rst:608 +#: ../../whatsnew/3.3.rst:610 msgid "PEP written and implemented by Antoine Pitrou." msgstr "由 Antoine Pitrou 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:614 +#: ../../whatsnew/3.3.rst:616 msgid "PEP 412: Key-Sharing Dictionary" msgstr "" -#: ../../whatsnew/3.3.rst:616 +#: ../../whatsnew/3.3.rst:618 msgid "" "Dictionaries used for the storage of objects' attributes are now able to " "share part of their internal storage between each other (namely, the part " @@ -1002,19 +1002,19 @@ msgid "" "consumption of programs creating many instances of non-builtin types." msgstr "" -#: ../../whatsnew/3.3.rst:623 +#: ../../whatsnew/3.3.rst:625 msgid ":pep:`412` - Key-Sharing Dictionary" msgstr ":pep:`412` - 密鑰共享字典" -#: ../../whatsnew/3.3.rst:624 +#: ../../whatsnew/3.3.rst:626 msgid "PEP written and implemented by Mark Shannon." msgstr "由 Mark Shannon 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:628 +#: ../../whatsnew/3.3.rst:630 msgid "PEP 362: Function Signature Object" msgstr "PEP 362:函式簽名物件" -#: ../../whatsnew/3.3.rst:630 +#: ../../whatsnew/3.3.rst:632 msgid "" "A new function :func:`inspect.signature` makes introspection of python " "callables easy and straightforward. A broad range of callables is " @@ -1026,11 +1026,11 @@ msgid "" "code that validates or amends calling signatures or arguments." msgstr "" -#: ../../whatsnew/3.3.rst:641 +#: ../../whatsnew/3.3.rst:643 msgid ":pep:`362`: - Function Signature Object" msgstr ":pep:`362`: - 函式簽名物件" -#: ../../whatsnew/3.3.rst:642 +#: ../../whatsnew/3.3.rst:644 msgid "" "PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo; " "implemented by Yury Selivanov." @@ -1038,11 +1038,11 @@ msgstr "" "PEP 由 Brett Cannon、Yury Selivanov、Larry Hastings、Jiwon Seo 撰寫;由 Yury " "Selivanov 實作。" -#: ../../whatsnew/3.3.rst:647 +#: ../../whatsnew/3.3.rst:649 msgid "PEP 421: Adding sys.implementation" msgstr "PEP 421:新增 sys.implementation" -#: ../../whatsnew/3.3.rst:649 +#: ../../whatsnew/3.3.rst:651 msgid "" "A new attribute on the :mod:`sys` module exposes details specific to the " "implementation of the currently running interpreter. The initial set of " @@ -1050,7 +1050,7 @@ msgid "" "``hexversion``, and ``cache_tag``." msgstr "" -#: ../../whatsnew/3.3.rst:654 +#: ../../whatsnew/3.3.rst:656 msgid "" "The intention of ``sys.implementation`` is to consolidate into one namespace " "the implementation-specific data used by the standard library. This allows " @@ -1060,7 +1060,7 @@ msgid "" "ratio will shift in order to make the standard library more portable." msgstr "" -#: ../../whatsnew/3.3.rst:661 +#: ../../whatsnew/3.3.rst:663 msgid "" "One example of improved standard library portability is ``cache_tag``. As " "of Python 3.3, ``sys.implementation.cache_tag`` is used by :mod:`importlib` " @@ -1069,11 +1069,11 @@ msgid "" "control the caching behavior for modules." msgstr "" -#: ../../whatsnew/3.3.rst:668 +#: ../../whatsnew/3.3.rst:670 msgid "SimpleNamespace" msgstr "SimpleNamespace" -#: ../../whatsnew/3.3.rst:670 +#: ../../whatsnew/3.3.rst:672 msgid "" "The implementation of ``sys.implementation`` also introduces a new type to " "Python: :class:`types.SimpleNamespace`. In contrast to a mapping-based " @@ -1083,19 +1083,19 @@ msgid "" "through normal attribute access." msgstr "" -#: ../../whatsnew/3.3.rst:679 +#: ../../whatsnew/3.3.rst:681 msgid ":pep:`421` - Adding sys.implementation" msgstr ":pep:`421` - 新增 sys.implementation" -#: ../../whatsnew/3.3.rst:680 +#: ../../whatsnew/3.3.rst:682 msgid "PEP written and implemented by Eric Snow." msgstr "由 Eric Snow 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:686 +#: ../../whatsnew/3.3.rst:688 msgid "Using importlib as the Implementation of Import" msgstr "使用 importlib 作為 import 的實作" -#: ../../whatsnew/3.3.rst:687 +#: ../../whatsnew/3.3.rst:689 msgid "" ":issue:`2377` - Replace __import__ w/ importlib.__import__ :issue:`13959` - " "Re-implement parts of :mod:`!imp` in pure Python :issue:`14605` - Make " @@ -1103,7 +1103,7 @@ msgid "" "and __package__" msgstr "" -#: ../../whatsnew/3.3.rst:692 +#: ../../whatsnew/3.3.rst:694 msgid "" "The :func:`__import__` function is now powered by :func:`importlib." "__import__`. This work leads to the completion of \"phase 2\" of :pep:`302`. " @@ -1115,7 +1115,7 @@ msgid "" "import, allowing for future growth to occur." msgstr "" -#: ../../whatsnew/3.3.rst:701 +#: ../../whatsnew/3.3.rst:703 msgid "" "For the common user, there should be no visible change in semantics. For " "those whose code currently manipulates import or calls import " @@ -1123,18 +1123,18 @@ msgid "" "covered in the `Porting Python code`_ section of this document." msgstr "" -#: ../../whatsnew/3.3.rst:707 +#: ../../whatsnew/3.3.rst:709 msgid "New APIs" msgstr "新 API" -#: ../../whatsnew/3.3.rst:708 +#: ../../whatsnew/3.3.rst:710 msgid "" "One of the large benefits of this work is the exposure of what goes into " "making the import statement work. That means the various importers that were " "once implicit are now fully exposed as part of the :mod:`importlib` package." msgstr "" -#: ../../whatsnew/3.3.rst:712 +#: ../../whatsnew/3.3.rst:714 msgid "" "The abstract base classes defined in :mod:`importlib.abc` have been expanded " "to properly delineate between :term:`meta path finders ` " @@ -1145,14 +1145,14 @@ msgid "" "requirements." msgstr "" -#: ../../whatsnew/3.3.rst:720 +#: ../../whatsnew/3.3.rst:722 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 :data:`sys.path_hooks`." msgstr "" -#: ../../whatsnew/3.3.rst:724 +#: ../../whatsnew/3.3.rst:726 msgid "" "For loaders, the new abstract base class :class:`importlib.abc.FileLoader` " "helps write a loader that uses the file system as the storage mechanism for " @@ -1162,7 +1162,7 @@ msgid "" "ExtensionFileLoader`) are now available for direct use." msgstr "" -#: ../../whatsnew/3.3.rst:732 +#: ../../whatsnew/3.3.rst:734 msgid "" ":exc:`ImportError` now has ``name`` and ``path`` attributes which are set " "when there is relevant data to provide. The message for failed imports will " @@ -1170,24 +1170,24 @@ msgid "" "the module's name." msgstr "" -#: ../../whatsnew/3.3.rst:737 +#: ../../whatsnew/3.3.rst:739 msgid "" "The :func:`importlib.invalidate_caches` function will now call the method " "with the same name on all finders cached in :data:`sys.path_importer_cache` " "to help clean up any stored state as necessary." msgstr "" -#: ../../whatsnew/3.3.rst:742 +#: ../../whatsnew/3.3.rst:744 msgid "Visible Changes" msgstr "明顯的變更" -#: ../../whatsnew/3.3.rst:744 +#: ../../whatsnew/3.3.rst:746 msgid "" "For potential required changes to code, see the `Porting Python code`_ " "section." msgstr "" -#: ../../whatsnew/3.3.rst:747 +#: ../../whatsnew/3.3.rst:749 msgid "" "Beyond the expanse of what :mod:`importlib` now exposes, there are other " "visible changes to import. The biggest is that :data:`sys.meta_path` and :" @@ -1198,7 +1198,7 @@ msgid "" "fit one's needs." msgstr "" -#: ../../whatsnew/3.3.rst:754 +#: ../../whatsnew/3.3.rst:756 msgid "" "Another change is that all modules have a ``__loader__`` attribute, storing " "the loader used to create the module. :pep:`302` has been updated to make " @@ -1208,14 +1208,14 @@ msgid "" "load." msgstr "" -#: ../../whatsnew/3.3.rst:760 +#: ../../whatsnew/3.3.rst:762 msgid "" "Loaders are also now expected to set the ``__package__`` attribute from :pep:" "`366`. Once again, import itself is already setting this on all loaders " "from :mod:`importlib` and import itself is setting the attribute post-load." msgstr "" -#: ../../whatsnew/3.3.rst:764 +#: ../../whatsnew/3.3.rst:766 msgid "" "``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 " @@ -1223,66 +1223,66 @@ msgid "" "upon to always be available to use as a value representing no finder found." msgstr "" -#: ../../whatsnew/3.3.rst:769 +#: ../../whatsnew/3.3.rst:771 msgid "" "All other changes relate to semantic changes which should be taken into " "consideration when updating code for Python 3.3, and thus should be read " "about in the `Porting Python code`_ section of this document." msgstr "" -#: ../../whatsnew/3.3.rst:773 +#: ../../whatsnew/3.3.rst:775 msgid "(Implementation by Brett Cannon)" msgstr "(由 Brett Cannon 實作)" -#: ../../whatsnew/3.3.rst:777 +#: ../../whatsnew/3.3.rst:779 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.3.rst:779 +#: ../../whatsnew/3.3.rst:781 msgid "Some smaller changes made to the core Python language are:" msgstr "對核心 Python 語言所做的一些較小的更改包括:" -#: ../../whatsnew/3.3.rst:781 +#: ../../whatsnew/3.3.rst:783 msgid "" "Added support for Unicode name aliases and named sequences. Both :func:" "`unicodedata.lookup` and ``'\\N{...}'`` now resolve name aliases, and :func:" "`unicodedata.lookup` resolves named sequences too." msgstr "" -#: ../../whatsnew/3.3.rst:785 +#: ../../whatsnew/3.3.rst:787 msgid "(Contributed by Ezio Melotti in :issue:`12753`.)" msgstr "(由 Ezio Melotti 在 :issue:`12753` 中貢獻。)" -#: ../../whatsnew/3.3.rst:787 +#: ../../whatsnew/3.3.rst:789 msgid "Unicode database updated to UCD version 6.1.0" msgstr "Unicode 資料庫更新至 UCD 版本 6.1.0" -#: ../../whatsnew/3.3.rst:789 +#: ../../whatsnew/3.3.rst:791 msgid "" "Equality comparisons on :func:`range` objects now return a result reflecting " "the equality of the underlying sequences generated by those range objects. (:" "issue:`13201`)" msgstr "" -#: ../../whatsnew/3.3.rst:793 +#: ../../whatsnew/3.3.rst:795 msgid "" "The ``count()``, ``find()``, ``rfind()``, ``index()`` and ``rindex()`` " "methods of :class:`bytes` and :class:`bytearray` objects now accept an " "integer between 0 and 255 as their first argument." msgstr "" -#: ../../whatsnew/3.3.rst:797 +#: ../../whatsnew/3.3.rst:799 msgid "(Contributed by Petri Lehtinen in :issue:`12170`.)" msgstr "(由 Petri Lehtinen 在 :issue:`12170` 中貢獻。)" -#: ../../whatsnew/3.3.rst:799 +#: ../../whatsnew/3.3.rst:801 msgid "" "The ``rjust()``, ``ljust()``, and ``center()`` methods of :class:`bytes` " "and :class:`bytearray` now accept a :class:`bytearray` for the ``fill`` " "argument. (Contributed by Petri Lehtinen in :issue:`12380`.)" msgstr "" -#: ../../whatsnew/3.3.rst:803 +#: ../../whatsnew/3.3.rst:805 msgid "" "New methods have been added to :class:`list` and :class:`bytearray`: " "``copy()`` and ``clear()`` (:issue:`10516`). Consequently, :class:" @@ -1290,40 +1290,40 @@ msgid "" "abc.MutableSequence.clear` method (:issue:`11388`)." msgstr "" -#: ../../whatsnew/3.3.rst:808 +#: ../../whatsnew/3.3.rst:810 msgid "" "Raw bytes literals can now be written ``rb\"...\"`` as well as ``br\"...\"``." msgstr "" -#: ../../whatsnew/3.3.rst:810 +#: ../../whatsnew/3.3.rst:812 msgid "(Contributed by Antoine Pitrou in :issue:`13748`.)" msgstr "(由 Antoine Pitrou 在 :issue:`13748` 中貢獻。)" -#: ../../whatsnew/3.3.rst:812 +#: ../../whatsnew/3.3.rst:814 msgid "" ":meth:`dict.setdefault` now does only one lookup for the given key, making " "it atomic when used with built-in types." msgstr "" -#: ../../whatsnew/3.3.rst:815 +#: ../../whatsnew/3.3.rst:817 msgid "(Contributed by Filip Gruszczyński in :issue:`13521`.)" msgstr "(由 Filip Gruszczyński 在 :issue:`13521` 中貢獻。)" -#: ../../whatsnew/3.3.rst:817 +#: ../../whatsnew/3.3.rst:819 msgid "" "The error messages produced when a function call does not match the function " "signature have been significantly improved." msgstr "" -#: ../../whatsnew/3.3.rst:820 +#: ../../whatsnew/3.3.rst:822 msgid "(Contributed by Benjamin Peterson.)" msgstr "(由 Benjamin Peterson 貢獻。)" -#: ../../whatsnew/3.3.rst:824 +#: ../../whatsnew/3.3.rst:826 msgid "A Finer-Grained Import Lock" msgstr "" -#: ../../whatsnew/3.3.rst:826 +#: ../../whatsnew/3.3.rst:828 msgid "" "Previous versions of CPython have always relied on a global import lock. " "This led to unexpected annoyances, such as deadlocks when importing a module " @@ -1332,7 +1332,7 @@ msgid "" "`PyImport_ImportModuleNoBlock` C API function." msgstr "" -#: ../../whatsnew/3.3.rst:832 +#: ../../whatsnew/3.3.rst:834 msgid "" "In Python 3.3, importing a module takes a per-module lock. This correctly " "serializes importation of a given module from multiple threads (preventing " @@ -1340,15 +1340,15 @@ msgid "" "aforementioned annoyances." msgstr "" -#: ../../whatsnew/3.3.rst:837 +#: ../../whatsnew/3.3.rst:839 msgid "(Contributed by Antoine Pitrou in :issue:`9260`.)" msgstr "(由 Antoine Pitrou 在 :issue:`9260` 中貢獻。)" -#: ../../whatsnew/3.3.rst:841 +#: ../../whatsnew/3.3.rst:843 msgid "Builtin functions and types" msgstr "內建函式和型別" -#: ../../whatsnew/3.3.rst:843 +#: ../../whatsnew/3.3.rst:845 msgid "" ":func:`open` gets a new *opener* parameter: the underlying file descriptor " "for the file object is then obtained by calling *opener* with (*file*, " @@ -1357,26 +1357,26 @@ msgid "" "the file already exists." msgstr "" -#: ../../whatsnew/3.3.rst:848 +#: ../../whatsnew/3.3.rst:850 msgid "" ":func:`print`: added the *flush* keyword argument. If the *flush* keyword " "argument is true, the stream is forcibly flushed." msgstr "" -#: ../../whatsnew/3.3.rst:850 +#: ../../whatsnew/3.3.rst:852 msgid "" ":func:`hash`: hash randomization is enabled by default, see :meth:`object." "__hash__` and :envvar:`PYTHONHASHSEED`." msgstr "" -#: ../../whatsnew/3.3.rst:852 +#: ../../whatsnew/3.3.rst:854 msgid "" "The :class:`str` type gets a new :meth:`~str.casefold` method: return a " "casefolded copy of the string, casefolded strings may be used for caseless " "matching. For example, ``'ß'.casefold()`` returns ``'ss'``." msgstr "" -#: ../../whatsnew/3.3.rst:855 +#: ../../whatsnew/3.3.rst:857 msgid "" "The sequence documentation has been substantially rewritten to better " "explain the binary/text sequence distinction and to provide specific " @@ -1384,15 +1384,15 @@ msgid "" "`4966`)." msgstr "" -#: ../../whatsnew/3.3.rst:862 +#: ../../whatsnew/3.3.rst:864 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.3.rst:865 +#: ../../whatsnew/3.3.rst:867 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.3.rst:867 +#: ../../whatsnew/3.3.rst:869 msgid "" "This new debug module :mod:`faulthandler` contains functions to dump Python " "tracebacks explicitly, on a fault (a crash like a segmentation fault), after " @@ -1403,11 +1403,11 @@ msgid "" "by using :option:`-X` ``faulthandler`` command line option." msgstr "" -#: ../../whatsnew/3.3.rst:875 +#: ../../whatsnew/3.3.rst:877 msgid "Example of a segmentation fault on Linux:" msgstr "" -#: ../../whatsnew/3.3.rst:877 +#: ../../whatsnew/3.3.rst:879 msgid "" "$ python -q -X faulthandler\n" ">>> import ctypes\n" @@ -1431,45 +1431,45 @@ msgstr "" " File \"\", line 1 in \n" "Segmentation fault" -#: ../../whatsnew/3.3.rst:891 +#: ../../whatsnew/3.3.rst:893 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.3.rst:893 +#: ../../whatsnew/3.3.rst:895 msgid "" "The new :mod:`ipaddress` module provides tools for creating and manipulating " "objects representing IPv4 and IPv6 addresses, networks and interfaces (i.e. " "an IP address associated with a specific IP subnet)." msgstr "" -#: ../../whatsnew/3.3.rst:897 +#: ../../whatsnew/3.3.rst:899 msgid "(Contributed by Google and Peter Moody in :pep:`3144`.)" msgstr "(由 Google 和 Peter Moody 在 :pep:`3144` 中貢獻。)" -#: ../../whatsnew/3.3.rst:900 +#: ../../whatsnew/3.3.rst:902 msgid "lzma" msgstr "lzma" -#: ../../whatsnew/3.3.rst:902 +#: ../../whatsnew/3.3.rst:904 msgid "" "The newly added :mod:`lzma` module provides data compression and " "decompression using the LZMA algorithm, including support for the ``.xz`` " "and ``.lzma`` file formats." msgstr "" -#: ../../whatsnew/3.3.rst:906 +#: ../../whatsnew/3.3.rst:908 msgid "(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`.)" msgstr "(由 Nadeem Vawda 和 Per Øyvind Karlsen 在 :issue:`6715` 中貢獻。)" -#: ../../whatsnew/3.3.rst:910 +#: ../../whatsnew/3.3.rst:912 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.3.rst:913 +#: ../../whatsnew/3.3.rst:915 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.3.rst:915 +#: ../../whatsnew/3.3.rst:917 msgid "" "Improved support for abstract base classes containing descriptors composed " "with abstract methods. The recommended approach to declaring abstract " @@ -1477,7 +1477,7 @@ msgid "" "updated property. The built-in descriptors have been updated accordingly." msgstr "" -#: ../../whatsnew/3.3.rst:920 ../../whatsnew/3.3.rst:2246 +#: ../../whatsnew/3.3.rst:922 ../../whatsnew/3.3.rst:2248 msgid "" ":class:`abc.abstractproperty` has been deprecated, use :class:`property` " "with :func:`abc.abstractmethod` instead." @@ -1485,7 +1485,7 @@ msgstr "" ":class:`abc.abstractproperty` 已被棄用,請改 :class:`property` 和 :func:`abc." "abstractmethod`。" -#: ../../whatsnew/3.3.rst:922 ../../whatsnew/3.3.rst:2248 +#: ../../whatsnew/3.3.rst:924 ../../whatsnew/3.3.rst:2250 msgid "" ":class:`abc.abstractclassmethod` has been deprecated, use :class:" "`classmethod` with :func:`abc.abstractmethod` instead." @@ -1493,7 +1493,7 @@ msgstr "" ":class:`abc.abstractclassmethod` 已被棄用,請改用 :class:`classmethod` 和 :" "func:`abc.abstractmethod`。" -#: ../../whatsnew/3.3.rst:924 ../../whatsnew/3.3.rst:2250 +#: ../../whatsnew/3.3.rst:926 ../../whatsnew/3.3.rst:2252 msgid "" ":class:`abc.abstractstaticmethod` has been deprecated, use :class:" "`staticmethod` with :func:`abc.abstractmethod` instead." @@ -1501,35 +1501,35 @@ msgstr "" ":class:`abc.abstractstaticmethod` 已被棄用,請改用 :class:`staticmethod` 和 :" "func:`abc.abstractmethod`。" -#: ../../whatsnew/3.3.rst:927 +#: ../../whatsnew/3.3.rst:929 msgid "(Contributed by Darren Dale in :issue:`11610`.)" msgstr "(由 Darren Dale 在 :issue:`11610` 中貢獻。)" -#: ../../whatsnew/3.3.rst:929 +#: ../../whatsnew/3.3.rst:931 msgid "" ":meth:`abc.ABCMeta.register` now returns the registered subclass, which " "means it can now be used as a class decorator (:issue:`10868`)." msgstr "" -#: ../../whatsnew/3.3.rst:934 +#: ../../whatsnew/3.3.rst:936 msgid "array" msgstr "array" -#: ../../whatsnew/3.3.rst:936 +#: ../../whatsnew/3.3.rst:938 msgid "" "The :mod:`array` module supports the :c:expr:`long long` type using ``q`` " "and ``Q`` type codes." msgstr "" -#: ../../whatsnew/3.3.rst:939 +#: ../../whatsnew/3.3.rst:941 msgid "(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`.)" msgstr "(由 Oren Tirosh 和 Hirokazu Yamamoto 在 :issue:`1172711` 中貢獻。)" -#: ../../whatsnew/3.3.rst:943 +#: ../../whatsnew/3.3.rst:945 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.3.rst:945 +#: ../../whatsnew/3.3.rst:947 msgid "" "ASCII-only Unicode strings are now accepted by the decoding functions of " "the :mod:`base64` modern interface. For example, ``base64." @@ -1537,44 +1537,44 @@ msgid "" "issue:`13641`.)" msgstr "" -#: ../../whatsnew/3.3.rst:951 +#: ../../whatsnew/3.3.rst:953 msgid "binascii" msgstr "binascii" -#: ../../whatsnew/3.3.rst:953 +#: ../../whatsnew/3.3.rst:955 msgid "" "In addition to the binary objects they normally accept, the ``a2b_`` " "functions now all also accept ASCII-only strings as input. (Contributed by " "Antoine Pitrou in :issue:`13637`.)" msgstr "" -#: ../../whatsnew/3.3.rst:959 +#: ../../whatsnew/3.3.rst:961 msgid "bz2" msgstr "bz2" -#: ../../whatsnew/3.3.rst:961 +#: ../../whatsnew/3.3.rst:963 msgid "" "The :mod:`bz2` module has been rewritten from scratch. In the process, " "several new features have been added:" msgstr "" -#: ../../whatsnew/3.3.rst:964 +#: ../../whatsnew/3.3.rst:966 msgid "" "New :func:`bz2.open` function: open a bzip2-compressed file in binary or " "text mode." msgstr "" -#: ../../whatsnew/3.3.rst:967 +#: ../../whatsnew/3.3.rst:969 msgid "" ":class:`bz2.BZ2File` can now read from and write to arbitrary file-like " "objects, by means of its constructor's *fileobj* argument." msgstr "" -#: ../../whatsnew/3.3.rst:970 +#: ../../whatsnew/3.3.rst:972 msgid "(Contributed by Nadeem Vawda in :issue:`5863`.)" msgstr "(由 Nadeem Vawda 在 :issue:`5863` 中貢獻。)" -#: ../../whatsnew/3.3.rst:972 +#: ../../whatsnew/3.3.rst:974 msgid "" ":class:`bz2.BZ2File` and :func:`bz2.decompress` can now decompress multi-" "stream inputs (such as those produced by the :program:`pbzip2` tool). :class:" @@ -1582,21 +1582,21 @@ msgid "" "``'a'`` (append) mode." msgstr "" -#: ../../whatsnew/3.3.rst:977 +#: ../../whatsnew/3.3.rst:979 msgid "(Contributed by Nir Aides in :issue:`1625`.)" msgstr "(由 Nir Aides 在 :issue:`1625` 中貢獻。)" -#: ../../whatsnew/3.3.rst:979 +#: ../../whatsnew/3.3.rst:981 msgid "" ":class:`bz2.BZ2File` now implements all of the :class:`io.BufferedIOBase` " "API, except for the :meth:`detach` and :meth:`truncate` methods." msgstr "" -#: ../../whatsnew/3.3.rst:984 +#: ../../whatsnew/3.3.rst:986 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.3.rst:986 +#: ../../whatsnew/3.3.rst:988 msgid "" "The :mod:`~encodings.mbcs` codec has been rewritten to handle correctly " "``replace`` and ``ignore`` error handlers on all Windows versions. The :mod:" @@ -1604,7 +1604,7 @@ msgid "" "``replace`` to encode and ``ignore`` to decode." msgstr "" -#: ../../whatsnew/3.3.rst:991 +#: ../../whatsnew/3.3.rst:993 msgid "" "A new Windows-only codec has been added: ``cp65001`` (:issue:`13216`). It is " "the Windows code page 65001 (Windows UTF-8, ``CP_UTF8``). For example, it " @@ -1612,7 +1612,7 @@ msgid "" "(e.g., using ``chcp 65001`` command)." msgstr "" -#: ../../whatsnew/3.3.rst:996 +#: ../../whatsnew/3.3.rst:998 msgid "" "Multibyte CJK decoders now resynchronize faster. They only ignore the first " "byte of an invalid byte sequence. For example, ``b'\\xff\\n'." @@ -1620,17 +1620,17 @@ msgid "" "character." msgstr "" -#: ../../whatsnew/3.3.rst:1000 +#: ../../whatsnew/3.3.rst:1002 msgid "(:issue:`12016`)" msgstr "(:issue:`12016`)" -#: ../../whatsnew/3.3.rst:1002 +#: ../../whatsnew/3.3.rst:1004 msgid "" "Incremental CJK codec encoders are no longer reset at each call to their " "encode() methods. For example::" msgstr "" -#: ../../whatsnew/3.3.rst:1005 +#: ../../whatsnew/3.3.rst:1007 msgid "" ">>> import codecs\n" ">>> encoder = codecs.getincrementalencoder('hz')('strict')\n" @@ -1644,32 +1644,32 @@ msgstr "" "Bye.')\n" "b'~{NpJ)l6HK!#~} Bye.'" -#: ../../whatsnew/3.3.rst:1010 +#: ../../whatsnew/3.3.rst:1012 msgid "" "This example gives ``b'~{Np~}~{J)~}~{l6~}~{HK~}~{!#~} Bye.'`` with older " "Python versions." msgstr "" -#: ../../whatsnew/3.3.rst:1013 +#: ../../whatsnew/3.3.rst:1015 msgid "(:issue:`12100`)" msgstr "(:issue:`12100`)" -#: ../../whatsnew/3.3.rst:1015 +#: ../../whatsnew/3.3.rst:1017 msgid "The ``unicode_internal`` codec has been deprecated." msgstr "``unicode_internal`` 編解碼器已被棄用。" -#: ../../whatsnew/3.3.rst:1019 +#: ../../whatsnew/3.3.rst:1021 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.3.rst:1021 +#: ../../whatsnew/3.3.rst:1023 msgid "" "Addition of a new :class:`~collections.ChainMap` class to allow treating a " "number of mappings as a single unit. (Written by Raymond Hettinger for :" "issue:`11089`, made public in :issue:`11297`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1025 +#: ../../whatsnew/3.3.rst:1027 msgid "" "The abstract base classes have been moved in a new :mod:`collections.abc` " "module, to better differentiate between the abstract and the concrete " @@ -1677,18 +1677,18 @@ msgid "" "`collections` module to preserve existing imports. (:issue:`11085`)" msgstr "" -#: ../../whatsnew/3.3.rst:1032 +#: ../../whatsnew/3.3.rst:1034 msgid "" "The :class:`~collections.Counter` class now supports the unary ``+`` and ``-" "`` operators, as well as the in-place operators ``+=``, ``-=``, ``|=``, and " "``&=``. (Contributed by Raymond Hettinger in :issue:`13121`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1038 +#: ../../whatsnew/3.3.rst:1040 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.3.rst:1040 +#: ../../whatsnew/3.3.rst:1042 msgid "" ":class:`~contextlib.ExitStack` now provides a solid foundation for " "programmatic manipulation of context managers and similar cleanup " @@ -1700,46 +1700,46 @@ msgid "" "module)." msgstr "" -#: ../../whatsnew/3.3.rst:1049 +#: ../../whatsnew/3.3.rst:1051 msgid "(:issue:`13585`)" msgstr "(:issue:`13585`)" -#: ../../whatsnew/3.3.rst:1053 +#: ../../whatsnew/3.3.rst:1055 msgid "crypt" msgstr "crypt" -#: ../../whatsnew/3.3.rst:1055 +#: ../../whatsnew/3.3.rst:1057 msgid "" "Addition of salt and modular crypt format (hashing method) and the :func:`!" "mksalt` function to the :mod:`!crypt` module." msgstr "" -#: ../../whatsnew/3.3.rst:1058 +#: ../../whatsnew/3.3.rst:1060 msgid "(:issue:`10924`)" msgstr "(:issue:`10924`)" -#: ../../whatsnew/3.3.rst:1061 +#: ../../whatsnew/3.3.rst:1063 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.3.rst:1063 +#: ../../whatsnew/3.3.rst:1065 msgid "" "If the :mod:`curses` module is linked to the ncursesw library, use Unicode " "functions when Unicode strings or characters are passed (e.g. :c:func:" "`waddwstr`), and bytes functions otherwise (e.g. :c:func:`waddstr`)." msgstr "" -#: ../../whatsnew/3.3.rst:1066 +#: ../../whatsnew/3.3.rst:1068 msgid "Use the locale encoding instead of ``utf-8`` to encode Unicode strings." msgstr "" -#: ../../whatsnew/3.3.rst:1067 +#: ../../whatsnew/3.3.rst:1069 msgid "" ":class:`curses.window` has a new :attr:`curses.window.encoding` attribute." msgstr "" ":class:`curses.window` 有一個新的 :attr:`curses.window.encoding` 屬性。" -#: ../../whatsnew/3.3.rst:1068 +#: ../../whatsnew/3.3.rst:1070 msgid "" "The :class:`curses.window` class has a new :meth:`~curses.window.get_wch` " "method to get a wide character" @@ -1747,59 +1747,59 @@ msgstr "" ":class:`curses.window` 類別有一個新的 :meth:`~curses.window.get_wch` 方法來獲" "取寬字元" -#: ../../whatsnew/3.3.rst:1070 +#: ../../whatsnew/3.3.rst:1072 msgid "" "The :mod:`curses` module has a new :meth:`~curses.unget_wch` function to " "push a wide character so the next :meth:`~curses.window.get_wch` will return " "it" msgstr "" -#: ../../whatsnew/3.3.rst:1074 +#: ../../whatsnew/3.3.rst:1076 msgid "(Contributed by Iñigo Serna in :issue:`6755`.)" msgstr "(由 Iñigo Serna 在 :issue:`6755` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1077 +#: ../../whatsnew/3.3.rst:1079 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.3.rst:1079 +#: ../../whatsnew/3.3.rst:1081 msgid "" "Equality comparisons between naive and aware :class:`~datetime.datetime` " "instances now return :const:`False` instead of raising :exc:`TypeError` (:" "issue:`15006`)." msgstr "" -#: ../../whatsnew/3.3.rst:1082 +#: ../../whatsnew/3.3.rst:1084 msgid "" "New :meth:`datetime.datetime.timestamp` method: Return POSIX timestamp " "corresponding to the :class:`~datetime.datetime` instance." msgstr "" -#: ../../whatsnew/3.3.rst:1084 +#: ../../whatsnew/3.3.rst:1086 msgid "" "The :meth:`datetime.datetime.strftime` method supports formatting years " "older than 1000." msgstr "" -#: ../../whatsnew/3.3.rst:1086 +#: ../../whatsnew/3.3.rst:1088 msgid "" "The :meth:`datetime.datetime.astimezone` method can now be called without " "arguments to convert datetime instance to the system timezone." msgstr "" -#: ../../whatsnew/3.3.rst:1094 +#: ../../whatsnew/3.3.rst:1096 msgid "decimal" msgstr "decimal" -#: ../../whatsnew/3.3.rst:1096 +#: ../../whatsnew/3.3.rst:1098 msgid ":issue:`7652` - integrate fast native decimal arithmetic." msgstr "" -#: ../../whatsnew/3.3.rst:1097 +#: ../../whatsnew/3.3.rst:1099 msgid "C-module and libmpdec written by Stefan Krah." msgstr "由 Stefan Krah 編寫的 C 模組和 libmpdec。" -#: ../../whatsnew/3.3.rst:1099 +#: ../../whatsnew/3.3.rst:1101 msgid "" "The new C version of the decimal module integrates the high speed libmpdec " "library for arbitrary precision correctly rounded decimal floating-point " @@ -1807,7 +1807,7 @@ msgid "" "Specification." msgstr "" -#: ../../whatsnew/3.3.rst:1103 +#: ../../whatsnew/3.3.rst:1105 msgid "" "Performance gains range from 10x for database applications to 100x for " "numerically intensive applications. These numbers are expected gains for " @@ -1816,128 +1816,128 @@ msgid "" "integer bignum arithmetic the differences can be significantly higher." msgstr "" -#: ../../whatsnew/3.3.rst:1109 +#: ../../whatsnew/3.3.rst:1111 msgid "" "The following table is meant as an illustration. Benchmarks are available at " "https://www.bytereef.org/mpdecimal/quickstart.html." msgstr "" -#: ../../whatsnew/3.3.rst:1113 +#: ../../whatsnew/3.3.rst:1115 msgid "decimal.py" msgstr "decimal.py" -#: ../../whatsnew/3.3.rst:1113 +#: ../../whatsnew/3.3.rst:1115 msgid "_decimal" msgstr "_decimal" -#: ../../whatsnew/3.3.rst:1113 +#: ../../whatsnew/3.3.rst:1115 msgid "speedup" msgstr "speedup" -#: ../../whatsnew/3.3.rst:1115 +#: ../../whatsnew/3.3.rst:1117 msgid "pi" msgstr "pi" -#: ../../whatsnew/3.3.rst:1115 +#: ../../whatsnew/3.3.rst:1117 msgid "42.02s" msgstr "42.02s" -#: ../../whatsnew/3.3.rst:1115 +#: ../../whatsnew/3.3.rst:1117 msgid "0.345s" msgstr "0.345s" -#: ../../whatsnew/3.3.rst:1115 +#: ../../whatsnew/3.3.rst:1117 msgid "120x" msgstr "120x" -#: ../../whatsnew/3.3.rst:1117 +#: ../../whatsnew/3.3.rst:1119 msgid "telco" msgstr "telco" -#: ../../whatsnew/3.3.rst:1117 +#: ../../whatsnew/3.3.rst:1119 msgid "172.19s" msgstr "172.19s" -#: ../../whatsnew/3.3.rst:1117 +#: ../../whatsnew/3.3.rst:1119 msgid "5.68s" msgstr "5.68s" -#: ../../whatsnew/3.3.rst:1117 +#: ../../whatsnew/3.3.rst:1119 msgid "30x" msgstr "30x" -#: ../../whatsnew/3.3.rst:1119 +#: ../../whatsnew/3.3.rst:1121 msgid "psycopg" msgstr "psycopg" -#: ../../whatsnew/3.3.rst:1119 +#: ../../whatsnew/3.3.rst:1121 msgid "3.57s" msgstr "3.57s" -#: ../../whatsnew/3.3.rst:1119 +#: ../../whatsnew/3.3.rst:1121 msgid "0.29s" msgstr "0.29s" -#: ../../whatsnew/3.3.rst:1119 +#: ../../whatsnew/3.3.rst:1121 msgid "12x" msgstr "12x" -#: ../../whatsnew/3.3.rst:1125 +#: ../../whatsnew/3.3.rst:1127 msgid "" "The :exc:`~decimal.FloatOperation` signal optionally enables stricter " "semantics for mixing floats and Decimals." msgstr "" -#: ../../whatsnew/3.3.rst:1128 +#: ../../whatsnew/3.3.rst:1130 msgid "" "If Python is compiled without threads, the C version automatically disables " "the expensive thread local context machinery. In this case, the variable :" "const:`~decimal.HAVE_THREADS` is set to ``False``." msgstr "" -#: ../../whatsnew/3.3.rst:1135 +#: ../../whatsnew/3.3.rst:1137 msgid "" "The C module has the following context limits, depending on the machine " "architecture:" msgstr "" -#: ../../whatsnew/3.3.rst:1139 +#: ../../whatsnew/3.3.rst:1141 msgid "32-bit" msgstr "32 位元" -#: ../../whatsnew/3.3.rst:1139 +#: ../../whatsnew/3.3.rst:1141 msgid "64-bit" msgstr "64 位元" -#: ../../whatsnew/3.3.rst:1141 +#: ../../whatsnew/3.3.rst:1143 msgid ":const:`MAX_PREC`" msgstr ":const:`MAX_PREC`" -#: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 +#: ../../whatsnew/3.3.rst:1143 ../../whatsnew/3.3.rst:1145 msgid "``425000000``" msgstr "``425000000``" -#: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 +#: ../../whatsnew/3.3.rst:1143 ../../whatsnew/3.3.rst:1145 msgid "``999999999999999999``" msgstr "``999999999999999999``" -#: ../../whatsnew/3.3.rst:1143 +#: ../../whatsnew/3.3.rst:1145 msgid ":const:`MAX_EMAX`" msgstr ":const:`MAX_EMAX`" -#: ../../whatsnew/3.3.rst:1145 +#: ../../whatsnew/3.3.rst:1147 msgid ":const:`MIN_EMIN`" msgstr ":const:`MIN_EMIN`" -#: ../../whatsnew/3.3.rst:1145 +#: ../../whatsnew/3.3.rst:1147 msgid "``-425000000``" msgstr "``-425000000``" -#: ../../whatsnew/3.3.rst:1145 +#: ../../whatsnew/3.3.rst:1147 msgid "``-999999999999999999``" msgstr "``-999999999999999999``" -#: ../../whatsnew/3.3.rst:1148 +#: ../../whatsnew/3.3.rst:1150 msgid "" "In the context templates (:class:`~decimal.DefaultContext`, :class:`~decimal." "BasicContext` and :class:`~decimal.ExtendedContext`) the magnitude of :attr:" @@ -1945,7 +1945,7 @@ msgid "" "``999999``." msgstr "" -#: ../../whatsnew/3.3.rst:1153 +#: ../../whatsnew/3.3.rst:1155 msgid "" "The :class:`~decimal.Decimal` constructor in decimal.py does not observe the " "context limits and converts values with arbitrary exponents or precision " @@ -1956,7 +1956,7 @@ msgid "" "obtain a rounded or inexact value." msgstr "" -#: ../../whatsnew/3.3.rst:1162 +#: ../../whatsnew/3.3.rst:1164 msgid "" "The power function in decimal.py is always correctly rounded. In the C " "version, it is defined in terms of the correctly rounded :meth:`~decimal." @@ -1964,7 +1964,7 @@ msgid "" "is only \"almost always correctly rounded\"." msgstr "" -#: ../../whatsnew/3.3.rst:1168 +#: ../../whatsnew/3.3.rst:1170 msgid "" "In the C version, the context dictionary containing the signals is a :class:" "`~collections.abc.MutableMapping`. For speed reasons, :attr:`~decimal." @@ -1975,33 +1975,33 @@ msgid "" "do not reference the RHS dictionary." msgstr "" -#: ../../whatsnew/3.3.rst:1178 +#: ../../whatsnew/3.3.rst:1180 msgid "" "Pickling a :class:`~decimal.Context` produces a different output in order to " "have a common interchange format for the Python and C versions." msgstr "" -#: ../../whatsnew/3.3.rst:1182 +#: ../../whatsnew/3.3.rst:1184 msgid "" "The order of arguments in the :class:`~decimal.Context` constructor has been " "changed to match the order displayed by :func:`repr`." msgstr "" -#: ../../whatsnew/3.3.rst:1186 +#: ../../whatsnew/3.3.rst:1188 msgid "" "The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method " "is deprecated." msgstr ":meth:`~decimal.Decimal.quantize` 方法中的 ``watchexp`` 參數已棄用。" -#: ../../whatsnew/3.3.rst:1193 +#: ../../whatsnew/3.3.rst:1195 msgid "email" msgstr "email" -#: ../../whatsnew/3.3.rst:1196 +#: ../../whatsnew/3.3.rst:1198 msgid "Policy Framework" msgstr "" -#: ../../whatsnew/3.3.rst:1198 +#: ../../whatsnew/3.3.rst:1200 msgid "" "The email package now has a :mod:`~email.policy` framework. A :class:" "`~email.policy.Policy` is an object with several methods and properties that " @@ -2017,52 +2017,52 @@ msgid "" "data:`~email.policy.compat32`." msgstr "" -#: ../../whatsnew/3.3.rst:1211 +#: ../../whatsnew/3.3.rst:1213 msgid "The minimum set of controls implemented by all ``policy`` objects are:" msgstr "" -#: ../../whatsnew/3.3.rst:1216 +#: ../../whatsnew/3.3.rst:1218 msgid "max_line_length" msgstr "max_line_length" -#: ../../whatsnew/3.3.rst:1216 +#: ../../whatsnew/3.3.rst:1218 msgid "" "The maximum length, excluding the linesep character(s), individual lines may " "have when a ``Message`` is serialized. Defaults to 78." msgstr "" -#: ../../whatsnew/3.3.rst:1220 +#: ../../whatsnew/3.3.rst:1222 msgid "linesep" msgstr "linesep" -#: ../../whatsnew/3.3.rst:1220 +#: ../../whatsnew/3.3.rst:1222 msgid "" "The character used to separate individual lines when a ``Message`` is " "serialized. Defaults to ``\\n``." msgstr "" -#: ../../whatsnew/3.3.rst:1223 +#: ../../whatsnew/3.3.rst:1225 msgid "cte_type" msgstr "cte_type" -#: ../../whatsnew/3.3.rst:1223 +#: ../../whatsnew/3.3.rst:1225 msgid "" "``7bit`` or ``8bit``. ``8bit`` applies only to a ``Bytes`` ``generator``, " "and means that non-ASCII may be used where allowed by the protocol (or where " "it exists in the original input)." msgstr "" -#: ../../whatsnew/3.3.rst:1228 +#: ../../whatsnew/3.3.rst:1230 msgid "raise_on_defect" msgstr "raise_on_defect" -#: ../../whatsnew/3.3.rst:1228 +#: ../../whatsnew/3.3.rst:1230 msgid "" "Causes a ``parser`` to raise error when defects are encountered instead of " "adding them to the ``Message`` object's ``defects`` list." msgstr "" -#: ../../whatsnew/3.3.rst:1233 +#: ../../whatsnew/3.3.rst:1235 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 " @@ -2071,11 +2071,11 @@ msgid "" "``\\r\\n`` linesep characters like this::" msgstr "" -#: ../../whatsnew/3.3.rst:1239 +#: ../../whatsnew/3.3.rst:1241 msgid "mypolicy = compat32.clone(linesep='\\r\\n')" msgstr "mypolicy = compat32.clone(linesep='\\r\\n')" -#: ../../whatsnew/3.3.rst:1241 +#: ../../whatsnew/3.3.rst:1243 msgid "" "Policies can be used to make the generation of messages in the format needed " "by your application simpler. Instead of having to remember to specify " @@ -2088,11 +2088,11 @@ msgid "" "when you create the ``generator``." msgstr "" -#: ../../whatsnew/3.3.rst:1253 +#: ../../whatsnew/3.3.rst:1255 msgid "Provisional Policy with New Header API" msgstr "" -#: ../../whatsnew/3.3.rst:1255 +#: ../../whatsnew/3.3.rst:1257 msgid "" "While the policy framework is worthwhile all by itself, the main motivation " "for introducing it is to allow the creation of new policies that implement " @@ -2104,17 +2104,17 @@ msgid "" "the core developers." msgstr "" -#: ../../whatsnew/3.3.rst:1263 +#: ../../whatsnew/3.3.rst:1265 msgid "" "The new policies are instances of :class:`~email.policy.EmailPolicy`, and " "add the following additional controls:" msgstr "" -#: ../../whatsnew/3.3.rst:1269 +#: ../../whatsnew/3.3.rst:1271 msgid "refold_source" msgstr "refold_source" -#: ../../whatsnew/3.3.rst:1269 +#: ../../whatsnew/3.3.rst:1271 msgid "" "Controls whether or not headers parsed by a :mod:`~email.parser` are " "refolded by the :mod:`~email.generator`. It can be ``none``, ``long``, or " @@ -2123,17 +2123,17 @@ msgid "" "get refolded, and ``all`` means that all lines get refolded." msgstr "" -#: ../../whatsnew/3.3.rst:1278 +#: ../../whatsnew/3.3.rst:1280 msgid "header_factory" msgstr "header_factory" -#: ../../whatsnew/3.3.rst:1278 +#: ../../whatsnew/3.3.rst:1280 msgid "" "A callable that take a ``name`` and ``value`` and produces a custom header " "object." msgstr "" -#: ../../whatsnew/3.3.rst:1282 +#: ../../whatsnew/3.3.rst:1284 msgid "" "The ``header_factory`` is the key to the new features provided by the new " "policies. When one of the new policies is used, any header retrieved from a " @@ -2145,7 +2145,7 @@ msgid "" "now do things like this::" msgstr "" -#: ../../whatsnew/3.3.rst:1291 +#: ../../whatsnew/3.3.rst:1293 msgid "" ">>> m = Message(policy=SMTP)\n" ">>> m['To'] = 'Éric '\n" @@ -2187,7 +2187,7 @@ msgstr "" "To: =?utf-8?q?=C3=89ric?= \n" "Date: Fri, 25 May 2012 21:44:27 -0400" -#: ../../whatsnew/3.3.rst:1310 +#: ../../whatsnew/3.3.rst:1312 msgid "" "You will note that the unicode display name is automatically encoded as " "``utf-8`` when the message is serialized, but that when the header is " @@ -2196,11 +2196,11 @@ msgid "" "meth:`~email.header.make_header` functions." msgstr "" -#: ../../whatsnew/3.3.rst:1316 +#: ../../whatsnew/3.3.rst:1318 msgid "You can also create addresses from parts::" msgstr "" -#: ../../whatsnew/3.3.rst:1318 +#: ../../whatsnew/3.3.rst:1320 msgid "" ">>> m['cc'] = [Group('pals', [Address('Bob', 'bob', 'example.com'),\n" "... Address('Sally', 'sally', 'example.com')]),\n" @@ -2212,25 +2212,25 @@ msgid "" "" msgstr "" -#: ../../whatsnew/3.3.rst:1326 +#: ../../whatsnew/3.3.rst:1328 msgid "Decoding to unicode is done automatically::" msgstr "解碼為 unicode 是自動完成的: ::" -#: ../../whatsnew/3.3.rst:1328 +#: ../../whatsnew/3.3.rst:1330 msgid "" ">>> m2 = message_from_string(str(m))\n" ">>> m2['to']\n" "'Éric '" msgstr "" -#: ../../whatsnew/3.3.rst:1332 +#: ../../whatsnew/3.3.rst:1334 msgid "" "When you parse a message, you can use the ``addresses`` and ``groups`` " "attributes of the header objects to access the groups and individual " "addresses::" msgstr "" -#: ../../whatsnew/3.3.rst:1336 +#: ../../whatsnew/3.3.rst:1338 msgid "" ">>> m2['cc'].addresses\n" "(Address(display_name='Bob', username='bob', domain='example.com'), " @@ -2254,7 +2254,7 @@ msgstr "" "addresses=(Address(display_name='Bonzo', username='bonz', domain='laugh." "com'),))" -#: ../../whatsnew/3.3.rst:1341 +#: ../../whatsnew/3.3.rst:1343 msgid "" "In summary, if you use one of the new policies, header manipulation works " "the way it ought to: your application works with unicode strings, and the " @@ -2262,35 +2262,35 @@ msgid "" "RFC standard Content Transfer Encodings." msgstr "" -#: ../../whatsnew/3.3.rst:1347 +#: ../../whatsnew/3.3.rst:1349 msgid "Other API Changes" msgstr "其他 API 變更" -#: ../../whatsnew/3.3.rst:1349 +#: ../../whatsnew/3.3.rst:1351 msgid "" "New :class:`~email.parser.BytesHeaderParser`, added to the :mod:`~email." "parser` module to complement :class:`~email.parser.HeaderParser` and " "complete the Bytes API." msgstr "" -#: ../../whatsnew/3.3.rst:1353 +#: ../../whatsnew/3.3.rst:1355 msgid "New utility functions:" msgstr "新工具函式:" -#: ../../whatsnew/3.3.rst:1355 +#: ../../whatsnew/3.3.rst:1357 msgid "" ":func:`~email.utils.format_datetime`: given a :class:`~datetime.datetime`, " "produce a string formatted for use in an email header." msgstr "" -#: ../../whatsnew/3.3.rst:1358 +#: ../../whatsnew/3.3.rst:1360 msgid "" ":func:`~email.utils.parsedate_to_datetime`: given a date string from an " "email header, convert it into an aware :class:`~datetime.datetime`, or a " "naive :class:`~datetime.datetime` if the offset is ``-0000``." msgstr "" -#: ../../whatsnew/3.3.rst:1362 +#: ../../whatsnew/3.3.rst:1364 msgid "" ":func:`~email.utils.localtime`: With no argument, returns the current local " "time as an aware :class:`~datetime.datetime` using the local :class:" @@ -2299,11 +2299,11 @@ msgid "" "`~datetime.timezone`." msgstr "" -#: ../../whatsnew/3.3.rst:1370 +#: ../../whatsnew/3.3.rst:1372 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.3.rst:1372 +#: ../../whatsnew/3.3.rst:1374 msgid "" ":class:`ftplib.FTP` now accepts a ``source_address`` keyword argument to " "specify the ``(host, port)`` to use as the source address in the bind call " @@ -2311,7 +2311,7 @@ msgid "" "issue:`8594`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1377 +#: ../../whatsnew/3.3.rst:1379 msgid "" "The :class:`~ftplib.FTP_TLS` class now provides a new :func:`~ftplib.FTP_TLS." "ccc` function to revert control channel back to plaintext. This can be " @@ -2320,18 +2320,18 @@ msgid "" "in :issue:`12139`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1383 +#: ../../whatsnew/3.3.rst:1385 msgid "" "Added :meth:`ftplib.FTP.mlsd` method which provides a parsable directory " "listing format and deprecates :meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP." "dir`. (Contributed by Giampaolo Rodolà in :issue:`11072`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1389 +#: ../../whatsnew/3.3.rst:1391 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.3.rst:1391 +#: ../../whatsnew/3.3.rst:1393 msgid "" "The :func:`functools.lru_cache` decorator now accepts a ``typed`` keyword " "argument (that defaults to ``False`` to ensure that it caches values of " @@ -2339,32 +2339,32 @@ msgid "" "Raymond Hettinger in :issue:`13227`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1398 +#: ../../whatsnew/3.3.rst:1400 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.3.rst:1400 +#: ../../whatsnew/3.3.rst:1402 msgid "" "It is now possible to register callbacks invoked by the garbage collector " "before and after collection using the new :data:`~gc.callbacks` list." msgstr "" -#: ../../whatsnew/3.3.rst:1405 +#: ../../whatsnew/3.3.rst:1407 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.3.rst:1407 +#: ../../whatsnew/3.3.rst:1409 msgid "" "A new :func:`~hmac.compare_digest` function has been added to prevent side " "channel attacks on digests through timing analysis. (Contributed by Nick " "Coghlan and Christian Heimes in :issue:`15061`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1413 +#: ../../whatsnew/3.3.rst:1415 msgid "http" msgstr "http" -#: ../../whatsnew/3.3.rst:1415 +#: ../../whatsnew/3.3.rst:1417 msgid "" ":class:`http.server.BaseHTTPRequestHandler` now buffers the headers and " "writes them all at once when :meth:`~http.server.BaseHTTPRequestHandler." @@ -2374,24 +2374,24 @@ msgid "" "`3709`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1421 +#: ../../whatsnew/3.3.rst:1423 msgid "" ":class:`http.server` now produces valid ``HTML 4.01 strict`` output. " "(Contributed by Ezio Melotti in :issue:`13295`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1424 +#: ../../whatsnew/3.3.rst:1426 msgid "" ":class:`http.client.HTTPResponse` now has a :meth:`~http.client.HTTPResponse." "readinto` method, which means it can be used as an :class:`io.RawIOBase` " "class. (Contributed by John Kuhn in :issue:`13464`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1431 +#: ../../whatsnew/3.3.rst:1433 msgid "html" msgstr "html" -#: ../../whatsnew/3.3.rst:1433 +#: ../../whatsnew/3.3.rst:1435 msgid "" ":class:`html.parser.HTMLParser` is now able to parse broken markup without " "raising errors, therefore the *strict* argument of the constructor and the :" @@ -2404,7 +2404,7 @@ msgid "" "`12888`, :issue:`7311`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1443 +#: ../../whatsnew/3.3.rst:1445 msgid "" "A new :data:`~html.entities.html5` dictionary that maps HTML5 named " "character references to the equivalent Unicode character(s) (e.g. " @@ -2413,25 +2413,25 @@ msgid "" "(Contributed by Ezio Melotti in :issue:`11113` and :issue:`15156`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1451 +#: ../../whatsnew/3.3.rst:1453 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.3.rst:1453 +#: ../../whatsnew/3.3.rst:1455 msgid "" "The :class:`~imaplib.IMAP4_SSL` constructor now accepts an SSLContext " "parameter to control parameters of the secure channel." msgstr "" -#: ../../whatsnew/3.3.rst:1456 +#: ../../whatsnew/3.3.rst:1458 msgid "(Contributed by Sijin Joseph in :issue:`8808`.)" msgstr "(由 Sijin Joseph 在 :issue:`8808` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1460 +#: ../../whatsnew/3.3.rst:1462 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.3.rst:1462 +#: ../../whatsnew/3.3.rst:1464 msgid "" "A new :func:`~inspect.getclosurevars` function has been added. This function " "reports the current binding of all names referenced from the function body " @@ -2439,11 +2439,11 @@ msgid "" "internal state when testing code that relies on stateful closures." msgstr "" -#: ../../whatsnew/3.3.rst:1467 +#: ../../whatsnew/3.3.rst:1469 msgid "(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`.)" msgstr "(由 Meador Inge 與 Nick Coghlan 在 :issue:`13062` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1469 +#: ../../whatsnew/3.3.rst:1471 msgid "" "A new :func:`~inspect.getgeneratorlocals` function has been added. This " "function reports the current binding of local variables in the generator's " @@ -2451,26 +2451,26 @@ msgid "" "generators." msgstr "" -#: ../../whatsnew/3.3.rst:1474 +#: ../../whatsnew/3.3.rst:1476 msgid "(Contributed by Meador Inge in :issue:`15153`.)" msgstr "(由 Meador Inge 於 :issue:`15153` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1477 +#: ../../whatsnew/3.3.rst:1479 msgid "io" msgstr "io" -#: ../../whatsnew/3.3.rst:1479 +#: ../../whatsnew/3.3.rst:1481 msgid "" "The :func:`~io.open` function has a new ``'x'`` mode that can be used to " "exclusively create a new file, and raise a :exc:`FileExistsError` if the " "file already exists. It is based on the C11 'x' mode to fopen()." msgstr "" -#: ../../whatsnew/3.3.rst:1483 +#: ../../whatsnew/3.3.rst:1485 msgid "(Contributed by David Townshend in :issue:`12760`.)" msgstr "(由 David Townshend 於 :issue:`12760` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1485 +#: ../../whatsnew/3.3.rst:1487 msgid "" "The constructor of the :class:`~io.TextIOWrapper` class has a new " "*write_through* optional argument. If *write_through* is ``True``, calls to :" @@ -2479,28 +2479,28 @@ msgid "" "its underlying binary buffer." msgstr "" -#: ../../whatsnew/3.3.rst:1493 +#: ../../whatsnew/3.3.rst:1495 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.3.rst:1495 +#: ../../whatsnew/3.3.rst:1497 msgid "" ":func:`~itertools.accumulate` now takes an optional ``func`` argument for " "providing a user-supplied binary function." msgstr "" -#: ../../whatsnew/3.3.rst:1500 +#: ../../whatsnew/3.3.rst:1502 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.3.rst:1502 +#: ../../whatsnew/3.3.rst:1504 msgid "" "The :func:`~logging.basicConfig` function now supports an optional " "``handlers`` argument taking an iterable of handlers to be added to the root " "logger." msgstr "" -#: ../../whatsnew/3.3.rst:1505 +#: ../../whatsnew/3.3.rst:1507 msgid "" "A class level attribute :attr:`~logging.handlers.SysLogHandler.append_nul` " "has been added to :class:`~logging.handlers.SysLogHandler` to allow control " @@ -2509,25 +2509,25 @@ msgid "" "log." msgstr "" -#: ../../whatsnew/3.3.rst:1513 +#: ../../whatsnew/3.3.rst:1515 msgid "math" msgstr "math" -#: ../../whatsnew/3.3.rst:1515 +#: ../../whatsnew/3.3.rst:1517 msgid "" "The :mod:`math` module has a new function, :func:`~math.log2`, which " "returns the base-2 logarithm of *x*." msgstr "" -#: ../../whatsnew/3.3.rst:1518 +#: ../../whatsnew/3.3.rst:1520 msgid "(Written by Mark Dickinson in :issue:`11888`.)" msgstr "(由 Mark Dickinson 於 :issue:`11888` 中撰寫)" -#: ../../whatsnew/3.3.rst:1522 +#: ../../whatsnew/3.3.rst:1524 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.3.rst:1524 +#: ../../whatsnew/3.3.rst:1526 msgid "" "The :meth:`~mmap.mmap.read` method is now more compatible with other file-" "like objects: if the argument is omitted or specified as ``None``, it " @@ -2535,39 +2535,39 @@ msgid "" "(Contributed by Petri Lehtinen in :issue:`12021`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1531 +#: ../../whatsnew/3.3.rst:1533 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.3.rst:1533 +#: ../../whatsnew/3.3.rst:1535 msgid "" "The new :func:`multiprocessing.connection.wait` function allows polling " "multiple objects (such as connections, sockets and pipes) with a timeout. " "(Contributed by Richard Oudkerk in :issue:`12328`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1537 +#: ../../whatsnew/3.3.rst:1539 msgid "" ":class:`multiprocessing.Connection` objects can now be transferred over " "multiprocessing connections. (Contributed by Richard Oudkerk in :issue:" "`4892`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1541 +#: ../../whatsnew/3.3.rst:1543 msgid "" ":class:`multiprocessing.Process` now accepts a ``daemon`` keyword argument " "to override the default behavior of inheriting the ``daemon`` flag from the " "parent process (:issue:`6064`)." msgstr "" -#: ../../whatsnew/3.3.rst:1545 +#: ../../whatsnew/3.3.rst:1547 msgid "" "New attribute :data:`multiprocessing.Process.sentinel` allows a program to " "wait on multiple :class:`~multiprocessing.Process` objects at one time using " "the appropriate OS primitives (for example, :mod:`select` on posix systems)." msgstr "" -#: ../../whatsnew/3.3.rst:1550 +#: ../../whatsnew/3.3.rst:1552 msgid "" "New methods :meth:`multiprocessing.pool.Pool.starmap` and :meth:" "`~multiprocessing.pool.Pool.starmap_async` provide :func:`itertools.starmap` " @@ -2576,18 +2576,18 @@ msgid "" "Schlawack in :issue:`12708`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1559 +#: ../../whatsnew/3.3.rst:1561 msgid "nntplib" msgstr "nntplib" -#: ../../whatsnew/3.3.rst:1561 +#: ../../whatsnew/3.3.rst:1563 msgid "" "The :class:`!nntplib.NNTP` class now supports the context management " "protocol to unconditionally consume :exc:`socket.error` exceptions and to " "close the NNTP connection when done::" msgstr "" -#: ../../whatsnew/3.3.rst:1565 +#: ../../whatsnew/3.3.rst:1567 msgid "" ">>> from nntplib import NNTP\n" ">>> with NNTP('news.gmane.org') as n:\n" @@ -2605,15 +2605,15 @@ msgstr "" "python.committers')\n" ">>>" -#: ../../whatsnew/3.3.rst:1572 +#: ../../whatsnew/3.3.rst:1574 msgid "(Contributed by Giampaolo Rodolà in :issue:`9795`.)" msgstr "(由 Giampaolo Rodolà 於 :issue:`9795` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1576 +#: ../../whatsnew/3.3.rst:1578 msgid "os" msgstr "os" -#: ../../whatsnew/3.3.rst:1578 +#: ../../whatsnew/3.3.rst:1580 msgid "" "The :mod:`os` module has a new :func:`~os.pipe2` function that makes it " "possible to create a pipe with :const:`~os.O_CLOEXEC` or :const:`~os." @@ -2621,7 +2621,7 @@ msgid "" "conditions in multi-threaded programs." msgstr "" -#: ../../whatsnew/3.3.rst:1583 +#: ../../whatsnew/3.3.rst:1585 msgid "" "The :mod:`os` module has a new :func:`~os.sendfile` function which provides " "an efficient \"zero-copy\" way for copying data from one file (or socket) " @@ -2632,12 +2632,12 @@ msgid "" "socket, e.g. for downloading a file." msgstr "" -#: ../../whatsnew/3.3.rst:1591 +#: ../../whatsnew/3.3.rst:1593 msgid "" "(Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)" msgstr "(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" -#: ../../whatsnew/3.3.rst:1593 +#: ../../whatsnew/3.3.rst:1595 msgid "" "To avoid race conditions like symlink attacks and issues with temporary " "files and directories, it is more reliable (and also faster) to manipulate " @@ -2646,14 +2646,14 @@ msgid "" "`4761`, :issue:`10755` and :issue:`14626`)." msgstr "" -#: ../../whatsnew/3.3.rst:1599 +#: ../../whatsnew/3.3.rst:1601 msgid "" "The :mod:`os` module has a new :func:`~os.fwalk` function similar to :func:" "`~os.walk` except that it also yields file descriptors referring to the " "directories visited. This is especially useful to avoid symlink races." msgstr "" -#: ../../whatsnew/3.3.rst:1603 +#: ../../whatsnew/3.3.rst:1605 msgid "" "The following functions get new optional *dir_fd* (:ref:`paths relative to " "directory descriptors `) and/or *follow_symlinks* (:ref:`not " @@ -2667,7 +2667,7 @@ msgid "" "`os.supports_follows_symlinks`." msgstr "" -#: ../../whatsnew/3.3.rst:1614 +#: ../../whatsnew/3.3.rst:1616 msgid "" "The following functions now support a file descriptor for their path " "argument: :func:`~os.chdir`, :func:`~os.chmod`, :func:`~os.chown`, :func:" @@ -2676,7 +2676,7 @@ msgid "" "support for this can be checked via the :data:`os.supports_fd` set." msgstr "" -#: ../../whatsnew/3.3.rst:1620 +#: ../../whatsnew/3.3.rst:1622 msgid "" ":func:`~os.access` accepts an ``effective_ids`` keyword argument to turn on " "using the effective uid/gid rather than the real uid/gid in the access " @@ -2684,7 +2684,7 @@ msgid "" "supports_effective_ids` set." msgstr "" -#: ../../whatsnew/3.3.rst:1625 +#: ../../whatsnew/3.3.rst:1627 msgid "" "The :mod:`os` module has two new functions: :func:`~os.getpriority` and :" "func:`~os.setpriority`. They can be used to get or set process niceness/" @@ -2692,11 +2692,11 @@ msgid "" "processes instead of just the current one." msgstr "" -#: ../../whatsnew/3.3.rst:1630 +#: ../../whatsnew/3.3.rst:1632 msgid "(Patch submitted by Giampaolo Rodolà in :issue:`10784`.)" msgstr "(由 Giampaolo Rodolà 於 :issue:`10784` 提交補丁。)" -#: ../../whatsnew/3.3.rst:1632 +#: ../../whatsnew/3.3.rst:1634 msgid "" "The new :func:`os.replace` function allows cross-platform renaming of a file " "with overwriting the destination. With :func:`os.rename`, an existing " @@ -2704,7 +2704,7 @@ msgid "" "Windows. (Contributed by Antoine Pitrou in :issue:`8828`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1638 +#: ../../whatsnew/3.3.rst:1640 msgid "" "The stat family of functions (:func:`~os.stat`, :func:`~os.fstat`, and :func:" "`~os.lstat`) now support reading a file's timestamps with nanosecond " @@ -2713,7 +2713,7 @@ msgid "" "`14127`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1644 +#: ../../whatsnew/3.3.rst:1646 msgid "" "The new :func:`os.get_terminal_size` function queries the size of the " "terminal attached to a file descriptor. See also :func:`shutil." @@ -2721,14 +2721,14 @@ msgid "" "`13609`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1651 +#: ../../whatsnew/3.3.rst:1653 msgid "" "New functions to support Linux extended attributes (:issue:`12720`): :func:" "`~os.getxattr`, :func:`~os.listxattr`, :func:`~os.removexattr`, :func:`~os." "setxattr`." msgstr "" -#: ../../whatsnew/3.3.rst:1655 +#: ../../whatsnew/3.3.rst:1657 msgid "" "New interface to the scheduler. These functions control how a process is " "allocated CPU time by the operating system. New functions: :func:`~os." @@ -2739,90 +2739,90 @@ msgid "" "sched_setscheduler`, :func:`~os.sched_yield`," msgstr "" -#: ../../whatsnew/3.3.rst:1664 +#: ../../whatsnew/3.3.rst:1666 msgid "New functions to control the file system:" msgstr "" -#: ../../whatsnew/3.3.rst:1666 +#: ../../whatsnew/3.3.rst:1668 msgid "" ":func:`~os.posix_fadvise`: Announces an intention to access data in a " "specific pattern thus allowing the kernel to make optimizations." msgstr "" -#: ../../whatsnew/3.3.rst:1668 +#: ../../whatsnew/3.3.rst:1670 msgid "" ":func:`~os.posix_fallocate`: Ensures that enough disk space is allocated for " "a file." msgstr "" -#: ../../whatsnew/3.3.rst:1670 +#: ../../whatsnew/3.3.rst:1672 msgid ":func:`~os.sync`: Force write of everything to disk." msgstr "" -#: ../../whatsnew/3.3.rst:1672 +#: ../../whatsnew/3.3.rst:1674 msgid "Additional new posix functions:" msgstr "其他新的 posix 函式:" -#: ../../whatsnew/3.3.rst:1674 +#: ../../whatsnew/3.3.rst:1676 msgid "" ":func:`~os.lockf`: Apply, test or remove a POSIX lock on an open file " "descriptor." msgstr "" -#: ../../whatsnew/3.3.rst:1675 +#: ../../whatsnew/3.3.rst:1677 msgid "" ":func:`~os.pread`: Read from a file descriptor at an offset, the file offset " "remains unchanged." msgstr "" -#: ../../whatsnew/3.3.rst:1677 +#: ../../whatsnew/3.3.rst:1679 msgid "" ":func:`~os.pwrite`: Write to a file descriptor from an offset, leaving the " "file offset unchanged." msgstr "" -#: ../../whatsnew/3.3.rst:1679 +#: ../../whatsnew/3.3.rst:1681 msgid "" ":func:`~os.readv`: Read from a file descriptor into a number of writable " "buffers." msgstr "" -#: ../../whatsnew/3.3.rst:1680 +#: ../../whatsnew/3.3.rst:1682 msgid "" ":func:`~os.truncate`: Truncate the file corresponding to *path*, so that it " "is at most *length* bytes in size." msgstr "" -#: ../../whatsnew/3.3.rst:1682 +#: ../../whatsnew/3.3.rst:1684 msgid "" ":func:`~os.waitid`: Wait for the completion of one or more child processes." msgstr "" -#: ../../whatsnew/3.3.rst:1683 +#: ../../whatsnew/3.3.rst:1685 msgid "" ":func:`~os.writev`: Write the contents of *buffers* to a file descriptor, " "where *buffers* is an arbitrary sequence of buffers." msgstr "" -#: ../../whatsnew/3.3.rst:1685 +#: ../../whatsnew/3.3.rst:1687 msgid "" ":func:`~os.getgrouplist` (:issue:`9344`): Return list of group ids that " "specified user belongs to." msgstr "" -#: ../../whatsnew/3.3.rst:1688 +#: ../../whatsnew/3.3.rst:1690 msgid "" ":func:`~os.times` and :func:`~os.uname`: Return type changed from a tuple to " "a tuple-like object with named attributes." msgstr "" -#: ../../whatsnew/3.3.rst:1691 +#: ../../whatsnew/3.3.rst:1693 msgid "" "Some platforms now support additional constants for the :func:`~os.lseek` " "function, such as ``os.SEEK_HOLE`` and ``os.SEEK_DATA``." msgstr "" -#: ../../whatsnew/3.3.rst:1694 +#: ../../whatsnew/3.3.rst:1696 msgid "" "New constants :const:`~os.RTLD_LAZY`, :const:`~os.RTLD_NOW`, :const:`~os." "RTLD_GLOBAL`, :const:`~os.RTLD_LOCAL`, :const:`~os.RTLD_NODELETE`, :const:" @@ -2832,70 +2832,70 @@ msgid "" "mod:`DLFCN`. (Contributed by Victor Stinner in :issue:`13226`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1702 +#: ../../whatsnew/3.3.rst:1704 msgid "" ":func:`os.symlink` now accepts (and ignores) the ``target_is_directory`` " "keyword argument on non-Windows platforms, to ease cross-platform support." msgstr "" -#: ../../whatsnew/3.3.rst:1707 +#: ../../whatsnew/3.3.rst:1709 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.3.rst:1709 +#: ../../whatsnew/3.3.rst:1711 msgid "" "Tab-completion is now available not only for command names, but also their " "arguments. For example, for the ``break`` command, function and file names " "are completed." msgstr "" -#: ../../whatsnew/3.3.rst:1713 +#: ../../whatsnew/3.3.rst:1715 msgid "(Contributed by Georg Brandl in :issue:`14210`)" msgstr "(由 Georg Brandl 在 :issue:`14210` 中貢獻)" -#: ../../whatsnew/3.3.rst:1717 +#: ../../whatsnew/3.3.rst:1719 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.3.rst:1719 +#: ../../whatsnew/3.3.rst:1721 msgid "" ":class:`pickle.Pickler` objects now have an optional :attr:`~pickle.Pickler." "dispatch_table` attribute allowing per-pickler reduction functions to be set." msgstr "" -#: ../../whatsnew/3.3.rst:1723 +#: ../../whatsnew/3.3.rst:1725 msgid "(Contributed by Richard Oudkerk in :issue:`14166`.)" msgstr "(由 Richard Oudkerk 在 :issue:`14166` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1727 +#: ../../whatsnew/3.3.rst:1729 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.3.rst:1729 +#: ../../whatsnew/3.3.rst:1731 msgid "" "The Tk GUI and the :func:`~pydoc.serve` function have been removed from the :" "mod:`pydoc` module: ``pydoc -g`` and :func:`~pydoc.serve` have been " "deprecated in Python 3.2." msgstr "" -#: ../../whatsnew/3.3.rst:1735 +#: ../../whatsnew/3.3.rst:1737 msgid "re" msgstr "re" -#: ../../whatsnew/3.3.rst:1737 +#: ../../whatsnew/3.3.rst:1739 msgid "" ":class:`str` regular expressions now support ``\\u`` and ``\\U`` escapes." msgstr "" -#: ../../whatsnew/3.3.rst:1739 +#: ../../whatsnew/3.3.rst:1741 msgid "(Contributed by Serhiy Storchaka in :issue:`3665`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`3665` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1743 +#: ../../whatsnew/3.3.rst:1745 msgid "sched" msgstr "sched" -#: ../../whatsnew/3.3.rst:1745 +#: ../../whatsnew/3.3.rst:1747 msgid "" ":meth:`~sched.scheduler.run` now accepts a *blocking* parameter which when " "set to false makes the method execute the scheduled events due to expire " @@ -2904,21 +2904,21 @@ msgid "" "(Contributed by Giampaolo Rodolà in :issue:`13449`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1751 +#: ../../whatsnew/3.3.rst:1753 msgid "" ":class:`~sched.scheduler` class can now be safely used in multi-threaded " "environments. (Contributed by Josiah Carlson and Giampaolo Rodolà in :issue:" "`8684`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1755 +#: ../../whatsnew/3.3.rst:1757 msgid "" "*timefunc* and *delayfunct* parameters of :class:`~sched.scheduler` class " "constructor are now optional and defaults to :func:`time.time` and :func:" "`time.sleep` respectively. (Contributed by Chris Clark in :issue:`13245`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1760 +#: ../../whatsnew/3.3.rst:1762 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` " "*argument* parameter is now optional. (Contributed by Chris Clark in :issue:" @@ -2927,7 +2927,7 @@ msgstr "" ":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` " "*argument* 參數現在是可選的。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1764 +#: ../../whatsnew/3.3.rst:1766 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` now " "accept a *kwargs* parameter. (Contributed by Chris Clark in :issue:`13245`.)" @@ -2935,22 +2935,22 @@ msgstr "" ":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` 現在接受 " "*kwargs* 參數。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1770 +#: ../../whatsnew/3.3.rst:1772 msgid "select" msgstr "select" -#: ../../whatsnew/3.3.rst:1772 +#: ../../whatsnew/3.3.rst:1774 msgid "" "Solaris and derivative platforms have a new class :class:`select.devpoll` " "for high performance asynchronous sockets via :file:`/dev/poll`. " "(Contributed by Jesús Cea Avión in :issue:`6397`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1778 +#: ../../whatsnew/3.3.rst:1780 msgid "shlex" msgstr "shlex" -#: ../../whatsnew/3.3.rst:1780 +#: ../../whatsnew/3.3.rst:1782 msgid "" "The previously undocumented helper function ``quote`` from the :mod:`!pipes` " "modules has been moved to the :mod:`shlex` module and documented. :func:" @@ -2958,35 +2958,35 @@ msgid "" "otherwise given special meaning by the shell." msgstr "" -#: ../../whatsnew/3.3.rst:1787 +#: ../../whatsnew/3.3.rst:1789 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.3.rst:1789 +#: ../../whatsnew/3.3.rst:1791 msgid "New functions:" msgstr "新功能:" -#: ../../whatsnew/3.3.rst:1791 +#: ../../whatsnew/3.3.rst:1793 msgid "" ":func:`~shutil.disk_usage`: provides total, used and free disk space " "statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1793 +#: ../../whatsnew/3.3.rst:1795 msgid "" ":func:`~shutil.chown`: allows one to change user and/or group of the given " "path also specifying the user/group names and not only their numeric ids. " "(Contributed by Sandro Tosi in :issue:`12191`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1796 +#: ../../whatsnew/3.3.rst:1798 msgid "" ":func:`shutil.get_terminal_size`: returns the size of the terminal window to " "which the interpreter is attached. (Contributed by Zbigniew Jędrzejewski-" "Szmek in :issue:`13609`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1800 +#: ../../whatsnew/3.3.rst:1802 msgid "" ":func:`~shutil.copy2` and :func:`~shutil.copystat` now preserve file " "timestamps with nanosecond precision on platforms that support it. They also " @@ -2994,7 +2994,7 @@ msgid "" "Hastings in :issue:`14127` and :issue:`15238`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1805 +#: ../../whatsnew/3.3.rst:1807 msgid "" "Several functions now take an optional ``symlinks`` argument: when that " "parameter is true, symlinks aren't dereferenced and the operation instead " @@ -3002,7 +3002,7 @@ msgid "" "Hynek Schlawack in :issue:`12715`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1810 +#: ../../whatsnew/3.3.rst:1812 msgid "" "When copying files to a different file system, :func:`~shutil.move` now " "handles symlinks the way the posix ``mv`` command does, recreating the " @@ -3011,7 +3011,7 @@ msgid "" "the ``dst`` argument as its result." msgstr "" -#: ../../whatsnew/3.3.rst:1816 +#: ../../whatsnew/3.3.rst:1818 msgid "" ":func:`~shutil.rmtree` is now resistant to symlink attacks on platforms " "which support the new ``dir_fd`` parameter in :func:`os.open` and :func:`os." @@ -3019,53 +3019,53 @@ msgid "" "`4489`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1823 +#: ../../whatsnew/3.3.rst:1825 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.3.rst:1825 +#: ../../whatsnew/3.3.rst:1827 msgid "The :mod:`signal` module has new functions:" msgstr ":mod:`signal` 模組有了新的函式:" -#: ../../whatsnew/3.3.rst:1827 +#: ../../whatsnew/3.3.rst:1829 msgid "" ":func:`~signal.pthread_sigmask`: fetch and/or change the signal mask of the " "calling thread (Contributed by Jean-Paul Calderone in :issue:`8407`);" msgstr "" -#: ../../whatsnew/3.3.rst:1829 +#: ../../whatsnew/3.3.rst:1831 msgid ":func:`~signal.pthread_kill`: send a signal to a thread;" msgstr ":func:`~signal.pthread_kill`:向執行緒發送訊號;" -#: ../../whatsnew/3.3.rst:1830 +#: ../../whatsnew/3.3.rst:1832 msgid ":func:`~signal.sigpending`: examine pending functions;" msgstr ":func:`~signal.sigpending`:檢查未定的函式;" -#: ../../whatsnew/3.3.rst:1831 +#: ../../whatsnew/3.3.rst:1833 msgid ":func:`~signal.sigwait`: wait a signal;" msgstr ":func:`~signal.sigwait`:等待訊號;" -#: ../../whatsnew/3.3.rst:1832 +#: ../../whatsnew/3.3.rst:1834 msgid "" ":func:`~signal.sigwaitinfo`: wait for a signal, returning detailed " "information about it;" msgstr ":func:`~signal.sigwaitinfo`:等待訊號,回傳有關該訊號的詳細資訊;" -#: ../../whatsnew/3.3.rst:1834 +#: ../../whatsnew/3.3.rst:1836 msgid "" ":func:`~signal.sigtimedwait`: like :func:`~signal.sigwaitinfo` but with a " "timeout." msgstr "" ":func:`~signal.sigtimedwait`:類似於 :func:`~signal.sigwaitinfo` 但有超時。" -#: ../../whatsnew/3.3.rst:1837 +#: ../../whatsnew/3.3.rst:1839 msgid "" "The signal handler writes the signal number as a single byte instead of a " "nul byte into the wakeup file descriptor. So it is possible to wait more " "than one signal and know which signals were raised." msgstr "" -#: ../../whatsnew/3.3.rst:1841 +#: ../../whatsnew/3.3.rst:1843 msgid "" ":func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError, " "instead of a RuntimeError: OSError has an errno attribute." @@ -3073,29 +3073,29 @@ msgstr "" ":func:`signal.signal` 和 :func:`signal.siginterrupt` 會引發 OSError,而不是 " "RuntimeError:OSError 有一個 errno 屬性。" -#: ../../whatsnew/3.3.rst:1846 +#: ../../whatsnew/3.3.rst:1848 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.3.rst:1848 +#: ../../whatsnew/3.3.rst:1850 msgid "" "The :mod:`!smtpd` module now supports :rfc:`5321` (extended SMTP) and :rfc:" "`1870` (size extension). Per the standard, these extensions are enabled if " "and only if the client initiates the session with an ``EHLO`` command." msgstr "" -#: ../../whatsnew/3.3.rst:1852 +#: ../../whatsnew/3.3.rst:1854 msgid "" "(Initial ``ELHO`` support by Alberto Trevino. Size extension by Juhana " "Jauhiainen. Substantial additional work on the patch contributed by Michele " "Orrù and Dan Boswell. :issue:`8739`)" msgstr "" -#: ../../whatsnew/3.3.rst:1858 +#: ../../whatsnew/3.3.rst:1860 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.3.rst:1860 +#: ../../whatsnew/3.3.rst:1862 msgid "" "The :class:`~smtplib.SMTP`, :class:`~smtplib.SMTP_SSL`, and :class:`~smtplib." "LMTP` classes now accept a ``source_address`` keyword argument to specify " @@ -3104,7 +3104,7 @@ msgid "" "`11281`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1866 +#: ../../whatsnew/3.3.rst:1868 msgid "" ":class:`~smtplib.SMTP` now supports the context management protocol, " "allowing an ``SMTP`` instance to be used in a ``with`` statement. " @@ -3113,7 +3113,7 @@ msgstr "" ":class:`~smtplib.SMTP` 現在支援情境管理協議,允許在 ``with`` 陳述式中使用 " "``SMTP`` 實例。(由 Giampaolo Rodolà 在 :issue:`11289` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1870 +#: ../../whatsnew/3.3.rst:1872 msgid "" "The :class:`~smtplib.SMTP_SSL` constructor and the :meth:`~smtplib.SMTP." "starttls` method now accept an SSLContext parameter to control parameters of " @@ -3123,11 +3123,11 @@ msgstr "" "接受 SSLContext 參數來控制安全通道的參數。(由 Kasun Herath 在 :issue:`8809` " "中貢獻。)" -#: ../../whatsnew/3.3.rst:1876 +#: ../../whatsnew/3.3.rst:1878 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.3.rst:1878 +#: ../../whatsnew/3.3.rst:1880 msgid "" "The :class:`~socket.socket` class now exposes additional methods to process " "ancillary data when supported by the underlying platform:" @@ -3135,26 +3135,26 @@ msgstr "" "當底層平台支援時,:class:`~socket.socket` 類現在公開了額外的方法來處理輔助資" "料:" -#: ../../whatsnew/3.3.rst:1881 +#: ../../whatsnew/3.3.rst:1883 msgid ":func:`~socket.socket.sendmsg`" msgstr ":func:`~socket.socket.sendmsg`" -#: ../../whatsnew/3.3.rst:1882 +#: ../../whatsnew/3.3.rst:1884 msgid ":func:`~socket.socket.recvmsg`" msgstr ":func:`~socket.socket.recvmsg`" -#: ../../whatsnew/3.3.rst:1883 +#: ../../whatsnew/3.3.rst:1885 msgid ":func:`~socket.socket.recvmsg_into`" msgstr ":func:`~socket.socket.recvmsg_into`" -#: ../../whatsnew/3.3.rst:1885 +#: ../../whatsnew/3.3.rst:1887 msgid "" "(Contributed by David Watson in :issue:`6560`, based on an earlier patch by " "Heiko Wundram)" msgstr "" "(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" -#: ../../whatsnew/3.3.rst:1888 +#: ../../whatsnew/3.3.rst:1890 msgid "" "The :class:`~socket.socket` class now supports the PF_CAN protocol family " "(https://en.wikipedia.org/wiki/Socketcan), on Linux (https://lwn.net/" @@ -3163,14 +3163,14 @@ msgstr "" ":class:`~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) " "上的 PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" -#: ../../whatsnew/3.3.rst:1892 +#: ../../whatsnew/3.3.rst:1894 msgid "" "(Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:" "`10141`.)" msgstr "" "(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" -#: ../../whatsnew/3.3.rst:1894 +#: ../../whatsnew/3.3.rst:1896 msgid "" "The :class:`~socket.socket` class now supports the PF_RDS protocol family " "(https://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and `https://oss." @@ -3182,7 +3182,7 @@ msgstr "" "`__\\ )。" -#: ../../whatsnew/3.3.rst:1898 +#: ../../whatsnew/3.3.rst:1900 msgid "" "The :class:`~socket.socket` class now supports the ``PF_SYSTEM`` protocol " "family on OS X. (Contributed by Michael Goderbauer in :issue:`13777`.)" @@ -3190,18 +3190,18 @@ msgstr "" ":class:`~socket.socket` 類別現在支援 OS X 上的 ``PF_SYSTEM`` 協議系列。(由 " "Michael Goderbauer 在 :issue:`13777` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1901 +#: ../../whatsnew/3.3.rst:1903 msgid "" "New function :func:`~socket.sethostname` allows the hostname to be set on " "Unix systems if the calling process has sufficient privileges. (Contributed " "by Ross Lagerwall in :issue:`10866`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1907 +#: ../../whatsnew/3.3.rst:1909 msgid "socketserver" msgstr "socketserver" -#: ../../whatsnew/3.3.rst:1909 +#: ../../whatsnew/3.3.rst:1911 msgid "" ":class:`~socketserver.BaseServer` now has an overridable method :meth:" "`~socketserver.BaseServer.service_actions` that is called by the :meth:" @@ -3210,54 +3210,54 @@ msgid "" "processes. (Contributed by Justin Warkentin in :issue:`11109`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1917 +#: ../../whatsnew/3.3.rst:1919 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.3.rst:1919 +#: ../../whatsnew/3.3.rst:1921 msgid "" "New :class:`sqlite3.Connection` method :meth:`~sqlite3.Connection." "set_trace_callback` can be used to capture a trace of all sql commands " "processed by sqlite. (Contributed by Torsten Landschoff in :issue:`11688`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1926 +#: ../../whatsnew/3.3.rst:1928 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.3.rst:1928 +#: ../../whatsnew/3.3.rst:1930 msgid "The :mod:`ssl` module has two new random generation functions:" msgstr ":mod:`ssl` 模組有兩個新的隨機生成函式:" -#: ../../whatsnew/3.3.rst:1930 +#: ../../whatsnew/3.3.rst:1932 msgid "" ":func:`~ssl.RAND_bytes`: generate cryptographically strong pseudo-random " "bytes." msgstr ":func:`~ssl.RAND_bytes`:生成加密的強偽隨機位元組。" -#: ../../whatsnew/3.3.rst:1932 +#: ../../whatsnew/3.3.rst:1934 msgid ":func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes." msgstr ":func:`~ssl.RAND_pseudo_bytes`:生成偽隨機位元組。" -#: ../../whatsnew/3.3.rst:1934 +#: ../../whatsnew/3.3.rst:1936 msgid "(Contributed by Victor Stinner in :issue:`12049`.)" msgstr "(由 Victor Stinner 在 :issue:`12049` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1936 +#: ../../whatsnew/3.3.rst:1938 msgid "" "The :mod:`ssl` module now exposes a finer-grained exception hierarchy in " "order to make it easier to inspect the various kinds of errors. (Contributed " "by Antoine Pitrou in :issue:`11183`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1940 +#: ../../whatsnew/3.3.rst:1942 msgid "" ":meth:`~ssl.SSLContext.load_cert_chain` now accepts a *password* argument to " "be used if the private key is encrypted. (Contributed by Adam Simpkins in :" "issue:`12803`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1944 +#: ../../whatsnew/3.3.rst:1946 msgid "" "Diffie-Hellman key exchange, both regular and Elliptic Curve-based, is now " "supported through the :meth:`~ssl.SSLContext.load_dh_params` and :meth:`~ssl." @@ -3265,14 +3265,14 @@ msgid "" "`13626` and :issue:`13627`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1949 +#: ../../whatsnew/3.3.rst:1951 msgid "" "SSL sockets have a new :meth:`~ssl.SSLSocket.get_channel_binding` method " "allowing the implementation of certain authentication mechanisms such as " "SCRAM-SHA-1-PLUS. (Contributed by Jacek Konieczny in :issue:`12551`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1953 +#: ../../whatsnew/3.3.rst:1955 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 :const:" @@ -3280,91 +3280,91 @@ msgid "" "Antoine Pitrou in :issue:`13634`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1958 +#: ../../whatsnew/3.3.rst:1960 msgid "" "Support has been added for the Next Protocol Negotiation extension using " "the :meth:`ssl.SSLContext.set_npn_protocols` method. (Contributed by Colin " "Marc in :issue:`14204`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1962 +#: ../../whatsnew/3.3.rst:1964 msgid "" "SSL errors can now be introspected more easily thanks to :attr:`~ssl." "SSLError.library` and :attr:`~ssl.SSLError.reason` attributes. (Contributed " "by Antoine Pitrou in :issue:`14837`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1966 +#: ../../whatsnew/3.3.rst:1968 msgid "" "The :func:`~ssl.get_server_certificate` function now supports IPv6. " "(Contributed by Charles-François Natali in :issue:`11811`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1969 +#: ../../whatsnew/3.3.rst:1971 msgid "" "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 "" -#: ../../whatsnew/3.3.rst:1975 +#: ../../whatsnew/3.3.rst:1977 msgid "stat" msgstr "stat" -#: ../../whatsnew/3.3.rst:1977 +#: ../../whatsnew/3.3.rst:1979 msgid "" "The undocumented tarfile.filemode function has been moved to :func:`stat." "filemode`. It can be used to convert a file's mode to a string of the form '-" "rwxrwxrwx'." msgstr "" -#: ../../whatsnew/3.3.rst:1981 +#: ../../whatsnew/3.3.rst:1983 msgid "(Contributed by Giampaolo Rodolà in :issue:`14807`.)" msgstr "(由 Giampaolo Rodolà 在 :issue:`14807` 中貢獻。)" -#: ../../whatsnew/3.3.rst:1985 +#: ../../whatsnew/3.3.rst:1987 msgid "struct" msgstr "struct" -#: ../../whatsnew/3.3.rst:1987 +#: ../../whatsnew/3.3.rst:1989 msgid "" "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:1993 +#: ../../whatsnew/3.3.rst:1995 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.3.rst:1995 +#: ../../whatsnew/3.3.rst:1997 msgid "" "Command strings can now be bytes objects on posix platforms. (Contributed " "by Victor Stinner in :issue:`8513`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1998 +#: ../../whatsnew/3.3.rst:2000 msgid "" "A new constant :const:`~subprocess.DEVNULL` allows suppressing output in a " "platform-independent fashion. (Contributed by Ross Lagerwall in :issue:" "`5870`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2004 +#: ../../whatsnew/3.3.rst:2006 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.3.rst:2006 +#: ../../whatsnew/3.3.rst:2008 msgid "" "The :mod:`sys` module has a new :data:`~sys.thread_info` :term:`named tuple` " "holding information about the thread implementation (:issue:`11223`)." msgstr "" -#: ../../whatsnew/3.3.rst:2012 +#: ../../whatsnew/3.3.rst:2014 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.3.rst:2014 +#: ../../whatsnew/3.3.rst:2016 msgid "" ":mod:`tarfile` now supports ``lzma`` encoding via the :mod:`lzma` module. " "(Contributed by Lars Gustäbel in :issue:`5689`.)" @@ -3372,33 +3372,33 @@ msgstr "" ":mod:`tarfile` 現在透過 :mod:`lzma` 模組支援 ``lzma`` 編碼。(由 Lars " "Gustäbel 在 :issue:`5689` 中貢獻。)" -#: ../../whatsnew/3.3.rst:2019 +#: ../../whatsnew/3.3.rst:2021 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.3.rst:2021 +#: ../../whatsnew/3.3.rst:2023 msgid "" ":class:`tempfile.SpooledTemporaryFile`\\'s :meth:`~tempfile." "SpooledTemporaryFile.truncate` method now accepts a ``size`` parameter. " "(Contributed by Ryan Kelly in :issue:`9957`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2027 +#: ../../whatsnew/3.3.rst:2029 msgid "textwrap" msgstr "textwrap" -#: ../../whatsnew/3.3.rst:2029 +#: ../../whatsnew/3.3.rst:2031 msgid "" "The :mod:`textwrap` module has a new :func:`~textwrap.indent` that makes it " "straightforward to add a common prefix to selected lines in a block of text " "(:issue:`13857`)." msgstr "" -#: ../../whatsnew/3.3.rst:2035 +#: ../../whatsnew/3.3.rst:2037 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.3.rst:2037 +#: ../../whatsnew/3.3.rst:2039 msgid "" ":class:`threading.Condition`, :class:`threading.Semaphore`, :class:" "`threading.BoundedSemaphore`, :class:`threading.Event`, and :class:" @@ -3407,14 +3407,14 @@ msgid "" "Araujo in :issue:`10968`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2043 +#: ../../whatsnew/3.3.rst:2045 msgid "" "The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword " "argument to override the default behavior of inheriting the ``daemon`` flag " "value from the parent thread (:issue:`6064`)." msgstr "" -#: ../../whatsnew/3.3.rst:2047 +#: ../../whatsnew/3.3.rst:2049 msgid "" "The formerly private function ``_thread.get_ident`` is now available as the " "public function :func:`threading.get_ident`. This eliminates several cases " @@ -3423,42 +3423,42 @@ msgid "" "public interface." msgstr "" -#: ../../whatsnew/3.3.rst:2055 +#: ../../whatsnew/3.3.rst:2057 msgid "time" msgstr "time" -#: ../../whatsnew/3.3.rst:2057 +#: ../../whatsnew/3.3.rst:2059 msgid "The :pep:`418` added new functions to the :mod:`time` module:" msgstr ":pep:`418` 向 :mod:`time` 模組新增了新功能:" -#: ../../whatsnew/3.3.rst:2059 +#: ../../whatsnew/3.3.rst:2061 msgid ":func:`~time.get_clock_info`: Get information on a clock." msgstr ":func:`~time.get_clock_info`:獲取時鐘資訊。" -#: ../../whatsnew/3.3.rst:2060 +#: ../../whatsnew/3.3.rst:2062 msgid "" ":func:`~time.monotonic`: Monotonic clock (cannot go backward), not affected " "by system clock updates." msgstr "" ":func:`~time.monotonic`:單調時鐘(不能倒退),不受系統時鐘更新的影響。" -#: ../../whatsnew/3.3.rst:2062 +#: ../../whatsnew/3.3.rst:2064 msgid "" ":func:`~time.perf_counter`: Performance counter with the highest available " "resolution to measure a short duration." msgstr "" -#: ../../whatsnew/3.3.rst:2064 +#: ../../whatsnew/3.3.rst:2066 msgid "" ":func:`~time.process_time`: Sum of the system and user CPU time of the " "current process." msgstr ":func:`~time.process_time`:當前行程的系統和使用者 CPU 時間總和。" -#: ../../whatsnew/3.3.rst:2067 +#: ../../whatsnew/3.3.rst:2069 msgid "Other new functions:" msgstr "其他新功能:" -#: ../../whatsnew/3.3.rst:2069 +#: ../../whatsnew/3.3.rst:2071 msgid "" ":func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time." "clock_settime` functions with :samp:`CLOCK_{xxx}` constants. (Contributed by " @@ -3468,35 +3468,35 @@ msgstr "" "clock_settime` 函式帶有 :samp:`CLOCK_{xxx}` 常數。(由 Victor Stinner 在 :" "issue:`10278` 中貢獻。)" -#: ../../whatsnew/3.3.rst:2073 +#: ../../whatsnew/3.3.rst:2075 msgid "" "To improve cross platform consistency, :func:`~time.sleep` now raises a :exc:" "`ValueError` when passed a negative sleep value. Previously this was an " "error on posix, but produced an infinite sleep on Windows." msgstr "" -#: ../../whatsnew/3.3.rst:2079 +#: ../../whatsnew/3.3.rst:2081 msgid "types" msgstr "types" -#: ../../whatsnew/3.3.rst:2081 +#: ../../whatsnew/3.3.rst:2083 msgid "" "Add a new :class:`types.MappingProxyType` class: Read-only proxy of a " "mapping. (:issue:`14386`)" msgstr "" -#: ../../whatsnew/3.3.rst:2085 +#: ../../whatsnew/3.3.rst:2087 msgid "" "The new functions :func:`types.new_class` and :func:`types.prepare_class` " "provide support for :pep:`3115` compliant dynamic type creation. (:issue:" "`14588`)" msgstr "" -#: ../../whatsnew/3.3.rst:2090 +#: ../../whatsnew/3.3.rst:2092 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.3.rst:2092 +#: ../../whatsnew/3.3.rst:2094 msgid "" ":meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, " "and :meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used " @@ -3504,37 +3504,37 @@ msgid "" "issue:`10775`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2097 +#: ../../whatsnew/3.3.rst:2099 msgid "" ":meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult` " "object." msgstr "" ":meth:`unittest.TestCase.run` 現在回傳 :class:`~unittest.TestResult` 物件。" -#: ../../whatsnew/3.3.rst:2102 +#: ../../whatsnew/3.3.rst:2104 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.3.rst:2104 +#: ../../whatsnew/3.3.rst:2106 msgid "" "The :class:`~urllib.request.Request` class, now accepts a *method* argument " "used by :meth:`~urllib.request.Request.get_method` to determine what HTTP " "method should be used. For example, this will send a ``'HEAD'`` request::" msgstr "" -#: ../../whatsnew/3.3.rst:2108 +#: ../../whatsnew/3.3.rst:2110 msgid ">>> urlopen(Request('https://www.python.org', method='HEAD'))" msgstr ">>> urlopen(Request('https://www.python.org', method='HEAD'))" -#: ../../whatsnew/3.3.rst:2110 +#: ../../whatsnew/3.3.rst:2112 msgid "(:issue:`1673007`)" msgstr "(:issue:`1673007`)" -#: ../../whatsnew/3.3.rst:2114 +#: ../../whatsnew/3.3.rst:2116 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.3.rst:2116 +#: ../../whatsnew/3.3.rst:2118 msgid "" "The :mod:`webbrowser` module supports more \"browsers\": Google Chrome " "(named :program:`chrome`, :program:`chromium`, :program:`chrome-browser` or :" @@ -3545,11 +3545,11 @@ msgid "" "latter by Matthias Klose in :issue:`14493`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2126 +#: ../../whatsnew/3.3.rst:2128 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.3.rst:2128 +#: ../../whatsnew/3.3.rst:2130 msgid "" "The :mod:`xml.etree.ElementTree` module now imports its C accelerator by " "default; there is no longer a need to explicitly import :mod:`xml.etree." @@ -3560,62 +3560,62 @@ msgid "" "detailed reference." msgstr "" -#: ../../whatsnew/3.3.rst:2138 +#: ../../whatsnew/3.3.rst:2140 msgid "zlib" msgstr "zlib" -#: ../../whatsnew/3.3.rst:2140 +#: ../../whatsnew/3.3.rst:2142 msgid "" "New attribute :attr:`zlib.Decompress.eof` makes it possible to distinguish " "between a properly formed compressed stream and an incomplete or truncated " "one. (Contributed by Nadeem Vawda in :issue:`12646`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2144 +#: ../../whatsnew/3.3.rst:2146 msgid "" "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 "" -#: ../../whatsnew/3.3.rst:2150 +#: ../../whatsnew/3.3.rst:2152 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.3.rst:2152 +#: ../../whatsnew/3.3.rst:2154 msgid "Major performance enhancements have been added:" msgstr "" -#: ../../whatsnew/3.3.rst:2154 +#: ../../whatsnew/3.3.rst:2156 msgid "" "Thanks to :pep:`393`, some operations on Unicode strings have been optimized:" msgstr "" -#: ../../whatsnew/3.3.rst:2156 +#: ../../whatsnew/3.3.rst:2158 msgid "the memory footprint is divided by 2 to 4 depending on the text" msgstr "" -#: ../../whatsnew/3.3.rst:2157 +#: ../../whatsnew/3.3.rst:2159 msgid "" "encode an ASCII string to UTF-8 doesn't need to encode characters anymore, " "the UTF-8 representation is shared with the ASCII representation" msgstr "" -#: ../../whatsnew/3.3.rst:2159 +#: ../../whatsnew/3.3.rst:2161 msgid "the UTF-8 encoder has been optimized" msgstr "" -#: ../../whatsnew/3.3.rst:2160 +#: ../../whatsnew/3.3.rst:2162 msgid "" "repeating a single ASCII letter and getting a substring of an ASCII string " "is 4 times faster" msgstr "" -#: ../../whatsnew/3.3.rst:2163 +#: ../../whatsnew/3.3.rst:2165 msgid "UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster." msgstr "" -#: ../../whatsnew/3.3.rst:2165 +#: ../../whatsnew/3.3.rst:2167 msgid "" "(Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:" "`15026`.)" @@ -3623,79 +3623,79 @@ msgstr "" "(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` 貢" "獻。)" -#: ../../whatsnew/3.3.rst:2170 +#: ../../whatsnew/3.3.rst:2172 msgid "Build and C API Changes" msgstr "建置和 C API 更改" -#: ../../whatsnew/3.3.rst:2172 +#: ../../whatsnew/3.3.rst:2174 msgid "Changes to Python's build process and to the C API include:" msgstr "Python 建置程序和 C API 的更改包括:" -#: ../../whatsnew/3.3.rst:2174 +#: ../../whatsnew/3.3.rst:2176 msgid "New :pep:`3118` related function:" msgstr "新的 :pep:`3118` 相關功能:" -#: ../../whatsnew/3.3.rst:2176 +#: ../../whatsnew/3.3.rst:2178 msgid ":c:func:`PyMemoryView_FromMemory`" msgstr ":c:func:`PyMemoryView_FromMemory`" -#: ../../whatsnew/3.3.rst:2178 +#: ../../whatsnew/3.3.rst:2180 msgid ":pep:`393` added new Unicode types, macros and functions:" msgstr "" -#: ../../whatsnew/3.3.rst:2180 +#: ../../whatsnew/3.3.rst:2182 msgid "High-level API:" msgstr "高階 API:" -#: ../../whatsnew/3.3.rst:2182 +#: ../../whatsnew/3.3.rst:2184 msgid ":c:func:`PyUnicode_CopyCharacters`" msgstr ":c:func:`PyUnicode_CopyCharacters`" -#: ../../whatsnew/3.3.rst:2183 +#: ../../whatsnew/3.3.rst:2185 msgid ":c:func:`PyUnicode_FindChar`" msgstr ":c:func:`PyUnicode_FindChar`" -#: ../../whatsnew/3.3.rst:2184 +#: ../../whatsnew/3.3.rst:2186 msgid ":c:func:`PyUnicode_GetLength`, :c:macro:`PyUnicode_GET_LENGTH`" msgstr ":c:func:`PyUnicode_GetLength`, :c:macro:`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.3.rst:2185 +#: ../../whatsnew/3.3.rst:2187 msgid ":c:func:`PyUnicode_New`" msgstr ":c:func:`PyUnicode_New`" -#: ../../whatsnew/3.3.rst:2186 +#: ../../whatsnew/3.3.rst:2188 msgid ":c:func:`PyUnicode_Substring`" msgstr ":c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.3.rst:2187 +#: ../../whatsnew/3.3.rst:2189 msgid ":c:func:`PyUnicode_ReadChar`, :c:func:`PyUnicode_WriteChar`" msgstr ":c:func:`PyUnicode_ReadChar`, :c:func:`PyUnicode_WriteChar`" -#: ../../whatsnew/3.3.rst:2189 +#: ../../whatsnew/3.3.rst:2191 msgid "Low-level API:" msgstr "低階 API:" -#: ../../whatsnew/3.3.rst:2191 +#: ../../whatsnew/3.3.rst:2193 msgid ":c:type:`Py_UCS1`, :c:type:`Py_UCS2`, :c:type:`Py_UCS4` types" msgstr ":c:type:`Py_UCS1`、:c:type:`Py_UCS2`、:c:type:`Py_UCS4` 型別" -#: ../../whatsnew/3.3.rst:2192 +#: ../../whatsnew/3.3.rst:2194 msgid ":c:type:`PyASCIIObject` and :c:type:`PyCompactUnicodeObject` structures" msgstr ":c:type:`PyASCIIObject` 和 :c:type:`PyCompactUnicodeObject` 結構" -#: ../../whatsnew/3.3.rst:2193 +#: ../../whatsnew/3.3.rst:2195 msgid ":c:macro:`PyUnicode_READY`" msgstr ":c:macro:`PyUnicode_READY`" -#: ../../whatsnew/3.3.rst:2194 +#: ../../whatsnew/3.3.rst:2196 msgid ":c:func:`PyUnicode_FromKindAndData`" msgstr ":c:func:`PyUnicode_FromKindAndData`" -#: ../../whatsnew/3.3.rst:2195 +#: ../../whatsnew/3.3.rst:2197 msgid ":c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsUCS4Copy`" msgstr ":c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsUCS4Copy`" -#: ../../whatsnew/3.3.rst:2196 +#: ../../whatsnew/3.3.rst:2198 msgid "" ":c:macro:`PyUnicode_DATA`, :c:macro:`PyUnicode_1BYTE_DATA`, :c:macro:" "`PyUnicode_2BYTE_DATA`, :c:macro:`PyUnicode_4BYTE_DATA`" @@ -3703,14 +3703,14 @@ msgstr "" ":c:macro:`PyUnicode_DATA`, :c:macro:`PyUnicode_1BYTE_DATA`, :c:macro:" "`PyUnicode_2BYTE_DATA`, :c:macro:`PyUnicode_4BYTE_DATA`" -#: ../../whatsnew/3.3.rst:2198 +#: ../../whatsnew/3.3.rst:2200 msgid "" ":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:`!" "PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" "`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" msgstr "" -#: ../../whatsnew/3.3.rst:2201 +#: ../../whatsnew/3.3.rst:2203 msgid "" ":c:macro:`PyUnicode_READ`, :c:macro:`PyUnicode_READ_CHAR`, :c:macro:" "`PyUnicode_WRITE`" @@ -3718,11 +3718,11 @@ msgstr "" ":c:macro:`PyUnicode_READ`, :c:macro:`PyUnicode_READ_CHAR`, :c:macro:" "`PyUnicode_WRITE`" -#: ../../whatsnew/3.3.rst:2202 +#: ../../whatsnew/3.3.rst:2204 msgid ":c:macro:`PyUnicode_MAX_CHAR_VALUE`" msgstr ":c:macro:`PyUnicode_MAX_CHAR_VALUE`" -#: ../../whatsnew/3.3.rst:2204 +#: ../../whatsnew/3.3.rst:2206 msgid "" ":c:macro:`PyArg_ParseTuple` now accepts a :class:`bytearray` for the ``c`` " "format (:issue:`12380`)." @@ -3730,46 +3730,46 @@ msgstr "" ":c:macro:`PyArg_ParseTuple` 現在接受 :class:`bytearray` 為 ``c`` 格式 (:" "issue:`12380`)。" -#: ../../whatsnew/3.3.rst:2210 +#: ../../whatsnew/3.3.rst:2212 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.3.rst:2213 +#: ../../whatsnew/3.3.rst:2215 msgid "Unsupported Operating Systems" msgstr "不支援的作業系統" -#: ../../whatsnew/3.3.rst:2215 +#: ../../whatsnew/3.3.rst:2217 msgid "OS/2 and VMS are no longer supported due to the lack of a maintainer." msgstr "由於缺乏維護者,OS/2 和 VMS 不再受支援。" -#: ../../whatsnew/3.3.rst:2217 +#: ../../whatsnew/3.3.rst:2219 msgid "" "Windows 2000 and Windows platforms which set ``COMSPEC`` to ``command.com`` " "are no longer supported due to maintenance burden." msgstr "" -#: ../../whatsnew/3.3.rst:2220 +#: ../../whatsnew/3.3.rst:2222 msgid "OSF support, which was deprecated in 3.2, has been completely removed." msgstr "OSF 支援在 3.2 中已棄用,現已完全刪除。" -#: ../../whatsnew/3.3.rst:2224 +#: ../../whatsnew/3.3.rst:2226 msgid "Deprecated Python modules, functions and methods" msgstr "已棄用的 Python 模組、函式和方法" -#: ../../whatsnew/3.3.rst:2226 +#: ../../whatsnew/3.3.rst:2228 msgid "" "Passing a non-empty string to ``object.__format__()`` is deprecated, and " "will produce a :exc:`TypeError` in Python 3.4 (:issue:`9856`)." msgstr "" -#: ../../whatsnew/3.3.rst:2228 +#: ../../whatsnew/3.3.rst:2230 msgid "" "The ``unicode_internal`` codec has been deprecated because of the :pep:" "`393`, use UTF-8, UTF-16 (``utf-16-le`` or ``utf-16-be``), or UTF-32 " "(``utf-32-le`` or ``utf-32-be``)" msgstr "" -#: ../../whatsnew/3.3.rst:2231 +#: ../../whatsnew/3.3.rst:2233 msgid "" ":meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use :meth:`ftplib.FTP." "mlsd`" @@ -3777,7 +3777,7 @@ msgstr "" ":meth:`ftplib.FTP.nlst` 和 :meth:`ftplib.FTP.dir`:使用 :meth:`ftplib.FTP." "mlsd`" -#: ../../whatsnew/3.3.rst:2233 +#: ../../whatsnew/3.3.rst:2235 msgid "" ":func:`platform.popen`: use the :mod:`subprocess` module. Check especially " "the :ref:`subprocess-replacements` section (:issue:`11377`)." @@ -3785,39 +3785,39 @@ msgstr "" ":func:`platform.popen`:使用 :mod:`subprocess` 模組。請特別檢查 :ref:" "`subprocess-replacements` 部分 (:issue:`11377`)。" -#: ../../whatsnew/3.3.rst:2235 +#: ../../whatsnew/3.3.rst:2237 msgid "" ":issue:`13374`: The Windows bytes API has been deprecated in the :mod:`os` " "module. Use Unicode filenames, instead of bytes filenames, to not depend on " "the ANSI code page anymore and to support any filename." msgstr "" -#: ../../whatsnew/3.3.rst:2238 +#: ../../whatsnew/3.3.rst:2240 msgid "" ":issue:`13988`: The :mod:`xml.etree.cElementTree` module is deprecated. The " "accelerator is used automatically whenever available." msgstr "" -#: ../../whatsnew/3.3.rst:2240 +#: ../../whatsnew/3.3.rst:2242 msgid "" "The behaviour of :func:`time.clock` depends on the platform: use the new :" "func:`time.perf_counter` or :func:`time.process_time` function instead, " "depending on your requirements, to have a well defined behaviour." msgstr "" -#: ../../whatsnew/3.3.rst:2243 +#: ../../whatsnew/3.3.rst:2245 msgid "The :func:`os.stat_float_times` function is deprecated." msgstr ":func:`os.stat_float_times` 函式已棄用。" -#: ../../whatsnew/3.3.rst:2244 +#: ../../whatsnew/3.3.rst:2246 msgid ":mod:`abc` module:" msgstr ":mod:`abc` 模組:" -#: ../../whatsnew/3.3.rst:2253 +#: ../../whatsnew/3.3.rst:2255 msgid ":mod:`importlib` package:" msgstr ":mod:`importlib` 套件:" -#: ../../whatsnew/3.3.rst:2255 +#: ../../whatsnew/3.3.rst:2257 msgid "" ":meth:`importlib.abc.SourceLoader.path_mtime` is now deprecated in favour " "of :meth:`importlib.abc.SourceLoader.path_stats` as bytecode files now store " @@ -3825,11 +3825,11 @@ msgid "" "compiled from." msgstr "" -#: ../../whatsnew/3.3.rst:2265 +#: ../../whatsnew/3.3.rst:2267 msgid "Deprecated functions and types of the C API" msgstr "C API 中已棄用的函式和型別" -#: ../../whatsnew/3.3.rst:2267 +#: ../../whatsnew/3.3.rst:2269 msgid "" "The :c:type:`Py_UNICODE` has been deprecated by :pep:`393` and will be " "removed in Python 4. All functions using this type are deprecated:" @@ -3837,13 +3837,13 @@ msgstr "" ":c:type:`Py_UNICODE` 已被 :pep:`393` 棄用,並將在 Python 4 中刪除。所有使用此" "型別的函式均已棄用:" -#: ../../whatsnew/3.3.rst:2270 +#: ../../whatsnew/3.3.rst:2272 msgid "" "Unicode functions and methods using :c:type:`Py_UNICODE` and :c:expr:" "`Py_UNICODE*` types:" msgstr "" -#: ../../whatsnew/3.3.rst:2273 +#: ../../whatsnew/3.3.rst:2275 msgid "" ":c:macro:`!PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :" "c:func:`PyUnicode_FromKindAndData`" @@ -3851,7 +3851,7 @@ msgstr "" ":c:macro:`!PyUnicode_FromUnicode`:使用 :c:func:`PyUnicode_FromWideChar` 或 :" "c:func:`PyUnicode_FromKindAndData`" -#: ../../whatsnew/3.3.rst:2275 +#: ../../whatsnew/3.3.rst:2277 msgid "" ":c:macro:`!PyUnicode_AS_UNICODE`, :c:func:`!PyUnicode_AsUnicode`, :c:func:`!" "PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" @@ -3859,7 +3859,7 @@ msgstr "" ":c:macro:`!PyUnicode_AS_UNICODE`、:c:func:`!PyUnicode_AsUnicode`、:c:func:`!" "PyUnicode_AsUnicodeAndSize`:使用 :c:func:`PyUnicode_AsWideCharString`" -#: ../../whatsnew/3.3.rst:2277 +#: ../../whatsnew/3.3.rst:2279 msgid "" ":c:macro:`!PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" "`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`" @@ -3867,7 +3867,7 @@ msgstr "" ":c:macro:`!PyUnicode_AS_DATA`:將 :c:macro:`PyUnicode_DATA` 與 :c:macro:" "`PyUnicode_READ` 和 :c:macro:`PyUnicode_WRITE` 一起使用" -#: ../../whatsnew/3.3.rst:2279 +#: ../../whatsnew/3.3.rst:2281 msgid "" ":c:macro:`!PyUnicode_GET_SIZE`, :c:func:`!PyUnicode_GetSize`: use :c:macro:" "`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`" @@ -3875,7 +3875,7 @@ msgstr "" ":c:macro:`!PyUnicode_GET_SIZE`、:c:func:`!PyUnicode_GetSize`:使用 :c:macro:" "`PyUnicode_GET_LENGTH` 或 :c:func:`PyUnicode_GetLength`" -#: ../../whatsnew/3.3.rst:2281 +#: ../../whatsnew/3.3.rst:2283 msgid "" ":c:macro:`!PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " "PyUnicode_KIND(str)`` (only work on ready strings)" @@ -3883,7 +3883,7 @@ msgstr "" ":c:macro:`!PyUnicode_GET_DATA_SIZE`:使用 ``PyUnicode_GET_LENGTH(str) * " "PyUnicode_KIND(str)``\\ (僅適用於準備好的字串)" -#: ../../whatsnew/3.3.rst:2284 +#: ../../whatsnew/3.3.rst:2286 msgid "" ":c:func:`!PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" "func:`PyUnicode_AsWideCharString`" @@ -3891,15 +3891,15 @@ msgstr "" ":c:func:`!PyUnicode_AsUnicodeCopy`:使用 :c:func:`PyUnicode_AsUCS4Copy` 或 :" "c:func:`PyUnicode_AsWideCharString`" -#: ../../whatsnew/3.3.rst:2286 +#: ../../whatsnew/3.3.rst:2288 msgid ":c:func:`!PyUnicode_GetMax`" msgstr ":c:func:`!PyUnicode_GetMax`" -#: ../../whatsnew/3.3.rst:2289 +#: ../../whatsnew/3.3.rst:2291 msgid "Functions and macros manipulating Py_UNICODE* strings:" msgstr "操作 Py_UNICODE* 字串的函式和巨集:" -#: ../../whatsnew/3.3.rst:2291 +#: ../../whatsnew/3.3.rst:2293 msgid "" ":c:macro:`!Py_UNICODE_strlen()`: use :c:func:`PyUnicode_GetLength` or :c:" "macro:`PyUnicode_GET_LENGTH`" @@ -3907,7 +3907,7 @@ msgstr "" ":c:macro:`!Py_UNICODE_strlen()`:使用 :c:func:`PyUnicode_GetLength` 或 :c:" "macro:`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.3.rst:2293 +#: ../../whatsnew/3.3.rst:2295 msgid "" ":c:macro:`!Py_UNICODE_strcat()`: use :c:func:`PyUnicode_CopyCharacters` or :" "c:func:`PyUnicode_FromFormat`" @@ -3915,7 +3915,7 @@ msgstr "" ":c:macro:`!Py_UNICODE_strcat()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :" "c:func:`PyUnicode_FromFormat`" -#: ../../whatsnew/3.3.rst:2295 +#: ../../whatsnew/3.3.rst:2297 msgid "" ":c:macro:`!Py_UNICODE_strcpy()`, :c:macro:`!Py_UNICODE_strncpy()`, :c:macro:" "`!Py_UNICODE_COPY()`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" @@ -3925,15 +3925,15 @@ msgstr "" "`!Py_UNICODE_COPY()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_Substring`" -#: ../../whatsnew/3.3.rst:2298 +#: ../../whatsnew/3.3.rst:2300 msgid ":c:macro:`!Py_UNICODE_strcmp()`: use :c:func:`PyUnicode_Compare`" msgstr ":c:macro:`!Py_UNICODE_strcmp()`:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.3.rst:2299 +#: ../../whatsnew/3.3.rst:2301 msgid ":c:macro:`!Py_UNICODE_strncmp()`: use :c:func:`PyUnicode_Tailmatch`" msgstr ":c:macro:`!Py_UNICODE_strncmp()`: 使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.3.rst:2300 +#: ../../whatsnew/3.3.rst:2302 msgid "" ":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: use :c:" "func:`PyUnicode_FindChar`" @@ -3941,27 +3941,27 @@ msgstr "" ":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: 使用 :c:" "func:`PyUnicode_FindChar`" -#: ../../whatsnew/3.3.rst:2302 +#: ../../whatsnew/3.3.rst:2304 msgid ":c:macro:`!Py_UNICODE_FILL()`: use :c:func:`PyUnicode_Fill`" msgstr ":c:macro:`!Py_UNICODE_FILL()`: 使用 :c:func:`PyUnicode_Fill`" -#: ../../whatsnew/3.3.rst:2303 +#: ../../whatsnew/3.3.rst:2305 msgid ":c:macro:`!Py_UNICODE_MATCH`" msgstr ":c:macro:`!Py_UNICODE_MATCH`" -#: ../../whatsnew/3.3.rst:2305 +#: ../../whatsnew/3.3.rst:2307 msgid "Encoders:" msgstr "編碼器:" -#: ../../whatsnew/3.3.rst:2307 +#: ../../whatsnew/3.3.rst:2309 msgid ":c:func:`!PyUnicode_Encode`: use :c:func:`!PyUnicode_AsEncodedObject`" msgstr ":c:func:`!PyUnicode_Encode`:使用 :c:func:`!PyUnicode_AsEncodedObject`" -#: ../../whatsnew/3.3.rst:2308 +#: ../../whatsnew/3.3.rst:2310 msgid ":c:func:`!PyUnicode_EncodeUTF7`" msgstr ":c:func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.3.rst:2309 +#: ../../whatsnew/3.3.rst:2311 msgid "" ":c:func:`!PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" "`PyUnicode_AsUTF8String`" @@ -3969,15 +3969,15 @@ msgstr "" ":c:func:`!PyUnicode_EncodeUTF8`:使用 :c:func:`PyUnicode_AsUTF8` 或 :c:func:" "`PyUnicode_AsUTF8String`" -#: ../../whatsnew/3.3.rst:2311 +#: ../../whatsnew/3.3.rst:2313 msgid ":c:func:`!PyUnicode_EncodeUTF32`" msgstr ":c:func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.3.rst:2312 +#: ../../whatsnew/3.3.rst:2314 msgid ":c:func:`!PyUnicode_EncodeUTF16`" msgstr ":c:func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.3.rst:2313 +#: ../../whatsnew/3.3.rst:2315 msgid "" ":c:func:`!PyUnicode_EncodeUnicodeEscape` use :c:func:" "`PyUnicode_AsUnicodeEscapeString`" @@ -3985,7 +3985,7 @@ msgstr "" ":c:func:`!PyUnicode_EncodeUnicodeEscape` 使用 :c:func:" "`PyUnicode_AsUnicodeEscapeString`" -#: ../../whatsnew/3.3.rst:2315 +#: ../../whatsnew/3.3.rst:2317 msgid "" ":c:func:`!PyUnicode_EncodeRawUnicodeEscape` use :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" @@ -3993,26 +3993,26 @@ msgstr "" ":c:func:`!PyUnicode_EncodeRawUnicodeEscape` 使用 :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" -#: ../../whatsnew/3.3.rst:2317 +#: ../../whatsnew/3.3.rst:2319 msgid "" ":c:func:`!PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" msgstr "" ":c:func:`!PyUnicode_EncodeLatin1`: 使用 :c:func:`PyUnicode_AsLatin1String`" -#: ../../whatsnew/3.3.rst:2318 +#: ../../whatsnew/3.3.rst:2320 msgid ":c:func:`!PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" msgstr "" ":c:func:`!PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" -#: ../../whatsnew/3.3.rst:2319 +#: ../../whatsnew/3.3.rst:2321 msgid ":c:func:`!PyUnicode_EncodeCharmap`" msgstr ":c:func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.3.rst:2320 +#: ../../whatsnew/3.3.rst:2322 msgid ":c:func:`!PyUnicode_TranslateCharmap`" msgstr ":c:func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.3.rst:2321 +#: ../../whatsnew/3.3.rst:2323 msgid "" ":c:func:`!PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" "func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)" @@ -4020,7 +4020,7 @@ msgstr "" ":c:func:`!PyUnicode_EncodeMBCS`:使用 :c:func:`PyUnicode_AsMBCSString` 或 :c:" "func:`PyUnicode_EncodeCodePage` (帶有 ``CP_ACP`` code_page)" -#: ../../whatsnew/3.3.rst:2323 +#: ../../whatsnew/3.3.rst:2325 msgid "" ":c:func:`!PyUnicode_EncodeDecimal`, :c:func:`!" "PyUnicode_TransformDecimalToASCII`" @@ -4028,38 +4028,38 @@ msgstr "" ":c:func:`!PyUnicode_EncodeDecimal`、:c:func:`!" "PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.3.rst:2328 +#: ../../whatsnew/3.3.rst:2330 msgid "Deprecated features" msgstr "已棄用的功能" -#: ../../whatsnew/3.3.rst:2330 +#: ../../whatsnew/3.3.rst:2332 msgid "" "The :mod:`array` module's ``'u'`` format code is now deprecated and will be " "removed in Python 4 together with the rest of the (:c:type:`Py_UNICODE`) API." msgstr "" -#: ../../whatsnew/3.3.rst:2335 +#: ../../whatsnew/3.3.rst:2337 msgid "Porting to Python 3.3" msgstr "移植到 Python 3.3" -#: ../../whatsnew/3.3.rst:2337 +#: ../../whatsnew/3.3.rst:2339 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要你更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.3.rst:2343 +#: ../../whatsnew/3.3.rst:2345 msgid "Porting Python code" msgstr "移植 Python 程式碼" -#: ../../whatsnew/3.3.rst:2345 +#: ../../whatsnew/3.3.rst:2347 msgid "" "Hash randomization is enabled by default. Set the :envvar:`PYTHONHASHSEED` " "environment variable to ``0`` to disable hash randomization. See also the :" "meth:`object.__hash__` method." msgstr "" -#: ../../whatsnew/3.3.rst:2349 +#: ../../whatsnew/3.3.rst:2351 msgid "" ":issue:`12326`: On Linux, sys.platform doesn't contain the major version " "anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending " @@ -4068,7 +4068,7 @@ msgid "" "if you don't need to support older Python versions." msgstr "" -#: ../../whatsnew/3.3.rst:2355 +#: ../../whatsnew/3.3.rst:2357 msgid "" ":issue:`13847`, :issue:`14180`: :mod:`time` and :mod:`datetime`: :exc:" "`OverflowError` is now raised instead of :exc:`ValueError` if a timestamp is " @@ -4076,7 +4076,7 @@ msgid "" "or :c:func:`localtime` failed." msgstr "" -#: ../../whatsnew/3.3.rst:2360 +#: ../../whatsnew/3.3.rst:2362 msgid "" "The default finders used by import now utilize a cache of what is contained " "within a specific directory. If you create a Python source file or " @@ -4085,7 +4085,7 @@ msgid "" "file." msgstr "" -#: ../../whatsnew/3.3.rst:2365 +#: ../../whatsnew/3.3.rst:2367 msgid "" ":exc:`ImportError` now uses the full name of the module that was attempted " "to be imported. Doctests that check ImportErrors' message will need to be " @@ -4093,7 +4093,7 @@ msgid "" "name." msgstr "" -#: ../../whatsnew/3.3.rst:2370 +#: ../../whatsnew/3.3.rst:2372 msgid "" "The *index* argument to :func:`__import__` now defaults to 0 instead of -1 " "and no longer support negative values. It was an oversight when :pep:`328` " @@ -4104,20 +4104,20 @@ msgid "" "import_module` rather than call :func:`__import__` directly." msgstr "" -#: ../../whatsnew/3.3.rst:2378 +#: ../../whatsnew/3.3.rst:2380 msgid "" ":func:`__import__` no longer allows one to use an index value other than 0 " "for top-level modules. E.g. ``__import__('sys', level=1)`` is now an error." msgstr "" -#: ../../whatsnew/3.3.rst:2381 +#: ../../whatsnew/3.3.rst:2383 msgid "" "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:2385 +#: ../../whatsnew/3.3.rst:2387 msgid "" "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 " @@ -4128,7 +4128,7 @@ msgid "" "finders, but semantically it should not change anything." msgstr "" -#: ../../whatsnew/3.3.rst:2393 +#: ../../whatsnew/3.3.rst:2395 msgid "" ":class:`!importlib.abc.Finder` no longer specifies a ``find_module()`` " "abstract method that must be implemented. If you were relying on subclasses " @@ -4137,7 +4137,7 @@ msgid "" "in the case of working with :term:`path entry finders `." msgstr "" -#: ../../whatsnew/3.3.rst:2399 +#: ../../whatsnew/3.3.rst:2401 msgid "" ":mod:`pkgutil` has been converted to use :mod:`importlib` internally. This " "eliminates many edge cases where the old behaviour of the :pep:`302` import " @@ -4148,7 +4148,7 @@ msgid "" "do not provide the non-standard ``iter_modules()`` method." msgstr "" -#: ../../whatsnew/3.3.rst:2407 +#: ../../whatsnew/3.3.rst:2409 msgid "" "A longstanding RFC-compliance bug (:issue:`1079`) in the parsing done by :" "func:`email.header.decode_header` has been fixed. Code that uses the " @@ -4162,7 +4162,7 @@ msgid "" "already present in the input strings." msgstr "" -#: ../../whatsnew/3.3.rst:2418 +#: ../../whatsnew/3.3.rst:2420 msgid "" ":func:`email.utils.formataddr` now does the correct content transfer " "encoding when passed non-``ASCII`` display names. Any code that depended on " @@ -4170,7 +4170,7 @@ msgid "" "formatted output string will need to be changed (:issue:`1690608`)." msgstr "" -#: ../../whatsnew/3.3.rst:2423 +#: ../../whatsnew/3.3.rst:2425 msgid "" ":meth:`poplib.POP3.quit` may now raise protocol errors like all other " "``poplib`` methods. Code that assumes ``quit`` does not raise :exc:`poplib." @@ -4178,7 +4178,7 @@ msgid "" "encountered by a particular application (:issue:`11291`)." msgstr "" -#: ../../whatsnew/3.3.rst:2428 +#: ../../whatsnew/3.3.rst:2430 msgid "" "The ``strict`` argument to :class:`email.parser.Parser`, deprecated since " "Python 2.4, has finally been removed." @@ -4186,51 +4186,51 @@ msgstr "" "自 Python 2.4 以來已棄用的 :class:`email.parser.Parser` 的 ``strict`` 引數終" "於被刪除了。" -#: ../../whatsnew/3.3.rst:2431 +#: ../../whatsnew/3.3.rst:2433 msgid "" "The deprecated method ``unittest.TestCase.assertSameElements`` has been " "removed." msgstr "已棄用的方法 ``unittest.TestCase.assertSameElements`` 已被刪除。" -#: ../../whatsnew/3.3.rst:2434 +#: ../../whatsnew/3.3.rst:2436 msgid "The deprecated variable ``time.accept2dyear`` has been removed." msgstr "已棄用的變數 ``time.accept2dyear`` 已被刪除。" -#: ../../whatsnew/3.3.rst:2436 +#: ../../whatsnew/3.3.rst:2438 msgid "" "The deprecated ``Context._clamp`` attribute has been removed from the :mod:" "`decimal` module. It was previously replaced by the public attribute :attr:" "`~decimal.Context.clamp`. (See :issue:`8540`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2440 +#: ../../whatsnew/3.3.rst:2442 msgid "" "The undocumented internal helper class ``SSLFakeFile`` has been removed " "from :mod:`smtplib`, since its functionality has long been provided directly " "by :meth:`socket.socket.makefile`." msgstr "" -#: ../../whatsnew/3.3.rst:2444 +#: ../../whatsnew/3.3.rst:2446 msgid "" "Passing a negative value to :func:`time.sleep` on Windows now raises an " "error instead of sleeping forever. It has always raised an error on posix." msgstr "" -#: ../../whatsnew/3.3.rst:2447 +#: ../../whatsnew/3.3.rst:2449 msgid "" "The ``ast.__version__`` constant has been removed. If you need to make " "decisions affected by the AST version, use :data:`sys.version_info` to make " "the decision." msgstr "" -#: ../../whatsnew/3.3.rst:2451 +#: ../../whatsnew/3.3.rst:2453 msgid "" "Code that used to work around the fact that the :mod:`threading` module used " "factory functions by subclassing the private classes will need to change to " "subclass the now-public classes." msgstr "" -#: ../../whatsnew/3.3.rst:2455 +#: ../../whatsnew/3.3.rst:2457 msgid "" "The undocumented debugging machinery in the threading module has been " "removed, simplifying the code. This should have no effect on production " @@ -4238,24 +4238,24 @@ msgid "" "interacting with it (:issue:`13550`)." msgstr "" -#: ../../whatsnew/3.3.rst:2462 +#: ../../whatsnew/3.3.rst:2464 msgid "Porting C code" msgstr "" -#: ../../whatsnew/3.3.rst:2464 +#: ../../whatsnew/3.3.rst:2466 msgid "" "In the course of changes to the buffer API the undocumented :c:member:`!" "smalltable` member of the :c:type:`Py_buffer` structure has been removed and " "the layout of the :c:type:`PyMemoryViewObject` has changed." msgstr "" -#: ../../whatsnew/3.3.rst:2469 +#: ../../whatsnew/3.3.rst:2471 msgid "" "All extensions relying on the relevant parts in ``memoryobject.h`` or " "``object.h`` must be rebuilt." msgstr "" -#: ../../whatsnew/3.3.rst:2472 +#: ../../whatsnew/3.3.rst:2474 msgid "" "Due to :ref:`PEP 393 `, the :c:type:`Py_UNICODE` type and all " "functions using this type are deprecated (but will stay available for at " @@ -4265,7 +4265,7 @@ msgid "" "doc:`Unicode API <../c-api/unicode>`." msgstr "" -#: ../../whatsnew/3.3.rst:2479 +#: ../../whatsnew/3.3.rst:2481 msgid "" "However, if you only have been using high-level functions such as :c:func:" "`PyUnicode_Concat()`, :c:func:`PyUnicode_Join` or :c:func:" @@ -4273,11 +4273,11 @@ msgid "" "new unicode representations." msgstr "" -#: ../../whatsnew/3.3.rst:2484 +#: ../../whatsnew/3.3.rst:2486 msgid ":c:func:`PyImport_GetMagicNumber` now returns ``-1`` upon failure." msgstr ":c:func:`PyImport_GetMagicNumber` 現在在失敗時回傳 ``-1``。" -#: ../../whatsnew/3.3.rst:2486 +#: ../../whatsnew/3.3.rst:2488 msgid "" "As a negative value for the *level* argument to :func:`__import__` is no " "longer valid, the same now holds for :c:func:`PyImport_ImportModuleLevel`. " @@ -4285,11 +4285,11 @@ msgid "" "`PyImport_ImportModuleEx` is now ``0`` instead of ``-1``." msgstr "" -#: ../../whatsnew/3.3.rst:2493 +#: ../../whatsnew/3.3.rst:2495 msgid "Building C extensions" msgstr "" -#: ../../whatsnew/3.3.rst:2495 +#: ../../whatsnew/3.3.rst:2497 msgid "" "The range of possible file names for C extensions has been narrowed. Very " "rarely used spellings have been suppressed: under POSIX, files named " @@ -4299,32 +4299,32 @@ msgid "" "remove the ``module`` string from the file names)." msgstr "" -#: ../../whatsnew/3.3.rst:2503 +#: ../../whatsnew/3.3.rst:2505 msgid "(implemented in :issue:`14040`.)" msgstr "(於 :issue:`14040` 中實作。)" -#: ../../whatsnew/3.3.rst:2507 +#: ../../whatsnew/3.3.rst:2509 msgid "Command Line Switch Changes" msgstr "命令列開關更改" -#: ../../whatsnew/3.3.rst:2509 +#: ../../whatsnew/3.3.rst:2511 msgid "" "The -Q command-line flag and related artifacts have been removed. Code " "checking sys.flags.division_warning will need updating." msgstr "" -#: ../../whatsnew/3.3.rst:2512 +#: ../../whatsnew/3.3.rst:2514 msgid "(:issue:`10998`, contributed by Éric Araujo.)" msgstr "(由 Éric Araujo 於 :issue:`10998` 中實作。)" -#: ../../whatsnew/3.3.rst:2514 +#: ../../whatsnew/3.3.rst:2516 msgid "" "When :program:`python` is started with :option:`-S`, ``import site`` will no " "longer add site-specific paths to the module search paths. In previous " "versions, it did." msgstr "" -#: ../../whatsnew/3.3.rst:2518 +#: ../../whatsnew/3.3.rst:2520 msgid "" "(:issue:`11591`, contributed by Carl Meyer with editions by Éric Araujo.)" msgstr "(:issue:`11591`,由 Carl Meyer 貢獻並由 Éric Araujo 修訂。)" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 00e2e09a2f..8a11889a89 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -3927,10 +3927,11 @@ msgstr "" #: ../../whatsnew/3.5.rst:2529 msgid "" -"Because the lack of the :attr:`__module__` attribute breaks pickling and " -"introspection, a deprecation warning is now raised for builtin types without " -"the :attr:`__module__` attribute. This would be an AttributeError in the " -"future. (Contributed by Serhiy Storchaka in :issue:`20204`.)" +"Because the lack of the :attr:`~type.__module__` attribute breaks pickling " +"and introspection, a deprecation warning is now raised for builtin types " +"without the :attr:`~type.__module__` attribute. This will be an :exc:" +"`AttributeError` in the future. (Contributed by Serhiy Storchaka in :issue:" +"`20204`.)" msgstr "" #: ../../whatsnew/3.5.rst:2535 diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index e3ad5e1ef2..da12479c9c 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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" @@ -771,7 +771,7 @@ msgstr "" msgid "" "Attributes in a class definition body have a natural ordering: the same " "order in which the names appear in the source. This order is now preserved " -"in the new class's :attr:`~object.__dict__` attribute." +"in the new class's :attr:`~type.__dict__` attribute." msgstr "" #: ../../whatsnew/3.6.rst:554 @@ -1368,9 +1368,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:935 msgid "" "The :func:`~collections.namedtuple` function now accepts an optional keyword " -"argument *module*, which, when specified, is used for the ``__module__`` " -"attribute of the returned named tuple class. (Contributed by Raymond " -"Hettinger in :issue:`17941`.)" +"argument *module*, which, when specified, is used for the :attr:`~type." +"__module__` attribute of the returned named tuple class. (Contributed by " +"Raymond Hettinger in :issue:`17941`.)" msgstr "" #: ../../whatsnew/3.6.rst:940 ../../whatsnew/3.6.rst:2295 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 96ce53c7f5..e380aa9d37 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-04 16:20+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-" @@ -198,7 +198,7 @@ msgid "" "Python as well. Consult the :ref:`removed-in-python-39` section." msgstr "" -#: ../../whatsnew/3.9.rst:140 ../../whatsnew/3.9.rst:1270 +#: ../../whatsnew/3.9.rst:140 ../../whatsnew/3.9.rst:1271 msgid "New Features" msgstr "" @@ -266,7 +266,7 @@ msgid "" "for example ``queue.Queue``." msgstr "" -#: ../../whatsnew/3.9.rst:180 ../../whatsnew/3.9.rst:1158 +#: ../../whatsnew/3.9.rst:180 ../../whatsnew/3.9.rst:1159 msgid "Example:" msgstr "範例:" @@ -985,36 +985,36 @@ msgstr "pydoc" #: ../../whatsnew/3.9.rst:639 msgid "" "The documentation string is now shown not only for class, function, method " -"etc, but for any object that has its own ``__doc__`` attribute. (Contributed " -"by Serhiy Storchaka in :issue:`40257`.)" +"etc, but for any object that has its own :attr:`~definition.__doc__` " +"attribute. (Contributed by Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:644 +#: ../../whatsnew/3.9.rst:645 msgid "random" msgstr "random" -#: ../../whatsnew/3.9.rst:646 +#: ../../whatsnew/3.9.rst:647 msgid "" "Added a new :attr:`random.Random.randbytes` method: generate random bytes. " "(Contributed by Victor Stinner in :issue:`40286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:650 +#: ../../whatsnew/3.9.rst:651 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.9.rst:652 +#: ../../whatsnew/3.9.rst:653 msgid "" "Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to " "signals to a process using a file descriptor instead of a pid. (:issue:" "`38712`)" msgstr "" -#: ../../whatsnew/3.9.rst:656 +#: ../../whatsnew/3.9.rst:657 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.9.rst:658 +#: ../../whatsnew/3.9.rst:659 msgid "" ":class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " @@ -1022,41 +1022,41 @@ msgid "" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:662 +#: ../../whatsnew/3.9.rst:663 msgid "" ":class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. " "(Contributed by Donghee Na in :issue:`39329`.)" msgstr "" -#: ../../whatsnew/3.9.rst:666 +#: ../../whatsnew/3.9.rst:667 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.9.rst:668 +#: ../../whatsnew/3.9.rst:669 msgid "" "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:672 +#: ../../whatsnew/3.9.rst:673 msgid "" "The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" -#: ../../whatsnew/3.9.rst:675 +#: ../../whatsnew/3.9.rst:676 msgid "" "The socket module now has the :func:`socket.send_fds` and :func:`socket." "recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and " "Victor Stinner in :issue:`28724`.)" msgstr "" -#: ../../whatsnew/3.9.rst:681 +#: ../../whatsnew/3.9.rst:682 msgid "time" msgstr "time" -#: ../../whatsnew/3.9.rst:683 +#: ../../whatsnew/3.9.rst:684 msgid "" "On AIX, :func:`~time.thread_time` is now implemented with " "``thread_cputime()`` which has nanosecond resolution, rather than " @@ -1064,11 +1064,11 @@ msgid "" "milliseconds. (Contributed by Batuhan Taskaya in :issue:`40192`)" msgstr "" -#: ../../whatsnew/3.9.rst:689 +#: ../../whatsnew/3.9.rst:690 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.9.rst:691 +#: ../../whatsnew/3.9.rst:692 msgid "" "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 " @@ -1078,29 +1078,29 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:697 +#: ../../whatsnew/3.9.rst:698 msgid "" "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 "" -#: ../../whatsnew/3.9.rst:702 +#: ../../whatsnew/3.9.rst:703 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.9.rst:704 +#: ../../whatsnew/3.9.rst:705 msgid "" "Added :func:`tracemalloc.reset_peak` to set the peak size of traced memory " "blocks to the current size, to measure the peak of specific pieces of code. " "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:709 ../../whatsnew/3.9.rst:1492 +#: ../../whatsnew/3.9.rst:710 ../../whatsnew/3.9.rst:1493 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.9.rst:711 +#: ../../whatsnew/3.9.rst:712 msgid "" ":pep:`593` introduced an :data:`typing.Annotated` type to decorate existing " "types with context-specific metadata and new ``include_extras`` parameter " @@ -1108,20 +1108,20 @@ msgid "" "(Contributed by Till Varoquaux and Konstantin Kashin.)" msgstr "" -#: ../../whatsnew/3.9.rst:717 +#: ../../whatsnew/3.9.rst:718 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.9.rst:719 +#: ../../whatsnew/3.9.rst:720 msgid "" "The Unicode database has been updated to version 13.0.0. (:issue:`39926`)." msgstr "" -#: ../../whatsnew/3.9.rst:722 +#: ../../whatsnew/3.9.rst:723 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.9.rst:724 +#: ../../whatsnew/3.9.rst:725 msgid "" "The activation scripts provided by :mod:`venv` now all specify their prompt " "customization consistently by always using the value specified by " @@ -1131,11 +1131,11 @@ msgid "" "Cannon in :issue:`37663`.)" msgstr "" -#: ../../whatsnew/3.9.rst:732 +#: ../../whatsnew/3.9.rst:733 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.9.rst:734 +#: ../../whatsnew/3.9.rst:735 msgid "" "White space characters within attributes are now preserved when serializing :" "mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized to " @@ -1143,32 +1143,32 @@ msgid "" "2.11 of XML spec. (Contributed by Mefistotelis in :issue:`39011`.)" msgstr "" -#: ../../whatsnew/3.9.rst:742 +#: ../../whatsnew/3.9.rst:743 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.9.rst:744 +#: ../../whatsnew/3.9.rst:745 msgid "" "Optimized the idiom for assignment a temporary variable in comprehensions. " "Now ``for y in [expr]`` in comprehensions is as fast as a simple assignment " "``y = expr``. For example:" msgstr "" -#: ../../whatsnew/3.9.rst:748 +#: ../../whatsnew/3.9.rst:749 msgid "sums = [s for s in [0] for x in data for s in [s + x]]" msgstr "sums = [s for s in [0] for x in data for s in [s + x]]" -#: ../../whatsnew/3.9.rst:750 +#: ../../whatsnew/3.9.rst:751 msgid "" "Unlike the ``:=`` operator this idiom does not leak a variable to the outer " "scope." msgstr "" -#: ../../whatsnew/3.9.rst:753 +#: ../../whatsnew/3.9.rst:754 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`32856` 中貢獻。)" -#: ../../whatsnew/3.9.rst:755 +#: ../../whatsnew/3.9.rst:756 msgid "" "Optimized signal handling in multithreaded applications. If a thread " "different than the main thread gets a signal, the bytecode evaluation loop " @@ -1177,27 +1177,27 @@ msgid "" "interpreter can handle signals." msgstr "" -#: ../../whatsnew/3.9.rst:761 +#: ../../whatsnew/3.9.rst:762 msgid "" "Previously, the bytecode evaluation loop was interrupted at each instruction " "until the main thread handles signals. (Contributed by Victor Stinner in :" "issue:`40010`.)" msgstr "" -#: ../../whatsnew/3.9.rst:765 +#: ../../whatsnew/3.9.rst:766 msgid "" "Optimized the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " "(Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor " "Stinner in :issue:`38061`.)" msgstr "" -#: ../../whatsnew/3.9.rst:769 +#: ../../whatsnew/3.9.rst:770 msgid "" ":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " "into :c:expr:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" msgstr "" -#: ../../whatsnew/3.9.rst:773 +#: ../../whatsnew/3.9.rst:774 msgid "" "A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :" "class:`frozenset`, :class:`list`, :class:`dict`) are now sped up by using :" @@ -1205,14 +1205,14 @@ msgid "" "Jeroen Demeyer and Petr Viktorin in :issue:`37207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:778 +#: ../../whatsnew/3.9.rst:779 msgid "" "Optimized :func:`~set.difference_update` for the case when the other set is " "much larger than the base set. (Suggested by Evgeny Kapun with code " "contributed by Michele Orrù in :issue:`8425`.)" msgstr "" -#: ../../whatsnew/3.9.rst:782 +#: ../../whatsnew/3.9.rst:783 msgid "" "Python's small object allocator (``obmalloc.c``) now allows (no more than) " "one empty arena to remain available for immediate reuse, without returning " @@ -1221,26 +1221,26 @@ msgid "" "in :issue:`37257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:788 +#: ../../whatsnew/3.9.rst:789 msgid "" ":term:`floor division` of float operation now has a better performance. Also " "the message of :exc:`ZeroDivisionError` for this operation is updated. " "(Contributed by Donghee Na in :issue:`39434`.)" msgstr "" -#: ../../whatsnew/3.9.rst:792 +#: ../../whatsnew/3.9.rst:793 msgid "" "Decoding short ASCII strings with UTF-8 and ascii codecs is now about 15% " "faster. (Contributed by Inada Naoki in :issue:`37348`.)" msgstr "" -#: ../../whatsnew/3.9.rst:795 +#: ../../whatsnew/3.9.rst:796 msgid "" "Here's a summary of performance improvements from Python 3.4 through Python " "3.9:" msgstr "" -#: ../../whatsnew/3.9.rst:797 +#: ../../whatsnew/3.9.rst:798 msgid "" "Python version 3.4 3.5 3.6 3.7 3.8 " "3.9\n" @@ -1388,7 +1388,7 @@ msgstr "" " loop_overhead 0.5 0.6 0.4 0.3 0.3 " "0.3" -#: ../../whatsnew/3.9.rst:842 +#: ../../whatsnew/3.9.rst:843 msgid "" "These results were generated from the variable access benchmark script at: " "``Tools/scripts/var_access_benchmark.py``. The benchmark script displays " @@ -1399,18 +1399,18 @@ msgid "" "python.org/downloads/macos/>`_." msgstr "" -#: ../../whatsnew/3.9.rst:852 +#: ../../whatsnew/3.9.rst:853 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.9.rst:854 +#: ../../whatsnew/3.9.rst:855 msgid "" "The distutils ``bdist_msi`` command is now deprecated, use ``bdist_wheel`` " "(wheel packages) instead. (Contributed by Hugo van Kemenade in :issue:" "`39586`.)" msgstr "" -#: ../../whatsnew/3.9.rst:858 +#: ../../whatsnew/3.9.rst:859 msgid "" "Currently :func:`math.factorial` accepts :class:`float` instances with non-" "negative integer values (like ``5.0``). It raises a :exc:`ValueError` for " @@ -1419,7 +1419,7 @@ msgid "" "Serhiy Storchaka in :issue:`37315`.)" msgstr "" -#: ../../whatsnew/3.9.rst:864 +#: ../../whatsnew/3.9.rst:865 msgid "" "The :mod:`!parser` and :mod:`!symbol` modules are deprecated and will be " "removed in future versions of Python. For the majority of use cases, users " @@ -1427,7 +1427,7 @@ msgid "" "stage, using the :mod:`ast` module." msgstr "" -#: ../../whatsnew/3.9.rst:869 +#: ../../whatsnew/3.9.rst:870 msgid "" "The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" "func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" @@ -1435,7 +1435,7 @@ msgid "" "and will be removed in Python 3.10 together with the old parser." msgstr "" -#: ../../whatsnew/3.9.rst:874 +#: ../../whatsnew/3.9.rst:875 msgid "" "Using :data:`NotImplemented` in a boolean context has been deprecated, as it " "is almost exclusively the result of incorrect rich comparator " @@ -1443,7 +1443,7 @@ msgid "" "Python. (Contributed by Josh Rosenberg in :issue:`35712`.)" msgstr "" -#: ../../whatsnew/3.9.rst:880 +#: ../../whatsnew/3.9.rst:881 msgid "" "The :mod:`random` module currently accepts any hashable type as a possible " "seed value. Unfortunately, some of those types are not guaranteed to have a " @@ -1452,7 +1452,7 @@ msgid "" "`bytes`, and :class:`bytearray`." msgstr "" -#: ../../whatsnew/3.9.rst:886 +#: ../../whatsnew/3.9.rst:887 msgid "" "Opening the :class:`~gzip.GzipFile` file for writing without specifying the " "*mode* argument is deprecated. In future Python versions it will always be " @@ -1461,39 +1461,39 @@ msgid "" "issue:`28286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:892 +#: ../../whatsnew/3.9.rst:893 msgid "" "Deprecated the ``split()`` method of :class:`!_tkinter.TkappType` in favour " "of the ``splitlist()`` method which has more consistent and predictable " "behavior. (Contributed by Serhiy Storchaka in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.9.rst:897 +#: ../../whatsnew/3.9.rst:898 msgid "" "The explicit passing of coroutine objects to :func:`asyncio.wait` has been " "deprecated and will be removed in version 3.11. (Contributed by Yury " "Selivanov and Kyle Stanley in :issue:`34790`.)" msgstr "" -#: ../../whatsnew/3.9.rst:901 +#: ../../whatsnew/3.9.rst:902 msgid "" "binhex4 and hexbin4 standards are now deprecated. The :mod:`!binhex` module " "and the following :mod:`binascii` functions are now deprecated:" msgstr "" -#: ../../whatsnew/3.9.rst:904 +#: ../../whatsnew/3.9.rst:905 msgid ":func:`!b2a_hqx`, :func:`!a2b_hqx`" msgstr ":func:`!b2a_hqx`、:func:`!a2b_hqx`" -#: ../../whatsnew/3.9.rst:905 +#: ../../whatsnew/3.9.rst:906 msgid ":func:`!rlecode_hqx`, :func:`!rledecode_hqx`" msgstr ":func:`!rlecode_hqx`、:func:`!rledecode_hqx`" -#: ../../whatsnew/3.9.rst:907 +#: ../../whatsnew/3.9.rst:908 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" msgstr "(由 Victor Stinner 在 :issue:`39353` 中貢獻。)" -#: ../../whatsnew/3.9.rst:909 +#: ../../whatsnew/3.9.rst:910 msgid "" ":mod:`ast` classes ``slice``, ``Index`` and ``ExtSlice`` are considered " "deprecated and will be removed in future Python versions. ``value`` itself " @@ -1502,7 +1502,7 @@ msgid "" "Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:915 +#: ../../whatsnew/3.9.rst:916 msgid "" ":mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore`` are " "considered deprecated and will be removed in future Python versions. They " @@ -1511,7 +1511,7 @@ msgid "" "`39969` and Serhiy Storchaka in :issue:`39988`.)" msgstr "" -#: ../../whatsnew/3.9.rst:922 +#: ../../whatsnew/3.9.rst:923 msgid "" "The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" @@ -1520,20 +1520,20 @@ msgid "" "in :issue:`39877`.)" msgstr "" -#: ../../whatsnew/3.9.rst:928 +#: ../../whatsnew/3.9.rst:929 msgid "" "Passing ``None`` as the first argument to the :func:`shlex.split` function " "has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.)" msgstr "" -#: ../../whatsnew/3.9.rst:931 +#: ../../whatsnew/3.9.rst:932 msgid "" ":func:`!smtpd.MailmanProxy` is now deprecated as it is unusable without an " "external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" "`35800`.)" msgstr "" -#: ../../whatsnew/3.9.rst:934 +#: ../../whatsnew/3.9.rst:935 msgid "" "The :mod:`!lib2to3` module now emits a :exc:`PendingDeprecationWarning`. " "Python 3.9 switched to a PEG parser (see :pep:`617`), and Python 3.10 may " @@ -1543,22 +1543,22 @@ msgid "" "or `parso`_. (Contributed by Carl Meyer in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.9.rst:942 +#: ../../whatsnew/3.9.rst:943 msgid "" "The *random* parameter of :func:`random.shuffle` has been deprecated. " "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:951 ../../whatsnew/3.9.rst:1406 +#: ../../whatsnew/3.9.rst:952 ../../whatsnew/3.9.rst:1407 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.9.rst:953 +#: ../../whatsnew/3.9.rst:954 msgid "" "The erroneous version at :data:`!unittest.mock.__version__` has been removed." msgstr "" -#: ../../whatsnew/3.9.rst:955 +#: ../../whatsnew/3.9.rst:956 msgid "" ":class:`!nntplib.NNTP`: ``xpath()`` and ``xgtitle()`` methods have been " "removed. These methods are deprecated since Python 3.3. Generally, these " @@ -1568,14 +1568,14 @@ msgid "" "`39366`.)" msgstr "" -#: ../../whatsnew/3.9.rst:962 +#: ../../whatsnew/3.9.rst:963 msgid "" ":class:`array.array`: ``tostring()`` and ``fromstring()`` methods have been " "removed. They were aliases to ``tobytes()`` and ``frombytes()``, deprecated " "since Python 3.2. (Contributed by Victor Stinner in :issue:`38916`.)" msgstr "" -#: ../../whatsnew/3.9.rst:967 +#: ../../whatsnew/3.9.rst:968 msgid "" "The undocumented ``sys.callstats()`` function has been removed. Since Python " "3.7, it was deprecated and always returned :const:`None`. It required a " @@ -1583,7 +1583,7 @@ msgid "" "3.7. (Contributed by Victor Stinner in :issue:`37414`.)" msgstr "" -#: ../../whatsnew/3.9.rst:972 +#: ../../whatsnew/3.9.rst:973 msgid "" "The ``sys.getcheckinterval()`` and ``sys.setcheckinterval()`` functions have " "been removed. They were deprecated since Python 3.2. Use :func:`sys." @@ -1591,21 +1591,21 @@ msgid "" "by Victor Stinner in :issue:`37392`.)" msgstr "" -#: ../../whatsnew/3.9.rst:977 +#: ../../whatsnew/3.9.rst:978 msgid "" "The C function ``PyImport_Cleanup()`` has been removed. It was documented " "as: \"Empty the module table. For internal use only.\" (Contributed by " "Victor Stinner in :issue:`36710`.)" msgstr "" -#: ../../whatsnew/3.9.rst:981 +#: ../../whatsnew/3.9.rst:982 msgid "" "``_dummy_thread`` and ``dummy_threading`` modules have been removed. These " "modules were deprecated since Python 3.7 which requires threading support. " "(Contributed by Victor Stinner in :issue:`37312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:985 +#: ../../whatsnew/3.9.rst:986 msgid "" "``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to " "``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open` have been " @@ -1613,14 +1613,14 @@ msgid "" "Stinner in :issue:`37320`.)" msgstr "" -#: ../../whatsnew/3.9.rst:990 +#: ../../whatsnew/3.9.rst:991 msgid "" "The :meth:`!isAlive` method of :class:`threading.Thread` has been removed. " "It was deprecated since Python 3.8. Use :meth:`~threading.Thread.is_alive` " "instead. (Contributed by Donghee Na in :issue:`37804`.)" msgstr "" -#: ../../whatsnew/3.9.rst:995 +#: ../../whatsnew/3.9.rst:996 msgid "" "Methods ``getchildren()`` and ``getiterator()`` of classes :class:`~xml." "etree.ElementTree.ElementTree` and :class:`~xml.etree.ElementTree.Element` " @@ -1630,7 +1630,7 @@ msgid "" "getiterator()``. (Contributed by Serhiy Storchaka in :issue:`36543`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1003 +#: ../../whatsnew/3.9.rst:1004 msgid "" "The old :mod:`plistlib` API has been removed, it was deprecated since Python " "3.4. Use the :func:`~plistlib.load`, :func:`~plistlib.loads`, :func:" @@ -1639,7 +1639,7 @@ msgid "" "are always used instead. (Contributed by Jon Janzen in :issue:`36409`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1009 +#: ../../whatsnew/3.9.rst:1010 msgid "" "The C function ``PyGen_NeedsFinalizing`` has been removed. It was not " "documented, tested, or used anywhere within CPython after the implementation " @@ -1647,7 +1647,7 @@ msgid "" "in :issue:`15088`)" msgstr "" -#: ../../whatsnew/3.9.rst:1014 +#: ../../whatsnew/3.9.rst:1015 msgid "" "``base64.encodestring()`` and ``base64.decodestring()``, aliases deprecated " "since Python 3.1, have been removed: use :func:`base64.encodebytes` and :" @@ -1655,14 +1655,14 @@ msgid "" "`39351`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1019 +#: ../../whatsnew/3.9.rst:1020 msgid "" "``fractions.gcd()`` function has been removed, it was deprecated since " "Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead. (Contributed by " "Victor Stinner in :issue:`39350`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1023 +#: ../../whatsnew/3.9.rst:1024 msgid "" "The *buffering* parameter of :class:`bz2.BZ2File` has been removed. Since " "Python 3.0, it was ignored and using it emitted a :exc:`DeprecationWarning`. " @@ -1670,7 +1670,7 @@ msgid "" "Victor Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1028 +#: ../../whatsnew/3.9.rst:1029 msgid "" "The *encoding* parameter of :func:`json.loads` has been removed. As of " "Python 3.1, it was deprecated and ignored; using it has emitted a :exc:" @@ -1678,7 +1678,7 @@ msgid "" "`39377`)" msgstr "" -#: ../../whatsnew/3.9.rst:1033 +#: ../../whatsnew/3.9.rst:1034 msgid "" "``with (await asyncio.lock):`` and ``with (yield from asyncio.lock):`` " "statements are not longer supported, use ``async with lock`` instead. The " @@ -1686,7 +1686,7 @@ msgid "" "(Contributed by Andrew Svetlov in :issue:`34793`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1038 +#: ../../whatsnew/3.9.rst:1039 msgid "" "The :func:`!sys.getcounts` function, the ``-X showalloccount`` command line " "option and the ``show_alloc_count`` field of the C structure :c:type:" @@ -1695,7 +1695,7 @@ msgid "" "`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1044 +#: ../../whatsnew/3.9.rst:1045 msgid "" "The ``_field_types`` attribute of the :class:`typing.NamedTuple` class has " "been removed. It was deprecated since Python 3.8. Use the " @@ -1703,14 +1703,14 @@ msgid "" "issue:`40182`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1049 +#: ../../whatsnew/3.9.rst:1050 msgid "" "The :meth:`!symtable.SymbolTable.has_exec` method has been removed. It was " "deprecated since 2006, and only returning ``False`` when it's called. " "(Contributed by Batuhan Taskaya in :issue:`40208`)" msgstr "" -#: ../../whatsnew/3.9.rst:1053 +#: ../../whatsnew/3.9.rst:1054 msgid "" "The :meth:`!asyncio.Task.current_task` and :meth:`!asyncio.Task.all_tasks` " "have been removed. They were deprecated since Python 3.7 and you can use :" @@ -1718,7 +1718,7 @@ msgid "" "(Contributed by Rémi Lapeyre in :issue:`40967`)" msgstr "" -#: ../../whatsnew/3.9.rst:1058 +#: ../../whatsnew/3.9.rst:1059 msgid "" "The ``unescape()`` method in the :class:`html.parser.HTMLParser` class has " "been removed (it was deprecated since Python 3.4). :func:`html.unescape` " @@ -1726,21 +1726,21 @@ msgid "" "unicode characters." msgstr "" -#: ../../whatsnew/3.9.rst:1065 ../../whatsnew/3.9.rst:1332 +#: ../../whatsnew/3.9.rst:1066 ../../whatsnew/3.9.rst:1333 msgid "Porting to Python 3.9" msgstr "" -#: ../../whatsnew/3.9.rst:1067 +#: ../../whatsnew/3.9.rst:1068 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.9.rst:1072 +#: ../../whatsnew/3.9.rst:1073 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.9.rst:1074 +#: ../../whatsnew/3.9.rst:1075 msgid "" ":func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:" "`ImportError` where it previously raised :exc:`ValueError`. Callers catching " @@ -1748,26 +1748,26 @@ msgid "" "versions will need to catch both using ``except (ImportError, ValueError):``." msgstr "" -#: ../../whatsnew/3.9.rst:1079 +#: ../../whatsnew/3.9.rst:1080 msgid "" "The :mod:`venv` activation scripts no longer special-case when " "``__VENV_PROMPT__`` is set to ``\"\"``." msgstr "" -#: ../../whatsnew/3.9.rst:1082 +#: ../../whatsnew/3.9.rst:1083 msgid "" "The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1086 +#: ../../whatsnew/3.9.rst:1087 msgid "" "The *compresslevel* parameter of :class:`bz2.BZ2File` became keyword-only, " "since the *buffering* parameter has been removed. (Contributed by Victor " "Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1090 +#: ../../whatsnew/3.9.rst:1091 msgid "" "Simplified AST for subscription. Simple indices will be represented by their " "value, extended slices will be represented as tuples. ``Index(value)`` will " @@ -1775,21 +1775,21 @@ msgid "" "Load())``. (Contributed by Serhiy Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1096 +#: ../../whatsnew/3.9.rst:1097 msgid "" "The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` " "environment variable when the :option:`-E` or :option:`-I` command line " "options are being used." msgstr "" -#: ../../whatsnew/3.9.rst:1100 +#: ../../whatsnew/3.9.rst:1101 msgid "" "The *encoding* parameter has been added to the classes :class:`ftplib.FTP` " "and :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default " "encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../whatsnew/3.9.rst:1104 +#: ../../whatsnew/3.9.rst:1105 msgid "" ":meth:`asyncio.loop.shutdown_default_executor` has been added to :class:" "`~asyncio.AbstractEventLoop`, meaning alternative event loops that inherit " @@ -1797,7 +1797,7 @@ msgid "" "issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1109 +#: ../../whatsnew/3.9.rst:1110 msgid "" "The constant values of future flags in the :mod:`__future__` module is " "updated in order to prevent collision with compiler flags. Previously " @@ -1805,7 +1805,7 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`39562`)" msgstr "" -#: ../../whatsnew/3.9.rst:1114 +#: ../../whatsnew/3.9.rst:1115 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of " "``Py_UNICODE``. This change doesn't affect to its behavior because " @@ -1813,7 +1813,7 @@ msgid "" "by Inada Naoki in :issue:`34538`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1119 +#: ../../whatsnew/3.9.rst:1120 msgid "" "The :func:`logging.getLogger` API now returns the root logger when passed " "the name ``'root'``, whereas previously it returned a non-root logger named " @@ -1823,7 +1823,7 @@ msgid "" "(Contributed by Vinay Sajip in :issue:`37742`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1126 +#: ../../whatsnew/3.9.rst:1127 msgid "" "Division handling of :class:`~pathlib.PurePath` now returns :data:" "`NotImplemented` instead of raising a :exc:`TypeError` when passed something " @@ -1832,7 +1832,7 @@ msgid "" "types. (Contributed by Roger Aiudi in :issue:`34775`)." msgstr "" -#: ../../whatsnew/3.9.rst:1132 +#: ../../whatsnew/3.9.rst:1133 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. Leading zeros are ambiguous and " @@ -1842,7 +1842,7 @@ msgid "" "leading zeros. (Contributed by Christian Heimes in :issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:1140 +#: ../../whatsnew/3.9.rst:1141 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" "`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " @@ -1851,11 +1851,11 @@ msgid "" "in :issue:`37751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1148 +#: ../../whatsnew/3.9.rst:1149 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.9.rst:1150 +#: ../../whatsnew/3.9.rst:1151 msgid "" "Instances of :ref:`heap-allocated types ` (such as those created " "with :c:func:`PyType_FromSpec` and similar APIs) hold a reference to their " @@ -1866,7 +1866,7 @@ msgid "" "heap-allocated types visit the object's type." msgstr "" -#: ../../whatsnew/3.9.rst:1160 +#: ../../whatsnew/3.9.rst:1161 msgid "" "int\n" "foo_traverse(foo_struct *self, visitproc visit, void *arg) {\n" @@ -1878,7 +1878,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.9.rst:1171 +#: ../../whatsnew/3.9.rst:1172 msgid "" "If your traverse function delegates to ``tp_traverse`` of its base class (or " "another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that " @@ -1886,19 +1886,19 @@ msgid "" "``tp_traverse``." msgstr "" -#: ../../whatsnew/3.9.rst:1176 +#: ../../whatsnew/3.9.rst:1177 msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1178 +#: ../../whatsnew/3.9.rst:1179 msgid "base->tp_traverse(self, visit, arg)" msgstr "base->tp_traverse(self, visit, arg)" -#: ../../whatsnew/3.9.rst:1182 +#: ../../whatsnew/3.9.rst:1183 msgid "then add:" msgstr "" -#: ../../whatsnew/3.9.rst:1184 +#: ../../whatsnew/3.9.rst:1185 msgid "" "#if PY_VERSION_HEX >= 0x03090000\n" " // This was not needed before Python 3.9 (bpo-35810 and bpo-40217)\n" @@ -1910,11 +1910,11 @@ msgid "" "#else" msgstr "" -#: ../../whatsnew/3.9.rst:1195 +#: ../../whatsnew/3.9.rst:1196 msgid "(See :issue:`35810` and :issue:`40217` for more information.)" msgstr "(更多資訊請見 :issue:`35810` 與 :issue:`40217`。)" -#: ../../whatsnew/3.9.rst:1197 +#: ../../whatsnew/3.9.rst:1198 msgid "" "The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, " "``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated. " @@ -1922,11 +1922,11 @@ msgid "" "issue:`29548`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1203 +#: ../../whatsnew/3.9.rst:1204 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.9.rst:1205 +#: ../../whatsnew/3.9.rst:1206 msgid "" "The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the :" "keyword:`assert` statement. Previously, the assert statement would not work " @@ -1934,37 +1934,37 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34880`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1210 +#: ../../whatsnew/3.9.rst:1211 msgid "" "The :opcode:`COMPARE_OP` opcode was split into four distinct instructions:" msgstr "" -#: ../../whatsnew/3.9.rst:1212 +#: ../../whatsnew/3.9.rst:1213 msgid "``COMPARE_OP`` for rich comparisons" msgstr "" -#: ../../whatsnew/3.9.rst:1213 +#: ../../whatsnew/3.9.rst:1214 msgid "``IS_OP`` for 'is' and 'is not' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1214 +#: ../../whatsnew/3.9.rst:1215 msgid "``CONTAINS_OP`` for 'in' and 'not in' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1215 +#: ../../whatsnew/3.9.rst:1216 msgid "" "``JUMP_IF_NOT_EXC_MATCH`` for checking exceptions in 'try-except' statements." msgstr "" -#: ../../whatsnew/3.9.rst:1218 +#: ../../whatsnew/3.9.rst:1219 msgid "(Contributed by Mark Shannon in :issue:`39156`.)" msgstr "(由 Mark Shannon 在 :issue:`39156` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1222 +#: ../../whatsnew/3.9.rst:1223 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.9.rst:1224 +#: ../../whatsnew/3.9.rst:1225 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " "platform-specific library directory, stored in the new :data:`sys." @@ -1973,26 +1973,26 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1230 +#: ../../whatsnew/3.9.rst:1231 msgid "" "The ``COUNT_ALLOCS`` special build macro has been removed. (Contributed by " "Victor Stinner in :issue:`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1233 +#: ../../whatsnew/3.9.rst:1234 msgid "" "On non-Windows platforms, the :c:func:`!setenv` and :c:func:`!unsetenv` " "functions are now required to build Python. (Contributed by Victor Stinner " "in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1237 +#: ../../whatsnew/3.9.rst:1238 msgid "" "On non-Windows platforms, creating ``bdist_wininst`` installers is now " "officially unsupported. (See :issue:`10945` for more details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1240 +#: ../../whatsnew/3.9.rst:1241 msgid "" "When building Python on macOS from source, ``_tkinter`` now links with non-" "system Tcl and Tk frameworks if they are installed in ``/Library/" @@ -2003,13 +2003,13 @@ msgid "" "(Contributed by Ned Deily in :issue:`34956`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1249 +#: ../../whatsnew/3.9.rst:1250 msgid "" "Python can now be built for Windows 10 ARM64. (Contributed by Steve Dower " "in :issue:`33125`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1252 +#: ../../whatsnew/3.9.rst:1253 msgid "" "Some individual tests are now skipped when ``--pgo`` is used. The tests in " "question increased the PGO task time significantly and likely didn't help " @@ -2025,11 +2025,11 @@ msgid "" "details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1267 +#: ../../whatsnew/3.9.rst:1268 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.9.rst:1272 +#: ../../whatsnew/3.9.rst:1273 msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " @@ -2038,20 +2038,20 @@ msgid "" "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1279 +#: ../../whatsnew/3.9.rst:1280 msgid "" "Added :c:func:`PyFrame_GetCode` function: get a frame code. Added :c:func:" "`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1283 +#: ../../whatsnew/3.9.rst:1284 msgid "" "Added :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1286 +#: ../../whatsnew/3.9.rst:1287 msgid "" "Added :c:func:`PyThreadState_GetInterpreter` and :c:func:" "`PyInterpreterState_Get` functions to get the interpreter. Added :c:func:" @@ -2061,7 +2061,7 @@ msgid "" "issue:`39947`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1294 +#: ../../whatsnew/3.9.rst:1295 msgid "" "Added a new public :c:func:`PyObject_CallNoArgs` function to the C API, " "which calls a callable Python object without any arguments. It is the most " @@ -2069,11 +2069,11 @@ msgid "" "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1299 ../../whatsnew/3.9.rst:1417 +#: ../../whatsnew/3.9.rst:1300 ../../whatsnew/3.9.rst:1418 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" -#: ../../whatsnew/3.9.rst:1301 +#: ../../whatsnew/3.9.rst:1302 msgid "" "Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` " "as regular functions for the limited API. Previously, there were defined as " @@ -2082,23 +2082,23 @@ msgid "" "the limited C API)." msgstr "" -#: ../../whatsnew/3.9.rst:1307 +#: ../../whatsnew/3.9.rst:1308 msgid "" "``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular \"opaque\" " "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1310 ../../whatsnew/3.9.rst:1444 +#: ../../whatsnew/3.9.rst:1311 ../../whatsnew/3.9.rst:1445 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "(由 Victor Stinner 在 38644 和 39542 中貢獻。)" -#: ../../whatsnew/3.9.rst:1312 +#: ../../whatsnew/3.9.rst:1313 msgid "" "The :c:func:`PyModule_AddType` function is added to help adding a type to a " "module. (Contributed by Donghee Na in :issue:`40024`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1316 +#: ../../whatsnew/3.9.rst:1317 msgid "" "Added the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" "`PyObject_GC_IsFinalized` to the public API to allow to query if Python " @@ -2107,27 +2107,27 @@ msgid "" "issue:`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1322 +#: ../../whatsnew/3.9.rst:1323 msgid "" "Added :c:func:`!_PyObject_FunctionStr` to get a user-friendly string " "representation of a function-like object. (Patch by Jeroen Demeyer in :issue:" "`37645`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1326 +#: ../../whatsnew/3.9.rst:1327 msgid "" "Added :c:func:`PyObject_CallOneArg` for calling an object with one " "positional argument (Patch by Jeroen Demeyer in :issue:`37483`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1334 +#: ../../whatsnew/3.9.rst:1335 msgid "" "``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory " "*tstate* parameter (``PyThreadState*``). (Contributed by Victor Stinner in :" "issue:`38500`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1338 +#: ../../whatsnew/3.9.rst:1339 msgid "" "Extension modules: :c:member:`~PyModuleDef.m_traverse`, :c:member:" "`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` functions of :c:" @@ -2139,12 +2139,12 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../whatsnew/3.9.rst:1347 +#: ../../whatsnew/3.9.rst:1348 msgid "" "Extension modules without module state (``m_size <= 0``) are not affected." msgstr "" -#: ../../whatsnew/3.9.rst:1349 +#: ../../whatsnew/3.9.rst:1350 msgid "" "If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function " "is now scheduled to be called from the subinterpreter, rather than being " @@ -2152,7 +2152,7 @@ msgid "" "of scheduled calls. (Contributed by Victor Stinner in :issue:`39984`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1355 +#: ../../whatsnew/3.9.rst:1356 msgid "" "The Windows registry is no longer used to initialize :data:`sys.path` when " "the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to " @@ -2160,21 +2160,21 @@ msgid "" "by Zackery Spytz in :issue:`8901`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1360 +#: ../../whatsnew/3.9.rst:1361 msgid "" "The global variable :c:data:`PyStructSequence_UnnamedField` is now a " "constant and refers to a constant string. (Contributed by Serhiy Storchaka " "in :issue:`38650`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1364 +#: ../../whatsnew/3.9.rst:1365 msgid "" "The :c:type:`!PyGC_Head` structure is now opaque. It is only defined in the " "internal C API (``pycore_gc.h``). (Contributed by Victor Stinner in :issue:" "`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1368 +#: ../../whatsnew/3.9.rst:1369 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" "func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " @@ -2183,7 +2183,7 @@ msgid "" "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1375 +#: ../../whatsnew/3.9.rst:1376 msgid "" "The :c:func:`Py_FatalError` function is replaced with a macro which logs " "automatically the name of the current function, unless the " @@ -2191,22 +2191,22 @@ msgid "" "issue:`39882`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1380 +#: ../../whatsnew/3.9.rst:1381 msgid "" "The vectorcall protocol now requires that the caller passes only strings as " "keyword names. (See :issue:`37540` for more information.)" msgstr "" -#: ../../whatsnew/3.9.rst:1383 +#: ../../whatsnew/3.9.rst:1384 msgid "" "Implementation details of a number of macros and functions are now hidden:" msgstr "" -#: ../../whatsnew/3.9.rst:1385 +#: ../../whatsnew/3.9.rst:1386 msgid ":c:func:`PyObject_IS_GC` macro was converted to a function." msgstr "" -#: ../../whatsnew/3.9.rst:1387 +#: ../../whatsnew/3.9.rst:1388 msgid "" "The :c:func:`!PyObject_NEW` macro becomes an alias to the :c:macro:" "`PyObject_New` macro, and the :c:func:`!PyObject_NEW_VAR` macro becomes an " @@ -2214,38 +2214,38 @@ msgid "" "directly the :c:member:`PyTypeObject.tp_basicsize` member." msgstr "" -#: ../../whatsnew/3.9.rst:1392 +#: ../../whatsnew/3.9.rst:1393 msgid "" ":c:func:`!PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " "the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " "member." msgstr "" -#: ../../whatsnew/3.9.rst:1396 +#: ../../whatsnew/3.9.rst:1397 msgid "" ":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " "accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." msgstr "" -#: ../../whatsnew/3.9.rst:1399 +#: ../../whatsnew/3.9.rst:1400 msgid "" ":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " "implementation details: removed the ``PyIndex_Check()`` macro. The macro " "accessed directly the :c:member:`PyTypeObject.tp_as_number` member." msgstr "" -#: ../../whatsnew/3.9.rst:1403 +#: ../../whatsnew/3.9.rst:1404 msgid "(See :issue:`40170` for more details.)" msgstr "(更多資訊請見 :issue:`40170`。)" -#: ../../whatsnew/3.9.rst:1408 +#: ../../whatsnew/3.9.rst:1409 msgid "" "Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1412 +#: ../../whatsnew/3.9.rst:1413 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2253,89 +2253,89 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1419 +#: ../../whatsnew/3.9.rst:1420 msgid "Excluded the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1422 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1424 msgid "``_Py_CheckRecursionLimit``" msgstr "``_Py_CheckRecursionLimit``" -#: ../../whatsnew/3.9.rst:1424 +#: ../../whatsnew/3.9.rst:1425 msgid "``_Py_NewReference()``" msgstr "``_Py_NewReference()``" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1426 msgid "``_Py_ForgetReference()``" msgstr "``_Py_ForgetReference()``" -#: ../../whatsnew/3.9.rst:1426 +#: ../../whatsnew/3.9.rst:1427 msgid "``_PyTraceMalloc_NewReference()``" msgstr "``_PyTraceMalloc_NewReference()``" -#: ../../whatsnew/3.9.rst:1427 +#: ../../whatsnew/3.9.rst:1428 msgid "``_Py_GetRefTotal()``" msgstr "``_Py_GetRefTotal()``" -#: ../../whatsnew/3.9.rst:1428 +#: ../../whatsnew/3.9.rst:1429 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1429 +#: ../../whatsnew/3.9.rst:1430 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "``PyTrash_UNWIND_LEVEL``" -#: ../../whatsnew/3.9.rst:1430 +#: ../../whatsnew/3.9.rst:1431 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "``Py_TRASHCAN_BEGIN_CONDITION``" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1432 msgid "``Py_TRASHCAN_BEGIN``" msgstr "``Py_TRASHCAN_BEGIN``" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1433 msgid "``Py_TRASHCAN_END``" msgstr "``Py_TRASHCAN_END``" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1434 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "``Py_TRASHCAN_SAFE_BEGIN``" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1435 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "``Py_TRASHCAN_SAFE_END``" -#: ../../whatsnew/3.9.rst:1436 +#: ../../whatsnew/3.9.rst:1437 msgid "Moved following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1438 +#: ../../whatsnew/3.9.rst:1439 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "``_PyDebug_PrintTotalRefs()``" -#: ../../whatsnew/3.9.rst:1439 +#: ../../whatsnew/3.9.rst:1440 msgid "``_Py_PrintReferences()``" msgstr "``_Py_PrintReferences()``" -#: ../../whatsnew/3.9.rst:1440 +#: ../../whatsnew/3.9.rst:1441 msgid "``_Py_PrintReferenceAddresses()``" msgstr "``_Py_PrintReferenceAddresses()``" -#: ../../whatsnew/3.9.rst:1441 +#: ../../whatsnew/3.9.rst:1442 msgid "``_Py_tracemalloc_config``" msgstr "``_Py_tracemalloc_config``" -#: ../../whatsnew/3.9.rst:1442 +#: ../../whatsnew/3.9.rst:1443 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1446 +#: ../../whatsnew/3.9.rst:1447 msgid "" "Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " @@ -2343,72 +2343,72 @@ msgid "" "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1451 +#: ../../whatsnew/3.9.rst:1452 msgid "" "Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1456 +#: ../../whatsnew/3.9.rst:1457 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "``PyAsyncGen_ClearFreeLists()``" -#: ../../whatsnew/3.9.rst:1457 +#: ../../whatsnew/3.9.rst:1458 msgid "``PyContext_ClearFreeList()``" msgstr "``PyContext_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1458 +#: ../../whatsnew/3.9.rst:1459 msgid "``PyDict_ClearFreeList()``" msgstr "``PyDict_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1459 +#: ../../whatsnew/3.9.rst:1460 msgid "``PyFloat_ClearFreeList()``" msgstr "``PyFloat_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1460 +#: ../../whatsnew/3.9.rst:1461 msgid "``PyFrame_ClearFreeList()``" msgstr "``PyFrame_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1461 +#: ../../whatsnew/3.9.rst:1462 msgid "``PyList_ClearFreeList()``" msgstr "``PyList_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1462 +#: ../../whatsnew/3.9.rst:1463 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1464 +#: ../../whatsnew/3.9.rst:1465 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1466 +#: ../../whatsnew/3.9.rst:1467 msgid "``PyTuple_ClearFreeList()``" msgstr "``PyTuple_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1467 +#: ../../whatsnew/3.9.rst:1468 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1470 +#: ../../whatsnew/3.9.rst:1471 msgid "" "Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1473 +#: ../../whatsnew/3.9.rst:1474 msgid "" "Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1478 +#: ../../whatsnew/3.9.rst:1479 msgid "" "Cleaned header files of interfaces defined but with no implementation. The " "public API symbols being removed are: " @@ -2421,26 +2421,26 @@ msgid "" "`39372`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1489 +#: ../../whatsnew/3.9.rst:1490 msgid "Notable changes in Python 3.9.1" msgstr "Python 3.9.1 中顯著的變更" -#: ../../whatsnew/3.9.rst:1494 +#: ../../whatsnew/3.9.rst:1495 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." msgstr "" -#: ../../whatsnew/3.9.rst:1497 +#: ../../whatsnew/3.9.rst:1498 msgid "``Literal`` now de-duplicates parameters." msgstr "" -#: ../../whatsnew/3.9.rst:1498 +#: ../../whatsnew/3.9.rst:1499 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "" -#: ../../whatsnew/3.9.rst:1499 +#: ../../whatsnew/3.9.rst:1500 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2448,7 +2448,7 @@ msgid "" "differentiating types." msgstr "" -#: ../../whatsnew/3.9.rst:1503 +#: ../../whatsnew/3.9.rst:1504 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2456,7 +2456,7 @@ msgid "" "error::" msgstr "" -#: ../../whatsnew/3.9.rst:1508 +#: ../../whatsnew/3.9.rst:1509 msgid "" ">>> from typing import Literal\n" ">>> Literal[{0}]\n" @@ -2472,15 +2472,15 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: unhashable type: 'set'" -#: ../../whatsnew/3.9.rst:1515 +#: ../../whatsnew/3.9.rst:1516 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1518 +#: ../../whatsnew/3.9.rst:1519 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" msgstr "" -#: ../../whatsnew/3.9.rst:1520 +#: ../../whatsnew/3.9.rst:1521 msgid "" "As of 3.9.1, Python now fully supports building and running on macOS 11.0 " "(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " @@ -2492,19 +2492,19 @@ msgid "" "version in use at runtime (\"weaklinking\")." msgstr "" -#: ../../whatsnew/3.9.rst:1529 +#: ../../whatsnew/3.9.rst:1530 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1532 +#: ../../whatsnew/3.9.rst:1533 msgid "Notable changes in Python 3.9.2" msgstr "Python 3.9.2 中顯著的變更" -#: ../../whatsnew/3.9.rst:1535 +#: ../../whatsnew/3.9.rst:1536 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.9.rst:1537 +#: ../../whatsnew/3.9.rst:1538 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2520,11 +2520,11 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1551 ../../whatsnew/3.9.rst:1576 +#: ../../whatsnew/3.9.rst:1552 ../../whatsnew/3.9.rst:1577 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.9.rst:1553 +#: ../../whatsnew/3.9.rst:1554 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -2536,11 +2536,11 @@ msgid "" "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1564 +#: ../../whatsnew/3.9.rst:1565 msgid "Notable changes in Python 3.9.3" msgstr "Python 3.9.3 中顯著的變更" -#: ../../whatsnew/3.9.rst:1566 +#: ../../whatsnew/3.9.rst:1567 msgid "" "A security fix alters the :class:`ftplib.FTP` behavior to not trust the IPv4 " "address sent from the remote server when setting up a passive data channel. " @@ -2549,11 +2549,11 @@ msgid "" "instance to ``True``. (See :gh:`87451`)" msgstr "" -#: ../../whatsnew/3.9.rst:1573 +#: ../../whatsnew/3.9.rst:1574 msgid "Notable changes in Python 3.9.5" msgstr "Python 3.9.5 中顯著的變更" -#: ../../whatsnew/3.9.rst:1578 +#: ../../whatsnew/3.9.rst:1579 msgid "" "The presence of newline or tab characters in parts of a URL allows for some " "forms of attacks. Following the WHATWG specification that updates :rfc:" @@ -2563,11 +2563,11 @@ msgid "" "variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" msgstr "" -#: ../../whatsnew/3.9.rst:1586 +#: ../../whatsnew/3.9.rst:1587 msgid "Notable security feature in 3.9.14" msgstr "" -#: ../../whatsnew/3.9.rst:1588 +#: ../../whatsnew/3.9.rst:1589 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) " @@ -2580,15 +2580,15 @@ msgid "" "digits in string form." msgstr "" -#: ../../whatsnew/3.9.rst:1599 +#: ../../whatsnew/3.9.rst:1600 msgid "Notable changes in 3.9.17" msgstr "" -#: ../../whatsnew/3.9.rst:1602 +#: ../../whatsnew/3.9.rst:1603 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.9.rst:1604 +#: ../../whatsnew/3.9.rst:1605 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 bee2b6400bcd3b598ff768051bd15ffcc808f8fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 5 Oct 2024 07:10:30 +0000 Subject: [PATCH 03/14] sync with cpython b87aea6b --- whatsnew/3.13.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 74edc87bd3..d3e4aaf28f 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-05 07:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2266,7 +2266,7 @@ msgid ":mod:`!nis`" msgstr "" #: ../../whatsnew/3.13.rst:1561 -msgid ":mod:`!nntplib`: Use the :pypi:`nntplib` library from PyPI instead." +msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr "" #: ../../whatsnew/3.13.rst:1563 From 3aa50eb87452d6597587ac6ff89d10d1cc7df5fa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Oct 2024 18:31:08 +0000 Subject: [PATCH 04/14] sync with cpython 80ba17a3 --- glossary.po | 124 +++++++++++++++++++++------------------------ library/_thread.po | 42 ++++++++------- whatsnew/3.12.po | 14 ++--- whatsnew/3.13.po | 12 ++--- 4 files changed, 95 insertions(+), 97 deletions(-) diff --git a/glossary.po b/glossary.po index d4d86c08f8..16e1df90ad 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-07 18:29+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1819,7 +1819,7 @@ msgstr "" msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:771 ../../glossary.rst:803 ../../glossary.rst:1168 +#: ../../glossary.rst:771 ../../glossary.rst:803 ../../glossary.rst:1164 msgid "method" msgstr "method(方法)" @@ -2619,34 +2619,28 @@ msgstr "" #: ../../glossary.rst:1153 msgid "" -"A soft deprecation can be used when using an API which should no longer be " -"used to write new code, but it remains safe to continue using it in existing " -"code. The API remains documented and tested, but will not be developed " -"further (no enhancement)." +"A soft deprecated API should not be used in new code, but it is safe for " +"already existing code to use it. The API remains documented and tested, but " +"will not be enhanced further." msgstr "" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1157 msgid "" -"The main difference between a \"soft\" and a (regular) \"hard\" deprecation " -"is that the soft deprecation does not imply scheduling the removal of the " -"deprecated API." +"Soft deprecation, unlike normal deprecation, does not plan on removing the " +"API and will not emit warnings." msgstr "" -#: ../../glossary.rst:1162 -msgid "Another difference is that a soft deprecation does not issue a warning." -msgstr "" - -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1160 msgid "" "See `PEP 387: Soft Deprecation `_." msgstr "" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1162 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1166 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2657,11 +2651,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1174 +#: ../../glossary.rst:1170 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:1172 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2671,11 +2665,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1179 +#: ../../glossary.rst:1175 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1177 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2685,11 +2679,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1180 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1186 +#: ../../glossary.rst:1182 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2700,7 +2694,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1192 +#: ../../glossary.rst:1188 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2710,15 +2704,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1197 +#: ../../glossary.rst:1193 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1198 +#: ../../glossary.rst:1194 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1196 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 " @@ -2727,7 +2721,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1204 +#: ../../glossary.rst:1200 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2735,7 +2729,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1203 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2743,11 +2737,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1206 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1212 +#: ../../glossary.rst:1208 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2761,7 +2755,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1215 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2769,11 +2763,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1217 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1219 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2788,11 +2782,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1226 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1232 +#: ../../glossary.rst:1228 #, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " @@ -2803,22 +2797,22 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1232 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1234 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1236 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1239 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2828,11 +2822,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1243 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1245 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2844,15 +2838,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1254 ../../glossary.rst:1268 +#: ../../glossary.rst:1250 ../../glossary.rst:1264 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1251 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1257 +#: ../../glossary.rst:1253 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2860,7 +2854,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1256 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -2870,7 +2864,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1260 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2878,11 +2872,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1269 +#: ../../glossary.rst:1265 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1267 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2895,20 +2889,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1276 +#: ../../glossary.rst:1272 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1278 +#: ../../glossary.rst:1274 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1280 +#: ../../glossary.rst:1276 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1278 msgid "" "class C:\n" " field: 'annotation'" @@ -2916,7 +2910,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1285 +#: ../../glossary.rst:1281 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2924,15 +2918,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1289 +#: ../../glossary.rst:1285 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1291 +#: ../../glossary.rst:1287 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1293 +#: ../../glossary.rst:1289 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2941,11 +2935,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1297 +#: ../../glossary.rst:1293 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1299 +#: ../../glossary.rst:1295 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2956,15 +2950,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1300 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1305 +#: ../../glossary.rst:1301 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1307 +#: ../../glossary.rst:1303 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2972,11 +2966,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1305 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1311 +#: ../../glossary.rst:1307 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2997,7 +2991,7 @@ msgstr "Fortran contiguous(Fortran 連續的)" msgid "magic" msgstr "magic" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1164 msgid "special" msgstr "special" diff --git a/library/_thread.po b/library/_thread.po index 3fad9c4652..45e8dd3dd4 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-07 18:29+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-" @@ -314,15 +314,11 @@ msgstr "**注意事項:**" #: ../../library/_thread.rst:216 msgid "" -"Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " -"exception will be received by an arbitrary thread. (When the :mod:`signal` " -"module is available, interrupts always go to the main thread.)" +"Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " +"exception will be received by that thread.)" msgstr "" -"執行緒與中斷的互動可能會有奇怪的情況:任何一個執行緒都有可能收到 :exc:" -"`KeyboardInterrupt` 例外。(當 :mod:`signal` 模組可用時,中斷總是會進入主執行" -"緒。)" -#: ../../library/_thread.rst:220 +#: ../../library/_thread.rst:219 msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." @@ -330,7 +326,7 @@ msgstr "" "呼叫 :func:`sys.exit` 函數或引發 :exc:`SystemExit` 例外等同於呼叫 :func:" "`_thread.exit` 函式。" -#: ../../library/_thread.rst:223 +#: ../../library/_thread.rst:222 msgid "" "It is not possible to interrupt the :meth:`~threading.Lock.acquire` method " "on a lock --- the :exc:`KeyboardInterrupt` exception will happen after the " @@ -339,7 +335,7 @@ msgstr "" "無法在鎖的 :meth:`~threading.Lock.acquire` 方法上中斷執行, :exc:" "`KeyboardInterrupt` 例外會在鎖被獲取後發生。" -#: ../../library/_thread.rst:227 +#: ../../library/_thread.rst:226 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" @@ -349,15 +345,6 @@ msgstr "" "終止,而不會執行 :keyword:`try` ... :keyword:`finally` 子句或執行物件的解構函" "式。" -#: ../../library/_thread.rst:232 -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 " -"standard I/O files are not flushed." -msgstr "" -"當主執行緒退出時,它不會執行任何通常的清理操作(除非有 :keyword:`try` ... :" -"keyword:`finally` 子句),並且標準 I/O 檔案不會被刷新。" - #: ../../library/_thread.rst:7 msgid "light-weight processes" msgstr "light-weight processes(輕量級行程)" @@ -393,3 +380,20 @@ msgstr "module(模組)" #: ../../library/_thread.rst:214 msgid "signal" msgstr "signal(訊號)" + +#~ msgid "" +#~ "Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " +#~ "exception will be received by an arbitrary thread. (When the :mod:" +#~ "`signal` module is available, interrupts always go to the main thread.)" +#~ msgstr "" +#~ "執行緒與中斷的互動可能會有奇怪的情況:任何一個執行緒都有可能收到 :exc:" +#~ "`KeyboardInterrupt` 例外。(當 :mod:`signal` 模組可用時,中斷總是會進入主" +#~ "執行緒。)" + +#~ 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 standard I/O files are not flushed." +#~ msgstr "" +#~ "當主執行緒退出時,它不會執行任何通常的清理操作(除非有 :keyword:" +#~ "`try` ... :keyword:`finally` 子句),並且標準 I/O 檔案不會被刷新。" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 96311cb157..91c9586e38 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-07 18: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-" @@ -47,12 +47,12 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.12.rst:62 msgid "" -"Python 3.12 is the latest stable release of the Python programming language, " -"with a mix of changes to the language and the standard library. The library " -"changes focus on cleaning up deprecated APIs, usability, and correctness. Of " -"note, the :mod:`!distutils` package has been removed from the standard " -"library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " -"number of improvements, and several modules have better performance." +"Python 3.12 is a stable release of the Python programming language, with a " +"mix of changes to the language and the standard library. The library changes " +"focus on cleaning up deprecated APIs, usability, and correctness. Of note, " +"the :mod:`!distutils` package has been removed from the standard library. " +"Filesystem support in :mod:`os` and :mod:`pathlib` has seen a number of " +"improvements, and several modules have better performance." msgstr "" #: ../../whatsnew/3.12.rst:69 diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index d3e4aaf28f..363ce192a1 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-05 07:09+0000\n" +"POT-Creation-Date: 2024-10-07 18:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,8 +32,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:48 msgid "" "This article explains the new features in Python 3.13, compared to 3.12. " -"Python 3.13 will be released on October 7, 2024. For full details, see the :" -"ref:`changelog `." +"Python 3.13 was released on October 7, 2024. For full details, see the :ref:" +"`changelog `." msgstr "" #: ../../whatsnew/3.13.rst:54 @@ -46,9 +46,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:63 msgid "" -"Python 3.13 will be the latest stable release of the Python programming " -"language, with a mix of changes to the language, the implementation and the " -"standard library. The biggest changes include a new `interactive interpreter " +"Python 3.13 is the latest stable release of the Python programming language, " +"with a mix of changes to the language, the implementation and the standard " +"library. The biggest changes include a new `interactive interpreter " "`_, experimental support for " "running in a `free-threaded mode `_ (:" "pep:`703`), and a `Just-In-Time compiler `_ (:pep:" From 1339dc8b5d0aa93929c31f1a692347eb3dc8ec33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 13 Oct 2024 17:15:05 +0000 Subject: [PATCH 05/14] sync with cpython c9ead962 --- c-api/code.po | 115 +- c-api/exceptions.po | 9 +- c-api/import.po | 30 +- c-api/init.po | 1143 ++++++++------ c-api/init_config.po | 208 ++- c-api/module.po | 277 ++-- c-api/tuple.po | 44 +- c-api/veryhigh.po | 126 +- deprecations/index.po | 152 +- deprecations/pending-removal-in-3.14.po | 84 +- deprecations/pending-removal-in-3.15.po | 62 +- glossary.po | 719 +++++---- howto/argparse-optparse.po | 119 ++ library/_thread.po | 37 +- library/argparse.po | 1822 ++++++++++------------- library/ast.po | 5 +- library/asyncio-eventloop.po | 25 +- library/asyncio-policy.po | 9 +- library/asyncio-stream.po | 9 +- library/asyncio-task.po | 4 +- library/asyncio.po | 11 +- library/codecs.po | 9 +- library/compileall.po | 4 +- library/concurrent.futures.po | 11 +- library/configparser.po | 408 ++--- library/ctypes.po | 44 +- library/curses.po | 4 +- library/datetime.po | 854 +++++------ library/dbm.po | 10 +- library/dis.po | 471 +++--- library/ensurepip.po | 4 +- library/errno.po | 9 +- library/fcntl.po | 11 +- library/ftplib.po | 9 +- library/functions.po | 641 ++++---- library/getpass.po | 4 +- library/grp.po | 13 +- library/http.client.po | 4 +- library/http.server.po | 4 +- library/imaplib.po | 4 +- library/importlib.metadata.po | 398 +++-- library/importlib.po | 622 ++++---- library/itertools.po | 405 +++-- library/locale.po | 63 +- library/logging.config.po | 94 +- library/mimetypes.po | 9 +- library/mmap.po | 4 +- library/multiprocessing.po | 4 +- library/os.path.po | 9 +- library/os.po | 432 +++--- library/pkgutil.po | 99 +- library/poplib.po | 4 +- library/posix.po | 9 +- library/pty.po | 9 +- library/pwd.po | 11 +- library/readline.po | 4 +- library/resource.po | 63 +- library/select.po | 20 +- library/selectors.po | 4 +- library/shutil.po | 18 +- library/signal.po | 48 +- library/smtplib.po | 4 +- library/socket.po | 224 ++- library/socketserver.po | 4 +- library/ssl.po | 19 +- library/stat.po | 4 +- library/stdtypes.po | 590 ++++---- library/subprocess.po | 31 +- library/symtable.po | 70 +- library/sys.po | 435 +++--- library/syslog.po | 11 +- library/termios.po | 9 +- library/threading.po | 33 +- library/time.po | 97 +- library/traceback.po | 358 +++-- library/tty.po | 9 +- library/types.po | 169 +-- library/unittest.mock.po | 136 +- library/urllib.request.po | 4 +- library/venv.po | 14 +- library/webbrowser.po | 4 +- library/xmlrpc.client.po | 4 +- library/xmlrpc.server.po | 4 +- library/zoneinfo.po | 4 +- reference/datamodel.po | 1748 +++++++++++++--------- reference/executionmodel.po | 40 +- reference/expressions.po | 212 +-- reference/import.po | 392 ++--- tutorial/controlflow.po | 9 +- tutorial/introduction.po | 195 ++- tutorial/modules.po | 19 +- using/cmdline.po | 17 +- whatsnew/2.6.po | 16 +- whatsnew/3.0.po | 8 +- whatsnew/3.12.po | 802 +++++----- whatsnew/3.13.po | 1073 ++++++------- whatsnew/3.2.po | 6 +- whatsnew/3.4.po | 98 +- whatsnew/3.5.po | 4 +- 99 files changed, 8719 insertions(+), 8014 deletions(-) create mode 100644 howto/argparse-optparse.po diff --git a/c-api/code.po b/c-api/code.po index 79fec6db3e..b4636b8c8c 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -48,123 +48,127 @@ msgid "" msgstr "" #: ../../c-api/code.rst:35 -msgid "Return the number of free variables in a code object." +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." msgstr "" -#: ../../c-api/code.rst:39 -msgid "Return the position of the first free variable in a code object." +#: ../../c-api/code.rst:40 +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." msgstr "" -#: ../../c-api/code.rst:43 +#: ../../c-api/code.rst:45 msgid "" "Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " "old name is deprecated, but will remain available until the signature " "changes again." msgstr "" -#: ../../c-api/code.rst:49 +#: ../../c-api/code.rst:51 msgid "" "Return a new code object. If you need a dummy code object to create a " "frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: ../../c-api/code.rst:52 +#: ../../c-api/code.rst:54 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" "`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" -#: ../../c-api/code.rst:55 +#: ../../c-api/code.rst:57 msgid "" "The many arguments of this function are inter-dependent in complex ways, " "meaning that subtle changes to values are likely to result in incorrect " "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:59 +#: ../../c-api/code.rst:61 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:66 +#: ../../c-api/code.rst:68 msgid "" "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " "is deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:72 +#: ../../c-api/code.rst:74 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " "apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" -#: ../../c-api/code.rst:77 +#: ../../c-api/code.rst:79 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" -#: ../../c-api/code.rst:79 +#: ../../c-api/code.rst:81 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:84 +#: ../../c-api/code.rst:86 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:90 +#: ../../c-api/code.rst:92 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: ../../c-api/code.rst:96 +#: ../../c-api/code.rst:98 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../c-api/code.rst:99 +#: ../../c-api/code.rst:101 msgid "" "For efficiently iterating over the line numbers in a code object, use :pep:" "`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" -#: ../../c-api/code.rst:104 +#: ../../c-api/code.rst:106 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: ../../c-api/code.rst:108 +#: ../../c-api/code.rst:110 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:114 +#: ../../c-api/code.rst:116 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:119 +#: ../../c-api/code.rst:121 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:127 +#: ../../c-api/code.rst:129 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:136 +#: ../../c-api/code.rst:138 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 " @@ -172,14 +176,15 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:145 +#: ../../c-api/code.rst:147 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 " -"variables. On error, ``NULL`` is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:153 +#: ../../c-api/code.rst:156 msgid "" "Register *callback* as a code object watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " @@ -187,7 +192,7 @@ msgid "" "exception." msgstr "" -#: ../../c-api/code.rst:162 +#: ../../c-api/code.rst:165 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " @@ -195,17 +200,17 @@ msgid "" "never registered.)" msgstr "" -#: ../../c-api/code.rst:171 +#: ../../c-api/code.rst:174 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" -#: ../../c-api/code.rst:179 +#: ../../c-api/code.rst:182 msgid "Type of a code object watcher callback function." msgstr "" -#: ../../c-api/code.rst:181 +#: ../../c-api/code.rst:184 msgid "" "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " "`co` has been fully initialized. Otherwise, the callback is invoked before " @@ -213,7 +218,7 @@ msgid "" "inspected." msgstr "" -#: ../../c-api/code.rst:186 +#: ../../c-api/code.rst:189 msgid "" "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " "to the about-to-be-destroyed code object will resurrect it and prevent it " @@ -221,7 +226,7 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/code.rst:191 +#: ../../c-api/code.rst:194 msgid "" "Users of this API should not rely on internal runtime implementation " "details. Such details may include, but are not limited to, the exact order " @@ -231,14 +236,14 @@ msgid "" "the Python code being executed." msgstr "" -#: ../../c-api/code.rst:198 +#: ../../c-api/code.rst:201 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/code.rst:202 +#: ../../c-api/code.rst:205 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -247,85 +252,85 @@ msgid "" "it before returning." msgstr "" -#: ../../c-api/code.rst:212 +#: ../../c-api/code.rst:215 msgid "Extra information" msgstr "" -#: ../../c-api/code.rst:214 +#: ../../c-api/code.rst:217 msgid "" "To support low-level extensions to frame evaluation, such as external just-" "in-time compilers, it is possible to attach arbitrary extra data to code " "objects." msgstr "" -#: ../../c-api/code.rst:218 +#: ../../c-api/code.rst:221 msgid "" "These functions are part of the unstable C API tier: this functionality is a " "CPython implementation detail, and the API may change without deprecation " "warnings." msgstr "" -#: ../../c-api/code.rst:224 +#: ../../c-api/code.rst:227 msgid "Return a new an opaque index value used to adding data to code objects." msgstr "" -#: ../../c-api/code.rst:226 +#: ../../c-api/code.rst:229 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " "individual code objects." msgstr "" -#: ../../c-api/code.rst:230 +#: ../../c-api/code.rst:233 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " "called on non-``NULL`` data stored under the new index. Use :c:func:" "`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" -#: ../../c-api/code.rst:236 +#: ../../c-api/code.rst:239 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "" -#: ../../c-api/code.rst:240 +#: ../../c-api/code.rst:243 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:246 +#: ../../c-api/code.rst:249 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:249 +#: ../../c-api/code.rst:252 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." msgstr "" -#: ../../c-api/code.rst:254 +#: ../../c-api/code.rst:257 msgid "as ``_PyCode_GetExtra``" msgstr "" -#: ../../c-api/code.rst:258 +#: ../../c-api/code.rst:261 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:264 +#: ../../c-api/code.rst:267 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:269 +#: ../../c-api/code.rst:272 msgid "as ``_PyCode_SetExtra``" msgstr "" -#: ../../c-api/code.rst:273 +#: ../../c-api/code.rst:276 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -343,22 +348,22 @@ msgstr "code(程式碼)" msgid "code object" msgstr "code object(程式碼物件)" -#: ../../c-api/code.rst:62 +#: ../../c-api/code.rst:64 msgid "PyCode_New (C function)" msgstr "PyCode_New(C 函式)" -#: ../../c-api/code.rst:75 +#: ../../c-api/code.rst:77 msgid "PyCode_NewWithPosOnlyArgs (C function)" msgstr "PyCode_NewWithPosOnlyArgs(C 函式)" -#: ../../c-api/code.rst:234 +#: ../../c-api/code.rst:237 msgid "_PyEval_RequestCodeExtraIndex (C function)" msgstr "_PyEval_RequestCodeExtraIndex(C 函式)" -#: ../../c-api/code.rst:252 +#: ../../c-api/code.rst:255 msgid "_PyCode_GetExtra (C function)" msgstr "_PyCode_GetExtra(C 函式)" -#: ../../c-api/code.rst:267 +#: ../../c-api/code.rst:270 msgid "_PyCode_SetExtra (C function)" msgstr "_PyCode_SetExtra(C 函式)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index d742b185ef..af94883d50 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -267,8 +267,8 @@ msgstr "" #: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:242 #: ../../c-api/exceptions.rst:253 ../../c-api/exceptions.rst:263 #: ../../c-api/exceptions.rst:271 ../../c-api/exceptions.rst:281 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../c-api/exceptions.rst:239 msgid "" @@ -1965,3 +1965,6 @@ msgstr "PyExc_UnicodeWarning(C 變數)" #: ../../c-api/exceptions.rst:1194 msgid "PyExc_UserWarning (C var)" msgstr "PyExc_UserWarning(C 變數)" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" diff --git a/c-api/import.po b/c-api/import.po index 96b3529885..fd97d9146d 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -159,17 +159,17 @@ msgstr "" #: ../../c-api/import.rst:139 msgid "" -"The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set " -"already, with the appropriate values. The spec's loader will be set to the " -"module's ``__loader__`` (if set) and to an instance of :class:`~importlib." -"machinery.SourceFileLoader` otherwise." +"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be " +"set, if not set already, with the appropriate values. The spec's loader " +"will be set to the module's :attr:`!__loader__` (if set) and to an instance " +"of :class:`~importlib.machinery.SourceFileLoader` otherwise." msgstr "" #: ../../c-api/import.rst:144 msgid "" -"The module's :attr:`__file__` attribute will be set to the code object's :" -"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also " -"be set." +"The module's :attr:`~module.__file__` attribute will be set to the code " +"object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module." +"__cached__` will also be set." msgstr "" #: ../../c-api/import.rst:148 @@ -192,14 +192,14 @@ msgstr "" #: ../../c-api/import.rst:157 msgid "" -"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :" -"class:`~importlib.machinery.ModuleSpec` for alternatives." +"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" #: ../../c-api/import.rst:165 msgid "" -"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " -"of the module object is set to *pathname* if it is non-``NULL``." +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " +"attribute of the module object is set to *pathname* if it is non-``NULL``." msgstr "" #: ../../c-api/import.rst:168 @@ -208,15 +208,15 @@ msgstr "也請見 :c:func:`PyImport_ExecCodeModuleWithPathnames`。" #: ../../c-api/import.rst:173 msgid "" -"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` " +"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" #: ../../c-api/import.rst:179 msgid "" -"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery." -"ModuleSpec` for alternatives." +"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." +"machinery.ModuleSpec` for alternatives." msgstr "" #: ../../c-api/import.rst:186 diff --git a/c-api/init.po b/c-api/init.po index 470d303142..3bc72498dc 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,14 +25,17 @@ msgid "Initialization, Finalization, and Threads" msgstr "" #: ../../c-api/init.rst:10 -msgid "See also :ref:`Python Initialization Configuration `." +#, fuzzy +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." msgstr "也請參見 :ref:`Python 初始化設定 `。" -#: ../../c-api/init.rst:15 +#: ../../c-api/init.rst:16 msgid "Before Python Initialization" msgstr "Python 初始化之前" -#: ../../c-api/init.rst:17 +#: ../../c-api/init.rst:18 msgid "" "In an application embedding Python, the :c:func:`Py_Initialize` function " "must be called before using any other Python/C API functions; with the " @@ -40,148 +43,191 @@ msgid "" "`." msgstr "" -#: ../../c-api/init.rst:22 +#: ../../c-api/init.rst:23 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "" -#: ../../c-api/init.rst:24 +#: ../../c-api/init.rst:25 +msgid "Functions that initialize the interpreter:" +msgstr "" + +#: ../../c-api/init.rst:27 +#, fuzzy +msgid ":c:func:`Py_Initialize`" +msgstr ":c:func:`Py_IsInitialized`" + +#: ../../c-api/init.rst:28 +#, fuzzy +msgid ":c:func:`Py_InitializeEx`" +msgstr ":c:func:`Py_IsInitialized`" + +#: ../../c-api/init.rst:29 +#, fuzzy +msgid ":c:func:`Py_InitializeFromConfig`" +msgstr ":c:func:`Py_IsInitialized`" + +#: ../../c-api/init.rst:30 +#, fuzzy +msgid ":c:func:`Py_BytesMain`" +msgstr ":c:func:`Py_GetVersion`" + +#: ../../c-api/init.rst:31 +#, fuzzy +msgid ":c:func:`Py_Main`" +msgstr ":c:func:`Py_SetPath`" + +#: ../../c-api/init.rst:32 +msgid "the runtime pre-initialization functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:34 msgid "Configuration functions:" msgstr "" -#: ../../c-api/init.rst:26 +#: ../../c-api/init.rst:36 msgid ":c:func:`PyImport_AppendInittab`" msgstr ":c:func:`PyImport_AppendInittab`" -#: ../../c-api/init.rst:27 +#: ../../c-api/init.rst:37 msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" -#: ../../c-api/init.rst:28 +#: ../../c-api/init.rst:38 msgid ":c:func:`!PyInitFrozenExtensions`" msgstr ":c:func:`!PyInitFrozenExtensions`" -#: ../../c-api/init.rst:29 +#: ../../c-api/init.rst:39 msgid ":c:func:`PyMem_SetAllocator`" msgstr ":c:func:`PyMem_SetAllocator`" -#: ../../c-api/init.rst:30 +#: ../../c-api/init.rst:40 msgid ":c:func:`PyMem_SetupDebugHooks`" msgstr ":c:func:`PyMem_SetupDebugHooks`" -#: ../../c-api/init.rst:31 +#: ../../c-api/init.rst:41 msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr ":c:func:`PyObject_SetArenaAllocator`" -#: ../../c-api/init.rst:32 +#: ../../c-api/init.rst:42 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../c-api/init.rst:33 +#: ../../c-api/init.rst:43 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../c-api/init.rst:34 +#: ../../c-api/init.rst:44 msgid ":c:func:`PySys_ResetWarnOptions`" msgstr ":c:func:`PySys_ResetWarnOptions`" -#: ../../c-api/init.rst:36 +#: ../../c-api/init.rst:45 +msgid "the configuration functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:47 msgid "Informative functions:" msgstr "" -#: ../../c-api/init.rst:38 +#: ../../c-api/init.rst:49 ../../c-api/init.rst:57 msgid ":c:func:`Py_IsInitialized`" msgstr ":c:func:`Py_IsInitialized`" -#: ../../c-api/init.rst:39 +#: ../../c-api/init.rst:50 msgid ":c:func:`PyMem_GetAllocator`" msgstr ":c:func:`PyMem_GetAllocator`" -#: ../../c-api/init.rst:40 +#: ../../c-api/init.rst:51 msgid ":c:func:`PyObject_GetArenaAllocator`" msgstr ":c:func:`PyObject_GetArenaAllocator`" -#: ../../c-api/init.rst:41 +#: ../../c-api/init.rst:52 msgid ":c:func:`Py_GetBuildInfo`" msgstr ":c:func:`Py_GetBuildInfo`" -#: ../../c-api/init.rst:42 +#: ../../c-api/init.rst:53 msgid ":c:func:`Py_GetCompiler`" msgstr ":c:func:`Py_GetCompiler`" -#: ../../c-api/init.rst:43 +#: ../../c-api/init.rst:54 msgid ":c:func:`Py_GetCopyright`" msgstr ":c:func:`Py_GetCopyright`" -#: ../../c-api/init.rst:44 +#: ../../c-api/init.rst:55 msgid ":c:func:`Py_GetPlatform`" msgstr ":c:func:`Py_GetPlatform`" -#: ../../c-api/init.rst:45 +#: ../../c-api/init.rst:56 msgid ":c:func:`Py_GetVersion`" msgstr ":c:func:`Py_GetVersion`" -#: ../../c-api/init.rst:47 +#: ../../c-api/init.rst:59 msgid "Utilities:" msgstr "" -#: ../../c-api/init.rst:49 +#: ../../c-api/init.rst:61 msgid ":c:func:`Py_DecodeLocale`" msgstr ":c:func:`Py_DecodeLocale`" -#: ../../c-api/init.rst:51 +#: ../../c-api/init.rst:62 +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:64 msgid "Memory allocators:" msgstr "" -#: ../../c-api/init.rst:53 +#: ../../c-api/init.rst:66 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/init.rst:54 +#: ../../c-api/init.rst:67 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/init.rst:55 +#: ../../c-api/init.rst:68 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/init.rst:56 +#: ../../c-api/init.rst:69 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/init.rst:58 +#: ../../c-api/init.rst:71 msgid "Synchronization:" msgstr "" -#: ../../c-api/init.rst:60 +#: ../../c-api/init.rst:73 msgid ":c:func:`PyMutex_Lock`" msgstr ":c:func:`PyMutex_Lock`" -#: ../../c-api/init.rst:61 +#: ../../c-api/init.rst:74 msgid ":c:func:`PyMutex_Unlock`" msgstr ":c:func:`PyMutex_Unlock`" -#: ../../c-api/init.rst:65 +#: ../../c-api/init.rst:78 msgid "" -"The following functions **should not be called** before :c:func:" -"`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" +"Despite their apparent similarity to some of the functions listed above, the " +"following functions **should not be called** before the interpreter has been " +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" "`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" "`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" -"`Py_GetProgramName` and :c:func:`PyEval_InitThreads`." +"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init.rst:75 +#: ../../c-api/init.rst:90 msgid "Global configuration variables" msgstr "" -#: ../../c-api/init.rst:77 +#: ../../c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " "features and options. By default, these flags are controlled by :ref:" "`command line options `." msgstr "" -#: ../../c-api/init.rst:81 +#: ../../c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " "times that the option was set. For example, ``-b`` sets :c:data:" @@ -189,108 +235,108 @@ msgid "" "2." msgstr "" -#: ../../c-api/init.rst:87 +#: ../../c-api/init.rst:102 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "bytes_warning` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:91 +#: ../../c-api/init.rst:106 msgid "" "Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" "class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " "or equal to ``2``." msgstr "" -#: ../../c-api/init.rst:95 +#: ../../c-api/init.rst:110 msgid "Set by the :option:`-b` option." msgstr "由 :option:`-b` 選項設定。" -#: ../../c-api/init.rst:101 +#: ../../c-api/init.rst:116 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "parser_debug` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:105 +#: ../../c-api/init.rst:120 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." msgstr "" -#: ../../c-api/init.rst:108 +#: ../../c-api/init.rst:123 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" -#: ../../c-api/init.rst:115 +#: ../../c-api/init.rst:130 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "write_bytecode` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:119 +#: ../../c-api/init.rst:134 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" -#: ../../c-api/init.rst:122 +#: ../../c-api/init.rst:137 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" "由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。" -#: ../../c-api/init.rst:129 +#: ../../c-api/init.rst:144 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "pathconfig_warnings` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:133 +#: ../../c-api/init.rst:148 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." msgstr "" -#: ../../c-api/init.rst:136 +#: ../../c-api/init.rst:151 msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" -#: ../../c-api/init.rst:142 +#: ../../c-api/init.rst:157 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:147 +#: ../../c-api/init.rst:162 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" "如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。" -#: ../../c-api/init.rst:150 +#: ../../c-api/init.rst:165 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" -#: ../../c-api/init.rst:157 +#: ../../c-api/init.rst:172 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "use_environment` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:161 +#: ../../c-api/init.rst:176 msgid "" "Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." @@ -298,73 +344,73 @@ msgstr "" "忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` " "與 :envvar:`PYTHONHOME`。" -#: ../../c-api/init.rst:164 +#: ../../c-api/init.rst:179 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" -#: ../../c-api/init.rst:170 +#: ../../c-api/init.rst:185 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "inspect` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:174 +#: ../../c-api/init.rst:189 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " "when :data:`sys.stdin` does not appear to be a terminal." msgstr "" -#: ../../c-api/init.rst:178 +#: ../../c-api/init.rst:193 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。" -#: ../../c-api/init.rst:185 +#: ../../c-api/init.rst:200 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "interactive` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:189 +#: ../../c-api/init.rst:204 msgid "Set by the :option:`-i` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:195 +#: ../../c-api/init.rst:210 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "isolated` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:199 +#: ../../c-api/init.rst:214 msgid "" "Run Python in isolated mode. In isolated mode :data:`sys.path` contains " "neither the script's directory nor the user's site-packages directory." msgstr "" -#: ../../c-api/init.rst:202 +#: ../../c-api/init.rst:217 msgid "Set by the :option:`-I` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:210 +#: ../../c-api/init.rst:225 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyPreConfig." "legacy_windows_fs_encoding` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:214 +#: ../../c-api/init.rst:229 msgid "" "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " "handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " "for the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/init.rst:218 +#: ../../c-api/init.rst:233 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." @@ -372,45 +418,45 @@ msgstr "" "如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設" "為 ``1``。" -#: ../../c-api/init.rst:221 +#: ../../c-api/init.rst:236 msgid "See :pep:`529` for more details." msgstr "更多詳情請見 :pep:`529`。" -#: ../../c-api/init.rst:223 ../../c-api/init.rst:241 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +#: ../../c-api/init.rst:238 ../../c-api/init.rst:256 +msgid "Availability" +msgstr "" -#: ../../c-api/init.rst:229 +#: ../../c-api/init.rst:244 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "legacy_windows_stdio` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:233 +#: ../../c-api/init.rst:248 msgid "" "If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" -#: ../../c-api/init.rst:236 +#: ../../c-api/init.rst:251 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init.rst:239 +#: ../../c-api/init.rst:254 msgid "See :pep:`528` for more details." msgstr "更多詳情請見 :pep:`528`。" -#: ../../c-api/init.rst:247 +#: ../../c-api/init.rst:262 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "site_import` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:251 +#: ../../c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -418,24 +464,24 @@ msgid "" "main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init.rst:256 +#: ../../c-api/init.rst:271 msgid "Set by the :option:`-S` option." msgstr "由 :option:`-S` 選項設定。" -#: ../../c-api/init.rst:262 +#: ../../c-api/init.rst:277 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "user_site_directory` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:266 +#: ../../c-api/init.rst:281 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" -#: ../../c-api/init.rst:269 +#: ../../c-api/init.rst:284 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." @@ -443,60 +489,60 @@ msgstr "" "由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" -#: ../../c-api/init.rst:276 +#: ../../c-api/init.rst:291 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "optimization_level` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:280 +#: ../../c-api/init.rst:295 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。" -#: ../../c-api/init.rst:287 +#: ../../c-api/init.rst:302 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "quiet` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:291 +#: ../../c-api/init.rst:306 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -#: ../../c-api/init.rst:293 +#: ../../c-api/init.rst:308 msgid "Set by the :option:`-q` option." msgstr "由 :option:`-q` 選項設定。" -#: ../../c-api/init.rst:301 +#: ../../c-api/init.rst:316 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "buffered_stdio` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:305 +#: ../../c-api/init.rst:320 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "" -#: ../../c-api/init.rst:307 +#: ../../c-api/init.rst:322 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。" -#: ../../c-api/init.rst:314 +#: ../../c-api/init.rst:329 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "verbose` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:318 +#: ../../c-api/init.rst:333 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. If greater or equal " @@ -504,67 +550,82 @@ msgid "" "for a module. Also provides information on module cleanup at exit." msgstr "" -#: ../../c-api/init.rst:323 +#: ../../c-api/init.rst:338 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。" -#: ../../c-api/init.rst:330 +#: ../../c-api/init.rst:345 msgid "Initializing and finalizing the interpreter" msgstr "" -#: ../../c-api/init.rst:345 +#: ../../c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " "this should be called before using any other Python/C API functions; see :" "ref:`Before Python Initialization ` for the few exceptions." msgstr "" -#: ../../c-api/init.rst:349 +#: ../../c-api/init.rst:364 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " -"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " "also initializes the module search path (``sys.path``). It does not set " -"``sys.argv``; use the new :c:type:`PyConfig` API of the :ref:`Python " -"Initialization Configuration ` for that. This is a no-op when " -"called for a second time (without calling :c:func:`Py_FinalizeEx` first). " -"There is no return value; it is a fatal error if the initialization fails." +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." msgstr "" -#: ../../c-api/init.rst:359 ../../c-api/init.rst:373 +#: ../../c-api/init.rst:372 ../../c-api/init.rst:386 +#, fuzzy msgid "" -"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:" -"`Python Initialization Configuration `." -msgstr "" +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." +msgstr "也請參見 :ref:`Python 初始化設定 `。" -#: ../../c-api/init.rst:363 +#: ../../c-api/init.rst:376 msgid "" "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " "will also affect non-Python uses of the console using the C Runtime." msgstr "" -#: ../../c-api/init.rst:369 +#: ../../c-api/init.rst:382 msgid "" "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " "*initsigs* is ``0``, it skips initialization registration of signal " -"handlers, which might be useful when Python is embedded." +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." +msgstr "" + +#: ../../c-api/init.rst:392 +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." +msgstr "" + +#: ../../c-api/init.rst:395 +msgid "" +"See the :ref:`init-config` section for details on pre-initializing the " +"interpreter, populating the runtime configuration structure, and querying " +"the returned status structure." msgstr "" -#: ../../c-api/init.rst:379 +#: ../../c-api/init.rst:402 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " "false until :c:func:`Py_Initialize` is called again." msgstr "" -#: ../../c-api/init.rst:386 +#: ../../c-api/init.rst:409 msgid "" "Return true (non-zero) if the main Python interpreter is :term:`shutting " "down `. Return false (zero) otherwise." msgstr "" -#: ../../c-api/init.rst:394 +#: ../../c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " "of Python/C API functions, and destroy all sub-interpreters (see :c:func:" @@ -574,7 +635,7 @@ msgid "" "second time (without calling :c:func:`Py_Initialize` again first)." msgstr "" -#: ../../c-api/init.rst:401 +#: ../../c-api/init.rst:424 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " @@ -582,13 +643,13 @@ msgid "" "`Py_RunMain` is running." msgstr "" -#: ../../c-api/init.rst:406 +#: ../../c-api/init.rst:429 msgid "" "Normally the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" -#: ../../c-api/init.rst:410 +#: ../../c-api/init.rst:433 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -599,7 +660,7 @@ msgid "" "Python before exiting from the application." msgstr "" -#: ../../c-api/init.rst:418 +#: ../../c-api/init.rst:441 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`~object.__del__` " @@ -614,7 +675,7 @@ msgid "" "more than once." msgstr "" -#: ../../c-api/init.rst:429 +#: ../../c-api/init.rst:452 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -622,24 +683,154 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "_PySys_ClearAuditHooks``。" -#: ../../c-api/init.rst:435 +#: ../../c-api/init.rst:459 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" -#: ../../c-api/init.rst:440 +#: ../../c-api/init.rst:465 +msgid "" +"Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, " +"allowing the calling application to delegate the text decoding step to the " +"CPython runtime." +msgstr "" + +#: ../../c-api/init.rst:474 +msgid "" +"The main program for the standard interpreter, encapsulating a full " +"initialization/finalization cycle, as well as additional behaviour to " +"implement reading configurations settings from the environment and command " +"line, and then executing ``__main__`` in accordance with :ref:`using-on-" +"cmdline`." +msgstr "" + +#: ../../c-api/init.rst:480 +msgid "" +"This is made available for programs which wish to support the full CPython " +"command line interface, rather than just embedding a Python runtime in a " +"larger application." +msgstr "" + +#: ../../c-api/init.rst:484 +msgid "" +"The *argc* and *argv* parameters are similar to those which are passed to a " +"C program's :c:func:`main` function, except that the *argv* entries are " +"first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also " +"important to note that the argument list entries may be modified to point to " +"strings other than those passed in (however, the contents of the strings " +"pointed to by the argument list are not modified)." +msgstr "" + +#: ../../c-api/init.rst:491 +msgid "" +"The return value will be ``0`` if the interpreter exits normally (i.e., " +"without an exception), ``1`` if the interpreter exits due to an exception, " +"or ``2`` if the argument list does not represent a valid Python command line." +msgstr "" + +#: ../../c-api/init.rst:496 +msgid "" +"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " +"function will not return ``1``, but exit the process, as long as " +"``Py_InspectFlag`` is not set. If ``Py_InspectFlag`` is set, execution will " +"drop into the interactive Python prompt, at which point a second otherwise " +"unhandled :exc:`SystemExit` will still exit the process, while any other " +"means of exiting will set the return value as described above." +msgstr "" + +#: ../../c-api/init.rst:503 +msgid "" +"In terms of the CPython runtime configuration APIs documented in the :ref:" +"`runtime configuration ` section (and without accounting for " +"error handling), ``Py_Main`` is approximately equivalent to::" +msgstr "" + +#: ../../c-api/init.rst:507 +msgid "" +"PyConfig config;\n" +"PyConfig_InitPythonConfig(&config);\n" +"PyConfig_SetArgv(&config, argc, argv);\n" +"Py_InitializeFromConfig(&config);\n" +"PyConfig_Clear(&config);\n" +"\n" +"Py_RunMain();" +msgstr "" + +#: ../../c-api/init.rst:515 +msgid "" +"In normal usage, an embedding application will call this function *instead* " +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" +"`Py_InitializeFromConfig` directly, and all settings will be applied as " +"described elsewhere in this documentation. If this function is instead " +"called *after* a preceding runtime initialization API call, then exactly " +"which environmental and command line configuration settings will be updated " +"is version dependent (as it depends on which settings correctly support " +"being modified after they have already been set once when the runtime was " +"first initialized)." +msgstr "" + +#: ../../c-api/init.rst:528 +msgid "Executes the main module in a fully configured CPython runtime." +msgstr "" + +#: ../../c-api/init.rst:530 +msgid "" +"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" +"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." +"run_module`) specified on the command line or in the configuration. If none " +"of these values are set, runs the interactive Python prompt (REPL) using the " +"``__main__`` module's global namespace." +msgstr "" + +#: ../../c-api/init.rst:536 +msgid "" +"If :c:member:`PyConfig.inspect` is not set (the default), the return value " +"will be ``0`` if the interpreter exits normally (that is, without raising an " +"exception), or ``1`` if the interpreter exits due to an exception. If an " +"otherwise unhandled :exc:`SystemExit` is raised, the function will " +"immediately exit the process instead of returning ``1``." +msgstr "" + +#: ../../c-api/init.rst:542 +msgid "" +"If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option " +"is used), rather than returning when the interpreter exits, execution will " +"instead resume in an interactive Python prompt (REPL) using the ``__main__`` " +"module's global namespace. If the interpreter exited with an exception, it " +"is immediately raised in the REPL session. The function return value is then " +"determined by the way the *REPL session* terminates: returning ``0`` if the " +"session terminates without raising an unhandled exception, exiting " +"immediately for an unhandled :exc:`SystemExit`, and returning ``1`` for any " +"other unhandled exception." +msgstr "" + +#: ../../c-api/init.rst:552 +msgid "" +"This function always finalizes the Python interpreter regardless of whether " +"it returns a value or immediately exits the process due to an unhandled :exc:" +"`SystemExit` exception." +msgstr "" + +#: ../../c-api/init.rst:556 +msgid "" +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode using :c:func:" +"`Py_RunMain`." +msgstr "" + +#: ../../c-api/init.rst:562 msgid "Process-wide parameters" msgstr "" -#: ../../c-api/init.rst:450 +#: ../../c-api/init.rst:572 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:454 +#: ../../c-api/init.rst:576 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -653,37 +844,37 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:465 ../../c-api/init.rst:704 ../../c-api/init.rst:740 -#: ../../c-api/init.rst:766 +#: ../../c-api/init.rst:587 ../../c-api/init.rst:826 ../../c-api/init.rst:862 +#: ../../c-api/init.rst:888 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" -#: ../../c-api/init.rst:473 +#: ../../c-api/init.rst:595 msgid "" "Return the program name set with :c:member:`PyConfig.program_name`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: ../../c-api/init.rst:477 ../../c-api/init.rst:499 ../../c-api/init.rst:543 -#: ../../c-api/init.rst:564 ../../c-api/init.rst:590 ../../c-api/init.rst:778 +#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:665 +#: ../../c-api/init.rst:686 ../../c-api/init.rst:712 ../../c-api/init.rst:900 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。" -#: ../../c-api/init.rst:480 ../../c-api/init.rst:502 ../../c-api/init.rst:546 -#: ../../c-api/init.rst:567 ../../c-api/init.rst:595 ../../c-api/init.rst:781 +#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:668 +#: ../../c-api/init.rst:689 ../../c-api/init.rst:717 ../../c-api/init.rst:903 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。" -#: ../../c-api/init.rst:483 ../../c-api/init.rst:570 +#: ../../c-api/init.rst:605 ../../c-api/init.rst:692 msgid "Get :data:`sys.executable` instead." msgstr "" -#: ../../c-api/init.rst:489 +#: ../../c-api/init.rst:611 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -697,11 +888,11 @@ msgid "" "also the next function." msgstr "" -#: ../../c-api/init.rst:505 +#: ../../c-api/init.rst:627 msgid "Get :data:`sys.prefix` instead." msgstr "" -#: ../../c-api/init.rst:511 +#: ../../c-api/init.rst:633 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -715,7 +906,7 @@ msgid "" "on Unix." msgstr "" -#: ../../c-api/init.rst:521 +#: ../../c-api/init.rst:643 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -724,7 +915,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:527 +#: ../../c-api/init.rst:649 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -738,7 +929,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:538 +#: ../../c-api/init.rst:660 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -746,11 +937,11 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:549 +#: ../../c-api/init.rst:671 msgid "Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../c-api/init.rst:558 +#: ../../c-api/init.rst:680 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -759,7 +950,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:580 +#: ../../c-api/init.rst:702 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:member:`PyConfig.program_name`) and some environment " @@ -772,21 +963,21 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:598 +#: ../../c-api/init.rst:720 msgid "Get :data:`sys.path` instead." msgstr "" -#: ../../c-api/init.rst:604 +#: ../../c-api/init.rst:726 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: ../../c-api/init.rst:607 +#: ../../c-api/init.rst:729 msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -#: ../../c-api/init.rst:611 +#: ../../c-api/init.rst:733 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -795,11 +986,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:616 +#: ../../c-api/init.rst:738 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:623 +#: ../../c-api/init.rst:745 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -810,50 +1001,50 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:634 +#: ../../c-api/init.rst:756 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: ../../c-api/init.rst:636 +#: ../../c-api/init.rst:758 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:640 +#: ../../c-api/init.rst:762 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:646 +#: ../../c-api/init.rst:768 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: ../../c-api/init.rst:649 +#: ../../c-api/init.rst:771 msgid "\"[GCC 2.7.2.2]\"" msgstr "\"[GCC 2.7.2.2]\"" -#: ../../c-api/init.rst:653 ../../c-api/init.rst:667 +#: ../../c-api/init.rst:775 ../../c-api/init.rst:789 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:660 +#: ../../c-api/init.rst:782 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: ../../c-api/init.rst:663 +#: ../../c-api/init.rst:785 msgid "\"#67, Aug 1 1997, 22:34:28\"" msgstr "\"#67, Aug 1 1997, 22:34:28\"" -#: ../../c-api/init.rst:679 +#: ../../c-api/init.rst:801 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -861,7 +1052,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:684 +#: ../../c-api/init.rst:806 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -872,84 +1063,84 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:692 +#: ../../c-api/init.rst:814 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: ../../c-api/init.rst:696 +#: ../../c-api/init.rst:818 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:699 +#: ../../c-api/init.rst:821 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:707 ../../c-api/init.rst:743 +#: ../../c-api/init.rst:829 ../../c-api/init.rst:865 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:711 +#: ../../c-api/init.rst:833 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: ../../c-api/init.rst:716 +#: ../../c-api/init.rst:838 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:720 +#: ../../c-api/init.rst:842 msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -#: ../../c-api/init.rst:732 +#: ../../c-api/init.rst:854 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:736 +#: ../../c-api/init.rst:858 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:746 +#: ../../c-api/init.rst:868 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:753 +#: ../../c-api/init.rst:875 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:757 +#: ../../c-api/init.rst:879 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:761 +#: ../../c-api/init.rst:883 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -957,24 +1148,24 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:774 +#: ../../c-api/init.rst:896 msgid "" "Return the default \"home\", that is, the value set by :c:member:`PyConfig." "home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " "is set." msgstr "" -#: ../../c-api/init.rst:784 +#: ../../c-api/init.rst:906 msgid "" "Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " "instead." msgstr "改為取得 :c:member:`PyConfig.home` 或 :envvar:`PYTHONHOME` 環境變數。" -#: ../../c-api/init.rst:792 +#: ../../c-api/init.rst:914 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:921 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -986,7 +1177,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:809 +#: ../../c-api/init.rst:931 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -996,7 +1187,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:819 +#: ../../c-api/init.rst:941 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1004,17 +1195,17 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:825 +#: ../../c-api/init.rst:947 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:827 +#: ../../c-api/init.rst:949 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:830 +#: ../../c-api/init.rst:952 msgid "" "Save the thread state in a local variable.\n" "Release the global interpreter lock.\n" @@ -1023,29 +1214,29 @@ msgid "" "Restore the thread state from the local variable." msgstr "" -#: ../../c-api/init.rst:836 +#: ../../c-api/init.rst:958 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:838 +#: ../../c-api/init.rst:960 msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" -#: ../../c-api/init.rst:846 +#: ../../c-api/init.rst:968 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:850 +#: ../../c-api/init.rst:972 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:852 +#: ../../c-api/init.rst:974 msgid "" "PyThreadState *_save;\n" "\n" @@ -1054,7 +1245,7 @@ msgid "" "PyEval_RestoreThread(_save);" msgstr "" -#: ../../c-api/init.rst:862 +#: ../../c-api/init.rst:984 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1065,7 +1256,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:871 +#: ../../c-api/init.rst:993 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1075,11 +1266,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:1004 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:884 +#: ../../c-api/init.rst:1006 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1089,7 +1280,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:891 +#: ../../c-api/init.rst:1013 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1100,14 +1291,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:899 +#: ../../c-api/init.rst:1021 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:903 +#: ../../c-api/init.rst:1025 msgid "" "PyGILState_STATE gstate;\n" "gstate = PyGILState_Ensure();\n" @@ -1120,7 +1311,7 @@ msgid "" "PyGILState_Release(gstate);" msgstr "" -#: ../../c-api/init.rst:913 +#: ../../c-api/init.rst:1035 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1129,11 +1320,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:923 +#: ../../c-api/init.rst:1045 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:925 +#: ../../c-api/init.rst:1047 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1142,7 +1333,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:931 +#: ../../c-api/init.rst:1053 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1159,7 +1350,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:946 +#: ../../c-api/init.rst:1068 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1172,17 +1363,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:959 +#: ../../c-api/init.rst:1081 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:961 +#: ../../c-api/init.rst:1083 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:966 +#: ../../c-api/init.rst:1088 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1190,7 +1381,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:971 +#: ../../c-api/init.rst:1093 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1198,41 +1389,41 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:979 +#: ../../c-api/init.rst:1101 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:984 +#: ../../c-api/init.rst:1106 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:995 +#: ../../c-api/init.rst:1117 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:997 +#: ../../c-api/init.rst:1119 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:999 +#: ../../c-api/init.rst:1121 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1002 +#: ../../c-api/init.rst:1124 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1006 +#: ../../c-api/init.rst:1128 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1016 +#: ../../c-api/init.rst:1138 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1240,7 +1431,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1024 +#: ../../c-api/init.rst:1146 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1248,8 +1439,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1030 ../../c-api/init.rst:1089 -#: ../../c-api/init.rst:1371 +#: ../../c-api/init.rst:1152 ../../c-api/init.rst:1211 +#: ../../c-api/init.rst:1493 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1258,44 +1449,44 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:1160 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1042 +#: ../../c-api/init.rst:1164 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:1169 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1051 +#: ../../c-api/init.rst:1173 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1058 +#: ../../c-api/init.rst:1180 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1063 +#: ../../c-api/init.rst:1185 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1068 +#: ../../c-api/init.rst:1190 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1308,7 +1499,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1078 +#: ../../c-api/init.rst:1200 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1318,13 +1509,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1085 +#: ../../c-api/init.rst:1207 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1097 +#: ../../c-api/init.rst:1219 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1332,13 +1523,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1102 +#: ../../c-api/init.rst:1224 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1108 +#: ../../c-api/init.rst:1230 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1346,7 +1537,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1116 +#: ../../c-api/init.rst:1238 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1357,13 +1548,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1128 +#: ../../c-api/init.rst:1250 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1134 +#: ../../c-api/init.rst:1256 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1371,7 +1562,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1142 +#: ../../c-api/init.rst:1264 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1379,40 +1570,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1150 +#: ../../c-api/init.rst:1272 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1156 +#: ../../c-api/init.rst:1278 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1162 +#: ../../c-api/init.rst:1284 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1164 +#: ../../c-api/init.rst:1286 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1166 +#: ../../c-api/init.rst:1288 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1294 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1176 +#: ../../c-api/init.rst:1298 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1420,13 +1611,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1181 +#: ../../c-api/init.rst:1303 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1184 +#: ../../c-api/init.rst:1306 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1434,40 +1625,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1189 +#: ../../c-api/init.rst:1311 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1196 +#: ../../c-api/init.rst:1318 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1203 +#: ../../c-api/init.rst:1325 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1328 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:1335 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1220 +#: ../../c-api/init.rst:1342 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1475,119 +1666,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1350 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1230 +#: ../../c-api/init.rst:1352 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1355 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1235 ../../c-api/init.rst:1244 -#: ../../c-api/init.rst:1253 +#: ../../c-api/init.rst:1357 ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1375 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1242 +#: ../../c-api/init.rst:1364 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1251 +#: ../../c-api/init.rst:1373 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1260 +#: ../../c-api/init.rst:1382 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:1384 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:1391 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1394 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1280 +#: ../../c-api/init.rst:1402 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1282 +#: ../../c-api/init.rst:1404 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1285 ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1407 ../../c-api/init.rst:1417 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1292 +#: ../../c-api/init.rst:1414 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1302 +#: ../../c-api/init.rst:1424 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1428 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1313 +#: ../../c-api/init.rst:1435 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1315 +#: ../../c-api/init.rst:1437 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1318 +#: ../../c-api/init.rst:1440 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1321 +#: ../../c-api/init.rst:1443 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1326 +#: ../../c-api/init.rst:1448 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1328 ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1450 ../../c-api/init.rst:1458 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1334 +#: ../../c-api/init.rst:1456 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1343 +#: ../../c-api/init.rst:1465 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1596,7 +1787,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1352 +#: ../../c-api/init.rst:1474 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1608,33 +1799,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1360 +#: ../../c-api/init.rst:1482 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1488 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1377 +#: ../../c-api/init.rst:1499 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1382 +#: ../../c-api/init.rst:1504 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1388 +#: ../../c-api/init.rst:1510 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1643,17 +1834,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1516 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1401 +#: ../../c-api/init.rst:1523 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1403 +#: ../../c-api/init.rst:1525 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1661,7 +1852,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1408 +#: ../../c-api/init.rst:1530 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1672,31 +1863,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1415 +#: ../../c-api/init.rst:1537 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1421 +#: ../../c-api/init.rst:1543 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1427 +#: ../../c-api/init.rst:1549 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1553 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1435 +#: ../../c-api/init.rst:1557 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1704,44 +1895,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1565 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1447 +#: ../../c-api/init.rst:1569 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1452 +#: ../../c-api/init.rst:1574 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1457 +#: ../../c-api/init.rst:1579 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1462 +#: ../../c-api/init.rst:1584 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1468 +#: ../../c-api/init.rst:1590 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1475 +#: ../../c-api/init.rst:1597 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1750,37 +1941,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1482 +#: ../../c-api/init.rst:1604 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1487 +#: ../../c-api/init.rst:1609 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1616 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1498 +#: ../../c-api/init.rst:1620 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1502 +#: ../../c-api/init.rst:1624 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1626 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1518 +#: ../../c-api/init.rst:1640 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1793,13 +1984,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1528 +#: ../../c-api/init.rst:1650 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1653 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1810,7 +2001,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1662 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1822,13 +2013,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1551 +#: ../../c-api/init.rst:1673 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1554 +#: ../../c-api/init.rst:1676 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -1852,7 +2043,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1565 +#: ../../c-api/init.rst:1687 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1860,11 +2051,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1574 +#: ../../c-api/init.rst:1696 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1698 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1872,7 +2063,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1704 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1884,7 +2075,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1715 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1894,7 +2085,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1613 +#: ../../c-api/init.rst:1735 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1903,7 +2094,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1747 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1913,17 +2104,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1633 +#: ../../c-api/init.rst:1755 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1638 +#: ../../c-api/init.rst:1760 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1640 +#: ../../c-api/init.rst:1762 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1935,7 +2126,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1650 +#: ../../c-api/init.rst:1772 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -1949,7 +2140,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1783 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -1957,7 +2148,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1666 +#: ../../c-api/init.rst:1788 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -1967,11 +2158,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1799 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1801 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1984,7 +2175,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1689 +#: ../../c-api/init.rst:1811 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1993,7 +2184,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1695 +#: ../../c-api/init.rst:1817 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2005,25 +2196,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1828 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1830 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1837 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1719 +#: ../../c-api/init.rst:1841 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2031,17 +2222,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1724 +#: ../../c-api/init.rst:1846 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1847 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1850 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2049,20 +2240,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1855 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1736 +#: ../../c-api/init.rst:1858 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1741 +#: ../../c-api/init.rst:1863 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2072,7 +2263,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1872 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2080,18 +2271,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1759 +#: ../../c-api/init.rst:1881 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1886 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1768 +#: ../../c-api/init.rst:1890 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2101,7 +2292,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1778 +#: ../../c-api/init.rst:1900 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 " @@ -2113,66 +2304,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:1909 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:1909 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1789 +#: ../../c-api/init.rst:1911 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1789 ../../c-api/init.rst:1794 -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1911 ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1927 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1913 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1913 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1916 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1918 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1918 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1799 +#: ../../c-api/init.rst:1921 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1799 ../../c-api/init.rst:1801 -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1923 +#: ../../c-api/init.rst:1925 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1801 +#: ../../c-api/init.rst:1923 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1925 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1927 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1810 +#: ../../c-api/init.rst:1932 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2181,7 +2372,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1819 +#: ../../c-api/init.rst:1941 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2193,7 +2384,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:1952 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2201,31 +2392,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:1960 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:1966 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1972 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1978 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1862 +#: ../../c-api/init.rst:1984 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2233,7 +2424,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1992 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2243,29 +2434,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1877 +#: ../../c-api/init.rst:1999 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1886 -#: ../../c-api/init.rst:1905 ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:2001 ../../c-api/init.rst:2008 +#: ../../c-api/init.rst:2027 ../../c-api/init.rst:2034 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1883 +#: ../../c-api/init.rst:2005 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1888 +#: ../../c-api/init.rst:2010 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:2018 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2276,28 +2467,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:2025 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:2031 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1914 +#: ../../c-api/init.rst:2036 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:1920 +#: ../../c-api/init.rst:2042 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:2048 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2307,19 +2498,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:1936 +#: ../../c-api/init.rst:2058 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:1941 +#: ../../c-api/init.rst:2063 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:2068 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2328,7 +2519,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:1952 +#: ../../c-api/init.rst:2074 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2336,11 +2527,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1968 +#: ../../c-api/init.rst:2079 ../../c-api/init.rst:2090 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:2085 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2348,48 +2539,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:1975 +#: ../../c-api/init.rst:2097 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:1980 +#: ../../c-api/init.rst:2102 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:1985 +#: ../../c-api/init.rst:2107 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:2112 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:1995 +#: ../../c-api/init.rst:2117 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2123 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2007 +#: ../../c-api/init.rst:2129 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2014 +#: ../../c-api/init.rst:2136 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2140 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2399,19 +2590,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2147 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2150 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2032 +#: ../../c-api/init.rst:2154 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2419,22 +2610,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2162 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2164 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2170 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2175 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2442,52 +2633,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2180 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2064 +#: ../../c-api/init.rst:2186 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2069 +#: ../../c-api/init.rst:2191 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2071 +#: ../../c-api/init.rst:2193 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2078 +#: ../../c-api/init.rst:2200 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2085 +#: ../../c-api/init.rst:2207 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2091 +#: ../../c-api/init.rst:2213 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2218 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2098 +#: ../../c-api/init.rst:2220 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2495,13 +2686,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2106 +#: ../../c-api/init.rst:2228 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2112 +#: ../../c-api/init.rst:2234 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2510,7 +2701,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2243 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2519,31 +2710,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2130 +#: ../../c-api/init.rst:2252 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2137 +#: ../../c-api/init.rst:2259 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2145 +#: ../../c-api/init.rst:2267 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2269 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2152 +#: ../../c-api/init.rst:2274 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2552,62 +2743,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2279 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:2168 +#: ../../c-api/init.rst:2290 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2292 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2296 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2177 +#: ../../c-api/init.rst:2299 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2179 +#: ../../c-api/init.rst:2301 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2185 +#: ../../c-api/init.rst:2307 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2193 +#: ../../c-api/init.rst:2315 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2201 +#: ../../c-api/init.rst:2323 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2209 +#: ../../c-api/init.rst:2331 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2211 +#: ../../c-api/init.rst:2333 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2615,7 +2806,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2216 +#: ../../c-api/init.rst:2338 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2625,7 +2816,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2345 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2633,7 +2824,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2230 +#: ../../c-api/init.rst:2352 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2642,11 +2833,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2236 +#: ../../c-api/init.rst:2358 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2238 +#: ../../c-api/init.rst:2360 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2658,7 +2849,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2369 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2668,221 +2859,221 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2255 +#: ../../c-api/init.rst:2377 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2258 ../../c-api/init.rst:2272 -#: ../../c-api/init.rst:2287 ../../c-api/init.rst:2301 +#: ../../c-api/init.rst:2380 ../../c-api/init.rst:2394 +#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2423 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2260 +#: ../../c-api/init.rst:2382 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2264 ../../c-api/init.rst:2293 +#: ../../c-api/init.rst:2386 ../../c-api/init.rst:2415 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:2392 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2274 +#: ../../c-api/init.rst:2396 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2277 ../../c-api/init.rst:2306 +#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2428 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2283 +#: ../../c-api/init.rst:2405 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2289 +#: ../../c-api/init.rst:2411 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2421 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2303 +#: ../../c-api/init.rst:2425 msgid "" " PyCriticalSection_End2(&_py_cs2);\n" "}" msgstr "" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:350 msgid "PyEval_InitThreads()" msgstr "PyEval_InitThreads()" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:350 msgid "modules (in module sys)" msgstr "modules(sys 模組中)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 ../../c-api/init.rst:1011 -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 ../../c-api/init.rst:1133 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1570 ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1692 ../../c-api/init.rst:1745 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:567 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/init.rst:445 ../../c-api/init.rst:674 +#: ../../c-api/init.rst:567 ../../c-api/init.rst:796 msgid "main()" msgstr "main()" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:567 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/init.rst:555 +#: ../../c-api/init.rst:677 msgid "executable (in module sys)" msgstr "executable(sys 模組中)" -#: ../../c-api/init.rst:609 ../../c-api/init.rst:651 ../../c-api/init.rst:665 +#: ../../c-api/init.rst:731 ../../c-api/init.rst:773 ../../c-api/init.rst:787 msgid "version (in module sys)" msgstr "version(sys 模組中)" -#: ../../c-api/init.rst:621 +#: ../../c-api/init.rst:743 msgid "platform (in module sys)" msgstr "platform(sys 模組中)" -#: ../../c-api/init.rst:638 +#: ../../c-api/init.rst:760 msgid "copyright (in module sys)" msgstr "copyright(sys 模組中)" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:796 msgid "Py_FatalError()" msgstr "Py_FatalError()" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:796 msgid "argv (in module sys)" msgstr "argv(sys 模組中)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "interpreter lock" msgstr "interpreter lock(直譯器鎖)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" -#: ../../c-api/init.rst:807 +#: ../../c-api/init.rst:929 msgid "setswitchinterval (in module sys)" msgstr "setswitchinterval (sys 模組中)" -#: ../../c-api/init.rst:816 +#: ../../c-api/init.rst:938 msgid "PyThreadState (C type)" msgstr "PyThreadState(C 型別)" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:964 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:964 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "Py_END_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:980 msgid "PyEval_RestoreThread (C function)" msgstr "PyEval_RestoreThread(C 函式)" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:980 msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread(C 函式)" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:1011 +#: ../../c-api/init.rst:1133 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1570 +#: ../../c-api/init.rst:1692 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1600 +#: ../../c-api/init.rst:1722 msgid "close (in module os)" msgstr "close(os 模組中)" -#~ msgid ":c:func:`Py_SetPath`" -#~ msgstr ":c:func:`Py_SetPath`" +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" #~ msgid ":c:func:`Py_SetStandardStreamEncoding`" #~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" diff --git a/c-api/init_config.po b/c-api/init_config.po index a51f220060..0defbf5dcb 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -573,7 +573,7 @@ msgid "" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1360 +#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." @@ -1839,19 +1839,17 @@ msgstr "" msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1352 -msgid "Initialization with PyConfig" -msgstr "" - #: ../../c-api/init_config.rst:1354 -msgid "Function to initialize Python:" +msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1358 -msgid "Initialize Python from *config* configuration." +#: ../../c-api/init_config.rst:1356 +msgid "" +"Initializing the interpreter from a populated configuration struct is " +"handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: ../../c-api/init_config.rst:1363 +#: ../../c-api/init_config.rst:1362 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1860,17 +1858,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1370 +#: ../../c-api/init_config.rst:1369 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1373 +#: ../../c-api/init_config.rst:1372 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1375 +#: ../../c-api/init_config.rst:1374 msgid "" "void init_python(void)\n" "{\n" @@ -1924,7 +1922,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1400 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1933,7 +1931,7 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1408 +#: ../../c-api/init_config.rst:1407 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" @@ -1988,18 +1986,18 @@ msgid "" "}" msgstr "" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1463 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1466 +#: ../../c-api/init_config.rst:1465 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1471 +#: ../../c-api/init_config.rst:1470 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -2007,115 +2005,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1476 +#: ../../c-api/init_config.rst:1475 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1484 +#: ../../c-api/init_config.rst:1483 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1486 +#: ../../c-api/init_config.rst:1485 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1490 +#: ../../c-api/init_config.rst:1489 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1493 +#: ../../c-api/init_config.rst:1492 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1501 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1504 +#: ../../c-api/init_config.rst:1503 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1506 +#: ../../c-api/init_config.rst:1505 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1507 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1508 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1509 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1510 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1511 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1513 +#: ../../c-api/init_config.rst:1512 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1514 +#: ../../c-api/init_config.rst:1513 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1515 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1516 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1521 +#: ../../c-api/init_config.rst:1520 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1524 +#: ../../c-api/init_config.rst:1523 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1524 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1525 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1527 +#: ../../c-api/init_config.rst:1526 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1528 +#: ../../c-api/init_config.rst:1527 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -2123,11 +2121,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1529 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1532 +#: ../../c-api/init_config.rst:1531 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -2136,7 +2134,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1538 +#: ../../c-api/init_config.rst:1537 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -2146,52 +2144,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1545 +#: ../../c-api/init_config.rst:1544 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1548 +#: ../../c-api/init_config.rst:1547 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1552 +#: ../../c-api/init_config.rst:1551 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1554 +#: ../../c-api/init_config.rst:1553 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1557 +#: ../../c-api/init_config.rst:1556 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1559 +#: ../../c-api/init_config.rst:1558 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1561 +#: ../../c-api/init_config.rst:1560 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1563 +#: ../../c-api/init_config.rst:1562 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1565 +#: ../../c-api/init_config.rst:1564 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -2200,170 +2198,143 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1570 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1572 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1573 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1575 +#: ../../c-api/init_config.rst:1574 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1576 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1579 +#: ../../c-api/init_config.rst:1578 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1579 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1581 +#: ../../c-api/init_config.rst:1580 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1582 +#: ../../c-api/init_config.rst:1581 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1584 +#: ../../c-api/init_config.rst:1583 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`." msgstr "" -#: ../../c-api/init_config.rst:1589 -msgid "Py_RunMain()" -msgstr "Py_RunMain()" - -#: ../../c-api/init_config.rst:1593 -msgid "" -"Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" -"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." -"run_module`) specified on the command line or in the configuration." -msgstr "" - -#: ../../c-api/init_config.rst:1598 -msgid "By default and when if :option:`-i` option is used, run the REPL." -msgstr "" - -#: ../../c-api/init_config.rst:1600 -msgid "" -"Finally, finalizes Python and returns an exit status that can be passed to " -"the ``exit()`` function." -msgstr "" - -#: ../../c-api/init_config.rst:1603 -msgid "" -"See :ref:`Python Configuration ` for an example of " -"customized Python always running in isolated mode using :c:func:`Py_RunMain`." -msgstr "" - -#: ../../c-api/init_config.rst:1609 +#: ../../c-api/init_config.rst:1588 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1613 +#: ../../c-api/init_config.rst:1592 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1615 +#: ../../c-api/init_config.rst:1594 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1619 +#: ../../c-api/init_config.rst:1598 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1621 +#: ../../c-api/init_config.rst:1600 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1624 +#: ../../c-api/init_config.rst:1603 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1626 +#: ../../c-api/init_config.rst:1605 msgid "Builtin types;" msgstr "內建型別;" -#: ../../c-api/init_config.rst:1627 +#: ../../c-api/init_config.rst:1606 msgid "Builtin exceptions;" msgstr "內建例外;" -#: ../../c-api/init_config.rst:1628 +#: ../../c-api/init_config.rst:1607 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1629 +#: ../../c-api/init_config.rst:1608 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1632 +#: ../../c-api/init_config.rst:1611 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1634 +#: ../../c-api/init_config.rst:1613 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1635 +#: ../../c-api/init_config.rst:1614 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1636 +#: ../../c-api/init_config.rst:1615 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1637 +#: ../../c-api/init_config.rst:1616 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1639 +#: ../../c-api/init_config.rst:1618 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1640 +#: ../../c-api/init_config.rst:1619 msgid "Import the :mod:`site` module;" msgstr "引入 :mod:`site` 模組;" -#: ../../c-api/init_config.rst:1641 +#: ../../c-api/init_config.rst:1620 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1643 +#: ../../c-api/init_config.rst:1622 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1645 +#: ../../c-api/init_config.rst:1624 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1650 +#: ../../c-api/init_config.rst:1629 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1652 +#: ../../c-api/init_config.rst:1631 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2372,14 +2343,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1658 +#: ../../c-api/init_config.rst:1637 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1662 +#: ../../c-api/init_config.rst:1641 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2387,13 +2358,13 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1667 +#: ../../c-api/init_config.rst:1646 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" -#: ../../c-api/init_config.rst:1670 +#: ../../c-api/init_config.rst:1649 msgid "" "void init_python(void)\n" "{\n" @@ -2438,5 +2409,8 @@ msgstr "" msgid "argv (in module sys)" msgstr "" +#~ msgid "Py_RunMain()" +#~ msgstr "Py_RunMain()" + #~ msgid "Command line arguments: :data:`sys.argv`." #~ msgstr "命令列引數::data:`sys.argv`。" diff --git a/c-api/module.po b/c-api/module.po index 13cc3dc95a..10b3dd1087 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -42,29 +42,32 @@ msgstr "" #: ../../c-api/module.rst:40 msgid "" -"Return a new module object with the :attr:`__name__` attribute set to " -"*name*. The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, " -"and :attr:`__loader__` attributes are filled in (all but :attr:`__name__` " -"are set to ``None``); the caller is responsible for providing a :attr:" -"`__file__` attribute." +"Return a new module object with :attr:`module.__name__` set to *name*. The " +"module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module." +"__package__` and :attr:`~module.__loader__` attributes are filled in (all " +"but :attr:`!__name__` are set to ``None``). The caller is responsible for " +"setting a :attr:`~module.__file__` attribute." msgstr "" -#: ../../c-api/module.rst:46 ../../c-api/module.rst:270 -#: ../../c-api/module.rst:472 +#: ../../c-api/module.rst:46 ../../c-api/module.rst:272 +#: ../../c-api/module.rst:474 msgid "Return ``NULL`` with an exception set on error." msgstr "在失敗時回傳 ``NULL`` 並設定例外。" #: ../../c-api/module.rst:50 -msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." +#, fuzzy +msgid "" +":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " +"``None``." msgstr ":attr:`__package__` 和 :attr:`__loader__` 被設為 ``None``。" -#: ../../c-api/module.rst:56 +#: ../../c-api/module.rst:57 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." msgstr "" -#: ../../c-api/module.rst:64 +#: ../../c-api/module.rst:65 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -72,64 +75,64 @@ msgid "" "object), :exc:`SystemError` is raised and ``NULL`` is returned." msgstr "" -#: ../../c-api/module.rst:69 +#: ../../c-api/module.rst:70 msgid "" "It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " "functions rather than directly manipulate a module's :attr:`~object." "__dict__`." msgstr "" -#: ../../c-api/module.rst:80 +#: ../../c-api/module.rst:81 msgid "" -"Return *module*'s :attr:`__name__` value. If the module does not provide " -"one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " -"returned." +"Return *module*'s :attr:`~module.__name__` value. If the module does not " +"provide one, or if it is not a string, :exc:`SystemError` is raised and " +"``NULL`` is returned." msgstr "" -#: ../../c-api/module.rst:88 +#: ../../c-api/module.rst:90 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." msgstr "" -#: ../../c-api/module.rst:93 +#: ../../c-api/module.rst:95 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " "memory allocated at module creation time, or ``NULL``. See :c:member:" "`PyModuleDef.m_size`." msgstr "" -#: ../../c-api/module.rst:100 +#: ../../c-api/module.rst:102 msgid "" "Return a pointer to the :c:type:`PyModuleDef` struct from which the module " "was created, or ``NULL`` if the module wasn't created from a definition." msgstr "" -#: ../../c-api/module.rst:110 +#: ../../c-api/module.rst:112 msgid "" "Return the name of the file from which *module* was loaded using *module*'s :" -"attr:`__file__` attribute. If this is not defined, or if it is not a " -"unicode string, raise :exc:`SystemError` and return ``NULL``; otherwise " -"return a reference to a Unicode object." +"attr:`~module.__file__` attribute. If this is not defined, or if it is not " +"a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a " +"reference to a Unicode object." msgstr "" -#: ../../c-api/module.rst:120 +#: ../../c-api/module.rst:122 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." msgstr "" -#: ../../c-api/module.rst:123 +#: ../../c-api/module.rst:125 msgid "" ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" -#: ../../c-api/module.rst:131 +#: ../../c-api/module.rst:133 msgid "Initializing C modules" msgstr "初始化 C 模組" -#: ../../c-api/module.rst:133 +#: ../../c-api/module.rst:135 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -137,55 +140,55 @@ msgid "" "See :ref:`building` or :ref:`extending-with-embedding` for details." msgstr "" -#: ../../c-api/module.rst:138 +#: ../../c-api/module.rst:140 msgid "" "The initialization function can either pass a module definition instance to :" "c:func:`PyModule_Create`, and return the resulting module object, or request " "\"multi-phase initialization\" by returning the definition struct itself." msgstr "" -#: ../../c-api/module.rst:144 +#: ../../c-api/module.rst:146 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " "this type for each module." msgstr "" -#: ../../c-api/module.rst:150 +#: ../../c-api/module.rst:152 msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "" -#: ../../c-api/module.rst:154 +#: ../../c-api/module.rst:156 msgid "Name for the new module." msgstr "" -#: ../../c-api/module.rst:158 +#: ../../c-api/module.rst:160 msgid "" "Docstring for the module; usually a docstring variable created with :c:macro:" "`PyDoc_STRVAR` is used." msgstr "" -#: ../../c-api/module.rst:163 +#: ../../c-api/module.rst:165 msgid "" "Module state may be kept in a per-module memory area that can be retrieved " "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " "modules safe for use in multiple sub-interpreters." msgstr "" -#: ../../c-api/module.rst:167 +#: ../../c-api/module.rst:169 msgid "" "This memory area is allocated based on *m_size* on module creation, and " "freed when the module object is deallocated, after the :c:member:" "`~PyModuleDef.m_free` function has been called, if present." msgstr "" -#: ../../c-api/module.rst:171 +#: ../../c-api/module.rst:173 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." msgstr "" -#: ../../c-api/module.rst:174 +#: ../../c-api/module.rst:176 msgid "" "Setting it to a non-negative value means that the module can be re-" "initialized and specifies the additional amount of memory it requires for " @@ -193,37 +196,37 @@ msgid "" "initialization." msgstr "" -#: ../../c-api/module.rst:179 +#: ../../c-api/module.rst:181 msgid "See :PEP:`3121` for more details." msgstr "更多詳情請見 :pep:`3121`。" -#: ../../c-api/module.rst:183 +#: ../../c-api/module.rst:185 msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." msgstr "" -#: ../../c-api/module.rst:188 +#: ../../c-api/module.rst:190 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " "be ``NULL``." msgstr "" -#: ../../c-api/module.rst:194 +#: ../../c-api/module.rst:196 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" msgstr "" -#: ../../c-api/module.rst:201 +#: ../../c-api/module.rst:203 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:204 ../../c-api/module.rst:219 -#: ../../c-api/module.rst:240 +#: ../../c-api/module.rst:206 ../../c-api/module.rst:221 +#: ../../c-api/module.rst:242 msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " @@ -233,18 +236,18 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../c-api/module.rst:211 ../../c-api/module.rst:232 -#: ../../c-api/module.rst:247 +#: ../../c-api/module.rst:213 ../../c-api/module.rst:234 +#: ../../c-api/module.rst:249 msgid "No longer called before the module state is allocated." msgstr "" -#: ../../c-api/module.rst:216 +#: ../../c-api/module.rst:218 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:226 +#: ../../c-api/module.rst:228 msgid "" "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " "before a module is deallocated. For example, when reference counting is " @@ -253,55 +256,55 @@ msgid "" "directly." msgstr "" -#: ../../c-api/module.rst:237 +#: ../../c-api/module.rst:239 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." msgstr "" -#: ../../c-api/module.rst:251 +#: ../../c-api/module.rst:253 msgid "Single-phase initialization" msgstr "" -#: ../../c-api/module.rst:253 +#: ../../c-api/module.rst:255 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " "one of the following two module creation functions:" msgstr "" -#: ../../c-api/module.rst:259 +#: ../../c-api/module.rst:261 msgid "" "Create a new module object, given the definition in *def*. This behaves " "like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" "`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:266 +#: ../../c-api/module.rst:268 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:274 +#: ../../c-api/module.rst:276 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:277 +#: ../../c-api/module.rst:279 msgid "" "Before it is returned from in the initialization function, the resulting " "module object is typically populated using functions like :c:func:" "`PyModule_AddObjectRef`." msgstr "" -#: ../../c-api/module.rst:283 +#: ../../c-api/module.rst:285 msgid "Multi-phase initialization" msgstr "" -#: ../../c-api/module.rst:285 +#: ../../c-api/module.rst:287 msgid "" "An alternate way to specify extensions is to request \"multi-phase " "initialization\". Extension modules created this way behave more like Python " @@ -311,7 +314,7 @@ msgid "" "__init__` methods of classes." msgstr "" -#: ../../c-api/module.rst:292 +#: ../../c-api/module.rst:294 msgid "" "Unlike modules created using single-phase initialization, these modules are " "not singletons: if the *sys.modules* entry is removed and the module is re-" @@ -324,14 +327,14 @@ msgid "" "__dict__` or individual classes created with :c:func:`PyType_FromSpec`)." msgstr "" -#: ../../c-api/module.rst:302 +#: ../../c-api/module.rst:304 msgid "" "All modules created using multi-phase initialization are expected to " "support :ref:`sub-interpreters `. Making sure " "multiple modules are independent is typically enough to achieve this." msgstr "" -#: ../../c-api/module.rst:306 +#: ../../c-api/module.rst:308 msgid "" "To request multi-phase initialization, the initialization function " "(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" @@ -339,65 +342,65 @@ msgid "" "instance must be initialized with the following function:" msgstr "" -#: ../../c-api/module.rst:313 +#: ../../c-api/module.rst:315 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." msgstr "" -#: ../../c-api/module.rst:316 +#: ../../c-api/module.rst:318 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/module.rst:320 +#: ../../c-api/module.rst:322 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" msgstr "" -#: ../../c-api/module.rst:327 +#: ../../c-api/module.rst:329 msgid "A slot ID, chosen from the available values explained below." msgstr "" -#: ../../c-api/module.rst:331 +#: ../../c-api/module.rst:333 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "" -#: ../../c-api/module.rst:335 +#: ../../c-api/module.rst:337 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "" -#: ../../c-api/module.rst:337 +#: ../../c-api/module.rst:339 msgid "The available slot types are:" msgstr "" -#: ../../c-api/module.rst:341 +#: ../../c-api/module.rst:343 msgid "" "Specifies a function that is called to create the module object itself. The " "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:348 +#: ../../c-api/module.rst:350 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:353 +#: ../../c-api/module.rst:355 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:357 +#: ../../c-api/module.rst:359 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." msgstr "" -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:362 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -406,7 +409,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:366 +#: ../../c-api/module.rst:368 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -416,7 +419,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:375 +#: ../../c-api/module.rst:377 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -424,61 +427,61 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:386 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:389 ../../c-api/module.rst:422 +#: ../../c-api/module.rst:391 ../../c-api/module.rst:424 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:395 +#: ../../c-api/module.rst:397 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:401 msgid "" "The module supports being imported in subinterpreters, but only when they " "share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:405 +#: ../../c-api/module.rst:407 msgid "" "The module supports being imported in subinterpreters, even when they have " "their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:409 +#: ../../c-api/module.rst:411 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:412 +#: ../../c-api/module.rst:414 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:415 +#: ../../c-api/module.rst:417 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:428 +#: ../../c-api/module.rst:430 msgid "" "The module depends on the presence of the global interpreter lock (GIL), and " "may access global state without synchronization." msgstr "" -#: ../../c-api/module.rst:433 +#: ../../c-api/module.rst:435 msgid "The module is safe to run without an active GIL." msgstr "" -#: ../../c-api/module.rst:435 +#: ../../c-api/module.rst:437 msgid "" "This slot is ignored by Python builds not configured with :option:`--disable-" "gil`. Otherwise, it determines whether or not importing this module will " @@ -486,26 +489,26 @@ msgid "" "threaded-cpython` for more detail." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:442 msgid "" "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." msgstr "" -#: ../../c-api/module.rst:442 +#: ../../c-api/module.rst:444 msgid "" "If ``Py_mod_gil`` is not specified, the import machinery defaults to " "``Py_MOD_GIL_USED``." msgstr "" -#: ../../c-api/module.rst:447 +#: ../../c-api/module.rst:449 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:452 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:452 +#: ../../c-api/module.rst:454 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -513,14 +516,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:459 +#: ../../c-api/module.rst:461 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 :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:467 +#: ../../c-api/module.rst:469 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -528,24 +531,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:476 +#: ../../c-api/module.rst:478 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:483 +#: ../../c-api/module.rst:485 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:489 +#: ../../c-api/module.rst:491 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:498 +#: ../../c-api/module.rst:500 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -557,11 +560,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:510 +#: ../../c-api/module.rst:512 msgid "Support functions" msgstr "支援的函式" -#: ../../c-api/module.rst:512 +#: ../../c-api/module.rst:514 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -569,29 +572,29 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:519 +#: ../../c-api/module.rst:521 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:522 +#: ../../c-api/module.rst:524 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:524 +#: ../../c-api/module.rst:526 msgid "" "Return ``-1`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:527 ../../c-api/module.rst:574 -#: ../../c-api/module.rst:601 +#: ../../c-api/module.rst:529 ../../c-api/module.rst:576 +#: ../../c-api/module.rst:603 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:529 +#: ../../c-api/module.rst:531 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -617,13 +620,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:541 +#: ../../c-api/module.rst:543 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:544 +#: ../../c-api/module.rst:546 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -643,13 +646,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:553 +#: ../../c-api/module.rst:555 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:556 +#: ../../c-api/module.rst:558 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -659,7 +662,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:569 +#: ../../c-api/module.rst:571 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -667,39 +670,39 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:576 +#: ../../c-api/module.rst:578 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" -#: ../../c-api/module.rst:585 +#: ../../c-api/module.rst:587 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:588 +#: ../../c-api/module.rst:590 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:595 +#: ../../c-api/module.rst:597 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:598 +#: ../../c-api/module.rst:600 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:605 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -713,24 +716,24 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:616 +#: ../../c-api/module.rst:618 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: ../../c-api/module.rst:621 +#: ../../c-api/module.rst:623 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:625 +#: ../../c-api/module.rst:627 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:631 +#: ../../c-api/module.rst:633 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -738,14 +741,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:636 +#: ../../c-api/module.rst:638 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:643 +#: ../../c-api/module.rst:645 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -753,11 +756,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:651 +#: ../../c-api/module.rst:653 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:655 +#: ../../c-api/module.rst:657 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -765,7 +768,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:665 +#: ../../c-api/module.rst:667 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -776,25 +779,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:678 +#: ../../c-api/module.rst:680 msgid "Module lookup" msgstr "模組查找" -#: ../../c-api/module.rst:680 +#: ../../c-api/module.rst:682 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:684 +#: ../../c-api/module.rst:686 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:689 +#: ../../c-api/module.rst:691 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -803,18 +806,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:696 +#: ../../c-api/module.rst:698 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:701 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:701 +#: ../../c-api/module.rst:703 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -825,15 +828,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:709 ../../c-api/module.rst:720 +#: ../../c-api/module.rst:711 ../../c-api/module.rst:722 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:711 +#: ../../c-api/module.rst:713 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:717 +#: ../../c-api/module.rst:719 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." @@ -851,7 +854,7 @@ msgstr "module(模組)" msgid "ModuleType (in module types)" msgstr "MethodType(types 模組中)" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:76 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:77 msgid "__name__ (module attribute)" msgstr "__name__(模組屬性)" @@ -859,7 +862,7 @@ msgstr "__name__(模組屬性)" msgid "__doc__ (module attribute)" msgstr "__doc__(模組屬性)" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:108 msgid "__file__ (module attribute)" msgstr "__file__(模組屬性)" @@ -871,10 +874,10 @@ msgstr "__package__(模組屬性)" msgid "__loader__ (module attribute)" msgstr "__loader__(模組屬性)" -#: ../../c-api/module.rst:62 +#: ../../c-api/module.rst:63 msgid "__dict__ (module attribute)" msgstr "__dict__(模組屬性)" -#: ../../c-api/module.rst:76 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:77 ../../c-api/module.rst:108 msgid "SystemError (built-in exception)" msgstr "SystemError(內建例外)" diff --git a/c-api/tuple.po b/c-api/tuple.po index 3e5dbda024..30724c0d7e 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -119,8 +119,8 @@ msgid "" "*only* be used to fill in brand new tuples." msgstr "" -#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:217 -#: ../../c-api/tuple.rst:235 +#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:218 +#: ../../c-api/tuple.rst:236 msgid "" "Bounds checking is performed as an assertion if Python is built in :ref:" "`debug mode ` or :option:`with assertions <--with-assertions>`." @@ -167,7 +167,7 @@ msgid "" "`PyStructSequence_New`." msgstr "" -#: ../../c-api/tuple.rst:142 ../../c-api/tuple.rst:210 +#: ../../c-api/tuple.rst:142 ../../c-api/tuple.rst:211 msgid "Return ``NULL`` with an exception set on failure." msgstr "" @@ -186,22 +186,24 @@ msgid "Contains the meta information of a struct sequence type to create." msgstr "" #: ../../c-api/tuple.rst:164 -msgid "Name of the struct sequence type." +msgid "" +"Fully qualified name of the type; null-terminated UTF-8 encoded. The name " +"must contain the module name." msgstr "" -#: ../../c-api/tuple.rst:168 +#: ../../c-api/tuple.rst:169 msgid "Pointer to docstring for the type or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:172 +#: ../../c-api/tuple.rst:173 msgid "Pointer to ``NULL``-terminated array with field names of the new type." msgstr "" -#: ../../c-api/tuple.rst:176 +#: ../../c-api/tuple.rst:177 msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" -#: ../../c-api/tuple.rst:181 +#: ../../c-api/tuple.rst:182 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " "tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" @@ -210,59 +212,59 @@ msgid "" "described." msgstr "" -#: ../../c-api/tuple.rst:189 +#: ../../c-api/tuple.rst:190 msgid "" "Name for the field or ``NULL`` to end the list of named fields, set to :c:" "data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" -#: ../../c-api/tuple.rst:194 +#: ../../c-api/tuple.rst:195 msgid "Field docstring or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:199 +#: ../../c-api/tuple.rst:200 msgid "Special value for a field name to leave it unnamed." msgstr "" -#: ../../c-api/tuple.rst:201 +#: ../../c-api/tuple.rst:202 msgid "The type was changed from ``char *``." msgstr "" -#: ../../c-api/tuple.rst:207 +#: ../../c-api/tuple.rst:208 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." msgstr "" -#: ../../c-api/tuple.rst:215 +#: ../../c-api/tuple.rst:216 msgid "" "Return the object at position *pos* in the struct sequence pointed to by *p*." msgstr "" -#: ../../c-api/tuple.rst:223 +#: ../../c-api/tuple.rst:224 msgid "Alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:225 +#: ../../c-api/tuple.rst:226 msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:231 +#: ../../c-api/tuple.rst:232 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " "new instances." msgstr "" -#: ../../c-api/tuple.rst:240 +#: ../../c-api/tuple.rst:241 msgid "This function \"steals\" a reference to *o*." msgstr "" -#: ../../c-api/tuple.rst:245 +#: ../../c-api/tuple.rst:246 msgid "Alias to :c:func:`PyStructSequence_SetItem`." msgstr "" -#: ../../c-api/tuple.rst:247 +#: ../../c-api/tuple.rst:248 msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 7f42392eaf..2bccfe497c 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,47 +51,23 @@ msgstr "" #: ../../c-api/veryhigh.rst:30 msgid "" -"The main program for the standard interpreter. This is made available for " -"programs which embed Python. The *argc* and *argv* parameters should be " -"prepared exactly as those which are passed to a C program's :c:func:`main` " -"function (converted to wchar_t according to the user's locale). It is " -"important to note that the argument list may be modified (but the contents " -"of the strings pointed to by the argument list are not). The return value " -"will be ``0`` if the interpreter exits normally (i.e., without an " -"exception), ``1`` if the interpreter exits due to an exception, or ``2`` if " -"the parameter list does not represent a valid Python command line." -msgstr "" - -#: ../../c-api/veryhigh.rst:40 -msgid "" -"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``1``, but exit the process, as long as :c:member:" -"`PyConfig.inspect` is zero." -msgstr "" - -#: ../../c-api/veryhigh.rst:47 -msgid "Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings." -msgstr "" - -#: ../../c-api/veryhigh.rst:54 -msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:60 +#: ../../c-api/veryhigh.rst:36 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *closeit* argument set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:66 +#: ../../c-api/veryhigh.rst:42 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *flags* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:72 +#: ../../c-api/veryhigh.rst:48 msgid "" "If *fp* refers to a file associated with an interactive device (console or " "terminal input or Unix pseudo-terminal), return the value of :c:func:" @@ -102,13 +78,13 @@ msgid "" "before ``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:84 +#: ../../c-api/veryhigh.rst:60 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " "leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:90 +#: ../../c-api/veryhigh.rst:66 msgid "" "Executes the Python source code from *command* in the :mod:`__main__` module " "according to the *flags* argument. If :mod:`__main__` does not already " @@ -117,26 +93,26 @@ msgid "" "information. For the meaning of *flags*, see below." msgstr "" -#: ../../c-api/veryhigh.rst:96 +#: ../../c-api/veryhigh.rst:72 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " "function will not return ``-1``, but exit the process, as long as :c:member:" "`PyConfig.inspect` is zero." msgstr "" -#: ../../c-api/veryhigh.rst:103 +#: ../../c-api/veryhigh.rst:79 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:109 +#: ../../c-api/veryhigh.rst:85 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:115 +#: ../../c-api/veryhigh.rst:91 msgid "" "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " "read from *fp* instead of an in-memory string. *filename* should be the name " @@ -145,20 +121,20 @@ msgid "" "``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:122 +#: ../../c-api/veryhigh.rst:98 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 " "correctly." msgstr "" -#: ../../c-api/veryhigh.rst:128 +#: ../../c-api/veryhigh.rst:104 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:134 +#: ../../c-api/veryhigh.rst:110 msgid "" "Read and execute a single statement from a file associated with an " "interactive device according to the *flags* argument. The user will be " @@ -166,7 +142,7 @@ msgid "" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:139 +#: ../../c-api/veryhigh.rst:115 msgid "" "Returns ``0`` when the input was executed successfully, ``-1`` if there was " "an exception, or an error code from the :file:`errcode.h` include file " @@ -175,13 +151,13 @@ msgid "" "specifically if needed.)" msgstr "" -#: ../../c-api/veryhigh.rst:148 +#: ../../c-api/veryhigh.rst:124 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:154 +#: ../../c-api/veryhigh.rst:130 msgid "" "Read and execute statements from a file associated with an interactive " "device until EOF is reached. The user will be prompted using ``sys.ps1`` " @@ -189,7 +165,7 @@ msgid "" "and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" -#: ../../c-api/veryhigh.rst:162 +#: ../../c-api/veryhigh.rst:138 msgid "" "Can be set to point to a function with the prototype ``int func(void)``. " "The function will be called when Python's interpreter prompt is about to " @@ -199,13 +175,13 @@ msgid "" "the Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:170 ../../c-api/veryhigh.rst:194 +#: ../../c-api/veryhigh.rst:146 ../../c-api/veryhigh.rst:170 msgid "" "This function is only called from the :ref:`main interpreter `." msgstr "" -#: ../../c-api/veryhigh.rst:177 +#: ../../c-api/veryhigh.rst:153 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -216,26 +192,26 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: ../../c-api/veryhigh.rst:186 +#: ../../c-api/veryhigh.rst:162 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/veryhigh.rst:189 +#: ../../c-api/veryhigh.rst:165 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" "c:func:`PyMem_Realloc`." msgstr "" -#: ../../c-api/veryhigh.rst:200 +#: ../../c-api/veryhigh.rst:176 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:206 +#: ../../c-api/veryhigh.rst:182 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -244,31 +220,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: ../../c-api/veryhigh.rst:212 +#: ../../c-api/veryhigh.rst:188 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:218 +#: ../../c-api/veryhigh.rst:194 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:224 +#: ../../c-api/veryhigh.rst:200 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:230 +#: ../../c-api/veryhigh.rst:206 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:236 +#: ../../c-api/veryhigh.rst:212 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -277,19 +253,19 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:245 +#: ../../c-api/veryhigh.rst:221 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:251 +#: ../../c-api/veryhigh.rst:227 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:257 +#: ../../c-api/veryhigh.rst:233 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 " @@ -300,7 +276,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:265 +#: ../../c-api/veryhigh.rst:241 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -309,20 +285,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:276 +#: ../../c-api/veryhigh.rst:252 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:283 +#: ../../c-api/veryhigh.rst:259 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:290 +#: ../../c-api/veryhigh.rst:266 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -331,13 +307,13 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:299 +#: ../../c-api/veryhigh.rst:275 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:305 +#: ../../c-api/veryhigh.rst:281 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -347,39 +323,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:312 +#: ../../c-api/veryhigh.rst:288 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:319 +#: ../../c-api/veryhigh.rst:295 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:303 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:335 +#: ../../c-api/veryhigh.rst:311 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:344 +#: ../../c-api/veryhigh.rst:320 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:351 +#: ../../c-api/veryhigh.rst:327 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -387,40 +363,40 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:356 +#: ../../c-api/veryhigh.rst:332 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." "cf_flags` is treated as equal to ``0``, and any modification due to ``from " "__future__ import`` is discarded." msgstr "" -#: ../../c-api/veryhigh.rst:362 +#: ../../c-api/veryhigh.rst:338 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:366 +#: ../../c-api/veryhigh.rst:342 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:369 +#: ../../c-api/veryhigh.rst:345 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" -#: ../../c-api/veryhigh.rst:372 +#: ../../c-api/veryhigh.rst:348 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:378 +#: ../../c-api/veryhigh.rst:354 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:325 ../../c-api/veryhigh.rst:333 -#: ../../c-api/veryhigh.rst:342 +#: ../../c-api/veryhigh.rst:301 ../../c-api/veryhigh.rst:309 +#: ../../c-api/veryhigh.rst:318 msgid "Py_CompileString (C function)" msgstr "Py_CompileString(C 函式)" diff --git a/deprecations/index.po b/deprecations/index.po index da4145159a..ddad8933c8 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,6 +26,19 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -35,7 +48,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -44,38 +57,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -87,7 +100,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -99,7 +112,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -110,7 +123,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -122,7 +135,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -130,39 +143,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -173,7 +186,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -190,7 +203,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -198,7 +211,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -208,27 +221,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -238,7 +251,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -246,7 +259,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -258,7 +271,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -266,7 +279,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -280,23 +293,39 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 #, fuzzy msgid ":mod:`ctypes`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:6 +#: ../../deprecations/pending-removal-in-3.15.rst:18 msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 #, fuzzy msgid ":mod:`http.server`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " @@ -307,26 +336,18 @@ msgstr "" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -340,12 +361,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -354,24 +375,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -379,12 +400,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 #, fuzzy msgid ":mod:`typing`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -396,19 +417,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -1351,6 +1372,13 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" +#~ msgid "" +#~ ":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set " +#~ "or taken into consideration by the import system (:gh:`97879`)." +#~ msgstr "" +#~ ":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 " +#~ "import 系統考慮。 (:gh:`97879`)" + #~ msgid "" #~ ":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " #~ "removed in 3.15. It was largely untested, had a confusing API, and was " diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 5d13a24b7c..6b433dac75 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,6 +21,18 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 +msgid "The import system:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -30,7 +42,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -39,38 +51,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -82,7 +94,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -94,7 +106,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -105,7 +117,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -117,7 +129,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -125,39 +137,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -168,7 +180,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -185,7 +197,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -193,7 +205,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -203,27 +215,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -233,7 +245,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -241,7 +253,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -253,7 +265,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -261,7 +273,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index de0e0e3b3c..4d95ff9016 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,20 +21,40 @@ msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:4 -msgid ":mod:`ctypes`:" +msgid "The import system:" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 +msgid ":mod:`ctypes`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:18 +msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " @@ -45,24 +65,18 @@ msgstr "" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`typing.NamedTuple`:" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -76,11 +90,11 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -89,22 +103,22 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -112,11 +126,11 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -128,18 +142,18 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/glossary.po b/glossary.po index 16e1df90ad..0e2464d8e3 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 18:29+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -530,10 +530,51 @@ msgstr "" "修改的變數。" #: ../../glossary.rst:228 +#, fuzzy +msgid "closure variable" +msgstr "class variable(類別變數)" + +#: ../../glossary.rst:230 +msgid "" +"A :term:`free variable` referenced from a :term:`nested scope` that is " +"defined in an outer scope rather than being resolved at runtime from the " +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." +msgstr "" + +#: ../../glossary.rst:235 +msgid "" +"For example, in the ``inner`` function in the following code, both ``x`` and " +"``print`` are :term:`free variables `, but only ``x`` is a " +"*closure variable*::" +msgstr "" + +#: ../../glossary.rst:238 +msgid "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" +msgstr "" + +#: ../../glossary.rst:246 +msgid "" +"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " +"name, only includes the names of closure variables rather than listing all " +"referenced free variables), the more general :term:`free variable` term is " +"sometimes used even when the intended meaning is to refer specifically to " +"closure variables." +msgstr "" + +#: ../../glossary.rst:250 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:230 +#: ../../glossary.rst:252 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -553,11 +594,11 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:240 +#: ../../glossary.rst:262 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:242 +#: ../../glossary.rst:264 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " @@ -567,11 +608,11 @@ msgstr "" "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" "`343`。" -#: ../../glossary.rst:245 +#: ../../glossary.rst:267 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:247 +#: ../../glossary.rst:269 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -586,11 +627,11 @@ msgstr "" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" "`contextvars`。" -#: ../../glossary.rst:254 +#: ../../glossary.rst:276 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:258 +#: ../../glossary.rst:280 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -607,11 +648,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:266 +#: ../../glossary.rst:288 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:268 +#: ../../glossary.rst:290 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -622,11 +663,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:295 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:297 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -637,11 +678,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " "for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:302 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:282 +#: ../../glossary.rst:304 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -652,11 +693,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:286 +#: ../../glossary.rst:308 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:288 +#: ../../glossary.rst:310 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -666,13 +707,13 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`。" -#: ../../glossary.rst:292 +#: ../../glossary.rst:314 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::" -#: ../../glossary.rst:295 +#: ../../glossary.rst:317 msgid "" "def f(arg):\n" " ...\n" @@ -690,7 +731,7 @@ msgstr "" "def f(arg):\n" " ..." -#: ../../glossary.rst:303 +#: ../../glossary.rst:325 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -699,11 +740,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:306 +#: ../../glossary.rst:328 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:308 +#: ../../glossary.rst:330 msgid "" "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." "__set__`, or :meth:`~object.__delete__`. When a class attribute is a " @@ -723,7 +764,7 @@ msgstr "" "們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" "靜態 method,以及對 super class(父類別)的參照。" -#: ../../glossary.rst:319 +#: ../../glossary.rst:341 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -731,11 +772,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `。" -#: ../../glossary.rst:321 +#: ../../glossary.rst:343 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:323 +#: ../../glossary.rst:345 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " @@ -745,11 +786,11 @@ msgstr "" "有 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` method 的物件。在 Perl " "中被稱為雜湊 (hash)。" -#: ../../glossary.rst:327 +#: ../../glossary.rst:349 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:329 +#: ../../glossary.rst:351 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -760,11 +801,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:333 +#: ../../glossary.rst:355 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:335 +#: ../../glossary.rst:357 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -777,11 +818,11 @@ msgstr "" "反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:341 +#: ../../glossary.rst:363 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:343 +#: ../../glossary.rst:365 #, fuzzy msgid "" "A string literal which appears as the first expression in a class, function " @@ -795,11 +836,11 @@ msgstr "" "__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:349 +#: ../../glossary.rst:371 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:351 +#: ../../glossary.rst:373 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -820,11 +861,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:360 +#: ../../glossary.rst:382 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:362 +#: ../../glossary.rst:384 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -839,11 +880,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:368 +#: ../../glossary.rst:390 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:370 +#: ../../glossary.rst:392 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -859,11 +900,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" "式,而不是運算式。" -#: ../../glossary.rst:377 +#: ../../glossary.rst:399 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:379 +#: ../../glossary.rst:401 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -871,11 +912,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:381 +#: ../../glossary.rst:403 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:383 +#: ../../glossary.rst:405 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -884,11 +925,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:408 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:388 +#: ../../glossary.rst:410 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -903,7 +944,7 @@ msgstr "" "衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案" "物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:396 +#: ../../glossary.rst:418 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -915,19 +956,19 @@ msgstr "" "term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" "面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:401 +#: ../../glossary.rst:423 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:403 +#: ../../glossary.rst:425 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:404 +#: ../../glossary.rst:426 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:406 +#: ../../glossary.rst:428 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -935,7 +976,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:409 +#: ../../glossary.rst:431 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -944,7 +985,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:413 +#: ../../glossary.rst:435 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -953,7 +994,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:417 +#: ../../glossary.rst:439 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -965,22 +1006,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:422 +#: ../../glossary.rst:444 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:423 +#: ../../glossary.rst:445 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:425 +#: ../../glossary.rst:447 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:450 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項目尋檢器 (path " "entry finder) ` 會使用 :data:`sys.path_hooks`。" -#: ../../glossary.rst:432 -msgid "See :ref:`importsystem` and :mod:`importlib` for much more detail." +#: ../../glossary.rst:454 +#, fuzzy +msgid "" +"See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." msgstr "請參閱 :ref:`importsystem` 和 :mod:`importlib` 以了解更多細節。" -#: ../../glossary.rst:433 +#: ../../glossary.rst:455 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:435 +#: ../../glossary.rst:457 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1011,11 +1054,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:440 +#: ../../glossary.rst:462 msgid "free threading" msgstr "" -#: ../../glossary.rst:442 +#: ../../glossary.rst:464 msgid "" "A threading model where multiple threads can run Python bytecode " "simultaneously within the same interpreter. This is in contrast to the :" @@ -1023,11 +1066,26 @@ msgid "" "Python bytecode at a time. See :pep:`703`." msgstr "" -#: ../../glossary.rst:446 +#: ../../glossary.rst:468 +#, fuzzy +msgid "free variable" +msgstr "context variable(情境變數)" + +#: ../../glossary.rst:470 +msgid "" +"Formally, as defined in the :ref:`language execution model `, a " +"free variable is any variable used in a namespace which is not a local " +"variable in that namespace. See :term:`closure variable` for an example. " +"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " +"attribute, the term is also sometimes used as a synonym for :term:`closure " +"variable`." +msgstr "" + +#: ../../glossary.rst:475 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:448 +#: ../../glossary.rst:477 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1039,15 +1097,15 @@ msgstr "" "`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " "章節。" -#: ../../glossary.rst:452 +#: ../../glossary.rst:481 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:454 +#: ../../glossary.rst:483 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:456 +#: ../../glossary.rst:485 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1056,7 +1114,7 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到" "兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:461 +#: ../../glossary.rst:490 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1064,11 +1122,11 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: ../../glossary.rst:464 +#: ../../glossary.rst:493 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:466 +#: ../../glossary.rst:495 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1077,11 +1135,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:470 +#: ../../glossary.rst:499 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:472 +#: ../../glossary.rst:501 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1097,7 +1155,7 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:480 +#: ../../glossary.rst:509 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1107,11 +1165,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: ../../glossary.rst:483 +#: ../../glossary.rst:512 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:485 +#: ../../glossary.rst:514 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1123,11 +1181,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:490 ../../glossary.rst:491 +#: ../../glossary.rst:519 ../../glossary.rst:520 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:493 +#: ../../glossary.rst:522 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1138,7 +1196,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:498 +#: ../../glossary.rst:527 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1147,15 +1205,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:501 +#: ../../glossary.rst:530 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:503 +#: ../../glossary.rst:532 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:505 +#: ../../glossary.rst:534 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1166,11 +1224,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:511 ../../glossary.rst:512 +#: ../../glossary.rst:540 ../../glossary.rst:541 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:514 +#: ../../glossary.rst:543 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1182,17 +1240,17 @@ msgstr "" "變數、範圍以及一個選擇性的 :keyword:`!if` 子句。該組合運算式會為外層函式產生" "多個值: ::" -#: ../../glossary.rst:519 +#: ../../glossary.rst:548 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" msgstr "" -#: ../../glossary.rst:521 +#: ../../glossary.rst:550 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:523 +#: ../../glossary.rst:552 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1201,7 +1259,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:556 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1209,11 +1267,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." "singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:529 +#: ../../glossary.rst:558 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:531 +#: ../../glossary.rst:560 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1223,7 +1281,7 @@ msgstr "" "`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:536 +#: ../../glossary.rst:565 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1231,19 +1289,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" "`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:538 +#: ../../glossary.rst:567 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:540 +#: ../../glossary.rst:569 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:541 +#: ../../glossary.rst:570 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:572 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1260,7 +1318,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:552 +#: ../../glossary.rst:581 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1271,21 +1329,21 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:557 +#: ../../glossary.rst:586 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " -"run with :option:`-X gil 0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " +"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " "` environment variable. This feature enables improved " "performance for multi-threaded applications and makes it easier to use multi-" "core CPUs efficiently. For more details, see :pep:`703`." msgstr "" -#: ../../glossary.rst:563 +#: ../../glossary.rst:592 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:565 +#: ../../glossary.rst:594 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1294,11 +1352,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:568 +#: ../../glossary.rst:597 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:570 +#: ../../glossary.rst:599 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " @@ -1310,7 +1368,7 @@ msgstr "" "`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" "多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:576 +#: ../../glossary.rst:605 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1318,7 +1376,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:579 +#: ../../glossary.rst:608 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1333,11 +1391,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:586 +#: ../../glossary.rst:615 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:588 +#: ../../glossary.rst:617 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1347,28 +1405,28 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:591 +#: ../../glossary.rst:620 msgid "immortal" msgstr "" -#: ../../glossary.rst:593 +#: ../../glossary.rst:622 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." msgstr "" -#: ../../glossary.rst:596 +#: ../../glossary.rst:625 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" -#: ../../glossary.rst:599 +#: ../../glossary.rst:628 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:601 +#: ../../glossary.rst:630 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1380,11 +1438,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:606 +#: ../../glossary.rst:635 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:608 +#: ../../glossary.rst:637 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1396,11 +1454,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:613 +#: ../../glossary.rst:642 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:615 +#: ../../glossary.rst:644 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1408,11 +1466,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:617 +#: ../../glossary.rst:646 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:619 +#: ../../glossary.rst:648 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1420,11 +1478,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:621 +#: ../../glossary.rst:650 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:623 +#: ../../glossary.rst:652 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1438,11 +1496,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:630 +#: ../../glossary.rst:659 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:632 +#: ../../glossary.rst:661 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1456,11 +1514,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:639 +#: ../../glossary.rst:668 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:641 +#: ../../glossary.rst:670 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1478,18 +1536,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:679 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:652 +#: ../../glossary.rst:681 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:654 +#: ../../glossary.rst:683 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1505,7 +1563,7 @@ msgstr "" "`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物件就是可" "疊代物件。" -#: ../../glossary.rst:662 +#: ../../glossary.rst:691 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1525,11 +1583,11 @@ msgstr "" "數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" "term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:672 +#: ../../glossary.rst:701 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:674 +#: ../../glossary.rst:703 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1558,11 +1616,11 @@ msgstr "" "此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:689 +#: ../../glossary.rst:718 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:693 +#: ../../glossary.rst:722 #, fuzzy msgid "" "CPython does not consistently apply the requirement that an iterator define :" @@ -1572,11 +1630,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." "__iter__`\\ 」這個規定。" -#: ../../glossary.rst:698 +#: ../../glossary.rst:727 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:700 +#: ../../glossary.rst:729 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1586,7 +1644,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:705 +#: ../../glossary.rst:734 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1598,7 +1656,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:711 +#: ../../glossary.rst:740 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1615,19 +1673,19 @@ msgstr "" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:718 +#: ../../glossary.rst:747 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:720 ../../glossary.rst:1019 +#: ../../glossary.rst:749 ../../glossary.rst:1053 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:721 +#: ../../glossary.rst:750 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:723 +#: ../../glossary.rst:752 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1637,11 +1695,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:726 +#: ../../glossary.rst:755 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:728 +#: ../../glossary.rst:757 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1652,7 +1710,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:733 +#: ../../glossary.rst:762 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1666,11 +1724,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:738 +#: ../../glossary.rst:767 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:740 +#: ../../glossary.rst:769 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1680,11 +1738,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:743 +#: ../../glossary.rst:772 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:745 +#: ../../glossary.rst:774 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1698,27 +1756,39 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:751 +#: ../../glossary.rst:780 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:753 +#: ../../glossary.rst:782 +#, fuzzy msgid "" "An object that loads a module. It must define a method named :meth:" -"`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" -"`302` for details and :class:`importlib.abc.Loader` for an :term:`abstract " -"base class`." +"`load_module`. A loader is typically returned by a :term:`finder`. See also:" msgstr "" "一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" "法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`。" -#: ../../glossary.rst:757 +#: ../../glossary.rst:786 +msgid ":ref:`finders-and-loaders`" +msgstr "" + +#: ../../glossary.rst:787 +msgid ":class:`importlib.abc.Loader`" +msgstr "" + +#: ../../glossary.rst:788 +#, fuzzy +msgid ":pep:`302`" +msgstr "請參閱 :pep:`1`。" + +#: ../../glossary.rst:789 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:759 +#: ../../glossary.rst:791 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1726,36 +1796,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:762 +#: ../../glossary.rst:794 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:764 +#: ../../glossary.rst:796 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:766 +#: ../../glossary.rst:798 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:768 +#: ../../glossary.rst:800 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:769 +#: ../../glossary.rst:801 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:773 +#: ../../glossary.rst:805 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:774 +#: ../../glossary.rst:806 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:776 +#: ../../glossary.rst:808 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1770,11 +1840,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:782 +#: ../../glossary.rst:814 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:784 +#: ../../glossary.rst:816 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:820 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:790 +#: ../../glossary.rst:822 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:792 +#: ../../glossary.rst:824 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1815,15 +1885,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:802 +#: ../../glossary.rst:834 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:771 ../../glossary.rst:803 ../../glossary.rst:1164 +#: ../../glossary.rst:803 ../../glossary.rst:835 ../../glossary.rst:1198 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:805 +#: ../../glossary.rst:837 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1835,11 +1905,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:809 +#: ../../glossary.rst:841 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:811 +#: ../../glossary.rst:843 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -1848,11 +1918,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:846 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:816 +#: ../../glossary.rst:848 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1862,15 +1932,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:852 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:821 +#: ../../glossary.rst:853 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:823 +#: ../../glossary.rst:855 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1878,19 +1948,24 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:825 +#: ../../glossary.rst:858 +#, fuzzy +msgid "See also :ref:`module-specs`." +msgstr "另請參閱 :term:`module`\\ (模組)。" + +#: ../../glossary.rst:859 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:827 +#: ../../glossary.rst:861 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:828 +#: ../../glossary.rst:862 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:830 +#: ../../glossary.rst:864 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1898,11 +1973,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:832 +#: ../../glossary.rst:866 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:834 +#: ../../glossary.rst:868 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1912,7 +1987,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:838 +#: ../../glossary.rst:872 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1921,7 +1996,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:842 +#: ../../glossary.rst:876 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -1931,7 +2006,7 @@ msgid "" "True" msgstr "" -#: ../../glossary.rst:849 +#: ../../glossary.rst:883 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1948,11 +2023,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:857 +#: ../../glossary.rst:891 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:859 +#: ../../glossary.rst:893 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1972,11 +2047,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:869 +#: ../../glossary.rst:903 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:871 +#: ../../glossary.rst:905 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1987,15 +2062,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:876 +#: ../../glossary.rst:910 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:911 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:879 +#: ../../glossary.rst:913 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2010,11 +2085,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:886 +#: ../../glossary.rst:920 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:888 +#: ../../glossary.rst:922 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2026,11 +2101,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:893 +#: ../../glossary.rst:927 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:895 +#: ../../glossary.rst:929 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2038,11 +2113,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:898 +#: ../../glossary.rst:932 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:900 +#: ../../glossary.rst:934 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2053,11 +2128,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:907 +#: ../../glossary.rst:941 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:909 +#: ../../glossary.rst:943 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2067,17 +2142,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:913 +#: ../../glossary.rst:947 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:914 +#: ../../glossary.rst:948 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:916 +#: ../../glossary.rst:950 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2087,7 +2162,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:920 +#: ../../glossary.rst:954 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2098,11 +2173,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:925 +#: ../../glossary.rst:959 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:929 +#: ../../glossary.rst:963 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2113,11 +2188,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:934 +#: ../../glossary.rst:968 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:938 +#: ../../glossary.rst:972 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2130,11 +2205,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:944 +#: ../../glossary.rst:978 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:946 +#: ../../glossary.rst:980 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2146,11 +2221,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:952 +#: ../../glossary.rst:986 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:954 +#: ../../glossary.rst:988 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2161,14 +2236,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:960 +#: ../../glossary.rst:994 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:963 +#: ../../glossary.rst:997 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2179,11 +2254,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:967 +#: ../../glossary.rst:1001 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:969 +#: ../../glossary.rst:1003 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2191,11 +2266,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:971 +#: ../../glossary.rst:1005 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:973 +#: ../../glossary.rst:1007 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2205,7 +2280,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:977 +#: ../../glossary.rst:1011 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2213,11 +2288,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:979 +#: ../../glossary.rst:1013 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:981 +#: ../../glossary.rst:1015 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2227,11 +2302,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:984 +#: ../../glossary.rst:1018 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:986 +#: ../../glossary.rst:1020 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2239,11 +2314,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:1022 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:990 +#: ../../glossary.rst:1024 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2261,11 +2336,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1032 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1034 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2276,7 +2351,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1040 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2288,15 +2363,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1012 +#: ../../glossary.rst:1046 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1047 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1049 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2304,15 +2379,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1051 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1054 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1022 +#: ../../glossary.rst:1056 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2328,7 +2403,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1065 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2337,7 +2412,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1035 +#: ../../glossary.rst:1069 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2346,19 +2421,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1072 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1074 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1041 +#: ../../glossary.rst:1075 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1043 +#: ../../glossary.rst:1077 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2367,11 +2442,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1080 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1048 +#: ../../glossary.rst:1082 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2385,7 +2460,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1055 +#: ../../glossary.rst:1089 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2393,11 +2468,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1058 +#: ../../glossary.rst:1092 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1060 +#: ../../glossary.rst:1094 msgid "" "for piece in food:\n" " print(piece)" @@ -2405,11 +2480,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1062 +#: ../../glossary.rst:1096 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1098 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2420,7 +2495,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1103 msgid "" ">>> class C:\n" "... class D:\n" @@ -2446,7 +2521,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1081 +#: ../../glossary.rst:1115 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2455,7 +2530,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:1119 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2465,11 +2540,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1088 +#: ../../glossary.rst:1122 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1090 +#: ../../glossary.rst:1124 #, fuzzy msgid "" "The number of references to an object. When the reference count of an " @@ -2486,11 +2561,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1132 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1100 +#: ../../glossary.rst:1134 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2498,25 +2573,25 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1137 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1138 msgid "REPL" msgstr "" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1140 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." msgstr "" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1142 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1144 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2529,11 +2604,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1149 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1117 +#: ../../glossary.rst:1151 #, fuzzy msgid "" "An :term:`iterable` which supports efficient element access using integer " @@ -2553,7 +2628,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` " "鍵,而不是整數。" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1160 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2570,11 +2645,11 @@ msgstr "" "用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" "\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1169 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1171 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2585,11 +2660,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1175 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1177 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2597,11 +2672,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1179 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1181 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2613,34 +2688,34 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1185 msgid "soft deprecated" msgstr "" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1187 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " "will not be enhanced further." msgstr "" -#: ../../glossary.rst:1157 +#: ../../glossary.rst:1191 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1194 msgid "" "See `PEP 387: Soft Deprecation `_." msgstr "" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1196 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1200 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2651,11 +2726,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1204 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1172 +#: ../../glossary.rst:1206 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2665,11 +2740,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1209 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1211 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2679,11 +2754,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1180 +#: ../../glossary.rst:1214 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1216 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2694,7 +2769,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1188 +#: ../../glossary.rst:1222 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2704,15 +2779,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1227 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1194 +#: ../../glossary.rst:1228 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1196 +#: ../../glossary.rst:1230 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 " @@ -2721,7 +2796,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1234 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2729,7 +2804,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1237 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2737,11 +2812,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1240 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1242 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2755,7 +2830,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1249 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2763,11 +2838,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1251 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1253 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2782,11 +2857,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1260 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1262 #, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " @@ -2797,22 +2872,22 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1232 +#: ../../glossary.rst:1266 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1234 +#: ../../glossary.rst:1268 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1270 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1239 +#: ../../glossary.rst:1273 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2822,11 +2897,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1277 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1245 +#: ../../glossary.rst:1279 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2838,15 +2913,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1250 ../../glossary.rst:1264 +#: ../../glossary.rst:1284 ../../glossary.rst:1298 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1285 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1253 +#: ../../glossary.rst:1287 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2854,7 +2929,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1290 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -2864,7 +2939,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1294 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2872,11 +2947,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1265 +#: ../../glossary.rst:1299 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1301 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2889,20 +2964,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1272 +#: ../../glossary.rst:1306 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1274 +#: ../../glossary.rst:1308 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1276 +#: ../../glossary.rst:1310 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1278 +#: ../../glossary.rst:1312 msgid "" "class C:\n" " field: 'annotation'" @@ -2910,7 +2985,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1281 +#: ../../glossary.rst:1315 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2918,15 +2993,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1285 +#: ../../glossary.rst:1319 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1287 +#: ../../glossary.rst:1321 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1289 +#: ../../glossary.rst:1323 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2935,11 +3010,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1293 +#: ../../glossary.rst:1327 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1295 +#: ../../glossary.rst:1329 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2950,15 +3025,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1300 +#: ../../glossary.rst:1334 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1301 +#: ../../glossary.rst:1335 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1303 +#: ../../glossary.rst:1337 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2966,11 +3041,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1305 +#: ../../glossary.rst:1339 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1307 +#: ../../glossary.rst:1341 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2979,19 +3054,19 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:256 +#: ../../glossary.rst:278 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:256 +#: ../../glossary.rst:278 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:771 +#: ../../glossary.rst:803 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1198 msgid "special" msgstr "special" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po new file mode 100644 index 0000000000..550beb2efd --- /dev/null +++ b/howto/argparse-optparse.po @@ -0,0 +1,119 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../howto/argparse-optparse.rst:7 +msgid "Upgrading optparse code" +msgstr "" + +#: ../../howto/argparse-optparse.rst:9 +msgid "" +"Originally, the :mod:`argparse` module had attempted to maintain " +"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " +"to extend transparently, particularly with the changes required to support " +"``nargs=`` specifiers and better usage messages. When most everything in :" +"mod:`optparse` had either been copy-pasted over or monkey-patched, it no " +"longer seemed practical to try to maintain the backwards compatibility." +msgstr "" + +#: ../../howto/argparse-optparse.rst:16 +msgid "" +"The :mod:`argparse` module improves on the :mod:`optparse` module in a " +"number of ways including:" +msgstr "" + +#: ../../howto/argparse-optparse.rst:19 +msgid "Handling positional arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:20 +msgid "Supporting subcommands." +msgstr "" + +#: ../../howto/argparse-optparse.rst:21 +msgid "Allowing alternative option prefixes like ``+`` and ``/``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:22 +msgid "Handling zero-or-more and one-or-more style arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:23 +msgid "Producing more informative usage messages." +msgstr "" + +#: ../../howto/argparse-optparse.rst:24 +msgid "Providing a much simpler interface for custom ``type`` and ``action``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:26 +msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" +msgstr "" + +#: ../../howto/argparse-optparse.rst:28 +msgid "" +"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" +"`ArgumentParser.add_argument` calls." +msgstr "" + +#: ../../howto/argparse-optparse.rst:31 +msgid "" +"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." +"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " +"for the positional arguments. Keep in mind that what was previously called " +"``options``, now in the :mod:`argparse` context is called ``args``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:36 +msgid "" +"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" +"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" +"`~ArgumentParser.parse_args`." +msgstr "" + +#: ../../howto/argparse-optparse.rst:40 +msgid "" +"Replace callback actions and the ``callback_*`` keyword arguments with " +"``type`` or ``action`` arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:43 +msgid "" +"Replace string names for ``type`` keyword arguments with the corresponding " +"type objects (e.g. int, float, complex, etc)." +msgstr "" + +#: ../../howto/argparse-optparse.rst:46 +msgid "" +"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." +"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." +msgstr "" + +#: ../../howto/argparse-optparse.rst:50 +msgid "" +"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " +"with the standard Python syntax to use dictionaries to format strings, that " +"is, ``%(default)s`` and ``%(prog)s``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:54 +msgid "" +"Replace the OptionParser constructor ``version`` argument with a call to " +"``parser.add_argument('--version', action='version', version='')``." +msgstr "" diff --git a/library/_thread.po b/library/_thread.po index 45e8dd3dd4..cfed6252da 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 18:29+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -172,14 +172,9 @@ msgstr "" "的值可用於在整個系統中唯一標識此特定執行緒(直到執行緒終止後,該值可能被操作" "系統重新使用)。" -#: ../../library/_thread.rst:123 -#, fuzzy -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD." +#: ../../library/_thread.rst:123 ../../library/_thread.rst:148 +msgid "Availability" msgstr "" -":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、NetBSD、" -"AIX、DragonFlyBSD。" #: ../../library/_thread.rst:127 msgid "Added support for GNU/kFreeBSD." @@ -213,10 +208,6 @@ msgstr "" "分配。應參考平台文檔以獲取更多訊息(4 KiB 頁面是比較普遍的;在缺乏更具體訊息" "的情況下,建議使用 4096 的倍數作為堆疊大小)。" -#: ../../library/_thread.rst:148 -msgid ":ref:`Availability `: Windows, pthreads." -msgstr ":ref:`適用 `:Windows, pthreads。" - #: ../../library/_thread.rst:150 msgid "Unix platforms with POSIX threads support." msgstr "Unix 平台上支援 POSIX 執行緒。" @@ -327,15 +318,18 @@ msgstr "" "`_thread.exit` 函式。" #: ../../library/_thread.rst:222 +#, fuzzy msgid "" -"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." +"It is platform-dependent whether the :meth:`~threading.Lock.acquire` method " +"on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception " +"will happen immediately, rather than only after the lock has been acquired " +"or the operation has timed out). It can be interrupted on POSIX, but not on " +"Windows." msgstr "" "無法在鎖的 :meth:`~threading.Lock.acquire` 方法上中斷執行, :exc:" "`KeyboardInterrupt` 例外會在鎖被獲取後發生。" -#: ../../library/_thread.rst:226 +#: ../../library/_thread.rst:228 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" @@ -381,6 +375,17 @@ msgstr "module(模組)" msgid "signal" msgstr "signal(訊號)" +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, " +#~ "OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD." +#~ msgstr "" +#~ ":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、" +#~ "NetBSD、AIX、DragonFlyBSD。" + +#~ msgid ":ref:`Availability `: Windows, pthreads." +#~ msgstr ":ref:`適用 `:Windows, pthreads。" + #~ msgid "" #~ "Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " #~ "exception will be received by an arbitrary thread. (When the :mod:" diff --git a/library/argparse.po b/library/argparse.po index 9038af0eac..de332ce032 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -20,8 +20,8 @@ msgstr "" #: ../../library/argparse.rst:2 msgid "" -":mod:`!argparse` --- Parser for command-line options, arguments and sub-" -"commands" +":mod:`!argparse` --- Parser for command-line options, arguments and " +"subcommands" msgstr "" #: ../../library/argparse.rst:12 @@ -41,27 +41,23 @@ msgstr "" #: ../../library/argparse.rst:22 msgid "" -"The :mod:`argparse` module makes it easy to write user-friendly command-line " -"interfaces. The program defines what arguments it requires, and :mod:" -"`argparse` will figure out how to parse those out of :data:`sys.argv`. The :" -"mod:`argparse` module also automatically generates help and usage messages. " -"The module will also issue errors when users give the program invalid " -"arguments." +"The :mod:`!argparse` module makes it easy to write user-friendly command-" +"line interfaces. The program defines what arguments it requires, and :mod:`!" +"argparse` will figure out how to parse those out of :data:`sys.argv`. The :" +"mod:`!argparse` module also automatically generates help and usage " +"messages. The module will also issue errors when users give the program " +"invalid arguments." msgstr "" -#: ../../library/argparse.rst:30 -msgid "Core Functionality" -msgstr "" - -#: ../../library/argparse.rst:32 +#: ../../library/argparse.rst:28 msgid "" -"The :mod:`argparse` module's support for command-line interfaces is built " +"The :mod:`!argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " "for argument specifications and has options that apply to the parser as " "whole::" msgstr "" -#: ../../library/argparse.rst:36 +#: ../../library/argparse.rst:32 msgid "" "parser = argparse.ArgumentParser(\n" " prog='ProgramName',\n" @@ -69,14 +65,14 @@ msgid "" " epilog='Text at the bottom of help')" msgstr "" -#: ../../library/argparse.rst:41 +#: ../../library/argparse.rst:37 msgid "" "The :meth:`ArgumentParser.add_argument` method attaches individual argument " "specifications to the parser. It supports positional arguments, options " "that accept values, and on/off flags::" msgstr "" -#: ../../library/argparse.rst:45 +#: ../../library/argparse.rst:41 msgid "" "parser.add_argument('filename') # positional argument\n" "parser.add_argument('-c', '--count') # option that takes a value\n" @@ -84,509 +80,161 @@ msgid "" " action='store_true') # on/off flag" msgstr "" -#: ../../library/argparse.rst:50 +#: ../../library/argparse.rst:46 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" -#: ../../library/argparse.rst:53 +#: ../../library/argparse.rst:49 msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" -#: ../../library/argparse.rst:58 -msgid "Quick Links for add_argument()" -msgstr "" - -#: ../../library/argparse.rst:61 -msgid "Name" -msgstr "名稱" - -#: ../../library/argparse.rst:61 -msgid "Description" -msgstr "描述" - -#: ../../library/argparse.rst:61 -msgid "Values" -msgstr "數值" - -#: ../../library/argparse.rst:63 -msgid "action_" -msgstr "action_" - -#: ../../library/argparse.rst:63 -msgid "Specify how an argument should be handled" -msgstr "" - -#: ../../library/argparse.rst:63 -msgid "" -"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " -"``'append_const'``, ``'count'``, ``'help'``, ``'version'``" -msgstr "" -"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " -"``'append_const'``, ``'count'``, ``'help'``, ``'version'``" - -#: ../../library/argparse.rst:64 -msgid "choices_" -msgstr "choices_" - -#: ../../library/argparse.rst:64 -msgid "Limit values to a specific set of choices" -msgstr "" - -#: ../../library/argparse.rst:64 -msgid "" -"``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` " -"instance" -msgstr "" - -#: ../../library/argparse.rst:65 -msgid "const_" -msgstr "const_" - -#: ../../library/argparse.rst:65 -msgid "Store a constant value" -msgstr "" - -#: ../../library/argparse.rst:66 -msgid "default_" -msgstr "default_" - -#: ../../library/argparse.rst:66 -msgid "Default value used when an argument is not provided" -msgstr "" - -#: ../../library/argparse.rst:66 -msgid "Defaults to ``None``" -msgstr "" - -#: ../../library/argparse.rst:67 -msgid "dest_" -msgstr "dest_" - -#: ../../library/argparse.rst:67 -msgid "Specify the attribute name used in the result namespace" -msgstr "" - -#: ../../library/argparse.rst:68 -msgid "help_" -msgstr "help_" - -#: ../../library/argparse.rst:68 -msgid "Help message for an argument" -msgstr "" - -#: ../../library/argparse.rst:69 -msgid "metavar_" -msgstr "metavar_" - -#: ../../library/argparse.rst:69 -msgid "Alternate display name for the argument as shown in help" -msgstr "" - -#: ../../library/argparse.rst:70 -msgid "nargs_" -msgstr "nargs_" - -#: ../../library/argparse.rst:70 -msgid "Number of times the argument can be used" -msgstr "" - -#: ../../library/argparse.rst:70 -msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" -msgstr ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" - -#: ../../library/argparse.rst:71 -msgid "required_" -msgstr "required_" - -#: ../../library/argparse.rst:71 -msgid "Indicate whether an argument is required or optional" -msgstr "" - -#: ../../library/argparse.rst:71 -msgid "``True`` or ``False``" -msgstr "``True`` 或 ``False``" - -#: ../../library/argparse.rst:72 -msgid ":ref:`type `" -msgstr "" - -#: ../../library/argparse.rst:72 -msgid "Automatically convert an argument to the given type" -msgstr "" - -#: ../../library/argparse.rst:72 -msgid "" -":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " -"function" -msgstr "" -":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" - -#: ../../library/argparse.rst:77 -msgid "Example" -msgstr "範例" - -#: ../../library/argparse.rst:79 -msgid "" -"The following code is a Python program that takes a list of integers and " -"produces either the sum or the max::" -msgstr "" - -#: ../../library/argparse.rst:82 -msgid "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(description='Process some integers.')\n" -"parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -" help='an integer for the accumulator')\n" -"parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -" const=sum, default=max,\n" -" help='sum the integers (default: find the max)')\n" -"\n" -"args = parser.parse_args()\n" -"print(args.accumulate(args.integers))" -msgstr "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(description='Process some integers.')\n" -"parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -" help='an integer for the accumulator')\n" -"parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -" const=sum, default=max,\n" -" help='sum the integers (default: find the max)')\n" -"\n" -"args = parser.parse_args()\n" -"print(args.accumulate(args.integers))" - -#: ../../library/argparse.rst:94 -msgid "" -"Assuming the above Python code is saved into a file called ``prog.py``, it " -"can be run at the command line and it provides useful help messages:" -msgstr "" - -#: ../../library/argparse.rst:97 -msgid "" -"$ python prog.py -h\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"\n" -"Process some integers.\n" -"\n" -"positional arguments:\n" -" N an integer for the accumulator\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --sum sum the integers (default: find the max)" -msgstr "" -"$ python prog.py -h\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"\n" -"Process some integers.\n" -"\n" -"positional arguments:\n" -" N an integer for the accumulator\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --sum sum the integers (default: find the max)" - -#: ../../library/argparse.rst:111 -msgid "" -"When run with the appropriate arguments, it prints either the sum or the max " -"of the command-line integers:" -msgstr "" - -#: ../../library/argparse.rst:114 -msgid "" -"$ python prog.py 1 2 3 4\n" -"4\n" -"\n" -"$ python prog.py 1 2 3 4 --sum\n" -"10" -msgstr "" -"$ python prog.py 1 2 3 4\n" -"4\n" -"\n" -"$ python prog.py 1 2 3 4 --sum\n" -"10" - -#: ../../library/argparse.rst:122 -msgid "If invalid arguments are passed in, an error will be displayed:" -msgstr "" - -#: ../../library/argparse.rst:124 -msgid "" -"$ python prog.py a b c\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"prog.py: error: argument N: invalid int value: 'a'" -msgstr "" -"$ python prog.py a b c\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"prog.py: error: argument N: invalid int value: 'a'" - -#: ../../library/argparse.rst:130 -msgid "The following sections walk you through this example." -msgstr "" - -#: ../../library/argparse.rst:134 -msgid "Creating a parser" -msgstr "建立一個剖析器" - -#: ../../library/argparse.rst:136 -msgid "" -"The first step in using the :mod:`argparse` is creating an :class:" -"`ArgumentParser` object::" -msgstr "" - -#: ../../library/argparse.rst:139 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')" -msgstr "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')" - -#: ../../library/argparse.rst:141 -msgid "" -"The :class:`ArgumentParser` object will hold all the information necessary " -"to parse the command line into Python data types." -msgstr "" - -#: ../../library/argparse.rst:146 -msgid "Adding arguments" -msgstr "增加引數" - -#: ../../library/argparse.rst:148 -msgid "" -"Filling an :class:`ArgumentParser` with information about program arguments " -"is done by making calls to the :meth:`~ArgumentParser.add_argument` method. " -"Generally, these calls tell the :class:`ArgumentParser` how to take the " -"strings on the command line and turn them into objects. This information is " -"stored and used when :meth:`~ArgumentParser.parse_args` is called. For " -"example::" -msgstr "" - -#: ../../library/argparse.rst:154 -msgid "" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -"... const=sum, default=max,\n" -"... help='sum the integers (default: find the max)')" -msgstr "" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -"... const=sum, default=max,\n" -"... help='sum the integers (default: find the max)')" - -#: ../../library/argparse.rst:160 -msgid "" -"Later, calling :meth:`~ArgumentParser.parse_args` will return an object with " -"two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute " -"will be a list of one or more integers, and the ``accumulate`` attribute " -"will be either the :func:`sum` function, if ``--sum`` was specified at the " -"command line, or the :func:`max` function if it was not." -msgstr "" - -#: ../../library/argparse.rst:168 -msgid "Parsing arguments" -msgstr "剖析引數" - -#: ../../library/argparse.rst:170 -msgid "" -":class:`ArgumentParser` parses arguments through the :meth:`~ArgumentParser." -"parse_args` method. This will inspect the command line, convert each " -"argument to the appropriate type and then invoke the appropriate action. In " -"most cases, this means a simple :class:`Namespace` object will be built up " -"from attributes parsed out of the command line::" -msgstr "" - -#: ../../library/argparse.rst:176 -msgid "" -">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" -"Namespace(accumulate=, integers=[7, -1, 42])" -msgstr "" -">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" -"Namespace(accumulate=, integers=[7, -1, 42])" - -#: ../../library/argparse.rst:179 +#: ../../library/argparse.rst:53 msgid "" -"In a script, :meth:`~ArgumentParser.parse_args` will typically be called " -"with no arguments, and the :class:`ArgumentParser` will automatically " -"determine the command-line arguments from :data:`sys.argv`." +"If you're looking a guide about how to upgrade optparse code to argparse, " +"see :ref:`Upgrading Optparse Code `." msgstr "" -#: ../../library/argparse.rst:185 +#: ../../library/argparse.rst:57 msgid "ArgumentParser objects" msgstr "ArgumentParser 物件" -#: ../../library/argparse.rst:194 +#: ../../library/argparse.rst:66 msgid "" "Create a new :class:`ArgumentParser` object. All parameters should be passed " "as keyword arguments. Each parameter has its own more detailed description " "below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:198 +#: ../../library/argparse.rst:70 msgid "" "prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" msgstr "" -#: ../../library/argparse.rst:201 +#: ../../library/argparse.rst:73 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" msgstr "" -#: ../../library/argparse.rst:204 +#: ../../library/argparse.rst:76 msgid "" "description_ - Text to display before the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:207 +#: ../../library/argparse.rst:79 msgid "epilog_ - Text to display after the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:209 +#: ../../library/argparse.rst:81 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" msgstr "" -#: ../../library/argparse.rst:212 +#: ../../library/argparse.rst:84 msgid "formatter_class_ - A class for customizing the help output" msgstr "" -#: ../../library/argparse.rst:214 +#: ../../library/argparse.rst:86 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" msgstr "" -#: ../../library/argparse.rst:217 +#: ../../library/argparse.rst:89 msgid "" "fromfile_prefix_chars_ - The set of characters that prefix files from which " "additional arguments should be read (default: ``None``)" msgstr "" -#: ../../library/argparse.rst:220 +#: ../../library/argparse.rst:92 msgid "" "argument_default_ - The global default value for arguments (default: " "``None``)" msgstr "" -#: ../../library/argparse.rst:223 +#: ../../library/argparse.rst:95 msgid "" "conflict_handler_ - The strategy for resolving conflicting optionals " "(usually unnecessary)" msgstr "" -#: ../../library/argparse.rst:226 +#: ../../library/argparse.rst:98 msgid "" "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:228 +#: ../../library/argparse.rst:100 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " "unambiguous. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:231 +#: ../../library/argparse.rst:103 msgid "" "exit_on_error_ - Determines whether or not ArgumentParser exits with error " "info when an error occurs. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:234 +#: ../../library/argparse.rst:106 msgid "*allow_abbrev* parameter was added." msgstr "新增 *allow_abbrev* 參數。" -#: ../../library/argparse.rst:237 +#: ../../library/argparse.rst:109 msgid "" "In previous versions, *allow_abbrev* also disabled grouping of short flags " "such as ``-vv`` to mean ``-v -v``." msgstr "" -#: ../../library/argparse.rst:241 +#: ../../library/argparse.rst:113 msgid "*exit_on_error* parameter was added." msgstr "新增 *exit_on_error* 參數。" -#: ../../library/argparse.rst:244 ../../library/argparse.rst:783 +#: ../../library/argparse.rst:116 ../../library/argparse.rst:598 msgid "The following sections describe how each of these are used." msgstr "" -#: ../../library/argparse.rst:250 +#: ../../library/argparse.rst:122 msgid "prog" msgstr "" -#: ../../library/argparse.rst:252 +#: ../../library/argparse.rst:125 msgid "" -"By default, :class:`ArgumentParser` objects use the base name (see :func:`os." -"path.basename`) of ``sys.argv[0]`` to determine how to display the name of " -"the program in help messages. This default is almost always desirable " -"because it will make the help messages match the name that was used to " -"invoke the program on the command line. For example, consider a file named " -"``myprogram.py`` with the following code::" +"By default, :class:`ArgumentParser` calculates the name of the program to " +"display in help messages depending on the way the Python interpreter was run:" msgstr "" -#: ../../library/argparse.rst:259 ../../library/argparse.rst:679 +#: ../../library/argparse.rst:128 msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('--foo', help='foo help')\n" -"args = parser.parse_args()" +"The :func:`base name ` of ``sys.argv[0]`` if a file was " +"passed as argument." msgstr "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('--foo', help='foo help')\n" -"args = parser.parse_args()" -#: ../../library/argparse.rst:264 +#: ../../library/argparse.rst:130 msgid "" -"The help for this program will display ``myprogram.py`` as the program name " -"(regardless of where the program was invoked from):" +"The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " +"zipfile was passed as argument." msgstr "" -#: ../../library/argparse.rst:267 +#: ../../library/argparse.rst:132 msgid "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help\n" -"$ cd ..\n" -"$ python subdir/myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" +"The Python interpreter name followed by ``-m`` followed by the module or " +"package name if the :option:`-m` option was used." msgstr "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help\n" -"$ cd ..\n" -"$ python subdir/myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" -#: ../../library/argparse.rst:283 +#: ../../library/argparse.rst:135 msgid "" -"To change this default behavior, another value can be supplied using the " -"``prog=`` argument to :class:`ArgumentParser`::" +"This default is almost always desirable because it will make the help " +"messages match the string that was used to invoke the program on the command " +"line. However, to change this default behavior, another value can be " +"supplied using the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:286 +#: ../../library/argparse.rst:140 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -602,14 +250,14 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:293 +#: ../../library/argparse.rst:147 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " "the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " "format specifier." msgstr "" -#: ../../library/argparse.rst:299 +#: ../../library/argparse.rst:153 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -629,50 +277,18 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" -#: ../../library/argparse.rst:310 +#: ../../library/argparse.rst:164 msgid "usage" msgstr "" -#: ../../library/argparse.rst:312 +#: ../../library/argparse.rst:166 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " -"arguments it contains::" +"arguments it contains. The default message can be overridden with the " +"``usage=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:315 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" -">>> parser.add_argument('bar', nargs='+', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo [FOO] foo help" -msgstr "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" -">>> parser.add_argument('bar', nargs='+', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo [FOO] foo help" - -#: ../../library/argparse.rst:328 -msgid "" -"The default message can be overridden with the ``usage=`` keyword argument::" -msgstr "" - -#: ../../library/argparse.rst:330 +#: ../../library/argparse.rst:170 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -702,63 +318,43 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" -#: ../../library/argparse.rst:343 +#: ../../library/argparse.rst:183 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." msgstr "" -#: ../../library/argparse.rst:350 +#: ../../library/argparse.rst:190 msgid "description" msgstr "描述" -#: ../../library/argparse.rst:352 +#: ../../library/argparse.rst:192 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " "of what the program does and how it works. In help messages, the " "description is displayed between the command-line usage string and the help " -"messages for the various arguments::" -msgstr "" - -#: ../../library/argparse.rst:358 -msgid "" -">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" -">>> parser.print_help()\n" -"usage: argparse.py [-h]\n" -"\n" -"A foo that bars\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" +"messages for the various arguments." msgstr "" -">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" -">>> parser.print_help()\n" -"usage: argparse.py [-h]\n" -"\n" -"A foo that bars\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -#: ../../library/argparse.rst:367 +#: ../../library/argparse.rst:198 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." msgstr "" -#: ../../library/argparse.rst:372 +#: ../../library/argparse.rst:203 msgid "epilog" msgstr "" -#: ../../library/argparse.rst:374 +#: ../../library/argparse.rst:205 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:378 +#: ../../library/argparse.rst:209 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -786,18 +382,18 @@ msgstr "" "\n" "And that's how you'd foo a bar" -#: ../../library/argparse.rst:391 +#: ../../library/argparse.rst:222 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:397 +#: ../../library/argparse.rst:228 msgid "parents" msgstr "" -#: ../../library/argparse.rst:399 +#: ../../library/argparse.rst:230 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -808,7 +404,7 @@ msgid "" "object being constructed::" msgstr "" -#: ../../library/argparse.rst:406 +#: ../../library/argparse.rst:237 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -836,32 +432,32 @@ msgstr "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" -#: ../../library/argparse.rst:419 +#: ../../library/argparse.rst:250 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -#: ../../library/argparse.rst:424 +#: ../../library/argparse.rst:255 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " "not be reflected in the child." msgstr "" -#: ../../library/argparse.rst:432 +#: ../../library/argparse.rst:263 msgid "formatter_class" msgstr "formatter_class" -#: ../../library/argparse.rst:434 +#: ../../library/argparse.rst:265 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " "classes:" msgstr "" -#: ../../library/argparse.rst:443 +#: ../../library/argparse.rst:274 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -869,7 +465,7 @@ msgid "" "command-line help messages::" msgstr "" -#: ../../library/argparse.rst:448 +#: ../../library/argparse.rst:279 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -893,14 +489,14 @@ msgid "" "will be wrapped across a couple lines" msgstr "" -#: ../../library/argparse.rst:468 +#: ../../library/argparse.rst:299 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " "should not be line-wrapped::" msgstr "" -#: ../../library/argparse.rst:472 +#: ../../library/argparse.rst:303 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -925,21 +521,21 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: ../../library/argparse.rst:494 +#: ../../library/argparse.rst:325 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " -"text, including argument descriptions. However, multiple new lines are " +"text, including argument descriptions. However, multiple newlines are " "replaced with one. If you wish to preserve multiple blank lines, add spaces " "between the newlines." msgstr "" -#: ../../library/argparse.rst:499 +#: ../../library/argparse.rst:330 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" msgstr "" -#: ../../library/argparse.rst:502 +#: ../../library/argparse.rst:333 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -971,14 +567,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" -#: ../../library/argparse.rst:517 +#: ../../library/argparse.rst:348 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " "dest_ as the regular formatter does)::" msgstr "" -#: ../../library/argparse.rst:521 +#: ../../library/argparse.rst:352 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -1010,11 +606,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo int" -#: ../../library/argparse.rst:538 +#: ../../library/argparse.rst:369 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:540 +#: ../../library/argparse.rst:371 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " @@ -1022,7 +618,7 @@ msgid "" "``prefix_chars=`` argument to the ArgumentParser constructor::" msgstr "" -#: ../../library/argparse.rst:546 +#: ../../library/argparse.rst:377 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -1036,18 +632,18 @@ msgstr "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" -#: ../../library/argparse.rst:552 +#: ../../library/argparse.rst:383 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " "disallowed." msgstr "" -#: ../../library/argparse.rst:558 +#: ../../library/argparse.rst:389 msgid "fromfile_prefix_chars" msgstr "fromfile_prefix_chars" -#: ../../library/argparse.rst:560 +#: ../../library/argparse.rst:391 msgid "" "Sometimes, when dealing with a particularly long argument list, it may make " "sense to keep the list of arguments in a file rather than typing it out at " @@ -1057,7 +653,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: ../../library/argparse.rst:567 +#: ../../library/argparse.rst:398 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -1075,7 +671,7 @@ msgstr "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" -#: ../../library/argparse.rst:575 +#: ../../library/argparse.rst:406 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -1085,32 +681,32 @@ msgid "" "f', 'bar']``." msgstr "" -#: ../../library/argparse.rst:581 +#: ../../library/argparse.rst:412 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" -#: ../../library/argparse.rst:584 +#: ../../library/argparse.rst:415 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: ../../library/argparse.rst:587 +#: ../../library/argparse.rst:418 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to :term:`filesystem encoding and " -"error handler`. Arguments file should be encoded in UTF-8 instead of ANSI " -"Codepage on Windows." +"getpreferredencoding>` and ``\"strict\"``) to the :term:`filesystem encoding " +"and error handler`. Arguments file should be encoded in UTF-8 instead of " +"ANSI Codepage on Windows." msgstr "" -#: ../../library/argparse.rst:595 +#: ../../library/argparse.rst:426 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:597 +#: ../../library/argparse.rst:428 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -1122,7 +718,7 @@ msgid "" "supply ``argument_default=SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:606 +#: ../../library/argparse.rst:437 msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -1140,22 +736,22 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace()" -#: ../../library/argparse.rst:617 +#: ../../library/argparse.rst:448 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:619 +#: ../../library/argparse.rst:450 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -#: ../../library/argparse.rst:623 +#: ../../library/argparse.rst:454 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:625 +#: ../../library/argparse.rst:456 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -1171,11 +767,11 @@ msgstr "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" -#: ../../library/argparse.rst:636 +#: ../../library/argparse.rst:467 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:638 +#: ../../library/argparse.rst:469 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -1183,7 +779,7 @@ msgid "" "that is already in use::" msgstr "" -#: ../../library/argparse.rst:643 +#: ../../library/argparse.rst:474 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -1199,7 +795,7 @@ msgstr "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" -#: ../../library/argparse.rst:650 +#: ../../library/argparse.rst:481 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -1207,7 +803,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:655 +#: ../../library/argparse.rst:486 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -1233,7 +829,7 @@ msgstr "" " -f FOO old foo help\n" " --foo FOO new foo help" -#: ../../library/argparse.rst:666 +#: ../../library/argparse.rst:497 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -1241,47 +837,25 @@ msgid "" "option string was overridden." msgstr "" -#: ../../library/argparse.rst:673 +#: ../../library/argparse.rst:504 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:675 +#: ../../library/argparse.rst:506 msgid "" "By default, ArgumentParser objects add an option which simply displays the " -"parser's help message. For example, consider a file named ``myprogram.py`` " -"containing the following code::" -msgstr "" - -#: ../../library/argparse.rst:684 -msgid "" -"If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser " -"help will be printed:" +"parser's help message. If ``-h`` or ``--help`` is supplied at the command " +"line, the ArgumentParser help will be printed." msgstr "" -#: ../../library/argparse.rst:687 -msgid "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" -msgstr "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" - -#: ../../library/argparse.rst:696 +#: ../../library/argparse.rst:510 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:700 +#: ../../library/argparse.rst:514 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -1299,7 +873,7 @@ msgstr "" "options:\n" " --foo FOO foo help" -#: ../../library/argparse.rst:708 +#: ../../library/argparse.rst:522 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -1307,7 +881,7 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: ../../library/argparse.rst:714 +#: ../../library/argparse.rst:528 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -1323,24 +897,24 @@ msgstr "" "options:\n" " +h, ++help show this help message and exit" -#: ../../library/argparse.rst:723 +#: ../../library/argparse.rst:537 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:725 +#: ../../library/argparse.rst:539 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " -"exit with error info." +"print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" -#: ../../library/argparse.rst:728 +#: ../../library/argparse.rst:543 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:731 +#: ../../library/argparse.rst:546 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -1366,81 +940,81 @@ msgstr "" "...\n" "Catching an argumentError" -#: ../../library/argparse.rst:745 +#: ../../library/argparse.rst:560 msgid "The add_argument() method" msgstr "" -#: ../../library/argparse.rst:751 +#: ../../library/argparse.rst:566 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:754 +#: ../../library/argparse.rst:569 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " "or ``-f, --foo``." msgstr "" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:572 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:760 +#: ../../library/argparse.rst:575 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:762 +#: ../../library/argparse.rst:577 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:764 +#: ../../library/argparse.rst:579 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:767 +#: ../../library/argparse.rst:582 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:769 +#: ../../library/argparse.rst:584 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:771 +#: ../../library/argparse.rst:586 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:774 +#: ../../library/argparse.rst:589 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:776 +#: ../../library/argparse.rst:591 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:778 +#: ../../library/argparse.rst:593 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:781 +#: ../../library/argparse.rst:596 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "" -#: ../../library/argparse.rst:789 +#: ../../library/argparse.rst:604 msgid "name or flags" msgstr "" -#: ../../library/argparse.rst:791 +#: ../../library/argparse.rst:606 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1449,30 +1023,30 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:797 +#: ../../library/argparse.rst:612 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:799 +#: ../../library/argparse.rst:614 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:801 +#: ../../library/argparse.rst:616 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:803 +#: ../../library/argparse.rst:618 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:805 +#: ../../library/argparse.rst:620 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:809 +#: ../../library/argparse.rst:624 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1496,11 +1070,11 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:639 msgid "action" msgstr "" -#: ../../library/argparse.rst:826 +#: ../../library/argparse.rst:641 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1510,25 +1084,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:832 +#: ../../library/argparse.rst:647 msgid "" "``'store'`` - This just stores the argument's value. This is the default " -"action. For example::" -msgstr "" - -#: ../../library/argparse.rst:835 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args('--foo 1'.split())\n" -"Namespace(foo='1')" +"action." msgstr "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args('--foo 1'.split())\n" -"Namespace(foo='1')" -#: ../../library/argparse.rst:840 +#: ../../library/argparse.rst:650 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1536,7 +1098,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:845 +#: ../../library/argparse.rst:655 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1548,15 +1110,15 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:660 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " "respectively. In addition, they create default values of ``False`` and " -"``True`` respectively. For example::" +"``True`` respectively::" msgstr "" -#: ../../library/argparse.rst:855 +#: ../../library/argparse.rst:665 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1572,7 +1134,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:862 +#: ../../library/argparse.rst:672 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -1581,7 +1143,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: ../../library/argparse.rst:868 +#: ../../library/argparse.rst:678 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append')\n" @@ -1593,7 +1155,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['1', '2'])" -#: ../../library/argparse.rst:873 +#: ../../library/argparse.rst:683 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -1602,7 +1164,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:879 +#: ../../library/argparse.rst:689 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1620,13 +1182,13 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" -#: ../../library/argparse.rst:885 +#: ../../library/argparse.rst:695 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:888 +#: ../../library/argparse.rst:698 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1634,11 +1196,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:703 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:895 +#: ../../library/argparse.rst:705 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1646,14 +1208,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:900 +#: ../../library/argparse.rst:710 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:904 +#: ../../library/argparse.rst:714 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1669,13 +1231,13 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:910 +#: ../../library/argparse.rst:720 msgid "" "``'extend'`` - This stores a list, and extends each argument value to the " "list. Example usage::" msgstr "" -#: ../../library/argparse.rst:914 +#: ../../library/argparse.rst:724 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1691,7 +1253,13 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:921 +#: ../../library/argparse.rst:731 +msgid "" +"Only actions that consume command-line arguments (e.g. ``'store'``, " +"``'append'`` or ``'extend'``) can be used with positional arguments." +msgstr "" + +#: ../../library/argparse.rst:734 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " "other object that implements the same interface. The " @@ -1699,7 +1267,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:926 +#: ../../library/argparse.rst:739 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1713,18 +1281,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:934 +#: ../../library/argparse.rst:747 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:938 +#: ../../library/argparse.rst:751 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:753 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1745,15 +1313,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:958 +#: ../../library/argparse.rst:771 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:964 +#: ../../library/argparse.rst:777 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:966 +#: ../../library/argparse.rst:779 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " @@ -1761,13 +1329,13 @@ msgid "" "ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" -#: ../../library/argparse.rst:971 +#: ../../library/argparse.rst:784 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:974 +#: ../../library/argparse.rst:787 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1781,13 +1349,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:793 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:985 +#: ../../library/argparse.rst:798 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1797,7 +1365,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:992 +#: ../../library/argparse.rst:805 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1819,13 +1387,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:1002 +#: ../../library/argparse.rst:815 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:1005 +#: ../../library/argparse.rst:818 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1851,7 +1419,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1019 +#: ../../library/argparse.rst:832 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1859,7 +1427,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:1024 +#: ../../library/argparse.rst:837 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1875,14 +1443,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:1033 +#: ../../library/argparse.rst:846 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:1037 +#: ../../library/argparse.rst:850 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1900,19 +1468,20 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:1045 +#: ../../library/argparse.rst:858 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " "command-line argument will be consumed and a single item (not a list) will " -"be produced." +"be produced. Actions that do not consume command-line arguments (e.g. " +"``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:1053 +#: ../../library/argparse.rst:868 msgid "const" msgstr "" -#: ../../library/argparse.rst:1055 +#: ../../library/argparse.rst:870 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1920,7 +1489,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:1059 +#: ../../library/argparse.rst:874 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1930,7 +1499,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:1067 +#: ../../library/argparse.rst:882 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1940,17 +1509,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:889 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:1081 +#: ../../library/argparse.rst:896 msgid "default" msgstr "" -#: ../../library/argparse.rst:1083 +#: ../../library/argparse.rst:898 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1960,7 +1529,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1090 +#: ../../library/argparse.rst:905 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1976,13 +1545,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1097 +#: ../../library/argparse.rst:912 msgid "" "If the target namespace already has an attribute set, the action *default* " -"will not over write it::" +"will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:915 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1994,7 +1563,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:1105 +#: ../../library/argparse.rst:920 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -2002,7 +1571,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1110 +#: ../../library/argparse.rst:925 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -2016,13 +1585,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:1116 +#: ../../library/argparse.rst:931 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1119 +#: ../../library/argparse.rst:934 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -2038,20 +1607,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1126 +#: ../../library/argparse.rst:941 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:945 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1133 +#: ../../library/argparse.rst:948 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -2067,11 +1636,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:959 msgid "type" msgstr "" -#: ../../library/argparse.rst:1146 +#: ../../library/argparse.rst:961 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -2080,13 +1649,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:1152 +#: ../../library/argparse.rst:967 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:1155 +#: ../../library/argparse.rst:970 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -2094,11 +1663,12 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:1160 +#: ../../library/argparse.rst:975 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:1162 +#: ../../library/argparse.rst:977 +#, fuzzy msgid "" "import argparse\n" "import pathlib\n" @@ -2108,7 +1678,6 @@ msgid "" "parser.add_argument('distance', type=float)\n" "parser.add_argument('street', type=ascii)\n" "parser.add_argument('code_point', type=ord)\n" -"parser.add_argument('source_file', type=open)\n" "parser.add_argument('dest_file', type=argparse.FileType('w', " "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" @@ -2126,11 +1695,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1176 +#: ../../library/argparse.rst:990 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1178 +#: ../../library/argparse.rst:992 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -2148,14 +1717,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1188 +#: ../../library/argparse.rst:1002 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1192 +#: ../../library/argparse.rst:1006 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -2163,7 +1732,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1197 +#: ../../library/argparse.rst:1011 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." @@ -2171,26 +1740,27 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1202 +#: ../../library/argparse.rst:1016 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " -"``type`` keyword. If one argument uses *FileType* and then a subsequent " -"argument fails, an error is reported but the file is not automatically " -"closed. In this case, it would be better to wait until after the parser has " -"run and then use the :keyword:`with`-statement to manage the files." +"``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " +"a subsequent argument fails, an error is reported but the file is not " +"automatically closed. In this case, it would be better to wait until after " +"the parser has run and then use the :keyword:`with`-statement to manage the " +"files." msgstr "" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1023 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1215 +#: ../../library/argparse.rst:1030 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1217 +#: ../../library/argparse.rst:1032 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -2199,7 +1769,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1223 +#: ../../library/argparse.rst:1038 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -2219,44 +1789,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1232 +#: ../../library/argparse.rst:1047 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " -"sequence should match the type_ specified::" +"sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1236 -msgid "" -">>> parser = argparse.ArgumentParser(prog='doors.py')\n" -">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" -">>> print(parser.parse_args(['3']))\n" -"Namespace(door=3)\n" -">>> parser.parse_args(['4'])\n" -"usage: doors.py [-h] {1,2,3}\n" -"doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" -msgstr "" -">>> parser = argparse.ArgumentParser(prog='doors.py')\n" -">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" -">>> print(parser.parse_args(['3']))\n" -"Namespace(door=3)\n" -">>> parser.parse_args(['4'])\n" -"usage: doors.py [-h] {1,2,3}\n" -"doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" - -#: ../../library/argparse.rst:1244 +#: ../../library/argparse.rst:1051 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1247 +#: ../../library/argparse.rst:1054 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1057 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -2264,11 +1816,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1259 +#: ../../library/argparse.rst:1066 msgid "required" msgstr "" -#: ../../library/argparse.rst:1261 +#: ../../library/argparse.rst:1068 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -2276,7 +1828,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1266 +#: ../../library/argparse.rst:1073 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2294,64 +1846,32 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1274 +#: ../../library/argparse.rst:1081 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1280 +#: ../../library/argparse.rst:1087 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1287 +#: ../../library/argparse.rst:1094 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1289 +#: ../../library/argparse.rst:1096 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " "at the command line), these ``help`` descriptions will be displayed with " -"each argument::" -msgstr "" - -#: ../../library/argparse.rst:1294 -msgid "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('--foo', action='store_true',\n" -"... help='foo the bars before frobbling')\n" -">>> parser.add_argument('bar', nargs='+',\n" -"... help='one of the bars to be frobbled')\n" -">>> parser.parse_args(['-h'])\n" -"usage: frobble [-h] [--foo] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar one of the bars to be frobbled\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo foo the bars before frobbling" +"each argument." msgstr "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('--foo', action='store_true',\n" -"... help='foo the bars before frobbling')\n" -">>> parser.add_argument('bar', nargs='+',\n" -"... help='one of the bars to be frobbled')\n" -">>> parser.parse_args(['-h'])\n" -"usage: frobble [-h] [--foo] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar one of the bars to be frobbled\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo foo the bars before frobbling" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1101 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -2360,7 +1880,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1106 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2386,19 +1906,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1326 +#: ../../library/argparse.rst:1118 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1329 +#: ../../library/argparse.rst:1121 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1332 +#: ../../library/argparse.rst:1124 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2416,11 +1936,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1344 +#: ../../library/argparse.rst:1136 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1346 +#: ../../library/argparse.rst:1138 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -2432,7 +1952,7 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1355 +#: ../../library/argparse.rst:1147 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2464,11 +1984,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1370 +#: ../../library/argparse.rst:1162 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1372 +#: ../../library/argparse.rst:1164 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2500,21 +2020,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1387 +#: ../../library/argparse.rst:1179 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1391 +#: ../../library/argparse.rst:1183 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1395 +#: ../../library/argparse.rst:1187 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2538,11 +2058,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1410 +#: ../../library/argparse.rst:1202 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1412 +#: ../../library/argparse.rst:1204 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2552,7 +2072,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1419 +#: ../../library/argparse.rst:1211 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2564,7 +2084,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1424 +#: ../../library/argparse.rst:1216 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2576,7 +2096,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1433 +#: ../../library/argparse.rst:1225 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2594,11 +2114,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1441 +#: ../../library/argparse.rst:1233 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1443 +#: ../../library/argparse.rst:1235 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2610,11 +2130,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1452 +#: ../../library/argparse.rst:1244 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1246 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2625,7 +2145,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1464 +#: ../../library/argparse.rst:1256 #, fuzzy msgid "" ">>> import argparse\n" @@ -2644,11 +2164,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1477 +#: ../../library/argparse.rst:1269 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1479 +#: ../../library/argparse.rst:1271 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " @@ -2656,7 +2176,7 @@ msgid "" "add_argument`." msgstr "" -#: ../../library/argparse.rst:1488 +#: ../../library/argparse.rst:1280 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -2665,7 +2185,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1494 +#: ../../library/argparse.rst:1286 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -2673,91 +2193,102 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1499 +#: ../../library/argparse.rst:1291 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1502 -msgid "``parser`` - The ArgumentParser object which contains this action." +#: ../../library/argparse.rst:1294 +msgid "*parser* - The ArgumentParser object which contains this action." msgstr "" -#: ../../library/argparse.rst:1504 +#: ../../library/argparse.rst:1296 +msgid "*namespace* - The :class:`Namespace` object that will be returned by" +msgstr "" + +#: ../../library/argparse.rst:1297 msgid "" -"``namespace`` - The :class:`Namespace` object that will be returned by :meth:" -"`~ArgumentParser.parse_args`. Most actions add an attribute to this object " -"using :func:`setattr`." +":meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this " +"object using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1508 +#: ../../library/argparse.rst:1300 msgid "" -"``values`` - The associated command-line arguments, with any type " -"conversions applied. Type conversions are specified with the type_ keyword " -"argument to :meth:`~ArgumentParser.add_argument`." +"*values* - The associated command-line arguments, with any type conversions" msgstr "" -#: ../../library/argparse.rst:1512 +#: ../../library/argparse.rst:1301 +msgid "" +"applied. Type conversions are specified with the type_ keyword argument to :" +"meth:`~ArgumentParser.add_argument`." +msgstr "" + +#: ../../library/argparse.rst:1304 +msgid "" +"*option_string* - The option string that was used to invoke this action." +msgstr "" + +#: ../../library/argparse.rst:1305 msgid "" -"``option_string`` - The option string that was used to invoke this action. " "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1516 +#: ../../library/argparse.rst:1308 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1519 +#: ../../library/argparse.rst:1311 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1524 +#: ../../library/argparse.rst:1317 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1528 +#: ../../library/argparse.rst:1321 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1324 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1535 +#: ../../library/argparse.rst:1328 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1331 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1543 +#: ../../library/argparse.rst:1336 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1545 +#: ../../library/argparse.rst:1338 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1342 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2775,14 +2306,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1557 +#: ../../library/argparse.rst:1350 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1561 +#: ../../library/argparse.rst:1354 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2790,13 +2321,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1564 +#: ../../library/argparse.rst:1357 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1567 +#: ../../library/argparse.rst:1360 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2804,13 +2335,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1363 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1573 +#: ../../library/argparse.rst:1366 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2826,11 +2357,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1375 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1377 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2838,7 +2369,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1589 +#: ../../library/argparse.rst:1382 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2860,11 +2391,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1610 +#: ../../library/argparse.rst:1403 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1612 +#: ../../library/argparse.rst:1405 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2876,7 +2407,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1620 +#: ../../library/argparse.rst:1413 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2909,7 +2440,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1650 +#: ../../library/argparse.rst:1443 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2917,7 +2448,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1655 +#: ../../library/argparse.rst:1448 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2925,24 +2456,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1658 +#: ../../library/argparse.rst:1451 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1664 +#: ../../library/argparse.rst:1457 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1459 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1670 +#: ../../library/argparse.rst:1463 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2966,17 +2497,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1681 +#: ../../library/argparse.rst:1474 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1687 +#: ../../library/argparse.rst:1480 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1689 +#: ../../library/argparse.rst:1482 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -2984,7 +2515,7 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1694 +#: ../../library/argparse.rst:1487 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -3010,24 +2541,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1502 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1713 +#: ../../library/argparse.rst:1506 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1716 +#: ../../library/argparse.rst:1509 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1720 +#: ../../library/argparse.rst:1513 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3041,14 +2572,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1519 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1730 +#: ../../library/argparse.rst:1523 msgid "" ">>> class C:\n" "... pass\n" @@ -3070,98 +2601,97 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1742 +#: ../../library/argparse.rst:1535 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1745 +#: ../../library/argparse.rst:1538 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1752 +#: ../../library/argparse.rst:1545 msgid "" -"Many programs split up their functionality into a number of sub-commands, " -"for example, the ``svn`` program can invoke sub-commands like ``svn " -"checkout``, ``svn update``, and ``svn commit``. Splitting up functionality " -"this way can be a particularly good idea when a program performs several " -"different functions which require different kinds of command-line " -"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:`~_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." +"Many programs split up their functionality into a number of subcommands, for " +"example, the ``svn`` program can invoke subcommands like ``svn checkout``, " +"``svn update``, and ``svn commit``. Splitting up functionality this way can " +"be a particularly good idea when a program performs several different " +"functions which require different kinds of command-line arguments. :class:" +"`ArgumentParser` supports the creation of such subcommands 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:`~_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." msgstr "" -#: ../../library/argparse.rst:1764 +#: ../../library/argparse.rst:1557 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1766 +#: ../../library/argparse.rst:1559 msgid "" -"title - title for the sub-parser group in help output; by default " +"*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1770 +#: ../../library/argparse.rst:1563 msgid "" -"description - description for the sub-parser group in help output, by " +"*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1773 +#: ../../library/argparse.rst:1566 msgid "" -"prog - usage information that will be displayed with sub-command help, by " +"*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1777 +#: ../../library/argparse.rst:1570 msgid "" -"parser_class - class which will be used to create sub-parser instances, by " +"*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1780 +#: ../../library/argparse.rst:1573 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1783 +#: ../../library/argparse.rst:1576 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1786 +#: ../../library/argparse.rst:1579 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1789 +#: ../../library/argparse.rst:1582 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1791 +#: ../../library/argparse.rst:1584 msgid "" -"metavar_ - string presenting available sub-commands in help; by default it " -"is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" +"metavar_ - string presenting available subcommands in help; by default it is " +"``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1794 +#: ../../library/argparse.rst:1587 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1796 +#: ../../library/argparse.rst:1589 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" -">>> subparsers = parser.add_subparsers(help='sub-command help')\n" +">>> subparsers = parser.add_subparsers(help='subcommand help')\n" ">>>\n" ">>> # create the parser for the \"a\" command\n" ">>> parser_a = subparsers.add_parser('a', help='a help')\n" @@ -3169,7 +2699,8 @@ msgid "" ">>>\n" ">>> # create the parser for the \"b\" command\n" ">>> parser_b = subparsers.add_parser('b', help='b help')\n" -">>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')\n" +">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz " +"help')\n" ">>>\n" ">>> # parse some argument lists\n" ">>> parser.parse_args(['a', '12'])\n" @@ -3178,7 +2709,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1815 +#: ../../library/argparse.rst:1608 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -3188,7 +2719,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1822 +#: ../../library/argparse.rst:1615 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -3197,13 +2728,14 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1830 +#: ../../library/argparse.rst:1623 +#, fuzzy msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" "\n" "positional arguments:\n" -" {a,b} sub-command help\n" +" {a,b} subcommand help\n" " a a help\n" " b b help\n" "\n" @@ -3255,14 +2787,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1651 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1862 +#: ../../library/argparse.rst:1655 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3298,7 +2830,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1879 +#: ../../library/argparse.rst:1672 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3306,7 +2838,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1884 +#: ../../library/argparse.rst:1677 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3322,23 +2854,23 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1891 +#: ../../library/argparse.rst:1684 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1905 +#: ../../library/argparse.rst:1698 msgid "" -"One particularly effective way of handling sub-commands is to combine the " -"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " -"so that each subparser knows which Python function it should execute. For " +"One particularly effective way of handling subcommands is to combine the use " +"of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " +"that each subparser knows which Python function it should execute. For " "example::" msgstr "" -#: ../../library/argparse.rst:1910 +#: ../../library/argparse.rst:1703 msgid "" -">>> # sub-command functions\n" +">>> # subcommand functions\n" ">>> def foo(args):\n" "... print(args.x * args.y)\n" "...\n" @@ -3371,7 +2903,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1735 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3381,7 +2913,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1949 +#: ../../library/argparse.rst:1742 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3401,15 +2933,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1958 +#: ../../library/argparse.rst:1751 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1963 +#: ../../library/argparse.rst:1756 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1967 +#: ../../library/argparse.rst:1760 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3418,7 +2950,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1973 +#: ../../library/argparse.rst:1766 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3436,14 +2968,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1772 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1983 +#: ../../library/argparse.rst:1776 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3455,15 +2987,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1988 +#: ../../library/argparse.rst:1781 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1786 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1997 +#: ../../library/argparse.rst:1790 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3472,7 +3004,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:2003 +#: ../../library/argparse.rst:1796 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3496,7 +3028,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:2014 +#: ../../library/argparse.rst:1807 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3507,7 +3039,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:2022 +#: ../../library/argparse.rst:1815 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3545,13 +3077,13 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:1833 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:2043 +#: ../../library/argparse.rst:1836 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3559,18 +3091,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:1844 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:1848 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:2059 +#: ../../library/argparse.rst:1852 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3596,14 +3128,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:1864 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2075 +#: ../../library/argparse.rst:1868 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3621,7 +3153,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2083 +#: ../../library/argparse.rst:1876 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3629,7 +3161,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2089 +#: ../../library/argparse.rst:1882 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3665,7 +3197,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:1899 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3673,11 +3205,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:2114 +#: ../../library/argparse.rst:1907 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2118 +#: ../../library/argparse.rst:1911 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3686,7 +3218,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2124 +#: ../../library/argparse.rst:1917 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3700,12 +3232,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2130 +#: ../../library/argparse.rst:1923 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:2132 +#: ../../library/argparse.rst:1925 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3719,20 +3251,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:1931 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2144 +#: ../../library/argparse.rst:1937 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2148 +#: ../../library/argparse.rst:1941 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3744,54 +3276,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2155 +#: ../../library/argparse.rst:1948 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:2157 +#: ../../library/argparse.rst:1950 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2163 +#: ../../library/argparse.rst:1956 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2169 +#: ../../library/argparse.rst:1962 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2173 +#: ../../library/argparse.rst:1966 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2178 +#: ../../library/argparse.rst:1971 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2183 +#: ../../library/argparse.rst:1976 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2188 +#: ../../library/argparse.rst:1981 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2192 +#: ../../library/argparse.rst:1985 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3802,7 +3334,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2201 +#: ../../library/argparse.rst:1994 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3816,7 +3348,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2208 +#: ../../library/argparse.rst:2001 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3824,11 +3356,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2215 +#: ../../library/argparse.rst:2008 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2219 +#: ../../library/argparse.rst:2012 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3836,20 +3368,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2224 +#: ../../library/argparse.rst:2017 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2228 +#: ../../library/argparse.rst:2021 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2231 +#: ../../library/argparse.rst:2024 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3859,18 +3391,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2237 +#: ../../library/argparse.rst:2030 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2241 +#: ../../library/argparse.rst:2034 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2245 +#: ../../library/argparse.rst:2038 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3884,17 +3416,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2253 +#: ../../library/argparse.rst:2046 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2258 +#: ../../library/argparse.rst:2051 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2263 +#: ../../library/argparse.rst:2056 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3902,7 +3434,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2268 +#: ../../library/argparse.rst:2061 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -3910,7 +3442,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2273 +#: ../../library/argparse.rst:2066 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3918,7 +3450,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2279 +#: ../../library/argparse.rst:2072 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3938,7 +3470,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2288 +#: ../../library/argparse.rst:2081 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3946,143 +3478,371 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2298 -msgid "Upgrading optparse code" -msgstr "" - -#: ../../library/argparse.rst:2300 -msgid "" -"Originally, the :mod:`argparse` module had attempted to maintain " -"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " -"to extend transparently, particularly with the changes required to support " -"the new ``nargs=`` specifiers and better usage messages. When most " -"everything in :mod:`optparse` had either been copy-pasted over or monkey-" -"patched, it no longer seemed practical to try to maintain the backwards " -"compatibility." -msgstr "" - -#: ../../library/argparse.rst:2307 -msgid "" -"The :mod:`argparse` module improves on the standard library :mod:`optparse` " -"module in a number of ways including:" -msgstr "" - -#: ../../library/argparse.rst:2310 -msgid "Handling positional arguments." -msgstr "" - -#: ../../library/argparse.rst:2311 -msgid "Supporting sub-commands." -msgstr "" - -#: ../../library/argparse.rst:2312 -msgid "Allowing alternative option prefixes like ``+`` and ``/``." -msgstr "" - -#: ../../library/argparse.rst:2313 -msgid "Handling zero-or-more and one-or-more style arguments." -msgstr "" - -#: ../../library/argparse.rst:2314 -msgid "Producing more informative usage messages." -msgstr "" - -#: ../../library/argparse.rst:2315 -msgid "Providing a much simpler interface for custom ``type`` and ``action``." -msgstr "" - -#: ../../library/argparse.rst:2317 -msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" -msgstr "" - -#: ../../library/argparse.rst:2319 -msgid "" -"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" -"`ArgumentParser.add_argument` calls." -msgstr "" - -#: ../../library/argparse.rst:2322 -msgid "" -"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." -"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " -"for the positional arguments. Keep in mind that what was previously called " -"``options``, now in the :mod:`argparse` context is called ``args``." -msgstr "" - -#: ../../library/argparse.rst:2327 -msgid "" -"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" -"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" -"`~ArgumentParser.parse_args`." -msgstr "" - -#: ../../library/argparse.rst:2331 -msgid "" -"Replace callback actions and the ``callback_*`` keyword arguments with " -"``type`` or ``action`` arguments." -msgstr "" - -#: ../../library/argparse.rst:2334 -msgid "" -"Replace string names for ``type`` keyword arguments with the corresponding " -"type objects (e.g. int, float, complex, etc)." -msgstr "" - -#: ../../library/argparse.rst:2337 -msgid "" -"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." -"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." -msgstr "" - -#: ../../library/argparse.rst:2341 -msgid "" -"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " -"with the standard Python syntax to use dictionaries to format strings, that " -"is, ``%(default)s`` and ``%(prog)s``." -msgstr "" - -#: ../../library/argparse.rst:2345 -msgid "" -"Replace the OptionParser constructor ``version`` argument with a call to " -"``parser.add_argument('--version', action='version', version='')``." -msgstr "" - -#: ../../library/argparse.rst:2349 +#: ../../library/argparse.rst:2090 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2353 +#: ../../library/argparse.rst:2094 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2355 +#: ../../library/argparse.rst:2096 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2360 +#: ../../library/argparse.rst:2101 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:2105 +msgid "Guides and Tutorials" +msgstr "" + +#: ../../library/argparse.rst:796 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:983 ../../library/argparse.rst:1017 -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:796 ../../library/argparse.rst:830 +#: ../../library/argparse.rst:844 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:1017 +#: ../../library/argparse.rst:830 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:844 msgid "+ (plus)" msgstr "+ (加號)" +#~ msgid "Name" +#~ msgstr "名稱" + +#~ msgid "Description" +#~ msgstr "描述" + +#~ msgid "Values" +#~ msgstr "數值" + +#~ msgid "action_" +#~ msgstr "action_" + +#~ msgid "" +#~ "``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " +#~ "``'append_const'``, ``'count'``, ``'help'``, ``'version'``" +#~ msgstr "" +#~ "``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " +#~ "``'append_const'``, ``'count'``, ``'help'``, ``'version'``" + +#~ msgid "choices_" +#~ msgstr "choices_" + +#~ msgid "const_" +#~ msgstr "const_" + +#~ msgid "default_" +#~ msgstr "default_" + +#~ msgid "dest_" +#~ msgstr "dest_" + +#~ msgid "help_" +#~ msgstr "help_" + +#~ msgid "metavar_" +#~ msgstr "metavar_" + +#~ msgid "nargs_" +#~ msgstr "nargs_" + +#~ msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" +#~ msgstr ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" + +#~ msgid "required_" +#~ msgstr "required_" + +#~ msgid "``True`` or ``False``" +#~ msgstr "``True`` 或 ``False``" + +#~ msgid "" +#~ ":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " +#~ "function" +#~ msgstr "" +#~ ":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" + +#~ msgid "Example" +#~ msgstr "範例" + +#~ msgid "" +#~ "import argparse\n" +#~ "\n" +#~ "parser = argparse.ArgumentParser(description='Process some integers.')\n" +#~ "parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ " help='an integer for the accumulator')\n" +#~ "parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +#~ " const=sum, default=max,\n" +#~ " help='sum the integers (default: find the max)')\n" +#~ "\n" +#~ "args = parser.parse_args()\n" +#~ "print(args.accumulate(args.integers))" +#~ msgstr "" +#~ "import argparse\n" +#~ "\n" +#~ "parser = argparse.ArgumentParser(description='Process some integers.')\n" +#~ "parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ " help='an integer for the accumulator')\n" +#~ "parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +#~ " const=sum, default=max,\n" +#~ " help='sum the integers (default: find the max)')\n" +#~ "\n" +#~ "args = parser.parse_args()\n" +#~ "print(args.accumulate(args.integers))" + +#~ msgid "" +#~ "$ python prog.py -h\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "\n" +#~ "Process some integers.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " N an integer for the accumulator\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --sum sum the integers (default: find the max)" +#~ msgstr "" +#~ "$ python prog.py -h\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "\n" +#~ "Process some integers.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " N an integer for the accumulator\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --sum sum the integers (default: find the max)" + +#~ msgid "" +#~ "$ python prog.py 1 2 3 4\n" +#~ "4\n" +#~ "\n" +#~ "$ python prog.py 1 2 3 4 --sum\n" +#~ "10" +#~ msgstr "" +#~ "$ python prog.py 1 2 3 4\n" +#~ "4\n" +#~ "\n" +#~ "$ python prog.py 1 2 3 4 --sum\n" +#~ "10" + +#~ msgid "" +#~ "$ python prog.py a b c\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "prog.py: error: argument N: invalid int value: 'a'" +#~ msgstr "" +#~ "$ python prog.py a b c\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "prog.py: error: argument N: invalid int value: 'a'" + +#~ msgid "Creating a parser" +#~ msgstr "建立一個剖析器" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(description='Process some integers.')" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(description='Process some integers.')" + +#~ msgid "Adding arguments" +#~ msgstr "增加引數" + +#~ msgid "" +#~ ">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ "... help='an integer for the accumulator')\n" +#~ ">>> parser.add_argument('--sum', dest='accumulate', " +#~ "action='store_const',\n" +#~ "... const=sum, default=max,\n" +#~ "... help='sum the integers (default: find the max)')" +#~ msgstr "" +#~ ">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ "... help='an integer for the accumulator')\n" +#~ ">>> parser.add_argument('--sum', dest='accumulate', " +#~ "action='store_const',\n" +#~ "... const=sum, default=max,\n" +#~ "... help='sum the integers (default: find the max)')" + +#~ msgid "Parsing arguments" +#~ msgstr "剖析引數" + +#~ msgid "" +#~ ">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" +#~ "Namespace(accumulate=, integers=[7, -1, 42])" +#~ msgstr "" +#~ ">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" +#~ "Namespace(accumulate=, integers=[7, -1, 42])" + +#~ msgid "" +#~ "import argparse\n" +#~ "parser = argparse.ArgumentParser()\n" +#~ "parser.add_argument('--foo', help='foo help')\n" +#~ "args = parser.parse_args()" +#~ msgstr "" +#~ "import argparse\n" +#~ "parser = argparse.ArgumentParser()\n" +#~ "parser.add_argument('--foo', help='foo help')\n" +#~ "args = parser.parse_args()" + +#~ msgid "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help\n" +#~ "$ cd ..\n" +#~ "$ python subdir/myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" +#~ msgstr "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help\n" +#~ "$ cd ..\n" +#~ "$ python subdir/myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='PROG')\n" +#~ ">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +#~ ">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar bar help\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo [FOO] foo help" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='PROG')\n" +#~ ">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +#~ ">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar bar help\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo [FOO] foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: argparse.py [-h]\n" +#~ "\n" +#~ "A foo that bars\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: argparse.py [-h]\n" +#~ "\n" +#~ "A foo that bars\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit" + +#~ msgid "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" +#~ msgstr "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser()\n" +#~ ">>> parser.add_argument('--foo')\n" +#~ ">>> parser.parse_args('--foo 1'.split())\n" +#~ "Namespace(foo='1')" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser()\n" +#~ ">>> parser.add_argument('--foo')\n" +#~ ">>> parser.parse_args('--foo 1'.split())\n" +#~ "Namespace(foo='1')" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='doors.py')\n" +#~ ">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" +#~ ">>> print(parser.parse_args(['3']))\n" +#~ "Namespace(door=3)\n" +#~ ">>> parser.parse_args(['4'])\n" +#~ "usage: doors.py [-h] {1,2,3}\n" +#~ "doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='doors.py')\n" +#~ ">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" +#~ ">>> print(parser.parse_args(['3']))\n" +#~ "Namespace(door=3)\n" +#~ ">>> parser.parse_args(['4'])\n" +#~ "usage: doors.py [-h] {1,2,3}\n" +#~ "doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='frobble')\n" +#~ ">>> parser.add_argument('--foo', action='store_true',\n" +#~ "... help='foo the bars before frobbling')\n" +#~ ">>> parser.add_argument('bar', nargs='+',\n" +#~ "... help='one of the bars to be frobbled')\n" +#~ ">>> parser.parse_args(['-h'])\n" +#~ "usage: frobble [-h] [--foo] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar one of the bars to be frobbled\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo foo the bars before frobbling" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='frobble')\n" +#~ ">>> parser.add_argument('--foo', action='store_true',\n" +#~ "... help='foo the bars before frobbling')\n" +#~ ">>> parser.add_argument('bar', nargs='+',\n" +#~ "... help='one of the bars to be frobbled')\n" +#~ ">>> parser.parse_args(['-h'])\n" +#~ "usage: frobble [-h] [--foo] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar one of the bars to be frobbled\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo foo the bars before frobbling" + #~ msgid "type_" #~ msgstr "type_" diff --git a/library/ast.po b/library/ast.po index 0d526eb785..2a6accefab 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1607,12 +1607,13 @@ msgstr "" "`Constant` 或 :class:`Name` 節點。``value`` 是單個可選節點。" #: ../../library/ast.rst:896 +#, fuzzy msgid "" "``simple`` is always either 0 (indicating a \"complex\" target) or 1 " "(indicating a \"simple\" target). A \"simple\" target consists solely of a :" "class:`Name` node that does not appear between parentheses; all other " "targets are considered complex. Only simple targets appear in the :attr:" -"`__annotations__` dictionary of modules and classes." +"`~object.__annotations__` dictionary of modules and classes." msgstr "" "``simple`` 總會是 0(表示一個「複雜」目標)或 1(表示一個「簡單」目標)。一個" "「簡單」目標僅包含一個 :class:`Name` 節點,且不出現在括號之間;所有其他目標都" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 3e07964e9d..5db2d5a11f 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1087,8 +1087,10 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:652 #: ../../library/asyncio-eventloop.rst:806 #: ../../library/asyncio-eventloop.rst:1249 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1789 +msgid "Availability" +msgstr "" #: ../../library/asyncio-eventloop.rst:654 msgid "" @@ -2675,10 +2677,6 @@ msgstr "" "\n" "asyncio.set_event_loop_policy(MyPolicy())" -#: ../../library/asyncio-eventloop.rst:1782 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/asyncio-eventloop.rst:1787 #, fuzzy msgid "" @@ -2686,10 +2684,6 @@ msgid "" "Completion Ports\" (IOCP)." msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" -#: ../../library/asyncio-eventloop.rst:1789 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/asyncio-eventloop.rst:1793 msgid "" "`MSDN documentation on I/O Completion Ports `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + +#~ msgid ":ref:`Availability `: Unix, Windows." +#~ msgstr ":ref:`適用 `:Unix、Windows。" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 78b1176d70..b45cb59d01 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -160,8 +160,8 @@ msgid "" msgstr "" #: ../../library/asyncio-policy.rst:131 ../../library/asyncio-policy.rst:139 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/asyncio-policy.rst:136 msgid "" @@ -413,3 +413,6 @@ msgstr "" " return loop\n" "\n" "asyncio.set_event_loop_policy(MyEventLoopPolicy())" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index a89301bcf9..915398e208 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -208,8 +208,8 @@ 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。" +msgid "Availability" +msgstr "" #: ../../library/asyncio-stream.rst:153 msgid "" @@ -762,3 +762,6 @@ msgid "" msgstr "" "在\\ :ref:`監視檔案描述器以讀取事件 `\\ 範例中,有" "使用低階的 :meth:`loop.add_reader` 方法來監視檔案描述器。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index cc3762eb98..280363e69e 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -262,7 +262,7 @@ msgid "" " # Nothing happens if we just call \"nested()\".\n" " # A coroutine object is created but not awaited,\n" " # so it *won't run at all*.\n" -" nested()\n" +" nested() # will raise a \"RuntimeWarning\".\n" "\n" " # Let's do it differently now and await it:\n" " print(await nested()) # will print \"42\".\n" diff --git a/library/asyncio.po b/library/asyncio.po index f6ca78be42..d93fc66b22 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -148,9 +148,8 @@ msgstr "" "based) 的函式庫與程式碼。" #: ../../includes/wasm-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -215,3 +214,7 @@ msgstr "參閱" #: ../../library/asyncio.rst:123 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" + +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" diff --git a/library/codecs.po b/library/codecs.po index aa60cd8b84..0411327eea 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -2652,8 +2652,8 @@ msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" #: ../../library/codecs.rst:1542 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/codecs.rst:1544 msgid "" @@ -2767,6 +2767,9 @@ msgstr "\\N" msgid "surrogatepass" msgstr "surrogatepass" +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + #, fuzzy #~ msgid "" #~ ":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" diff --git a/library/compileall.po b/library/compileall.po index 2f8e76a53f..abe80dc80d 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -36,7 +36,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 061f4dc950..9374bb0d8b 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,9 +51,8 @@ msgstr "" "相同的介面,該介面由抽象的 :class:`Executor` 類別定義。" #: ../../includes/wasm-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -951,3 +950,7 @@ msgstr "" "`RuntimeError`),當 :class:`~concurrent.futures.ProcessPoolExecutor` 的其中" "一個 worker 以不乾淨的方式終止時將引發此例外類別(例如它是從外面被 kill 掉" "的)。" + +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" diff --git a/library/configparser.po b/library/configparser.po index 0943f36e02..acab0efbd0 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -69,15 +69,15 @@ msgid "" "sometimes used for configuration, but does not support comments." msgstr "" -#: ../../library/configparser.rst:60 +#: ../../library/configparser.rst:61 msgid "Quick Start" msgstr "" -#: ../../library/configparser.rst:62 +#: ../../library/configparser.rst:63 msgid "Let's take a very basic configuration file that looks like this:" msgstr "" -#: ../../library/configparser.rst:64 +#: ../../library/configparser.rst:65 msgid "" "[DEFAULT]\n" "ServerAliveInterval = 45\n" @@ -105,7 +105,7 @@ msgstr "" "Port = 50022\n" "ForwardX11 = no" -#: ../../library/configparser.rst:79 +#: ../../library/configparser.rst:80 msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " @@ -114,7 +114,7 @@ msgid "" "configuration file programmatically." msgstr "" -#: ../../library/configparser.rst:85 +#: ../../library/configparser.rst:86 msgid "" ">>> import configparser\n" ">>> config = configparser.ConfigParser()\n" @@ -133,20 +133,20 @@ msgid "" "..." msgstr "" -#: ../../library/configparser.rst:103 +#: ../../library/configparser.rst:104 msgid "" "As you can see, we can treat a config parser much like a dictionary. There " "are differences, `outlined later <#mapping-protocol-access>`_, but the " "behavior is very close to what you would expect from a dictionary." msgstr "" -#: ../../library/configparser.rst:107 +#: ../../library/configparser.rst:108 msgid "" "Now that we have created and saved a configuration file, let's read it back " "and explore the data it holds." msgstr "" -#: ../../library/configparser.rst:110 +#: ../../library/configparser.rst:111 msgid "" ">>> config = configparser.ConfigParser()\n" ">>> config.sections()\n" @@ -179,7 +179,7 @@ msgid "" "'yes'" msgstr "" -#: ../../library/configparser.rst:142 +#: ../../library/configparser.rst:143 msgid "" "As we can see above, the API is pretty straightforward. The only bit of " "magic involves the ``DEFAULT`` section which provides default values for all " @@ -187,7 +187,7 @@ msgid "" "and stored in lowercase [1]_." msgstr "" -#: ../../library/configparser.rst:147 ../../library/configparser.rst:992 +#: ../../library/configparser.rst:148 ../../library/configparser.rst:993 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " @@ -197,7 +197,7 @@ msgid "" "``example.ini`` file." msgstr "" -#: ../../library/configparser.rst:154 ../../library/configparser.rst:999 +#: ../../library/configparser.rst:155 ../../library/configparser.rst:1000 msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" @@ -205,7 +205,7 @@ msgstr "" "[DEFAULT]\n" "ServerAliveInterval = -1" -#: ../../library/configparser.rst:159 ../../library/configparser.rst:1004 +#: ../../library/configparser.rst:160 ../../library/configparser.rst:1005 msgid "" ">>> config_override = configparser.ConfigParser()\n" ">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" @@ -229,24 +229,24 @@ msgstr "" ">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" "-1" -#: ../../library/configparser.rst:173 +#: ../../library/configparser.rst:174 msgid "" "This behaviour is equivalent to a :meth:`ConfigParser.read` call with " "several files passed to the *filenames* parameter." msgstr "" -#: ../../library/configparser.rst:178 +#: ../../library/configparser.rst:179 msgid "Supported Datatypes" msgstr "" -#: ../../library/configparser.rst:180 +#: ../../library/configparser.rst:181 msgid "" "Config parsers do not guess datatypes of values in configuration files, " "always storing them internally as strings. This means that if you need " "other datatypes, you should convert on your own:" msgstr "" -#: ../../library/configparser.rst:184 +#: ../../library/configparser.rst:185 msgid "" ">>> int(topsecret['Port'])\n" "50022\n" @@ -258,7 +258,7 @@ msgstr "" ">>> float(topsecret['CompressionLevel'])\n" "9.0" -#: ../../library/configparser.rst:191 +#: ../../library/configparser.rst:192 msgid "" "Since this task is so common, config parsers provide a range of handy getter " "methods to handle integers, floats and booleans. The last one is the most " @@ -269,7 +269,7 @@ msgid "" "``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" msgstr "" -#: ../../library/configparser.rst:199 +#: ../../library/configparser.rst:200 msgid "" ">>> topsecret.getboolean('ForwardX11')\n" "False\n" @@ -285,7 +285,7 @@ msgstr "" ">>> config.getboolean('forge.example', 'Compression')\n" "True" -#: ../../library/configparser.rst:208 +#: ../../library/configparser.rst:209 msgid "" "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " "equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " @@ -293,17 +293,17 @@ msgid "" "ones. [1]_" msgstr "" -#: ../../library/configparser.rst:214 +#: ../../library/configparser.rst:215 msgid "Fallback Values" msgstr "" -#: ../../library/configparser.rst:216 +#: ../../library/configparser.rst:217 msgid "" "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " "method to provide fallback values:" msgstr "" -#: ../../library/configparser.rst:219 +#: ../../library/configparser.rst:220 msgid "" ">>> topsecret.get('Port')\n" "'50022'\n" @@ -321,7 +321,7 @@ msgstr "" ">>> topsecret.get('Cipher', '3des-cbc')\n" "'3des-cbc'" -#: ../../library/configparser.rst:229 +#: ../../library/configparser.rst:230 msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " @@ -330,7 +330,7 @@ msgid "" "specify a fallback:" msgstr "" -#: ../../library/configparser.rst:235 +#: ../../library/configparser.rst:236 msgid "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" @@ -338,7 +338,7 @@ msgstr "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" -#: ../../library/configparser.rst:240 +#: ../../library/configparser.rst:241 msgid "" "One more thing to be aware of is that the parser-level :meth:`~ConfigParser." "get` method provides a custom, more complex interface, maintained for " @@ -346,21 +346,21 @@ msgid "" "provided via the ``fallback`` keyword-only argument:" msgstr "" -#: ../../library/configparser.rst:245 +#: ../../library/configparser.rst:246 msgid "" ">>> config.get('forge.example', 'monster',\n" "... fallback='No such things as monsters')\n" "'No such things as monsters'" msgstr "" -#: ../../library/configparser.rst:251 +#: ../../library/configparser.rst:252 msgid "" "The same ``fallback`` argument can be used with the :meth:`~ConfigParser." "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " "methods, for example:" msgstr "" -#: ../../library/configparser.rst:255 +#: ../../library/configparser.rst:256 msgid "" ">>> 'BatchMode' in topsecret\n" "False\n" @@ -378,11 +378,11 @@ msgstr "" ">>> topsecret.getboolean('BatchMode', fallback=True)\n" "False" -#: ../../library/configparser.rst:267 +#: ../../library/configparser.rst:268 msgid "Supported INI File Structure" msgstr "" -#: ../../library/configparser.rst:269 +#: ../../library/configparser.rst:270 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " @@ -395,13 +395,13 @@ msgid "" "parts of multiline values or ignored." msgstr "" -#: ../../library/configparser.rst:279 +#: ../../library/configparser.rst:280 msgid "" "By default, a valid section name can be any string that does not contain '\\" "\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." msgstr "" -#: ../../library/configparser.rst:282 +#: ../../library/configparser.rst:283 msgid "" "The first section name may be omitted if the parser is configured to allow " "an unnamed top level section with ``allow_unnamed_section=True``. In this " @@ -409,18 +409,18 @@ msgid "" "``config[UNNAMED_SECTION]``." msgstr "" -#: ../../library/configparser.rst:287 +#: ../../library/configparser.rst:288 msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " "otherwise empty line, possibly indented. [1]_" msgstr "" -#: ../../library/configparser.rst:291 ../../library/configparser.rst:375 +#: ../../library/configparser.rst:292 ../../library/configparser.rst:376 msgid "For example:" msgstr "舉例來說:" -#: ../../library/configparser.rst:293 +#: ../../library/configparser.rst:294 msgid "" "[Simple Values]\n" "key=value\n" @@ -465,17 +465,17 @@ msgid "" " # Did I mention we can indent comments, too?" msgstr "" -#: ../../library/configparser.rst:341 +#: ../../library/configparser.rst:342 msgid "Unnamed Sections" msgstr "" -#: ../../library/configparser.rst:343 +#: ../../library/configparser.rst:344 msgid "" "The name of the first section (or unique) may be omitted and values " "retrieved by the :const:`UNNAMED_SECTION` attribute." msgstr "" -#: ../../library/configparser.rst:346 +#: ../../library/configparser.rst:347 msgid "" ">>> config = \"\"\"\n" "... option = value\n" @@ -489,18 +489,18 @@ msgid "" "'value'" msgstr "" -#: ../../library/configparser.rst:360 +#: ../../library/configparser.rst:361 msgid "Interpolation of values" msgstr "" -#: ../../library/configparser.rst:362 +#: ../../library/configparser.rst:363 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " "from ``get()`` calls." msgstr "" -#: ../../library/configparser.rst:370 +#: ../../library/configparser.rst:371 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -508,7 +508,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: ../../library/configparser.rst:377 +#: ../../library/configparser.rst:378 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -521,7 +521,7 @@ msgid "" "gain: 80%%" msgstr "" -#: ../../library/configparser.rst:388 +#: ../../library/configparser.rst:389 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -531,14 +531,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: ../../library/configparser.rst:395 +#: ../../library/configparser.rst:396 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/" "lumberjack`` as the value of ``my_dir``." msgstr "" -#: ../../library/configparser.rst:403 +#: ../../library/configparser.rst:404 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -548,13 +548,13 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: ../../library/configparser.rst:410 +#: ../../library/configparser.rst:411 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" -#: ../../library/configparser.rst:413 +#: ../../library/configparser.rst:414 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -567,11 +567,11 @@ msgid "" "cost: $$80" msgstr "" -#: ../../library/configparser.rst:424 +#: ../../library/configparser.rst:425 msgid "Values from other sections can be fetched as well:" msgstr "" -#: ../../library/configparser.rst:426 +#: ../../library/configparser.rst:427 msgid "" "[Common]\n" "home_dir: /Users\n" @@ -607,11 +607,11 @@ msgstr "" "my_pictures: ${my_dir}/Pictures\n" "python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" -#: ../../library/configparser.rst:446 +#: ../../library/configparser.rst:447 msgid "Mapping Protocol Access" msgstr "" -#: ../../library/configparser.rst:450 +#: ../../library/configparser.rst:451 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -619,7 +619,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: ../../library/configparser.rst:455 +#: ../../library/configparser.rst:456 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -628,7 +628,7 @@ msgid "" "original parser." msgstr "" -#: ../../library/configparser.rst:461 +#: ../../library/configparser.rst:462 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -636,7 +636,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: ../../library/configparser.rst:466 +#: ../../library/configparser.rst:467 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -645,7 +645,7 @@ msgid "" "expressions return ``True``::" msgstr "" -#: ../../library/configparser.rst:471 +#: ../../library/configparser.rst:472 msgid "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" @@ -653,7 +653,7 @@ msgstr "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" -#: ../../library/configparser.rst:474 +#: ../../library/configparser.rst:475 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -663,30 +663,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: ../../library/configparser.rst:481 +#: ../../library/configparser.rst:482 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: ../../library/configparser.rst:483 +#: ../../library/configparser.rst:484 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: ../../library/configparser.rst:485 +#: ../../library/configparser.rst:486 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: ../../library/configparser.rst:487 +#: ../../library/configparser.rst:488 msgid "``parser.popitem()`` never returns it." msgstr "" -#: ../../library/configparser.rst:489 +#: ../../library/configparser.rst:490 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " "compatible both with the mapping protocol and the classic configparser API." msgstr "" -#: ../../library/configparser.rst:493 +#: ../../library/configparser.rst:494 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -696,18 +696,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: ../../library/configparser.rst:500 +#: ../../library/configparser.rst:501 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " "working as expected." msgstr "" -#: ../../library/configparser.rst:506 +#: ../../library/configparser.rst:507 msgid "Customizing Parser Behaviour" msgstr "" -#: ../../library/configparser.rst:508 +#: ../../library/configparser.rst:509 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -716,17 +716,17 @@ msgid "" "customize some of the features." msgstr "" -#: ../../library/configparser.rst:514 +#: ../../library/configparser.rst:515 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`!__init__` options:" msgstr "" -#: ../../library/configparser.rst:517 +#: ../../library/configparser.rst:518 msgid "*defaults*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:519 +#: ../../library/configparser.rst:520 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -734,17 +734,17 @@ msgid "" "the documented default." msgstr "" -#: ../../library/configparser.rst:524 +#: ../../library/configparser.rst:525 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" -#: ../../library/configparser.rst:527 +#: ../../library/configparser.rst:528 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: ../../library/configparser.rst:529 +#: ../../library/configparser.rst:530 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -752,20 +752,20 @@ msgid "" "goes for options within sections." msgstr "" -#: ../../library/configparser.rst:534 +#: ../../library/configparser.rst:535 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" -#: ../../library/configparser.rst:537 +#: ../../library/configparser.rst:538 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " "of the keys will be ordered. For example:" msgstr "" -#: ../../library/configparser.rst:541 +#: ../../library/configparser.rst:542 msgid "" ">>> parser = configparser.ConfigParser()\n" ">>> parser.read_dict({'section1': {'key1': 'value1',\n" @@ -799,11 +799,11 @@ msgstr "" ">>> [option for option in parser['section3']]\n" "['foo', 'bar', 'baz']" -#: ../../library/configparser.rst:559 +#: ../../library/configparser.rst:560 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: ../../library/configparser.rst:561 +#: ../../library/configparser.rst:562 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -811,7 +811,7 @@ msgid "" "such values should be accepted:" msgstr "" -#: ../../library/configparser.rst:566 +#: ../../library/configparser.rst:567 msgid "" ">>> import configparser\n" "\n" @@ -842,32 +842,32 @@ msgid "" "KeyError: 'does-not-exist'" msgstr "" -#: ../../library/configparser.rst:596 +#: ../../library/configparser.rst:597 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: ../../library/configparser.rst:598 +#: ../../library/configparser.rst:599 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " "delimiter. This means values (but not keys) can contain the delimiters." msgstr "" -#: ../../library/configparser.rst:602 +#: ../../library/configparser.rst:603 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: ../../library/configparser.rst:605 +#: ../../library/configparser.rst:606 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: ../../library/configparser.rst:607 +#: ../../library/configparser.rst:608 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:609 +#: ../../library/configparser.rst:610 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -877,13 +877,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: ../../library/configparser.rst:616 +#: ../../library/configparser.rst:617 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: ../../library/configparser.rst:620 +#: ../../library/configparser.rst:621 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -893,7 +893,7 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: ../../library/configparser.rst:627 +#: ../../library/configparser.rst:628 msgid "" ">>> from configparser import ConfigParser, ExtendedInterpolation\n" ">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" @@ -935,11 +935,11 @@ msgid "" "line #3" msgstr "" -#: ../../library/configparser.rst:666 +#: ../../library/configparser.rst:667 msgid "*strict*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:668 +#: ../../library/configparser.rst:669 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`~ConfigParser." @@ -947,17 +947,17 @@ msgid "" "read_dict`). It is recommended to use strict parsers in new applications." msgstr "" -#: ../../library/configparser.rst:673 +#: ../../library/configparser.rst:674 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: ../../library/configparser.rst:677 +#: ../../library/configparser.rst:678 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:679 +#: ../../library/configparser.rst:680 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -967,7 +967,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: ../../library/configparser.rst:686 +#: ../../library/configparser.rst:687 msgid "" "[Section]\n" "key = multiline\n" @@ -976,7 +976,7 @@ msgid "" " this = is still a part of the multiline value of 'key'" msgstr "" -#: ../../library/configparser.rst:694 +#: ../../library/configparser.rst:695 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -985,13 +985,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: ../../library/configparser.rst:700 +#: ../../library/configparser.rst:701 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" msgstr "" -#: ../../library/configparser.rst:703 +#: ../../library/configparser.rst:704 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -1005,11 +1005,11 @@ msgid "" "files from one format to another)." msgstr "" -#: ../../library/configparser.rst:714 +#: ../../library/configparser.rst:715 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: ../../library/configparser.rst:716 +#: ../../library/configparser.rst:717 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1019,11 +1019,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: ../../library/configparser.rst:723 +#: ../../library/configparser.rst:724 msgid "*converters*, default value: not set" msgstr "" -#: ../../library/configparser.rst:725 +#: ../../library/configparser.rst:726 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -1037,7 +1037,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: ../../library/configparser.rst:736 +#: ../../library/configparser.rst:737 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -1045,14 +1045,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: ../../library/configparser.rst:741 +#: ../../library/configparser.rst:742 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " "may be overridden by subclasses or by attribute assignment." msgstr "" -#: ../../library/configparser.rst:747 +#: ../../library/configparser.rst:748 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -1061,7 +1061,7 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: ../../library/configparser.rst:753 +#: ../../library/configparser.rst:754 msgid "" ">>> custom = configparser.ConfigParser()\n" ">>> custom['section1'] = {'funky': 'nope'}\n" @@ -1083,13 +1083,13 @@ msgstr "" ">>> custom['section1'].getboolean('funky')\n" "False" -#: ../../library/configparser.rst:765 +#: ../../library/configparser.rst:766 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: ../../library/configparser.rst:771 +#: ../../library/configparser.rst:772 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -1097,7 +1097,7 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: ../../library/configparser.rst:777 +#: ../../library/configparser.rst:778 msgid "" ">>> config = \"\"\"\n" "... [Section1]\n" @@ -1141,14 +1141,14 @@ msgstr "" ">>> list(custom['Section2'].keys())\n" "['AnotherKey']" -#: ../../library/configparser.rst:801 +#: ../../library/configparser.rst:802 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" -#: ../../library/configparser.rst:808 +#: ../../library/configparser.rst:809 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -1157,7 +1157,7 @@ msgid "" "example:" msgstr "" -#: ../../library/configparser.rst:814 +#: ../../library/configparser.rst:815 msgid "" ">>> import re\n" ">>> config = \"\"\"\n" @@ -1195,18 +1195,18 @@ msgstr "" ">>> custom.sections()\n" "['Section 1', 'Section 2']" -#: ../../library/configparser.rst:836 +#: ../../library/configparser.rst:837 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " "interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" -#: ../../library/configparser.rst:842 +#: ../../library/configparser.rst:843 msgid "Legacy API Examples" msgstr "" -#: ../../library/configparser.rst:844 +#: ../../library/configparser.rst:845 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -1215,11 +1215,11 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: ../../library/configparser.rst:850 +#: ../../library/configparser.rst:851 msgid "An example of writing to a configuration file::" msgstr "" -#: ../../library/configparser.rst:852 +#: ../../library/configparser.rst:853 msgid "" "import configparser\n" "\n" @@ -1243,11 +1243,11 @@ msgid "" " config.write(configfile)" msgstr "" -#: ../../library/configparser.rst:873 +#: ../../library/configparser.rst:874 msgid "An example of reading the configuration file again::" msgstr "" -#: ../../library/configparser.rst:875 +#: ../../library/configparser.rst:876 msgid "" "import configparser\n" "\n" @@ -1266,11 +1266,11 @@ msgid "" " print(config.get('Section1', 'foo'))" msgstr "" -#: ../../library/configparser.rst:891 +#: ../../library/configparser.rst:892 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: ../../library/configparser.rst:893 +#: ../../library/configparser.rst:894 msgid "" "import configparser\n" "\n" @@ -1305,13 +1305,13 @@ msgid "" " # -> None" msgstr "" -#: ../../library/configparser.rst:924 +#: ../../library/configparser.rst:925 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" msgstr "" -#: ../../library/configparser.rst:927 +#: ../../library/configparser.rst:928 msgid "" "import configparser\n" "\n" @@ -1325,11 +1325,11 @@ msgid "" "print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgstr "" -#: ../../library/configparser.rst:942 +#: ../../library/configparser.rst:943 msgid "ConfigParser Objects" msgstr "ConfigParser 物件" -#: ../../library/configparser.rst:946 +#: ../../library/configparser.rst:947 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -1337,7 +1337,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:951 +#: ../../library/configparser.rst:952 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -1346,7 +1346,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:957 +#: ../../library/configparser.rst:958 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1359,7 +1359,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:967 +#: ../../library/configparser.rst:968 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1369,7 +1369,7 @@ msgid "" "settings to a new config file." msgstr "" -#: ../../library/configparser.rst:974 +#: ../../library/configparser.rst:975 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1378,7 +1378,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:980 +#: ../../library/configparser.rst:981 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1387,7 +1387,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:986 +#: ../../library/configparser.rst:987 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -1396,50 +1396,50 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:1017 +#: ../../library/configparser.rst:1018 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:1020 +#: ../../library/configparser.rst:1021 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:1025 +#: ../../library/configparser.rst:1026 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:1028 +#: ../../library/configparser.rst:1029 msgid "" "The *defaults* argument is read with :meth:`read_dict`, providing consistent " "behavior across the parser: non-string keys and values are implicitly " "converted to strings." msgstr "" -#: ../../library/configparser.rst:1033 ../../library/configparser.rst:1305 +#: ../../library/configparser.rst:1034 ../../library/configparser.rst:1306 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:1037 +#: ../../library/configparser.rst:1038 msgid "" "Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " "and a key without a value is continued with an indented line." msgstr "" -#: ../../library/configparser.rst:1043 +#: ../../library/configparser.rst:1044 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:1048 +#: ../../library/configparser.rst:1049 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:1054 +#: ../../library/configparser.rst:1055 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1447,34 +1447,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1059 +#: ../../library/configparser.rst:1060 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1065 +#: ../../library/configparser.rst:1066 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1071 +#: ../../library/configparser.rst:1072 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1076 +#: ../../library/configparser.rst:1077 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1083 +#: ../../library/configparser.rst:1084 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1086 +#: ../../library/configparser.rst:1087 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1485,7 +1485,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1095 +#: ../../library/configparser.rst:1096 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1493,7 +1493,7 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1101 +#: ../../library/configparser.rst:1102 msgid "" "import configparser, os\n" "\n" @@ -1509,49 +1509,49 @@ msgstr "" "config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" " encoding='cp1250')" -#: ../../library/configparser.rst:1108 +#: ../../library/configparser.rst:1109 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1112 +#: ../../library/configparser.rst:1113 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1115 +#: ../../library/configparser.rst:1116 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1121 +#: ../../library/configparser.rst:1122 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1124 +#: ../../library/configparser.rst:1125 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`!name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1128 +#: ../../library/configparser.rst:1129 msgid "Replaces :meth:`!readfp`." msgstr "取代 :meth:`!readfp`。" -#: ../../library/configparser.rst:1133 +#: ../../library/configparser.rst:1134 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1135 +#: ../../library/configparser.rst:1136 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1144 +#: ../../library/configparser.rst:1145 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1560,17 +1560,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1150 +#: ../../library/configparser.rst:1151 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1153 +#: ../../library/configparser.rst:1154 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1160 +#: ../../library/configparser.rst:1161 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1579,35 +1579,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1166 +#: ../../library/configparser.rst:1167 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1170 +#: ../../library/configparser.rst:1171 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1178 +#: ../../library/configparser.rst:1179 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1185 +#: ../../library/configparser.rst:1186 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating-point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1192 +#: ../../library/configparser.rst:1193 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1619,34 +1619,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1205 +#: ../../library/configparser.rst:1206 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1208 +#: ../../library/configparser.rst:1209 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1212 +#: ../../library/configparser.rst:1213 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1220 +#: ../../library/configparser.rst:1221 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1227 +#: ../../library/configparser.rst:1228 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1655,27 +1655,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1235 +#: ../../library/configparser.rst:1236 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1243 +#: ../../library/configparser.rst:1244 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1251 +#: ../../library/configparser.rst:1252 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1257 +#: ../../library/configparser.rst:1258 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1684,7 +1684,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1263 +#: ../../library/configparser.rst:1264 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1692,7 +1692,7 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1268 +#: ../../library/configparser.rst:1269 msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" @@ -1700,30 +1700,30 @@ msgstr "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" -#: ../../library/configparser.rst:1271 +#: ../../library/configparser.rst:1272 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1277 +#: ../../library/configparser.rst:1278 msgid "" "A special object representing a section name used to reference the unnamed " "section (see :ref:`unnamed-sections`)." msgstr "" -#: ../../library/configparser.rst:1282 +#: ../../library/configparser.rst:1283 msgid "" "The maximum depth for recursive interpolation for :meth:`~configparser." "ConfigParser.get` when the *raw* parameter is false. This is relevant only " "when the default *interpolation* is used." msgstr "" -#: ../../library/configparser.rst:1290 +#: ../../library/configparser.rst:1291 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1300 +#: ../../library/configparser.rst:1301 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1731,27 +1731,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1310 +#: ../../library/configparser.rst:1311 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1317 +#: ../../library/configparser.rst:1318 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1321 +#: ../../library/configparser.rst:1322 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1327 +#: ../../library/configparser.rst:1328 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1761,7 +1761,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1334 +#: ../../library/configparser.rst:1335 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1769,32 +1769,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1341 +#: ../../library/configparser.rst:1342 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1345 +#: ../../library/configparser.rst:1346 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1350 +#: ../../library/configparser.rst:1351 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1355 +#: ../../library/configparser.rst:1356 msgid "" "Exception raised if :meth:`~ConfigParser.add_section` is called with the " "name of a section that is already present or in strict parsers when a " "section if found more than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1359 +#: ../../library/configparser.rst:1360 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" -#: ../../library/configparser.rst:1366 +#: ../../library/configparser.rst:1367 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1802,64 +1802,64 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1374 +#: ../../library/configparser.rst:1375 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1380 +#: ../../library/configparser.rst:1381 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1386 +#: ../../library/configparser.rst:1387 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1393 +#: ../../library/configparser.rst:1394 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1399 +#: ../../library/configparser.rst:1400 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1405 +#: ../../library/configparser.rst:1406 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1411 +#: ../../library/configparser.rst:1412 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1413 +#: ../../library/configparser.rst:1414 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1419 +#: ../../library/configparser.rst:1420 msgid "" "Exception raised when a key without a corresponding value is continued with " "an indented line." msgstr "" -#: ../../library/configparser.rst:1425 +#: ../../library/configparser.rst:1426 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1426 +#: ../../library/configparser.rst:1427 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " @@ -1886,14 +1886,14 @@ msgstr "ini file(ini 檔案)" msgid "Windows ini file" msgstr "Windows ini file(Windows ini 檔案)" -#: ../../library/configparser.rst:366 +#: ../../library/configparser.rst:367 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/configparser.rst:366 ../../library/configparser.rst:399 +#: ../../library/configparser.rst:367 ../../library/configparser.rst:400 msgid "interpolation in configuration files" msgstr "interpolation in configuration files(設定檔中的插值)" -#: ../../library/configparser.rst:399 +#: ../../library/configparser.rst:400 msgid "$ (dollar)" msgstr "$ (金錢符號)" diff --git a/library/ctypes.po b/library/ctypes.po index 4d41b963bb..2b037a09a0 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4065,14 +4065,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2545 +#: ../../library/ctypes.rst:2547 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2549 +#: ../../library/ctypes.rst:2551 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4080,11 +4080,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2554 +#: ../../library/ctypes.rst:2556 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2556 +#: ../../library/ctypes.rst:2558 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4106,7 +4106,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2567 +#: ../../library/ctypes.rst:2569 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4116,7 +4116,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2574 +#: ../../library/ctypes.rst:2576 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4128,7 +4128,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2579 +#: ../../library/ctypes.rst:2581 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4136,7 +4136,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2584 +#: ../../library/ctypes.rst:2586 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4146,15 +4146,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2595 +#: ../../library/ctypes.rst:2597 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2599 +#: ../../library/ctypes.rst:2601 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2601 +#: ../../library/ctypes.rst:2603 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4164,46 +4164,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2611 +#: ../../library/ctypes.rst:2613 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2618 +#: ../../library/ctypes.rst:2620 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2623 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2626 +#: ../../library/ctypes.rst:2628 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:2630 +#: ../../library/ctypes.rst:2632 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:2636 +#: ../../library/ctypes.rst:2638 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2640 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2642 +#: ../../library/ctypes.rst:2644 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4212,11 +4212,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2652 +#: ../../library/ctypes.rst:2654 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2656 +#: ../../library/ctypes.rst:2658 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.po b/library/curses.po index 963eaac381..22177e6b68 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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,7 +41,7 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 diff --git a/library/datetime.po b/library/datetime.po index b0ee3d5312..9de36afc55 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -423,8 +423,8 @@ msgstr "" "(-1, 86399, 999999)" #: ../../library/datetime.rst:265 ../../library/datetime.rst:566 -#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1760 -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:1126 ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:2369 msgid "Class attributes:" msgstr "類別屬性:" @@ -452,7 +452,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:287 ../../library/datetime.rst:584 -#: ../../library/datetime.rst:1142 ../../library/datetime.rst:1780 +#: ../../library/datetime.rst:1146 ../../library/datetime.rst:1784 msgid "Instance attributes (read-only):" msgstr "" @@ -491,17 +491,17 @@ msgid "Between 0 and 999,999 inclusive." msgstr "在 0 到 999,999 (含)之間" #: ../../library/datetime.rst:318 ../../library/datetime.rst:601 -#: ../../library/datetime.rst:1195 +#: ../../library/datetime.rst:1199 msgid "Supported operations:" msgstr "" #: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1198 +#: ../../library/datetime.rst:1202 msgid "Operation" msgstr "" #: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1198 +#: ../../library/datetime.rst:1202 msgid "Result" msgstr "" @@ -646,7 +646,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:384 ../../library/datetime.rst:623 -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2600 msgid "Notes:" msgstr "註解:" @@ -718,7 +718,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:428 ../../library/datetime.rst:665 -#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1289 ../../library/datetime.rst:1891 msgid "Instance methods:" msgstr "實例方法:" @@ -884,23 +884,23 @@ msgid "" "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:538 ../../library/datetime.rst:1044 +#: ../../library/datetime.rst:538 ../../library/datetime.rst:1048 msgid "" "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" -#: ../../library/datetime.rst:540 ../../library/datetime.rst:1046 +#: ../../library/datetime.rst:540 ../../library/datetime.rst:1050 msgid "" "Extended date representations are not currently supported (``±YYYYYY-MM-" "DD``)." msgstr "" -#: ../../library/datetime.rst:542 ../../library/datetime.rst:1048 +#: ../../library/datetime.rst:542 ../../library/datetime.rst:1052 msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" -#: ../../library/datetime.rst:544 ../../library/datetime.rst:1050 -#: ../../library/datetime.rst:1516 +#: ../../library/datetime.rst:544 ../../library/datetime.rst:1054 +#: ../../library/datetime.rst:1520 msgid "Examples::" msgstr "範例: ::" @@ -947,15 +947,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1150 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:593 ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:593 ../../library/datetime.rst:1155 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1156 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1160 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -979,7 +979,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:612 ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:612 ../../library/datetime.rst:1208 msgid "\\(3)" msgstr "\\(3)" @@ -991,7 +991,7 @@ msgstr "``date1 == date2``" msgid "``date1 != date2``" msgstr "``date1 != date2``" -#: ../../library/datetime.rst:614 ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:614 ../../library/datetime.rst:1210 msgid "Equality comparison. (4)" msgstr "" @@ -1011,7 +1011,7 @@ msgstr "``date1 <= date2``" msgid "``date1 >= date2``" msgstr "``date1 >= date2``" -#: ../../library/datetime.rst:617 ../../library/datetime.rst:1209 +#: ../../library/datetime.rst:617 ../../library/datetime.rst:1213 msgid "Order comparison. (5)" msgstr "" @@ -1058,7 +1058,7 @@ msgid "" "datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:655 ../../library/datetime.rst:1277 +#: ../../library/datetime.rst:655 ../../library/datetime.rst:1281 msgid "" "Comparison between :class:`.datetime` object and an instance of the :class:" "`date` subclass that is not a :class:`!datetime` subclass no longer converts " @@ -1078,7 +1078,7 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:672 ../../library/datetime.rst:1933 +#: ../../library/datetime.rst:672 ../../library/datetime.rst:1937 msgid "Example::" msgstr "範例: ::" @@ -1100,7 +1100,7 @@ msgid "" "replace`." msgstr "" -#: ../../library/datetime.rst:685 ../../library/datetime.rst:1401 +#: ../../library/datetime.rst:685 ../../library/datetime.rst:1405 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -1111,7 +1111,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:689 ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:689 ../../library/datetime.rst:1407 msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` 等價於: ::" @@ -1227,11 +1227,11 @@ msgstr "" ">>> date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" -#: ../../library/datetime.rst:763 ../../library/datetime.rst:1587 +#: ../../library/datetime.rst:763 ../../library/datetime.rst:1591 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` 等價於: ::" -#: ../../library/datetime.rst:765 ../../library/datetime.rst:1589 +#: ../../library/datetime.rst:765 ../../library/datetime.rst:1593 msgid "time.ctime(time.mktime(d.timetuple()))" msgstr "time.ctime(time.mktime(d.timetuple()))" @@ -1391,28 +1391,28 @@ msgstr "``1 <= month <= 12``," msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:877 ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:877 ../../library/datetime.rst:1755 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:878 ../../library/datetime.rst:1752 +#: ../../library/datetime.rst:878 ../../library/datetime.rst:1756 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:879 ../../library/datetime.rst:1753 +#: ../../library/datetime.rst:879 ../../library/datetime.rst:1757 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:880 ../../library/datetime.rst:1754 +#: ../../library/datetime.rst:880 ../../library/datetime.rst:1758 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:881 ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:881 ../../library/datetime.rst:1759 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:885 ../../library/datetime.rst:1322 -#: ../../library/datetime.rst:1900 +#: ../../library/datetime.rst:885 ../../library/datetime.rst:1326 +#: ../../library/datetime.rst:1904 msgid "Added the *fold* parameter." msgstr "新增 *fold* 參數。" @@ -1463,18 +1463,24 @@ msgstr "" msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:921 +#: ../../library/datetime.rst:920 +msgid "" +"Subsequent calls to :meth:`!datetime.now` may return the same instant " +"depending on the precision of the underlying clock." +msgstr "" + +#: ../../library/datetime.rst:925 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:923 +#: ../../library/datetime.rst:927 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:929 +#: ../../library/datetime.rst:933 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 " @@ -1482,11 +1488,11 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:936 +#: ../../library/datetime.rst:940 msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:941 +#: ../../library/datetime.rst:945 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 " @@ -1494,13 +1500,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:946 +#: ../../library/datetime.rst:950 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:949 +#: ../../library/datetime.rst:953 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` " @@ -1513,7 +1519,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:960 +#: ../../library/datetime.rst:964 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` " @@ -1521,17 +1527,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:967 +#: ../../library/datetime.rst:971 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:972 +#: ../../library/datetime.rst:976 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:975 +#: ../../library/datetime.rst:979 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:" @@ -1539,33 +1545,33 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:980 +#: ../../library/datetime.rst:984 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:982 +#: ../../library/datetime.rst:986 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" -#: ../../library/datetime.rst:984 +#: ../../library/datetime.rst:988 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:987 +#: ../../library/datetime.rst:991 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -#: ../../library/datetime.rst:989 +#: ../../library/datetime.rst:993 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:994 +#: ../../library/datetime.rst:998 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 " @@ -1574,7 +1580,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:1000 +#: ../../library/datetime.rst:1004 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` " @@ -1582,11 +1588,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:1008 +#: ../../library/datetime.rst:1012 msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:1013 +#: ../../library/datetime.rst:1017 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1595,7 +1601,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:1021 +#: ../../library/datetime.rst:1025 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 " @@ -1606,35 +1612,35 @@ msgid "" "attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:1029 +#: ../../library/datetime.rst:1033 msgid "" "For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" -#: ../../library/datetime.rst:1032 +#: ../../library/datetime.rst:1036 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:1038 +#: ../../library/datetime.rst:1042 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1041 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1045 ../../library/datetime.rst:1855 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1042 +#: ../../library/datetime.rst:1046 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1043 ../../library/datetime.rst:1856 +#: ../../library/datetime.rst:1047 ../../library/datetime.rst:1860 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1056 msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1680,13 +1686,13 @@ msgstr "" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -#: ../../library/datetime.rst:1074 +#: ../../library/datetime.rst:1078 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1081 +#: ../../library/datetime.rst:1085 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 " @@ -1694,23 +1700,23 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1090 +#: ../../library/datetime.rst:1094 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:1097 msgid "" "If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" -#: ../../library/datetime.rst:1095 ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:1099 ../../library/datetime.rst:2580 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" -#: ../../library/datetime.rst:1097 +#: ../../library/datetime.rst:1101 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. " @@ -1718,7 +1724,7 @@ msgid "" "fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1104 +#: ../../library/datetime.rst:1108 msgid "" "If *format* specifies a day of month without a year a :exc:" "`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " @@ -1729,7 +1735,7 @@ msgid "" "not have a year, explicitly add a year that is a leap year before parsing:" msgstr "" -#: ../../library/datetime.rst:1113 +#: ../../library/datetime.rst:1117 msgid "" ">>> from datetime import datetime\n" ">>> date_string = \"02/29\"\n" @@ -1739,44 +1745,44 @@ msgid "" "'February 29'" msgstr "" -#: ../../library/datetime.rst:1126 +#: ../../library/datetime.rst:1130 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1136 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1138 +#: ../../library/datetime.rst:1142 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1161 ../../library/datetime.rst:1784 +#: ../../library/datetime.rst:1165 ../../library/datetime.rst:1788 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1166 ../../library/datetime.rst:1171 -#: ../../library/datetime.rst:1789 ../../library/datetime.rst:1794 +#: ../../library/datetime.rst:1170 ../../library/datetime.rst:1175 +#: ../../library/datetime.rst:1793 ../../library/datetime.rst:1798 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1176 ../../library/datetime.rst:1799 +#: ../../library/datetime.rst:1180 ../../library/datetime.rst:1803 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:1185 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1187 ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1191 ../../library/datetime.rst:1814 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 " @@ -1786,26 +1792,26 @@ msgid "" "time representation." msgstr "" -#: ../../library/datetime.rst:1200 +#: ../../library/datetime.rst:1204 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1200 ../../library/datetime.rst:2423 -#: ../../library/datetime.rst:2428 ../../library/datetime.rst:2440 -#: ../../library/datetime.rst:2445 ../../library/datetime.rst:2505 -#: ../../library/datetime.rst:2510 ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:1204 ../../library/datetime.rst:2427 +#: ../../library/datetime.rst:2432 ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2449 ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2514 ../../library/datetime.rst:2518 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:1206 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1202 ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:1206 ../../library/datetime.rst:2460 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1208 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" @@ -1833,7 +1839,7 @@ msgstr "``datetime1 <= datetime2``" msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" -#: ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1220 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " "moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." @@ -1844,7 +1850,7 @@ msgid "" "adjustments are done even if the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1229 msgid "" "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " "As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " @@ -1852,14 +1858,14 @@ msgid "" "input is aware." msgstr "" -#: ../../library/datetime.rst:1230 +#: ../../library/datetime.rst:1234 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:1234 +#: ../../library/datetime.rst:1238 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 " @@ -1867,7 +1873,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1239 +#: ../../library/datetime.rst:1243 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. " @@ -1876,17 +1882,17 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1245 +#: ../../library/datetime.rst:1249 msgid "" ":class:`.datetime` objects are equal if they represent the same date and " "time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:1252 msgid "Naive and aware :class:`!datetime` objects are never equal." msgstr "" -#: ../../library/datetime.rst:1250 +#: ../../library/datetime.rst:1254 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1897,19 +1903,19 @@ msgid "" "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1263 +#: ../../library/datetime.rst:1267 msgid "" "Order comparison between naive and aware :class:`.datetime` objects raises :" "exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1266 +#: ../../library/datetime.rst:1270 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1919,33 +1925,33 @@ msgid "" "implementation never overflows." msgstr "" -#: ../../library/datetime.rst:1273 +#: ../../library/datetime.rst:1277 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1289 +#: ../../library/datetime.rst:1293 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1294 +#: ../../library/datetime.rst:1298 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:1297 ../../library/datetime.rst:1306 +#: ../../library/datetime.rst:1301 ../../library/datetime.rst:1310 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1303 +#: ../../library/datetime.rst:1307 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1314 +#: ../../library/datetime.rst:1318 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1953,27 +1959,27 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:1323 msgid "" ":class:`.datetime` objects are also supported by generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/datetime.rst:1328 +#: ../../library/datetime.rst:1332 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:1332 +#: ../../library/datetime.rst:1336 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 time zone." msgstr "" -#: ../../library/datetime.rst:1336 +#: ../../library/datetime.rst:1340 msgid "" "If called without arguments (or with ``tz=None``) the system local time zone " "is assumed for the target time zone. The ``.tzinfo`` attribute of the " @@ -1981,7 +1987,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1341 +#: ../../library/datetime.rst:1345 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 " @@ -1990,7 +1996,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1347 +#: ../../library/datetime.rst:1351 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " "*dt* without adjustment of date and time data, use ``dt." @@ -1999,14 +2005,14 @@ msgid "" "use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1356 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:1356 +#: ../../library/datetime.rst:1360 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -2017,49 +2023,49 @@ msgid "" " return tz.fromutc(utc)" msgstr "" -#: ../../library/datetime.rst:1364 +#: ../../library/datetime.rst:1368 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1367 +#: ../../library/datetime.rst:1371 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1374 +#: ../../library/datetime.rst:1378 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:1378 ../../library/datetime.rst:1973 -#: ../../library/datetime.rst:2080 ../../library/datetime.rst:2325 -#: ../../library/datetime.rst:2337 ../../library/datetime.rst:2649 +#: ../../library/datetime.rst:1382 ../../library/datetime.rst:1977 +#: ../../library/datetime.rst:2084 ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2653 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1384 +#: ../../library/datetime.rst:1388 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:1388 ../../library/datetime.rst:1983 -#: ../../library/datetime.rst:2134 +#: ../../library/datetime.rst:1392 ../../library/datetime.rst:1987 +#: ../../library/datetime.rst:2138 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1394 +#: ../../library/datetime.rst:1398 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:1405 +#: ../../library/datetime.rst:1409 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" @@ -2069,7 +2075,7 @@ msgstr "" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1413 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 :" @@ -2080,7 +2086,7 @@ msgid "" "to 0." msgstr "" -#: ../../library/datetime.rst:1420 +#: ../../library/datetime.rst:1424 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " @@ -2088,7 +2094,7 @@ msgid "" "time." msgstr "" -#: ../../library/datetime.rst:1424 +#: ../../library/datetime.rst:1428 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 " @@ -2097,7 +2103,7 @@ msgid "" "and UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1433 +#: ../../library/datetime.rst:1437 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 " @@ -2107,20 +2113,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1446 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1447 +#: ../../library/datetime.rst:1451 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:1451 +#: ../../library/datetime.rst:1455 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 " @@ -2130,22 +2136,22 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1458 +#: ../../library/datetime.rst:1462 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1461 +#: ../../library/datetime.rst:1465 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -#: ../../library/datetime.rst:1465 +#: ../../library/datetime.rst:1469 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1471 +#: ../../library/datetime.rst:1475 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -2153,57 +2159,57 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1477 +#: ../../library/datetime.rst:1481 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -#: ../../library/datetime.rst:1479 +#: ../../library/datetime.rst:1483 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1481 +#: ../../library/datetime.rst:1485 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -#: ../../library/datetime.rst:1485 +#: ../../library/datetime.rst:1489 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:1491 +#: ../../library/datetime.rst:1495 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:1498 +#: ../../library/datetime.rst:1502 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1508 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1506 +#: ../../library/datetime.rst:1510 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1507 +#: ../../library/datetime.rst:1511 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1509 +#: ../../library/datetime.rst:1513 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1512 +#: ../../library/datetime.rst:1516 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -2211,13 +2217,13 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1514 +#: ../../library/datetime.rst:1518 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1522 msgid "" ">>> from datetime import datetime, timezone\n" ">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2231,13 +2237,13 @@ msgstr "" ">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" -#: ../../library/datetime.rst:1524 +#: ../../library/datetime.rst:1528 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:1527 +#: ../../library/datetime.rst:1531 msgid "" ">>> from datetime import tzinfo, timedelta, datetime\n" ">>> class TZ(tzinfo):\n" @@ -2251,53 +2257,53 @@ msgid "" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" -#: ../../library/datetime.rst:1538 ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:1542 ../../library/datetime.rst:1917 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:1542 ../../library/datetime.rst:1917 +#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1544 ../../library/datetime.rst:1919 +#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1545 ../../library/datetime.rst:1920 +#: ../../library/datetime.rst:1549 ../../library/datetime.rst:1924 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 +#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 +#: ../../library/datetime.rst:1552 ../../library/datetime.rst:1927 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 +#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 +#: ../../library/datetime.rst:1558 ../../library/datetime.rst:1933 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1556 +#: ../../library/datetime.rst:1560 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1559 +#: ../../library/datetime.rst:1563 msgid "" ">>> from datetime import datetime\n" ">>> datetime.now().isoformat(timespec='minutes') \n" @@ -2313,21 +2319,21 @@ msgstr "" ">>> dt.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" -#: ../../library/datetime.rst:1566 ../../library/datetime.rst:1944 +#: ../../library/datetime.rst:1570 ../../library/datetime.rst:1948 msgid "Added the *timespec* parameter." msgstr "新增 *timespec* 參數。" -#: ../../library/datetime.rst:1572 +#: ../../library/datetime.rst:1576 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1578 +#: ../../library/datetime.rst:1582 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1580 +#: ../../library/datetime.rst:1584 msgid "" ">>> from datetime import datetime\n" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" @@ -2337,27 +2343,27 @@ msgstr "" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" -#: ../../library/datetime.rst:1584 +#: ../../library/datetime.rst:1588 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:1595 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:1598 +#: ../../library/datetime.rst:1602 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1605 +#: ../../library/datetime.rst:1609 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -2365,15 +2371,15 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1612 +#: ../../library/datetime.rst:1616 msgid "Examples of Usage: :class:`.datetime`" msgstr "用法範例::class:`.datetime`" -#: ../../library/datetime.rst:1614 +#: ../../library/datetime.rst:1618 msgid "Examples of working with :class:`.datetime` objects:" msgstr "更多 :class:`.datetime` 的用法範例:" -#: ../../library/datetime.rst:1616 +#: ../../library/datetime.rst:1620 msgid "" ">>> from datetime import datetime, date, time, timezone\n" "\n" @@ -2427,14 +2433,14 @@ msgid "" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" -#: ../../library/datetime.rst:1667 +#: ../../library/datetime.rst:1671 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:1671 +#: ../../library/datetime.rst:1675 msgid "" "from datetime import timedelta, datetime, tzinfo, timezone\n" "\n" @@ -2481,11 +2487,11 @@ msgid "" " return \"+04\"" msgstr "" -#: ../../library/datetime.rst:1714 +#: ../../library/datetime.rst:1718 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1720 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2509,63 +2515,63 @@ msgid "" "True" msgstr "" -#: ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1744 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1742 +#: ../../library/datetime.rst:1746 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:1747 +#: ../../library/datetime.rst:1751 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:1757 +#: ../../library/datetime.rst:1761 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" -#: ../../library/datetime.rst:1765 +#: ../../library/datetime.rst:1769 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1774 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 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:1804 +#: ../../library/datetime.rst:1808 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1818 +#: ../../library/datetime.rst:1822 msgid "" ":class:`.time` objects support equality and order comparisons, where *a* is " "considered less than *b* when *a* precedes *b* in time." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1825 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1829 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " "attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " @@ -2574,18 +2580,18 @@ msgid "" "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1835 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1839 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1841 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-" @@ -2593,33 +2599,33 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1848 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1852 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1856 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:1854 +#: ../../library/datetime.rst:1858 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1858 +#: ../../library/datetime.rst:1862 msgid "Examples:" msgstr "範例: ::" -#: ../../library/datetime.rst:1860 +#: ../../library/datetime.rst:1864 msgid "" ">>> from datetime import time\n" ">>> time.fromisoformat('04:23:01')\n" @@ -2659,13 +2665,13 @@ msgstr "" ">>> time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -#: ../../library/datetime.rst:1882 +#: ../../library/datetime.rst:1886 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1892 +#: ../../library/datetime.rst:1896 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2673,41 +2679,41 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1897 +#: ../../library/datetime.rst:1901 msgid "" ":class:`.time` objects are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/datetime.rst:1906 +#: ../../library/datetime.rst:1910 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1908 +#: ../../library/datetime.rst:1912 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1909 +#: ../../library/datetime.rst:1913 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1910 +#: ../../library/datetime.rst:1914 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1911 +#: ../../library/datetime.rst:1915 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1931 +#: ../../library/datetime.rst:1935 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1935 +#: ../../library/datetime.rst:1939 msgid "" ">>> from datetime import time\n" ">>> time(hour=12, minute=34, second=56, microsecond=123456)." @@ -2729,18 +2735,18 @@ msgstr "" ">>> dt.isoformat(timespec='auto')\n" "'12:34:56'" -#: ../../library/datetime.rst:1950 +#: ../../library/datetime.rst:1954 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1955 +#: ../../library/datetime.rst:1959 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1961 +#: ../../library/datetime.rst:1965 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 >> from datetime import time, tzinfo, timedelta\n" ">>> class TZ1(tzinfo):\n" @@ -2829,18 +2835,18 @@ msgstr "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" -#: ../../library/datetime.rst:2026 +#: ../../library/datetime.rst:2030 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:2034 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:2034 +#: ../../library/datetime.rst:2038 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 " @@ -2850,7 +2856,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:2040 +#: ../../library/datetime.rst:2044 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2860,7 +2866,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:2047 +#: ../../library/datetime.rst:2051 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`~object.__init__` method that can be called with no arguments, " @@ -2868,20 +2874,20 @@ msgid "" "technical requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:2053 +#: ../../library/datetime.rst:2057 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:2060 +#: ../../library/datetime.rst:2064 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:2063 +#: ../../library/datetime.rst:2067 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2892,31 +2898,31 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:2071 +#: ../../library/datetime.rst:2075 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" -#: ../../library/datetime.rst:2074 +#: ../../library/datetime.rst:2078 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:2077 +#: ../../library/datetime.rst:2081 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2086 +#: ../../library/datetime.rst:2090 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:2090 +#: ../../library/datetime.rst:2094 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 " @@ -2929,17 +2935,17 @@ msgid "" "to account for DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2100 +#: ../../library/datetime.rst:2104 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:2103 +#: ../../library/datetime.rst:2107 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2105 +#: ../../library/datetime.rst:2109 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " @@ -2952,24 +2958,24 @@ msgid "" "astimezone` regardless." msgstr "" -#: ../../library/datetime.rst:2114 +#: ../../library/datetime.rst:2118 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2116 +#: ../../library/datetime.rst:2120 msgid "" "def dst(self, dt):\n" " # a fixed-offset class: doesn't account for DST\n" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2120 +#: ../../library/datetime.rst:2124 msgid "or::" msgstr "或是: ::" -#: ../../library/datetime.rst:2122 +#: ../../library/datetime.rst:2126 msgid "" "def dst(self, dt):\n" " # Code to set dston and dstoff to the time zone's DST\n" @@ -2982,12 +2988,12 @@ msgid "" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2132 +#: ../../library/datetime.rst:2136 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2140 +#: ../../library/datetime.rst:2144 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:`!" @@ -3001,13 +3007,13 @@ msgid "" "accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2150 +#: ../../library/datetime.rst:2154 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2153 +#: ../../library/datetime.rst:2157 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 " @@ -3017,7 +3023,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2159 +#: ../../library/datetime.rst:2163 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 " @@ -3026,7 +3032,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2165 +#: ../../library/datetime.rst:2169 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -3036,13 +3042,13 @@ msgid "" "zones." msgstr "" -#: ../../library/datetime.rst:2171 +#: ../../library/datetime.rst:2175 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2176 +#: ../../library/datetime.rst:2180 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -3051,7 +3057,7 @@ msgid "" "datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2182 +#: ../../library/datetime.rst:2186 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -3066,13 +3072,13 @@ msgid "" "offset changes." msgstr "" -#: ../../library/datetime.rst:2193 +#: ../../library/datetime.rst:2197 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2196 +#: ../../library/datetime.rst:2200 msgid "" "def fromutc(self, dt):\n" " # raise ValueError error if dt.tzinfo is not self\n" @@ -3090,13 +3096,13 @@ msgid "" " return dt" msgstr "" -#: ../../library/datetime.rst:2211 +#: ../../library/datetime.rst:2215 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:2215 +#: ../../library/datetime.rst:2219 msgid "" "from datetime import tzinfo, timedelta, datetime\n" "\n" @@ -3276,7 +3282,7 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2221 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 " @@ -3285,7 +3291,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2223 +#: ../../library/datetime.rst:2227 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3303,7 +3309,7 @@ msgstr "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2235 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, " @@ -3312,7 +3318,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2240 msgid "" ">>> from datetime import datetime, timezone\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3340,7 +3346,7 @@ msgstr "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" -#: ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2254 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 " @@ -3355,7 +3361,7 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2261 +#: ../../library/datetime.rst:2265 msgid "" ">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" ">>> for i in range(4):\n" @@ -3379,13 +3385,13 @@ msgstr "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" -#: ../../library/datetime.rst:2272 +#: ../../library/datetime.rst:2276 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:2275 +#: ../../library/datetime.rst:2279 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3395,28 +3401,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2284 +#: ../../library/datetime.rst:2288 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 :class:`!timezone` instance)." msgstr "" -#: ../../library/datetime.rst:2288 +#: ../../library/datetime.rst:2292 msgid "" "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2295 msgid "`IANA time zone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2292 +#: ../../library/datetime.rst:2296 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 " @@ -3425,24 +3431,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2302 +#: ../../library/datetime.rst:2306 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2304 +#: ../../library/datetime.rst:2308 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a time zone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2312 msgid "" "Objects of this class cannot be used to represent time zone 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:2315 +#: ../../library/datetime.rst:2319 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -3450,25 +3456,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2320 +#: ../../library/datetime.rst:2324 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:2331 ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2346 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2338 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:2345 +#: ../../library/datetime.rst:2349 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 " @@ -3477,119 +3483,119 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2355 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "Always returns ``None``." msgstr "總是回傳 ``None``。" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2373 msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "UTC 時區,``timezone(timedelta(0))``。" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 的行為" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2384 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:2384 +#: ../../library/datetime.rst:2388 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:2388 +#: ../../library/datetime.rst:2392 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2396 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2396 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2407 +#: ../../library/datetime.rst:2411 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 格式碼" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2413 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "" ">>> datetime.strptime('31/01/22 23:59:59.999999',\n" "... '%d/%m/%y %H:%M:%S.%f')\n" @@ -3603,33 +3609,33 @@ msgstr "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2421 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:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Meaning" msgstr "含義" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2427 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2427 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -3641,11 +3647,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2432 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2432 msgid "Weekday as locale's full name." msgstr "" @@ -3657,42 +3663,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2437 ../../library/datetime.rst:2450 -#: ../../library/datetime.rst:2453 ../../library/datetime.rst:2459 -#: ../../library/datetime.rst:2462 ../../library/datetime.rst:2468 -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2457 ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2466 ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2490 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2444 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2444 msgid "Month as locale's abbreviated name." msgstr "" @@ -3704,11 +3710,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "Month as locale's full name." msgstr "" @@ -3720,67 +3726,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2454 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2454 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2450 ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2454 ../../library/datetime.rst:2466 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2456 ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2460 ../../library/datetime.rst:2530 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2466 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2466 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -3792,128 +3798,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2472 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2472 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2468 ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2472 ../../library/datetime.rst:2475 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2641 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2482 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2482 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2483 -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2487 +#: ../../library/datetime.rst:2544 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2483 ../../library/datetime.rst:2663 +#: ../../library/datetime.rst:2487 ../../library/datetime.rst:2667 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2487 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2487 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 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:2489 ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2489 ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2501 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2501 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:2505 +#: ../../library/datetime.rst:2509 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2509 msgid "Locale's appropriate date and time representation." msgstr "" @@ -3925,11 +3931,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2514 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2514 msgid "Locale's appropriate date representation." msgstr "" @@ -3945,11 +3951,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2518 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2518 msgid "Locale's appropriate time representation." msgstr "" @@ -3961,83 +3967,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2524 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:2526 +#: ../../library/datetime.rst:2530 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2530 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2530 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 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:2534 +#: ../../library/datetime.rst:2538 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2540 ../../library/datetime.rst:2659 +#: ../../library/datetime.rst:2544 ../../library/datetime.rst:2663 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2544 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2544 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2550 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -4046,7 +4052,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2555 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -4056,44 +4062,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2561 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``、``%u`` 與 ``%V``。" -#: ../../library/datetime.rst:2560 +#: ../../library/datetime.rst:2564 msgid "``%:z`` was added." msgstr "新增 ``%:z``。" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2568 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2570 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2574 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:2574 +#: ../../library/datetime.rst:2578 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2582 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:2586 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 " @@ -4103,7 +4109,7 @@ msgstr "" "time` 物件並沒有這些值。如果使用這些格式碼,年份會以 1900 代替、月及日會以 1 " "代替。" -#: ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2590 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 " @@ -4112,7 +4118,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2594 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 " @@ -4121,7 +4127,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2603 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 " @@ -4129,38 +4135,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2605 +#: ../../library/datetime.rst:2609 msgid "" "The :meth:`~.datetime.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:2608 +#: ../../library/datetime.rst:2612 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: ../../library/datetime.rst:2612 +#: ../../library/datetime.rst:2616 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: ../../library/datetime.rst:2617 +#: ../../library/datetime.rst:2621 msgid "" "When used with the :meth:`~.datetime.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:2621 +#: ../../library/datetime.rst:2625 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2629 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -4168,17 +4174,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2632 +#: ../../library/datetime.rst:2636 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2635 +#: ../../library/datetime.rst:2639 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2638 +#: ../../library/datetime.rst:2642 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -4192,7 +4198,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2652 +#: ../../library/datetime.rst:2656 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -4201,53 +4207,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2660 +#: ../../library/datetime.rst:2664 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2664 +#: ../../library/datetime.rst:2668 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: ../../library/datetime.rst:2668 +#: ../../library/datetime.rst:2672 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2670 +#: ../../library/datetime.rst:2674 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2671 +#: ../../library/datetime.rst:2675 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2673 +#: ../../library/datetime.rst:2677 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:2677 +#: ../../library/datetime.rst:2681 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.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:2683 +#: ../../library/datetime.rst:2687 msgid "" "When used with the :meth:`~.datetime.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:2688 +#: ../../library/datetime.rst:2692 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:`~." @@ -4255,7 +4261,7 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2694 +#: ../../library/datetime.rst:2698 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -4263,7 +4269,7 @@ msgid "" "zero." msgstr "" -#: ../../library/datetime.rst:2699 +#: ../../library/datetime.rst:2703 msgid "" "When parsing a month and day using :meth:`~.datetime.strptime`, always " "include a year in the format. If the value you need to parse lacks a year, " @@ -4272,7 +4278,7 @@ msgid "" "parser is not a leap year. Users run into this bug every four years..." msgstr "" -#: ../../library/datetime.rst:2705 +#: ../../library/datetime.rst:2709 msgid "" ">>> month_day = \"02/29\"\n" ">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " @@ -4280,7 +4286,7 @@ msgid "" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" -#: ../../library/datetime.rst:2711 +#: ../../library/datetime.rst:2715 msgid "" ":meth:`~.datetime.strptime` calls using a format string containing a day of " "month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " @@ -4288,15 +4294,15 @@ msgid "" "See :gh:`70647`." msgstr "" -#: ../../library/datetime.rst:2718 +#: ../../library/datetime.rst:2722 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2719 +#: ../../library/datetime.rst:2723 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2721 +#: ../../library/datetime.rst:2725 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4305,23 +4311,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2727 +#: ../../library/datetime.rst:2731 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2731 +#: ../../library/datetime.rst:2735 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " "a leap year." msgstr "" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2376 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2376 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dbm.po b/library/dbm.po index d22ea3490f..537944f975 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -253,8 +253,8 @@ msgid "" "including the SQLite CLI." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +#: ../../includes/wasm-mobile-notavail.rst:3 ../../includes/wasm-notavail.rst:3 +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 @@ -302,10 +302,6 @@ msgid "" "incompatible and can not be used interchangeably." msgstr "" -#: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr "" - #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" "This module is not supported on :ref:`mobile platforms \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -721,8 +721,8 @@ msgstr "" msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:618 ../../library/dis.rst:1313 -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:618 ../../library/dis.rst:1314 +#: ../../library/dis.rst:1330 msgid "This instruction now requires an exact :class:`bool` operand." msgstr "" @@ -782,9 +782,9 @@ msgstr "" #: ../../library/dis.rst:690 ../../library/dis.rst:698 #: ../../library/dis.rst:710 ../../library/dis.rst:798 #: ../../library/dis.rst:808 ../../library/dis.rst:818 -#: ../../library/dis.rst:1041 ../../library/dis.rst:1052 -#: ../../library/dis.rst:1156 ../../library/dis.rst:1168 -#: ../../library/dis.rst:1180 +#: ../../library/dis.rst:1042 ../../library/dis.rst:1053 +#: ../../library/dis.rst:1157 ../../library/dis.rst:1169 +#: ../../library/dis.rst:1181 msgid "Implements::" msgstr "" @@ -1090,10 +1090,12 @@ msgid "" msgstr "" #: ../../library/dis.rst:960 -msgid "Perform ``STACK.append(len(STACK[-1]))``." +msgid "" +"Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " +"statements where comparison with structure of pattern is needed." msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:968 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -1101,7 +1103,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:978 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -1110,20 +1112,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:987 +#: ../../library/dis.rst:988 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:993 ../../library/dis.rst:1664 +#: ../../library/dis.rst:994 ../../library/dis.rst:1665 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:1000 +#: ../../library/dis.rst:1001 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:1013 +#: ../../library/dis.rst:1014 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:1016 +#: ../../library/dis.rst:1017 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" @@ -1151,7 +1153,7 @@ msgstr "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" -#: ../../library/dis.rst:1022 +#: ../../library/dis.rst:1023 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -1159,11 +1161,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:1028 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:1030 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -1172,13 +1174,13 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:1035 +#: ../../library/dis.rst:1036 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:1043 +#: ../../library/dis.rst:1044 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" @@ -1188,13 +1190,13 @@ msgstr "" "value = STACK.pop()\n" "obj.name = value" -#: ../../library/dis.rst:1047 +#: ../../library/dis.rst:1048 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:1054 +#: ../../library/dis.rst:1055 msgid "" "obj = STACK.pop()\n" "del obj.name" @@ -1202,38 +1204,38 @@ msgstr "" "obj = STACK.pop()\n" "del obj.name" -#: ../../library/dis.rst:1057 +#: ../../library/dis.rst:1058 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1064 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:1068 +#: ../../library/dis.rst:1069 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1074 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1078 +#: ../../library/dis.rst:1079 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:1084 +#: ../../library/dis.rst:1085 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:1093 +#: ../../library/dis.rst:1094 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -1242,13 +1244,13 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1105 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" -#: ../../library/dis.rst:1107 +#: ../../library/dis.rst:1108 msgid "" "if count == 0:\n" " value = ()\n" @@ -1266,41 +1268,41 @@ msgstr "" "\n" "STACK.append(value)" -#: ../../library/dis.rst:1118 +#: ../../library/dis.rst:1119 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1123 +#: ../../library/dis.rst:1124 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1128 +#: ../../library/dis.rst:1129 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1132 +#: ../../library/dis.rst:1133 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1139 +#: ../../library/dis.rst:1140 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 " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1148 +#: ../../library/dis.rst:1149 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1158 +#: ../../library/dis.rst:1159 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" @@ -1308,11 +1310,11 @@ msgstr "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:1162 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1170 +#: ../../library/dis.rst:1171 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" @@ -1320,11 +1322,11 @@ msgstr "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1174 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1182 +#: ../../library/dis.rst:1183 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" @@ -1332,21 +1334,21 @@ msgstr "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" -#: ../../library/dis.rst:1185 +#: ../../library/dis.rst:1186 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1192 +#: ../../library/dis.rst:1193 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1200 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1202 +#: ../../library/dis.rst:1203 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -1358,76 +1360,76 @@ msgid "" "pushed." msgstr "" -#: ../../library/dis.rst:1211 +#: ../../library/dis.rst:1212 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1218 +#: ../../library/dis.rst:1219 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1222 +#: ../../library/dis.rst:1223 msgid "It pops three values from the stack (from top of stack down):" msgstr "" -#: ../../library/dis.rst:1224 +#: ../../library/dis.rst:1225 msgid "``self``: the first argument to the current method" msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1226 msgid "``cls``: the class within which the current method was defined" msgstr "" -#: ../../library/dis.rst:1226 +#: ../../library/dis.rst:1227 msgid "the global ``super``" msgstr "" -#: ../../library/dis.rst:1228 +#: ../../library/dis.rst:1229 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1232 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1235 +#: ../../library/dis.rst:1236 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1243 +#: ../../library/dis.rst:1244 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " "(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1248 msgid "" "The fifth-lowest bit of the oparg now indicates a forced conversion to :" "class:`bool`." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1255 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1262 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1268 +#: ../../library/dis.rst:1269 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1436,68 +1438,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1277 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1284 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:1289 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1295 +#: ../../library/dis.rst:1296 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1303 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1305 ../../library/dis.rst:1321 +#: ../../library/dis.rst:1306 ../../library/dis.rst:1322 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1310 ../../library/dis.rst:1326 -#: ../../library/dis.rst:1342 ../../library/dis.rst:1356 +#: ../../library/dis.rst:1311 ../../library/dis.rst:1327 +#: ../../library/dis.rst:1343 ../../library/dis.rst:1357 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1319 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1334 +#: ../../library/dis.rst:1335 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1337 ../../library/dis.rst:1351 +#: ../../library/dis.rst:1338 ../../library/dis.rst:1352 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1348 +#: ../../library/dis.rst:1349 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1362 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1505,186 +1507,188 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1366 +#: ../../library/dis.rst:1367 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1371 +#: ../../library/dis.rst:1372 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1373 +#: ../../library/dis.rst:1374 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:1379 +#: ../../library/dis.rst:1380 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1381 +#: ../../library/dis.rst:1382 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1388 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1396 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1404 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1408 +#: ../../library/dis.rst:1409 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1413 +#: ../../library/dis.rst:1414 msgid "" "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:1421 +#: ../../library/dis.rst:1422 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:1424 ../../library/dis.rst:1446 -#: ../../library/dis.rst:1457 +#: ../../library/dis.rst:1425 ../../library/dis.rst:1447 +#: ../../library/dis.rst:1458 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1431 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " "found there, loads it from the cell contained in slot ``i``, similar to :" -"opcode:`LOAD_DEREF`. This is used for loading free variables in class bodies " -"(which previously used :opcode:`!LOAD_CLASSDEREF`) and in :ref:`annotation " -"scopes ` within class bodies." +"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"` in class bodies (which previously used :opcode:`!" +"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " +"class bodies." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1444 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1453 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1464 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." +"Copies the ``n`` :term:`free (closure) 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:1472 +#: ../../library/dis.rst:1473 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1475 +#: ../../library/dis.rst:1476 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1477 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1477 +#: ../../library/dis.rst:1478 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1483 +#: ../../library/dis.rst:1484 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1486 ../../library/dis.rst:1510 +#: ../../library/dis.rst:1487 ../../library/dis.rst:1511 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1487 ../../library/dis.rst:1511 +#: ../../library/dis.rst:1488 ../../library/dis.rst:1512 msgid "``self`` or ``NULL``" msgstr "" -#: ../../library/dis.rst:1488 ../../library/dis.rst:1512 +#: ../../library/dis.rst:1489 ../../library/dis.rst:1513 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1490 +#: ../../library/dis.rst:1491 msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: ../../library/dis.rst:1492 +#: ../../library/dis.rst:1493 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:1498 +#: ../../library/dis.rst:1499 msgid "The callable now always appears at the same position on the stack." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1502 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: ../../library/dis.rst:1507 +#: ../../library/dis.rst:1508 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1513 +#: ../../library/dis.rst:1514 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1515 msgid "A :class:`tuple` of keyword argument names" msgstr "" -#: ../../library/dis.rst:1516 +#: ../../library/dis.rst:1517 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1520 msgid "" "``CALL_KW`` pops all arguments, the keyword names, 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:1528 +#: ../../library/dis.rst:1529 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 " @@ -1696,33 +1700,33 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 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:1552 +#: ../../library/dis.rst:1553 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[1]``." msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1555 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1557 +#: ../../library/dis.rst:1558 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1561 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1568 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " @@ -1730,42 +1734,42 @@ msgid "" "attribute to set:" msgstr "" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1572 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1574 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1574 +#: ../../library/dis.rst:1575 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1575 +#: ../../library/dis.rst:1576 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1584 +#: ../../library/dis.rst:1585 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1587 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1591 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1593 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1777,11 +1781,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1598 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1603 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 " @@ -1789,11 +1793,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1611 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1613 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1803,28 +1807,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1617 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1617 +#: ../../library/dis.rst:1618 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1618 +#: ../../library/dis.rst:1619 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1620 ../../library/dis.rst:1633 -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1621 ../../library/dis.rst:1634 +#: ../../library/dis.rst:1647 msgid "Used for implementing formatted literal strings (f-strings)." msgstr "" -#: ../../library/dis.rst:1627 +#: ../../library/dis.rst:1628 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1629 +#: ../../library/dis.rst:1630 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1834,11 +1838,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1640 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1641 +#: ../../library/dis.rst:1642 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1850,14 +1854,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1654 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1658 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1865,219 +1869,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1672 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1673 +#: ../../library/dis.rst:1674 msgid "" "The ``context`` oparand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1676 +#: ../../library/dis.rst:1677 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1678 +#: ../../library/dis.rst:1679 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1680 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1680 +#: ../../library/dis.rst:1681 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1683 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1687 +#: ../../library/dis.rst:1688 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1694 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1702 +#: ../../library/dis.rst:1703 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1705 +#: ../../library/dis.rst:1706 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1714 +#: ../../library/dis.rst:1715 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1718 +#: ../../library/dis.rst:1719 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1722 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:1725 +#: ../../library/dis.rst:1726 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1731 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1735 +#: ../../library/dis.rst:1736 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1739 ../../library/dis.rst:1793 +#: ../../library/dis.rst:1740 ../../library/dis.rst:1794 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1742 ../../library/dis.rst:1796 +#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1742 ../../library/dis.rst:1796 +#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 msgid "Description" msgstr "" -#: ../../library/dis.rst:1744 +#: ../../library/dis.rst:1745 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1744 ../../library/dis.rst:1798 +#: ../../library/dis.rst:1745 ../../library/dis.rst:1799 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1746 +#: ../../library/dis.rst:1747 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1746 +#: ../../library/dis.rst:1747 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1749 +#: ../../library/dis.rst:1750 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1749 +#: ../../library/dis.rst:1750 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1753 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1753 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1756 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1756 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1758 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1758 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1761 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1761 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1763 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1763 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1764 +#: ../../library/dis.rst:1765 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1764 +#: ../../library/dis.rst:1765 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1768 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1768 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1770 +#: ../../library/dis.rst:1771 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1770 +#: ../../library/dis.rst:1771 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1773 +#: ../../library/dis.rst:1774 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1773 +#: ../../library/dis.rst:1774 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1785 +#: ../../library/dis.rst:1786 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1788 +#: ../../library/dis.rst:1789 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2089,61 +2093,61 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1798 +#: ../../library/dis.rst:1799 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1800 +#: ../../library/dis.rst:1801 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1800 +#: ../../library/dis.rst:1801 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1804 +#: ../../library/dis.rst:1805 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1804 +#: ../../library/dis.rst:1805 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1807 +#: ../../library/dis.rst:1808 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1807 +#: ../../library/dis.rst:1808 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1811 +#: ../../library/dis.rst:1812 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1811 +#: ../../library/dis.rst:1812 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1818 +#: ../../library/dis.rst:1819 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1820 +#: ../../library/dis.rst:1821 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1825 +#: ../../library/dis.rst:1826 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1832 +#: ../../library/dis.rst:1833 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -2152,139 +2156,140 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1841 +#: ../../library/dis.rst:1842 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1845 +#: ../../library/dis.rst:1846 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1852 +#: ../../library/dis.rst:1853 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1858 +#: ../../library/dis.rst:1859 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1863 +#: ../../library/dis.rst:1864 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1866 +#: ../../library/dis.rst:1867 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1868 +#: ../../library/dis.rst:1869 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1874 +#: ../../library/dis.rst:1875 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1881 +#: ../../library/dis.rst:1882 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1883 +#: ../../library/dis.rst:1884 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1886 +#: ../../library/dis.rst:1887 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1893 +#: ../../library/dis.rst:1894 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1898 +#: ../../library/dis.rst:1899 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1903 +#: ../../library/dis.rst:1904 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1908 +#: ../../library/dis.rst:1909 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1915 +#: ../../library/dis.rst:1916 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1920 +#: ../../library/dis.rst:1921 msgid "" -"Sequence of bytecodes that access a free variable. 'free' in this context " -"refers to names in the current scope that are referenced by inner scopes or " -"names in outer scopes that are referenced from this scope. It does *not* " -"include references to global or builtin scopes." +"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " +"are referenced by inner scopes or names in outer scopes that are referenced " +"from this scope. It does *not* include references to global or builtin " +"scopes." msgstr "" -#: ../../library/dis.rst:1928 +#: ../../library/dis.rst:1929 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1933 +#: ../../library/dis.rst:1934 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:1940 +#: ../../library/dis.rst:1941 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1945 +#: ../../library/dis.rst:1946 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1949 +#: ../../library/dis.rst:1950 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1956 +#: ../../library/dis.rst:1957 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1958 +#: ../../library/dis.rst:1959 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:1964 +#: ../../library/dis.rst:1965 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1966 +#: ../../library/dis.rst:1967 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1583 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1583 msgid "slice" msgstr "slice(切片)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 9a8a3dcc0f..54caf8f9cb 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -76,7 +76,7 @@ msgid "The original rationale and specification for this module." msgstr "此模組的最初設計理念與規範。" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 diff --git a/library/errno.po b/library/errno.po index 8a2c10f4e4..7de3106068 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -588,8 +588,8 @@ msgid "" msgstr "" #: ../../library/errno.rst:673 -msgid ":ref:`Availability `: WASI, FreeBSD" -msgstr ":ref:`適用 `:WASI, FreeBSD" +msgid "Availability" +msgstr "" #: ../../library/errno.rst:680 msgid "Operation canceled" @@ -602,3 +602,6 @@ msgstr "" #: ../../library/errno.rst:694 msgid "State not recoverable" msgstr "" + +#~ msgid ":ref:`Availability `: WASI, FreeBSD" +#~ msgstr ":ref:`適用 `:WASI, FreeBSD" diff --git a/library/fcntl.po b/library/fcntl.po index 4a43c0463f..1661caeefe 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -31,9 +31,8 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:21 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/fcntl.rst:23 msgid "" @@ -381,6 +380,10 @@ msgstr "file control(檔案控制)" msgid "I/O control" msgstr "I/O control(I/O 控制)" +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + #~ msgid "" #~ "This module does not work or is not available on WebAssembly platforms " #~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " diff --git a/library/ftplib.po b/library/ftplib.po index b0dac40c3a..cf88ad9a5b 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,8 +46,8 @@ msgid "The default encoding is UTF-8, following :rfc:`2640`." msgstr "預設編碼是 UTF-8,遵循 :rfc:`2640`。" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`Availability `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -747,3 +747,6 @@ msgstr "protocol(協定)" #: ../../library/ftplib.rst:9 msgid "ftplib (standard module)" msgstr "ftplib(標準模組)" + +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`Availability `:非 WASI。" diff --git a/library/functions.po b/library/functions.po index 6f51cc8aa6..550f981d9e 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,8 +514,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:141 ../../library/functions.rst:931 -#: ../../library/functions.rst:1311 +#: ../../library/functions.rst:141 ../../library/functions.rst:932 +#: ../../library/functions.rst:1312 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -535,7 +535,7 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:156 ../../library/functions.rst:796 +#: ../../library/functions.rst:156 ../../library/functions.rst:797 msgid "The parameter is now positional-only." msgstr "現在為僅限位置參數。" @@ -933,8 +933,8 @@ msgid "" "number from real and imaginary parts." msgstr "" -#: ../../library/functions.rst:384 ../../library/functions.rst:741 -#: ../../library/functions.rst:987 +#: ../../library/functions.rst:384 ../../library/functions.rst:742 +#: ../../library/functions.rst:988 msgid "Examples:" msgstr "例如: ::" @@ -1023,8 +1023,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:447 ../../library/functions.rst:793 -#: ../../library/functions.rst:1036 +#: ../../library/functions.rst:447 ../../library/functions.rst:794 +#: ../../library/functions.rst:1037 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -1299,7 +1299,7 @@ msgstr "" "串。" #: ../../library/functions.rst:629 ../../library/functions.rst:631 -#: ../../library/functions.rst:685 ../../library/functions.rst:687 +#: ../../library/functions.rst:686 ../../library/functions.rst:688 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1307,11 +1307,11 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發程式碼編譯事件。" -#: ../../library/functions.rst:636 ../../library/functions.rst:707 +#: ../../library/functions.rst:636 ../../library/functions.rst:708 msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" -#: ../../library/functions.rst:640 ../../library/functions.rst:711 +#: ../../library/functions.rst:640 ../../library/functions.rst:712 msgid "" "The semantics of the default *locals* namespace have been adjusted as " "described for the :func:`locals` builtin." @@ -1378,17 +1378,18 @@ msgstr "" "哪些內建函式來執行程式碼。" #: ../../library/functions.rst:680 +#, fuzzy 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 " -"length of the tuple must exactly match the number of free variables " -"referenced by the code object." +"valid when the *object* is a code object containing :term:`free (closure) " +"variables `. The length of the tuple must exactly match " +"the length of the code object's :attr:`~codeobject.co_freevars` attribute." msgstr "" "*closure* 引數會指定一個閉包 (closure) — 它是一個 cellvar(格變數)的 tuple。" "只有在 *object* 是一個含有自由變數 (free variable) 的程式碼物件時,它才有效。" "Tuple 的長度必須與程式碼物件所引用的自由變數數量完全匹配。" -#: ../../library/functions.rst:692 +#: ../../library/functions.rst:693 #, fuzzy msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " @@ -1398,7 +1399,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:698 +#: ../../library/functions.rst:699 #, fuzzy msgid "" "The default *locals* act as described for function :func:`locals` below. " @@ -1409,11 +1410,11 @@ msgstr "" "預設的 *locals* dictionary。如果你想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:702 +#: ../../library/functions.rst:703 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:717 +#: ../../library/functions.rst:718 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1425,7 +1426,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個識別性函式,即 *iterable* 中所有假值" "元素會被移除。" -#: ../../library/functions.rst:723 +#: ../../library/functions.rst:724 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1436,7 +1437,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:728 +#: ../../library/functions.rst:729 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1444,11 +1445,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:739 +#: ../../library/functions.rst:740 msgid "Return a floating-point number constructed from a number or a string." msgstr "回傳從數字或字串生成的浮點數。" -#: ../../library/functions.rst:743 +#: ../../library/functions.rst:744 msgid "" ">>> float('+1.23')\n" "1.23\n" @@ -1472,7 +1473,7 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../library/functions.rst:756 +#: ../../library/functions.rst:757 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 " @@ -1487,7 +1488,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 :token:`~float:floatvalue` 的生成規則:" -#: ../../library/functions.rst:777 +#: ../../library/functions.rst:778 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1495,7 +1496,7 @@ msgstr "" "字母大小寫不影響,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表" "示正無窮大。" -#: ../../library/functions.rst:780 +#: ../../library/functions.rst:781 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 " @@ -1505,7 +1506,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:785 +#: ../../library/functions.rst:786 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1514,22 +1515,22 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 會委派給 ``x.__float__()``。如果未" "定義 :meth:`~object.__float__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:789 +#: ../../library/functions.rst:790 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:791 +#: ../../library/functions.rst:792 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:799 +#: ../../library/functions.rst:800 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" "如果 :meth:`~object.__float__` 未定義,則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:809 +#: ../../library/functions.rst:810 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1540,7 +1541,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:814 +#: ../../library/functions.rst:815 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1548,7 +1549,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:817 +#: ../../library/functions.rst:818 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1562,7 +1563,7 @@ msgstr "" "實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," "或是 *format_spec* 或回傳值不是字串,則會引發 :exc:`TypeError`。" -#: ../../library/functions.rst:824 +#: ../../library/functions.rst:825 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1570,7 +1571,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:833 +#: ../../library/functions.rst:834 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1580,7 +1581,7 @@ msgstr "" "``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:837 +#: ../../library/functions.rst:838 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." @@ -1588,7 +1589,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:845 +#: ../../library/functions.rst:846 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 " @@ -1603,7 +1604,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:854 +#: ../../library/functions.rst:855 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1614,7 +1615,7 @@ msgstr "" "發生在編譯期,因此你必須手動改編私有屬性(有兩個前導底線的屬性)的名稱,才能" "使用 :func:`getattr` 來取得它。" -#: ../../library/functions.rst:862 +#: ../../library/functions.rst:863 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1623,7 +1624,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:869 +#: ../../library/functions.rst:870 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. " @@ -1634,7 +1635,7 @@ msgstr "" "則回傳 ``False``。(此功能是透過呼叫 ``getattr(object, name)`` 並檢查是否引" "發 :exc:`AttributeError` 來實作的。)" -#: ../../library/functions.rst:877 +#: ../../library/functions.rst:878 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 " @@ -1645,7 +1646,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:884 +#: ../../library/functions.rst:885 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1653,7 +1654,7 @@ msgstr "" "請注意,如果物件帶有自訂的 :meth:`~object.__hash__` 方法,:func:`hash` 將根據" "運行機器的位元長度來截斷回傳值。" -#: ../../library/functions.rst:891 +#: ../../library/functions.rst:892 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 " @@ -1667,7 +1668,7 @@ msgstr "" "關鍵字或說明文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任" "意物件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:898 +#: ../../library/functions.rst:899 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 " @@ -1678,12 +1679,12 @@ msgstr "" "前面的參數是僅限位置 (positional-only) 參數。有關更多資訊,請參閱\\ :ref:`常" "見問答集中的僅限位置參數條目 `。" -#: ../../library/functions.rst:903 +#: ../../library/functions.rst:904 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "此函式會被 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:905 +#: ../../library/functions.rst:906 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1691,7 +1692,7 @@ msgstr "" "對於 :mod:`pydoc` 和 :mod:`inspect` 的變更,使得可呼叫物件回報的的簽名 " "(signature) 更加全面和一致。" -#: ../../library/functions.rst:912 +#: ../../library/functions.rst:913 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 :" @@ -1701,7 +1702,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:921 +#: ../../library/functions.rst:922 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 " @@ -1710,20 +1711,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:933 +#: ../../library/functions.rst:934 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:938 +#: ../../library/functions.rst:939 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:944 +#: ../../library/functions.rst:945 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. " @@ -1733,18 +1734,18 @@ msgstr "" "回傳物件的 \"識別性\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:949 +#: ../../library/functions.rst:950 msgid "This is the address of the object in memory." msgstr "這是該物件在記憶體中的位址。" -#: ../../library/functions.rst:951 +#: ../../library/functions.rst:952 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:957 +#: ../../library/functions.rst:958 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, " @@ -1755,7 +1756,7 @@ msgstr "" "從輸入中讀取一行,將其轉換為字串(去除末尾的換行符)並回傳。當讀取到 EOF 時," "則引發 :exc:`EOFError`。例如: ::" -#: ../../library/functions.rst:962 +#: ../../library/functions.rst:963 msgid "" ">>> s = input('--> ') \n" "--> Monty Python's Flying Circus\n" @@ -1767,7 +1768,7 @@ msgstr "" ">>> s \n" "\"Monty Python's Flying Circus\"" -#: ../../library/functions.rst:967 +#: ../../library/functions.rst:968 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1775,7 +1776,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:970 ../../library/functions.rst:972 +#: ../../library/functions.rst:971 ../../library/functions.rst:973 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1783,7 +1784,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:975 ../../library/functions.rst:977 +#: ../../library/functions.rst:976 ../../library/functions.rst:978 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1791,13 +1792,13 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:984 +#: ../../library/functions.rst:985 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." msgstr "" -#: ../../library/functions.rst:989 +#: ../../library/functions.rst:990 msgid "" ">>> int(123.45)\n" "123\n" @@ -1825,7 +1826,7 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -#: ../../library/functions.rst:1004 +#: ../../library/functions.rst:1005 msgid "" "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." "__int__()``. If the argument defines :meth:`~object.__index__`, it returns " @@ -1838,7 +1839,7 @@ msgstr "" "義了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數,則會向零" "的方向無條件捨去。" -#: ../../library/functions.rst:1010 +#: ../../library/functions.rst:1011 msgid "" "If the argument is not a number or if *base* is given, then it must be a " "string, :class:`bytes`, or :class:`bytearray` instance representing an " @@ -1851,7 +1852,7 @@ msgstr "" "以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、或在" "數字間有單一底線。" -#: ../../library/functions.rst:1016 +#: ../../library/functions.rst:1017 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 " @@ -1873,11 +1874,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:1027 +#: ../../library/functions.rst:1028 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱\\ :ref:`typesnumeric`。" -#: ../../library/functions.rst:1029 +#: ../../library/functions.rst:1030 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 " @@ -1889,22 +1890,22 @@ msgstr "" "的版本使用 :meth:`base.__int__ ` 而不是 :meth:`base." "__index__ `。" -#: ../../library/functions.rst:1039 +#: ../../library/functions.rst:1040 msgid "The first parameter is now positional-only." msgstr "第一個參數為僅限位置參數。" -#: ../../library/functions.rst:1042 +#: ../../library/functions.rst:1043 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" "如果未定義 :meth:`~object.__int__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:1045 +#: ../../library/functions.rst:1046 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "對 :meth:`~object.__trunc__` 的委派已棄用。" -#: ../../library/functions.rst:1048 +#: ../../library/functions.rst:1049 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 " @@ -1918,7 +1919,7 @@ msgstr "" "`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱\\ :ref:`整" "數字串轉換的長度限制 `\\ 說明文件。" -#: ../../library/functions.rst:1058 +#: ../../library/functions.rst:1059 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 " @@ -1958,7 +1959,7 @@ msgstr "" "是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:1090 +#: ../../library/functions.rst:1091 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1982,11 +1983,11 @@ msgstr "" "__next__` 時會不帶引數地呼叫 *object*;如果回傳的結果是 *sentinel* 則引發 :" "exc:`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:1104 +#: ../../library/functions.rst:1105 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1106 +#: ../../library/functions.rst:1107 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 " @@ -1995,7 +1996,7 @@ msgstr "" ":func:`iter` 的第二種形式有一個好用的應用,是能夠建立一個區塊閱讀器 (block-" "reader)。例如,從二進位資料庫檔案中讀取固定寬度的區塊,直到檔案的結尾: ::" -#: ../../library/functions.rst:1110 +#: ../../library/functions.rst:1111 msgid "" "from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" @@ -2007,7 +2008,7 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -#: ../../library/functions.rst:1118 +#: ../../library/functions.rst:1119 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 " @@ -2016,7 +2017,7 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1124 +#: ../../library/functions.rst:1125 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2024,7 +2025,7 @@ msgstr "" "如果物件長度大於 :data:`sys.maxsize`,像是 :class:`range(2 ** 100) `," "則 ``len`` 會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:1133 +#: ../../library/functions.rst:1134 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2032,33 +2033,33 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1140 msgid "" "Return a mapping object representing the current local symbol table, with " "variable names as the keys, and their currently bound references as the " "values." msgstr "" -#: ../../library/functions.rst:1143 +#: ../../library/functions.rst:1144 msgid "" "At module scope, as well as when using :func:`exec` or :func:`eval` with a " "single namespace, this function returns the same namespace as :func:" "`globals`." msgstr "" -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1148 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -#: ../../library/functions.rst:1150 +#: ../../library/functions.rst:1151 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -#: ../../library/functions.rst:1153 +#: ../../library/functions.rst:1154 msgid "" "In all of the above cases, each call to ``locals()`` in a given frame of " "execution will return the *same* mapping object. Changes made through the " @@ -2068,7 +2069,7 @@ msgid "" "returned mapping object." msgstr "" -#: ../../library/functions.rst:1160 +#: ../../library/functions.rst:1161 msgid "" "In an :term:`optimized scope` (including functions, generators, and " "coroutines), each call to ``locals()`` instead returns a fresh dictionary " @@ -2080,7 +2081,7 @@ msgid "" "previously returned dictionaries." msgstr "" -#: ../../library/functions.rst:1169 +#: ../../library/functions.rst:1170 msgid "" "Calling ``locals()`` as part of a comprehension in a function, generator, or " "coroutine is equivalent to calling it in the containing scope, except that " @@ -2089,19 +2090,19 @@ msgid "" "function." msgstr "" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1176 msgid "" "Calling ``locals()`` as part of a generator expression is equivalent to " "calling it in a nested generator function." msgstr "" -#: ../../library/functions.rst:1178 +#: ../../library/functions.rst:1179 msgid "" "The behaviour of ``locals()`` in a comprehension has been updated as " "described in :pep:`709`." msgstr "" -#: ../../library/functions.rst:1182 +#: ../../library/functions.rst:1183 msgid "" "As part of :pep:`667`, the semantics of mutating the mapping objects " "returned from this function are now defined. The behavior in :term:" @@ -2110,7 +2111,7 @@ msgid "" "versions." msgstr "" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1193 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2125,13 +2126,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經被編排為引數的 tuple," "請參閱 :func:`itertools.starmap`。" -#: ../../library/functions.rst:1204 +#: ../../library/functions.rst:1205 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個以上的引數中最大的。" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1208 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 " @@ -2140,7 +2141,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1212 ../../library/functions.rst:1250 +#: ../../library/functions.rst:1213 ../../library/functions.rst:1251 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 " @@ -2153,7 +2154,7 @@ msgstr "" "的物件。如果 iterable 為空,並且沒有提供 *default*,則會引發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:1218 +#: ../../library/functions.rst:1219 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2164,15 +2165,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1223 ../../library/functions.rst:1261 +#: ../../library/functions.rst:1224 ../../library/functions.rst:1262 msgid "Added the *default* keyword-only parameter." msgstr "新增 *default* 僅限關鍵字參數。" -#: ../../library/functions.rst:1226 ../../library/functions.rst:1264 +#: ../../library/functions.rst:1227 ../../library/functions.rst:1265 msgid "The *key* can be ``None``." msgstr "*key* 可以為 ``None``。" -#: ../../library/functions.rst:1234 +#: ../../library/functions.rst:1235 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2180,13 +2181,13 @@ msgstr "" "回傳由給定的引數所建立之「memory view(記憶體檢視)」物件。有關詳細資訊,請參" "閱\\ :ref:`typememoryview`。" -#: ../../library/functions.rst:1242 +#: ../../library/functions.rst:1243 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個以上的引數中最小的。" -#: ../../library/functions.rst:1245 +#: ../../library/functions.rst:1246 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 " @@ -2195,7 +2196,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1256 +#: ../../library/functions.rst:1257 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2206,7 +2207,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1271 +#: ../../library/functions.rst:1272 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 " @@ -2216,7 +2217,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1278 +#: ../../library/functions.rst:1279 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 " @@ -2225,7 +2226,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1284 +#: ../../library/functions.rst:1285 #, fuzzy msgid "" ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " @@ -2234,7 +2235,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1291 +#: ../../library/functions.rst:1292 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` " @@ -2245,7 +2246,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1301 +#: ../../library/functions.rst:1302 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." @@ -2253,7 +2254,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1318 +#: ../../library/functions.rst:1319 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 " @@ -2263,7 +2264,7 @@ msgstr "" "啟,則引發 :exc:`OSError`。關於使用此函式的更多方法,請參閱\\ :ref:`tut-" "files`。" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1323 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 " @@ -2276,7 +2277,7 @@ msgstr "" "器 (file descriptor)。(如果有給定檔案描述器,它會隨著回傳的 I/O 物件關閉而關" "閉,除非 *closefd* 被設為 ``False``。)" -#: ../../library/functions.rst:1328 +#: ../../library/functions.rst:1329 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. " @@ -2297,71 +2298,71 @@ msgstr "" "getencoding` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模" "式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1346 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1346 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1348 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1348 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1349 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1349 msgid "open for writing, truncating the file first" msgstr "寫入,會先清除檔案內容" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1350 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1350 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性建立,如果文件已存在則會失敗" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1351 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1351 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果檔案存在則在其末端附加內容" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1352 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1351 ../../library/functions.rst:1495 +#: ../../library/functions.rst:1352 ../../library/functions.rst:1496 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1353 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1353 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1354 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1354 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1356 +#: ../../library/functions.rst:1357 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 " @@ -2371,7 +2372,7 @@ msgstr "" "``'w+b'`` 模式會開啟並清除檔案。``'r+'`` 和 ``'r+b'`` 模式會開啟且保留檔案內" "容。" -#: ../../library/functions.rst:1360 +#: ../../library/functions.rst:1361 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* " @@ -2387,7 +2388,7 @@ msgstr "" "``'t'``),檔案的內容會以 :class:`str` 回傳,其位元組已經先被解碼,使用的是取" "決於平台的編碼系統或是給定的 *encoding*。" -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1371 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 " @@ -2396,7 +2397,7 @@ msgstr "" "Python 不會使用底層作業系統對於文字檔案的操作概念;所有的處理都是由 Python 獨" "自完成的,因此能獨立於不同平台。" -#: ../../library/functions.rst:1374 +#: ../../library/functions.rst:1375 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 " @@ -2417,7 +2418,7 @@ msgstr "" "``write_through`` 旗標。若未給定 *buffering* 引數,則預設的緩衝策略會運作如" "下:" -#: ../../library/functions.rst:1384 +#: ../../library/functions.rst:1385 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 " @@ -2429,7 +2430,7 @@ msgstr "" "DEFAULT_BUFFER_SIZE`。在許多系統上,緩衝區的長度通常為 4096 或 8192 個位元" "組。" -#: ../../library/functions.rst:1389 +#: ../../library/functions.rst:1390 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2438,7 +2439,7 @@ msgstr "" "「互動式」文字檔(:meth:`~io.IOBase.isatty` 回傳 ``True`` 的檔案)會使用列緩" "衝。其他文字檔則使用上述的二進制檔案緩衝策略。" -#: ../../library/functions.rst:1393 +#: ../../library/functions.rst:1394 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 " @@ -2451,7 +2452,7 @@ msgstr "" "Python 支援的任何 :term:`text encoding`\\ (文字編碼)都是可以使用的。關於支" "援的編碼系統清單,請參閱 :mod:`codecs` module。" -#: ../../library/functions.rst:1399 +#: ../../library/functions.rst:1400 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 " @@ -2464,7 +2465,7 @@ msgstr "" "handlers`\\ 有列出清單),不過任何已註冊到 :func:`codecs.register_error` 的錯" "誤處理程式名稱也都是有效的。標準的名稱包括:" -#: ../../library/functions.rst:1407 +#: ../../library/functions.rst:1408 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2472,20 +2473,20 @@ msgstr "" "``'strict'`` 如果發生編碼錯誤,則引發 :exc:`ValueError` 例外。預設值 " "``None`` 也有相同的效果。" -#: ../../library/functions.rst:1411 +#: ../../library/functions.rst:1412 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "``'ignore'`` 忽略錯誤。請注意,忽略編碼錯誤可能導致資料遺失。" -#: ../../library/functions.rst:1414 +#: ../../library/functions.rst:1415 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" "``'replace'`` 會在格式不正確的資料位置插入一個替換標誌(像是 ``'?'``)。" -#: ../../library/functions.rst:1417 +#: ../../library/functions.rst:1418 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2498,7 +2499,7 @@ msgstr "" "被還原回 ``surrogateescape`` 錯誤處理程式當時所處理的那些相同位元組。這對於處" "理未知編碼方式的檔案會很好用。" -#: ../../library/functions.rst:1424 +#: ../../library/functions.rst:1425 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2507,7 +2508,7 @@ msgstr "" "``'xmlcharrefreplace'`` 僅在寫入檔案時可支援。編碼系統不支援的字元會被替換為" "適當的 XML 字元參考 (character reference) ``&#nnn;``。" -#: ../../library/functions.rst:1428 +#: ../../library/functions.rst:1429 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2515,7 +2516,7 @@ msgstr "" "``'backslashreplace'`` 會用 Python 的反斜線跳脫序列 (backslashed escape " "sequence) 替換格式不正確的資料。" -#: ../../library/functions.rst:1431 +#: ../../library/functions.rst:1432 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2523,7 +2524,7 @@ msgstr "" "``'namereplace'``\\ (也僅在寫入時支援)會將不支援的字元替換為 ``\\N{...}`` " "跳脫序列。" -#: ../../library/functions.rst:1439 +#: ../../library/functions.rst:1440 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2532,7 +2533,7 @@ msgstr "" "*newline* 會決定如何剖析資料串流 (stream) 中的換行字元。它可以是 ``None``、" "``''``、``'\\n'``、``'\\r'`` 或 ``'\\r\\n'``。它的運作規則如下:" -#: ../../library/functions.rst:1443 +#: ../../library/functions.rst:1444 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2548,7 +2549,7 @@ msgstr "" "傳給呼叫方時,行尾符號不會被轉換。如果它是任何其他有效的值,則輸入資料的行只" "會由給定的字串做結尾,且在回傳給呼叫方時,行尾符號不會被轉換。" -#: ../../library/functions.rst:1451 +#: ../../library/functions.rst:1452 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2561,7 +2562,7 @@ msgstr "" "``''`` 或 ``'\\n'``,則不做任何轉換。如果 *newline* 是任何其他有效的值,則寫" "入的任何 ``'\\n'`` 字元都將轉換為給定的字串。" -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1458 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 " @@ -2572,7 +2573,7 @@ msgstr "" "則當檔案關閉時,底層的檔案描述器會保持開啟狀態。如果有給定一個檔名,則 " "*closefd* 必須是 ``True``\\ (預設值);否則將引發錯誤。" -#: ../../library/functions.rst:1462 +#: ../../library/functions.rst:1463 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 " @@ -2585,11 +2586,11 @@ msgstr "" "必須回傳一個開啟的檔案描述器(將 :mod:`os.open` 作為 *opener* 傳入,在功能上" "的結果會相當於傳入 ``None``)。" -#: ../../library/functions.rst:1468 +#: ../../library/functions.rst:1469 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1470 +#: ../../library/functions.rst:1471 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::" @@ -2597,7 +2598,7 @@ msgstr "" "下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," "從給定的目錄中用相對路徑開啟檔案: ::" -#: ../../library/functions.rst:1473 +#: ../../library/functions.rst:1474 msgid "" ">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" @@ -2610,7 +2611,7 @@ msgid "" ">>> os.close(dir_fd) # don't leak a file descriptor" msgstr "" -#: ../../library/functions.rst:1483 +#: ../../library/functions.rst:1484 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 " @@ -2634,7 +2635,7 @@ msgstr "" "BufferedRandom`。當緩衝被停用時,會回傳原始資料串流 :class:`io.FileIO`,它" "是 :class:`io.RawIOBase` 的一個 subclass。" -#: ../../library/functions.rst:1504 +#: ../../library/functions.rst:1505 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2644,7 +2645,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1508 +#: ../../library/functions.rst:1509 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2652,25 +2653,25 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1510 +#: ../../library/functions.rst:1511 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推論 (infer)。" -#: ../../library/functions.rst:1515 +#: ../../library/functions.rst:1516 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1517 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1517 +#: ../../library/functions.rst:1518 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去引發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1518 +#: ../../library/functions.rst:1519 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2678,11 +2679,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1523 +#: ../../library/functions.rst:1524 msgid "The file is now non-inheritable." msgstr "檔案在此版本開始是不可繼承的。" -#: ../../library/functions.rst:1527 +#: ../../library/functions.rst:1528 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 :" @@ -2691,15 +2692,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有引發例外,此函式現在會重試系統呼叫,而" "不是引發 :exc:`InterruptedError` 例外(原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1530 +#: ../../library/functions.rst:1531 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1534 +#: ../../library/functions.rst:1535 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對於實作 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1536 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2707,11 +2708,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1538 +#: ../../library/functions.rst:1539 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1543 +#: ../../library/functions.rst:1544 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2722,7 +2723,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1551 +#: ../../library/functions.rst:1552 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) % " @@ -2733,7 +2734,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1557 #, fuzzy msgid "" "The arguments must have numeric types. With mixed operand types, the " @@ -2756,7 +2757,7 @@ msgstr "" "數,且指數 (exponent) 不是整數,則會得到一個複數的結果。例如,``pow(-9, " "0.5)`` 會回傳一個接近 ``3j`` 的值。" -#: ../../library/functions.rst:1568 +#: ../../library/functions.rst:1569 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 " @@ -2769,11 +2770,11 @@ msgstr "" "與 *mod* 互質。在這種情況下,會回傳 ``pow(inv_base, -exp, mod)``,其中 " "*inv_base* 是 *base* 對 *mod* 的模倒數 (inverse modulo)。" -#: ../../library/functions.rst:1574 +#: ../../library/functions.rst:1575 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "以下是一個計算 ``38`` 對 ``97`` 取模倒數的範例: ::" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1577 msgid "" ">>> pow(38, -1, mod=97)\n" "23\n" @@ -2785,7 +2786,7 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -#: ../../library/functions.rst:1581 +#: ../../library/functions.rst:1582 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2793,12 +2794,12 @@ msgstr "" "對於 :class:`int` 運算元,現在 ``pow`` 的三引數形式允許第二個引數為負數,也容" "許模倒數的計算。" -#: ../../library/functions.rst:1586 +#: ../../library/functions.rst:1587 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "允許關鍵字引數。在此之前只支援位置引數。" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1594 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 " @@ -2807,7 +2808,7 @@ msgstr "" "將 *objects* 列印到文字資料串流 *file*,用 *sep* 分隔並以 *end* 結尾。如果有" "給定 *sep*、*end*、*file* 和 *flush*,那麼它們必須是關鍵字引數的形式。" -#: ../../library/functions.rst:1597 +#: ../../library/functions.rst:1598 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* " @@ -2820,7 +2821,7 @@ msgstr "" "以是 ``None``,這表示使用預設值。如果沒有給定 *objects*,:func:`print` 就只會" "寫入 *end*。" -#: ../../library/functions.rst:1603 +#: ../../library/functions.rst:1604 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 " @@ -2832,7 +2833,7 @@ msgstr "" "串,所以 :func:`print` 不能用於二進位模式的檔案物件。對於此類物件,請改用 " "``file.write(...)``。" -#: ../../library/functions.rst:1608 +#: ../../library/functions.rst:1609 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2840,15 +2841,15 @@ msgstr "" "輸出緩衝通常會由 *file* 決定。但是如果 *flush* 為 true,則資料串流會被強制清" "除。" -#: ../../library/functions.rst:1612 +#: ../../library/functions.rst:1613 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1619 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1620 +#: ../../library/functions.rst:1621 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 " @@ -2857,11 +2858,11 @@ msgstr "" "*fget* 是一個用於取得屬性值的函式,*fset* 是一個用於設定屬性值的函式,*fdel* " "是一個用於刪除屬性值的函式,而 *doc* 會為該屬性建立一個說明字串。" -#: ../../library/functions.rst:1624 +#: ../../library/functions.rst:1625 msgid "A typical use is to define a managed attribute ``x``::" msgstr "一個典型的用途是定義一個受管理的屬性 ``x``: ::" -#: ../../library/functions.rst:1626 +#: ../../library/functions.rst:1627 msgid "" "class C:\n" " def __init__(self):\n" @@ -2893,7 +2894,7 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../library/functions.rst:1641 +#: ../../library/functions.rst:1642 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." @@ -2901,7 +2902,7 @@ msgstr "" "如果 *c* 是 *C* 的一個實例,則 ``c.x`` 將會呼叫取得器 (getter),``c.x = " "value`` 會呼叫設定器 (setter),而 ``del c.x`` 會呼叫刪除器 (deleter)。" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1645 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 " @@ -2912,7 +2913,7 @@ msgstr "" "*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使用 :func:" "`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1649 msgid "" "class Parrot:\n" " def __init__(self):\n" @@ -2924,14 +2925,14 @@ msgid "" " return self._voltage" msgstr "" -#: ../../library/functions.rst:1657 +#: ../../library/functions.rst:1658 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:1665 +#: ../../library/functions.rst:1666 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2939,7 +2940,7 @@ msgid "" "with an example:" msgstr "" -#: ../../library/functions.rst:1670 +#: ../../library/functions.rst:1671 msgid "" "class C:\n" " def __init__(self):\n" @@ -2975,36 +2976,36 @@ msgstr "" " def x(self):\n" " del self._x" -#: ../../library/functions.rst:1689 +#: ../../library/functions.rst:1690 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:1693 +#: ../../library/functions.rst:1694 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1696 +#: ../../library/functions.rst:1697 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1701 +#: ../../library/functions.rst:1702 msgid "" "Attribute holding the name of the property. The name of the property can be " "changed at runtime." msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1713 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:1718 +#: ../../library/functions.rst:1719 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 " @@ -3017,11 +3018,11 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1729 +#: ../../library/functions.rst:1730 msgid "This class has a custom representation that can be evaluated::" msgstr "" -#: ../../library/functions.rst:1731 +#: ../../library/functions.rst:1732 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3039,7 +3040,7 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -#: ../../library/functions.rst:1742 +#: ../../library/functions.rst:1743 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -3047,14 +3048,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1750 +#: ../../library/functions.rst:1751 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:1754 +#: ../../library/functions.rst:1755 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 " @@ -3065,13 +3066,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1763 +#: ../../library/functions.rst:1764 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1768 +#: ../../library/functions.rst:1769 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 " @@ -3080,21 +3081,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1781 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:1784 +#: ../../library/functions.rst:1785 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:1791 +#: ../../library/functions.rst:1792 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 " @@ -3103,7 +3104,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1797 +#: ../../library/functions.rst:1798 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:" @@ -3112,21 +3113,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1805 +#: ../../library/functions.rst:1806 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:1814 +#: ../../library/functions.rst:1815 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``." msgstr "" -#: ../../library/functions.rst:1822 +#: ../../library/functions.rst:1823 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3134,48 +3135,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1827 +#: ../../library/functions.rst:1828 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" "`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" -#: ../../library/functions.rst:1832 +#: ../../library/functions.rst:1833 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1838 +#: ../../library/functions.rst:1839 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1840 +#: ../../library/functions.rst:1841 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1842 +#: ../../library/functions.rst:1843 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:1846 +#: ../../library/functions.rst:1847 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:1849 +#: ../../library/functions.rst:1850 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1852 +#: ../../library/functions.rst:1853 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 " @@ -3183,7 +3184,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1858 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3195,22 +3196,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1867 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1871 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1872 +#: ../../library/functions.rst:1873 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1875 +#: ../../library/functions.rst:1876 msgid "" "class C:\n" " @staticmethod\n" @@ -3220,7 +3221,7 @@ msgstr "" " @staticmethod\n" " def f(arg1, arg2, argN): ..." -#: ../../library/functions.rst:1879 +#: ../../library/functions.rst:1880 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3228,7 +3229,7 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1882 +#: ../../library/functions.rst:1883 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3236,14 +3237,14 @@ msgid "" "(such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1887 +#: ../../library/functions.rst:1888 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:1891 +#: ../../library/functions.rst:1892 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 " @@ -3252,7 +3253,7 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1897 +#: ../../library/functions.rst:1898 msgid "" "def regular_function():\n" " ...\n" @@ -3266,11 +3267,11 @@ msgstr "" "class C:\n" " method = staticmethod(regular_function)" -#: ../../library/functions.rst:1903 +#: ../../library/functions.rst:1904 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1905 +#: ../../library/functions.rst:1906 #, fuzzy msgid "" "Static methods now inherit the method attributes (:attr:`~function." @@ -3282,25 +3283,25 @@ msgstr "" "``__qualname__``、``__doc__`` 和 ``__annotations__``),並擁有一個新的 " "``__wrapped__`` 屬性。" -#: ../../library/functions.rst:1921 +#: ../../library/functions.rst:1922 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1923 +#: ../../library/functions.rst:1924 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1929 +#: ../../library/functions.rst:1930 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:1933 +#: ../../library/functions.rst:1934 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 ``''." @@ -3309,37 +3310,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1939 +#: ../../library/functions.rst:1940 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1942 +#: ../../library/functions.rst:1943 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -#: ../../library/functions.rst:1949 +#: ../../library/functions.rst:1950 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:1953 +#: ../../library/functions.rst:1954 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:1957 +#: ../../library/functions.rst:1958 msgid "" "For example, if :attr:`~type.__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:1961 +#: ../../library/functions.rst:1962 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" @@ -3347,7 +3348,7 @@ msgid "" "whenever the inheritance hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1966 +#: ../../library/functions.rst:1967 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. " @@ -3355,7 +3356,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1971 +#: ../../library/functions.rst:1972 msgid "" "When called directly within an ordinary method of a class, both arguments " "may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " @@ -3365,7 +3366,7 @@ msgid "" "including generator expressions, which implicitly create nested functions.)" msgstr "" -#: ../../library/functions.rst:1978 +#: ../../library/functions.rst:1979 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 " @@ -3373,7 +3374,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1983 +#: ../../library/functions.rst:1984 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 " @@ -3386,11 +3387,11 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1993 +#: ../../library/functions.rst:1994 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1995 +#: ../../library/functions.rst:1996 msgid "" "class C(B):\n" " def method(self, arg):\n" @@ -3398,14 +3399,14 @@ msgid "" " # super(C, self).method(arg)" msgstr "" -#: ../../library/functions.rst:2000 +#: ../../library/functions.rst:2001 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:2004 +#: ../../library/functions.rst:2005 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3415,7 +3416,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:2012 +#: ../../library/functions.rst:2013 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 " @@ -3425,33 +3426,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:2019 +#: ../../library/functions.rst:2020 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:2029 +#: ../../library/functions.rst:2030 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:2038 +#: ../../library/functions.rst:2039 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:2042 +#: ../../library/functions.rst:2043 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:2045 +#: ../../library/functions.rst:2046 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 " @@ -3464,22 +3465,22 @@ msgid "" "type` objects:" msgstr "" -#: ../../library/functions.rst:2060 +#: ../../library/functions.rst:2061 msgid "See also:" msgstr "" -#: ../../library/functions.rst:2062 +#: ../../library/functions.rst:2063 msgid "" ":ref:`Documentation on attributes and methods on classes `." msgstr "" -#: ../../library/functions.rst:2063 +#: ../../library/functions.rst:2064 #, fuzzy msgid ":ref:`bltin-type-objects`" msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:2065 +#: ../../library/functions.rst:2066 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3487,23 +3488,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:2070 +#: ../../library/functions.rst:2071 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:2072 +#: ../../library/functions.rst:2073 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:2079 +#: ../../library/functions.rst:2080 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`!__dict__` attribute." msgstr "" -#: ../../library/functions.rst:2082 +#: ../../library/functions.rst:2083 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -3511,34 +3512,34 @@ msgid "" "MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:2087 +#: ../../library/functions.rst:2088 msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "" -#: ../../library/functions.rst:2089 +#: ../../library/functions.rst:2090 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:2095 +#: ../../library/functions.rst:2096 msgid "" "The result of calling this function without an argument has been updated as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:2101 +#: ../../library/functions.rst:2102 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:2104 +#: ../../library/functions.rst:2105 msgid "Example::" msgstr "例如: ::" -#: ../../library/functions.rst:2106 +#: ../../library/functions.rst:2107 msgid "" ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" @@ -3554,27 +3555,27 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -#: ../../library/functions.rst:2113 +#: ../../library/functions.rst:2114 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:2116 +#: ../../library/functions.rst:2117 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:2120 +#: ../../library/functions.rst:2121 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:2124 +#: ../../library/functions.rst:2125 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 " @@ -3582,14 +3583,14 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:2129 +#: ../../library/functions.rst:2130 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:2133 +#: ../../library/functions.rst:2134 msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" @@ -3597,14 +3598,14 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -#: ../../library/functions.rst:2136 +#: ../../library/functions.rst:2137 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:2140 +#: ../../library/functions.rst:2141 msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" @@ -3612,37 +3613,37 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../library/functions.rst:2143 +#: ../../library/functions.rst:2144 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:2161 +#: ../../library/functions.rst:2162 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:2165 +#: ../../library/functions.rst:2166 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:2169 +#: ../../library/functions.rst:2170 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:2172 +#: ../../library/functions.rst:2173 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:2174 +#: ../../library/functions.rst:2175 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 " @@ -3651,13 +3652,13 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:2180 +#: ../../library/functions.rst:2181 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2183 +#: ../../library/functions.rst:2184 msgid "" ">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" @@ -3675,17 +3676,17 @@ msgstr "" ">>> x == list(x2) and y == list(y2)\n" "True" -#: ../../library/functions.rst:2191 +#: ../../library/functions.rst:2192 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2203 +#: ../../library/functions.rst:2204 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2206 +#: ../../library/functions.rst:2207 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3697,7 +3698,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2215 +#: ../../library/functions.rst:2216 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3707,7 +3708,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2222 +#: ../../library/functions.rst:2223 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3716,7 +3717,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2228 +#: ../../library/functions.rst:2229 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 " @@ -3724,37 +3725,37 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2233 +#: ../../library/functions.rst:2234 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2236 +#: ../../library/functions.rst:2237 msgid "spam = __import__('spam', globals(), locals(), [], 0)" msgstr "spam = __import__('spam', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2238 +#: ../../library/functions.rst:2239 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2240 +#: ../../library/functions.rst:2241 msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2242 +#: ../../library/functions.rst:2243 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:2245 +#: ../../library/functions.rst:2246 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2248 +#: ../../library/functions.rst:2249 msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" @@ -3764,36 +3765,36 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -#: ../../library/functions.rst:2252 +#: ../../library/functions.rst:2253 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:2256 +#: ../../library/functions.rst:2257 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2259 +#: ../../library/functions.rst:2260 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2263 +#: ../../library/functions.rst:2264 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:2268 +#: ../../library/functions.rst:2269 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2269 +#: ../../library/functions.rst:2270 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 " @@ -3806,7 +3807,7 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:154 ../../library/functions.rst:2036 +#: ../../library/functions.rst:154 ../../library/functions.rst:2037 msgid "type" msgstr "type(型別)" @@ -3818,95 +3819,95 @@ msgstr "built-in function(內建函式)" msgid "exec" msgstr "exec" -#: ../../library/functions.rst:735 +#: ../../library/functions.rst:736 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:735 +#: ../../library/functions.rst:736 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:803 +#: ../../library/functions.rst:804 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:803 ../../library/functions.rst:1913 +#: ../../library/functions.rst:804 ../../library/functions.rst:1914 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:803 +#: ../../library/functions.rst:804 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1313 +#: ../../library/functions.rst:1314 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1313 ../../library/functions.rst:1434 +#: ../../library/functions.rst:1314 ../../library/functions.rst:1435 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1341 +#: ../../library/functions.rst:1342 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1341 +#: ../../library/functions.rst:1342 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1435 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "line-buffered I/O" msgstr "line-buffered I/O(行緩衝 I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1495 ../../library/functions.rst:2197 +#: ../../library/functions.rst:1496 ../../library/functions.rst:2198 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1913 +#: ../../library/functions.rst:1914 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2037 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/getpass.po b/library/getpass.po index 19177262cd..d36a12a06e 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -28,7 +28,7 @@ msgid "**Source code:** :source:`Lib/getpass.py`" msgstr "**原始碼:**\\ :source:`Lib/getpass.py`" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/grp.po b/library/grp.po index 4d5f800f8f..fc6efba553 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -29,10 +29,8 @@ msgid "" msgstr "" #: ../../library/grp.rst:13 -#, fuzzy -msgid "" -":ref:`Availability `: Unix, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/grp.rst:15 msgid "" @@ -145,6 +143,11 @@ msgstr ":mod:`pwd` 模組" msgid "An interface to the user database, similar to this." msgstr "" +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Unix, not WASI, not Android, not iOS." +#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + #~ msgid "Module :mod:`spwd`" #~ msgstr ":mod:`spwd` 模組" diff --git a/library/http.client.po b/library/http.client.po index a3bb30106b..2cab236de9 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/http.server.po b/library/http.server.po index 5a706bd1c1..554034bc93 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/imaplib.po b/library/imaplib.po index ecc2eaa302..9be63a2ec0 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 02d7d7e1c8..0064d10e54 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -161,43 +161,81 @@ msgid "" "`requirements`." msgstr "" -#: ../../library/importlib.metadata.rst:104 +#: ../../library/importlib.metadata.rst:105 +msgid "" +"Subclass of :class:`ModuleNotFoundError` raised by several functions in this " +"module when queried for a distribution package which is not installed in the " +"current Python environment." +msgstr "" + +#: ../../library/importlib.metadata.rst:111 msgid "Functional API" msgstr "" -#: ../../library/importlib.metadata.rst:106 +#: ../../library/importlib.metadata.rst:113 msgid "This package provides the following functionality via its public API." msgstr "" -#: ../../library/importlib.metadata.rst:112 +#: ../../library/importlib.metadata.rst:119 msgid "Entry points" msgstr "" -#: ../../library/importlib.metadata.rst:114 +#: ../../library/importlib.metadata.rst:123 +msgid "" +"Returns a :class:`EntryPoints` instance describing entry points for the " +"current environment. Any given keyword parameters are passed to the :meth:`!" +"select` method for comparison to the attributes of the individual entry " +"point definitions." +msgstr "" + +#: ../../library/importlib.metadata.rst:128 +msgid "" +"Note: it is not currently possible to query for entry points based on their :" +"attr:`!EntryPoint.dist` attribute (as different :class:`!Distribution` " +"instances do not currently compare equal, even if they have the same " +"attributes)" +msgstr "" + +#: ../../library/importlib.metadata.rst:134 +msgid "Details of a collection of installed entry points." +msgstr "" + +#: ../../library/importlib.metadata.rst:136 +msgid "" +"Also provides a ``.groups`` attribute that reports all identifed entry point " +"groups, and a ``.names`` attribute that reports all identified entry point " +"names." +msgstr "" + +#: ../../library/importlib.metadata.rst:142 +msgid "Details of an installed entry point." +msgstr "" + +#: ../../library/importlib.metadata.rst:144 msgid "" -"The ``entry_points()`` function returns a collection of entry points. Entry " -"points are represented by ``EntryPoint`` instances; each ``EntryPoint`` has " -"a ``.name``, ``.group``, and ``.value`` attributes and a ``.load()`` method " -"to resolve the value. There are also ``.module``, ``.attr``, and ``." -"extras`` attributes for getting the components of the ``.value`` attribute." +"Each :class:`!EntryPoint` instance has ``.name``, ``.group``, and ``.value`` " +"attributes and a ``.load()`` method to resolve the value. There are also ``." +"module``, ``.attr``, and ``.extras`` attributes for getting the components " +"of the ``.value`` attribute, and ``.dist`` for obtaining information " +"regarding the distribution package that provides the entry point." msgstr "" -#: ../../library/importlib.metadata.rst:121 +#: ../../library/importlib.metadata.rst:150 msgid "Query all entry points::" msgstr "" -#: ../../library/importlib.metadata.rst:123 +#: ../../library/importlib.metadata.rst:152 msgid ">>> eps = entry_points() " msgstr ">>> eps = entry_points() " -#: ../../library/importlib.metadata.rst:125 +#: ../../library/importlib.metadata.rst:154 msgid "" -"The ``entry_points()`` function returns an ``EntryPoints`` object, a " -"collection of all ``EntryPoint`` objects with ``names`` and ``groups`` " +"The :func:`!entry_points` function returns a :class:`!EntryPoints` object, a " +"collection of all :class:`!EntryPoint` objects with ``names`` and ``groups`` " "attributes for convenience::" msgstr "" -#: ../../library/importlib.metadata.rst:129 +#: ../../library/importlib.metadata.rst:158 msgid "" ">>> sorted(eps.groups) \n" "['console_scripts', 'distutils.commands', 'distutils.setup_keywords', " @@ -207,32 +245,33 @@ msgstr "" "['console_scripts', 'distutils.commands', 'distutils.setup_keywords', " "'egg_info.writers', 'setuptools.installation']" -#: ../../library/importlib.metadata.rst:132 +#: ../../library/importlib.metadata.rst:161 msgid "" -"``EntryPoints`` has a ``select`` method to select entry points matching " -"specific properties. Select entry points in the ``console_scripts`` group::" +":class:`!EntryPoints` has a :meth:`!select` method to select entry points " +"matching specific properties. Select entry points in the ``console_scripts`` " +"group::" msgstr "" -#: ../../library/importlib.metadata.rst:136 +#: ../../library/importlib.metadata.rst:165 msgid ">>> scripts = eps.select(group='console_scripts') " msgstr ">>> scripts = eps.select(group='console_scripts') " -#: ../../library/importlib.metadata.rst:138 +#: ../../library/importlib.metadata.rst:167 msgid "" -"Equivalently, since ``entry_points`` passes keyword arguments through to " -"select::" +"Equivalently, since :func:`!entry_points` passes keyword arguments through " +"to select::" msgstr "" -#: ../../library/importlib.metadata.rst:141 +#: ../../library/importlib.metadata.rst:170 msgid ">>> scripts = entry_points(group='console_scripts') " msgstr ">>> scripts = entry_points(group='console_scripts') " -#: ../../library/importlib.metadata.rst:143 +#: ../../library/importlib.metadata.rst:172 msgid "" "Pick out a specific script named \"wheel\" (found in the wheel project)::" msgstr "" -#: ../../library/importlib.metadata.rst:145 +#: ../../library/importlib.metadata.rst:174 msgid "" ">>> 'wheel' in scripts.names \n" "True\n" @@ -242,11 +281,11 @@ msgstr "" "True\n" ">>> wheel = scripts['wheel'] " -#: ../../library/importlib.metadata.rst:149 +#: ../../library/importlib.metadata.rst:178 msgid "Equivalently, query for that entry point during selection::" msgstr "" -#: ../../library/importlib.metadata.rst:151 +#: ../../library/importlib.metadata.rst:180 msgid "" ">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" ">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " @@ -254,11 +293,11 @@ msgstr "" ">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" ">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " -#: ../../library/importlib.metadata.rst:154 +#: ../../library/importlib.metadata.rst:183 msgid "Inspect the resolved entry point::" msgstr "" -#: ../../library/importlib.metadata.rst:156 +#: ../../library/importlib.metadata.rst:185 msgid "" ">>> wheel \n" "EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')\n" @@ -284,7 +323,7 @@ msgstr "" ">>> main \n" "" -#: ../../library/importlib.metadata.rst:168 +#: ../../library/importlib.metadata.rst:197 msgid "" "The ``group`` and ``name`` are arbitrary values defined by the package " "author and usually a client will wish to resolve all entry points for a " @@ -293,7 +332,7 @@ msgid "" "their definition, and usage." msgstr "" -#: ../../library/importlib.metadata.rst:174 +#: ../../library/importlib.metadata.rst:203 msgid "" "The \"selectable\" entry points were introduced in ``importlib_metadata`` " "3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted no " @@ -303,35 +342,66 @@ msgid "" "entry_points_selectable` for compatibility options." msgstr "" -#: ../../library/importlib.metadata.rst:183 +#: ../../library/importlib.metadata.rst:212 msgid "" "``EntryPoint`` objects no longer present a tuple-like interface (:meth:" "`~object.__getitem__`)." msgstr "" -#: ../../library/importlib.metadata.rst:190 +#: ../../library/importlib.metadata.rst:219 msgid "Distribution metadata" msgstr "" -#: ../../library/importlib.metadata.rst:192 +#: ../../library/importlib.metadata.rst:223 +msgid "" +"Return the distribution metadata corresponding to the named distribution " +"package as a :class:`PackageMetadata` instance." +msgstr "" + +#: ../../library/importlib.metadata.rst:226 +#: ../../library/importlib.metadata.rst:274 +#: ../../library/importlib.metadata.rst:295 +#: ../../library/importlib.metadata.rst:358 +#: ../../library/importlib.metadata.rst:409 +msgid "" +"Raises :exc:`PackageNotFoundError` if the named distribution package is not " +"installed in the current Python environment." +msgstr "" + +#: ../../library/importlib.metadata.rst:231 +msgid "A concrete implementation of the" +msgstr "" + +#: ../../library/importlib.metadata.rst:232 +msgid "" +"`PackageMetadata protocol `_." +msgstr "" + +#: ../../library/importlib.metadata.rst:234 +msgid "" +"In addition to providing the defined protocol methods and attributes, " +"subscripting the instance is equivalent to calling the :meth:`!get` method." +msgstr "" + +#: ../../library/importlib.metadata.rst:237 msgid "" "Every `Distribution Package `_ includes some metadata, which you can extract " -"using the ``metadata()`` function::" +"using the :func:`!metadata` function::" msgstr "" -#: ../../library/importlib.metadata.rst:196 +#: ../../library/importlib.metadata.rst:240 msgid ">>> wheel_metadata = metadata('wheel') " msgstr ">>> wheel_metadata = metadata('wheel') " -#: ../../library/importlib.metadata.rst:198 +#: ../../library/importlib.metadata.rst:242 msgid "" -"The keys of the returned data structure, a ``PackageMetadata``, name the " -"metadata keywords, and the values are returned unparsed from the " -"distribution metadata::" +"The keys of the returned data structure name the metadata keywords, and the " +"values are returned unparsed from the distribution metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:202 +#: ../../library/importlib.metadata.rst:245 msgid "" ">>> wheel_metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" @@ -339,13 +409,13 @@ msgstr "" ">>> wheel_metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" -#: ../../library/importlib.metadata.rst:205 +#: ../../library/importlib.metadata.rst:248 msgid "" -"``PackageMetadata`` also presents a ``json`` attribute that returns all the " -"metadata in a JSON-compatible form per :PEP:`566`::" +":class:`PackageMetadata` also presents a :attr:`!json` attribute that " +"returns all the metadata in a JSON-compatible form per :PEP:`566`::" msgstr "" -#: ../../library/importlib.metadata.rst:208 +#: ../../library/importlib.metadata.rst:251 msgid "" ">>> wheel_metadata.json['requires_python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" @@ -353,36 +423,42 @@ msgstr "" ">>> wheel_metadata.json['requires_python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" -#: ../../library/importlib.metadata.rst:213 +#: ../../library/importlib.metadata.rst:254 +#: ../../library/importlib.metadata.rst:452 msgid "" -"The actual type of the object returned by ``metadata()`` is an " -"implementation detail and should be accessed only through the interface " -"described by the `PackageMetadata protocol `_." +"The full set of available metadata is not described here. See the PyPA `Core " +"metadata specification `_ for additional details." msgstr "" -#: ../../library/importlib.metadata.rst:218 +#: ../../library/importlib.metadata.rst:257 msgid "" "The ``Description`` is now included in the metadata when presented through " "the payload. Line continuation characters have been removed." msgstr "" -#: ../../library/importlib.metadata.rst:222 +#: ../../library/importlib.metadata.rst:261 msgid "The ``json`` attribute was added." msgstr "新增 ``json`` 屬性。" -#: ../../library/importlib.metadata.rst:228 +#: ../../library/importlib.metadata.rst:267 msgid "Distribution versions" msgstr "" -#: ../../library/importlib.metadata.rst:230 +#: ../../library/importlib.metadata.rst:271 msgid "" -"The ``version()`` function is the quickest way to get a `Distribution " +"Return the installed distribution package version for the named distribution " +"package." +msgstr "" + +#: ../../library/importlib.metadata.rst:277 +msgid "" +"The :func:`!version` function is the quickest way to get a `Distribution " "Package `_'s version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:234 +#: ../../library/importlib.metadata.rst:281 msgid "" ">>> version('wheel') \n" "'0.32.3'" @@ -390,22 +466,38 @@ msgstr "" ">>> version('wheel') \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:241 +#: ../../library/importlib.metadata.rst:288 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:243 +#: ../../library/importlib.metadata.rst:292 +msgid "" +"Return the full set of files contained within the named distribution package." +msgstr "" + +#: ../../library/importlib.metadata.rst:298 msgid "" -"You can also get the full set of files contained within a distribution. The " -"``files()`` function takes a `Distribution Package `_ name and returns all of " -"the files installed by this distribution. Each file object returned is a " -"``PackagePath``, a :class:`pathlib.PurePath` derived object with additional " -"``dist``, ``size``, and ``hash`` properties as indicated by the metadata. " -"For example::" +"Returns :const:`None` if the distribution is found but the installation " +"database records reporting the files associated with the distribuion package " +"are missing." msgstr "" -#: ../../library/importlib.metadata.rst:250 +#: ../../library/importlib.metadata.rst:304 +msgid "" +"A :class:`pathlib.PurePath` derived object with additional ``dist``, " +"``size``, and ``hash`` properties corresponding to the distribution " +"package's installation metadata for that file." +msgstr "" + +#: ../../library/importlib.metadata.rst:308 +msgid "" +"The :func:`!files` function takes a `Distribution Package `_ name and returns " +"all of the files installed by this distribution. Each file is reported as a :" +"class:`PackagePath` instance. For example::" +msgstr "" + +#: ../../library/importlib.metadata.rst:313 msgid "" ">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0] \n" ">>> util \n" @@ -427,11 +519,11 @@ msgstr "" ">>> util.hash \n" "" -#: ../../library/importlib.metadata.rst:260 +#: ../../library/importlib.metadata.rst:323 msgid "Once you have the file, you can also read its contents::" msgstr "" -#: ../../library/importlib.metadata.rst:262 +#: ../../library/importlib.metadata.rst:325 msgid "" ">>> print(util.read_text()) \n" "import base64\n" @@ -451,13 +543,13 @@ msgstr "" " return s.encode('utf-8')\n" " return s" -#: ../../library/importlib.metadata.rst:271 +#: ../../library/importlib.metadata.rst:334 msgid "" -"You can also use the ``locate`` method to get a the absolute path to the " +"You can also use the :meth:`!locate` method to get the absolute path to the " "file::" msgstr "" -#: ../../library/importlib.metadata.rst:274 +#: ../../library/importlib.metadata.rst:337 msgid "" ">>> util.locate() \n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" @@ -465,28 +557,33 @@ msgstr "" ">>> util.locate() \n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" -#: ../../library/importlib.metadata.rst:277 +#: ../../library/importlib.metadata.rst:340 msgid "" -"In the case where the metadata file listing files (RECORD or SOURCES.txt) is " -"missing, ``files()`` will return ``None``. The caller may wish to wrap calls " -"to ``files()`` in `always_iterable `_ or otherwise guard against " -"this condition if the target distribution is not known to have the metadata " -"present." +"In the case where the metadata file listing files (``RECORD`` or ``SOURCES." +"txt``) is missing, :func:`!files` will return :const:`None`. The caller may " +"wish to wrap calls to :func:`!files` in `always_iterable `_ or otherwise guard against this condition if the target " +"distribution is not known to have the metadata present." msgstr "" -#: ../../library/importlib.metadata.rst:288 +#: ../../library/importlib.metadata.rst:351 msgid "Distribution requirements" msgstr "" -#: ../../library/importlib.metadata.rst:290 +#: ../../library/importlib.metadata.rst:355 +msgid "" +"Return the declared dependency specifiers for the named distribution package." +msgstr "" + +#: ../../library/importlib.metadata.rst:361 msgid "" "To get the full set of requirements for a `Distribution Package `_, use " -"the ``requires()`` function::" +"the :func:`!requires` function::" msgstr "" -#: ../../library/importlib.metadata.rst:294 +#: ../../library/importlib.metadata.rst:365 msgid "" ">>> requires('wheel') \n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" @@ -494,11 +591,25 @@ msgstr "" ">>> requires('wheel') \n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" -#: ../../library/importlib.metadata.rst:302 +#: ../../library/importlib.metadata.rst:373 msgid "Mapping import to distribution packages" msgstr "" -#: ../../library/importlib.metadata.rst:304 +#: ../../library/importlib.metadata.rst:377 +msgid "" +"Return a mapping from the top level module and import package names found " +"via :attr:`sys.meta_path` to the names of the distribution packages (if any) " +"that provide the corresponding files." +msgstr "" + +#: ../../library/importlib.metadata.rst:381 +msgid "" +"To allow for namespace packages (which may have members provided by multiple " +"distribution packages), each top level import name maps to a list of " +"distribution names rather than mapping directly to a single name." +msgstr "" + +#: ../../library/importlib.metadata.rst:385 msgid "" "A convenience method to resolve the `Distribution Package `_ name (or names, " @@ -507,7 +618,7 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: ../../library/importlib.metadata.rst:309 +#: ../../library/importlib.metadata.rst:390 msgid "" ">>> packages_distributions()\n" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " @@ -517,41 +628,63 @@ msgstr "" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " "['jaraco.classes', 'jaraco.functools'], ...}" -#: ../../library/importlib.metadata.rst:312 +#: ../../library/importlib.metadata.rst:393 msgid "" "Some editable installs, `do not supply top-level names `_, and thus this function is not " "reliable with such installs." msgstr "" -#: ../../library/importlib.metadata.rst:321 +#: ../../library/importlib.metadata.rst:402 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:323 +#: ../../library/importlib.metadata.rst:406 msgid "" -"While the above API is the most common and convenient usage, you can get all " -"of that information from the ``Distribution`` class. A ``Distribution`` is " -"an abstract object that represents the metadata for a Python `Distribution " -"Package `_. You can get the ``Distribution`` instance::" +"Return a :class:`Distribution` instance describing the named distribution " +"package." +msgstr "" + +#: ../../library/importlib.metadata.rst:414 +msgid "Details of an installed distribution package." +msgstr "" + +#: ../../library/importlib.metadata.rst:416 +msgid "" +"Note: different :class:`!Distribution` instances do not currently compare " +"equal, even if they relate to the same installed distribution and " +"accordingly have the same attributes." +msgstr "" + +#: ../../library/importlib.metadata.rst:420 +msgid "" +"While the module level API described above is the most common and convenient " +"usage, you can get all of that information from the :class:`!Distribution` " +"class. :class:`!Distribution` is an abstract object that represents the " +"metadata for a Python `Distribution Package `_. You can get the concreate :" +"class:`!Distribution` subclass instance for an installed distribution " +"package by calling the :func:`distribution` function::" msgstr "" -#: ../../library/importlib.metadata.rst:329 +#: ../../library/importlib.metadata.rst:427 +#, fuzzy msgid "" ">>> from importlib.metadata import distribution \n" -">>> dist = distribution('wheel') " +">>> dist = distribution('wheel') \n" +">>> type(dist) \n" +"" msgstr "" ">>> from importlib.metadata import distribution \n" ">>> dist = distribution('wheel') " -#: ../../library/importlib.metadata.rst:332 +#: ../../library/importlib.metadata.rst:432 msgid "" -"Thus, an alternative way to get the version number is through the " -"``Distribution`` instance::" +"Thus, an alternative way to get the version number is through the :class:`!" +"Distribution` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:335 +#: ../../library/importlib.metadata.rst:435 msgid "" ">>> dist.version \n" "'0.32.3'" @@ -559,13 +692,13 @@ msgstr "" ">>> dist.version \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:338 +#: ../../library/importlib.metadata.rst:438 msgid "" -"There are all kinds of additional metadata available on the ``Distribution`` " -"instance::" +"There are all kinds of additional metadata available on :class:`!" +"Distribution` instances::" msgstr "" -#: ../../library/importlib.metadata.rst:341 +#: ../../library/importlib.metadata.rst:441 msgid "" ">>> dist.metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'\n" @@ -577,35 +710,28 @@ msgstr "" ">>> dist.metadata['License'] \n" "'MIT'" -#: ../../library/importlib.metadata.rst:346 +#: ../../library/importlib.metadata.rst:446 msgid "" "For editable packages, an ``origin`` property may present :pep:`610` " "metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:349 +#: ../../library/importlib.metadata.rst:449 msgid "" ">>> dist.origin.url\n" "'file:///path/to/wheel-0.32.3.editable-py3-none-any.whl'" msgstr "" -#: ../../library/importlib.metadata.rst:352 -msgid "" -"The full set of available metadata is not described here. See the `Core " -"metadata specifications `_ for additional details." -msgstr "" - -#: ../../library/importlib.metadata.rst:355 +#: ../../library/importlib.metadata.rst:455 #, fuzzy msgid "The ``.origin`` property was added." msgstr "新增 ``json`` 屬性。" -#: ../../library/importlib.metadata.rst:359 +#: ../../library/importlib.metadata.rst:459 msgid "Distribution Discovery" msgstr "" -#: ../../library/importlib.metadata.rst:361 +#: ../../library/importlib.metadata.rst:461 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package `_ metadata is not available through :" @@ -640,14 +766,14 @@ msgid "" "on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:380 +#: ../../library/importlib.metadata.rst:480 msgid "" "By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: ../../library/importlib.metadata.rst:385 +#: ../../library/importlib.metadata.rst:485 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -657,7 +783,7 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:393 +#: ../../library/importlib.metadata.rst:493 msgid "" "@abc.abstractmethod\n" "def find_distributions(context=DistributionFinder.Context()):\n" @@ -666,14 +792,14 @@ msgid "" " \"\"\"" msgstr "" -#: ../../library/importlib.metadata.rst:399 +#: ../../library/importlib.metadata.rst:499 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:403 +#: ../../library/importlib.metadata.rst:503 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " @@ -682,17 +808,17 @@ msgid "" "method." msgstr "" -#: ../../library/importlib.metadata.rst:410 +#: ../../library/importlib.metadata.rst:510 msgid "Example" msgstr "" -#: ../../library/importlib.metadata.rst:412 +#: ../../library/importlib.metadata.rst:512 msgid "" "Consider for example a custom finder that loads Python modules from a " "database::" msgstr "" -#: ../../library/importlib.metadata.rst:415 +#: ../../library/importlib.metadata.rst:515 msgid "" "class DatabaseImporter(importlib.abc.MetaPathFinder):\n" " def __init__(self, db):\n" @@ -704,14 +830,14 @@ msgid "" "sys.meta_path.append(DatabaseImporter(connect_db(...)))" msgstr "" -#: ../../library/importlib.metadata.rst:424 +#: ../../library/importlib.metadata.rst:524 msgid "" "That importer now presumably provides importable modules from a database, " "but it provides no metadata or entry points. For this custom importer to " "provide metadata, it would also need to implement ``DistributionFinder``::" msgstr "" -#: ../../library/importlib.metadata.rst:429 +#: ../../library/importlib.metadata.rst:529 msgid "" "from importlib.metadata import DistributionFinder\n" "\n" @@ -724,7 +850,7 @@ msgid "" " yield DatabaseDistribution(dist_record)" msgstr "" -#: ../../library/importlib.metadata.rst:439 +#: ../../library/importlib.metadata.rst:539 msgid "" "In this way, ``query_distributions`` would return records for each " "distribution served by the database matching the query. For example, if " @@ -733,7 +859,7 @@ msgid "" "``Context(name=None)``." msgstr "" -#: ../../library/importlib.metadata.rst:445 +#: ../../library/importlib.metadata.rst:545 msgid "" "For the sake of simplicity, this example ignores ``context.path``\\. The " "``path`` attribute defaults to ``sys.path`` and is the set of import paths " @@ -746,11 +872,11 @@ msgid "" "``context.path`` and only yield ``Distribution``\\ s pertinent to that path." msgstr "" -#: ../../library/importlib.metadata.rst:456 +#: ../../library/importlib.metadata.rst:556 msgid "``DatabaseDistribution``, then, would look something like::" msgstr "" -#: ../../library/importlib.metadata.rst:458 +#: ../../library/importlib.metadata.rst:558 msgid "" "class DatabaseDistribution(importlib.metadata.Distributon):\n" " def __init__(self, record):\n" @@ -773,14 +899,14 @@ msgid "" " raise RuntimeError(\"This distribution has no file system\")" msgstr "" -#: ../../library/importlib.metadata.rst:478 +#: ../../library/importlib.metadata.rst:578 msgid "" "This basic implementation should provide metadata and entry points for " "packages served by the ``DatabaseImporter``, assuming that the ``record`` " "supplies suitable ``.name``, ``.version``, and ``.entry_points`` attributes." msgstr "" -#: ../../library/importlib.metadata.rst:483 +#: ../../library/importlib.metadata.rst:583 msgid "" "The ``DatabaseDistribution`` may also provide other metadata files, like " "``RECORD`` (required for ``Distribution.files``) or override the " diff --git a/library/importlib.po b/library/importlib.po index 21e83d7803..8d69ebe9cb 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -422,11 +422,11 @@ msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. If this is a top-level import, *path* will be ``None``. " "Otherwise, this is a search for a subpackage or module and *path* will be " -"the value of :attr:`__path__` from the parent package. If a spec cannot be " -"found, ``None`` is returned. When passed in, ``target`` is a module object " -"that the finder may use to make a more educated guess about what spec to " -"return. :func:`importlib.util.spec_from_loader` may be useful for " -"implementing concrete ``MetaPathFinders``." +"the value of :attr:`~module.__path__` from the parent package. If a spec " +"cannot be found, ``None`` is returned. When passed in, ``target`` is a " +"module object that the finder may use to make a more educated guess about " +"what spec to return. :func:`importlib.util.spec_from_loader` may be useful " +"for implementing concrete ``MetaPathFinders``." msgstr "" #: ../../library/importlib.rst:263 @@ -530,81 +530,48 @@ msgid "" msgstr "" #: ../../library/importlib.rst:358 -msgid ":attr:`__name__`" +#, fuzzy +msgid ":attr:`module.__name__`" msgstr ":attr:`__name__`" #: ../../library/importlib.rst:359 -msgid "" -"The module's fully qualified name. It is ``'__main__'`` for an executed " -"module." -msgstr "" - -#: ../../library/importlib.rst:362 -msgid ":attr:`__file__`" +#, fuzzy +msgid ":attr:`module.__file__`" msgstr ":attr:`__file__`" -#: ../../library/importlib.rst:363 -msgid "" -"The location the :term:`loader` used to load the module. For example, for " -"modules loaded from a .py file this is the filename. It is not set on all " -"modules (e.g. built-in modules)." -msgstr "" - -#: ../../library/importlib.rst:367 -msgid ":attr:`__cached__`" -msgstr ":attr:`__cached__`" +#: ../../library/importlib.rst:360 +#, fuzzy +msgid ":attr:`module.__cached__` *(deprecated)*" +msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:368 -msgid "" -"The filename of a compiled version of the module's code. It is not set on " -"all modules (e.g. built-in modules)." -msgstr "" - -#: ../../library/importlib.rst:371 -msgid ":attr:`__path__`" +#: ../../library/importlib.rst:361 +#, fuzzy +msgid ":attr:`module.__path__`" msgstr ":attr:`__path__`" -#: ../../library/importlib.rst:372 -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 :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 "" - -#: ../../library/importlib.rst:379 -msgid ":attr:`__package__`" -msgstr ":attr:`__package__`" - -#: ../../library/importlib.rst:380 -msgid "" -"The fully qualified name of the package the module is in (or the empty " -"string for a top-level module). If the module is a package then this is the " -"same as :attr:`__name__`." -msgstr "" - -#: ../../library/importlib.rst:384 -msgid ":attr:`__loader__`" -msgstr ":attr:`__loader__`" +#: ../../library/importlib.rst:362 +#, fuzzy +msgid ":attr:`module.__package__` *(deprecated)*" +msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:385 -msgid "The :term:`loader` used to load the module." -msgstr "" +#: ../../library/importlib.rst:363 +#, fuzzy +msgid ":attr:`module.__loader__` *(deprecated)*" +msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:387 +#: ../../library/importlib.rst:365 msgid "" "When :meth:`exec_module` is available then backwards-compatible " "functionality is provided." msgstr "" -#: ../../library/importlib.rst:390 +#: ../../library/importlib.rst:368 msgid "" "Raise :exc:`ImportError` when called instead of :exc:`NotImplementedError`. " "Functionality provided when :meth:`exec_module` is available." msgstr "" -#: ../../library/importlib.rst:395 +#: ../../library/importlib.rst:373 msgid "" "The recommended API for loading a module is :meth:`exec_module` (and :meth:" "`create_module`). Loaders should implement it instead of :meth:" @@ -613,56 +580,56 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:405 +#: ../../library/importlib.rst:383 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loading arbitrary resources from the storage back-end." msgstr "" -#: ../../library/importlib.rst:409 +#: ../../library/importlib.rst:387 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" "class:`importlib.resources.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:415 +#: ../../library/importlib.rst:393 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " "data can implement this abstract method to give direct access to the data " "stored. :exc:`OSError` is to be raised if the *path* cannot be found. The " -"*path* is expected to be constructed using a module's :attr:`__file__` " -"attribute or an item from a package's :attr:`__path__`." +"*path* is expected to be constructed using a module's :attr:`~module." +"__file__` attribute or an item from a package's :attr:`~module.__path__`." msgstr "" -#: ../../library/importlib.rst:423 +#: ../../library/importlib.rst:402 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:429 +#: ../../library/importlib.rst:408 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:434 +#: ../../library/importlib.rst:413 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:440 +#: ../../library/importlib.rst:419 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:446 +#: ../../library/importlib.rst:425 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:451 +#: ../../library/importlib.rst:430 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -671,23 +638,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:457 ../../library/importlib.rst:466 -#: ../../library/importlib.rst:516 +#: ../../library/importlib.rst:436 ../../library/importlib.rst:445 +#: ../../library/importlib.rst:495 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:462 +#: ../../library/importlib.rst:441 msgid "" "An optional method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:471 +#: ../../library/importlib.rst:450 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:473 +#: ../../library/importlib.rst:452 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -695,106 +662,107 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:478 +#: ../../library/importlib.rst:457 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:483 +#: ../../library/importlib.rst:462 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:488 +#: ../../library/importlib.rst:467 msgid "Implementation of :meth:`Loader.exec_module`." msgstr ":meth:`Loader.exec_module` 的實作。" -#: ../../library/importlib.rst:494 +#: ../../library/importlib.rst:473 msgid "Implementation of :meth:`Loader.load_module`." msgstr ":meth:`Loader.load_module` 的實作。" -#: ../../library/importlib.rst:496 +#: ../../library/importlib.rst:475 msgid "use :meth:`exec_module` instead." msgstr "請改用 :meth:`exec_module`。" -#: ../../library/importlib.rst:502 +#: ../../library/importlib.rst:481 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:508 +#: ../../library/importlib.rst:487 msgid "" -"An abstract method that is to return the value of :attr:`__file__` for the " -"specified module. If no path is available, :exc:`ImportError` is raised." +"An abstract method that is to return the value of :attr:`~module.__file__` " +"for the specified module. If no path is available, :exc:`ImportError` is " +"raised." msgstr "" -#: ../../library/importlib.rst:512 +#: ../../library/importlib.rst:491 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:501 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:526 +#: ../../library/importlib.rst:505 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:533 +#: ../../library/importlib.rst:512 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:537 +#: ../../library/importlib.rst:516 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:541 +#: ../../library/importlib.rst:520 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:543 +#: ../../library/importlib.rst:522 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 +#: ../../library/importlib.rst:527 ../../library/importlib.rst:1122 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:552 +#: ../../library/importlib.rst:531 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:557 +#: ../../library/importlib.rst:536 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:561 +#: ../../library/importlib.rst:540 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:562 +#: ../../library/importlib.rst:541 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:542 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:566 +#: ../../library/importlib.rst:545 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -806,83 +774,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:577 +#: ../../library/importlib.rst:556 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:580 +#: ../../library/importlib.rst:559 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:582 +#: ../../library/importlib.rst:561 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:584 +#: ../../library/importlib.rst:563 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:589 ../../library/importlib.rst:602 +#: ../../library/importlib.rst:568 ../../library/importlib.rst:581 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:594 +#: ../../library/importlib.rst:573 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:597 +#: ../../library/importlib.rst:576 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:607 +#: ../../library/importlib.rst:586 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:611 +#: ../../library/importlib.rst:590 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:615 +#: ../../library/importlib.rst:594 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:620 +#: ../../library/importlib.rst:599 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:624 +#: ../../library/importlib.rst:603 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:630 +#: ../../library/importlib.rst:609 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:632 +#: ../../library/importlib.rst:611 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:637 +#: ../../library/importlib.rst:616 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:641 +#: ../../library/importlib.rst:620 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -891,16 +859,16 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:650 +#: ../../library/importlib.rst:629 msgid "*Superseded by TraversableResources*" msgstr "" -#: ../../library/importlib.rst:652 +#: ../../library/importlib.rst:631 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:655 +#: ../../library/importlib.rst:634 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -910,7 +878,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:663 +#: ../../library/importlib.rst:642 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -922,7 +890,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:674 +#: ../../library/importlib.rst:653 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -931,37 +899,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:683 ../../library/importlib.rst:793 +#: ../../library/importlib.rst:662 ../../library/importlib.rst:772 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.rst:688 +#: ../../library/importlib.rst:667 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:670 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:675 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:698 +#: ../../library/importlib.rst:677 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:703 +#: ../../library/importlib.rst:682 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:687 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -969,7 +937,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:714 +#: ../../library/importlib.rst:693 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -978,71 +946,71 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:722 +#: ../../library/importlib.rst:701 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:706 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.rst:730 +#: ../../library/importlib.rst:709 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.rst:735 +#: ../../library/importlib.rst:714 msgid "Use :class:`importlib.resources.abc.Traversable` instead." msgstr "" -#: ../../library/importlib.rst:740 +#: ../../library/importlib.rst:719 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:744 +#: ../../library/importlib.rst:723 msgid "Yield ``Traversable`` objects in ``self``." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:727 msgid "Return ``True`` if ``self`` is a directory." msgstr "" -#: ../../library/importlib.rst:752 +#: ../../library/importlib.rst:731 msgid "Return ``True`` if ``self`` is a file." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:735 msgid "Return Traversable child in ``self``." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:739 msgid "Return ``Traversable`` child in ``self``." msgstr "" -#: ../../library/importlib.rst:764 +#: ../../library/importlib.rst:743 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.rst:767 +#: ../../library/importlib.rst:746 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:772 +#: ../../library/importlib.rst:751 msgid "Read contents of ``self`` as bytes." msgstr "" -#: ../../library/importlib.rst:776 +#: ../../library/importlib.rst:755 msgid "Read contents of ``self`` as text." msgstr "" -#: ../../library/importlib.rst:781 +#: ../../library/importlib.rst:760 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -1052,71 +1020,71 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:788 +#: ../../library/importlib.rst:767 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:798 +#: ../../library/importlib.rst:777 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:783 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:809 +#: ../../library/importlib.rst:788 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:792 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:797 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:825 +#: ../../library/importlib.rst:804 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 +#: ../../library/importlib.rst:809 ../../library/importlib.rst:819 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:835 +#: ../../library/importlib.rst:814 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:845 +#: ../../library/importlib.rst:824 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:850 +#: ../../library/importlib.rst:829 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:855 +#: ../../library/importlib.rst:834 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:862 +#: ../../library/importlib.rst:841 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1125,57 +1093,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:852 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 -#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 +#: ../../library/importlib.rst:857 ../../library/importlib.rst:871 +#: ../../library/importlib.rst:884 ../../library/importlib.rst:899 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:860 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:888 +#: ../../library/importlib.rst:867 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:874 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:902 +#: ../../library/importlib.rst:881 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:910 +#: ../../library/importlib.rst:889 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:917 +#: ../../library/importlib.rst:896 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:904 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1189,43 +1157,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:939 +#: ../../library/importlib.rst:918 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:946 +#: ../../library/importlib.rst:925 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:930 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:954 +#: ../../library/importlib.rst:933 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:961 +#: ../../library/importlib.rst:940 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:943 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:967 +#: ../../library/importlib.rst:946 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1233,7 +1201,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:972 +#: ../../library/importlib.rst:951 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1246,166 +1214,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:986 +#: ../../library/importlib.rst:965 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:990 +#: ../../library/importlib.rst:969 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:975 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1000 +#: ../../library/importlib.rst:979 msgid "" "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 "" -#: ../../library/importlib.rst:1005 +#: ../../library/importlib.rst:984 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1011 +#: ../../library/importlib.rst:990 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1019 +#: ../../library/importlib.rst:998 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1023 +#: ../../library/importlib.rst:1002 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1027 +#: ../../library/importlib.rst:1006 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1031 +#: ../../library/importlib.rst:1010 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1014 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 +#: ../../library/importlib.rst:1018 ../../library/importlib.rst:1061 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 +#: ../../library/importlib.rst:1023 ../../library/importlib.rst:1066 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1049 +#: ../../library/importlib.rst:1028 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1031 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1061 +#: ../../library/importlib.rst:1040 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1065 +#: ../../library/importlib.rst:1044 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1048 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1073 +#: ../../library/importlib.rst:1052 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1056 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1092 +#: ../../library/importlib.rst:1071 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1095 +#: ../../library/importlib.rst:1074 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1098 +#: ../../library/importlib.rst:1077 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1104 +#: ../../library/importlib.rst:1083 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1109 ../../library/importlib.rst:1293 +#: ../../library/importlib.rst:1088 ../../library/importlib.rst:1274 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1092 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1117 +#: ../../library/importlib.rst:1096 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1124 +#: ../../library/importlib.rst:1103 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1109 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1135 +#: ../../library/importlib.rst:1114 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1139 +#: ../../library/importlib.rst:1118 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1150 +#: ../../library/importlib.rst:1129 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1155 +#: ../../library/importlib.rst:1134 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1423,88 +1391,90 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1168 +#: ../../library/importlib.rst:1147 msgid "" "A specification for a module's import-system-related state. This is " -"typically exposed as the module's :attr:`__spec__` attribute. Many of these " -"attributes are also available directly on a module: for example, ``module." -"__spec__.origin == module.__file__``. Note, however, that while the " -"*values* are usually equivalent, they can differ since there is no " +"typically exposed as the module's :attr:`~module.__spec__` attribute. Many " +"of these attributes are also available directly on a module: for example, " +"``module.__spec__.origin == module.__file__``. Note, however, that while " +"the *values* are usually equivalent, they can differ since there is no " "synchronization between the two objects. For example, it is possible to " -"update the module's :attr:`__file__` at runtime and this will not be " -"automatically reflected in the module's :attr:`__spec__.origin`, and vice " -"versa." +"update the module's :attr:`~module.__file__` at runtime and this will not be " +"automatically reflected in the module's :attr:`__spec__.origin `, and vice versa." msgstr "" -#: ../../library/importlib.rst:1181 +#: ../../library/importlib.rst:1161 msgid "" -"The module's fully qualified name (see :attr:`__name__` attributes on " -"modules). The :term:`finder` should always set this attribute to a non-empty " -"string." +"The module's fully qualified name (see :attr:`module.__name__`). The :term:" +"`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1187 +#: ../../library/importlib.rst:1166 msgid "" -"The :term:`loader` used to load the module (see :attr:`__loader__` " -"attributes on modules). The :term:`finder` should always set this attribute." +"The :term:`loader` used to load the module (see :attr:`module.__loader__`). " +"The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1171 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" -"`__file__` attributes on modules). For example, for modules loaded from a ." -"py file this is the filename. The :term:`finder` should always set this " -"attribute to a meaningful value for the :term:`loader` to use. In the " -"uncommon case that there is not one (like for namespace packages), it should " -"be set to ``None``." +"`module.__file__`). For example, for modules loaded from a ``.py`` file this " +"is the filename. The :term:`finder` should always set this attribute to a " +"meaningful value for the :term:`loader` to use. In the uncommon case that " +"there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1202 +#: ../../library/importlib.rst:1180 msgid "" -"The list of locations where the package's submodules will be found (see :" -"attr:`__path__` attributes on modules). Most of the time this is a single " -"directory. The :term:`finder` should set this attribute to a list, even an " -"empty one, to indicate to the import system that the module is a package. " -"It should be set to ``None`` for non-package modules. It is set " -"automatically later to a special object for namespace packages." +"A (possibly empty) :term:`sequence` of strings enumerating the locations in " +"which a package's submodules will be found (see :attr:`module.__path__`). " +"Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1212 +#: ../../library/importlib.rst:1185 +msgid "" +"The :term:`finder` should set this attribute to a sequence, even an empty " +"one, to indicate to the import system that the module is a package. It " +"should be set to ``None`` for non-package modules. It is set automatically " +"later to a special object for namespace packages." +msgstr "" + +#: ../../library/importlib.rst:1193 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1218 +#: ../../library/importlib.rst:1199 msgid "" -"The filename of a compiled version of the module's code (see :attr:" -"`__cached__` attributes on modules). The :term:`finder` should always set " -"this attribute but it may be ``None`` for modules that do not need compiled " -"code stored." +"The filename of a compiled version of the module's code (see :attr:`module." +"__cached__`). The :term:`finder` should always set this attribute but it may " +"be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1225 +#: ../../library/importlib.rst:1206 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " -"empty string for a top-level module). See :attr:`__package__` attributes on " -"modules. If the module is a package then this is the same as :attr:`name`." +"empty string for a top-level module). See :attr:`module.__package__`. If the " +"module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1232 +#: ../../library/importlib.rst:1213 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " -"``False`` otherwise. This value impacts how :attr:`origin` is interpreted " -"and how the module's :attr:`__file__` is populated." +"``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " +"and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1239 +#: ../../library/importlib.rst:1220 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1242 +#: ../../library/importlib.rst:1223 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1513,7 +1483,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1248 +#: ../../library/importlib.rst:1229 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1527,7 +1497,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1259 +#: ../../library/importlib.rst:1240 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1543,7 +1513,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1273 +#: ../../library/importlib.rst:1254 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1552,7 +1522,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1279 +#: ../../library/importlib.rst:1260 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1563,35 +1533,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1289 -msgid ":ref:`Availability `: iOS." +#: ../../library/importlib.rst:1270 +msgid "Availability" msgstr "" -#: ../../library/importlib.rst:1297 +#: ../../library/importlib.rst:1278 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1301 +#: ../../library/importlib.rst:1282 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1307 +#: ../../library/importlib.rst:1288 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1311 +#: ../../library/importlib.rst:1292 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1316 +#: ../../library/importlib.rst:1297 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1323 +#: ../../library/importlib.rst:1304 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1601,7 +1571,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1330 +#: ../../library/importlib.rst:1311 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1614,7 +1584,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1321 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1623,18 +1593,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1348 +#: ../../library/importlib.rst:1329 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1352 ../../library/importlib.rst:1368 -#: ../../library/importlib.rst:1457 +#: ../../library/importlib.rst:1333 ../../library/importlib.rst:1349 +#: ../../library/importlib.rst:1438 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1358 +#: ../../library/importlib.rst:1339 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1644,25 +1614,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1373 +#: ../../library/importlib.rst:1354 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1381 +#: ../../library/importlib.rst:1362 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1383 +#: ../../library/importlib.rst:1364 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1388 +#: ../../library/importlib.rst:1369 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1670,13 +1640,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1396 +#: ../../library/importlib.rst:1377 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1403 +#: ../../library/importlib.rst:1384 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1686,30 +1656,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1410 +#: ../../library/importlib.rst:1391 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1394 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1417 +#: ../../library/importlib.rst:1398 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " -"**package** is in fact not a package (i.e. lacks a :attr:`__path__` " +"**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1424 +#: ../../library/importlib.rst:1405 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1427 +#: ../../library/importlib.rst:1408 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1717,14 +1687,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1432 +#: ../../library/importlib.rst:1413 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1440 +#: ../../library/importlib.rst:1421 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1733,7 +1703,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1450 +#: ../../library/importlib.rst:1431 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1741,14 +1711,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1462 +#: ../../library/importlib.rst:1443 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1470 +#: ../../library/importlib.rst:1451 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1757,33 +1727,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1477 +#: ../../library/importlib.rst:1458 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1481 +#: ../../library/importlib.rst:1462 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1486 +#: ../../library/importlib.rst:1467 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1494 +#: ../../library/importlib.rst:1475 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1497 +#: ../../library/importlib.rst:1478 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1796,7 +1766,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1508 +#: ../../library/importlib.rst:1489 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1805,21 +1775,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1516 +#: ../../library/importlib.rst:1497 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1523 +#: ../../library/importlib.rst:1504 msgid "" "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 "" -#: ../../library/importlib.rst:1528 +#: ../../library/importlib.rst:1509 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1831,20 +1801,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1536 +#: ../../library/importlib.rst:1517 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1539 +#: ../../library/importlib.rst:1520 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1541 +#: ../../library/importlib.rst:1522 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1544 +#: ../../library/importlib.rst:1525 msgid "" "import importlib\n" "\n" @@ -1854,23 +1824,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1550 +#: ../../library/importlib.rst:1531 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1552 +#: ../../library/importlib.rst:1533 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1555 +#: ../../library/importlib.rst:1536 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1559 +#: ../../library/importlib.rst:1540 msgid "" "import importlib.util\n" "import sys\n" @@ -1890,11 +1860,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1578 +#: ../../library/importlib.rst:1559 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1580 +#: ../../library/importlib.rst:1561 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1904,13 +1874,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1587 +#: ../../library/importlib.rst:1568 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1589 +#: ../../library/importlib.rst:1570 msgid "" "import importlib.util\n" "import sys\n" @@ -1933,15 +1903,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1611 +#: ../../library/importlib.rst:1592 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1613 +#: ../../library/importlib.rst:1594 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1615 +#: ../../library/importlib.rst:1596 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1961,11 +1931,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1634 +#: ../../library/importlib.rst:1615 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1636 +#: ../../library/importlib.rst:1617 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1979,7 +1949,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1647 +#: ../../library/importlib.rst:1628 msgid "" "import importlib.machinery\n" "import sys\n" @@ -2003,11 +1973,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1668 +#: ../../library/importlib.rst:1649 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1670 +#: ../../library/importlib.rst:1651 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -2015,7 +1985,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1676 +#: ../../library/importlib.rst:1657 msgid "" "import importlib.util\n" "import sys\n" @@ -2048,28 +2018,28 @@ msgid "" " return module" msgstr "" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:422 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:422 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" +#~ msgid ":attr:`__cached__`" +#~ msgstr ":attr:`__cached__`" + +#~ msgid ":attr:`__package__`" +#~ msgstr ":attr:`__package__`" + +#~ msgid ":attr:`__loader__`" +#~ msgstr ":attr:`__loader__`" + #~ msgid "(:attr:`__name__`)" #~ msgstr "(:attr:`__name__`)" -#~ msgid "(:attr:`__loader__`)" -#~ msgstr "(:attr:`__loader__`)" - #~ msgid "(:attr:`__file__`)" #~ msgstr "(:attr:`__file__`)" #~ msgid "(:attr:`__path__`)" #~ msgstr "(:attr:`__path__`)" - -#~ msgid "(:attr:`__cached__`)" -#~ msgstr "(:attr:`__cached__`)" - -#~ msgid "(:attr:`__package__`)" -#~ msgstr "(:attr:`__package__`)" diff --git a/library/itertools.po b/library/itertools.po index cd3e78c8ca..44026ccfba 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,6 +259,11 @@ msgstr "iterable[, key]" msgid "sub-iterators grouped by value of key(v)" msgstr "根據 key(v) 的值分組的子疊代器" +#: ../../library/itertools.rst:61 +#, fuzzy +msgid "``groupby(['A','B','DEF'], len) → (1, A B) (3, DEF)``" +msgstr "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" + #: ../../library/itertools.rst:62 msgid ":func:`islice`" msgstr ":func:`islice`" @@ -428,10 +433,11 @@ msgid "Itertool Functions" msgstr "Itertool 函式" #: ../../library/itertools.rst:96 +#, fuzzy msgid "" -"The following module functions all construct and return iterators. Some " -"provide streams of infinite length, so they should only be accessed by " -"functions or loops that truncate the stream." +"The following functions all construct and return iterators. Some provide " +"streams of infinite length, so they should only be accessed by functions or " +"loops that truncate the stream." msgstr "" "以下的模組函式都會建構並回傳疊代器。一些函式提供無限長度的串流 (stream),因此" "應僅由截斷串流的函式或迴圈來存取它們。" @@ -458,11 +464,11 @@ msgstr "" "如果提供了 *initial* 值,則累積將從該值開始,並且輸出的元素數將比輸入的可疊代" "物件多一個。" -#: ../../library/itertools.rst:113 ../../library/itertools.rst:185 -#: ../../library/itertools.rst:244 ../../library/itertools.rst:287 -#: ../../library/itertools.rst:484 ../../library/itertools.rst:515 -#: ../../library/itertools.rst:550 ../../library/itertools.rst:623 -#: ../../library/itertools.rst:684 ../../library/itertools.rst:726 +#: ../../library/itertools.rst:113 ../../library/itertools.rst:186 +#: ../../library/itertools.rst:245 ../../library/itertools.rst:288 +#: ../../library/itertools.rst:489 ../../library/itertools.rst:524 +#: ../../library/itertools.rst:561 ../../library/itertools.rst:637 +#: ../../library/itertools.rst:698 ../../library/itertools.rst:779 msgid "Roughly equivalent to::" msgstr "大致等價於: ::" @@ -489,19 +495,20 @@ msgid "" msgstr "" #: ../../library/itertools.rst:134 +#, fuzzy msgid "" -"The *function* argument can be set to :func:`min` for a running minimum, :" -"func:`max` for a running maximum, or :func:`operator.mul` for a running " -"product. `Amortization tables `_ can be built by accumulating interest and applying " -"payments:" +"To compute a running minimum, set *function* to :func:`min`. For a running " +"maximum, set *function* to :func:`max`. Or for a running product, set " +"*function* to :func:`operator.mul`. To build an `amortization table `_, accumulate the " +"interest and apply payments:" msgstr "" "*function* 引數可以被設定為 :func:`min` 以得到連續的最小值,設定為 :func:" "`max` 以得到連續的最大值,或者設定為 :func:`operator.mul` 以得到連續的乘積。" "也可以透過累積利息和付款來建立\\ `攤銷表 (Amortization tables) `_ :" -#: ../../library/itertools.rst:140 +#: ../../library/itertools.rst:141 msgid "" ">>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8]\n" ">>> list(accumulate(data, max)) # running maximum\n" @@ -515,35 +522,35 @@ msgid "" "[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 497]" msgstr "" -#: ../../library/itertools.rst:153 +#: ../../library/itertools.rst:154 msgid "" "See :func:`functools.reduce` for a similar function that returns only the " "final accumulated value." msgstr "" "可參見 :func:`functools.reduce`,其是個類似的函式,但僅回傳最終的累積值。" -#: ../../library/itertools.rst:158 +#: ../../library/itertools.rst:159 msgid "Added the optional *function* parameter." msgstr "新增可選的 *function* 參數。" -#: ../../library/itertools.rst:161 +#: ../../library/itertools.rst:162 msgid "Added the optional *initial* parameter." msgstr "新增可選的 *initial* 參數。" -#: ../../library/itertools.rst:167 +#: ../../library/itertools.rst:168 msgid "" "Batch data from the *iterable* into tuples of length *n*. The last batch may " "be shorter than *n*." msgstr "" "將來自 *iterable* 的資料分批為長度為 *n* 的元組。最後一個批次可能比 *n* 短。" -#: ../../library/itertools.rst:170 +#: ../../library/itertools.rst:171 msgid "" "If *strict* is true, will raise a :exc:`ValueError` if the final batch is " "shorter than *n*." msgstr "" -#: ../../library/itertools.rst:173 +#: ../../library/itertools.rst:174 msgid "" "Loops over the input iterable and accumulates data into tuples up to size " "*n*. The input is consumed lazily, just enough to fill a batch. The result " @@ -554,7 +561,7 @@ msgstr "" "消耗 (consumed lazily) 的,會剛好足夠填充一批的資料。一旦批次填滿或輸入的可疊" "代物件耗盡,就會 yield 出結果:" -#: ../../library/itertools.rst:178 +#: ../../library/itertools.rst:179 msgid "" ">>> flattened_data = ['roses', 'red', 'violets', 'blue', 'sugar', 'sweet']\n" ">>> unflattened = list(batched(flattened_data, 2))\n" @@ -566,7 +573,7 @@ msgstr "" ">>> unflattened\n" "[('roses', 'red'), ('violets', 'blue'), ('sugar', 'sweet')]" -#: ../../library/itertools.rst:187 +#: ../../library/itertools.rst:188 #, fuzzy msgid "" "def batched(iterable, n, *, strict=False):\n" @@ -587,22 +594,23 @@ msgstr "" " while batch := tuple(islice(iterator, n)):\n" " yield batch" -#: ../../library/itertools.rst:199 +#: ../../library/itertools.rst:200 msgid "Added the *strict* option." msgstr "" -#: ../../library/itertools.rst:205 +#: ../../library/itertools.rst:206 +#, fuzzy msgid "" "Make an iterator that returns elements from the first iterable until it is " "exhausted, then proceeds to the next iterable, until all of the iterables " -"are exhausted. Used for treating consecutive sequences as a single " -"sequence. Roughly equivalent to::" +"are exhausted. This combines multiple data sources into a single iterator. " +"Roughly equivalent to::" msgstr "" "建立一個疊代器,從第一個可疊代物件回傳元素直到其耗盡,然後繼續處理下一個可疊" "代物件,直到所有可疊代物件都耗盡。用於將連續的序列做為單一序列處理。大致等價" "於: ::" -#: ../../library/itertools.rst:210 +#: ../../library/itertools.rst:211 msgid "" "def chain(*iterables):\n" " # chain('ABC', 'DEF') → A B C D E F\n" @@ -610,7 +618,7 @@ msgid "" " yield from iterable" msgstr "" -#: ../../library/itertools.rst:218 +#: ../../library/itertools.rst:219 msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" @@ -618,7 +626,7 @@ msgstr "" ":func:`chain` 的另一個建構函式。從單個可疊代的引數中得到鏈接的輸入,該引數是" "惰性計算的。大致等價於:" -#: ../../library/itertools.rst:221 +#: ../../library/itertools.rst:222 msgid "" "def from_iterable(iterables):\n" " # chain.from_iterable(['ABC', 'DEF']) → A B C D E F\n" @@ -630,11 +638,11 @@ msgstr "" " for iterable in iterables:\n" " yield from iterable" -#: ../../library/itertools.rst:229 +#: ../../library/itertools.rst:230 msgid "Return *r* length subsequences of elements from the input *iterable*." msgstr "從輸入 *iterable* 中回傳長度為 *r* 的元素的子序列。" -#: ../../library/itertools.rst:231 +#: ../../library/itertools.rst:232 msgid "" "The output is a subsequence of :func:`product` keeping only entries that are " "subsequences of the *iterable*. The length of the output is given by :func:" @@ -645,7 +653,7 @@ msgstr "" "度由 :func:`math.comb` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / r! / (n - r)!" "``,當 ``r > n`` 時為零。" -#: ../../library/itertools.rst:236 +#: ../../library/itertools.rst:237 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the output " @@ -654,7 +662,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:240 +#: ../../library/itertools.rst:241 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within " @@ -663,7 +671,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則每" "個組合內將不會有重複的值。" -#: ../../library/itertools.rst:246 +#: ../../library/itertools.rst:247 msgid "" "def combinations(iterable, r):\n" " # combinations('ABCD', 2) → AB AC AD BC BD CD\n" @@ -688,14 +696,14 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:271 +#: ../../library/itertools.rst:272 msgid "" "Return *r* length subsequences of elements from the input *iterable* " "allowing individual elements to be repeated more than once." msgstr "" "回傳來自輸入 *iterable* 的長度為 *r* 的子序列,且允許個別元素重複多次。" -#: ../../library/itertools.rst:274 +#: ../../library/itertools.rst:275 msgid "" "The output is a subsequence of :func:`product` that keeps only entries that " "are subsequences (with possible repeated elements) of the *iterable*. The " @@ -706,7 +714,7 @@ msgstr "" "複元素)的條目。當 ``n > 0`` 時,回傳的子序列數量為 ``(n + r - 1)! / r! / (n " "- 1)!``。" -#: ../../library/itertools.rst:279 +#: ../../library/itertools.rst:280 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. if the input *iterable* is sorted, the output " @@ -715,7 +723,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:283 +#: ../../library/itertools.rst:284 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, the generated combinations will also be " @@ -724,7 +732,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,生成" "的組合也將是獨特的。" -#: ../../library/itertools.rst:289 +#: ../../library/itertools.rst:290 msgid "" "def combinations_with_replacement(iterable, r):\n" " # combinations_with_replacement('ABC', 2) → AA AB AC BB BC CC\n" @@ -746,7 +754,7 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:313 +#: ../../library/itertools.rst:314 msgid "" "Make an iterator that returns elements from *data* where the corresponding " "element in *selectors* is true. Stops when either the *data* or *selectors* " @@ -755,14 +763,14 @@ msgstr "" "建立一個疊代器,回傳 *data* 中對應 *selectors* 的元素為 true 的元素。當 " "*data* 或 *selectors* 可疊代物件耗盡時停止。大致等價於: ::" -#: ../../library/itertools.rst:318 +#: ../../library/itertools.rst:319 msgid "" "def compress(data, selectors):\n" " # compress('ABCDEF', [1,0,1,0,1,1]) → A C E F\n" " return (datum for datum, selector in zip(data, selectors) if selector)" msgstr "" -#: ../../library/itertools.rst:327 +#: ../../library/itertools.rst:328 msgid "" "Make an iterator that returns evenly spaced values beginning with *start*. " "Can be used with :func:`map` to generate consecutive data points or with :" @@ -771,7 +779,7 @@ msgstr "" "建立一個疊代器,回傳從 *start* 開始的等差的值。可以與 :func:`map` 一起使用來" "產生連續的資料點,或與 :func:`zip` 一起使用來增加序列號。大致等價於: ::" -#: ../../library/itertools.rst:332 +#: ../../library/itertools.rst:333 msgid "" "def count(start=0, step=1):\n" " # count(10) → 10 11 12 13 14 ...\n" @@ -789,7 +797,7 @@ msgstr "" " yield n\n" " n += step" -#: ../../library/itertools.rst:340 +#: ../../library/itertools.rst:341 msgid "" "When counting with floating-point numbers, better accuracy can sometimes be " "achieved by substituting multiplicative code such as: ``(start + step * i " @@ -798,11 +806,11 @@ msgstr "" "當用浮點數計數時,將上述程式碼替換為乘法有時可以獲得更好的精確度,例如:" "``(start + step * i for i in count())``。" -#: ../../library/itertools.rst:344 +#: ../../library/itertools.rst:345 msgid "Added *step* argument and allowed non-integer arguments." msgstr "新增 *step* 引數並允許非整數引數。" -#: ../../library/itertools.rst:350 +#: ../../library/itertools.rst:351 msgid "" "Make an iterator returning elements from the *iterable* and saving a copy of " "each. When the iterable is exhausted, return elements from the saved copy. " @@ -811,14 +819,17 @@ msgstr "" "建立一個疊代器,回傳 *iterable* 中的元素並保存每個元素的副本。當可疊代物件耗" "盡時,從保存的副本中回傳元素。會無限次的重複。大致等價於: ::" -#: ../../library/itertools.rst:354 +#: ../../library/itertools.rst:355 +#, fuzzy msgid "" "def cycle(iterable):\n" " # cycle('ABCD') → A B C D A B C D A B C D ...\n" +"\n" " saved = []\n" " for element in iterable:\n" " yield element\n" " saved.append(element)\n" +"\n" " while saved:\n" " for element in saved:\n" " yield element" @@ -833,13 +844,13 @@ msgstr "" " for element in saved:\n" " yield element" -#: ../../library/itertools.rst:364 +#: ../../library/itertools.rst:367 msgid "" "This itertool may require significant auxiliary storage (depending on the " "length of the iterable)." msgstr "此 itertool 可能需要大量的輔助儲存空間(取決於可疊代物件的長度)。" -#: ../../library/itertools.rst:370 +#: ../../library/itertools.rst:373 msgid "" "Make an iterator that drops elements from the *iterable* while the " "*predicate* is true and afterwards returns every element. Roughly " @@ -848,7 +859,7 @@ msgstr "" "建立一個疊代器,在 *predicate* 為 true 時丟棄 *iterable* 中的元素,之後回傳每" "個元素。大致等價於:" -#: ../../library/itertools.rst:374 +#: ../../library/itertools.rst:377 msgid "" "def dropwhile(predicate, iterable):\n" " # dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8\n" @@ -874,7 +885,7 @@ msgstr "" " for x in iterator:\n" " yield x" -#: ../../library/itertools.rst:386 +#: ../../library/itertools.rst:389 msgid "" "Note this does not produce *any* output until the predicate first becomes " "false, so this itertool may have a lengthy start-up time." @@ -882,7 +893,7 @@ msgstr "" "注意,在 predicate 首次變為 False 之前,這不會產生\\ *任何*\\ 輸出,所以此 " "itertool 可能會有較長的啟動時間。" -#: ../../library/itertools.rst:392 +#: ../../library/itertools.rst:395 msgid "" "Make an iterator that filters elements from the *iterable* returning only " "those for which the *predicate* returns a false value. If *predicate* is " @@ -891,12 +902,15 @@ msgstr "" "建立一個疊代器,過濾 *iterable* 中的元素,僅回傳 *predicate* 為 False 值的元" "素。如果 *predicate* 是 ``None``,則回傳為 False 的項目。大致等價於: ::" -#: ../../library/itertools.rst:397 +#: ../../library/itertools.rst:400 +#, fuzzy msgid "" "def filterfalse(predicate, iterable):\n" " # filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8\n" +"\n" " if predicate is None:\n" " predicate = bool\n" +"\n" " for x in iterable:\n" " if not predicate(x):\n" " yield x" @@ -909,7 +923,7 @@ msgstr "" " if not predicate(x):\n" " yield x" -#: ../../library/itertools.rst:408 +#: ../../library/itertools.rst:413 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -922,7 +936,7 @@ msgstr "" "(identity function),並回傳未被更改的元素。一般來說,可疊代物件需要已經用相同" "的鍵函式進行排序。" -#: ../../library/itertools.rst:414 +#: ../../library/itertools.rst:419 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -935,7 +949,7 @@ msgstr "" "料進行排序)。這種行為不同於 SQL 的 GROUP BY,其無論輸入順序如何都會聚合相同" "的元素。" -#: ../../library/itertools.rst:420 +#: ../../library/itertools.rst:425 msgid "" "The returned group is itself an iterator that shares the underlying iterable " "with :func:`groupby`. Because the source is shared, when the :func:" @@ -946,7 +960,7 @@ msgstr "" "共享的,當 :func:`groupby` 物件前進時,前一個群組將不再可見。因此,如果之後需" "要該資料,應將其儲存為串列: ::" -#: ../../library/itertools.rst:425 +#: ../../library/itertools.rst:430 msgid "" "groups = []\n" "uniquekeys = []\n" @@ -956,11 +970,11 @@ msgid "" " uniquekeys.append(k)" msgstr "" -#: ../../library/itertools.rst:432 +#: ../../library/itertools.rst:437 msgid ":func:`groupby` is roughly equivalent to::" msgstr ":func:`groupby` 大致等價於: ::" -#: ../../library/itertools.rst:434 +#: ../../library/itertools.rst:439 msgid "" "def groupby(iterable, key=None):\n" " # [k for k, g in groupby('AAAABBBCCDAABBB')] → A B C D A B\n" @@ -1026,7 +1040,7 @@ msgstr "" " for _ in curr_group:\n" " pass" -#: ../../library/itertools.rst:470 +#: ../../library/itertools.rst:475 msgid "" "Make an iterator that returns selected elements from the iterable. Works " "like sequence slicing but does not support negative values for *start*, " @@ -1035,7 +1049,7 @@ msgstr "" "建立一個疊代器,回傳從 iterable 中選取的元素。其作用類似於序列切片 (sequence " "slicing),但不支援負數的 *start*、*stop* 或 *step* 的值。" -#: ../../library/itertools.rst:474 +#: ../../library/itertools.rst:479 msgid "" "If *start* is zero or ``None``, iteration starts at zero. Otherwise, " "elements from the iterable are skipped until *start* is reached." @@ -1043,15 +1057,16 @@ msgstr "" "如果 *start* 為零或 ``None``,則從零開始疊代。否則在達到 *start* 之前,會跳" "過 iterable 中的元素。" -#: ../../library/itertools.rst:477 +#: ../../library/itertools.rst:482 +#, fuzzy msgid "" -"If *stop* is ``None``, iteration continues until the iterator is exhausted, " -"if at all. Otherwise, it stops at the specified position." +"If *stop* is ``None``, iteration continues until the input is exhausted, if " +"at all. Otherwise, it stops at the specified position." msgstr "" "如果 *stop* 為 ``None``,則疊代將繼續前進直到疊代器耗盡。如果指定了 *stop*," "則在達到指定位置時停止。" -#: ../../library/itertools.rst:480 +#: ../../library/itertools.rst:485 msgid "" "If *step* is ``None``, the step defaults to one. Elements are returned " "consecutively unless *step* is set higher than one which results in items " @@ -1060,7 +1075,7 @@ msgstr "" "如果 *step* 為 ``None``,則步長 (step) 預設為一。元素會連續回傳,除非將 " "*step* 設定為大於一,這會導致一些項目被跳過。" -#: ../../library/itertools.rst:486 +#: ../../library/itertools.rst:491 msgid "" "def islice(iterable, *args):\n" " # islice('ABCDEFG', 2) → A B\n" @@ -1102,11 +1117,17 @@ msgstr "" " yield element\n" " next_i += step" -#: ../../library/itertools.rst:509 +#: ../../library/itertools.rst:511 +msgid "" +"If the input is an iterator, then fully consuming the *islice* advances the " +"input iterator by ``max(start, stop)`` steps regardless of the *step* value." +msgstr "" + +#: ../../library/itertools.rst:518 msgid "Return successive overlapping pairs taken from the input *iterable*." msgstr "回傳從輸入的 *iterable* 中提取的連續重疊對。" -#: ../../library/itertools.rst:511 +#: ../../library/itertools.rst:520 msgid "" "The number of 2-tuples in the output iterator will be one fewer than the " "number of inputs. It will be empty if the input iterable has fewer than two " @@ -1115,12 +1136,15 @@ msgstr "" "輸出疊代器中的 2 元組數量將比輸入少一個。如果輸入的可疊代物件中的值少於兩個," "則輸出將為空值。" -#: ../../library/itertools.rst:517 +#: ../../library/itertools.rst:526 +#, fuzzy msgid "" "def pairwise(iterable):\n" " # pairwise('ABCDEFG') → AB BC CD DE EF FG\n" +"\n" " iterator = iter(iterable)\n" " a = next(iterator, None)\n" +"\n" " for b in iterator:\n" " yield a, b\n" " a = b" @@ -1133,7 +1157,7 @@ msgstr "" " yield a, b\n" " a = b" -#: ../../library/itertools.rst:530 +#: ../../library/itertools.rst:541 msgid "" "Return successive *r* length `permutations of elements `_ from the *iterable*." @@ -1141,7 +1165,7 @@ msgstr "" "回傳 *iterable* 中連續且長度為 *r* 的\\ `元素排列 `_ 。" -#: ../../library/itertools.rst:533 +#: ../../library/itertools.rst:544 msgid "" "If *r* is not specified or is ``None``, then *r* defaults to the length of " "the *iterable* and all possible full-length permutations are generated." @@ -1149,7 +1173,7 @@ msgstr "" "如果未指定 *r* 或其值為 ``None``,則 *r* 預設為 *iterable* 的長度,並產生所有" "可能的完整長度的排列。" -#: ../../library/itertools.rst:537 +#: ../../library/itertools.rst:548 msgid "" "The output is a subsequence of :func:`product` where entries with repeated " "elements have been filtered out. The length of the output is given by :func:" @@ -1160,7 +1184,7 @@ msgstr "" "func:`math.perm` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / (n - r)!``,當 ``r " "> n`` 時為零。" -#: ../../library/itertools.rst:542 +#: ../../library/itertools.rst:553 msgid "" "The permutation tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the " @@ -1169,7 +1193,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,排列的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:546 +#: ../../library/itertools.rst:557 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within a " @@ -1178,7 +1202,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則排" "列中將不會有重複的值。" -#: ../../library/itertools.rst:552 +#: ../../library/itertools.rst:563 msgid "" "def permutations(iterable, r=None):\n" " # permutations('ABCD', 2) → AB AC AD BA BC BD CA CB CD DA DB DC\n" @@ -1236,11 +1260,13 @@ msgstr "" " else:\n" " return" -#: ../../library/itertools.rst:583 -msgid "Cartesian product of input iterables." -msgstr "輸入的 iterables 的笛卡爾乘積。" +#: ../../library/itertools.rst:594 +msgid "" +"`Cartesian product `_ of " +"the input iterables." +msgstr "" -#: ../../library/itertools.rst:585 +#: ../../library/itertools.rst:597 msgid "" "Roughly equivalent to nested for-loops in a generator expression. For " "example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in " @@ -1249,7 +1275,7 @@ msgstr "" "大致等價於產生器運算式中的巢狀 for 迴圈。例如,``product(A, B)`` 的回傳結果" "與 ``((x,y) for x in A for y in B)`` 相同。" -#: ../../library/itertools.rst:588 +#: ../../library/itertools.rst:600 msgid "" "The nested loops cycle like an odometer with the rightmost element advancing " "on every iteration. This pattern creates a lexicographic ordering so that " @@ -1259,7 +1285,7 @@ msgstr "" "巢狀迴圈的循環類似於里程表,最右邊的元素在每次疊代時前進。這種模式會建立字典" "順序,因此如果輸入的 iterables 已排序,則輸出的乘積元組也將按排序的順序產生。" -#: ../../library/itertools.rst:593 +#: ../../library/itertools.rst:605 msgid "" "To compute the product of an iterable with itself, specify the number of " "repetitions with the optional *repeat* keyword argument. For example, " @@ -1268,7 +1294,7 @@ msgstr "" "要計算可疊代物件自身的乘積,可以使用可選的 *repeat* 關鍵字引數來指定重複次" "數。例如,``product(A, repeat=4)`` 與 ``product(A, A, A, A)`` 相同。" -#: ../../library/itertools.rst:597 +#: ../../library/itertools.rst:609 msgid "" "This function is roughly equivalent to the following code, except that the " "actual implementation does not build up intermediate results in memory::" @@ -1276,12 +1302,15 @@ msgstr "" "此函式大致等價於以下的程式碼,不同之處在於真正的實作不會在記憶體中建立中間結" "果: ::" -#: ../../library/itertools.rst:600 +#: ../../library/itertools.rst:612 +#, fuzzy msgid "" "def product(*iterables, repeat=1):\n" " # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy\n" " # product(range(2), repeat=3) → 000 001 010 011 100 101 110 111\n" "\n" +" if repeat < 0:\n" +" raise ValueError('repeat argument cannot be negative')\n" " pools = [tuple(pool) for pool in iterables] * repeat\n" "\n" " result = [[]]\n" @@ -1304,7 +1333,7 @@ msgstr "" " for prod in result:\n" " yield tuple(prod)" -#: ../../library/itertools.rst:613 +#: ../../library/itertools.rst:627 msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " @@ -1313,7 +1342,7 @@ msgstr "" "在 :func:`product` 執行之前,它會完全消耗輸入的 iterables,並將值的池 (pools " "of values) 保存在記憶體中以產生乘積。因此,它僅對有限的輸入有用。" -#: ../../library/itertools.rst:620 +#: ../../library/itertools.rst:634 msgid "" "Make an iterator that returns *object* over and over again. Runs " "indefinitely unless the *times* argument is specified." @@ -1321,7 +1350,7 @@ msgstr "" "建立一個疊代器,反覆回傳 *object*。除非指定了 *times* 引數,否則會執行無限" "次。" -#: ../../library/itertools.rst:625 +#: ../../library/itertools.rst:639 msgid "" "def repeat(object, times=None):\n" " # repeat(10, 3) → 10 10 10\n" @@ -1341,13 +1370,13 @@ msgstr "" " for i in range(times):\n" " yield object" -#: ../../library/itertools.rst:634 +#: ../../library/itertools.rst:648 msgid "" "A common use for *repeat* is to supply a stream of constant values to *map* " "or *zip*:" msgstr "*repeat* 的常見用途是為 *map* 或 *zip* 提供定值的串流:" -#: ../../library/itertools.rst:637 +#: ../../library/itertools.rst:651 msgid "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" @@ -1355,7 +1384,7 @@ msgstr "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" -#: ../../library/itertools.rst:645 +#: ../../library/itertools.rst:659 msgid "" "Make an iterator that computes the *function* using arguments obtained from " "the *iterable*. Used instead of :func:`map` when argument parameters have " @@ -1364,7 +1393,7 @@ msgstr "" "建立一個疊代器,使用從 *iterable* 獲取的引數計算 *function* 。當引數參數已經" "被「預先壓縮 (pre-zipped)」成元組時,使用此方法代替 :func:`map`。" -#: ../../library/itertools.rst:649 +#: ../../library/itertools.rst:663 msgid "" "The difference between :func:`map` and :func:`starmap` parallels the " "distinction between ``function(a,b)`` and ``function(*c)``. Roughly " @@ -1373,7 +1402,7 @@ msgstr "" ":func:`map` 和 :func:`starmap` 之間的區別類似於 ``function(a,b)`` 和 " "``function(*c)`` 之間的區別。大致等價於:" -#: ../../library/itertools.rst:653 +#: ../../library/itertools.rst:667 msgid "" "def starmap(function, iterable):\n" " # starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000\n" @@ -1385,7 +1414,7 @@ msgstr "" " for args in iterable:\n" " yield function(*args)" -#: ../../library/itertools.rst:661 +#: ../../library/itertools.rst:675 msgid "" "Make an iterator that returns elements from the *iterable* as long as the " "*predicate* is true. Roughly equivalent to::" @@ -1393,7 +1422,7 @@ msgstr "" "建立一個疊代器,只在 *predicate* 為 true 時回傳 *iterable* 中的元素。大致等價" "於:" -#: ../../library/itertools.rst:664 +#: ../../library/itertools.rst:678 msgid "" "def takewhile(predicate, iterable):\n" " # takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4\n" @@ -1409,7 +1438,7 @@ msgstr "" " break\n" " yield x" -#: ../../library/itertools.rst:671 +#: ../../library/itertools.rst:685 msgid "" "Note, the element that first fails the predicate condition is consumed from " "the input iterator and there is no way to access it. This could be an issue " @@ -1424,54 +1453,80 @@ msgstr "" "more-itertools.readthedocs.io/en/stable/api.html#more_itertools." "before_and_after>`_ 作為替代。" -#: ../../library/itertools.rst:682 +#: ../../library/itertools.rst:696 msgid "Return *n* independent iterators from a single iterable." msgstr "從一個 iterable 中回傳 *n* 個獨立的疊代器。" -#: ../../library/itertools.rst:686 +#: ../../library/itertools.rst:700 msgid "" "def tee(iterable, n=2):\n" -" iterator = iter(iterable)\n" -" shared_link = [None, None]\n" -" return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +" if n < 0:\n" +" raise ValueError\n" +" if n == 0:\n" +" return ()\n" +" iterator = _tee(iterable)\n" +" result = [iterator]\n" +" for _ in range(n - 1):\n" +" result.append(_tee(iterator))\n" +" return tuple(result)\n" +"\n" +"class _tee:\n" +"\n" +" def __init__(self, iterable):\n" +" it = iter(iterable)\n" +" if isinstance(it, _tee):\n" +" self.iterator = it.iterator\n" +" self.link = it.link\n" +" else:\n" +" self.iterator = it\n" +" self.link = [None, None]\n" "\n" -"def _tee(iterator, link):\n" -" try:\n" -" while True:\n" -" if link[1] is None:\n" -" link[0] = next(iterator)\n" -" link[1] = [None, None]\n" -" value, link = link\n" -" yield value\n" -" except StopIteration:\n" -" return" -msgstr "" -"def tee(iterable, n=2):\n" -" iterator = iter(iterable)\n" -" shared_link = [None, None]\n" -" return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +" def __iter__(self):\n" +" return self\n" "\n" -"def _tee(iterator, link):\n" -" try:\n" -" while True:\n" -" if link[1] is None:\n" -" link[0] = next(iterator)\n" -" link[1] = [None, None]\n" -" value, link = link\n" -" yield value\n" -" except StopIteration:\n" -" return" +" def __next__(self):\n" +" link = self.link\n" +" if link[1] is None:\n" +" link[0] = next(self.iterator)\n" +" link[1] = [None, None]\n" +" value, self.link = link\n" +" return value" +msgstr "" + +#: ../../library/itertools.rst:733 +msgid "" +"When the input *iterable* is already a tee iterator object, all members of " +"the return tuple are constructed as if they had been produced by the " +"upstream :func:`tee` call. This \"flattening step\" allows nested :func:" +"`tee` calls to share the same underlying data chain and to have a single " +"update step rather than a chain of calls." +msgstr "" + +#: ../../library/itertools.rst:739 +msgid "The flattening property makes tee iterators efficiently peekable:" +msgstr "" + +#: ../../library/itertools.rst:741 +msgid "" +"def lookahead(tee_iterator):\n" +" \"Return the next value without moving the input forward\"\n" +" [forked_iterator] = tee(tee_iterator, 1)\n" +" return next(forked_iterator)" +msgstr "" -#: ../../library/itertools.rst:702 +#: ../../library/itertools.rst:748 msgid "" -"Once a :func:`tee` has been created, the original *iterable* should not be " -"used anywhere else; otherwise, the *iterable* could get advanced without the " -"tee objects being informed." +">>> iterator = iter('abcdef')\n" +">>> [iterator] = tee(iterator, 1) # Make the input peekable\n" +">>> next(iterator) # Move the iterator forward\n" +"'a'\n" +">>> lookahead(iterator) # Check next value\n" +"'b'\n" +">>> next(iterator) # Continue moving forward\n" +"'b'" msgstr "" -"一旦建立了 :func:`tee`,原始的 *iterable* 不應在其他地方使用;否則," -"*iterable* 可能會在 tee 物件未被通知的情況下前進。" -#: ../../library/itertools.rst:706 +#: ../../library/itertools.rst:759 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " "when simultaneously using iterators returned by the same :func:`tee` call, " @@ -1481,7 +1536,7 @@ msgstr "" "呼叫所回傳的疊代器時,即使原始的 *iterable* 是執行緒安全的,也可能引發 :exc:" "`RuntimeError`。" -#: ../../library/itertools.rst:710 +#: ../../library/itertools.rst:763 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -1492,11 +1547,11 @@ msgstr "" "果一個疊代器在另一個疊代器開始之前使用了大部分或全部的資料,使用 :func:" "`list` 會比 :func:`tee` 更快。" -#: ../../library/itertools.rst:718 +#: ../../library/itertools.rst:771 msgid "Make an iterator that aggregates elements from each of the *iterables*." msgstr "建立一個疊代器,聚合來自每個 *iterables* 中的元素。" -#: ../../library/itertools.rst:721 +#: ../../library/itertools.rst:774 msgid "" "If the iterables are of uneven length, missing values are filled-in with " "*fillvalue*. If not specified, *fillvalue* defaults to ``None``." @@ -1504,11 +1559,11 @@ msgstr "" "如果 iterables 的長度不一,則使用 *fillvalue* 填充缺少的值。如果未指定," "*fillvalue* 會預設為 ``None``。" -#: ../../library/itertools.rst:724 +#: ../../library/itertools.rst:777 msgid "Iteration continues until the longest iterable is exhausted." msgstr "疊代將持續直到最長的可疊代物件耗盡為止。" -#: ../../library/itertools.rst:728 +#: ../../library/itertools.rst:781 msgid "" "def zip_longest(*iterables, fillvalue=None):\n" " # zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-\n" @@ -1554,7 +1609,7 @@ msgstr "" " values.append(value)\n" " yield tuple(values)" -#: ../../library/itertools.rst:750 +#: ../../library/itertools.rst:803 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " @@ -1563,18 +1618,18 @@ msgstr "" "如果其中一個 iterables 可能是無限的,那麼應該用別的可以限制呼叫次數的方法來包" "裝 :func:`zip_longest` 函式(例如 :func:`islice` 或 :func:`takewhile`)。" -#: ../../library/itertools.rst:758 +#: ../../library/itertools.rst:811 msgid "Itertools Recipes" msgstr "Itertools 應用技巧" -#: ../../library/itertools.rst:760 +#: ../../library/itertools.rst:813 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" "此段落展示了使用現有的 itertools 作為構建塊來建立擴展工具集的應用技巧。" -#: ../../library/itertools.rst:763 +#: ../../library/itertools.rst:816 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -1592,7 +1647,7 @@ msgstr "" "`collections` 模組一同使用以及與內建 itertools(如 ``map()``、``filter()``、" "``reversed()`` 和 ``enumerate()``)一同使用的模式。" -#: ../../library/itertools.rst:772 +#: ../../library/itertools.rst:825 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " @@ -1604,7 +1659,7 @@ msgstr "" "``sliding_window()``、``iter_index()`` 和 ``sieve()`` 的應用技巧正在被測試," "以確定它們是否有價值被收錄到內建的 itertools 中。" -#: ../../library/itertools.rst:777 +#: ../../library/itertools.rst:830 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the :pypi:`more-itertools` project found on the Python Package Index::" @@ -1612,11 +1667,11 @@ msgstr "" "幾乎所有這些應用技巧以及許多其他應用技巧都可以從 Python Package Index 上的 :" "pypi:`more-itertools` 專案中安裝: ::" -#: ../../library/itertools.rst:781 +#: ../../library/itertools.rst:834 msgid "python -m pip install more-itertools" msgstr "python -m pip install more-itertools" -#: ../../library/itertools.rst:783 +#: ../../library/itertools.rst:836 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -1634,7 +1689,7 @@ msgstr "" "用「向量化 (vectorized)」的構建塊而不是使用會造成直譯器負擔的 for 迴圈和\\ :" "term:`產生器 `,則能保持高速度。" -#: ../../library/itertools.rst:791 +#: ../../library/itertools.rst:844 msgid "" "import collections\n" "import contextlib\n" @@ -1770,16 +1825,6 @@ msgid "" " iterators = cycle(islice(iterators, num_active))\n" " yield from map(next, iterators)\n" "\n" -"def partition(predicate, iterable):\n" -" \"\"\"Partition entries into false entries and true entries.\n" -"\n" -" If *predicate* is slow, consider wrapping it with functools." -"lru_cache().\n" -" \"\"\"\n" -" # partition(is_odd, range(10)) → 0 2 4 6 8 and 1 3 5 7 9\n" -" t1, t2 = tee(iterable)\n" -" return filterfalse(predicate, t1), filter(predicate, t2)\n" -"\n" "def subslices(seq):\n" " \"Return all contiguous non-empty subslices of a sequence.\"\n" " # subslices('ABCD') → A AB ABC ABCD B BC BCD C CD D\n" @@ -1813,11 +1858,11 @@ msgid "" " yield func()" msgstr "" -#: ../../library/itertools.rst:964 +#: ../../library/itertools.rst:1008 msgid "The following recipes have a more mathematical flavor:" msgstr "以下的應用技巧具有更多的數學風格:" -#: ../../library/itertools.rst:966 +#: ../../library/itertools.rst:1010 msgid "" "def powerset(iterable):\n" " \"powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\"\n" @@ -1931,3 +1976,47 @@ msgid "" " n -= n // prime\n" " return n" msgstr "" + +#~ msgid "Cartesian product of input iterables." +#~ msgstr "輸入的 iterables 的笛卡爾乘積。" + +#~ msgid "" +#~ "def tee(iterable, n=2):\n" +#~ " iterator = iter(iterable)\n" +#~ " shared_link = [None, None]\n" +#~ " return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +#~ "\n" +#~ "def _tee(iterator, link):\n" +#~ " try:\n" +#~ " while True:\n" +#~ " if link[1] is None:\n" +#~ " link[0] = next(iterator)\n" +#~ " link[1] = [None, None]\n" +#~ " value, link = link\n" +#~ " yield value\n" +#~ " except StopIteration:\n" +#~ " return" +#~ msgstr "" +#~ "def tee(iterable, n=2):\n" +#~ " iterator = iter(iterable)\n" +#~ " shared_link = [None, None]\n" +#~ " return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +#~ "\n" +#~ "def _tee(iterator, link):\n" +#~ " try:\n" +#~ " while True:\n" +#~ " if link[1] is None:\n" +#~ " link[0] = next(iterator)\n" +#~ " link[1] = [None, None]\n" +#~ " value, link = link\n" +#~ " yield value\n" +#~ " except StopIteration:\n" +#~ " return" + +#~ msgid "" +#~ "Once a :func:`tee` has been created, the original *iterable* should not " +#~ "be used anywhere else; otherwise, the *iterable* could get advanced " +#~ "without the tee objects being informed." +#~ msgstr "" +#~ "一旦建立了 :func:`tee`,原始的 *iterable* 不應在其他地方使用;否則," +#~ "*iterable* 可能會在 tee 物件未被通知的情況下前進。" diff --git a/library/locale.po b/library/locale.po index 2cb4e18ddf..4f50c54eff 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -331,110 +331,111 @@ msgstr "" #: ../../library/locale.rst:161 msgid "" -"Return some locale-specific information as a string. This function is not " -"available on all systems, and the set of possible options might also vary " -"across platforms. The possible argument values are numbers, for which " -"symbolic constants are available in the locale module." +"Return some locale-specific information as a string (or a tuple for " +"``ALT_DIGITS``). This function is not available on all systems, and the set " +"of possible options might also vary across platforms. The possible argument " +"values are numbers, for which symbolic constants are available in the locale " +"module." msgstr "" -#: ../../library/locale.rst:166 +#: ../../library/locale.rst:167 msgid "" "The :func:`nl_langinfo` function accepts one of the following keys. Most " "descriptions are taken from the corresponding description in the GNU C " "library." msgstr "" -#: ../../library/locale.rst:172 +#: ../../library/locale.rst:173 msgid "" "Get a string with the name of the character encoding used in the selected " "locale." msgstr "" -#: ../../library/locale.rst:177 +#: ../../library/locale.rst:178 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent date and time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:182 +#: ../../library/locale.rst:183 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a date in a locale-specific way." msgstr "" -#: ../../library/locale.rst:187 +#: ../../library/locale.rst:188 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:192 +#: ../../library/locale.rst:193 msgid "" "Get a format string for :func:`time.strftime` to represent time in the am/pm " "format." msgstr "" -#: ../../library/locale.rst:203 +#: ../../library/locale.rst:204 msgid "Get the name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:207 +#: ../../library/locale.rst:208 msgid "" "This follows the US convention of :const:`DAY_1` being Sunday, not the " "international convention (ISO 8601) that Monday is the first day of the week." msgstr "" -#: ../../library/locale.rst:219 +#: ../../library/locale.rst:220 msgid "Get the abbreviated name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:234 +#: ../../library/locale.rst:235 msgid "Get the name of the n-th month." msgstr "" -#: ../../library/locale.rst:249 +#: ../../library/locale.rst:250 msgid "Get the abbreviated name of the n-th month." msgstr "" -#: ../../library/locale.rst:253 +#: ../../library/locale.rst:254 msgid "Get the radix character (decimal dot, decimal comma, etc.)." msgstr "" -#: ../../library/locale.rst:257 +#: ../../library/locale.rst:258 msgid "Get the separator character for thousands (groups of three digits)." msgstr "" -#: ../../library/locale.rst:261 +#: ../../library/locale.rst:262 msgid "" "Get a regular expression that can be used with the regex function to " "recognize a positive response to a yes/no question." msgstr "" -#: ../../library/locale.rst:266 +#: ../../library/locale.rst:267 msgid "" "Get a regular expression that can be used with the ``regex(3)`` function to " "recognize a negative response to a yes/no question." msgstr "" -#: ../../library/locale.rst:271 +#: ../../library/locale.rst:272 msgid "" "The regular expressions for :const:`YESEXPR` and :const:`NOEXPR` use syntax " "suitable for the ``regex`` function from the C library, which might differ " "from the syntax used in :mod:`re`." msgstr "" -#: ../../library/locale.rst:278 +#: ../../library/locale.rst:279 msgid "" "Get the currency symbol, preceded by \"-\" if the symbol should appear " "before the value, \"+\" if the symbol should appear after the value, or \"." "\" if the symbol should replace the radix character." msgstr "" -#: ../../library/locale.rst:284 +#: ../../library/locale.rst:285 msgid "Get a string that represents the era used in the current locale." msgstr "" -#: ../../library/locale.rst:286 +#: ../../library/locale.rst:287 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -442,7 +443,7 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:291 +#: ../../library/locale.rst:292 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " @@ -451,28 +452,26 @@ msgid "" "systems." msgstr "" -#: ../../library/locale.rst:299 +#: ../../library/locale.rst:300 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:304 +#: ../../library/locale.rst:305 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:309 +#: ../../library/locale.rst:310 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:314 -msgid "" -"Get a representation of up to 100 values used to represent the values 0 to " -"99." +#: ../../library/locale.rst:315 +msgid "Get a tuple of up to 100 strings used to represent the values 0 to 99." msgstr "" #: ../../library/locale.rst:320 diff --git a/library/logging.config.po b/library/logging.config.po index 018f87b9aa..28e8aa0765 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1085,59 +1085,59 @@ msgstr "" #: ../../library/logging.config.rst:756 msgid "" -"An object implementing the :class:`queue.Queue` public API. For instance, " -"this may be an actual instance of :class:`queue.Queue` or a subclass " -"thereof, or a proxy obtained by :meth:`multiprocessing.managers.SyncManager." -"Queue`." +"An object implementing the :meth:`Queue.put_nowait ` " +"and :meth:`Queue.get ` public API. For instance, this may " +"be an actual instance of :class:`queue.Queue` or a subclass thereof, or a " +"proxy obtained by :meth:`multiprocessing.managers.SyncManager.Queue`." msgstr "" -#: ../../library/logging.config.rst:760 +#: ../../library/logging.config.rst:761 msgid "" "This is of course only possible if you are constructing or modifying the " "configuration dictionary in code." msgstr "" -#: ../../library/logging.config.rst:763 +#: ../../library/logging.config.rst:764 msgid "" "A string that resolves to a callable which, when called with no arguments, " -"returns the :class:`queue.Queue` instance to use. That callable could be a :" -"class:`queue.Queue` subclass or a function which returns a suitable queue " -"instance, such as ``my.module.queue_factory()``." +"returns the queue instance to use. That callable could be a :class:`queue." +"Queue` subclass or a function which returns a suitable queue instance, such " +"as ``my.module.queue_factory()``." msgstr "" -#: ../../library/logging.config.rst:768 +#: ../../library/logging.config.rst:769 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " "construction should be a :class:`queue.Queue` instance." msgstr "" -#: ../../library/logging.config.rst:772 +#: ../../library/logging.config.rst:773 msgid "" "If the ``queue`` key is absent, a standard unbounded :class:`queue.Queue` " "instance is created and used." msgstr "" -#: ../../library/logging.config.rst:775 +#: ../../library/logging.config.rst:776 msgid "" "If the ``listener`` key is present, the corresponding value can be one of " "the following:" msgstr "" -#: ../../library/logging.config.rst:777 +#: ../../library/logging.config.rst:778 msgid "" "A subclass of :class:`logging.handlers.QueueListener`. This is of course " "only possible if you are constructing or modifying the configuration " "dictionary in code." msgstr "" -#: ../../library/logging.config.rst:781 +#: ../../library/logging.config.rst:782 msgid "" "A string which resolves to a class which is a subclass of ``QueueListener``, " "such as ``'my.package.CustomListener'``." msgstr "" -#: ../../library/logging.config.rst:784 +#: ../../library/logging.config.rst:785 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " @@ -1145,31 +1145,31 @@ msgid "" "``QueueListener`` initializer." msgstr "" -#: ../../library/logging.config.rst:788 +#: ../../library/logging.config.rst:789 msgid "" "If the ``listener`` key is absent, :class:`logging.handlers.QueueListener` " "is used." msgstr "" -#: ../../library/logging.config.rst:790 +#: ../../library/logging.config.rst:791 msgid "" "The values under the ``handlers`` key are the names of other handlers in the " "configuration (not shown in the above snippet) which will be passed to the " "queue listener." msgstr "" -#: ../../library/logging.config.rst:794 +#: ../../library/logging.config.rst:795 msgid "" "Any custom queue handler and listener classes will need to be defined with " "the same initialization signatures as :class:`~logging.handlers." "QueueHandler` and :class:`~logging.handlers.QueueListener`." msgstr "" -#: ../../library/logging.config.rst:803 +#: ../../library/logging.config.rst:804 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:805 +#: ../../library/logging.config.rst:806 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -1186,7 +1186,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:820 +#: ../../library/logging.config.rst:821 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, " @@ -1199,11 +1199,11 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:830 +#: ../../library/logging.config.rst:831 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:832 +#: ../../library/logging.config.rst:833 msgid "" "[loggers]\n" "keys=root,log02,log03,log04,log05,log06,log07\n" @@ -1223,13 +1223,13 @@ msgstr "" "[formatters]\n" "keys=form01,form02,form03,form04,form05,form06,form07,form08,form09" -#: ../../library/logging.config.rst:843 +#: ../../library/logging.config.rst:844 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:846 +#: ../../library/logging.config.rst:847 msgid "" "[logger_root]\n" "level=NOTSET\n" @@ -1239,7 +1239,7 @@ msgstr "" "level=NOTSET\n" "handlers=hand01" -#: ../../library/logging.config.rst:852 +#: ../../library/logging.config.rst:853 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 " @@ -1247,7 +1247,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:857 +#: ../../library/logging.config.rst:858 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 " @@ -1255,13 +1255,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:862 +#: ../../library/logging.config.rst:863 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:865 +#: ../../library/logging.config.rst:866 msgid "" "[logger_parser]\n" "level=DEBUG\n" @@ -1275,7 +1275,7 @@ msgstr "" "propagate=1\n" "qualname=compiler.parser" -#: ../../library/logging.config.rst:873 +#: ../../library/logging.config.rst:874 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``, " @@ -1288,13 +1288,13 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:882 +#: ../../library/logging.config.rst:883 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:884 +#: ../../library/logging.config.rst:885 msgid "" "[handler_hand01]\n" "class=StreamHandler\n" @@ -1308,14 +1308,14 @@ msgstr "" "formatter=form01\n" "args=(sys.stdout,)" -#: ../../library/logging.config.rst:892 +#: ../../library/logging.config.rst:893 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:896 +#: ../../library/logging.config.rst:897 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -1323,7 +1323,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:901 +#: ../../library/logging.config.rst:902 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -1332,7 +1332,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:907 +#: ../../library/logging.config.rst:908 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -1340,7 +1340,7 @@ msgid "" "``{}``." msgstr "" -#: ../../library/logging.config.rst:911 +#: ../../library/logging.config.rst:912 msgid "" "[handler_hand02]\n" "class=FileHandler\n" @@ -1448,12 +1448,12 @@ msgstr "" "args=('localhost:9022', '/log', 'GET')\n" "kwargs={'secure': True}" -#: ../../library/logging.config.rst:964 +#: ../../library/logging.config.rst:965 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:966 +#: ../../library/logging.config.rst:967 msgid "" "[formatter_form01]\n" "format=F1 %(asctime)s %(levelname)s %(message)s %(customfield)s\n" @@ -1471,21 +1471,21 @@ msgstr "" "defaults={'customfield': 'defaultvalue'}\n" "class=logging.Formatter" -#: ../../library/logging.config.rst:976 +#: ../../library/logging.config.rst:977 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:980 +#: ../../library/logging.config.rst:981 msgid "" "The ``defaults`` entry, when :ref:`evaluated ` in the context of " "the ``logging`` package's namespace, is a dictionary of default values for " "custom formatting fields. If not provided, it defaults to ``None``." msgstr "" -#: ../../library/logging.config.rst:987 +#: ../../library/logging.config.rst:988 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 " @@ -1494,18 +1494,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:995 +#: ../../library/logging.config.rst:996 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:996 +#: ../../library/logging.config.rst:997 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:998 +#: ../../library/logging.config.rst:999 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:999 +#: ../../library/logging.config.rst:1000 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/mimetypes.po b/library/mimetypes.po index 9b5715f5c0..6271917517 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -353,8 +353,8 @@ msgid "Load MIME type information from the Windows registry." msgstr "" #: ../../library/mimetypes.rst:292 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/mimetypes.rst:11 ../../library/mimetypes.rst:31 #: ../../library/mimetypes.rst:64 @@ -376,3 +376,6 @@ msgstr "file(檔案)" #: ../../library/mimetypes.rst:145 msgid "mime.types" msgstr "mime.types" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" diff --git a/library/mmap.po b/library/mmap.po index b9e77a07cc..bc740afcf1 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 @@ msgid ":mod:`!mmap` --- Memory-mapped file support" msgstr ":mod:`!mmap` --- 記憶體映射檔案的支援" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 3439e54315..831578b13f 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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 @@ msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "**原始碼:**\\ :source:`Lib/multiprocessing/`" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 diff --git a/library/os.path.po b/library/os.path.po index 7480d8c542..6aa3f011f5 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -456,8 +456,8 @@ msgid "" msgstr "" #: ../../library/os.path.rst:348 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/os.path.rst:355 msgid "" @@ -863,3 +863,6 @@ msgstr "% (百分號)" #: ../../library/os.path.rst:184 msgid "environment variables expansion (Windows)" msgstr "environment variables expansion (Windows)(環境變數展開 (Windows))" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" diff --git a/library/os.po b/library/os.po index cd584ddc17..4f0982a091 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -306,20 +306,62 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../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:512 ../../library/os.rst:522 ../../library/os.rst:602 +#: ../../library/os.rst:181 ../../library/os.rst:322 ../../library/os.rst:337 +#: ../../library/os.rst:358 ../../library/os.rst:367 ../../library/os.rst:376 +#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:426 +#: ../../library/os.rst:434 ../../library/os.rst:442 ../../library/os.rst:462 +#: ../../library/os.rst:480 ../../library/os.rst:491 ../../library/os.rst:503 +#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:533 +#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 +#: ../../library/os.rst:593 ../../library/os.rst:602 ../../library/os.rst:639 #: ../../library/os.rst:652 ../../library/os.rst:661 ../../library/os.rst:678 -#: ../../library/os.rst:719 ../../library/os.rst:726 ../../library/os.rst:1139 -#: ../../library/os.rst:1183 ../../library/os.rst:1367 -#: ../../library/os.rst:1393 ../../library/os.rst:1463 -#: ../../library/os.rst:1535 ../../library/os.rst:1662 -#: ../../library/os.rst:1682 ../../library/os.rst:1691 +#: ../../library/os.rst:687 ../../library/os.rst:694 ../../library/os.rst:703 +#: ../../library/os.rst:712 ../../library/os.rst:719 ../../library/os.rst:726 +#: ../../library/os.rst:735 ../../library/os.rst:792 ../../library/os.rst:831 +#: ../../library/os.rst:953 ../../library/os.rst:979 ../../library/os.rst:992 +#: ../../library/os.rst:1009 ../../library/os.rst:1027 +#: ../../library/os.rst:1038 ../../library/os.rst:1061 +#: ../../library/os.rst:1082 ../../library/os.rst:1094 +#: ../../library/os.rst:1105 ../../library/os.rst:1118 +#: ../../library/os.rst:1139 ../../library/os.rst:1160 +#: ../../library/os.rst:1172 ../../library/os.rst:1183 +#: ../../library/os.rst:1244 ../../library/os.rst:1367 +#: ../../library/os.rst:1379 ../../library/os.rst:1393 +#: ../../library/os.rst:1403 ../../library/os.rst:1418 +#: ../../library/os.rst:1433 ../../library/os.rst:1446 +#: ../../library/os.rst:1463 ../../library/os.rst:1489 +#: ../../library/os.rst:1506 ../../library/os.rst:1520 +#: ../../library/os.rst:1535 ../../library/os.rst:1547 +#: ../../library/os.rst:1574 ../../library/os.rst:1586 +#: ../../library/os.rst:1596 ../../library/os.rst:1610 +#: ../../library/os.rst:1662 ../../library/os.rst:1682 +#: ../../library/os.rst:1691 ../../library/os.rst:1703 +#: ../../library/os.rst:1738 ../../library/os.rst:1762 #: ../../library/os.rst:1772 ../../library/os.rst:1780 -#: ../../library/os.rst:1800 ../../library/os.rst:2087 -#: ../../library/os.rst:2221 ../../library/os.rst:2514 -#: ../../library/os.rst:2536 ../../library/os.rst:4330 +#: ../../library/os.rst:1789 ../../library/os.rst:1800 +#: ../../library/os.rst:1837 ../../library/os.rst:1864 +#: ../../library/os.rst:1915 ../../library/os.rst:1921 +#: ../../library/os.rst:2087 ../../library/os.rst:2164 +#: ../../library/os.rst:2181 ../../library/os.rst:2195 +#: ../../library/os.rst:2221 ../../library/os.rst:2239 +#: ../../library/os.rst:2255 ../../library/os.rst:2271 +#: ../../library/os.rst:2334 ../../library/os.rst:2358 +#: ../../library/os.rst:2378 ../../library/os.rst:2514 +#: ../../library/os.rst:2536 ../../library/os.rst:2580 +#: ../../library/os.rst:2592 ../../library/os.rst:2614 +#: ../../library/os.rst:3322 ../../library/os.rst:3456 +#: ../../library/os.rst:3479 ../../library/os.rst:3493 +#: ../../library/os.rst:3712 ../../library/os.rst:3737 +#: ../../library/os.rst:3762 ../../library/os.rst:3816 +#: ../../library/os.rst:3825 ../../library/os.rst:3834 +#: ../../library/os.rst:3842 ../../library/os.rst:3851 +#: ../../library/os.rst:3860 ../../library/os.rst:3932 +#: ../../library/os.rst:3995 ../../library/os.rst:4005 +#: ../../library/os.rst:4023 ../../library/os.rst:4032 +#: ../../library/os.rst:4042 ../../library/os.rst:4052 +#: ../../library/os.rst:4062 ../../library/os.rst:4073 +#: ../../library/os.rst:4218 ../../library/os.rst:4287 +#: ../../library/os.rst:4322 ../../library/os.rst:4330 #: ../../library/os.rst:4337 ../../library/os.rst:4344 #: ../../library/os.rst:4351 ../../library/os.rst:4358 #: ../../library/os.rst:4365 ../../library/os.rst:4372 @@ -327,9 +369,32 @@ msgstr "" #: ../../library/os.rst:4395 ../../library/os.rst:4402 #: ../../library/os.rst:4411 ../../library/os.rst:4419 #: ../../library/os.rst:4427 ../../library/os.rst:4434 -#: ../../library/os.rst:4441 ../../library/os.rst:4564 -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" +#: ../../library/os.rst:4441 ../../library/os.rst:4490 +#: ../../library/os.rst:4517 ../../library/os.rst:4541 +#: ../../library/os.rst:4557 ../../library/os.rst:4564 +#: ../../library/os.rst:4575 ../../library/os.rst:4585 +#: ../../library/os.rst:4594 ../../library/os.rst:4626 +#: ../../library/os.rst:4734 ../../library/os.rst:4750 +#: ../../library/os.rst:4783 ../../library/os.rst:4852 +#: ../../library/os.rst:4871 ../../library/os.rst:4882 +#: ../../library/os.rst:4894 ../../library/os.rst:4939 +#: ../../library/os.rst:4976 ../../library/os.rst:4999 +#: ../../library/os.rst:5020 ../../library/os.rst:5054 +#: ../../library/os.rst:5095 ../../library/os.rst:5115 +#: ../../library/os.rst:5129 ../../library/os.rst:5146 +#: ../../library/os.rst:5161 ../../library/os.rst:5172 +#: ../../library/os.rst:5184 ../../library/os.rst:5197 +#: ../../library/os.rst:5206 ../../library/os.rst:5216 +#: ../../library/os.rst:5229 ../../library/os.rst:5264 +#: ../../library/os.rst:5280 ../../library/os.rst:5291 +#: ../../library/os.rst:5303 ../../library/os.rst:5310 +#: ../../library/os.rst:5319 ../../library/os.rst:5328 +#: ../../library/os.rst:5337 ../../library/os.rst:5346 +#: ../../library/os.rst:5496 ../../library/os.rst:5505 +#: ../../library/os.rst:5529 ../../library/os.rst:5556 +#: ../../library/os.rst:5565 ../../library/os.rst:5688 +msgid "Availability" +msgstr "" #: ../../library/os.rst:186 msgid "" @@ -482,17 +547,6 @@ msgid "" "like to use a different encoding." msgstr "" -#: ../../library/os.rst:322 ../../library/os.rst:1009 ../../library/os.rst:1094 -#: ../../library/os.rst:1105 ../../library/os.rst:1118 -#: ../../library/os.rst:1379 ../../library/os.rst:1703 -#: ../../library/os.rst:1864 ../../library/os.rst:2271 -#: ../../library/os.rst:2614 ../../library/os.rst:3456 -#: ../../library/os.rst:3493 ../../library/os.rst:4322 -#: ../../library/os.rst:4871 ../../library/os.rst:4882 -#: ../../library/os.rst:4999 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/os.rst:327 msgid "" "Return the value of the environment variable *key* as bytes if it exists, or " @@ -508,24 +562,6 @@ msgid "" "``True``." msgstr "" -#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:533 -#: ../../library/os.rst:792 ../../library/os.rst:1027 ../../library/os.rst:1038 -#: ../../library/os.rst:1061 ../../library/os.rst:1082 -#: ../../library/os.rst:1160 ../../library/os.rst:1172 -#: ../../library/os.rst:1403 ../../library/os.rst:1418 -#: ../../library/os.rst:1433 ../../library/os.rst:1446 -#: ../../library/os.rst:1547 ../../library/os.rst:1762 -#: ../../library/os.rst:1789 ../../library/os.rst:1837 -#: ../../library/os.rst:2164 ../../library/os.rst:2195 -#: ../../library/os.rst:2255 ../../library/os.rst:2580 -#: ../../library/os.rst:2592 ../../library/os.rst:3322 -#: ../../library/os.rst:3479 ../../library/os.rst:3712 -#: ../../library/os.rst:5496 ../../library/os.rst:5505 -#: ../../library/os.rst:5529 ../../library/os.rst:5556 -#: ../../library/os.rst:5565 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/os.rst:344 msgid "" "Returns the list of directories that will be searched for a named " @@ -594,11 +630,6 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 -#, fuzzy -msgid ":ref:`Availability `: Unix, Windows, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/os.rst:431 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " @@ -640,10 +671,6 @@ msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:503 -msgid ":ref:`Availability `: macOS" -msgstr ":ref:`適用 `:macOS" - #: ../../library/os.rst:509 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " @@ -667,14 +694,6 @@ msgid "" "group id." msgstr "" -#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 -#: ../../library/os.rst:593 ../../library/os.rst:687 ../../library/os.rst:694 -#: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:735 -#: ../../library/os.rst:2181 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not Android." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/os.rst:554 msgid "" "Set the environment variable named *key* to the string *value*. Such " @@ -786,10 +805,6 @@ msgstr "" "os.setns(fd, os.CLONE_NEWNET)\n" "os.close(fd)" -#: ../../library/os.rst:639 -msgid ":ref:`Availability `: Linux >= 3.0 with glibc >= 2.14." -msgstr ":ref:`適用 `:Linux 3.0 以上且具有 glibc 2.14 以上。" - #: ../../library/os.rst:645 msgid "The :func:`~os.unshare` function." msgstr ":func:`~os.unshare` 函式。" @@ -961,10 +976,6 @@ msgid "" "are made to the calling process's execution context." msgstr "" -#: ../../library/os.rst:831 -msgid ":ref:`Availability `: Linux >= 2.6.16." -msgstr ":ref:`適用 `:Linux 2.6.16 以上。" - #: ../../library/os.rst:837 msgid "The :func:`~os.setns` function." msgstr ":func:`~os.setns` 函式。" @@ -1098,10 +1109,6 @@ msgid "" "known Linux kernel issue." msgstr "" -#: ../../library/os.rst:953 -msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." -msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" - #: ../../library/os.rst:960 msgid "" "Return a string describing the encoding of the device associated with *fd* " @@ -1130,10 +1137,6 @@ msgid "" "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:979 ../../library/os.rst:992 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" - #: ../../library/os.rst:981 ../../library/os.rst:1266 msgid "The new file descriptor is now non-inheritable." msgstr "" @@ -1450,10 +1453,6 @@ msgstr "" msgid "These operations only make sense for filesystems that support them." msgstr "" -#: ../../library/os.rst:1244 -msgid ":ref:`Availability `: Linux >= 3.1, macOS, Unix" -msgstr ":ref:`適用 `:Linux 3.1 以上、macOS、Unix。" - #: ../../library/os.rst:1251 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " @@ -1693,14 +1692,6 @@ msgstr "" msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1489 ../../library/os.rst:1574 -msgid "" -":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " -">= 2.7, AIX >= 7.1." -msgstr "" -":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " -"以上、AIX 7.1 以上。" - #: ../../library/os.rst:1491 ../../library/os.rst:1576 msgid "Using flags requires Linux >= 4.6." msgstr "" @@ -1719,10 +1710,6 @@ msgid "" "EAGAIN`." msgstr "" -#: ../../library/os.rst:1506 -msgid ":ref:`Availability `: Linux >= 4.14." -msgstr ":ref:`適用 `:Linux 4.14 以上。" - #: ../../library/os.rst:1513 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " @@ -1735,10 +1722,6 @@ msgid "" "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1520 -msgid ":ref:`Availability `: Linux >= 4.6." -msgstr ":ref:`適用 `:Linux 4.6 以上。" - #: ../../library/os.rst:1527 msgid "" "Return the name of the slave pseudo-terminal device associated with the " @@ -1798,10 +1781,6 @@ msgid "" "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1586 ../../library/os.rst:1596 -msgid ":ref:`Availability `: Linux >= 4.7." -msgstr ":ref:`適用 `:Linux 4.7 以上。" - #: ../../library/os.rst:1593 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " @@ -1818,10 +1797,6 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1610 -msgid ":ref:`Availability `: Linux >= 4.16." -msgstr ":ref:`適用 `:Linux 4.16 以上。" - #: ../../library/os.rst:1617 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" @@ -1942,10 +1917,6 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1738 -msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" -msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" - #: ../../library/os.rst:1751 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " @@ -2096,12 +2067,6 @@ msgstr "" msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1915 ../../library/os.rst:1921 -#: ../../library/os.rst:4218 ../../library/os.rst:4894 -#: ../../library/os.rst:4939 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/os.rst:1919 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" @@ -2537,15 +2502,6 @@ msgid "" "changing the mode of symbolic links is supported." msgstr "" -#: ../../library/os.rst:2239 -#, fuzzy -msgid "" -":ref:`Availability `: Unix, Windows, not Linux, FreeBSD >= " -"1.3, NetBSD >= 1.3, not OpenBSD" -msgstr "" -":ref:`適用 `:Unix、非 Linux、FreeBSD 1.3 以上、NetBSD 1.3 以" -"上、非 OpenBSD。" - #: ../../library/os.rst:2249 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " @@ -2655,11 +2611,6 @@ msgid "" "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2334 ../../library/os.rst:2358 -#: ../../library/os.rst:2378 -msgid ":ref:`Availability `: Windows" -msgstr ":ref:`適用 `:Windows。" - #: ../../library/os.rst:2341 msgid "" "Return a list containing the mount points for a volume on a Windows system." @@ -4281,18 +4232,10 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3737 -msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." -msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" - #: ../../library/os.rst:3760 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3762 -msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" -msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" - #: ../../library/os.rst:3764 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" @@ -4364,25 +4307,12 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3816 ../../library/os.rst:3932 -#: ../../library/os.rst:3995 ../../library/os.rst:4005 -#: ../../library/os.rst:4023 ../../library/os.rst:4032 -#: ../../library/os.rst:4042 ../../library/os.rst:4052 -#: ../../library/os.rst:4062 ../../library/os.rst:4073 -msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" -msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" - #: ../../library/os.rst:3822 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:3825 ../../library/os.rst:3834 -#: ../../library/os.rst:3842 ../../library/os.rst:3851 -msgid ":ref:`Availability `: Linux >= 2.6.27" -msgstr ":ref:`適用 `:Linux 2.6.27 以上" - #: ../../library/os.rst:3831 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " @@ -4404,10 +4334,6 @@ msgid "" "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3860 -msgid ":ref:`Availability `: Linux >= 2.6.30" -msgstr ":ref:`適用 `:Linux 2.6.30 以上" - #: ../../library/os.rst:3868 msgid "Timer File Descriptors" msgstr "" @@ -4943,15 +4869,6 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4287 ../../library/os.rst:4852 -#: ../../library/os.rst:4976 ../../library/os.rst:5095 -#: ../../library/os.rst:5264 -#, fuzzy -msgid "" -":ref:`Availability `: Unix, Windows, not WASI, not Android, " -"not iOS." -msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" - #: ../../library/os.rst:4289 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" @@ -5135,12 +5052,6 @@ msgid "" "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4490 ../../library/os.rst:4750 -#, fuzzy -msgid "" -":ref:`Availability `: POSIX, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" - #: ../../library/os.rst:4495 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " @@ -5168,23 +5079,6 @@ msgid "" "fork`." msgstr "" -#: ../../library/os.rst:4517 ../../library/os.rst:4734 -#: ../../library/os.rst:4783 ../../library/os.rst:5020 -#: ../../library/os.rst:5054 ../../library/os.rst:5115 -#: ../../library/os.rst:5129 ../../library/os.rst:5146 -#: ../../library/os.rst:5161 ../../library/os.rst:5172 -#: ../../library/os.rst:5184 ../../library/os.rst:5197 -#: ../../library/os.rst:5206 ../../library/os.rst:5216 -#: ../../library/os.rst:5229 ../../library/os.rst:5280 -#: ../../library/os.rst:5291 ../../library/os.rst:5303 -#: ../../library/os.rst:5310 ../../library/os.rst:5319 -#: ../../library/os.rst:5328 ../../library/os.rst:5337 -#: ../../library/os.rst:5346 -#, fuzzy -msgid "" -":ref:`Availability `: Unix, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/os.rst:4526 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " @@ -5214,11 +5108,6 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4541 -#, fuzzy -msgid ":ref:`Availability `: Unix, Windows, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" - #: ../../library/os.rst:4553 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" @@ -5231,11 +5120,6 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4557 ../../library/os.rst:4594 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/os.rst:4562 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." @@ -5252,15 +5136,6 @@ msgstr "" msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4575 -#, fuzzy -msgid "" -":ref:`Availability `: Linux >= 5.3, Android >= :func:`build-" -"time ` API level 31" -msgstr "" -":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " -"以上、AIX 7.1 以上。" - #: ../../library/os.rst:4580 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " @@ -5269,10 +5144,6 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4585 -msgid ":ref:`Availability `: Linux >= 5.10" -msgstr ":ref:`適用 `:Linux 5.10 以上" - #: ../../library/os.rst:4591 msgid "" "Lock program segments into memory. The value of *op* (defined in ```: not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:非 WASI。" - #: ../../library/os.rst:4629 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " @@ -6566,10 +6432,6 @@ msgid "" "pages/man2/getrandom.2.html>`_." msgstr "" -#: ../../library/os.rst:5688 -msgid ":ref:`Availability `: Linux >= 3.17." -msgstr ":ref:`適用 `:Linux 3.17 以上。" - #: ../../library/os.rst:5694 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." @@ -6796,6 +6658,138 @@ msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" msgid "; (semicolon)" msgstr "; (分號)" +#~ msgid ":ref:`Availability `: Unix, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#~ msgid ":ref:`Availability `: Unix, Windows." +#~ msgstr ":ref:`適用 `:Unix、Windows。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, Windows, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#~ msgid ":ref:`Availability `: macOS" +#~ msgstr ":ref:`適用 `:macOS" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI, not Android." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#~ msgid ":ref:`Availability `: Linux >= 3.0 with glibc >= 2.14." +#~ msgstr ":ref:`適用 `:Linux 3.0 以上且具有 glibc 2.14 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.16." +#~ msgstr ":ref:`適用 `:Linux 2.6.16 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." +#~ msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" + +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:非 WASI。" + +#~ msgid ":ref:`Availability `: Linux >= 3.1, macOS, Unix" +#~ msgstr ":ref:`適用 `:Linux 3.1 以上、macOS、Unix。" + +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, " +#~ "OpenBSD >= 2.7, AIX >= 7.1." +#~ msgstr "" +#~ ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD " +#~ "2.7 以上、AIX 7.1 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 4.14." +#~ msgstr ":ref:`適用 `:Linux 4.14 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 4.6." +#~ msgstr ":ref:`適用 `:Linux 4.6 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 4.7." +#~ msgstr ":ref:`適用 `:Linux 4.7 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 4.16." +#~ msgstr ":ref:`適用 `:Linux 4.16 以上。" + +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" +#~ msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Unix, Windows, not Linux, FreeBSD >= " +#~ "1.3, NetBSD >= 1.3, not OpenBSD" +#~ msgstr "" +#~ ":ref:`適用 `:Unix、非 Linux、FreeBSD 1.3 以上、NetBSD 1.3 " +#~ "以上、非 OpenBSD。" + +#~ msgid ":ref:`Availability `: Windows" +#~ msgstr ":ref:`適用 `:Windows。" + +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." +#~ msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" +#~ msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" + +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" +#~ msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.27" +#~ msgstr ":ref:`適用 `:Linux 2.6.27 以上" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.30" +#~ msgstr ":ref:`適用 `:Linux 2.6.30 以上" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Unix, Windows, not WASI, not Android, " +#~ "not iOS." +#~ msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: POSIX, not WASI, not Android, not iOS." +#~ msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Unix, not WASI, not Android, not iOS." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Unix, Windows, not WASI, not iOS." +#~ msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI, not iOS." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#, fuzzy +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 5.3, Android >= :func:`build-" +#~ "time ` API level 31" +#~ msgstr "" +#~ ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD " +#~ "2.7 以上、AIX 7.1 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 5.10" +#~ msgstr ":ref:`適用 `:Linux 5.10 以上" + +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI, not Android, not iOS." +#~ msgstr ":ref:`適用 `:非 WASI。" + +#~ msgid ":ref:`Availability `: Linux >= 3.17." +#~ msgstr ":ref:`適用 `:Linux 3.17 以上。" + #~ msgid ":ref:`Availability `: Linux >= 5.3" #~ msgstr ":ref:`適用 `:Linux 5.3 以上" diff --git a/library/pkgutil.po b/library/pkgutil.po index c8a23bee35..e6e80f2c93 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-03-08 16:07+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,17 +53,18 @@ msgstr "" "__path__ = extend_path(__path__, __name__)" #: ../../library/pkgutil.rst:28 +#, fuzzy msgid "" "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." +"the package name, add the subdirectory to the package's :attr:`~module." +"__path__`. This is useful if one wants to distribute different parts of a " +"single logical package as multiple directories." msgstr "" "對於 :data:`sys.path` 上具有與套件名稱相符的子目錄的每個目錄,將該子目錄新增" "至套件的 :attr:`__path__` 中。如果想要將單一邏輯套件的不同部分給分配到多個目" "錄時,這會非常有用。" -#: ../../library/pkgutil.rst:33 +#: ../../library/pkgutil.rst:34 msgid "" "It also looks for :file:`\\*.pkg` files beginning where ``*`` matches the " "*name* argument. This feature is similar to :file:`\\*.pth` files (see the :" @@ -79,7 +80,7 @@ msgstr "" "過空行和備註之外,在 :file:`\\*.pkg` 檔案中找到的所有條目都將新增到路徑中,無" "論它們是否存在於檔案系統。(這是一個功能。)" -#: ../../library/pkgutil.rst:41 +#: ../../library/pkgutil.rst:42 msgid "" "If the input path is not a list (as is the case for frozen packages) it is " "returned unchanged. The input path is not modified; an extended copy is " @@ -88,7 +89,7 @@ msgstr "" "如果輸入路徑不是串列(像是凍結套件 (frozen package) 的情況),它將原封不動地" "被回傳。輸入路徑不會被修改;而是回傳擴充後的副本。僅將項目附加到副本的尾端。" -#: ../../library/pkgutil.rst:45 +#: ../../library/pkgutil.rst:46 msgid "" "It is assumed that :data:`sys.path` is a sequence. Items of :data:`sys." "path` that are not strings referring to existing directories are ignored. " @@ -100,11 +101,11 @@ msgstr "" "存目錄的字串則將被忽略。:data:`sys.path` 上用作檔案名稱時導致錯誤的 Unicode " "項目可能會導致此函式引發例外(與 :func:`os.path.isdir` 行為一致)。" -#: ../../library/pkgutil.rst:53 +#: ../../library/pkgutil.rst:54 msgid "Retrieve a module :term:`loader` for the given *fullname*." msgstr "取得給定之 *fullname* 的模組 :term:`loader`。" -#: ../../library/pkgutil.rst:55 +#: ../../library/pkgutil.rst:56 msgid "" "This is a backwards compatibility wrapper around :func:`importlib.util." "find_spec` that converts most failures to :exc:`ImportError` and only " @@ -115,9 +116,9 @@ msgstr "" "轉換為 :exc:`ImportError` 並且僅回傳載入器而不是完整的 :class:`importlib." "machinery.ModuleSpec`。" -#: ../../library/pkgutil.rst:60 ../../library/pkgutil.rst:81 -#: ../../library/pkgutil.rst:96 ../../library/pkgutil.rst:120 -#: ../../library/pkgutil.rst:141 ../../library/pkgutil.rst:180 +#: ../../library/pkgutil.rst:61 ../../library/pkgutil.rst:82 +#: ../../library/pkgutil.rst:97 ../../library/pkgutil.rst:121 +#: ../../library/pkgutil.rst:142 ../../library/pkgutil.rst:181 msgid "" "Updated to be based directly on :mod:`importlib` rather than relying on the " "package internal :pep:`302` import emulation." @@ -125,19 +126,19 @@ msgstr "" "更新為直接基於 :mod:`importlib`,而不是依賴套件內部 :pep:`302` 的引入模擬 " "(import emulation)。" -#: ../../library/pkgutil.rst:64 ../../library/pkgutil.rst:100 +#: ../../library/pkgutil.rst:65 ../../library/pkgutil.rst:101 msgid "Updated to be based on :pep:`451`" msgstr "基於 :pep:`451` 來更新" -#: ../../library/pkgutil.rst:67 ../../library/pkgutil.rst:103 +#: ../../library/pkgutil.rst:68 ../../library/pkgutil.rst:104 msgid "Use :func:`importlib.util.find_spec` instead." msgstr "改用 :func:`importlib.util.find_spec`。" -#: ../../library/pkgutil.rst:73 +#: ../../library/pkgutil.rst:74 msgid "Retrieve a :term:`finder` for the given *path_item*." msgstr "取得給定之 *path_item* 的 :term:`finder`。" -#: ../../library/pkgutil.rst:75 +#: ../../library/pkgutil.rst:76 msgid "" "The returned finder is cached in :data:`sys.path_importer_cache` if it was " "newly created by a path hook." @@ -145,18 +146,18 @@ msgstr "" "如果回傳的尋檢器 (finder) 是由路徑勾點 (path hook) 所新建立的,則它會被快取" "在 :data:`sys.path_importer_cache` 中。" -#: ../../library/pkgutil.rst:78 +#: ../../library/pkgutil.rst:79 msgid "" "The cache (or part of it) can be cleared manually if a rescan of :data:`sys." "path_hooks` is necessary." msgstr "" "如果需要重新掃描 :data:`sys.path_hooks`,可以手動清除快取(或部分快取)。" -#: ../../library/pkgutil.rst:88 +#: ../../library/pkgutil.rst:89 msgid "Get a :term:`loader` object for *module_or_name*." msgstr "取得 *module_or_name* 的 :term:`loader` 物件。" -#: ../../library/pkgutil.rst:90 +#: ../../library/pkgutil.rst:91 msgid "" "If the module or package is accessible via the normal import mechanism, a " "wrapper around the relevant part of that machinery is returned. Returns " @@ -168,11 +169,11 @@ msgstr "" "不到或無法引入模組,則回傳 ``None``。如果指定的模組尚未被引入,則引入其包含的" "套件(如有存在)以建立套件 ``__path__``。" -#: ../../library/pkgutil.rst:109 +#: ../../library/pkgutil.rst:110 msgid "Yield :term:`finder` objects for the given module name." msgstr "yield 給定模組名稱的 :term:`finder` 物件。" -#: ../../library/pkgutil.rst:111 +#: ../../library/pkgutil.rst:112 msgid "" "If fullname contains a ``'.'``, the finders will be for the package " "containing fullname, otherwise they will be all registered top level finders " @@ -182,7 +183,7 @@ msgstr "" "會是在頂層被註冊的尋檢器(即 :data:`sys.meta_path` 和 :data:`sys.path_hooks` " "上的尋檢器)。" -#: ../../library/pkgutil.rst:115 +#: ../../library/pkgutil.rst:116 msgid "" "If the named module is in a package, that package is imported as a side " "effect of invoking this function." @@ -190,11 +191,11 @@ msgstr "" "如果指定的模組位於套件中,則作為呼叫此函式的副作用 (side effect) ,該套件會被" "引入。" -#: ../../library/pkgutil.rst:118 +#: ../../library/pkgutil.rst:119 msgid "If no module name is specified, all top level finders are produced." msgstr "如果未指定模組名稱,則會產生所有頂層尋檢器。" -#: ../../library/pkgutil.rst:127 +#: ../../library/pkgutil.rst:128 msgid "" "Yields :class:`ModuleInfo` for all submodules on *path*, or, if *path* is " "``None``, all top-level modules on :data:`sys.path`." @@ -202,17 +203,17 @@ msgstr "" "yield *path* 上所有子模組的 :class:`ModuleInfo`,或者如果 *path* 為 " "``None``,則產生 :data:`sys.path` 上的所有頂層模組。" -#: ../../library/pkgutil.rst:130 ../../library/pkgutil.rst:151 +#: ../../library/pkgutil.rst:131 ../../library/pkgutil.rst:152 msgid "" "*path* should be either ``None`` or a list of paths to look for modules in." msgstr "*path* 應該是 ``None`` 或用來尋找模組的路徑串列。" -#: ../../library/pkgutil.rst:132 ../../library/pkgutil.rst:153 +#: ../../library/pkgutil.rst:133 ../../library/pkgutil.rst:154 msgid "" "*prefix* is a string to output on the front of every module name on output." msgstr "*prefix* 是在輸出的每個模組名稱前面的輸出字串。" -#: ../../library/pkgutil.rst:136 ../../library/pkgutil.rst:175 +#: ../../library/pkgutil.rst:137 ../../library/pkgutil.rst:176 msgid "" "Only works for a :term:`finder` which defines an ``iter_modules()`` method. " "This interface is non-standard, so the module also provides implementations " @@ -223,7 +224,7 @@ msgstr "" "因此該模組還提供了 :class:`importlib.machinery.FileFinder` 和 :class:" "`zipimport.zipimporter` 的實作。" -#: ../../library/pkgutil.rst:148 +#: ../../library/pkgutil.rst:149 msgid "" "Yields :class:`ModuleInfo` for all modules recursively on *path*, or, if " "*path* is ``None``, all accessible modules." @@ -231,7 +232,7 @@ msgstr "" "為 *path* 上的所有模組遞迴 yield 出 :class:`ModuleInfo`,或如果 *path* 為 " "``None`` 則 yield 所有可存取的模組。" -#: ../../library/pkgutil.rst:155 +#: ../../library/pkgutil.rst:156 msgid "" "Note that this function must import all *packages* (*not* all modules!) on " "the given *path*, in order to access the ``__path__`` attribute to find " @@ -240,7 +241,7 @@ msgstr "" "請注意,此函式必須引入給定之 *path* 上的所有\\ *套件*\\ (*不是*\\ 所有模" "組!),以便存取 ``__path__`` 屬性來尋找子模組。" -#: ../../library/pkgutil.rst:159 +#: ../../library/pkgutil.rst:160 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 " @@ -252,11 +253,11 @@ msgstr "" "引入之套件的名稱)來呼叫函式。如果未提供 *onerror* 函式,則會捕獲並忽略 :exc:" "`ImportError`,同時傳播所有其他例外並終止搜尋。" -#: ../../library/pkgutil.rst:165 +#: ../../library/pkgutil.rst:166 msgid "Examples::" msgstr "範例: ::" -#: ../../library/pkgutil.rst:167 +#: ../../library/pkgutil.rst:168 msgid "" "# list all modules python can access\n" "walk_packages()\n" @@ -265,11 +266,11 @@ msgid "" "walk_packages(ctypes.__path__, ctypes.__name__ + '.')" msgstr "" -#: ../../library/pkgutil.rst:187 +#: ../../library/pkgutil.rst:188 msgid "Get a resource from a package." msgstr "從套件中取得資源。" -#: ../../library/pkgutil.rst:189 +#: ../../library/pkgutil.rst:190 msgid "" "This is a wrapper for the :term:`loader` :meth:`get_data ` API. The *package* argument should be the name of " @@ -283,19 +284,19 @@ msgstr "" "*resource* 引數應為相對檔案名稱的形式,並使用 ``/`` 作為路徑分隔符號。不允許" "使用父目錄名稱 ``..``,也不允許使用根目錄名稱(以 ``/`` 開頭)。" -#: ../../library/pkgutil.rst:196 +#: ../../library/pkgutil.rst:197 msgid "" "The function returns a binary string that is the contents of the specified " "resource." msgstr "該函式回傳一個二進位字串,它是指定資源的內容。" -#: ../../library/pkgutil.rst:199 +#: ../../library/pkgutil.rst:200 msgid "" "For packages located in the filesystem, which have already been imported, " "this is the rough equivalent of::" msgstr "對於位於檔案系統中且已被引入過的套件,這大致相當於: ::" -#: ../../library/pkgutil.rst:202 +#: ../../library/pkgutil.rst:203 msgid "" "d = os.path.dirname(sys.modules[package].__file__)\n" "data = open(os.path.join(d, resource), 'rb').read()" @@ -303,7 +304,7 @@ msgstr "" "d = os.path.dirname(sys.modules[package].__file__)\n" "data = open(os.path.join(d, resource), 'rb').read()" -#: ../../library/pkgutil.rst:205 +#: ../../library/pkgutil.rst:206 msgid "" "If the package cannot be located or loaded, or it uses a :term:`loader` " "which does not support :meth:`get_data `\\ 的 :term:`loader` 不支援 :meth:`get_data " "`。" -#: ../../library/pkgutil.rst:214 +#: ../../library/pkgutil.rst:215 msgid "Resolve a name to an object." msgstr "將名稱解析為物件。" -#: ../../library/pkgutil.rst:216 +#: ../../library/pkgutil.rst:217 msgid "" "This functionality is used in numerous places in the standard library (see :" "issue:`12915`) - and equivalent functionality is also in widely used third-" @@ -329,7 +330,7 @@ msgstr "" "標準函式庫中的許多地方都使用了此功能(請參閱 :issue:`12915`),且相同功能也被" "用於擁有廣大使用者的第三方套件,如 setuptools、Django 和 Pyramid。" -#: ../../library/pkgutil.rst:220 +#: ../../library/pkgutil.rst:221 msgid "" "It is expected that *name* will be a string in one of the following formats, " "where W is shorthand for a valid Python identifier and dot stands for a " @@ -338,15 +339,15 @@ msgstr "" "*name* 預期要是以下格式之一的字串,其中 W 是有效 Python 識別字的簡寫,而點 " "(dot) 代表這些偽正規表示式 (pseudo-regex) 中的字面句點 (literal period):" -#: ../../library/pkgutil.rst:224 +#: ../../library/pkgutil.rst:225 msgid "``W(.W)*``" msgstr "``W(.W)*``" -#: ../../library/pkgutil.rst:225 +#: ../../library/pkgutil.rst:226 msgid "``W(.W)*:(W(.W)*)?``" msgstr "``W(.W)*:(W(.W)*)?``" -#: ../../library/pkgutil.rst:227 +#: ../../library/pkgutil.rst:228 msgid "" "The first form is intended for backward compatibility only. It assumes that " "some part of the dotted name is a package, and the rest is an object " @@ -360,7 +361,7 @@ msgstr "" "於無法透過檢查 (inspection) 來推斷出套件停止的位置和物件層次結構的開始位置," "因此必須使用此形式來重複嘗試引入。" -#: ../../library/pkgutil.rst:234 +#: ../../library/pkgutil.rst:235 msgid "" "In the second form, the caller makes the division point clear through the " "provision of a single colon: the dotted name to the left of the colon is a " @@ -372,21 +373,21 @@ msgstr "" "引入的套件,右側的點名稱是該套件內的物件層次結構。這種形式只需要一次引入。如" "果它以冒號結尾,則回傳一個模組物件。" -#: ../../library/pkgutil.rst:240 +#: ../../library/pkgutil.rst:241 msgid "" "The function will return an object (which might be a module), or raise one " "of the following exceptions:" msgstr "此函式會回傳一個物件(可能是一個模組),或引發以下其中一個例外:" -#: ../../library/pkgutil.rst:243 +#: ../../library/pkgutil.rst:244 msgid ":exc:`ValueError` -- if *name* isn't in a recognised format." msgstr ":exc:`ValueError` -- 如果 *name* 不是可辨識的格式。" -#: ../../library/pkgutil.rst:245 +#: ../../library/pkgutil.rst:246 msgid ":exc:`ImportError` -- if an import failed when it shouldn't have." msgstr ":exc:`ImportError` -- 如果在不應該失敗的情況下引入失敗。" -#: ../../library/pkgutil.rst:247 +#: ../../library/pkgutil.rst:248 msgid "" ":exc:`AttributeError` -- If a failure occurred when traversing the object " "hierarchy within the imported package to get to the desired object." diff --git a/library/poplib.po b/library/poplib.po index 56f717a4f5..4c201930bb 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -52,7 +52,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/posix.po b/library/posix.po index 394ad55dc8..1641bfaf67 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "" "功能的存取。" #: ../../library/posix.rst:14 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/posix.rst:18 msgid "" @@ -182,3 +182,6 @@ msgstr "large files(大型檔案)" #: ../../library/posix.rst:36 msgid "file" msgstr "file(檔案)" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/pty.po b/library/pty.po index f609bfc794..8f4a8bb482 100644 --- a/library/pty.po +++ b/library/pty.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -33,8 +33,8 @@ msgid "" msgstr "" #: ../../library/pty.rst:19 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/pty.rst:21 msgid "" @@ -180,3 +180,6 @@ msgid "" " script.write(('Script done on %s\\n' % time.asctime()).encode())\n" " print('Script done, file is', filename)" msgstr "" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/pwd.po b/library/pwd.po index 29507dc008..340061c435 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,9 +31,8 @@ msgstr "" "此模組提供對 Unix 使用者帳戶和密碼資料庫的存取介面。它適用於所有 Unix 版本。" #: ../../library/pwd.rst:13 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/pwd.rst:15 msgid "" @@ -191,6 +190,10 @@ msgstr ":mod:`grp` 模組" msgid "An interface to the group database, similar to this." msgstr "群組資料庫的介面,與此模組類似。" +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI, not iOS." +#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + #~ msgid "Module :mod:`spwd`" #~ msgstr ":mod:`spwd` 模組" diff --git a/library/readline.po b/library/readline.po index 8082da20e1..a93627616a 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -44,7 +44,7 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 diff --git a/library/resource.po b/library/resource.po index f1f4e4a90c..09f4c98e7a 100644 --- a/library/resource.po +++ b/library/resource.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -27,10 +27,14 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../library/resource.rst:16 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +#: ../../library/resource.rst:16 ../../library/resource.rst:104 +#: ../../library/resource.rst:180 ../../library/resource.rst:192 +#: ../../library/resource.rst:201 ../../library/resource.rst:210 +#: ../../library/resource.rst:220 ../../library/resource.rst:229 +#: ../../library/resource.rst:239 ../../library/resource.rst:252 +#: ../../library/resource.rst:260 ../../library/resource.rst:268 +msgid "Availability" +msgstr "" #: ../../library/resource.rst:18 msgid "" @@ -153,10 +157,6 @@ msgstr "" "引發一個附帶引數 ``pid``、``resource``、``limits`` 的\\ :ref:`稽核事件 " "` ``resource.prlimit``。" -#: ../../library/resource.rst:104 -msgid ":ref:`Availability `: Linux >= 2.6.36 with glibc >= 2.13." -msgstr ":ref:`適用 `:Linux 2.6.36 以上且具有 glibc 2.13 以上。" - #: ../../library/resource.rst:109 msgid "" "These symbols define resources whose consumption can be controlled using " @@ -227,10 +227,6 @@ msgstr "" msgid "The largest area of mapped memory which the process may occupy." msgstr "" -#: ../../library/resource.rst:180 ../../library/resource.rst:268 -msgid ":ref:`Availability `: FreeBSD >= 11." -msgstr ":ref:`適用 `:FreeBSD 11 以上。" - #: ../../library/resource.rst:185 msgid "" "The maximum area (in bytes) of address space which may be taken by the " @@ -241,18 +237,10 @@ msgstr "" msgid "The number of bytes that can be allocated for POSIX message queues." msgstr "" -#: ../../library/resource.rst:192 ../../library/resource.rst:229 -msgid ":ref:`Availability `: Linux >= 2.6.8." -msgstr ":ref:`適用 `:Linux 2.6.8 以上。" - #: ../../library/resource.rst:199 msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." msgstr "" -#: ../../library/resource.rst:201 ../../library/resource.rst:210 -msgid ":ref:`Availability `: Linux >= 2.6.12." -msgstr ":ref:`適用 `:Linux 2.6.12 以上。" - #: ../../library/resource.rst:208 msgid "The ceiling of the real-time priority." msgstr "" @@ -263,10 +251,6 @@ msgid "" "real-time scheduling without making a blocking syscall." msgstr "" -#: ../../library/resource.rst:220 -msgid ":ref:`Availability `: Linux >= 2.6.25." -msgstr ":ref:`適用 `:Linux 2.6.25 以上。" - #: ../../library/resource.rst:227 msgid "The number of signals which the process may queue." msgstr "" @@ -278,11 +262,6 @@ msgid "" "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:239 ../../library/resource.rst:252 -#: ../../library/resource.rst:260 -msgid ":ref:`Availability `: FreeBSD." -msgstr ":ref:`適用 `:FreeBSD。" - #: ../../library/resource.rst:245 msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " @@ -608,6 +587,30 @@ msgid "" "thread. May not be available on all systems." msgstr "" +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + +#~ msgid "" +#~ ":ref:`Availability `: Linux >= 2.6.36 with glibc >= 2.13." +#~ msgstr "" +#~ ":ref:`適用 `:Linux 2.6.36 以上且具有 glibc 2.13 以上。" + +#~ msgid ":ref:`Availability `: FreeBSD >= 11." +#~ msgstr ":ref:`適用 `:FreeBSD 11 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.8." +#~ msgstr ":ref:`適用 `:Linux 2.6.8 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.12." +#~ msgstr ":ref:`適用 `:Linux 2.6.12 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.25." +#~ msgstr ":ref:`適用 `:Linux 2.6.25 以上。" + +#~ msgid ":ref:`Availability `: FreeBSD." +#~ msgstr ":ref:`適用 `:FreeBSD。" + #~ msgid "" #~ "This module does not work or is not available on WebAssembly platforms " #~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " diff --git a/library/select.po b/library/select.po index 9c9f95c416..3989b77001 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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,10 +41,9 @@ msgid "" "precise control over the OS-level primitives used." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/select.rst:177 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -239,10 +238,6 @@ msgstr "" msgid "This value is guaranteed by POSIX to be at least 512." msgstr "" -#: ../../library/select.rst:177 -msgid ":ref:`Availability `: Unix" -msgstr ":ref:`適用 `:Unix。" - #: ../../library/select.rst:185 msgid "``/dev/poll`` Polling Objects" msgstr "" @@ -1015,3 +1010,10 @@ msgstr "popen() (於 os 模組)" #: ../../library/select.rst:154 msgid "WinSock" msgstr "WinSock" + +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:Unix。" + +#~ msgid ":ref:`Availability `: Unix" +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/selectors.po b/library/selectors.po index 4ef9e9b455..e9e2d0f99a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 @@ msgid "Low-level I/O multiplexing module." msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/shutil.po b/library/shutil.po index ce2dab280b..e87a69458b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -541,9 +541,9 @@ msgstr "" msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:422 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" +#: ../../library/shutil.rst:422 ../../library/shutil.rst:436 +msgid "Availability" +msgstr "" #: ../../library/shutil.rst:427 msgid "Change owner *user* and/or *group* of the given *path*." @@ -567,10 +567,6 @@ msgstr "" "引發一個附帶引數 ``path``、``user``、``group`` 的\\ :ref:`稽核事件 " "` ``shutil.chown``。" -#: ../../library/shutil.rst:436 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/shutil.rst:440 #, fuzzy msgid "Added *dir_fd* and *follow_symlinks* parameters." @@ -1251,3 +1247,9 @@ msgstr "directory(目錄)" #: ../../library/shutil.rst:297 msgid "deleting" msgstr "deleting(刪除)" + +#~ msgid ":ref:`Availability `: Unix, Windows." +#~ msgstr ":ref:`適用 `:Unix、Windows。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/signal.po b/library/signal.po index bf2ed3970b..1fcc70e3a3 100644 --- a/library/signal.po +++ b/library/signal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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,18 +152,21 @@ msgid "" msgstr "" #: ../../library/signal.rst:103 ../../library/signal.rst:136 -#: ../../library/signal.rst:148 ../../library/signal.rst:154 +#: ../../library/signal.rst:142 ../../library/signal.rst:148 +#: ../../library/signal.rst:154 ../../library/signal.rst:160 #: ../../library/signal.rst:166 ../../library/signal.rst:180 #: ../../library/signal.rst:198 ../../library/signal.rst:206 -#: ../../library/signal.rst:232 ../../library/signal.rst:238 -#: ../../library/signal.rst:244 ../../library/signal.rst:351 -#: ../../library/signal.rst:390 ../../library/signal.rst:437 +#: ../../library/signal.rst:217 ../../library/signal.rst:232 +#: ../../library/signal.rst:238 ../../library/signal.rst:244 +#: ../../library/signal.rst:262 ../../library/signal.rst:272 +#: ../../library/signal.rst:351 ../../library/signal.rst:390 +#: ../../library/signal.rst:414 ../../library/signal.rst:437 #: ../../library/signal.rst:471 ../../library/signal.rst:501 #: ../../library/signal.rst:508 ../../library/signal.rst:561 #: ../../library/signal.rst:603 ../../library/signal.rst:618 #: ../../library/signal.rst:644 ../../library/signal.rst:664 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/signal.rst:105 ../../library/signal.rst:473 msgid "" @@ -203,11 +206,6 @@ msgstr "" msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:142 ../../library/signal.rst:262 -#: ../../library/signal.rst:272 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/signal.rst:146 msgid "Bus error (bad memory access)." msgstr "" @@ -220,10 +218,6 @@ msgstr "" msgid "Alias to :data:`SIGCHLD`." msgstr ":data:`SIGCHLD` 的別名。" -#: ../../library/signal.rst:160 -msgid ":ref:`Availability `: not macOS." -msgstr ":ref:`適用 `:非 macOS。" - #: ../../library/signal.rst:164 msgid "Continue the process if it is currently stopped" msgstr "" @@ -281,10 +275,6 @@ msgid "" "can only be raised in user space." msgstr "" -#: ../../library/signal.rst:217 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - #: ../../library/signal.rst:219 msgid "" "On architectures where the signal is available. See the man page :manpage:" @@ -468,12 +458,6 @@ msgstr "" msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 手冊頁。" -#: ../../library/signal.rst:414 -msgid "" -":ref:`Availability `: Linux >= 5.1, Android >= :func:`build-" -"time ` API level 31" -msgstr "" - #: ../../library/signal.rst:420 msgid "" "Send the signal *signalnum* to the thread *thread_id*, another thread in the " @@ -953,5 +937,17 @@ msgid "" "print(\"Shutdown...\")" msgstr "" +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + +#~ msgid ":ref:`Availability `: not macOS." +#~ msgstr ":ref:`適用 `:非 macOS。" + +#~ msgid ":ref:`Availability `: Linux." +#~ msgstr ":ref:`適用 `:Linux。" + #~ msgid ":ref:`Availability `: Linux >= 5.1" #~ msgstr ":ref:`適用 `:Linux 5.1 以上" diff --git a/library/smtplib.po b/library/smtplib.po index 1f438f383e..8dc73d5d15 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -35,7 +35,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/socket.po b/library/socket.po index 88afba9a25..ad7273c1dc 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,17 +38,37 @@ msgid "" "operating system socket APIs." msgstr "" -#: ../../library/socket.rst:709 ../../library/socket.rst:994 -#: ../../library/socket.rst:1010 ../../library/socket.rst:1023 -#: ../../library/socket.rst:1038 ../../library/socket.rst:1055 -#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 -#: ../../library/socket.rst:1088 ../../library/socket.rst:1412 -#: ../../library/socket.rst:1459 ../../library/socket.rst:1473 -#: ../../library/socket.rst:1493 ../../library/socket.rst:1540 -#: ../../library/socket.rst:1585 ../../library/socket.rst:1969 -#: ../../library/socket.rst:1979 ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../library/socket.rst:171 ../../library/socket.rst:181 +#: ../../library/socket.rst:209 ../../library/socket.rst:216 +#: ../../library/socket.rst:233 ../../library/socket.rst:383 +#: ../../library/socket.rst:461 ../../library/socket.rst:475 +#: ../../library/socket.rst:490 ../../library/socket.rst:501 +#: ../../library/socket.rst:510 ../../library/socket.rst:519 +#: ../../library/socket.rst:530 ../../library/socket.rst:542 +#: ../../library/socket.rst:553 ../../library/socket.rst:566 +#: ../../library/socket.rst:594 ../../library/socket.rst:606 +#: ../../library/socket.rst:612 ../../library/socket.rst:643 +#: ../../library/socket.rst:658 ../../library/socket.rst:667 +#: ../../library/socket.rst:684 ../../library/socket.rst:699 +#: ../../library/socket.rst:709 ../../library/socket.rst:898 +#: ../../library/socket.rst:994 ../../library/socket.rst:1010 +#: ../../library/socket.rst:1023 ../../library/socket.rst:1038 +#: ../../library/socket.rst:1055 ../../library/socket.rst:1066 +#: ../../library/socket.rst:1077 ../../library/socket.rst:1088 +#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 +#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 +#: ../../library/socket.rst:1275 ../../library/socket.rst:1286 +#: ../../library/socket.rst:1313 ../../library/socket.rst:1330 +#: ../../library/socket.rst:1347 ../../library/socket.rst:1361 +#: ../../library/socket.rst:1412 ../../library/socket.rst:1459 +#: ../../library/socket.rst:1473 ../../library/socket.rst:1493 +#: ../../library/socket.rst:1540 ../../library/socket.rst:1585 +#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 +#: ../../library/socket.rst:1867 ../../library/socket.rst:1885 +#: ../../library/socket.rst:1969 ../../library/socket.rst:1979 +#: ../../library/socket.rst:1991 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -295,11 +315,6 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:594 -#: ../../library/socket.rst:1885 -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 "" @@ -311,10 +326,6 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:667 -msgid ":ref:`Availability `: Linux >= 3.9" -msgstr ":ref:`適用 `:Linux 3.9 以上。" - #: ../../library/socket.rst:183 msgid "See :manpage:`vsock(7)`" msgstr "請見 :manpage:`vsock(7)`" @@ -376,10 +387,6 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:209 ../../library/socket.rst:542 -msgid ":ref:`Availability `: Linux >= 2.2." -msgstr ":ref:`適用 `:Linux >= 2.2。" - #: ../../library/socket.rst:211 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " @@ -388,10 +395,6 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:216 ../../library/socket.rst:643 -msgid ":ref:`Availability `: Linux >= 4.7." -msgstr ":ref:`適用 `:Linux >= 4.7。" - #: ../../library/socket.rst:220 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " @@ -410,10 +413,6 @@ msgid "" "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:233 -msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" -msgstr ":ref:`適用 `:Linux 2.6.20 以上、FreeBSD 10.1 以上。" - #: ../../library/socket.rst:237 msgid "" ":const:`AF_HYPERV` is a Windows-only socket based interface for " @@ -596,10 +595,6 @@ msgid "" "html>`_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:383 -msgid ":ref:`Availability `: Linux >= 2.6.27." -msgstr ":ref:`適用 `:Linux >= 2.6.27。" - #: ../../library/socket.rst:404 msgid "" "Many constants of these forms, documented in the Unix documentation on " @@ -674,10 +669,6 @@ msgid "" "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:461 -msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." -msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" - #: ../../library/socket.rst:465 msgid "NetBSD support was added." msgstr "" @@ -689,10 +680,6 @@ msgid "" "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:475 ../../library/socket.rst:510 -msgid ":ref:`Availability `: Linux >= 2.6.25." -msgstr ":ref:`適用 `:Linux >= 2.6.25。" - #: ../../library/socket.rst:478 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." @@ -709,20 +696,12 @@ msgstr "" msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:490 -msgid ":ref:`Availability `: Linux >= 3.6." -msgstr ":ref:`適用 `:Linux >= 3.6。" - #: ../../library/socket.rst:496 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:501 -msgid ":ref:`Availability `: Linux >= 4.1." -msgstr ":ref:`適用 `:Linux >= 4.1。" - #: ../../library/socket.rst:507 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " @@ -735,20 +714,12 @@ msgid "" "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:519 -msgid ":ref:`Availability `: Linux >= 5.4." -msgstr ":ref:`適用 `:Linux >= 5.4。" - #: ../../library/socket.rst:527 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:530 -msgid ":ref:`Availability `: FreeBSD >= 14.0." -msgstr ":ref:`適用 `:FreeBSD >= 14.0。" - #: ../../library/socket.rst:547 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " @@ -760,14 +731,6 @@ msgstr "" msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:553 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - -#: ../../library/socket.rst:566 -msgid ":ref:`Availability `: Linux >= 2.6.30." -msgstr ":ref:`適用 `:Linux >= 2.6.30。" - #: ../../library/socket.rst:576 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " @@ -792,14 +755,6 @@ msgstr "" msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:606 -msgid ":ref:`Availability `: Linux >= 4.8." -msgstr ":ref:`適用 `:Linux >= 4.8。" - -#: ../../library/socket.rst:612 -msgid ":ref:`Availability `: BSD, macOS." -msgstr ":ref:`適用 `:BSD、macOS。" - #: ../../library/socket.rst:618 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " @@ -835,10 +790,6 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:658 -msgid ":ref:`Availability `: FreeBSD." -msgstr ":ref:`適用 `:FreeBSD。" - #: ../../library/socket.rst:662 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" @@ -849,21 +800,12 @@ msgstr "" msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:684 ../../library/socket.rst:898 -#: ../../library/socket.rst:1991 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/socket.rst:695 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:699 -msgid ":ref:`Availability `: Linux, FreeBSD, macOS." -msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" - #: ../../library/socket.rst:707 msgid "" "These constants are used by the :meth:`~socket.socket.shutdown` method of " @@ -1456,10 +1398,6 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/socket.rst:1179 ../../library/socket.rst:1199 msgid "Windows support added" msgstr "" @@ -1492,11 +1430,6 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 -#: ../../library/socket.rst:1867 -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1225 ../../library/socket.rst:1717 #: ../../library/socket.rst:1761 ../../library/socket.rst:1869 msgid "Most Unix platforms." @@ -1552,24 +1485,12 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1275 -#, fuzzy -msgid ":ref:`Availability `: Unix, not Android." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1282 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1286 ../../library/socket.rst:1313 -#: ../../library/socket.rst:1330 ../../library/socket.rst:1347 -#: ../../library/socket.rst:1361 -#, fuzzy -msgid ":ref:`Availability `: Unix, Windows, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1290 ../../library/socket.rst:1317 #: ../../library/socket.rst:1334 msgid "Windows support was added." @@ -2018,10 +1939,6 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/socket.rst:1729 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" @@ -2717,6 +2634,83 @@ msgstr "module(模組)" msgid "struct" msgstr "struct" +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:非 WASI。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.38." +#~ msgstr ":ref:`適用 `:Linux >= 2.6.38。" + +#~ msgid ":ref:`Availability `: Linux >= 3.9" +#~ msgstr ":ref:`適用 `:Linux 3.9 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.2." +#~ msgstr ":ref:`適用 `:Linux >= 2.2。" + +#~ msgid ":ref:`Availability `: Linux >= 4.7." +#~ msgstr ":ref:`適用 `:Linux >= 4.7。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" +#~ msgstr ":ref:`適用 `:Linux 2.6.20 以上、FreeBSD 10.1 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.27." +#~ msgstr ":ref:`適用 `:Linux >= 2.6.27。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." +#~ msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.25." +#~ msgstr ":ref:`適用 `:Linux >= 2.6.25。" + +#~ msgid ":ref:`Availability `: Linux >= 3.6." +#~ msgstr ":ref:`適用 `:Linux >= 3.6。" + +#~ msgid ":ref:`Availability `: Linux >= 4.1." +#~ msgstr ":ref:`適用 `:Linux >= 4.1。" + +#~ msgid ":ref:`Availability `: Linux >= 5.4." +#~ msgstr ":ref:`適用 `:Linux >= 5.4。" + +#~ msgid ":ref:`Availability `: FreeBSD >= 14.0." +#~ msgstr ":ref:`適用 `:FreeBSD >= 14.0。" + +#~ msgid ":ref:`Availability `: Linux." +#~ msgstr ":ref:`適用 `:Linux。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.30." +#~ msgstr ":ref:`適用 `:Linux >= 2.6.30。" + +#~ msgid ":ref:`Availability `: Linux >= 4.8." +#~ msgstr ":ref:`適用 `:Linux >= 4.8。" + +#~ msgid ":ref:`Availability `: BSD, macOS." +#~ msgstr ":ref:`適用 `:BSD、macOS。" + +#~ msgid ":ref:`Availability `: FreeBSD." +#~ msgstr ":ref:`適用 `:FreeBSD。" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + +#~ msgid ":ref:`Availability `: Linux, FreeBSD, macOS." +#~ msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" + +#~ msgid ":ref:`Availability `: Unix, Windows." +#~ msgstr ":ref:`適用 `:Unix、Windows。" + +#~ msgid ":ref:`Availability `: Unix, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not Android." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, Windows, not WASI." +#~ msgstr ":ref:`適用 `:Unix、非 WASI。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + #~ msgid ":ref:`Availability `: not Emscripten, not WASI." #~ msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" diff --git a/library/socketserver.po b/library/socketserver.po index 656edd79ce..d572ee7494 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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 "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/ssl.po b/library/ssl.po index ad0e9f709c..77b7368436 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,10 +59,10 @@ msgstr "" "在使用此模組之前,請閱讀 :ref:`ssl-security`。如果不這樣做,可能會產生錯誤的" "安全性認知,因為 ssl 模組的預設設定未必適合你的應用程式。" +#: ../../library/ssl.rst:454 ../../library/ssl.rst:469 #: ../../includes/wasm-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:只有 Windows。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -723,10 +723,6 @@ msgstr "" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" -#: ../../library/ssl.rst:454 ../../library/ssl.rst:469 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:只有 Windows。" - #: ../../library/ssl.rst:460 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " @@ -4150,5 +4146,12 @@ msgstr "certificates(憑證)" msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:只有 Windows。" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:只有 Windows。" + #~ msgid ":ref:`Availability `: not Emscripten, not WASI." #~ msgstr ":ref:`適用 `: 非 Emscripten、非 WASI。" diff --git a/library/stat.po b/library/stat.po index 83b937fed9..626398e356 100644 --- a/library/stat.po +++ b/library/stat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -429,7 +429,7 @@ msgid "All super-user supported flags" msgstr "" #: ../../library/stat.rst:409 ../../library/stat.rst:417 -msgid ":ref:`Availability `: macOS" +msgid "Availability" msgstr "" #: ../../library/stat.rst:415 diff --git a/library/stdtypes.po b/library/stdtypes.po index a83aab5f32..1db6d495b0 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6223,13 +6223,14 @@ msgstr "" #: ../../library/stdtypes.rst:4471 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 " -"created with the same key-value pairs as the mapping object. Otherwise, the " -"positional argument must be an :term:`iterable` object. Each item in the " -"iterable must itself be an iterable with exactly two objects. The first " -"object of each item becomes a key in the new dictionary, and the second " -"object the corresponding value. If a key occurs more than once, the last " -"value for that key becomes the corresponding value in the new dictionary." +"positional argument is given and it defines a ``keys()`` method, a " +"dictionary is created by calling :meth:`~object.__getitem__` on the argument " +"with each returned key from the method. Otherwise, the positional argument " +"must be an :term:`iterable` object. Each item in the iterable must itself " +"be an iterable with exactly two elements. The first element of each item " +"becomes a key in the new dictionary, and the second element the " +"corresponding value. If a key occurs more than once, the last value for " +"that key becomes the corresponding value in the new dictionary." msgstr "" #: ../../library/stdtypes.rst:4481 @@ -6445,26 +6446,27 @@ msgstr "" #: ../../library/stdtypes.rst:4636 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 " -"arguments are specified, the dictionary is then updated with those key/value " -"pairs: ``d.update(red=1, blue=2)``." +":meth:`update` accepts either another object with a ``keys()`` method (in " +"which case :meth:`~object.__getitem__` is called with every key returned " +"from the method). or an iterable of key/value pairs (as tuples or other " +"iterables of length two). If keyword arguments are specified, the dictionary " +"is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4643 +#: ../../library/stdtypes.rst:4644 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4647 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:4650 +#: ../../library/stdtypes.rst:4651 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -6474,34 +6476,34 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4657 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:4664 +#: ../../library/stdtypes.rst:4665 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:4670 +#: ../../library/stdtypes.rst:4671 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:4674 +#: ../../library/stdtypes.rst:4675 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:4677 +#: ../../library/stdtypes.rst:4678 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6533,17 +6535,17 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:4692 +#: ../../library/stdtypes.rst:4693 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4696 +#: ../../library/stdtypes.rst:4697 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4699 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6565,21 +6567,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:4708 +#: ../../library/stdtypes.rst:4709 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4713 +#: ../../library/stdtypes.rst:4714 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4720 +#: ../../library/stdtypes.rst:4721 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4722 +#: ../../library/stdtypes.rst:4723 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 " @@ -6587,23 +6589,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4727 +#: ../../library/stdtypes.rst:4728 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4732 +#: ../../library/stdtypes.rst:4733 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4736 +#: ../../library/stdtypes.rst:4737 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4739 +#: ../../library/stdtypes.rst:4740 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -6611,39 +6613,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4744 +#: ../../library/stdtypes.rst:4745 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:4747 +#: ../../library/stdtypes.rst:4748 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4752 +#: ../../library/stdtypes.rst:4753 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:4757 +#: ../../library/stdtypes.rst:4758 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:4760 +#: ../../library/stdtypes.rst:4761 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4765 +#: ../../library/stdtypes.rst:4766 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4770 +#: ../../library/stdtypes.rst:4771 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -6657,11 +6659,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:4782 +#: ../../library/stdtypes.rst:4783 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4785 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -6702,11 +6704,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4827 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:4833 +#: ../../library/stdtypes.rst:4834 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 " @@ -6717,7 +6719,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4842 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 " @@ -6728,7 +6730,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:4846 +#: ../../library/stdtypes.rst:4847 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -6737,7 +6739,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:4850 +#: ../../library/stdtypes.rst:4851 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 " @@ -6751,7 +6753,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的當前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:4860 +#: ../../library/stdtypes.rst:4861 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -6763,7 +6765,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4866 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -6778,7 +6780,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:4872 +#: ../../library/stdtypes.rst:4873 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -6790,7 +6792,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:4878 +#: ../../library/stdtypes.rst:4879 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -6802,7 +6804,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:4884 +#: ../../library/stdtypes.rst:4885 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -6817,7 +6819,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4892 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 " @@ -6829,7 +6831,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:4900 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -6837,7 +6839,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4905 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -6845,11 +6847,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:4911 +#: ../../library/stdtypes.rst:4912 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:4917 +#: ../../library/stdtypes.rst:4918 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -6864,7 +6866,7 @@ msgstr "" "物件,它是透過使用引數 :class:`int` 來下標 ``list`` 類別而建立的。" "``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使用。" -#: ../../library/stdtypes.rst:4927 +#: ../../library/stdtypes.rst:4928 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -6872,7 +6874,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:4930 +#: ../../library/stdtypes.rst:4931 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -6880,7 +6882,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4934 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 " @@ -6892,7 +6894,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4940 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 " @@ -6904,7 +6906,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:4945 +#: ../../library/stdtypes.rst:4946 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 " @@ -6916,7 +6918,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:4951 +#: ../../library/stdtypes.rst:4952 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." @@ -6929,7 +6931,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4958 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -6938,7 +6940,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4964 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -6948,7 +6950,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4969 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -6956,7 +6958,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4972 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 " @@ -6967,7 +6969,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4977 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -6975,7 +6977,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4980 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -6983,7 +6985,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4983 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -6995,7 +6997,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4988 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7007,7 +7009,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4994 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7017,13 +7019,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4998 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5001 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7041,13 +7043,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5009 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5011 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7061,7 +7063,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5017 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7069,7 +7071,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5020 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7081,7 +7083,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5025 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7091,7 +7093,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5029 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7103,245 +7105,245 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5035 +#: ../../library/stdtypes.rst:5036 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5038 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5040 +#: ../../library/stdtypes.rst:5041 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5041 +#: ../../library/stdtypes.rst:5042 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5042 +#: ../../library/stdtypes.rst:5043 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5043 +#: ../../library/stdtypes.rst:5044 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5044 +#: ../../library/stdtypes.rst:5045 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5046 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5047 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5047 +#: ../../library/stdtypes.rst:5048 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5048 +#: ../../library/stdtypes.rst:5049 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5049 +#: ../../library/stdtypes.rst:5050 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5051 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5051 +#: ../../library/stdtypes.rst:5052 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5052 +#: ../../library/stdtypes.rst:5053 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5054 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5055 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5056 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5056 +#: ../../library/stdtypes.rst:5057 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5058 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5059 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5060 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5060 +#: ../../library/stdtypes.rst:5061 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5062 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5063 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5064 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5065 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5066 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5067 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5068 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5068 +#: ../../library/stdtypes.rst:5069 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5070 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5071 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5071 +#: ../../library/stdtypes.rst:5072 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5072 +#: ../../library/stdtypes.rst:5073 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5074 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5075 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5076 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5077 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5078 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5079 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5080 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5081 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5082 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5083 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5084 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5085 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:5086 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5086 +#: ../../library/stdtypes.rst:5087 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5087 +#: ../../library/stdtypes.rst:5088 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5089 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5089 +#: ../../library/stdtypes.rst:5090 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5091 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5092 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5093 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5094 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5098 +#: ../../library/stdtypes.rst:5099 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5100 +#: ../../library/stdtypes.rst:5101 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5105 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5106 +#: ../../library/stdtypes.rst:5107 msgid "" ">>> list[int].__origin__\n" "" @@ -7349,7 +7351,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5112 +#: ../../library/stdtypes.rst:5113 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 " @@ -7358,7 +7360,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5116 +#: ../../library/stdtypes.rst:5117 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -7366,7 +7368,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5123 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -7374,7 +7376,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5126 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -7388,7 +7390,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5134 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -7398,7 +7400,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5141 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -7406,19 +7408,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5148 +#: ../../library/stdtypes.rst:5149 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5150 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5151 +#: ../../library/stdtypes.rst:5152 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5153 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -7427,7 +7429,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5156 +#: ../../library/stdtypes.rst:5157 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -7435,18 +7437,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:5158 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5167 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5172 +#: ../../library/stdtypes.rst:5173 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -7459,7 +7461,7 @@ msgstr "" "釋 (type annotation) `。與 :data:`typing.Union` 相比,聯合型別運" "算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5179 +#: ../../library/stdtypes.rst:5180 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 " @@ -7470,7 +7472,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5184 +#: ../../library/stdtypes.rst:5185 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -7478,7 +7480,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5189 +#: ../../library/stdtypes.rst:5190 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 " @@ -7491,58 +7493,58 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5198 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5199 +#: ../../library/stdtypes.rst:5200 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5201 +#: ../../library/stdtypes.rst:5202 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5203 +#: ../../library/stdtypes.rst:5204 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5206 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5207 +#: ../../library/stdtypes.rst:5208 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5210 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5212 msgid "It is compatible with :data:`typing.Union`::" msgstr "它與 :data:`typing.Union` 相容: ::" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5214 msgid "int | str == typing.Union[int, str]" msgstr "int | str == typing.Union[int, str]" -#: ../../library/stdtypes.rst:5215 +#: ../../library/stdtypes.rst:5216 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5217 +#: ../../library/stdtypes.rst:5218 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5223 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5225 +#: ../../library/stdtypes.rst:5226 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -7550,14 +7552,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5229 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5231 +#: ../../library/stdtypes.rst:5232 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -7567,7 +7569,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5239 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 " @@ -7576,7 +7578,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查。物件不能以型別來實例化: ::" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5243 msgid "" ">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" @@ -7594,7 +7596,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'types.UnionType' instances" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5252 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 " @@ -7603,7 +7605,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5255 +#: ../../library/stdtypes.rst:5256 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -7629,25 +7631,25 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5271 +#: ../../library/stdtypes.rst:5272 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5279 +#: ../../library/stdtypes.rst:5280 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5281 +#: ../../library/stdtypes.rst:5282 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5288 +#: ../../library/stdtypes.rst:5289 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5291 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 " @@ -7658,7 +7660,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5297 +#: ../../library/stdtypes.rst:5298 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -7669,32 +7671,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5306 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5313 +#: ../../library/stdtypes.rst:5314 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5315 +#: ../../library/stdtypes.rst:5316 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5321 +#: ../../library/stdtypes.rst:5322 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5324 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:5326 +#: ../../library/stdtypes.rst:5327 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -7702,15 +7704,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5330 +#: ../../library/stdtypes.rst:5331 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5337 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5340 +#: ../../library/stdtypes.rst:5341 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -7718,7 +7720,7 @@ msgid "" "Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5345 +#: ../../library/stdtypes.rst:5346 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -7731,7 +7733,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5357 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -7742,7 +7744,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5365 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -7770,15 +7772,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5379 +#: ../../library/stdtypes.rst:5380 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5387 +#: ../../library/stdtypes.rst:5388 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5393 +#: ../../library/stdtypes.rst:5394 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -7788,7 +7790,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5400 +#: ../../library/stdtypes.rst:5401 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -7797,21 +7799,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5407 +#: ../../library/stdtypes.rst:5408 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:5410 +#: ../../library/stdtypes.rst:5411 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5416 +#: ../../library/stdtypes.rst:5417 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5422 +#: ../../library/stdtypes.rst:5423 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 " @@ -7819,30 +7821,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5427 +#: ../../library/stdtypes.rst:5428 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5433 +#: ../../library/stdtypes.rst:5434 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5435 +#: ../../library/stdtypes.rst:5436 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:5439 +#: ../../library/stdtypes.rst:5440 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5446 +#: ../../library/stdtypes.rst:5447 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5449 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -7850,15 +7852,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5453 +#: ../../library/stdtypes.rst:5454 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5459 +#: ../../library/stdtypes.rst:5460 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5461 +#: ../../library/stdtypes.rst:5462 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 " @@ -7866,64 +7868,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5466 +#: ../../library/stdtypes.rst:5467 msgid "It is written as :code:`NotImplemented`." msgstr "" -#: ../../library/stdtypes.rst:5472 +#: ../../library/stdtypes.rst:5473 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5475 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:5482 +#: ../../library/stdtypes.rst:5483 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5485 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:5491 +#: ../../library/stdtypes.rst:5492 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5497 +#: ../../library/stdtypes.rst:5498 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5505 +#: ../../library/stdtypes.rst:5506 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5510 +#: ../../library/stdtypes.rst:5511 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5516 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:5525 +#: ../../library/stdtypes.rst:5526 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5527 +#: ../../library/stdtypes.rst:5528 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 " @@ -7931,7 +7933,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5532 +#: ../../library/stdtypes.rst:5533 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 " @@ -7941,24 +7943,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5540 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5542 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:5545 +#: ../../library/stdtypes.rst:5546 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5548 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -7982,7 +7984,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5568 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -7990,11 +7992,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5572 +#: ../../library/stdtypes.rst:5573 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5575 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8005,84 +8007,84 @@ msgid "" "..." msgstr "" -#: ../../library/stdtypes.rst:5587 +#: ../../library/stdtypes.rst:5588 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:5589 +#: ../../library/stdtypes.rst:5590 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5592 +#: ../../library/stdtypes.rst:5593 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5594 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5595 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5596 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5596 +#: ../../library/stdtypes.rst:5597 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5600 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5601 +#: ../../library/stdtypes.rst:5602 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5603 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:5603 +#: ../../library/stdtypes.rst:5604 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5605 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5605 +#: ../../library/stdtypes.rst:5606 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5607 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5610 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:5611 +#: ../../library/stdtypes.rst:5612 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:5614 +#: ../../library/stdtypes.rst:5615 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:5617 +#: ../../library/stdtypes.rst:5618 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8090,7 +8092,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5619 +#: ../../library/stdtypes.rst:5620 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 " @@ -8099,38 +8101,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5626 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5629 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:5632 +#: ../../library/stdtypes.rst:5633 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5635 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5637 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:5643 +#: ../../library/stdtypes.rst:5644 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 " @@ -8142,7 +8144,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5653 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 " @@ -8150,11 +8152,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5658 +#: ../../library/stdtypes.rst:5659 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:5660 +#: ../../library/stdtypes.rst:5661 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 " @@ -8162,11 +8164,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5665 +#: ../../library/stdtypes.rst:5666 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:5667 +#: ../../library/stdtypes.rst:5668 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -8179,38 +8181,38 @@ msgid "" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" -#: ../../library/stdtypes.rst:5677 +#: ../../library/stdtypes.rst:5678 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5681 +#: ../../library/stdtypes.rst:5682 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5683 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5685 +#: ../../library/stdtypes.rst:5686 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5689 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5691 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:5693 +#: ../../library/stdtypes.rst:5694 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -8224,7 +8226,7 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1139 #: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5419 msgid "types" msgstr "type(型別)" @@ -8353,9 +8355,9 @@ msgstr "is not" #: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1540 #: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:2545 #: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:4233 -#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4913 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5338 -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:5383 msgid "object" msgstr "object(物件)" @@ -8448,8 +8450,8 @@ msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5389 ../../library/stdtypes.rst:5403 -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5390 ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5419 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -8516,7 +8518,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1606 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5419 msgid "module" msgstr "模組" @@ -8584,7 +8586,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4829 msgid "protocol" msgstr "protocol(協定)" @@ -8694,7 +8696,7 @@ msgid "bytearray" msgstr "bytearray(位元組陣列)" #: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5419 msgid "type" msgstr "type(型別)" @@ -8887,79 +8889,79 @@ msgstr "dictionary(字典)" msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4901 +#: ../../library/stdtypes.rst:4902 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4901 +#: ../../library/stdtypes.rst:4902 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5169 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5169 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5339 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5383 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5383 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5390 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5390 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5404 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5404 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5443 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5443 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" diff --git a/library/subprocess.po b/library/subprocess.po index 748bc1a1fe..b5d89a2e37 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -50,10 +50,13 @@ msgstr "" msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr ":pep:`324` -- 提議 subprocess 模組的 PEP" +#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 +#: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 +#: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 +#: ../../library/subprocess.rst:1560 ../../library/subprocess.rst:1582 #: ../../includes/wasm-mobile-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:Unix 和 Windows。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -777,12 +780,6 @@ msgid "" "the child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 -#: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 -#: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 -msgid ":ref:`Availability `: POSIX" -msgstr ":ref:`適用 `:POSIX" - #: ../../library/subprocess.rst:599 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*。" @@ -2045,10 +2042,6 @@ msgstr "" ">>> subprocess.getstatusoutput('/bin/kill $$')\n" "(-15, '')" -#: ../../library/subprocess.rst:1560 ../../library/subprocess.rst:1582 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix 和 Windows。" - #: ../../library/subprocess.rst:1562 msgid "Windows support was added." msgstr "新增對 Windows 的支援。" @@ -2214,6 +2207,16 @@ msgstr "universal newlines" msgid "subprocess module" msgstr "subprocess 模組" +#, fuzzy +#~ msgid ":ref:`Availability `: not Android, not iOS, not WASI." +#~ msgstr ":ref:`適用 `:Unix 和 Windows。" + +#~ msgid ":ref:`Availability `: POSIX" +#~ msgstr ":ref:`適用 `:POSIX" + +#~ msgid ":ref:`Availability `: Unix, Windows." +#~ msgstr ":ref:`適用 `:Unix 和 Windows。" + #, fuzzy #~ msgid "" #~ "This module does not work or is not available on WebAssembly platforms, " diff --git a/library/symtable.po b/library/symtable.po index 48c873ff47..3904eff30a 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -209,90 +209,96 @@ msgid "Return a tuple containing names of globals in this function." msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" #: ../../library/symtable.rst:170 -msgid "Return a tuple containing names of nonlocals in this function." +#, fuzzy +msgid "" +"Return a tuple containing names of explicitly declared nonlocals in this " +"function." msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" #: ../../library/symtable.rst:174 -msgid "Return a tuple containing names of free variables in this function." +#, fuzzy +msgid "" +"Return a tuple containing names of :term:`free (closure) variables ` in this function." msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" -#: ../../library/symtable.rst:179 +#: ../../library/symtable.rst:180 msgid "A namespace of a class. This class inherits from :class:`SymbolTable`." msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:183 +#: ../../library/symtable.rst:184 msgid "" "Return a tuple containing the names of method-like functions declared in the " "class." msgstr "回傳一個包含類別中聲明的類似方法之函式名稱的元組。" -#: ../../library/symtable.rst:186 +#: ../../library/symtable.rst:187 msgid "" "Here, the term 'method' designates *any* function defined in the class body " "via :keyword:`def` or :keyword:`async def`." msgstr "" -#: ../../library/symtable.rst:189 +#: ../../library/symtable.rst:190 msgid "" "Functions defined in a deeper scope (e.g., in an inner class) are not picked " "up by :meth:`get_methods`." msgstr "" -#: ../../library/symtable.rst:192 +#: ../../library/symtable.rst:193 msgid "For example:" msgstr "舉例來說:" -#: ../../library/symtable.rst:214 +#: ../../library/symtable.rst:215 msgid "" "Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still " "considered as a method-like function." msgstr "" -#: ../../library/symtable.rst:219 +#: ../../library/symtable.rst:220 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" ":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" -#: ../../library/symtable.rst:224 +#: ../../library/symtable.rst:225 msgid "Return the symbol's name." msgstr "回傳符號的名稱。" -#: ../../library/symtable.rst:228 +#: ../../library/symtable.rst:229 msgid "Return ``True`` if the symbol is used in its block." msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" -#: ../../library/symtable.rst:232 +#: ../../library/symtable.rst:233 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" -#: ../../library/symtable.rst:236 +#: ../../library/symtable.rst:237 msgid "Return ``True`` if the symbol is a parameter." msgstr "如果符號是一個參數,則回傳 ``True``。" -#: ../../library/symtable.rst:240 +#: ../../library/symtable.rst:241 msgid "Return ``True`` if the symbol is global." msgstr "如果符號是全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:244 +#: ../../library/symtable.rst:245 msgid "Return ``True`` if the symbol is nonlocal." msgstr "如果符號是非區域的,則回傳 ``True``。" -#: ../../library/symtable.rst:248 +#: ../../library/symtable.rst:249 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:252 +#: ../../library/symtable.rst:253 msgid "Return ``True`` if the symbol is local to its block." msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" -#: ../../library/symtable.rst:256 +#: ../../library/symtable.rst:257 msgid "Return ``True`` if the symbol is annotated." msgstr "如果符號有被註釋,則回傳 ``True``。" -#: ../../library/symtable.rst:262 +#: ../../library/symtable.rst:263 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." @@ -300,25 +306,25 @@ msgstr "" "如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " "``True``。" -#: ../../library/symtable.rst:267 +#: ../../library/symtable.rst:268 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" -#: ../../library/symtable.rst:271 +#: ../../library/symtable.rst:272 msgid "Return ``True`` if name binding introduces new namespace." msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" -#: ../../library/symtable.rst:273 +#: ../../library/symtable.rst:274 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" -#: ../../library/symtable.rst:276 +#: ../../library/symtable.rst:277 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/symtable.rst:278 +#: ../../library/symtable.rst:279 msgid "" ">>> table = symtable.symtable(\"def some_func(): pass\", \"string\", " "\"exec\")\n" @@ -330,7 +336,7 @@ msgstr "" ">>> table.lookup(\"some_func\").is_namespace()\n" "True" -#: ../../library/symtable.rst:282 +#: ../../library/symtable.rst:283 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " @@ -339,11 +345,11 @@ msgstr "" "請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" "到其他物件,例如 int 或 list,而不會引入新的命名空間。" -#: ../../library/symtable.rst:288 +#: ../../library/symtable.rst:289 msgid "Return a list of namespaces bound to this name." msgstr "回傳綁定到該名稱的命名空間的串列。" -#: ../../library/symtable.rst:292 +#: ../../library/symtable.rst:293 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." @@ -351,20 +357,20 @@ msgstr "" "回傳綁定到該名稱的命名空間。如果該名稱綁定了多個命名空間或沒有命名空間,則會" "引發 :exc:`ValueError`。" -#: ../../library/symtable.rst:299 +#: ../../library/symtable.rst:300 msgid "Command-Line Usage" msgstr "" -#: ../../library/symtable.rst:303 +#: ../../library/symtable.rst:304 msgid "" "The :mod:`symtable` module can be executed as a script from the command line." msgstr "" -#: ../../library/symtable.rst:305 +#: ../../library/symtable.rst:306 msgid "python -m symtable [infile...]" msgstr "" -#: ../../library/symtable.rst:309 +#: ../../library/symtable.rst:310 msgid "" "Symbol tables are generated for the specified Python source files and dumped " "to stdout. If no input file is specified, the content is read from stdin." diff --git a/library/sys.po b/library/sys.po index 77f594eaca..2df11db85e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,10 +42,14 @@ msgid "" "removed)." msgstr "" -#: ../../library/sys.rst:25 ../../library/sys.rst:778 -#: ../../library/sys.rst:1489 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369 +#: ../../library/sys.rst:760 ../../library/sys.rst:778 +#: ../../library/sys.rst:991 ../../library/sys.rst:1490 +#: ../../library/sys.rst:1731 ../../library/sys.rst:1746 +#: ../../library/sys.rst:1754 ../../library/sys.rst:1770 +#: ../../library/sys.rst:2014 +msgid "Availability" +msgstr "" #: ../../library/sys.rst:30 msgid "" @@ -381,11 +385,6 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:299 ../../library/sys.rst:991 -#: ../../library/sys.rst:1769 ../../library/sys.rst:2013 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/sys.rst:304 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." @@ -470,10 +469,6 @@ msgstr "" msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:369 -msgid ":ref:`Availability `: Emscripten." -msgstr ":ref:`適用 `:Emscripten。" - #: ../../library/sys.rst:376 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " @@ -998,10 +993,6 @@ msgid "" "version information, see :func:`platform.android_ver`." msgstr "" -#: ../../library/sys.rst:760 -msgid ":ref:`Availability `: Android." -msgstr ":ref:`適用 `:Android。" - #: ../../library/sys.rst:767 msgid "" "Return the name of the current default string encoding used by the Unicode " @@ -1300,7 +1291,7 @@ msgstr "" msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`。" -#: ../../library/sys.rst:1014 ../../library/sys.rst:1701 +#: ../../library/sys.rst:1014 ../../library/sys.rst:1702 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" @@ -1312,7 +1303,7 @@ msgid "" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1026 ../../library/sys.rst:1722 +#: ../../library/sys.rst:1026 ../../library/sys.rst:1723 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." @@ -1588,45 +1579,45 @@ msgid "" "implement Python's default import semantics. The :meth:`~importlib.abc." "MetaPathFinder.find_spec` method is called with at least the absolute name " "of the module being imported. If the module to be imported is contained in a " -"package, then the parent package's :attr:`__path__` attribute is passed in " -"as a second argument. The method returns a :term:`module spec`, or ``None`` " -"if the module cannot be found." +"package, then the parent package's :attr:`~module.__path__` attribute is " +"passed in as a second argument. The method returns a :term:`module spec`, or " +"``None`` if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1284 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1285 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1287 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1288 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1294 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1299 msgid "" "Removed the fallback that looked for a :meth:`!find_module` method if a :" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" -#: ../../library/sys.rst:1304 +#: ../../library/sys.rst:1305 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 " @@ -1638,13 +1629,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1317 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1320 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1652,68 +1643,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1331 +#: ../../library/sys.rst:1332 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:1335 +#: ../../library/sys.rst:1336 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:1339 +#: ../../library/sys.rst:1340 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1341 +#: ../../library/sys.rst:1342 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1343 +#: ../../library/sys.rst:1344 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1346 +#: ../../library/sys.rst:1347 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:1349 +#: ../../library/sys.rst:1350 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:1355 +#: ../../library/sys.rst:1356 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1361 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:1364 ../../library/sys.rst:1375 +#: ../../library/sys.rst:1365 ../../library/sys.rst:1376 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1370 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 " @@ -1721,92 +1712,92 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1380 +#: ../../library/sys.rst:1381 msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1384 msgid "System" msgstr "" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1384 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1386 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1386 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1387 msgid "Android" msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1387 #, fuzzy msgid "``'android'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1388 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1388 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1389 msgid "iOS" msgstr "" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1389 msgid "``'ios'``" msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1390 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1390 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1391 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1391 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1392 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1392 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1393 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1393 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1394 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1394 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1396 +#: ../../library/sys.rst:1397 msgid "" "On Unix systems not listed in the table, the value is the lowercased OS name " "as returned by ``uname -s``, with the first part of the version as returned " @@ -1815,81 +1806,81 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1402 +#: ../../library/sys.rst:1403 msgid "" "if sys.platform.startswith('freebsd'):\n" " # FreeBSD-specific code here..." msgstr "" -#: ../../library/sys.rst:1405 +#: ../../library/sys.rst:1406 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1410 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: ../../library/sys.rst:1413 +#: ../../library/sys.rst:1414 msgid "" "On Android, :data:`sys.platform` now returns ``'android'`` rather than " "``'linux'``." msgstr "" -#: ../../library/sys.rst:1419 +#: ../../library/sys.rst:1420 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1422 +#: ../../library/sys.rst:1423 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1428 +#: ../../library/sys.rst:1429 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:1431 +#: ../../library/sys.rst:1432 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:1435 +#: ../../library/sys.rst:1436 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1437 +#: ../../library/sys.rst:1438 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:1440 +#: ../../library/sys.rst:1441 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1442 +#: ../../library/sys.rst:1443 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1451 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1898,14 +1889,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1456 +#: ../../library/sys.rst:1457 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:1471 +#: ../../library/sys.rst:1472 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1915,7 +1906,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1481 +#: ../../library/sys.rst:1482 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 " @@ -1926,14 +1917,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1494 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:1505 +#: ../../library/sys.rst:1506 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 " @@ -1948,14 +1939,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1518 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1521 +#: ../../library/sys.rst:1522 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1963,71 +1954,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1526 ../../library/sys.rst:1613 +#: ../../library/sys.rst:1527 ../../library/sys.rst:1614 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1528 ../../library/sys.rst:1615 +#: ../../library/sys.rst:1529 ../../library/sys.rst:1616 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1529 +#: ../../library/sys.rst:1530 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1532 ../../library/sys.rst:1630 +#: ../../library/sys.rst:1533 ../../library/sys.rst:1631 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1533 +#: ../../library/sys.rst:1534 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:1537 +#: ../../library/sys.rst:1538 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1538 +#: ../../library/sys.rst:1539 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:1541 +#: ../../library/sys.rst:1542 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1543 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1544 +#: ../../library/sys.rst:1545 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1546 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1548 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1552 +#: ../../library/sys.rst:1553 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:1556 +#: ../../library/sys.rst:1557 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 " @@ -2035,19 +2026,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1562 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1564 +#: ../../library/sys.rst:1565 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1572 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2058,7 +2049,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1588 +#: ../../library/sys.rst:1589 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 " @@ -2067,7 +2058,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1594 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2075,7 +2066,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1598 +#: ../../library/sys.rst:1599 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 " @@ -2083,36 +2074,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1603 +#: ../../library/sys.rst:1604 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1606 +#: ../../library/sys.rst:1607 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:1610 +#: ../../library/sys.rst:1611 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1616 +#: ../../library/sys.rst:1617 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:1620 +#: ../../library/sys.rst:1621 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1622 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``; " @@ -2122,7 +2113,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1632 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 " @@ -2130,22 +2121,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1636 +#: ../../library/sys.rst:1637 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1638 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:1641 +#: ../../library/sys.rst:1642 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1643 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 " @@ -2155,13 +2146,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1650 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:1652 +#: ../../library/sys.rst:1653 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 " @@ -2175,17 +2166,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1663 +#: ../../library/sys.rst:1664 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1666 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" -#: ../../library/sys.rst:1669 +#: ../../library/sys.rst:1670 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2193,13 +2184,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1676 +#: ../../library/sys.rst:1677 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1681 +#: ../../library/sys.rst:1682 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2208,7 +2199,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1687 +#: ../../library/sys.rst:1688 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2216,7 +2207,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1690 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2224,20 +2215,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1692 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:1694 +#: ../../library/sys.rst:1695 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:1706 +#: ../../library/sys.rst:1707 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2246,116 +2237,111 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: ../../library/sys.rst:1713 +#: ../../library/sys.rst:1714 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:1717 +#: ../../library/sys.rst:1718 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1728 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1730 ../../library/sys.rst:1745 -#: ../../library/sys.rst:1753 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - -#: ../../library/sys.rst:1736 +#: ../../library/sys.rst:1737 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1738 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1742 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1744 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1751 +#: ../../library/sys.rst:1752 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1759 +#: ../../library/sys.rst:1760 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:1763 +#: ../../library/sys.rst:1764 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1766 +#: ../../library/sys.rst:1767 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1772 +#: ../../library/sys.rst:1773 msgid "" "Changing the filesystem encoding after Python startup is risky because the " "old fsencoding or paths encoded by the old fsencoding may be cached " "somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1777 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1780 msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1787 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1790 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1791 +#: ../../library/sys.rst:1792 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:1793 +#: ../../library/sys.rst:1794 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1795 +#: ../../library/sys.rst:1796 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:1799 +#: ../../library/sys.rst:1800 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:1802 +#: ../../library/sys.rst:1803 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 " @@ -2366,14 +2352,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1811 +#: ../../library/sys.rst:1812 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:1816 +#: ../../library/sys.rst:1817 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2382,7 +2368,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1823 +#: ../../library/sys.rst:1824 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2391,19 +2377,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1829 +#: ../../library/sys.rst:1830 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1835 +#: ../../library/sys.rst:1836 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:1839 +#: ../../library/sys.rst:1840 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 " @@ -2411,7 +2397,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1849 +#: ../../library/sys.rst:1850 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2419,7 +2405,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1855 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, " @@ -2427,7 +2413,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1860 +#: ../../library/sys.rst:1861 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2435,12 +2421,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1869 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1870 +#: ../../library/sys.rst:1871 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 " @@ -2448,7 +2434,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1875 +#: ../../library/sys.rst:1876 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 " @@ -2456,60 +2442,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1881 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1887 +#: ../../library/sys.rst:1888 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1892 +#: ../../library/sys.rst:1893 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1894 +#: ../../library/sys.rst:1895 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1895 +#: ../../library/sys.rst:1896 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1897 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1898 +#: ../../library/sys.rst:1899 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1902 +#: ../../library/sys.rst:1903 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1904 +#: ../../library/sys.rst:1905 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1905 +#: ../../library/sys.rst:1906 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1907 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1910 +#: ../../library/sys.rst:1911 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1918 +#: ../../library/sys.rst:1919 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2518,73 +2504,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1926 +#: ../../library/sys.rst:1927 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1928 +#: ../../library/sys.rst:1929 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:1932 +#: ../../library/sys.rst:1933 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1934 +#: ../../library/sys.rst:1935 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1936 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1936 +#: ../../library/sys.rst:1937 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1937 +#: ../../library/sys.rst:1938 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1939 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1940 +#: ../../library/sys.rst:1941 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1944 +#: ../../library/sys.rst:1945 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1949 +#: ../../library/sys.rst:1950 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1953 +#: ../../library/sys.rst:1954 msgid "" "Storing :attr:`!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:1957 +#: ../../library/sys.rst:1958 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1961 ../../library/sys.rst:1963 +#: ../../library/sys.rst:1962 ../../library/sys.rst:1964 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2592,7 +2578,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1972 +#: ../../library/sys.rst:1973 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2601,13 +2587,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1981 +#: ../../library/sys.rst:1982 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:1987 +#: ../../library/sys.rst:1988 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2618,18 +2604,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1995 +#: ../../library/sys.rst:1996 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:2000 +#: ../../library/sys.rst:2001 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:2007 +#: ../../library/sys.rst:2008 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 " @@ -2638,20 +2624,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:2019 +#: ../../library/sys.rst:2020 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:2025 +#: ../../library/sys.rst:2026 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:2029 +#: ../../library/sys.rst:2030 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2671,18 +2657,18 @@ msgstr "" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" -#: ../../library/sys.rst:2041 +#: ../../library/sys.rst:2042 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:2049 +#: ../../library/sys.rst:2050 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2050 +#: ../../library/sys.rst:2051 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/" @@ -2703,50 +2689,65 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:925 ../../library/sys.rst:1501 +#: ../../library/sys.rst:925 ../../library/sys.rst:1502 msgid "profile function" msgstr "" -#: ../../library/sys.rst:925 ../../library/sys.rst:1501 +#: ../../library/sys.rst:925 ../../library/sys.rst:1502 msgid "profiler" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1584 +#: ../../library/sys.rst:934 ../../library/sys.rst:1585 msgid "trace function" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1584 +#: ../../library/sys.rst:934 ../../library/sys.rst:1585 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "..." msgstr "..." + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + +#~ msgid ":ref:`Availability `: Emscripten." +#~ msgstr ":ref:`適用 `:Emscripten。" + +#~ msgid ":ref:`Availability `: Android." +#~ msgstr ":ref:`適用 `:Android。" + +#~ msgid ":ref:`Availability `: Linux." +#~ msgstr ":ref:`適用 `:Linux。" diff --git a/library/syslog.po b/library/syslog.po index 9fb0489e10..2238d89e81 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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,9 +30,8 @@ msgid "" msgstr "" #: ../../library/syslog.rst:14 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/syslog.rst:16 msgid "" @@ -229,3 +228,7 @@ msgid "" msgstr "" "syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_MAIL)\n" "syslog.syslog('E-mail processing initiated...')" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not WASI, not iOS." +#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" diff --git a/library/termios.po b/library/termios.po index d801678336..3f6693e439 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -31,8 +31,8 @@ msgid "" msgstr "" #: ../../library/termios.rst:19 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/termios.rst:21 msgid "" @@ -185,3 +185,6 @@ msgstr "I/O control(I/O 控制)" #: ../../library/termios.rst:8 msgid "tty" msgstr "tty" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/threading.po b/library/threading.po index 82ec8c7c3b..4102117f68 100644 --- a/library/threading.po +++ b/library/threading.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -73,10 +73,10 @@ msgid "" "appropriate model if you want to run multiple I/O-bound tasks simultaneously." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -#, fuzzy -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../library/threading.rst:130 ../../library/threading.rst:229 +#: ../../library/threading.rst:468 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 #, fuzzy @@ -197,12 +197,6 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:130 -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD." -msgstr "" - #: ../../library/threading.rst:134 msgid "Added support for GNU/kFreeBSD." msgstr "" @@ -287,10 +281,6 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:229 -msgid ":ref:`Availability `: Windows, pthreads." -msgstr ":ref:`適用 `:Windows, pthreads。" - #: ../../library/threading.rst:231 msgid "Unix platforms with POSIX threads support." msgstr "" @@ -635,12 +625,6 @@ msgid "" "terminated." msgstr "" -#: ../../library/threading.rst:468 -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD." -msgstr "" - #: ../../library/threading.rst:474 msgid "Return whether the thread is alive." msgstr "" @@ -1657,3 +1641,10 @@ msgstr "debugger(除錯器)" #: ../../library/threading.rst:187 ../../library/threading.rst:205 msgid "profile function" msgstr "" + +#, fuzzy +#~ msgid ":ref:`Availability `: not WASI." +#~ msgstr ":ref:`適用 `:非 WASI。" + +#~ msgid ":ref:`Availability `: Windows, pthreads." +#~ msgstr ":ref:`適用 `:Windows, pthreads。" diff --git a/library/time.po b/library/time.po index a1acf58f77..23a3fed4e7 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-08-14 16:05+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,9 +263,19 @@ msgstr "" "傳遞無效或過期的 *thread_id* 可能會導致未定義的行為,例如分段錯誤 " "(segmentation fault)。" -#: ../../library/time.rst:149 -msgid ":ref:`Availability `: Unix" -msgstr ":ref:`適用 `:Unix" +#: ../../library/time.rst:149 ../../library/time.rst:161 +#: ../../library/time.rst:174 ../../library/time.rst:183 +#: ../../library/time.rst:196 ../../library/time.rst:205 +#: ../../library/time.rst:721 ../../library/time.rst:745 +#: ../../library/time.rst:841 ../../library/time.rst:852 +#: ../../library/time.rst:862 ../../library/time.rst:872 +#: ../../library/time.rst:881 ../../library/time.rst:890 +#: ../../library/time.rst:899 ../../library/time.rst:910 +#: ../../library/time.rst:918 ../../library/time.rst:929 +#: ../../library/time.rst:940 ../../library/time.rst:949 +#: ../../library/time.rst:962 +msgid "Availability" +msgstr "" #: ../../library/time.rst:151 msgid "" @@ -281,13 +291,6 @@ msgstr "" "回傳指定時鐘 *clk_id* 的解析度(精確度)。有關 *clk_id* 可接受的值的串列,請" "參閱 :ref:`time-clock-id-constants`。" -#: ../../library/time.rst:161 ../../library/time.rst:174 -#: ../../library/time.rst:183 ../../library/time.rst:745 -#: ../../library/time.rst:862 ../../library/time.rst:890 -#: ../../library/time.rst:918 ../../library/time.rst:962 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/time.rst:168 msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" @@ -323,11 +326,6 @@ msgid "" msgstr "" "使用 :func:`clock_settime_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:196 ../../library/time.rst:205 -#, fuzzy -msgid ":ref:`Availability `: Unix, not Android, not iOS." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "類似於 :func:`clock_settime`,但設定以奈秒為單位的時間。" @@ -1274,10 +1272,6 @@ msgid "" "`float` type." msgstr "" -#: ../../library/time.rst:721 -msgid ":ref:`Availability `: Linux, Unix, Windows." -msgstr ":ref:`適用 `:Linux、Unix、Windows。" - #: ../../library/time.rst:723 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" @@ -1459,10 +1453,6 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:841 -msgid ":ref:`Availability `: Linux >= 2.6.39." -msgstr ":ref:`適用 `:Linux 2.6.39 以上。" - #: ../../library/time.rst:848 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " @@ -1470,10 +1460,6 @@ msgid "" "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:852 -msgid ":ref:`Availability `: Solaris." -msgstr ":ref:`適用 `:Solaris。" - #: ../../library/time.rst:859 msgid "" "Clock that cannot be set and represents monotonic time since some " @@ -1486,29 +1472,16 @@ msgid "" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:872 -msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." -msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" - #: ../../library/time.rst:878 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." msgstr "" -#: ../../library/time.rst:881 ../../library/time.rst:940 -#: ../../library/time.rst:949 -msgid ":ref:`Availability `: macOS >= 10.12." -msgstr ":ref:`適用 `:macOS 10.12 以上。" - #: ../../library/time.rst:888 ../../library/time.rst:897 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:899 -msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." -msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" - #: ../../library/time.rst:905 msgid "" "`International Atomic Time `: Linux." -msgstr ":ref:`適用 `:Linux。" - #: ../../library/time.rst:916 msgid "Thread-specific CPU-time clock." msgstr "" @@ -1535,10 +1504,6 @@ msgid "" "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:929 -msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." -msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" - #: ../../library/time.rst:936 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " @@ -1697,6 +1662,40 @@ msgstr "% (百分號)" msgid "datetime format" msgstr "datetime format(日期時間格式)" +#~ msgid ":ref:`Availability `: Unix" +#~ msgstr ":ref:`適用 `:Unix" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" + +#, fuzzy +#~ msgid ":ref:`Availability `: Unix, not Android, not iOS." +#~ msgstr ":ref:`適用 `:Unix。" + +#~ msgid ":ref:`Availability `: Linux, Unix, Windows." +#~ msgstr ":ref:`適用 `:Linux、Unix、Windows。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.39." +#~ msgstr ":ref:`適用 `:Linux 2.6.39 以上。" + +#~ msgid ":ref:`Availability `: Solaris." +#~ msgstr ":ref:`適用 `:Solaris。" + +#~ msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." +#~ msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" + +#~ msgid ":ref:`Availability `: macOS >= 10.12." +#~ msgstr ":ref:`適用 `:macOS 10.12 以上。" + +#~ msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." +#~ msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" + +#~ msgid ":ref:`Availability `: Linux." +#~ msgstr ":ref:`適用 `:Linux。" + +#~ msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." +#~ msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" + #~ msgid ":attr:`tm_year`" #~ msgstr ":attr:`tm_year`" diff --git a/library/traceback.po b/library/traceback.po index 5d2a56c436..22e0a96d42 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -29,13 +29,16 @@ msgstr "**原始碼:**\\ :source:`Lib/traceback.py`" #: ../../library/traceback.rst:11 msgid "" "This module provides a standard interface to extract, format and print stack " -"traces of Python programs. It exactly mimics the behavior of the Python " -"interpreter when it prints a stack trace. This is useful when you want to " -"print stack traces under program control, such as in a \"wrapper\" around " -"the interpreter." +"traces of Python programs. It is more flexible than the interpreter's " +"default traceback display, and therefore makes it possible to configure " +"certain aspects of the output. Finally, it contains a utility for capturing " +"enough information about an exception to print it later, without the need to " +"save a reference to the actual exception. Since exceptions can be the roots " +"of large objects graph, this utility can significantly improve memory " +"management." msgstr "" -#: ../../library/traceback.rst:19 +#: ../../library/traceback.rst:23 msgid "" "The module uses :ref:`traceback objects ` --- these are " "objects of type :class:`types.TracebackType`, which are assigned to the :" @@ -43,29 +46,48 @@ msgid "" "instances." msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:30 msgid "Module :mod:`faulthandler`" msgstr ":mod:`faulthandler` 模組" -#: ../../library/traceback.rst:27 +#: ../../library/traceback.rst:31 msgid "" "Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " "on a user signal." msgstr "" -#: ../../library/traceback.rst:29 +#: ../../library/traceback.rst:33 msgid "Module :mod:`pdb`" msgstr ":mod:`pdb` 模組" -#: ../../library/traceback.rst:30 +#: ../../library/traceback.rst:34 msgid "Interactive source code debugger for Python programs." msgstr "" -#: ../../library/traceback.rst:32 -msgid "The module defines the following functions:" -msgstr "此模組定義了以下函式:" - #: ../../library/traceback.rst:36 +msgid "The module's API can be divided into two parts:" +msgstr "" + +#: ../../library/traceback.rst:38 +msgid "" +"Module-level functions offering basic functionality, which are useful for " +"interactive inspection of exceptions and tracebacks." +msgstr "" + +#: ../../library/traceback.rst:41 +msgid "" +":class:`TracebackException` class and its helper classes :class:" +"`StackSummary` and :class:`FrameSummary`. These offer both more flexibility " +"in the output generated and the ability to store the information necessary " +"for later formatting without holding references to actual exception and " +"traceback objects." +msgstr "" + +#: ../../library/traceback.rst:49 +msgid "Module-Level Functions" +msgstr "" + +#: ../../library/traceback.rst:53 msgid "" "Print up to *limit* stack trace entries from :ref:`traceback object " "` *tb* (starting from the caller's frame) if *limit* is " @@ -76,7 +98,7 @@ msgid "" "output." msgstr "" -#: ../../library/traceback.rst:47 +#: ../../library/traceback.rst:64 msgid "" "The meaning of the *limit* parameter is different than the meaning of :const:" "`sys.tracebacklimit`. A negative *limit* value corresponds to a positive " @@ -84,42 +106,42 @@ msgid "" "*limit* value cannot be achieved with :const:`!sys.tracebacklimit`." msgstr "" -#: ../../library/traceback.rst:53 ../../library/traceback.rst:118 +#: ../../library/traceback.rst:70 ../../library/traceback.rst:135 msgid "Added negative *limit* support." msgstr "新增負數 *limit* 的支援。" -#: ../../library/traceback.rst:60 +#: ../../library/traceback.rst:77 msgid "" "Print exception information and stack trace entries from :ref:`traceback " "object ` *tb* to *file*. This differs from :func:" "`print_tb` in the following ways:" msgstr "" -#: ../../library/traceback.rst:65 +#: ../../library/traceback.rst:82 msgid "" "if *tb* is not ``None``, it prints a header ``Traceback (most recent call " "last):``" msgstr "" -#: ../../library/traceback.rst:68 +#: ../../library/traceback.rst:85 msgid "it prints the exception type and *value* after the stack trace" msgstr "" -#: ../../library/traceback.rst:72 +#: ../../library/traceback.rst:89 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:76 +#: ../../library/traceback.rst:93 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:80 +#: ../../library/traceback.rst:97 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:" @@ -128,29 +150,29 @@ msgid "" "when printing an unhandled exception." msgstr "" -#: ../../library/traceback.rst:87 ../../library/traceback.rst:191 +#: ../../library/traceback.rst:104 ../../library/traceback.rst:208 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:90 ../../library/traceback.rst:171 +#: ../../library/traceback.rst:107 ../../library/traceback.rst:188 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" -#: ../../library/traceback.rst:97 +#: ../../library/traceback.rst:114 msgid "" "This is a shorthand for ``print_exception(sys.exception(), limit, file, " "chain)``." msgstr "" -#: ../../library/traceback.rst:103 +#: ../../library/traceback.rst:120 msgid "" "This is a shorthand for ``print_exception(sys.last_exc, limit, file, " "chain)``. In general it will work only after an exception has reached an " "interactive prompt (see :data:`sys.last_exc`)." msgstr "" -#: ../../library/traceback.rst:110 +#: ../../library/traceback.rst:127 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -160,7 +182,7 @@ msgid "" "for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:124 +#: ../../library/traceback.rst:141 msgid "" "Return a :class:`StackSummary` object representing a list of \"pre-" "processed\" stack trace entries extracted from the :ref:`traceback object " @@ -173,7 +195,7 @@ msgid "" "for a stack trace." msgstr "" -#: ../../library/traceback.rst:137 +#: ../../library/traceback.rst:154 msgid "" "Extract the raw traceback from the current :ref:`stack frame `. The return value has the same format as for :func:`extract_tb`. " @@ -181,7 +203,7 @@ msgid "" "`print_stack`." msgstr "" -#: ../../library/traceback.rst:145 +#: ../../library/traceback.rst:162 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 " @@ -191,7 +213,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:155 +#: ../../library/traceback.rst:172 msgid "" "Format the exception part of a traceback using an exception value such as " "given by :data:`sys.last_value`. The return value is a list of strings, " @@ -202,31 +224,31 @@ msgid "" "contains the exception's :attr:`notes `." msgstr "" -#: ../../library/traceback.rst:163 +#: ../../library/traceback.rst:180 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:167 ../../library/traceback.rst:394 +#: ../../library/traceback.rst:184 ../../library/traceback.rst:415 msgid "" "When *show_group* is ``True``, and the exception is an instance of :exc:" "`BaseExceptionGroup`, the nested exceptions are included as well, " "recursively, with indentation relative to their nesting depth." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:192 msgid "" "The returned list now includes any :attr:`notes ` " "attached to the exception." msgstr "" -#: ../../library/traceback.rst:179 +#: ../../library/traceback.rst:196 msgid "*show_group* parameter was added." msgstr "" -#: ../../library/traceback.rst:185 +#: ../../library/traceback.rst:202 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -235,68 +257,69 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:194 +#: ../../library/traceback.rst:211 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:201 +#: ../../library/traceback.rst:218 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:207 +#: ../../library/traceback.rst:224 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "``format_list(extract_tb(tb, limit))`` 的簡寫。" -#: ../../library/traceback.rst:212 +#: ../../library/traceback.rst:229 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "``format_list(extract_stack(f, limit))`` 的簡寫。" -#: ../../library/traceback.rst:216 +#: ../../library/traceback.rst:233 msgid "" "Clears the local variables of all the stack frames in a :ref:`traceback " "` *tb* by calling the :meth:`~frame.clear` method of " "each :ref:`frame object `." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:242 msgid "" "Walk a stack following :attr:`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:234 +#: ../../library/traceback.rst:251 msgid "" "Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and " "line number for each frame. This helper is used with :meth:`StackSummary." "extract`." msgstr "" -#: ../../library/traceback.rst:240 -msgid "The module also defines the following classes:" -msgstr "" - -#: ../../library/traceback.rst:243 +#: ../../library/traceback.rst:259 msgid ":class:`!TracebackException` Objects" msgstr ":class:`!TracebackException` 物件" -#: ../../library/traceback.rst:247 +#: ../../library/traceback.rst:263 msgid "" ":class:`!TracebackException` objects are created from actual exceptions to " -"capture data for later printing in a lightweight fashion." +"capture data for later printing. They offer a more lightweight method of " +"storing this information by avoiding holding references to :ref:" +"`traceback` and :ref:`frame` objects In " +"addition, they expose more options to configure the output compared to the " +"module-level functions described above." msgstr "" -#: ../../library/traceback.rst:252 ../../library/traceback.rst:359 +#: ../../library/traceback.rst:272 msgid "" -"Capture an exception for later rendering. *limit*, *lookup_lines* and " -"*capture_locals* are as for the :class:`StackSummary` class." +"Capture an exception for later rendering. The meaning of *limit*, " +"*lookup_lines* and *capture_locals* are as for the :class:`StackSummary` " +"class." msgstr "" -#: ../../library/traceback.rst:255 +#: ../../library/traceback.rst:276 msgid "" "If *compact* is true, only data that is required by :class:`!" "TracebackException`'s :meth:`format` method is saved in the class " @@ -304,12 +327,12 @@ msgid "" "if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false." msgstr "" -#: ../../library/traceback.rst:261 ../../library/traceback.rst:362 +#: ../../library/traceback.rst:282 ../../library/traceback.rst:383 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:263 +#: ../../library/traceback.rst:284 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -318,122 +341,128 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:269 +#: ../../library/traceback.rst:290 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:293 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" -#: ../../library/traceback.rst:277 +#: ../../library/traceback.rst:298 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__cause__`." msgstr "" -#: ../../library/traceback.rst:282 +#: ../../library/traceback.rst:303 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__context__`." msgstr "" -#: ../../library/traceback.rst:287 +#: ../../library/traceback.rst:308 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:295 +#: ../../library/traceback.rst:316 msgid "" "The :attr:`~BaseException.__suppress_context__` value from the original " "exception." msgstr "" -#: ../../library/traceback.rst:300 +#: ../../library/traceback.rst:321 msgid "" "The :attr:`~BaseException.__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:309 +#: ../../library/traceback.rst:330 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:313 +#: ../../library/traceback.rst:334 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:319 +#: ../../library/traceback.rst:340 msgid "String display of the class of the original exception." msgstr "" -#: ../../library/traceback.rst:325 +#: ../../library/traceback.rst:346 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:350 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:333 +#: ../../library/traceback.rst:354 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:361 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:344 +#: ../../library/traceback.rst:365 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:348 +#: ../../library/traceback.rst:369 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:355 +#: ../../library/traceback.rst:376 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:366 +#: ../../library/traceback.rst:380 +msgid "" +"Capture an exception for later rendering. *limit*, *lookup_lines* and " +"*capture_locals* are as for the :class:`StackSummary` class." +msgstr "" + +#: ../../library/traceback.rst:387 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:373 +#: ../../library/traceback.rst:394 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:375 +#: ../../library/traceback.rst:396 msgid "" "If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will " "not be formatted." msgstr "" -#: ../../library/traceback.rst:378 +#: ../../library/traceback.rst:399 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:384 +#: ../../library/traceback.rst:405 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:407 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:388 +#: ../../library/traceback.rst:409 msgid "" "When *show_group* is ``False``, the generator emits the exception's message " "followed by its notes (if it has any). The exception message is normally a " @@ -442,33 +471,33 @@ msgid "" "the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:398 +#: ../../library/traceback.rst:419 msgid "" "The exception's :attr:`notes ` are now included in " "the output." msgstr "" -#: ../../library/traceback.rst:402 +#: ../../library/traceback.rst:423 #, fuzzy msgid "Added the *show_group* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:407 +#: ../../library/traceback.rst:428 msgid ":class:`!StackSummary` Objects" msgstr ":class:`!StackSummary` 物件" -#: ../../library/traceback.rst:411 +#: ../../library/traceback.rst:432 msgid "" ":class:`!StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:417 +#: ../../library/traceback.rst:438 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:421 +#: ../../library/traceback.rst:442 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 " @@ -478,20 +507,20 @@ msgid "" "class:`!FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:429 +#: ../../library/traceback.rst:450 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:435 +#: ../../library/traceback.rst:456 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:442 +#: ../../library/traceback.rst:463 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single :ref:`frame ` from the stack. " @@ -499,18 +528,18 @@ msgid "" "well, for those items with source text lines." msgstr "" -#: ../../library/traceback.rst:448 +#: ../../library/traceback.rst:469 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:452 +#: ../../library/traceback.rst:473 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:457 +#: ../../library/traceback.rst:478 msgid "" "Returns a string for printing one of the :ref:`frames ` " "involved in the stack. This method is called for each :class:`FrameSummary` " @@ -518,17 +547,17 @@ msgid "" "the frame is omitted from the output." msgstr "" -#: ../../library/traceback.rst:467 +#: ../../library/traceback.rst:488 msgid ":class:`!FrameSummary` Objects" msgstr ":class:`!FrameSummary` 物件" -#: ../../library/traceback.rst:471 +#: ../../library/traceback.rst:492 msgid "" "A :class:`!FrameSummary` object represents a single :ref:`frame ` in a :ref:`traceback `." msgstr "" -#: ../../library/traceback.rst:476 +#: ../../library/traceback.rst:497 msgid "" "Represents a single :ref:`frame ` in the :ref:`traceback " "` or stack that is being formatted or printed. It may " @@ -542,38 +571,38 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:487 +#: ../../library/traceback.rst:508 msgid ":class:`!FrameSummary` instances have the following attributes:" msgstr "" -#: ../../library/traceback.rst:491 +#: ../../library/traceback.rst:512 msgid "" "The filename of the source code for this frame. Equivalent to accessing :" "attr:`f.f_code.co_filename ` on a :ref:`frame object " "` *f*." msgstr "" -#: ../../library/traceback.rst:497 +#: ../../library/traceback.rst:518 msgid "The line number of the source code for this frame." msgstr "" -#: ../../library/traceback.rst:501 +#: ../../library/traceback.rst:522 msgid "" "Equivalent to accessing :attr:`f.f_code.co_name ` on a :" "ref:`frame object ` *f*." msgstr "" -#: ../../library/traceback.rst:506 +#: ../../library/traceback.rst:527 msgid "" "A string representing the source code for this frame, with leading and " "trailing whitespace stripped. If the source is not available, it is ``None``." msgstr "" -#: ../../library/traceback.rst:513 -msgid "Traceback Examples" +#: ../../library/traceback.rst:534 +msgid "Examples of Using the Module-Level Functions" msgstr "" -#: ../../library/traceback.rst:515 +#: ../../library/traceback.rst:536 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 " @@ -581,7 +610,7 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:520 +#: ../../library/traceback.rst:541 msgid "" "import sys, traceback\n" "\n" @@ -600,13 +629,13 @@ msgid "" " run_user_code(envdir)" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:558 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:540 +#: ../../library/traceback.rst:561 msgid "" "import sys, traceback\n" "\n" @@ -618,8 +647,7 @@ msgid "" "\n" "try:\n" " lumberjack()\n" -"except IndexError:\n" -" exc = sys.exception()\n" +"except IndexError as exc:\n" " print(\"*** print_tb:\")\n" " traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)\n" " print(\"*** print_exception:\")\n" @@ -639,11 +667,11 @@ msgid "" " print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)" msgstr "" -#: ../../library/traceback.rst:572 +#: ../../library/traceback.rst:592 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:574 +#: ../../library/traceback.rst:594 msgid "" "*** print_tb:\n" " File \"\", line 10, in \n" @@ -693,13 +721,13 @@ msgid "" "*** tb_lineno: 10" msgstr "" -#: ../../library/traceback.rst:619 +#: ../../library/traceback.rst:639 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:621 +#: ../../library/traceback.rst:641 msgid "" ">>> import traceback\n" ">>> def another_function():\n" @@ -751,11 +779,11 @@ msgstr "" " ' File \"\", line 8, in lumberstack\\n print(repr(traceback." "format_stack()))\\n']" -#: ../../library/traceback.rst:645 +#: ../../library/traceback.rst:665 msgid "This last example demonstrates the final few formatting functions:" msgstr "" -#: ../../library/traceback.rst:647 +#: ../../library/traceback.rst:667 msgid "" ">>> import traceback\n" ">>> traceback.format_list([('spam.py', 3, '', 'spam.eggs()'),\n" @@ -763,22 +791,114 @@ msgid "" "[' File \"spam.py\", line 3, in \\n spam.eggs()\\n',\n" " ' File \"eggs.py\", line 42, in eggs\\n return \"bacon\"\\n']\n" ">>> an_error = IndexError('tuple index out of range')\n" -">>> traceback.format_exception_only(type(an_error), an_error)\n" +">>> traceback.format_exception_only(an_error)\n" "['IndexError: tuple index out of range\\n']" msgstr "" -#: ../../library/traceback.rst:17 +#: ../../library/traceback.rst:681 +#, fuzzy +msgid "Examples of Using :class:`TracebackException`" +msgstr ":class:`!TracebackException` 物件" + +#: ../../library/traceback.rst:683 +msgid "With the helper class, we have more options::" +msgstr "" + +#: ../../library/traceback.rst:685 +msgid "" +">>> import sys\n" +">>> from traceback import TracebackException\n" +">>>\n" +">>> def lumberjack():\n" +"... bright_side_of_life()\n" +"...\n" +">>> def bright_side_of_life():\n" +"... t = \"bright\", \"side\", \"of\", \"life\"\n" +"... return t[5]\n" +"...\n" +">>> try:\n" +"... lumberjack()\n" +"... except IndexError as e:\n" +"... exc = e\n" +"...\n" +">>> try:\n" +"... try:\n" +"... lumberjack()\n" +"... except:\n" +"... 1/0\n" +"... except Exception as e:\n" +"... chained_exc = e\n" +"...\n" +">>> # limit works as with the module-level functions\n" +">>> TracebackException.from_exception(exc, limit=-2).print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 10, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +"IndexError: tuple index out of range\n" +"\n" +">>> # capture_locals adds local variables in frames\n" +">>> TracebackException.from_exception(exc, limit=-2, capture_locals=True)." +"print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 10, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +" t = (\"bright\", \"side\", \"of\", \"life\")\n" +"IndexError: tuple index out of range\n" +"\n" +">>> # The *chain* kwarg to print() controls whether chained\n" +">>> # exceptions are displayed\n" +">>> TracebackException.from_exception(chained_exc).print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 4, in \n" +" lumberjack()\n" +" ~~~~~~~~~~^^\n" +" File \"\", line 7, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 11, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +"IndexError: tuple index out of range\n" +"\n" +"During handling of the above exception, another exception occurred:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in \n" +" 1/0\n" +" ~^~\n" +"ZeroDivisionError: division by zero\n" +"\n" +">>> TracebackException.from_exception(chained_exc).print(chain=False)\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in \n" +" 1/0\n" +" ~^~\n" +"ZeroDivisionError: division by zero" +msgstr "" + +#: ../../library/traceback.rst:21 msgid "object" msgstr "object(物件)" -#: ../../library/traceback.rst:17 +#: ../../library/traceback.rst:21 msgid "traceback" msgstr "traceback" -#: ../../library/traceback.rst:70 +#: ../../library/traceback.rst:87 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/traceback.rst:70 +#: ../../library/traceback.rst:87 msgid "marker" msgstr "marker(標記)" + +#~ msgid "The module defines the following functions:" +#~ msgstr "此模組定義了以下函式:" diff --git a/library/tty.po b/library/tty.po index 56c833a6f6..2c04e96e1c 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,8 +36,8 @@ msgid "" msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" #: ../../library/tty.rst:18 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/tty.rst:20 msgid "" @@ -121,3 +121,6 @@ msgstr ":mod:`termios` 模組" #: ../../library/tty.rst:81 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/library/types.po b/library/types.po index 64c5f320eb..114605cdf6 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -299,7 +299,7 @@ msgstr "" #: ../../library/types.rst:201 msgid "" "The type for cell objects: such objects are used as containers for a " -"function's free variables." +"function's :term:`closure variables `." msgstr "" #: ../../library/types.rst:209 @@ -346,90 +346,47 @@ msgid "" "module to be created and optionally its :term:`docstring`." msgstr "" -#: ../../library/types.rst:264 -msgid "" -"Use :func:`importlib.util.module_from_spec` to create a new module if you " -"wish to set the various import-controlled attributes." -msgstr "" - -#: ../../library/types.rst:269 -msgid "The :term:`docstring` of the module. Defaults to ``None``." -msgstr "" - -#: ../../library/types.rst:273 -msgid "The :term:`loader` which loaded the module. Defaults to ``None``." -msgstr "" - -#: ../../library/types.rst:275 -msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " -"stored in the :attr:`__spec__` object." -msgstr "" - -#: ../../library/types.rst:279 -msgid "" -"A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferably read from the :attr:" -"`__spec__` attribute instead or use ``getattr(module, \"__loader__\", " -"None)`` if you explicitly need to use this attribute." -msgstr "" - -#: ../../library/types.rst:285 ../../library/types.rst:310 -msgid "Defaults to ``None``. Previously the attribute was optional." -msgstr "" - -#: ../../library/types.rst:290 -msgid "" -"The name of the module. Expected to match :attr:`importlib.machinery." -"ModuleSpec.name`." -msgstr "" - -#: ../../library/types.rst:295 -msgid "" -"Which :term:`package` a module belongs to. If the module is top-level (i.e. " -"not a part of any specific package) then the attribute should be set to " -"``''``, else it should be set to the name of the package (which can be :attr:" -"`__name__` if the module is a package itself). Defaults to ``None``." +#: ../../library/types.rst:265 +msgid ":ref:`Documentation on module objects `" msgstr "" -#: ../../library/types.rst:300 +#: ../../library/types.rst:266 msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " -"stored in the :attr:`__spec__` object." +"Provides details on the special attributes that can be found on instances " +"of :class:`!ModuleType`." msgstr "" -#: ../../library/types.rst:304 -msgid "" -"A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferably read from the :attr:" -"`__spec__` attribute instead or use ``getattr(module, \"__package__\", " -"None)`` if you explicitly need to use this attribute." +#: ../../library/types.rst:269 +msgid ":func:`importlib.util.module_from_spec`" msgstr "" -#: ../../library/types.rst:315 +#: ../../library/types.rst:270 msgid "" -"A record of the module's import-system-related state. Expected to be an " -"instance of :class:`importlib.machinery.ModuleSpec`." +"Modules created using the :class:`!ModuleType` constructor are created with " +"many of their special attributes unset or set to default values. :func:`!" +"module_from_spec` provides a more robust way of creating :class:`!" +"ModuleType` instances which ensures the various attributes are set " +"appropriately." msgstr "" -#: ../../library/types.rst:323 +#: ../../library/types.rst:278 msgid "The type of :data:`Ellipsis`." msgstr "" -#: ../../library/types.rst:329 +#: ../../library/types.rst:284 msgid "" "The type of :ref:`parameterized generics ` such as " "``list[int]``." msgstr "" -#: ../../library/types.rst:332 +#: ../../library/types.rst:287 msgid "" "``t_origin`` should be a non-parameterized generic class, such as ``list``, " "``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " "length 1) of types which parameterize ``t_origin``::" msgstr "" -#: ../../library/types.rst:336 +#: ../../library/types.rst:291 msgid "" ">>> from types import GenericAlias\n" "\n" @@ -445,50 +402,50 @@ msgstr "" ">>> dict[str, int] == GenericAlias(dict, (str, int))\n" "True" -#: ../../library/types.rst:345 +#: ../../library/types.rst:300 msgid "This type can now be subclassed." msgstr "" -#: ../../library/types.rst:350 +#: ../../library/types.rst:305 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../library/types.rst:351 +#: ../../library/types.rst:306 msgid "In-depth documentation on instances of :class:`!types.GenericAlias`" msgstr "" -#: ../../library/types.rst:353 +#: ../../library/types.rst:308 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/types.rst:354 +#: ../../library/types.rst:309 msgid "Introducing the :class:`!types.GenericAlias` class" msgstr "" -#: ../../library/types.rst:358 +#: ../../library/types.rst:313 msgid "The type of :ref:`union type expressions`." msgstr "" -#: ../../library/types.rst:364 +#: ../../library/types.rst:319 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" -#: ../../library/types.rst:366 +#: ../../library/types.rst:321 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:373 +#: ../../library/types.rst:328 msgid "" "The type of :ref:`frame objects ` such as found in :attr:`tb." "tb_frame ` if ``tb`` is a traceback object." msgstr "" -#: ../../library/types.rst:379 +#: ../../library/types.rst:334 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as :attr:`FrameType.f_locals ` or ``array.array.typecode``. " @@ -497,7 +454,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:388 +#: ../../library/types.rst:343 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -506,7 +463,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:393 +#: ../../library/types.rst:348 msgid "" "In addition, when a class is defined with a :attr:`~object.__slots__` " "attribute, then for each slot, an instance of :class:`!MemberDescriptorType` " @@ -514,99 +471,99 @@ msgid "" "in the class's :attr:`~type.__dict__`." msgstr "" -#: ../../library/types.rst:399 +#: ../../library/types.rst:354 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:404 +#: ../../library/types.rst:359 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:412 +#: ../../library/types.rst:367 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:417 +#: ../../library/types.rst:372 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:422 +#: ../../library/types.rst:377 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:427 +#: ../../library/types.rst:382 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:432 +#: ../../library/types.rst:387 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:436 +#: ../../library/types.rst:391 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:440 +#: ../../library/types.rst:395 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:446 +#: ../../library/types.rst:401 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:451 +#: ../../library/types.rst:406 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:455 +#: ../../library/types.rst:410 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:459 +#: ../../library/types.rst:414 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:465 +#: ../../library/types.rst:420 msgid "Return a hash of the underlying mapping." msgstr "" -#: ../../library/types.rst:471 +#: ../../library/types.rst:426 msgid "The type of :ref:`capsule objects `." msgstr "" -#: ../../library/types.rst:477 +#: ../../library/types.rst:432 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:481 +#: ../../library/types.rst:436 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:484 +#: ../../library/types.rst:439 msgid "" "Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and " "remove attributes." msgstr "" -#: ../../library/types.rst:487 +#: ../../library/types.rst:442 msgid "" ":py:class:`SimpleNamespace` objects may be initialized in the same way as :" "class:`dict`: either with keyword arguments, with a single positional " @@ -617,11 +574,11 @@ msgid "" "`iterable` object producing key-value pairs). All such keys must be strings." msgstr "" -#: ../../library/types.rst:498 +#: ../../library/types.rst:453 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:500 +#: ../../library/types.rst:455 msgid "" "class SimpleNamespace:\n" " def __init__(self, mapping_or_iterable=(), /, **kwargs):\n" @@ -653,33 +610,33 @@ msgstr "" " return self.__dict__ == other.__dict__\n" " return NotImplemented" -#: ../../library/types.rst:514 +#: ../../library/types.rst:469 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:518 +#: ../../library/types.rst:473 msgid "" ":class:`!SimpleNamespace` objects are supported by :func:`copy.replace`." msgstr "" -#: ../../library/types.rst:522 +#: ../../library/types.rst:477 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:526 +#: ../../library/types.rst:481 msgid "Added support for an optional positional argument." msgstr "" -#: ../../library/types.rst:531 +#: ../../library/types.rst:486 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:533 +#: ../../library/types.rst:488 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -687,18 +644,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:538 +#: ../../library/types.rst:493 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:545 +#: ../../library/types.rst:500 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:549 +#: ../../library/types.rst:504 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -708,11 +665,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:556 +#: ../../library/types.rst:511 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:558 +#: ../../library/types.rst:513 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 " diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 45fb032f8e..9489413183 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -94,9 +94,10 @@ msgstr "" "可用的屬性,然後對它們的使用方式做出判定:" #: ../../library/unittest.mock.rst:71 +#, fuzzy msgid "" -":attr:`side_effect` allows you to perform side effects, including raising an " -"exception when a mock is called:" +":attr:`~Mock.side_effect` allows you to perform side effects, including " +"raising an exception when a mock is called:" msgstr "" ":attr:`side_effect` 允許你執行 side effects,包含在 mock 被呼叫時引發例外:" @@ -755,19 +756,21 @@ msgstr "" "數不會被記錄,因此在比較時它們將始終相等:" #: ../../library/unittest.mock.rst:740 +#, fuzzy msgid "" -"Normally the :attr:`__class__` attribute of an object will return its type. " -"For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " -"instead. This allows mock objects to pass :func:`isinstance` tests for the " -"object they are replacing / masquerading as:" +"Normally the :attr:`!__class__` attribute of an object will return its type. " +"For a mock object with a :attr:`!spec`, :attr:`!__class__` returns the spec " +"class instead. This allows mock objects to pass :func:`isinstance` tests for " +"the object they are replacing / masquerading as:" msgstr "" "通常,物件的 :attr:`__class__` 屬性會回傳它的型別。但對於擁有 :attr:`spec` " "的 mock 物件,``__class__`` 會回傳 spec 的類別。這允許 mock 物件通過對它們所" "替代或偽裝的物件進行的 :func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:749 +#, fuzzy msgid "" -":attr:`__class__` is assignable to, this allows a mock to pass an :func:" +":attr:`!__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" ":attr:`__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" @@ -783,9 +786,10 @@ msgstr "" "例外為 *return_value* 和 *side_effect* 在不可呼叫的 mock 上無意義。" #: ../../library/unittest.mock.rst:763 +#, fuzzy msgid "" -"Mock objects that use a class or an instance as a :attr:`spec` or :attr:" -"`spec_set` are able to pass :func:`isinstance` tests:" +"Mock objects that use a class or an instance as a :attr:`!spec` or :attr:`!" +"spec_set` are able to pass :func:`isinstance` tests:" msgstr "" "使用類別或實例作為 :attr:`spec` 或 :attr:`spec_set` 的 mock 物件能夠通過 :" "func:`isinstance` 測試:" @@ -1201,10 +1205,11 @@ msgstr "" "call_args_list` 等屬性中。" #: ../../library/unittest.mock.rst:1177 +#, fuzzy msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " -"has been recorded, so if :attr:`side_effect` raises an exception the call is " -"still recorded." +"has been recorded, so if :attr:`!side_effect` raises an exception the call " +"is still recorded." msgstr "" "如果 :attr:`~Mock.side_effect` 被設定,那麼在呼叫被記錄後它才會被呼叫,所以如" "果 :attr:`side_effect` 引發例外,呼叫仍然會被記錄。" @@ -1218,40 +1223,44 @@ msgstr "" "或實例:" #: ../../library/unittest.mock.rst:1199 +#, fuzzy msgid "" -"If :attr:`side_effect` is a function then whatever that function returns is " -"what calls to the mock return. The :attr:`side_effect` function is called " -"with the same arguments as the mock. This allows you to vary the return " -"value of the call dynamically, based on the input:" +"If :attr:`~Mock.side_effect` is a function then whatever that function " +"returns is what calls to the mock return. The :attr:`!side_effect` function " +"is called with the same arguments as the mock. This allows you to vary the " +"return value of the call dynamically, based on the input:" msgstr "" "如果 :attr:`side_effect` 是一個函式,則該函式回傳的東西就是對 mock 的呼叫所回" "傳的值。:attr:`side_effect` 函式會使用與 mock 相同的引數被呼叫。這讓你可以根" "據輸入動態地變更呼叫的回傳值:" #: ../../library/unittest.mock.rst:1215 +#, fuzzy msgid "" "If you want the mock to still return the default return value (a new mock), " "or any set return value, then there are two ways of doing this. Either " -"return :attr:`mock.return_value` from inside :attr:`side_effect`, or return :" -"data:`DEFAULT`:" +"return :attr:`~Mock.return_value` from inside :attr:`~Mock.side_effect`, or " +"return :data:`DEFAULT`:" msgstr "" "如果你希望 mock 仍然回傳預設的回傳值(一個新的 mock),或者是任何已設定的回傳" "值,有兩種方法可以實現。從 :attr:`side_effect` 內部回傳 :attr:`mock." "return_value`,或回傳 :data:`DEFAULT`:" #: ../../library/unittest.mock.rst:1234 +#, fuzzy msgid "" -"To remove a :attr:`side_effect`, and return to the default behaviour, set " -"the :attr:`side_effect` to ``None``:" +"To remove a :attr:`~Mock.side_effect`, and return to the default behaviour, " +"set the :attr:`!side_effect` to ``None``:" msgstr "" "要刪除 :attr:`side_effect`,並恢復預設行為,將 :attr:`side_effect` 設為 " "``None``:" #: ../../library/unittest.mock.rst:1248 +#, fuzzy msgid "" -"The :attr:`side_effect` can also be any iterable object. Repeated calls to " -"the mock will return values from the iterable (until the iterable is " -"exhausted and a :exc:`StopIteration` is raised):" +"The :attr:`~Mock.side_effect` can also be any iterable object. Repeated " +"calls to the mock will return values from the iterable (until the iterable " +"is exhausted and a :exc:`StopIteration` is raised):" msgstr "" ":attr:`side_effect` 也可以是任何可疊代的物件。對 mock 的重複呼叫將從可疊代物" "件中回傳值(直到疊代物件耗盡並引發 :exc:`StopIteration` 為止):" @@ -1297,10 +1306,11 @@ msgid "" msgstr "Mock 物件會在需要時建立屬性。這使得它們可以假裝成任何種類的物件。" #: ../../library/unittest.mock.rst:1287 +#, fuzzy msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " "raise an :exc:`AttributeError` when an attribute is fetched. You can do this " -"by providing an object as a :attr:`spec` for a mock, but that isn't always " +"by providing an object as a :attr:`!spec` for a mock, but that isn't always " "convenient." msgstr "" "你可能希望一個 mock 物件在 :func:`hasattr` 呼叫時回傳 ``False``,或者在屬性被" @@ -1575,14 +1585,15 @@ msgstr "" "被加入。" #: ../../library/unittest.mock.rst:1458 +#, fuzzy msgid "" -"Patch can be used as a :class:`TestCase` class decorator. It works by " -"decorating each test method in the class. This reduces the boilerplate code " -"when your test methods share a common patchings set. :func:`patch` finds " -"tests by looking for method names that start with ``patch.TEST_PREFIX``. By " -"default this is ``'test'``, which matches the way :mod:`unittest` finds " -"tests. You can specify an alternative prefix by setting ``patch." -"TEST_PREFIX``." +"Patch can be used as a :class:`~unittest.TestCase` class decorator. It works " +"by decorating each test method in the class. This reduces the boilerplate " +"code when your test methods share a common patchings set. :func:`patch` " +"finds tests by looking for method names that start with ``patch." +"TEST_PREFIX``. By default this is ``'test'``, which matches the way :mod:" +"`unittest` finds tests. You can specify an alternative prefix by setting " +"``patch.TEST_PREFIX``." msgstr "" "patch 可以做為 :class:`TestCase` 類別的裝飾器使用。它透過裝飾類別中的每個測試" "方法來運作。當你的測試方法共享一組常見的 patch 時,這會減少繁冗的代碼。:func:" @@ -1662,9 +1673,10 @@ msgstr "" "的 mock。 或者你可以將 *return_value* 設定成你想要的任何值。" #: ../../library/unittest.mock.rst:1495 +#, fuzzy msgid "" "To configure return values on methods of *instances* on the patched class " -"you must do this on the :attr:`return_value`. For example::" +"you must do this on the :attr:`~Mock.return_value`. For example::" msgstr "" "若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須在 :attr:" "`return_value` 上進行配置。 例如: ::" @@ -2211,20 +2223,22 @@ msgid "patch methods: start and stop" msgstr "patch 方法:啟動與停止" #: ../../library/unittest.mock.rst:1817 +#, fuzzy msgid "" -"All the patchers have :meth:`start` and :meth:`stop` methods. These make it " -"simpler to do patching in ``setUp`` methods or where you want to do multiple " -"patches without nesting decorators or with statements." +"All the patchers have :meth:`!start` and :meth:`!stop` methods. These make " +"it simpler to do patching in ``setUp`` methods or where you want to do " +"multiple patches without nesting decorators or with statements." msgstr "" "所有的 patcher 都有 :meth:`start` 與 :meth:`stop` 方法。這使得在 ``setUp`` 方" "法中進行 patch 或在你想要在沒有巢狀使用裝飾器或 with 陳述式的情況下進行多個 " "patch 時變得更簡單。" #: ../../library/unittest.mock.rst:1821 +#, fuzzy msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " "as normal and keep a reference to the returned ``patcher`` object. You can " -"then call :meth:`start` to put the patch in place and :meth:`stop` to undo " +"then call :meth:`!start` to put the patch in place and :meth:`!stop` to undo " "it." msgstr "" "要使用它們,請像平常一樣呼叫 :func:`patch`、:func:`patch.object` 或 :func:" @@ -2262,9 +2276,10 @@ msgstr "" ">>> assert module.ClassName is not new_mock" #: ../../library/unittest.mock.rst:1839 +#, fuzzy msgid "" "A typical use case for this might be for doing multiple patches in the " -"``setUp`` method of a :class:`TestCase`::" +"``setUp`` method of a :class:`~unittest.TestCase`::" msgstr "" "一個典型的用法是在一個 :class:`TestCase` 的 ``setUp`` 方法中執行多個 " "patch: ::" @@ -3355,10 +3370,11 @@ msgstr "" " ..." #: ../../library/unittest.mock.rst:2511 +#, fuzzy msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " -"of :const:`mock.FILTER_DIR`." +"of :const:`FILTER_DIR`." msgstr "" "或者,你可以只使用 ``vars(my_mock)``\\ (實例成員)和 " "``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考慮 :const:`mock." @@ -3386,16 +3402,17 @@ msgstr "" "建立一個 :class:`MagicMock`,其 API 限制在標準檔案處理上可用的方法或屬性。" #: ../../library/unittest.mock.rst:2528 +#, fuzzy msgid "" -"*read_data* is a string for the :meth:`~io.IOBase.read`, :meth:`~io.IOBase." -"readline`, and :meth:`~io.IOBase.readlines` methods of the file handle to " -"return. Calls to those methods will take data from *read_data* until it is " -"depleted. The mock of these methods is pretty simplistic: every time the " -"*mock* is called, the *read_data* is rewound to the start. If you need more " -"control over the data that you are feeding to the tested code you will need " -"to customize this mock for yourself. When that is insufficient, one of the " -"in-memory filesystem packages on `PyPI `_ can offer a " -"realistic filesystem for testing." +"*read_data* is a string for the :meth:`~io.RawIOBase.read`, :meth:`~io." +"IOBase.readline`, and :meth:`~io.IOBase.readlines` methods of the file " +"handle to return. Calls to those methods will take data from *read_data* " +"until it is depleted. The mock of these methods is pretty simplistic: every " +"time the *mock* is called, the *read_data* is rewound to the start. If you " +"need more control over the data that you are feeding to the tested code you " +"will need to customize this mock for yourself. When that is insufficient, " +"one of the in-memory filesystem packages on `PyPI `_ can " +"offer a realistic filesystem for testing." msgstr "" "*read_data* 是檔案處理方法 :meth:`~io.IOBase.read`、:meth:`~io.IOBase." "readline` 和 :meth:`~io.IOBase.readlines` 的回傳字串。對這些方法的呼叫將從 " @@ -3406,9 +3423,10 @@ msgstr "" "試的真實檔案系統。" #: ../../library/unittest.mock.rst:2538 +#, fuzzy msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " -"The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " +"The mock of :meth:`~io.RawIOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" "新增對 :meth:`~io.IOBase.readline` 和 :meth:`~io.IOBase.readlines` 的支援。:" @@ -3516,8 +3534,9 @@ msgid "Autospeccing" msgstr "Autospeccing(自動規格)" #: ../../library/unittest.mock.rst:2592 +#, fuzzy msgid "" -"Autospeccing is based on the existing :attr:`spec` feature of mock. It " +"Autospeccing is based on the existing :attr:`!spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " "is recursive (implemented lazily) so that attributes of mocks only have the " "same api as the attributes of the spec. In addition mocked functions / " @@ -3566,10 +3585,11 @@ msgstr "" "果你不測試你的單元是如何「連接在一起」的,那麼測試還是有機會發現很多錯誤。" #: ../../library/unittest.mock.rst:2617 +#, fuzzy msgid "" -":mod:`mock` already provides a feature to help with this, called speccing. " -"If you use a class or instance as the :attr:`spec` for a mock then you can " -"only access attributes on the mock that exist on the real class:" +":mod:`unittest.mock` already provides a feature to help with this, called " +"speccing. If you use a class or instance as the :attr:`!spec` for a mock " +"then you can only access attributes on the mock that exist on the real class:" msgstr "" ":mod:`mock` 已經提供了一個功能來幫助解決這個問題,其稱為 speccing。如果你使用" "類別或實例作為 mock 的 :attr:`spec`,那麼你在 mock 上只能存取真實類別中存在的" @@ -3632,8 +3652,9 @@ msgstr "" "" #: ../../library/unittest.mock.rst:2656 +#, fuzzy msgid "" -"You can see that :class:`request.Request` has a spec. :class:`request." +"You can see that :class:`!request.Request` has a spec. :class:`!request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" @@ -3670,9 +3691,10 @@ msgstr "" "" #: ../../library/unittest.mock.rst:2672 +#, fuzzy msgid "" -":class:`Request` objects are not callable, so the return value of " -"instantiating our mocked out :class:`request.Request` is a non-callable " +":class:`!Request` objects are not callable, so the return value of " +"instantiating our mocked out :class:`!request.Request` is a non-callable " "mock. With the spec in place any typos in our asserts will raise the correct " "error::" msgstr "" @@ -3932,8 +3954,10 @@ msgstr "" ">>> mock.not_submock.attribute2 # This won't raise." #: ../../library/unittest.mock.rst:2826 +#, fuzzy msgid "" -"Order of precedence of :attr:`side_effect`, :attr:`return_value` and *wraps*" +"Order of precedence of :attr:`!side_effect`, :attr:`!return_value` and " +"*wraps*" msgstr ":attr:`side_effect`、:attr:`return_value` 和 *wraps* 的優先順序" #: ../../library/unittest.mock.rst:2828 diff --git a/library/urllib.request.po b/library/urllib.request.po index 3fb995ae69..bfe35b0016 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -54,7 +54,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/venv.po b/library/venv.po index e78a34e10c..4735b754e0 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,7 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 @@ -409,9 +409,9 @@ msgstr "csh/tcsh" msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:218 ../../library/venv.rst:222 -msgid "PowerShell" -msgstr "PowerShell" +#: ../../library/venv.rst:218 +msgid "pwsh" +msgstr "" #: ../../library/venv.rst:218 msgid ":samp:`$ {}/bin/Activate.ps1`" @@ -429,6 +429,10 @@ msgstr "cmd.exe" msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" +#: ../../library/venv.rst:222 +msgid "PowerShell" +msgstr "PowerShell" + #: ../../library/venv.rst:222 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" diff --git a/library/webbrowser.po b/library/webbrowser.po index 771f0b8dad..5681e43e79 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -95,7 +95,7 @@ msgid "python -m webbrowser -t \"https://www.python.org\"" msgstr "python -m webbrowser -t \"https://www.python.org\"" #: ../../library/webbrowser.rst:54 -msgid ":ref:`Availability `: not WASI, not Android." +msgid "Availability" msgstr "" #: ../../library/webbrowser.rst:56 diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index f4751962b1..a6c981f268 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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 "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index c3daa17cde..3b4992dbbf 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -42,7 +42,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 3e5a4a6662..a938c56cde 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -55,7 +55,7 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." +msgid "Availability" msgstr "" #: ../../includes/wasm-notavail.rst:5 diff --git a/reference/datamodel.po b/reference/datamodel.po index 145ac09302..aa4a8aca30 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -604,18 +604,18 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1206 -#: ../../reference/datamodel.rst:1403 +#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1395 +#: ../../reference/datamodel.rst:1596 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" -#: ../../reference/datamodel.rst:555 ../../reference/datamodel.rst:589 -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:555 ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:1170 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:590 -#: ../../reference/datamodel.rst:982 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:591 +#: ../../reference/datamodel.rst:1171 msgid "Meaning" msgstr "含義" @@ -628,69 +628,70 @@ msgstr "" #: ../../reference/datamodel.rst:564 msgid "" -"``None`` or a :class:`tuple` of cells that contain bindings for the " -"function's free variables." +"``None`` or a :class:`tuple` of cells that contain bindings for the names " +"specified in the :attr:`~codeobject.co_freevars` attribute of the " +"function's :attr:`code object `." msgstr "" -#: ../../reference/datamodel.rst:567 +#: ../../reference/datamodel.rst:568 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:571 ../../reference/datamodel.rst:1445 +#: ../../reference/datamodel.rst:572 ../../reference/datamodel.rst:1638 msgid "Special writable attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:584 +#: ../../reference/datamodel.rst:585 msgid "Most of these attributes check the type of the assigned value:" msgstr "" -#: ../../reference/datamodel.rst:593 +#: ../../reference/datamodel.rst:594 #, fuzzy msgid "The function's documentation string, or ``None`` if unavailable." msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:596 +#: ../../reference/datamodel.rst:597 msgid "" "The function's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:601 msgid "" "The function's :term:`qualified name`. See also: :attr:`__qualname__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:606 +#: ../../reference/datamodel.rst:607 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:611 msgid "" "A :class:`tuple` containing default :term:`parameter` values for those " "parameters that have defaults, or ``None`` if no parameters have a default " "value." msgstr "" -#: ../../reference/datamodel.rst:615 +#: ../../reference/datamodel.rst:616 msgid "" "The :ref:`code object ` representing the compiled function " "body." msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" -#: ../../reference/datamodel.rst:619 +#: ../../reference/datamodel.rst:620 msgid "" "The namespace supporting arbitrary function attributes. See also: :attr:" "`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:623 +#: ../../reference/datamodel.rst:624 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " @@ -698,88 +699,88 @@ msgid "" "`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:630 +#: ../../reference/datamodel.rst:631 msgid "" "A :class:`dictionary ` containing defaults for keyword-only :term:" "`parameters `." msgstr "" -#: ../../reference/datamodel.rst:634 +#: ../../reference/datamodel.rst:635 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic function `." msgstr "" -#: ../../reference/datamodel.rst:639 +#: ../../reference/datamodel.rst:640 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " "attribute dot-notation is used to get and set such attributes." msgstr "" -#: ../../reference/datamodel.rst:645 +#: ../../reference/datamodel.rst:646 msgid "" "CPython's current implementation only supports function attributes on user-" "defined functions. Function attributes on :ref:`built-in functions ` may be supported in the future." msgstr "" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:651 msgid "" "Additional information about a function's definition can be retrieved from " "its :ref:`code object ` (accessible via the :attr:`~function." "__code__` attribute)." msgstr "" -#: ../../reference/datamodel.rst:658 +#: ../../reference/datamodel.rst:659 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:665 +#: ../../reference/datamodel.rst:666 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:675 ../../reference/datamodel.rst:1541 +#: ../../reference/datamodel.rst:676 ../../reference/datamodel.rst:1734 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" -#: ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:681 msgid "" "Refers to the class instance object to which the method is :ref:`bound " "`" msgstr "" -#: ../../reference/datamodel.rst:684 +#: ../../reference/datamodel.rst:685 msgid "Refers to the original :ref:`function object `" msgstr "" -#: ../../reference/datamodel.rst:687 +#: ../../reference/datamodel.rst:688 msgid "" "The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" -#: ../../reference/datamodel.rst:693 +#: ../../reference/datamodel.rst:694 msgid "" "The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:698 msgid "" "The name of the module the method was defined in, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:700 +#: ../../reference/datamodel.rst:701 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:703 +#: ../../reference/datamodel.rst:704 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" @@ -787,7 +788,7 @@ msgid "" "`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:711 msgid "" "When an instance method object is created by retrieving a user-defined :ref:" "`function object ` from a class via one of its " @@ -796,7 +797,7 @@ msgid "" "__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:716 +#: ../../reference/datamodel.rst:717 msgid "" "When an instance method object is created by retrieving a :class:" "`classmethod` object from a class or instance, its :attr:`~method.__self__` " @@ -804,7 +805,7 @@ msgid "" "the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:721 +#: ../../reference/datamodel.rst:722 msgid "" "When an instance method object is called, the underlying function (:attr:" "`~method.__func__`) is called, inserting the class instance (:attr:`~method." @@ -814,7 +815,7 @@ msgid "" "f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:728 +#: ../../reference/datamodel.rst:729 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " @@ -823,18 +824,18 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:734 msgid "" "It is important to note that user-defined functions which are attributes of " "a class instance are not converted to bound methods; this *only* happens " "when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:740 +#: ../../reference/datamodel.rst:741 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:746 +#: ../../reference/datamodel.rst:747 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -847,11 +848,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:758 +#: ../../reference/datamodel.rst:759 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:763 +#: ../../reference/datamodel.rst:764 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -860,11 +861,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:771 +#: ../../reference/datamodel.rst:772 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:777 +#: ../../reference/datamodel.rst:778 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -873,7 +874,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:783 +#: ../../reference/datamodel.rst:784 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -884,11 +885,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:796 +#: ../../reference/datamodel.rst:797 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:803 +#: ../../reference/datamodel.rst:804 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -896,7 +897,7 @@ msgid "" "determined by the C function. Special read-only attributes:" msgstr "" -#: ../../reference/datamodel.rst:808 +#: ../../reference/datamodel.rst:809 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." @@ -904,26 +905,26 @@ msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:811 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" -#: ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:812 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." msgstr "" -#: ../../reference/datamodel.rst:812 +#: ../../reference/datamodel.rst:813 msgid "" ":attr:`!__module__` is the name of the module the function was defined in or " "``None`` if unavailable. See :attr:`function.__module__`." msgstr "" -#: ../../reference/datamodel.rst:820 +#: ../../reference/datamodel.rst:821 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:827 +#: ../../reference/datamodel.rst:828 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -934,11 +935,11 @@ msgid "" "__self__>`.)" msgstr "" -#: ../../reference/datamodel.rst:837 +#: ../../reference/datamodel.rst:838 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:839 +#: ../../reference/datamodel.rst:840 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -947,21 +948,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:847 +#: ../../reference/datamodel.rst:848 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:849 +#: ../../reference/datamodel.rst:850 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:854 +#: ../../reference/datamodel.rst:857 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:863 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -976,63 +977,291 @@ msgid "" "done)." msgstr "" -#: ../../reference/datamodel.rst:873 +#: ../../reference/datamodel.rst:876 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:883 -msgid "Predefined (writable) attributes:" +#: ../../reference/datamodel.rst:894 +msgid "Import-related attributes on module objects" msgstr "" -#: ../../reference/datamodel.rst:885 -msgid ":attr:`__name__`" -msgstr ":attr:`__name__`" +#: ../../reference/datamodel.rst:896 +msgid "" +"Module objects have the following attributes that relate to the :ref:`import " +"system `. When a module is created using the machinery " +"associated with the import system, these attributes are filled in based on " +"the module's :term:`spec `, before the :term:`loader` executes " +"and loads the module." +msgstr "" -#: ../../reference/datamodel.rst:886 -msgid "The module's name." +#: ../../reference/datamodel.rst:902 +msgid "" +"To create a module dynamically rather than using the import system, it's " +"recommended to use :func:`importlib.util.module_from_spec`, which will set " +"the various import-controlled attributes to appropriate values. It's also " +"possible to use the :class:`types.ModuleType` constructor to create modules " +"directly, but this technique is more error-prone, as most attributes must be " +"manually set on the module object after it has been created when using this " +"approach." msgstr "" -#: ../../reference/datamodel.rst:888 -msgid ":attr:`__doc__`" -msgstr ":attr:`__doc__`" +#: ../../reference/datamodel.rst:912 +msgid "" +"With the exception of :attr:`~module.__name__`, it is **strongly** " +"recommended that you rely on :attr:`~module.__spec__` and its attributes " +"instead of any of the other individual attributes listed in this subsection. " +"Note that updating an attribute on :attr:`!__spec__` will not update the " +"corresponding attribute on the module itself:" +msgstr "" -#: ../../reference/datamodel.rst:889 -msgid "The module's documentation string, or ``None`` if unavailable." +#: ../../reference/datamodel.rst:918 +msgid "" +">>> import typing\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'typing')\n" +">>> typing.__spec__.name = 'spelling'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'spelling')\n" +">>> typing.__name__ = 'keyboard_smashing'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('keyboard_smashing', 'spelling')" msgstr "" -#: ../../reference/datamodel.rst:892 -msgid ":attr:`__file__`" -msgstr ":attr:`__file__`" +#: ../../reference/datamodel.rst:932 +msgid "" +"The name used to uniquely identify the module in the import system. For a " +"directly executed module, this will be set to ``\"__main__\"``." +msgstr "" -#: ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:935 msgid "" -"The pathname of the file from which the module was loaded, if it was loaded " -"from a file. The :attr:`__file__` attribute may be missing for certain types " -"of modules, such as C modules that are statically linked into the " -"interpreter. For extension modules loaded dynamically from a shared " -"library, it's the pathname of the shared library file." +"This attribute must be set to the fully qualified name of the module. It is " +"expected to match the value of :attr:`module.__spec__.name `." msgstr "" -#: ../../reference/datamodel.rst:901 -msgid ":attr:`__annotations__`" -msgstr ":attr:`__annotations__`" +#: ../../reference/datamodel.rst:941 +msgid "A record of the module's import-system-related state." +msgstr "" -#: ../../reference/datamodel.rst:902 +#: ../../reference/datamodel.rst:943 +msgid "" +"Set to the :class:`module spec ` that was " +"used when importing the module. See :ref:`module-specs` for more details." +msgstr "" + +#: ../../reference/datamodel.rst:950 +msgid "The :term:`package` a module belongs to." +msgstr "" + +#: ../../reference/datamodel.rst:952 +msgid "" +"If the module is top-level (that is, not a part of any specific package) " +"then the attribute should be set to ``''`` (the empty string). Otherwise, it " +"should be set to the name of the module's package (which can be equal to :" +"attr:`module.__name__` if the module itself is a package). See :pep:`366` " +"for further details." +msgstr "" + +#: ../../reference/datamodel.rst:958 +msgid "" +"This attribute is used instead of :attr:`~module.__name__` to calculate " +"explicit relative imports for main modules. It defaults to ``None`` for " +"modules created dynamically using the :class:`types.ModuleType` constructor; " +"use :func:`importlib.util.module_from_spec` instead to ensure the attribute " +"is set to a :class:`str`." +msgstr "" + +#: ../../reference/datamodel.rst:964 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.parent " +"` instead of :attr:`!module." +"__package__`. :attr:`__package__` is now only used as a fallback if :attr:`!" +"__spec__.parent` is not set, and this fallback path is deprecated." +msgstr "" + +#: ../../reference/datamodel.rst:970 ../../reference/datamodel.rst:1011 +msgid "" +"This attribute now defaults to ``None`` for modules created dynamically " +"using the :class:`types.ModuleType` constructor. Previously the attribute " +"was optional." +msgstr "" + +#: ../../reference/datamodel.rst:975 +msgid "" +"The value of :attr:`!__package__` is expected to be the same as :attr:" +"`__spec__.parent `. :attr:" +"`__package__` is now only used as a fallback during import resolution if :" +"attr:`!__spec__.parent` is not defined." +msgstr "" + +#: ../../reference/datamodel.rst:981 +msgid "" +":exc:`ImportWarning` is raised if an import resolution falls back to :attr:`!" +"__package__` instead of :attr:`__spec__.parent `." +msgstr "" + +#: ../../reference/datamodel.rst:986 +msgid "" +"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " +"back to :attr:`!__package__` during import resolution." +msgstr "" + +#: ../../reference/datamodel.rst:990 +msgid "" +":attr:`!__package__` will cease to be set or taken into consideration by the " +"import system or standard library." +msgstr "" + +#: ../../reference/datamodel.rst:996 +msgid "" +"The :term:`loader` object that the import machinery used to load the module." +msgstr "" + +#: ../../reference/datamodel.rst:998 +msgid "" +"This attribute is mostly useful for introspection, but can be used for " +"additional loader-specific functionality, for example getting data " +"associated with a loader." +msgstr "" + +#: ../../reference/datamodel.rst:1002 +msgid "" +":attr:`!__loader__` defaults to ``None`` for modules created dynamically " +"using the :class:`types.ModuleType` constructor; use :func:`importlib.util." +"module_from_spec` instead to ensure the attribute is set to a :term:`loader` " +"object." +msgstr "" + +#: ../../reference/datamodel.rst:1007 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.loader " +"` instead of :attr:`!module." +"__loader__`." +msgstr "" + +#: ../../reference/datamodel.rst:1016 +msgid "" +"Setting :attr:`!__loader__` on a module while failing to set :attr:`!" +"__spec__.loader` is deprecated. In Python 3.14, :attr:`!__loader__` will " +"cease to be set or taken into consideration by the import system or the " +"standard library." +msgstr "" + +#: ../../reference/datamodel.rst:1024 +msgid "" +"A (possibly empty) :term:`sequence` of strings enumerating the locations " +"where the package's submodules will be found. Non-package modules should not " +"have a :attr:`!__path__` attribute. See :ref:`package-path-rules` for more " +"details." +msgstr "" + +#: ../../reference/datamodel.rst:1029 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__." +"submodule_search_locations ` instead of :attr:`!module.__path__`." +msgstr "" + +#: ../../reference/datamodel.rst:1036 +msgid "" +":attr:`!__file__` and :attr:`!__cached__` are both optional attributes that " +"may or may not be set. Both attributes should be a :class:`str` when they " +"are available." +msgstr "" + +#: ../../reference/datamodel.rst:1040 +msgid "" +":attr:`!__file__` indicates the pathname of the file from which the module " +"was loaded (if loaded from a file), or the pathname of the shared library " +"file for extension modules loaded dynamically from a shared library. It " +"might be missing for certain types of modules, such as C modules that are " +"statically linked into the interpreter, and the :ref:`import system " +"` may opt to leave it unset if it has no semantic meaning (for " +"example, a module loaded from a database)." +msgstr "" + +#: ../../reference/datamodel.rst:1048 +msgid "" +"If :attr:`!__file__` is set then the :attr:`!__cached__` attribute might " +"also be set, which is the path to any compiled version of the code (for " +"example, a byte-compiled file). The file does not need to exist to set this " +"attribute; the path can simply point to where the compiled file *would* " +"exist (see :pep:`3147`)." +msgstr "" + +#: ../../reference/datamodel.rst:1054 +msgid "" +"Note that :attr:`!__cached__` may be set even if :attr:`!__file__` is not " +"set. However, that scenario is quite atypical. Ultimately, the :term:" +"`loader` is what makes use of the module spec provided by the :term:`finder` " +"(from which :attr:`!__file__` and :attr:`!__cached__` are derived). So if a " +"loader can load from a cached module but otherwise does not load from a " +"file, that atypical scenario may be appropriate." +msgstr "" + +#: ../../reference/datamodel.rst:1061 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.cached " +"` instead of :attr:`!module." +"__cached__`." +msgstr "" + +#: ../../reference/datamodel.rst:1065 +msgid "" +"Setting :attr:`!__cached__` on a module while failing to set :attr:`!" +"__spec__.cached` is deprecated. In Python 3.15, :attr:`!__cached__` will " +"cease to be set or taken into consideration by the import system or standard " +"library." +msgstr "" + +#: ../../reference/datamodel.rst:1072 +#, fuzzy +msgid "Other writable attributes on module objects" +msgstr "特殊可寫屬性" + +#: ../../reference/datamodel.rst:1074 +msgid "" +"As well as the import-related attributes listed above, module objects also " +"have the following writable attributes:" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +#, fuzzy +msgid "" +"The module's documentation string, or ``None`` if unavailable. See also: :" +"attr:`__doc__ attributes `." +msgstr "" +":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" +"`function.__doc__`。" + +#: ../../reference/datamodel.rst:1084 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:909 +#: ../../reference/datamodel.rst:1090 +#, fuzzy +msgid "Module dictionaries" +msgstr "字典" + +#: ../../reference/datamodel.rst:1092 +msgid "Module objects also have the following special read-only attribute:" +msgstr "" + +#: ../../reference/datamodel.rst:1097 msgid "" -"Special read-only attribute: :attr:`~object.__dict__` is the module's " -"namespace as a dictionary object." +"The module's namespace as a dictionary object. Uniquely among the attributes " +"listed here, :attr:`!__dict__` cannot be accessed as a global variable from " +"within a module; it can only be accessed as an attribute on module objects." msgstr "" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:1103 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1040,11 +1269,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:923 +#: ../../reference/datamodel.rst:1112 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:925 +#: ../../reference/datamodel.rst:1114 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1059,7 +1288,7 @@ msgid "" "found at :ref:`python_2.3_mro`." msgstr "" -#: ../../reference/datamodel.rst:946 +#: ../../reference/datamodel.rst:1135 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1070,67 +1299,67 @@ msgid "" "contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:957 +#: ../../reference/datamodel.rst:1146 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:1151 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:965 ../../reference/datamodel.rst:1112 +#: ../../reference/datamodel.rst:1154 ../../reference/datamodel.rst:1301 #, fuzzy msgid "Special attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:985 +#: ../../reference/datamodel.rst:1174 msgid "" "The class's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:989 +#: ../../reference/datamodel.rst:1178 msgid "" "The class's :term:`qualified name`. See also: :attr:`__qualname__ attributes " "`." msgstr "" -#: ../../reference/datamodel.rst:993 +#: ../../reference/datamodel.rst:1182 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:996 +#: ../../reference/datamodel.rst:1185 msgid "" "A :class:`mapping proxy ` providing a read-only view " "of the class's namespace. See also: :attr:`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1001 +#: ../../reference/datamodel.rst:1190 msgid "" "A :class:`tuple` containing the class's bases. In most cases, for a class " "defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to " "``(A, B, C)``." msgstr "" -#: ../../reference/datamodel.rst:1006 +#: ../../reference/datamodel.rst:1195 msgid "" "The class's documentation string, or ``None`` if undefined. Not inherited by " "subclasses." msgstr "" -#: ../../reference/datamodel.rst:1010 +#: ../../reference/datamodel.rst:1199 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`!__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:1017 +#: ../../reference/datamodel.rst:1206 msgid "" "Accessing the :attr:`!__annotations__` attribute of a class object directly " "may yield incorrect results in the presence of metaclasses. In addition, the " @@ -1138,57 +1367,57 @@ msgid "" "get_annotations` to retrieve class annotations safely." msgstr "" -#: ../../reference/datamodel.rst:1024 +#: ../../reference/datamodel.rst:1213 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic class `." msgstr "" -#: ../../reference/datamodel.rst:1030 +#: ../../reference/datamodel.rst:1219 msgid "" "A :class:`tuple` containing names of attributes of this class which are " "assigned through ``self.X`` from any function in its body." msgstr "" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1225 msgid "" "The line number of the first line of the class definition, including " "decorators. Setting the :attr:`__module__` attribute removes the :attr:`!" "__firstlineno__` item from the type's dictionary." msgstr "" -#: ../../reference/datamodel.rst:1044 +#: ../../reference/datamodel.rst:1233 msgid "" "The :class:`tuple` of classes that are considered when looking for base " "classes during method resolution." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1238 #, fuzzy msgid "Special methods" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:1051 +#: ../../reference/datamodel.rst:1240 msgid "" "In addition to the special attributes described above, all Python classes " "also have the following two methods available:" msgstr "" -#: ../../reference/datamodel.rst:1056 +#: ../../reference/datamodel.rst:1245 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:`~type.__mro__`." msgstr "" -#: ../../reference/datamodel.rst:1062 +#: ../../reference/datamodel.rst:1251 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 "" -#: ../../reference/datamodel.rst:1066 +#: ../../reference/datamodel.rst:1255 msgid "" ">>> class A: pass\n" ">>> class B(A): pass\n" @@ -1196,11 +1425,11 @@ msgid "" "[]" msgstr "" -#: ../../reference/datamodel.rst:1074 +#: ../../reference/datamodel.rst:1263 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:1082 +#: ../../reference/datamodel.rst:1271 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1217,7 +1446,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:1098 +#: ../../reference/datamodel.rst:1287 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1225,28 +1454,28 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1297 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1309 msgid "The class to which a class instance belongs." msgstr "" -#: ../../reference/datamodel.rst:1124 +#: ../../reference/datamodel.rst:1313 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes. Not all instances have a :attr:`!__dict__` attribute; see the " "section on :ref:`slots` for more details." msgstr "" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1319 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1145 +#: ../../reference/datamodel.rst:1334 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1255,7 +1484,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1340 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1263,22 +1492,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1159 +#: ../../reference/datamodel.rst:1348 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1354 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1362 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1366 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1290,103 +1519,111 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1400 msgid "The function name" msgstr "函式名稱" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1403 msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1408 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1413 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1228 +#: ../../reference/datamodel.rst:1417 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1232 +#: ../../reference/datamodel.rst:1421 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1425 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1429 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " -"that are referenced by nested functions inside the function" +"that are referenced from at least one :term:`nested scope` inside the " +"function" +msgstr "" + +#: ../../reference/datamodel.rst:1433 +msgid "" +"A :class:`tuple` containing the names of :term:`free (closure) variables " +"` that a :term:`nested scope` references in an outer " +"scope. See also :attr:`function.__closure__`." msgstr "" -#: ../../reference/datamodel.rst:1244 -msgid "A :class:`tuple` containing the names of free variables in the function" +#: ../../reference/datamodel.rst:1437 +msgid "Note: references to global and builtin names are *not* included." msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1440 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1251 +#: ../../reference/datamodel.rst:1444 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1255 +#: ../../reference/datamodel.rst:1448 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1452 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1262 +#: ../../reference/datamodel.rst:1455 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1458 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1268 +#: ../../reference/datamodel.rst:1461 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.14." msgstr "" -#: ../../reference/datamodel.rst:1273 +#: ../../reference/datamodel.rst:1466 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1469 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1281 +#: ../../reference/datamodel.rst:1474 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1397,7 +1634,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1289 +#: ../../reference/datamodel.rst:1482 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`~codeobject.co_flags` to indicate whether a code object was " @@ -1406,29 +1643,29 @@ msgid "" "``0x1000`` were used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1488 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1492 msgid "" "If a code object represents a function, the first item in :attr:`~codeobject." "co_consts` is the documentation string of the function, or ``None`` if " "undefined." msgstr "" -#: ../../reference/datamodel.rst:1304 +#: ../../reference/datamodel.rst:1497 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1308 +#: ../../reference/datamodel.rst:1501 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1311 +#: ../../reference/datamodel.rst:1504 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1436,37 +1673,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1317 +#: ../../reference/datamodel.rst:1510 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1513 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1514 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1515 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1323 +#: ../../reference/datamodel.rst:1516 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1519 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1525 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1476,100 +1713,100 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1341 +#: ../../reference/datamodel.rst:1534 msgid "" "Returns an iterator that yields information about successive ranges of :term:" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" -#: ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1538 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1347 +#: ../../reference/datamodel.rst:1540 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1349 +#: ../../reference/datamodel.rst:1542 msgid "" "``lineno`` is an :class:`int` representing the line number of the :term:" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" -#: ../../reference/datamodel.rst:1353 +#: ../../reference/datamodel.rst:1546 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1355 +#: ../../reference/datamodel.rst:1548 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1549 msgid "" "The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" -#: ../../reference/datamodel.rst:1359 +#: ../../reference/datamodel.rst:1552 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1553 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1363 +#: ../../reference/datamodel.rst:1556 msgid "" "Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" -#: ../../reference/datamodel.rst:1371 +#: ../../reference/datamodel.rst:1564 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1372 +#: ../../reference/datamodel.rst:1565 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1569 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../reference/datamodel.rst:1378 +#: ../../reference/datamodel.rst:1571 msgid "" "Code objects are also supported by the generic function :func:`copy.replace`." msgstr "" -#: ../../reference/datamodel.rst:1386 +#: ../../reference/datamodel.rst:1579 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1390 +#: ../../reference/datamodel.rst:1583 msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1408 +#: ../../reference/datamodel.rst:1601 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1412 +#: ../../reference/datamodel.rst:1605 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1579,55 +1816,55 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1417 +#: ../../reference/datamodel.rst:1610 msgid "" "The mapping used by the frame to look up :ref:`local variables `. If " "the frame refers to an :term:`optimized scope`, this may return a write-" "through proxy object." msgstr "" -#: ../../reference/datamodel.rst:1422 +#: ../../reference/datamodel.rst:1615 msgid "Return a proxy for optimized scopes." msgstr "" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1619 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1430 +#: ../../reference/datamodel.rst:1623 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1627 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1450 +#: ../../reference/datamodel.rst:1643 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1455 +#: ../../reference/datamodel.rst:1648 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1459 +#: ../../reference/datamodel.rst:1652 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1465 +#: ../../reference/datamodel.rst:1658 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1635,15 +1872,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1471 +#: ../../reference/datamodel.rst:1664 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1666 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1477 +#: ../../reference/datamodel.rst:1670 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1652,34 +1889,34 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1483 +#: ../../reference/datamodel.rst:1676 msgid "" ":exc:`RuntimeError` is raised if the frame is currently executing or " "suspended." msgstr "" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1681 msgid "" "Attempting to clear a suspended frame raises :exc:`RuntimeError` (as has " "always been the case for executing frames)." msgstr "" -#: ../../reference/datamodel.rst:1496 +#: ../../reference/datamodel.rst:1689 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1509 +#: ../../reference/datamodel.rst:1702 msgid "" "Traceback objects represent the stack trace of an :ref:`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:1514 +#: ../../reference/datamodel.rst:1707 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1517 +#: ../../reference/datamodel.rst:1710 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1690,7 +1927,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1719 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1698,19 +1935,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1531 +#: ../../reference/datamodel.rst:1724 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1546 +#: ../../reference/datamodel.rst:1739 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1549 +#: ../../reference/datamodel.rst:1742 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1718,15 +1955,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1554 +#: ../../reference/datamodel.rst:1747 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1750 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1752 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1734,39 +1971,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1570 +#: ../../reference/datamodel.rst:1763 msgid "" "The 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:1574 +#: ../../reference/datamodel.rst:1767 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1579 +#: ../../reference/datamodel.rst:1772 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1776 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:1592 +#: ../../reference/datamodel.rst:1785 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:1596 +#: ../../reference/datamodel.rst:1789 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1600 +#: ../../reference/datamodel.rst:1793 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1776,11 +2013,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1609 +#: ../../reference/datamodel.rst:1802 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1611 +#: ../../reference/datamodel.rst:1804 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1791,11 +2028,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1621 +#: ../../reference/datamodel.rst:1814 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1816 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 " @@ -1805,11 +2042,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1633 +#: ../../reference/datamodel.rst:1826 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1639 +#: ../../reference/datamodel.rst:1832 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1823,7 +2060,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1650 +#: ../../reference/datamodel.rst:1843 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1832,7 +2069,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1656 +#: ../../reference/datamodel.rst:1849 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 " @@ -1842,11 +2079,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1667 +#: ../../reference/datamodel.rst:1860 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1673 +#: ../../reference/datamodel.rst:1866 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 " @@ -1856,7 +2093,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1873 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1864,7 +2101,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1878 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 " @@ -1873,13 +2110,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1690 +#: ../../reference/datamodel.rst:1883 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:1693 +#: ../../reference/datamodel.rst:1886 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1887,7 +2124,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1702 +#: ../../reference/datamodel.rst:1895 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 " @@ -1897,7 +2134,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1709 +#: ../../reference/datamodel.rst:1902 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1905,7 +2142,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1722 +#: ../../reference/datamodel.rst:1915 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:" @@ -1914,7 +2151,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1728 +#: ../../reference/datamodel.rst:1921 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. " @@ -1924,7 +2161,7 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1928 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits. :class:`weakref.finalize` " @@ -1932,14 +2169,14 @@ msgid "" "when an object is garbage collected." msgstr "" -#: ../../reference/datamodel.rst:1742 +#: ../../reference/datamodel.rst:1935 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:1747 +#: ../../reference/datamodel.rst:1940 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 " @@ -1950,18 +2187,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1950 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1761 +#: ../../reference/datamodel.rst:1954 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:1765 +#: ../../reference/datamodel.rst:1958 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1970,7 +2207,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1771 +#: ../../reference/datamodel.rst:1964 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1981,7 +2218,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1979 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 " @@ -1993,13 +2230,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1795 +#: ../../reference/datamodel.rst:1988 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1806 +#: ../../reference/datamodel.rst:1999 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -2007,26 +2244,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1811 +#: ../../reference/datamodel.rst:2004 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:1815 +#: ../../reference/datamodel.rst:2008 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:2018 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:1836 +#: ../../reference/datamodel.rst:2029 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -2038,28 +2275,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1846 +#: ../../reference/datamodel.rst:2039 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1848 +#: ../../reference/datamodel.rst:2041 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:2043 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1854 +#: ../../reference/datamodel.rst:2047 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1870 +#: ../../reference/datamodel.rst:2063 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:1962 +#: ../../reference/datamodel.rst:2155 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 " @@ -2193,7 +2430,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1971 +#: ../../reference/datamodel.rst:2164 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2201,7 +2438,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:2169 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 " @@ -2209,22 +2446,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2174 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:1985 +#: ../../reference/datamodel.rst:2178 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:1987 +#: ../../reference/datamodel.rst:2180 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1995 +#: ../../reference/datamodel.rst:2188 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2233,18 +2470,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:2006 +#: ../../reference/datamodel.rst:2199 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2201 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:2016 +#: ../../reference/datamodel.rst:2209 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2254,7 +2491,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2216 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2267,7 +2504,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:2036 +#: ../../reference/datamodel.rst:2229 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2279,64 +2516,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:2047 +#: ../../reference/datamodel.rst:2240 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:2052 ../../reference/datamodel.rst:2054 +#: ../../reference/datamodel.rst:2245 ../../reference/datamodel.rst:2247 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2254 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:2065 +#: ../../reference/datamodel.rst:2258 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." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:2069 ../../reference/datamodel.rst:2071 +#: ../../reference/datamodel.rst:2262 ../../reference/datamodel.rst:2264 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2271 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:2081 ../../reference/datamodel.rst:2083 +#: ../../reference/datamodel.rst:2274 ../../reference/datamodel.rst:2276 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2283 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2288 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2295 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2348,21 +2585,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2111 +#: ../../reference/datamodel.rst:2304 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "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:2115 +#: ../../reference/datamodel.rst:2308 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:2119 +#: ../../reference/datamodel.rst:2312 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2390,7 +2627,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2326 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2398,27 +2635,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2331 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2141 +#: ../../reference/datamodel.rst:2334 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2339 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2147 +#: ../../reference/datamodel.rst:2340 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2153 +#: ../../reference/datamodel.rst:2346 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2348 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 " @@ -2428,7 +2665,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2165 +#: ../../reference/datamodel.rst:2358 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 " @@ -2437,13 +2674,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2364 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2367 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2453,31 +2690,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2183 +#: ../../reference/datamodel.rst:2376 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2186 +#: ../../reference/datamodel.rst:2379 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:2192 +#: ../../reference/datamodel.rst:2385 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2387 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2392 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2488,11 +2725,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2210 +#: ../../reference/datamodel.rst:2403 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2212 +#: ../../reference/datamodel.rst:2405 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2501,7 +2738,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2411 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 " @@ -2509,7 +2746,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2416 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 " @@ -2517,54 +2754,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2421 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2424 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2425 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2428 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2429 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:2239 +#: ../../reference/datamodel.rst:2432 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2433 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2243 +#: ../../reference/datamodel.rst:2436 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2244 +#: ../../reference/datamodel.rst:2437 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:2281 +#: ../../reference/datamodel.rst:2474 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2582,7 +2819,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2296 +#: ../../reference/datamodel.rst:2489 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2591,30 +2828,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2495 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2502 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2311 +#: ../../reference/datamodel.rst:2504 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:2315 +#: ../../reference/datamodel.rst:2508 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:2320 +#: ../../reference/datamodel.rst:2513 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2622,18 +2859,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2522 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2524 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:2335 +#: ../../reference/datamodel.rst:2528 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2642,7 +2879,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2342 +#: ../../reference/datamodel.rst:2535 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2650,7 +2887,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2348 +#: ../../reference/datamodel.rst:2541 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2658,7 +2895,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2354 +#: ../../reference/datamodel.rst:2547 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. " @@ -2667,7 +2904,7 @@ msgid "" "only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2553 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 " @@ -2676,7 +2913,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2365 +#: ../../reference/datamodel.rst:2558 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2684,11 +2921,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2370 +#: ../../reference/datamodel.rst:2563 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2565 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 " @@ -2696,13 +2933,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2377 +#: ../../reference/datamodel.rst:2570 msgid "" ":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2380 +#: ../../reference/datamodel.rst:2573 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2710,18 +2947,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2386 +#: ../../reference/datamodel.rst:2579 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:2394 +#: ../../reference/datamodel.rst:2587 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2589 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2731,14 +2968,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2405 +#: ../../reference/datamodel.rst:2598 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:2409 +#: ../../reference/datamodel.rst:2602 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2746,7 +2983,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2608 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -2764,13 +3001,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2616 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2621 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2778,19 +3015,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2629 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:2441 +#: ../../reference/datamodel.rst:2634 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:2444 +#: ../../reference/datamodel.rst:2637 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -2798,14 +3035,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2447 +#: ../../reference/datamodel.rst:2640 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:2451 +#: ../../reference/datamodel.rst:2644 msgid "" "class A:\n" " pass\n" @@ -2815,22 +3052,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2651 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2466 +#: ../../reference/datamodel.rst:2659 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2666 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:2477 +#: ../../reference/datamodel.rst:2670 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2838,7 +3075,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2482 +#: ../../reference/datamodel.rst:2675 msgid "" "class Meta(type):\n" " pass\n" @@ -2858,41 +3095,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2684 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:2494 +#: ../../reference/datamodel.rst:2687 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2496 +#: ../../reference/datamodel.rst:2689 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2690 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2498 +#: ../../reference/datamodel.rst:2691 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2692 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2693 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2697 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2701 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2904,59 +3141,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2519 +#: ../../reference/datamodel.rst:2712 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2520 +#: ../../reference/datamodel.rst:2713 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2715 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2523 +#: ../../reference/datamodel.rst:2716 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2719 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2720 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2531 +#: ../../reference/datamodel.rst:2724 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2728 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2537 +#: ../../reference/datamodel.rst:2730 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2731 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:2540 +#: ../../reference/datamodel.rst:2733 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:2543 +#: ../../reference/datamodel.rst:2736 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2965,11 +3202,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2746 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2751 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2981,25 +3218,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2567 +#: ../../reference/datamodel.rst:2760 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2765 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2766 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2770 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2582 +#: ../../reference/datamodel.rst:2775 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -3008,7 +3245,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2781 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. " @@ -3017,11 +3254,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2790 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2604 +#: ../../reference/datamodel.rst:2797 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -3029,7 +3266,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2609 +#: ../../reference/datamodel.rst:2802 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 " @@ -3040,7 +3277,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2619 +#: ../../reference/datamodel.rst:2812 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 " @@ -3049,39 +3286,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2625 +#: ../../reference/datamodel.rst:2818 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:2629 +#: ../../reference/datamodel.rst:2822 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:2631 +#: ../../reference/datamodel.rst:2824 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2633 +#: ../../reference/datamodel.rst:2826 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:2636 +#: ../../reference/datamodel.rst:2829 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:2640 +#: ../../reference/datamodel.rst:2833 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 " @@ -3089,19 +3326,19 @@ msgid "" "becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2647 +#: ../../reference/datamodel.rst:2840 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2648 +#: ../../reference/datamodel.rst:2841 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2845 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2847 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3109,17 +3346,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2854 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2663 +#: ../../reference/datamodel.rst:2856 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:2666 +#: ../../reference/datamodel.rst:2859 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3127,21 +3364,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:2866 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:2680 +#: ../../reference/datamodel.rst:2873 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:2685 +#: ../../reference/datamodel.rst:2878 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 " @@ -3149,11 +3386,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2692 +#: ../../reference/datamodel.rst:2885 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2693 +#: ../../reference/datamodel.rst:2886 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" @@ -3162,11 +3399,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2701 +#: ../../reference/datamodel.rst:2894 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2703 +#: ../../reference/datamodel.rst:2896 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3174,65 +3411,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:2903 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2711 +#: ../../reference/datamodel.rst:2904 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2713 +#: ../../reference/datamodel.rst:2906 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2714 +#: ../../reference/datamodel.rst:2907 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2909 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2717 +#: ../../reference/datamodel.rst:2910 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2913 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2725 +#: ../../reference/datamodel.rst:2918 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2728 +#: ../../reference/datamodel.rst:2921 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:2734 +#: ../../reference/datamodel.rst:2927 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2929 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:2740 +#: ../../reference/datamodel.rst:2933 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3241,7 +3478,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2746 +#: ../../reference/datamodel.rst:2939 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3249,11 +3486,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2949 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2758 +#: ../../reference/datamodel.rst:2951 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3263,14 +3500,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2958 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:2770 +#: ../../reference/datamodel.rst:2963 msgid "" "from inspect import isclass\n" "\n" @@ -3296,7 +3533,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2986 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 " @@ -3306,7 +3543,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2993 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3321,14 +3558,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:3005 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:2816 +#: ../../reference/datamodel.rst:3009 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3348,33 +3585,33 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:3028 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2836 +#: ../../reference/datamodel.rst:3029 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:2844 +#: ../../reference/datamodel.rst:3037 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:3044 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:2858 +#: ../../reference/datamodel.rst:3051 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:3053 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3410,7 +3647,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:3094 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 " @@ -3418,7 +3655,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:3101 msgid "" "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:" @@ -3427,7 +3664,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:3110 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). " @@ -3437,28 +3674,28 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2931 +#: ../../reference/datamodel.rst:3124 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2933 +#: ../../reference/datamodel.rst:3126 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:2935 +#: ../../reference/datamodel.rst:3128 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2937 +#: ../../reference/datamodel.rst:3130 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:2939 +#: ../../reference/datamodel.rst:3132 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2944 +#: ../../reference/datamodel.rst:3137 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3470,20 +3707,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:3149 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:2961 +#: ../../reference/datamodel.rst:3154 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:2969 +#: ../../reference/datamodel.rst:3162 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3492,7 +3729,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:3171 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3501,13 +3738,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2987 +#: ../../reference/datamodel.rst:3180 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:2993 +#: ../../reference/datamodel.rst:3186 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 " @@ -3515,14 +3752,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3194 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:3005 +#: ../../reference/datamodel.rst:3198 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 :" @@ -3531,7 +3768,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3205 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3539,14 +3776,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3212 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:3023 +#: ../../reference/datamodel.rst:3216 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3554,11 +3791,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3032 +#: ../../reference/datamodel.rst:3225 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3227 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3566,7 +3803,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3060 +#: ../../reference/datamodel.rst:3253 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3580,13 +3817,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3264 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3094 +#: ../../reference/datamodel.rst:3287 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3599,13 +3836,13 @@ msgid "" "`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3299 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3304 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 " @@ -3614,7 +3851,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3132 +#: ../../reference/datamodel.rst:3325 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3632,19 +3869,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3348 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3168 +#: ../../reference/datamodel.rst:3361 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:3175 +#: ../../reference/datamodel.rst:3368 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3653,14 +3890,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3181 +#: ../../reference/datamodel.rst:3374 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:3193 +#: ../../reference/datamodel.rst:3386 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3669,21 +3906,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3199 +#: ../../reference/datamodel.rst:3392 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:3202 +#: ../../reference/datamodel.rst:3395 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3209 +#: ../../reference/datamodel.rst:3402 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3211 +#: ../../reference/datamodel.rst:3404 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 " @@ -3693,32 +3930,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3222 +#: ../../reference/datamodel.rst:3415 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:3225 +#: ../../reference/datamodel.rst:3418 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3423 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:3237 +#: ../../reference/datamodel.rst:3430 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:3241 +#: ../../reference/datamodel.rst:3434 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. " @@ -3726,27 +3963,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3245 +#: ../../reference/datamodel.rst:3438 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3444 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3252 +#: ../../reference/datamodel.rst:3445 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3259 +#: ../../reference/datamodel.rst:3452 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3261 +#: ../../reference/datamodel.rst:3454 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 " @@ -3754,7 +3991,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3461 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 " @@ -3763,7 +4000,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3274 +#: ../../reference/datamodel.rst:3467 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3773,19 +4010,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3284 +#: ../../reference/datamodel.rst:3477 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3285 +#: ../../reference/datamodel.rst:3478 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3291 +#: ../../reference/datamodel.rst:3484 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3293 +#: ../../reference/datamodel.rst:3486 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3793,13 +4030,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3298 +#: ../../reference/datamodel.rst:3491 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3303 +#: ../../reference/datamodel.rst:3496 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3809,7 +4046,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3312 +#: ../../reference/datamodel.rst:3505 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3818,28 +4055,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3323 +#: ../../reference/datamodel.rst:3516 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3324 +#: ../../reference/datamodel.rst:3517 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3326 +#: ../../reference/datamodel.rst:3519 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3327 +#: ../../reference/datamodel.rst:3520 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3332 +#: ../../reference/datamodel.rst:3525 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3334 +#: ../../reference/datamodel.rst:3527 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 " @@ -3847,7 +4084,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3339 +#: ../../reference/datamodel.rst:3532 msgid "" ">>> class C:\n" "... pass\n" @@ -3869,7 +4106,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3349 +#: ../../reference/datamodel.rst:3542 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3878,7 +4115,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3549 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -3894,14 +4131,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3363 +#: ../../reference/datamodel.rst:3556 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:3367 +#: ../../reference/datamodel.rst:3560 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -3913,14 +4150,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3372 +#: ../../reference/datamodel.rst:3565 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:3376 +#: ../../reference/datamodel.rst:3569 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -3945,7 +4182,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3398 +#: ../../reference/datamodel.rst:3591 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3954,36 +4191,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3409 +#: ../../reference/datamodel.rst:3602 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3413 +#: ../../reference/datamodel.rst:3606 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3608 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:3421 +#: ../../reference/datamodel.rst:3614 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:3427 +#: ../../reference/datamodel.rst:3620 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:3433 +#: ../../reference/datamodel.rst:3626 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 " @@ -3991,15 +4228,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3441 +#: ../../reference/datamodel.rst:3634 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3447 +#: ../../reference/datamodel.rst:3640 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3449 +#: ../../reference/datamodel.rst:3642 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -4010,18 +4247,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3457 +#: ../../reference/datamodel.rst:3650 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:3461 +#: ../../reference/datamodel.rst:3654 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3660 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -4032,7 +4269,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3671 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4043,13 +4280,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3489 +#: ../../reference/datamodel.rst:3682 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3687 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4059,42 +4296,42 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3502 +#: ../../reference/datamodel.rst:3695 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3508 +#: ../../reference/datamodel.rst:3701 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3510 +#: ../../reference/datamodel.rst:3703 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3513 +#: ../../reference/datamodel.rst:3706 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3517 +#: ../../reference/datamodel.rst:3710 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3521 +#: ../../reference/datamodel.rst:3714 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:3524 +#: ../../reference/datamodel.rst:3717 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3526 +#: ../../reference/datamodel.rst:3719 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4122,53 +4359,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3541 +#: ../../reference/datamodel.rst:3734 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:3546 +#: ../../reference/datamodel.rst:3739 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:3554 +#: ../../reference/datamodel.rst:3747 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3556 +#: ../../reference/datamodel.rst:3749 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:3559 +#: ../../reference/datamodel.rst:3752 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3563 +#: ../../reference/datamodel.rst:3756 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3568 +#: ../../reference/datamodel.rst:3761 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3571 +#: ../../reference/datamodel.rst:3764 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3573 +#: ../../reference/datamodel.rst:3766 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4184,18 +4421,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3584 +#: ../../reference/datamodel.rst:3777 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3585 +#: ../../reference/datamodel.rst:3778 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:3589 +#: ../../reference/datamodel.rst:3782 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4204,7 +4441,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3596 +#: ../../reference/datamodel.rst:3789 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4212,7 +4449,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3602 +#: ../../reference/datamodel.rst:3795 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 " @@ -4229,13 +4466,13 @@ msgstr "" #: ../../reference/datamodel.rst:427 ../../reference/datamodel.rst:447 #: ../../reference/datamodel.rst:455 ../../reference/datamodel.rst:466 #: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:519 -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 -#: ../../reference/datamodel.rst:798 ../../reference/datamodel.rst:822 -#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1103 -#: ../../reference/datamodel.rst:1175 ../../reference/datamodel.rst:1279 -#: ../../reference/datamodel.rst:1388 ../../reference/datamodel.rst:1498 -#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 +#: ../../reference/datamodel.rst:799 ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:859 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1364 ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:3120 msgid "object" msgstr "object(物件)" @@ -4245,14 +4482,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:296 #: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:798 -#: ../../reference/datamodel.rst:1132 ../../reference/datamodel.rst:1581 -#: ../../reference/datamodel.rst:1823 ../../reference/datamodel.rst:1828 -#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2468 -#: ../../reference/datamodel.rst:2897 ../../reference/datamodel.rst:3055 -#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3104 -#: ../../reference/datamodel.rst:3153 ../../reference/datamodel.rst:3163 -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:1321 ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:2016 ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3248 +#: ../../reference/datamodel.rst:3283 ../../reference/datamodel.rst:3297 +#: ../../reference/datamodel.rst:3346 ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3384 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4261,7 +4498,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:126 -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "type" msgstr "type(型別)" @@ -4297,7 +4534,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:1126 msgid "container" msgstr "container(容器)" @@ -4311,24 +4548,24 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:400 #: ../../reference/datamodel.rst:401 ../../reference/datamodel.rst:502 -#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:876 -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:859 ../../reference/datamodel.rst:879 +#: ../../reference/datamodel.rst:1321 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:799 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:799 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:955 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1144 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1285 msgid "attribute" msgstr "attribute(屬性)" @@ -4348,7 +4585,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1292 msgid "numeric" msgstr "numeric(數值)" @@ -4385,16 +4622,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3356 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:3090 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1292 msgid "sequence" msgstr "sequence(序列)" @@ -4423,8 +4660,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1798 -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:2021 msgid "string" msgstr "string(字串)" @@ -4460,7 +4697,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:2016 msgid "bytes" msgstr "bytes(位元組)" @@ -4476,14 +4713,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:955 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1285 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1535 ../../reference/datamodel.rst:1717 -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:859 +#: ../../reference/datamodel.rst:1728 ../../reference/datamodel.rst:1910 +#: ../../reference/datamodel.rst:3411 msgid "statement" msgstr "statement(陳述式)" @@ -4515,12 +4752,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1292 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:2105 msgid "dictionary" msgstr "dictionary(字典)" @@ -4537,13 +4774,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:534 -#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:773 ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:761 +#: ../../reference/datamodel.rst:774 ../../reference/datamodel.rst:799 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:960 ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:3042 msgid "call" msgstr "call(呼叫)" @@ -4555,7 +4792,7 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -4575,613 +4812,650 @@ msgstr "__globals__ (函式屬性)" msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:547 ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:547 ../../reference/datamodel.rst:879 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:661 ../../reference/datamodel.rst:823 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:661 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:1279 +#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:1472 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:742 +#: ../../reference/datamodel.rst:743 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:3405 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3598 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:773 +#: ../../reference/datamodel.rst:774 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:773 +#: ../../reference/datamodel.rst:774 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:823 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:823 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:856 +#: ../../reference/datamodel.rst:859 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:876 -msgid "__doc__ (module attribute)" +#: ../../reference/datamodel.rst:879 +#, fuzzy +msgid "__spec__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 +#, fuzzy +msgid "__package__ (module attribute)" +msgstr "__name__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +#, fuzzy +msgid "__loader__ (module attribute)" +msgstr "__dir__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +#, fuzzy +msgid "__path__ (module attribute)" +msgstr "__name__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 +#, fuzzy +msgid "__cached__ (module attribute)" +msgstr "__name__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +msgid "__doc__ (module attribute)" +msgstr "__doc__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:907 +#: ../../reference/datamodel.rst:1094 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:955 -#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1700 -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:2772 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1285 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:3042 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:960 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1149 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 #, fuzzy msgid "__static_attributes__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 #, fuzzy msgid "__firstlineno__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1303 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1303 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1161 +#: ../../reference/datamodel.rst:1350 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1161 +#: ../../reference/datamodel.rst:1350 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1490 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1581 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1565 +#: ../../reference/datamodel.rst:1758 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:1774 ../../reference/datamodel.rst:3120 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1864 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1864 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:1893 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1974 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1974 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:2060 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:2105 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:2186 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2532 +#: ../../reference/datamodel.rst:2725 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2748 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:2772 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2792 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2792 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:3090 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 +#: ../../reference/datamodel.rst:3297 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3153 +#: ../../reference/datamodel.rst:3346 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3356 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3356 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:3384 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3411 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3411 msgid "context manager" msgstr "context manager(情境管理器)" +#~ msgid ":attr:`__name__`" +#~ msgstr ":attr:`__name__`" + +#~ msgid ":attr:`__doc__`" +#~ msgstr ":attr:`__doc__`" + +#~ msgid ":attr:`__file__`" +#~ msgstr ":attr:`__file__`" + +#~ msgid ":attr:`__annotations__`" +#~ msgstr ":attr:`__annotations__`" + #~ msgid ":attr:`~definition.__name__`" #~ msgstr ":attr:`~definition.__name__`" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 05143b6156..8d621b4895 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -138,7 +138,7 @@ msgid "" "declared as :keyword:`nonlocal` or :keyword:`global`. If a name is bound at " "the module level, it is a global variable. (The variables of the module " "code block are local and global.) If a variable is used in a code block but " -"not defined there, it is a :dfn:`free variable`." +"not defined there, it is a :term:`free variable`." msgstr "" #: ../../reference/executionmodel.rst:95 @@ -498,11 +498,11 @@ msgid "" "for both." msgstr "" -#: ../../reference/executionmodel.rst:337 +#: ../../reference/executionmodel.rst:340 msgid "Exceptions" msgstr "例外" -#: ../../reference/executionmodel.rst:348 +#: ../../reference/executionmodel.rst:351 msgid "" "Exceptions are a means of breaking out of the normal flow of control of a " "code block in order to handle errors or other exceptional conditions. An " @@ -511,7 +511,7 @@ msgid "" "or indirectly invoked the code block where the error occurred." msgstr "" -#: ../../reference/executionmodel.rst:354 +#: ../../reference/executionmodel.rst:357 msgid "" "The Python interpreter raises an exception when it detects a run-time error " "(such as division by zero). A Python program can also explicitly raise an " @@ -522,7 +522,7 @@ msgid "" "exception occurred or not in the preceding code." msgstr "" -#: ../../reference/executionmodel.rst:364 +#: ../../reference/executionmodel.rst:367 msgid "" "Python uses the \"termination\" model of error handling: an exception " "handler can find out what happened and continue execution at an outer level, " @@ -530,7 +530,7 @@ msgid "" "(except by re-entering the offending piece of code from the top)." msgstr "" -#: ../../reference/executionmodel.rst:371 +#: ../../reference/executionmodel.rst:374 msgid "" "When an exception is not handled at all, the interpreter terminates " "execution of the program, or returns to its interactive main loop. In " @@ -538,7 +538,7 @@ msgid "" "`SystemExit`." msgstr "" -#: ../../reference/executionmodel.rst:375 +#: ../../reference/executionmodel.rst:378 msgid "" "Exceptions are identified by class instances. The :keyword:`except` clause " "is selected depending on the class of the instance: it must reference the " @@ -547,7 +547,7 @@ msgid "" "additional information about the exceptional condition." msgstr "" -#: ../../reference/executionmodel.rst:383 +#: ../../reference/executionmodel.rst:386 msgid "" "Exception messages are not part of the Python API. Their contents may " "change from one version of Python to the next without warning and should not " @@ -555,17 +555,17 @@ msgid "" "interpreter." msgstr "" -#: ../../reference/executionmodel.rst:387 +#: ../../reference/executionmodel.rst:390 msgid "" "See also the description of the :keyword:`try` statement in section :ref:" "`try` and :keyword:`raise` statement in section :ref:`raise`." msgstr "" -#: ../../reference/executionmodel.rst:392 +#: ../../reference/executionmodel.rst:395 msgid "Footnotes" msgstr "註解" -#: ../../reference/executionmodel.rst:393 +#: ../../reference/executionmodel.rst:396 msgid "" "This limitation occurs because the code that is executed by these operations " "is not available at the time the module is compiled." @@ -647,34 +647,34 @@ msgstr "__main__" msgid "restricted" msgstr "restricted(受限)" -#: ../../reference/executionmodel.rst:339 +#: ../../reference/executionmodel.rst:342 msgid "exception" msgstr "exception(例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "raise an exception" msgstr "raise an exception(引發例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "handle an exception" msgstr "handle an exception(處理例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "exception handler" msgstr "exception handler(例外處理器)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "errors" msgstr "errors(錯誤)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "error handling" msgstr "error handling(錯誤處理)" -#: ../../reference/executionmodel.rst:362 +#: ../../reference/executionmodel.rst:365 msgid "termination model" msgstr "termination model(終止模型)" -#: ../../reference/executionmodel.rst:369 +#: ../../reference/executionmodel.rst:372 msgid "SystemExit (built-in exception)" msgstr "SystemExit(內建例外)" diff --git a/reference/expressions.po b/reference/expressions.po index fc336df342..5130e12383 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1322,7 +1322,7 @@ msgid "" "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2006 msgid "Await expression" msgstr "" @@ -2022,11 +2022,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1813 +#: ../../reference/expressions.rst:1815 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1818 +#: ../../reference/expressions.rst:1820 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2034,11 +2034,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1823 +#: ../../reference/expressions.rst:1825 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1827 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2046,11 +2046,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1830 +#: ../../reference/expressions.rst:1832 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1832 +#: ../../reference/expressions.rst:1834 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2058,7 +2058,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:1839 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2068,36 +2068,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1847 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1852 +#: ../../reference/expressions.rst:1854 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:1866 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1867 +#: ../../reference/expressions.rst:1869 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:1871 +#: ../../reference/expressions.rst:1873 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1878 +#: ../../reference/expressions.rst:1880 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1889 +#: ../../reference/expressions.rst:1891 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2105,7 +2105,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1893 +#: ../../reference/expressions.rst:1895 msgid "" "def (parameters):\n" " return expression" @@ -2113,25 +2113,25 @@ msgstr "" "def (parameters):\n" " return expression" -#: ../../reference/expressions.rst:1898 +#: ../../reference/expressions.rst:1900 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:1906 +#: ../../reference/expressions.rst:1908 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1924 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:1931 +#: ../../reference/expressions.rst:1933 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2139,16 +2139,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1938 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1941 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1946 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2157,24 +2157,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1957 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1961 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:1962 +#: ../../reference/expressions.rst:1964 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1967 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2190,11 +2190,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1978 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1983 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2204,176 +2204,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1987 +#: ../../reference/expressions.rst:1989 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:1993 +#: ../../reference/expressions.rst:1995 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1993 +#: ../../reference/expressions.rst:1995 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1997 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1999 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1997 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2001 +#: ../../reference/expressions.rst:2003 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2001 +#: ../../reference/expressions.rst:2003 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2006 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2008 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2008 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2010 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2010 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2012 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2012 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2016 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2016 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2018 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2018 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2020 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2020 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2022 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2022 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2024 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2024 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2026 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2026 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2030 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2030 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2032 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2032 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2034 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2034 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2036 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2036 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2038 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2038 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2040 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2040 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2043 +#: ../../reference/expressions.rst:2045 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2044 +#: ../../reference/expressions.rst:2046 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 " @@ -2385,7 +2385,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2053 +#: ../../reference/expressions.rst:2055 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, " @@ -2393,7 +2393,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2058 +#: ../../reference/expressions.rst:2060 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 " @@ -2407,7 +2407,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2069 +#: ../../reference/expressions.rst:2071 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2415,13 +2415,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2074 +#: ../../reference/expressions.rst:2076 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:2077 +#: ../../reference/expressions.rst:2079 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2429,13 +2429,13 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2082 +#: ../../reference/expressions.rst:2084 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:2085 +#: ../../reference/expressions.rst:2087 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." @@ -2443,8 +2443,8 @@ msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1765 -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1854 -#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1882 ../../reference/expressions.rst:1910 msgid "expression" msgstr "" @@ -2521,7 +2521,7 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 #: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1162 #: ../../reference/expressions.rst:1176 ../../reference/expressions.rst:1183 -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1922 msgid "object" msgstr "object(物件)" @@ -2543,18 +2543,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1922 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1944 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 #: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid ", (comma)" msgstr ", (逗號)" @@ -2571,7 +2571,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1856 msgid "if" msgstr "if" @@ -2585,7 +2585,7 @@ msgstr "await" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid "list" msgstr "list(串列)" @@ -2603,7 +2603,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2641,7 +2641,7 @@ msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" #: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid ": (colon)" msgstr ": (冒號)" @@ -2654,7 +2654,7 @@ msgid "in dictionary displays" msgstr "於字典顯示" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "unpacking" msgstr "unpacking(解包)" @@ -2689,7 +2689,7 @@ msgid "from" msgstr "from" #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1882 msgid "function" msgstr "function (函式)" @@ -2831,7 +2831,7 @@ msgid "parameter" msgstr "parameter(參數)" #: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1318 -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "* (asterisk)" msgstr "* (星號)" @@ -2895,7 +2895,7 @@ msgstr "operation(操作)" #: ../../reference/expressions.rst:1491 ../../reference/expressions.rst:1730 #: ../../reference/expressions.rst:1739 ../../reference/expressions.rst:1781 #: ../../reference/expressions.rst:1786 ../../reference/expressions.rst:1791 -#: ../../reference/expressions.rst:1854 ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1856 ../../reference/expressions.rst:1980 msgid "operator" msgstr "operator(運算子)" @@ -3151,59 +3151,59 @@ msgstr "named expression(附名運算式)" msgid "assignment" msgstr "argument(引數)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:1944 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1959 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1959 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1980 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/reference/import.po b/reference/import.po index 27ee9f46ec..7bf370ce28 100644 --- a/reference/import.po +++ b/reference/import.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -724,11 +724,12 @@ msgid "" "``foo`` attribute of the former." msgstr "" -#: ../../reference/import.rst:517 -msgid "Module spec" -msgstr "" - #: ../../reference/import.rst:519 +#, fuzzy +msgid "Module specs" +msgstr "module spec" + +#: ../../reference/import.rst:521 msgid "" "The import machinery uses a variety of information about each module during " "import, especially before loading. Most of the information is common to all " @@ -736,7 +737,7 @@ msgid "" "related information on a per-module basis." msgstr "" -#: ../../reference/import.rst:524 +#: ../../reference/import.rst:526 msgid "" "Using a spec during import allows state to be transferred between import " "system components, e.g. between the finder that creates the module spec and " @@ -745,220 +746,70 @@ msgid "" "a module spec the loader had that responsibility." msgstr "" -#: ../../reference/import.rst:530 -msgid "" -"The module's spec is exposed as the ``__spec__`` attribute on a module " -"object. See :class:`~importlib.machinery.ModuleSpec` for details on the " -"contents of the module spec." -msgstr "" - -#: ../../reference/import.rst:539 -msgid "Import-related module attributes" -msgstr "" - -#: ../../reference/import.rst:541 -msgid "" -"The import machinery fills in these attributes on each module object during " -"loading, based on the module's spec, before the loader executes the module." -msgstr "" - -#: ../../reference/import.rst:545 -msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` and its " -"attributes instead of any of the other individual attributes listed below." -msgstr "" - -#: ../../reference/import.rst:551 -msgid "" -"The ``__name__`` attribute must be set to the fully qualified name of the " -"module. This name is used to uniquely identify the module in the import " -"system." -msgstr "" - -#: ../../reference/import.rst:557 -msgid "" -"The ``__loader__`` attribute must be set to the loader object that the " -"import machinery used when loading the module. This is mostly for " -"introspection, but can be used for additional loader-specific functionality, " -"for example getting data associated with a loader." -msgstr "" - -#: ../../reference/import.rst:562 ../../reference/import.rst:583 -msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " -"this attribute." -msgstr "" - -#: ../../reference/import.rst:565 -msgid "" -"The value of ``__loader__`` is expected to be the same as ``__spec__." -"loader``. The use of ``__loader__`` is deprecated and slated for removal in " -"Python 3.14." -msgstr "" - -#: ../../reference/import.rst:572 -msgid "" -"The module's ``__package__`` attribute may be set. Its value must be a " -"string, but it can be the same value as its ``__name__``. When the module " -"is a package, its ``__package__`` value should be set to its ``__name__``. " -"When the module is not a package, ``__package__`` should be set to the empty " -"string for top-level modules, or for submodules, to the parent package's " -"name. See :pep:`366` for further details." -msgstr "" - -#: ../../reference/import.rst:580 -msgid "" -"This attribute is used instead of ``__name__`` to calculate explicit " -"relative imports for main modules, as defined in :pep:`366`." -msgstr "" - -#: ../../reference/import.rst:586 -msgid "" -"The value of ``__package__`` is expected to be the same as ``__spec__." -"parent``." -msgstr "" - -#: ../../reference/import.rst:590 -msgid "" -":exc:`ImportWarning` is raised if import falls back to ``__package__`` " -"instead of :attr:`~importlib.machinery.ModuleSpec.parent`." -msgstr "" - -#: ../../reference/import.rst:595 -msgid "" -"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " -"back to ``__package__``." -msgstr "" - -#: ../../reference/import.rst:599 -msgid "" -"``__package__`` will cease to be set or taken into consideration by the " -"import system or standard library." -msgstr "" - -#: ../../reference/import.rst:606 -msgid "" -"The ``__spec__`` attribute must be set to the module spec that was used when " -"importing the module. Setting ``__spec__`` appropriately applies equally to :" -"ref:`modules initialized during interpreter startup `. The one " -"exception is ``__main__``, where ``__spec__`` is :ref:`set to None in some " -"cases `." -msgstr "" - -#: ../../reference/import.rst:612 -msgid "" -"When ``__spec__.parent`` is not set, ``__package__`` is used as a fallback." -msgstr "" - -#: ../../reference/import.rst:617 -msgid "" -"``__spec__.parent`` is used as a fallback when ``__package__`` is not " -"defined." -msgstr "" - -#: ../../reference/import.rst:623 -msgid "" -"If the module is a package (either regular or namespace), the module " -"object's ``__path__`` attribute must be set. The value must be iterable, " -"but may be empty if ``__path__`` has no further significance. If " -"``__path__`` is not empty, it must produce strings when iterated over. More " -"details on the semantics of ``__path__`` are given :ref:`below `." -msgstr "" - -#: ../../reference/import.rst:630 -msgid "Non-package modules should not have a ``__path__`` attribute." -msgstr "" - -#: ../../reference/import.rst:635 -msgid "" -"``__file__`` is optional (if set, value must be a string). It indicates the " -"pathname of the file from which the module was loaded (if loaded from a " -"file), or the pathname of the shared library file for extension modules " -"loaded dynamically from a shared library. It might be missing for certain " -"types of modules, such as C modules that are statically linked into the " -"interpreter, and the import system may opt to leave it unset if it has no " -"semantic meaning (e.g. a module loaded from a database)." -msgstr "" - -#: ../../reference/import.rst:644 -msgid "" -"If ``__file__`` is set then the ``__cached__`` attribute might also be set, " -"which is the path to any compiled version of the code (e.g. byte-compiled " -"file). The file does not need to exist to set this attribute; the path can " -"simply point to where the compiled file would exist (see :pep:`3147`)." -msgstr "" - -#: ../../reference/import.rst:650 +#: ../../reference/import.rst:532 msgid "" -"Note that ``__cached__`` may be set even if ``__file__`` is not set. " -"However, that scenario is quite atypical. Ultimately, the loader is what " -"makes use of the module spec provided by the finder (from which ``__file__`` " -"and ``__cached__`` are derived). So if a loader can load from a cached " -"module but otherwise does not load from a file, that atypical scenario may " -"be appropriate." +"The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!" +"__spec__` appropriately applies equally to :ref:`modules initialized during " +"interpreter startup `. The one exception is ``__main__``, where :" +"attr:`!__spec__` is :ref:`set to None in some cases `." msgstr "" -#: ../../reference/import.rst:657 +#: ../../reference/import.rst:538 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " -"``__cached__``." +"See :class:`~importlib.machinery.ModuleSpec` for details on the contents of " +"the module spec." msgstr "" -#: ../../reference/import.rst:660 -msgid "" -"``__cached__`` will cease to be set or taken into consideration by the " -"import system or standard library." +#: ../../reference/import.rst:546 +msgid "__path__ attributes on modules" msgstr "" -#: ../../reference/import.rst:667 -msgid "module.__path__" -msgstr "module.__path__" - -#: ../../reference/import.rst:669 +#: ../../reference/import.rst:548 msgid "" -"By definition, if a module has a ``__path__`` attribute, it is a package." +"The :attr:`~module.__path__` attribute should be a (possibly empty) :term:" +"`sequence` of strings enumerating the locations where the package's " +"submodules will be found. By definition, if a module has a :attr:`!__path__` " +"attribute, it is a :term:`package`." msgstr "" -#: ../../reference/import.rst:671 +#: ../../reference/import.rst:553 msgid "" -"A package's ``__path__`` attribute is used during imports of its " +"A package's :attr:`~module.__path__` attribute is used during imports of its " "subpackages. Within the import machinery, it functions much the same as :" "data:`sys.path`, i.e. providing a list of locations to search for modules " -"during import. However, ``__path__`` is typically much more constrained " -"than :data:`sys.path`." +"during import. However, :attr:`!__path__` is typically much more constrained " +"than :data:`!sys.path`." msgstr "" -#: ../../reference/import.rst:677 +#: ../../reference/import.rst:560 msgid "" -"``__path__`` must be an iterable of strings, but it may be empty. The same " -"rules used for :data:`sys.path` also apply to a package's ``__path__``, and :" -"data:`sys.path_hooks` (described below) are consulted when traversing a " -"package's ``__path__``." +"The same rules used for :data:`sys.path` also apply to a package's :attr:`!" +"__path__`. :data:`sys.path_hooks` (described below) are consulted when " +"traversing a package's :attr:`!__path__`." msgstr "" -#: ../../reference/import.rst:682 +#: ../../reference/import.rst:564 msgid "" -"A package's ``__init__.py`` file may set or alter the package's ``__path__`` " -"attribute, and this was typically the way namespace packages were " -"implemented prior to :pep:`420`. With the adoption of :pep:`420`, namespace " -"packages no longer need to supply ``__init__.py`` files containing only " -"``__path__`` manipulation code; the import machinery automatically sets " -"``__path__`` correctly for the namespace package." +"A package's ``__init__.py`` file may set or alter the package's :attr:" +"`~module.__path__` attribute, and this was typically the way namespace " +"packages were implemented prior to :pep:`420`. With the adoption of :pep:" +"`420`, namespace packages no longer need to supply ``__init__.py`` files " +"containing only :attr:`!__path__` manipulation code; the import machinery " +"automatically sets :attr:`!__path__` correctly for the namespace package." msgstr "" -#: ../../reference/import.rst:690 +#: ../../reference/import.rst:573 msgid "Module reprs" msgstr "" -#: ../../reference/import.rst:692 +#: ../../reference/import.rst:575 msgid "" "By default, all modules have a usable repr, however depending on the " "attributes set above, and in the module's spec, you can more explicitly " "control the repr of module objects." msgstr "" -#: ../../reference/import.rst:696 +#: ../../reference/import.rst:579 msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " @@ -968,45 +819,45 @@ msgid "" "for whatever information is missing." msgstr "" -#: ../../reference/import.rst:703 +#: ../../reference/import.rst:586 msgid "Here are the exact rules used:" msgstr "" -#: ../../reference/import.rst:705 +#: ../../reference/import.rst:588 msgid "" "If the module has a ``__spec__`` attribute, the information in the spec is " "used to generate the repr. The \"name\", \"loader\", \"origin\", and " "\"has_location\" attributes are consulted." msgstr "" -#: ../../reference/import.rst:709 +#: ../../reference/import.rst:592 msgid "" "If the module has a ``__file__`` attribute, this is used as part of the " "module's repr." msgstr "" -#: ../../reference/import.rst:712 +#: ../../reference/import.rst:595 msgid "" "If the module has no ``__file__`` but does have a ``__loader__`` that is not " "``None``, then the loader's repr is used as part of the module's repr." msgstr "" -#: ../../reference/import.rst:715 +#: ../../reference/import.rst:598 msgid "Otherwise, just use the module's ``__name__`` in the repr." msgstr "" -#: ../../reference/import.rst:717 +#: ../../reference/import.rst:600 msgid "" "Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was " "removed in Python 3.12 and is no longer called during the resolution of a " "module's repr." msgstr "" -#: ../../reference/import.rst:725 +#: ../../reference/import.rst:608 msgid "Cached bytecode invalidation" msgstr "" -#: ../../reference/import.rst:727 +#: ../../reference/import.rst:610 msgid "" "Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " @@ -1016,7 +867,7 @@ msgid "" "source's metadata." msgstr "" -#: ../../reference/import.rst:734 +#: ../../reference/import.rst:617 msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " @@ -1030,17 +881,17 @@ msgid "" "option:`--check-hash-based-pycs` flag." msgstr "" -#: ../../reference/import.rst:745 +#: ../../reference/import.rst:628 msgid "" "Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-" "based invalidation of bytecode caches." msgstr "" -#: ../../reference/import.rst:751 +#: ../../reference/import.rst:634 msgid "The Path Based Finder" msgstr "" -#: ../../reference/import.rst:756 +#: ../../reference/import.rst:639 msgid "" "As mentioned previously, Python comes with several default meta path " "finders. One of these, called the :term:`path based finder` (:class:" @@ -1049,14 +900,14 @@ msgid "" "a location to search for modules." msgstr "" -#: ../../reference/import.rst:762 +#: ../../reference/import.rst:645 msgid "" "The path based finder itself doesn't know how to import anything. Instead, " "it traverses the individual path entries, associating each of them with a " "path entry finder that knows how to handle that particular kind of path." msgstr "" -#: ../../reference/import.rst:766 +#: ../../reference/import.rst:649 msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " @@ -1067,14 +918,14 @@ msgid "" "from zipfiles." msgstr "" -#: ../../reference/import.rst:773 +#: ../../reference/import.rst:656 msgid "" "Path entries need not be limited to file system locations. They can refer " "to URLs, database queries, or any other location that can be specified as a " "string." msgstr "" -#: ../../reference/import.rst:777 +#: ../../reference/import.rst:660 msgid "" "The path based finder provides additional hooks and protocols so that you " "can extend and customize the types of searchable path entries. For example, " @@ -1085,7 +936,7 @@ msgid "" "from the web." msgstr "" -#: ../../reference/import.rst:785 +#: ../../reference/import.rst:668 msgid "" "A word of warning: this section and the previous both use the term *finder*, " "distinguishing between them by using the terms :term:`meta path finder` and :" @@ -1096,7 +947,7 @@ msgid "" "process, as keyed off the :data:`sys.meta_path` traversal." msgstr "" -#: ../../reference/import.rst:793 +#: ../../reference/import.rst:676 msgid "" "By contrast, path entry finders are in a sense an implementation detail of " "the path based finder, and in fact, if the path based finder were to be " @@ -1104,11 +955,11 @@ msgid "" "would be invoked." msgstr "" -#: ../../reference/import.rst:800 +#: ../../reference/import.rst:683 msgid "Path entry finders" msgstr "" -#: ../../reference/import.rst:808 +#: ../../reference/import.rst:691 msgid "" "The :term:`path based finder` is responsible for finding and loading Python " "modules and packages whose location is specified with a string :term:`path " @@ -1116,7 +967,7 @@ msgid "" "not be limited to this." msgstr "" -#: ../../reference/import.rst:813 +#: ../../reference/import.rst:696 msgid "" "As a meta path finder, the :term:`path based finder` implements the :meth:" "`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " @@ -1124,7 +975,7 @@ msgid "" "modules are found and loaded from the :term:`import path`." msgstr "" -#: ../../reference/import.rst:818 +#: ../../reference/import.rst:701 msgid "" "Three variables are used by the :term:`path based finder`, :data:`sys." "path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " @@ -1132,7 +983,7 @@ msgid "" "additional ways that the import machinery can be customized." msgstr "" -#: ../../reference/import.rst:823 +#: ../../reference/import.rst:706 msgid "" ":data:`sys.path` contains a list of strings providing search locations for " "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " @@ -1144,7 +995,7 @@ msgid "" "other data types are ignored." msgstr "" -#: ../../reference/import.rst:832 +#: ../../reference/import.rst:715 msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " @@ -1156,7 +1007,7 @@ msgid "" "top level import and :data:`sys.path` is used." msgstr "" -#: ../../reference/import.rst:841 +#: ../../reference/import.rst:724 msgid "" "The path based finder iterates over every entry in the search path, and for " "each of these, looks for an appropriate :term:`path entry finder` (:class:" @@ -1172,7 +1023,7 @@ msgid "" "finder to perform the path entry search again." msgstr "" -#: ../../reference/import.rst:854 +#: ../../reference/import.rst:737 msgid "" "If the path entry is not present in the cache, the path based finder " "iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" @@ -1188,7 +1039,7 @@ msgid "" "decode the argument, it should raise :exc:`ImportError`." msgstr "" -#: ../../reference/import.rst:868 +#: ../../reference/import.rst:751 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " "being returned, then the path based finder's :meth:`~importlib.machinery." @@ -1198,7 +1049,7 @@ msgid "" "could not find the module." msgstr "" -#: ../../reference/import.rst:875 +#: ../../reference/import.rst:758 msgid "" "If a :term:`path entry finder` *is* returned by one of the :term:`path entry " "hook` callables on :data:`sys.path_hooks`, then the following protocol is " @@ -1206,7 +1057,7 @@ msgid "" "the module." msgstr "" -#: ../../reference/import.rst:880 +#: ../../reference/import.rst:763 msgid "" "The current working directory -- denoted by an empty string -- is handled " "slightly differently from other entries on :data:`sys.path`. First, if the " @@ -1218,18 +1069,18 @@ msgid "" "and not the empty string." msgstr "" -#: ../../reference/import.rst:890 +#: ../../reference/import.rst:773 msgid "Path entry finder protocol" msgstr "" -#: ../../reference/import.rst:892 +#: ../../reference/import.rst:775 msgid "" "In order to support imports of modules and initialized packages and also to " "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" -#: ../../reference/import.rst:896 +#: ../../reference/import.rst:779 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` takes two arguments: the " "fully qualified name of the module being imported, and the (optional) target " @@ -1237,21 +1088,21 @@ msgid "" "spec will always have \"loader\" set (with one exception)." msgstr "" -#: ../../reference/import.rst:901 +#: ../../reference/import.rst:784 msgid "" "To indicate to the import machinery that the spec represents a namespace :" "term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" -#: ../../reference/import.rst:905 +#: ../../reference/import.rst:788 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`!" "find_loader` and :meth:`!find_module`, both of which are now deprecated, but " "will be used if ``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:911 +#: ../../reference/import.rst:794 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1259,14 +1110,14 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:916 +#: ../../reference/import.rst:799 msgid "" ":meth:`!find_loader` takes one argument, the fully qualified name of the " "module being imported. ``find_loader()`` returns a 2-tuple where the first " "item is the loader and the second item is a namespace :term:`portion`." msgstr "" -#: ../../reference/import.rst:921 +#: ../../reference/import.rst:804 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1276,7 +1127,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:928 +#: ../../reference/import.rst:811 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1285,28 +1136,28 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:934 +#: ../../reference/import.rst:817 msgid "" "Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " "will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:939 +#: ../../reference/import.rst:822 msgid "``find_module()`` and ``find_loader()`` have been removed." msgstr "" -#: ../../reference/import.rst:944 +#: ../../reference/import.rst:827 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:946 +#: ../../reference/import.rst:829 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:950 +#: ../../reference/import.rst:833 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1315,7 +1166,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:956 +#: ../../reference/import.rst:839 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1325,11 +1176,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:966 +#: ../../reference/import.rst:849 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:851 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1337,7 +1188,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:973 +#: ../../reference/import.rst:856 msgid "" "package/\n" " __init__.py\n" @@ -1361,13 +1212,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:984 +#: ../../reference/import.rst:867 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:987 +#: ../../reference/import.rst:870 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1383,28 +1234,28 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:994 +#: ../../reference/import.rst:877 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:998 +#: ../../reference/import.rst:881 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:1000 +#: ../../reference/import.rst:883 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:1007 +#: ../../reference/import.rst:890 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:1009 +#: ../../reference/import.rst:892 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " @@ -1415,17 +1266,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:1020 +#: ../../reference/import.rst:903 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:1022 +#: ../../reference/import.rst:905 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:1025 +#: ../../reference/import.rst:908 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1433,30 +1284,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:1030 +#: ../../reference/import.rst:913 msgid "" "In :ref:`the remaining cases ` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:1034 +#: ../../reference/import.rst:917 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:1035 +#: ../../reference/import.rst:918 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:1036 +#: ../../reference/import.rst:919 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:1037 +#: ../../reference/import.rst:920 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:1039 +#: ../../reference/import.rst:922 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1464,7 +1315,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:1044 +#: ../../reference/import.rst:927 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1473,11 +1324,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:1052 +#: ../../reference/import.rst:935 msgid "References" msgstr "" -#: ../../reference/import.rst:1054 +#: ../../reference/import.rst:937 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:1066 +#: ../../reference/import.rst:949 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1069 +#: ../../reference/import.rst:952 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1073 +#: ../../reference/import.rst:956 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1075 +#: ../../reference/import.rst:958 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1524,15 +1375,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1082 +#: ../../reference/import.rst:965 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1083 +#: ../../reference/import.rst:966 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:1085 +#: ../../reference/import.rst:968 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1614,22 +1465,25 @@ msgstr "sys.meta_path" msgid "find_spec" msgstr "find_spec" -#: ../../reference/import.rst:753 +#: ../../reference/import.rst:636 msgid "path based finder" msgstr "path based finder(基於路徑的搜尋器)" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path" msgstr "sys.path" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path_hooks" msgstr "sys.path_hooks" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path_importer_cache" msgstr "sys.path_importer_cache" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "PYTHONPATH" msgstr "PYTHONPATH" + +#~ msgid "module.__path__" +#~ msgstr "module.__path__" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index a87bcb53cc..8ca2ad4ed0 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -903,8 +903,8 @@ msgstr "我們可以建立一個函式來產生費式數列到任何一個上界 #: ../../tutorial/controlflow.rst:464 msgid "" -">>> def fib(n): # write Fibonacci series up to n\n" -"... \"\"\"Print a Fibonacci series up to n.\"\"\"\n" +">>> def fib(n): # write Fibonacci series less than n\n" +"... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" "... a, b = 0, 1\n" "... while a < n:\n" "... print(a, end=' ')\n" @@ -1619,8 +1619,9 @@ msgstr "" "keyword arguments: 'arg'" #: ../../tutorial/controlflow.rst:835 +#, fuzzy msgid "" -"The third function ``kwd_only_args`` only allows keyword arguments as " +"The third function ``kwd_only_arg`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" msgstr "" "第三個函式 ``kwd_only_args`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 436e18af6b..5fb5537144 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -355,53 +355,47 @@ msgstr "" "和解決方法。" #: ../../tutorial/introduction.rst:197 +#, fuzzy msgid "" "String literals can span multiple lines. One way is using triple-quotes: " "``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically " "included in the string, but it's possible to prevent this by adding a ``\\`` " -"at the end of the line. The following example::" +"at the end of the line. In the following example, the initial newline is " +"not included::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:``\"\"\"...\"\"\"`` 或 " "``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` 來取" "消這個行為。在以下的例子中: ::" -#: ../../tutorial/introduction.rst:202 +#: ../../tutorial/introduction.rst:203 msgid "" -"print(\"\"\"\\\n" +">>> print(\"\"\"\\\n" +"... Usage: thingy [OPTIONS]\n" +"... -h Display this usage message\n" +"... -H hostname Hostname to connect to\n" +"... \"\"\")\n" "Usage: thingy [OPTIONS]\n" " -h Display this usage message\n" " -H hostname Hostname to connect to\n" -"\"\"\")" +"\n" +">>>" msgstr "" -#: ../../tutorial/introduction.rst:208 -msgid "" -"produces the following output (note that the initial newline is not " -"included):" -msgstr "會產生以下的輸出(注意第一個換行並沒有被包含進字串值中):" - -#: ../../tutorial/introduction.rst:210 -msgid "" -"Usage: thingy [OPTIONS]\n" -" -h Display this usage message\n" -" -H hostname Hostname to connect to" -msgstr "" - -#: ../../tutorial/introduction.rst:216 +#: ../../tutorial/introduction.rst:214 msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" msgstr "" "字串可以使用 ``+`` 運算子連接 (concatenate),並用 ``*`` 重覆該字串的內容: ::" -#: ../../tutorial/introduction.rst:219 +#: ../../tutorial/introduction.rst:217 msgid "" ">>> # 3 times 'un', followed by 'ium'\n" ">>> 3 * 'un' + 'ium'\n" "'unununium'" msgstr "" -#: ../../tutorial/introduction.rst:223 +#: ../../tutorial/introduction.rst:221 msgid "" "Two or more *string literals* (i.e. the ones enclosed between quotes) next " "to each other are automatically concatenated. ::" @@ -409,7 +403,7 @@ msgstr "" "兩個以上相鄰的字串文本(*string literal*,即被引號包圍的字串)會被自動連接起" "來: ::" -#: ../../tutorial/introduction.rst:226 +#: ../../tutorial/introduction.rst:224 msgid "" ">>> 'Py' 'thon'\n" "'Python'" @@ -417,13 +411,13 @@ msgstr "" ">>> 'Py' 'thon'\n" "'Python'" -#: ../../tutorial/introduction.rst:229 +#: ../../tutorial/introduction.rst:227 msgid "" "This feature is particularly useful when you want to break long strings::" msgstr "" "當你想要分段一個非常長的字串時,兩相鄰字串值自動連接的特性十分有用: ::" -#: ../../tutorial/introduction.rst:231 +#: ../../tutorial/introduction.rst:229 msgid "" ">>> text = ('Put several strings within parentheses '\n" "... 'to have them joined together.')\n" @@ -431,12 +425,12 @@ msgid "" "'Put several strings within parentheses to have them joined together.'" msgstr "" -#: ../../tutorial/introduction.rst:236 +#: ../../tutorial/introduction.rst:234 msgid "" "This only works with two literals though, not with variables or expressions::" msgstr "但這特性只限於兩相鄰的字串值間,而非兩相鄰變數或表達式: ::" -#: ../../tutorial/introduction.rst:238 +#: ../../tutorial/introduction.rst:236 msgid "" ">>> prefix = 'Py'\n" ">>> prefix 'thon' # can't concatenate a variable and a string literal\n" @@ -451,12 +445,12 @@ msgid "" "SyntaxError: invalid syntax" msgstr "" -#: ../../tutorial/introduction.rst:250 +#: ../../tutorial/introduction.rst:248 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" msgstr "如果要連接變數們或一個變數與一個字串值,使用 ``+``: ::" -#: ../../tutorial/introduction.rst:252 +#: ../../tutorial/introduction.rst:250 msgid "" ">>> prefix + 'thon'\n" "'Python'" @@ -464,7 +458,7 @@ msgstr "" ">>> prefix + 'thon'\n" "'Python'" -#: ../../tutorial/introduction.rst:255 +#: ../../tutorial/introduction.rst:253 msgid "" "Strings can be *indexed* (subscripted), with the first character having " "index 0. There is no separate character type; a character is simply a string " @@ -473,7 +467,7 @@ msgstr "" "字串可以被「索引 *indexed*」(下標,即 subscripted),第一個字元的索引值為 0。" "沒有獨立表示字元的型別;一個字元就是一個大小為 1 的字串: ::" -#: ../../tutorial/introduction.rst:259 +#: ../../tutorial/introduction.rst:257 msgid "" ">>> word = 'Python'\n" ">>> word[0] # character in position 0\n" @@ -482,12 +476,12 @@ msgid "" "'n'" msgstr "" -#: ../../tutorial/introduction.rst:265 +#: ../../tutorial/introduction.rst:263 msgid "" "Indices may also be negative numbers, to start counting from the right::" msgstr "索引值可以是負的,此時改成從右開始計數: ::" -#: ../../tutorial/introduction.rst:267 +#: ../../tutorial/introduction.rst:265 msgid "" ">>> word[-1] # last character\n" "'n'\n" @@ -497,11 +491,11 @@ msgid "" "'P'" msgstr "" -#: ../../tutorial/introduction.rst:274 +#: ../../tutorial/introduction.rst:272 msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" -#: ../../tutorial/introduction.rst:276 +#: ../../tutorial/introduction.rst:274 msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " "used to obtain individual characters, *slicing* allows you to obtain a " @@ -510,7 +504,7 @@ msgstr "" "除了索引外,字串亦支援「切片 *slicing*」。索引用來拿到單獨的字元,而切片則可" "以讓你拿到一個子字串 (substring): ::" -#: ../../tutorial/introduction.rst:279 +#: ../../tutorial/introduction.rst:277 msgid "" ">>> word[0:2] # characters from position 0 (included) to 2 (excluded)\n" "'Py'\n" @@ -518,7 +512,7 @@ msgid "" "'tho'" msgstr "" -#: ../../tutorial/introduction.rst:284 +#: ../../tutorial/introduction.rst:282 msgid "" "Slice indices have useful defaults; an omitted first index defaults to zero, " "an omitted second index defaults to the size of the string being sliced. ::" @@ -526,7 +520,7 @@ msgstr "" "切片索引 (slice indices) 有很常用的預設值,省略起點索引值時預設為 0,而省略第" "二個索引值時預設整個字串被包含在 slice 中: ::" -#: ../../tutorial/introduction.rst:287 +#: ../../tutorial/introduction.rst:285 msgid "" ">>> word[:2] # character from the beginning to position 2 (excluded)\n" "'Py'\n" @@ -536,7 +530,7 @@ msgid "" "'on'" msgstr "" -#: ../../tutorial/introduction.rst:294 +#: ../../tutorial/introduction.rst:292 msgid "" "Note how the start is always included, and the end always excluded. This " "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" @@ -544,7 +538,7 @@ msgstr "" "注意到起點永遠被包含,而結尾永遠不被包含。這確保了 ``s[:i] + s[i:]`` 永遠等" "於 ``s``: ::" -#: ../../tutorial/introduction.rst:297 +#: ../../tutorial/introduction.rst:295 msgid "" ">>> word[:2] + word[2:]\n" "'Python'\n" @@ -556,7 +550,7 @@ msgstr "" ">>> word[:4] + word[4:]\n" "'Python'" -#: ../../tutorial/introduction.rst:302 +#: ../../tutorial/introduction.rst:300 msgid "" "One way to remember how slices work is to think of the indices as pointing " "*between* characters, with the left edge of the first character numbered 0. " @@ -567,7 +561,7 @@ msgstr "" "其中第一個字元的左側邊緣由 0 計數。則 *n* 個字元的字串中最後一個字元的右側邊" "緣會有索引值 *n*,例如: ::" -#: ../../tutorial/introduction.rst:307 +#: ../../tutorial/introduction.rst:305 msgid "" " +---+---+---+---+---+---+\n" " | P | y | t | h | o | n |\n" @@ -581,7 +575,7 @@ msgstr "" " 0 1 2 3 4 5 6\n" "-6 -5 -4 -3 -2 -1" -#: ../../tutorial/introduction.rst:313 +#: ../../tutorial/introduction.rst:311 msgid "" "The first row of numbers gives the position of the indices 0...6 in the " "string; the second row gives the corresponding negative indices. The slice " @@ -591,7 +585,7 @@ msgstr "" "第一行數字給定字串索引值為 0...6 的位置;第二行則標示了負索引值的位置。由 " "*i* 至 *j* 的 slice 包含了標示 *i* 和 *j* 邊緣間的所有字元。" -#: ../../tutorial/introduction.rst:318 +#: ../../tutorial/introduction.rst:316 msgid "" "For non-negative indices, the length of a slice is the difference of the " "indices, if both are within bounds. For example, the length of " @@ -600,11 +594,11 @@ msgstr "" "對非負數的索引值而言,一個 slice 的長度等於其索引值之差,如果索引值落在字串邊" "界內。例如,``word[1:3]`` 的長度是 2。" -#: ../../tutorial/introduction.rst:322 +#: ../../tutorial/introduction.rst:320 msgid "Attempting to use an index that is too large will result in an error::" msgstr "嘗試使用一個過大的索引值會造成錯誤: ::" -#: ../../tutorial/introduction.rst:324 +#: ../../tutorial/introduction.rst:322 msgid "" ">>> word[42] # the word only has 6 characters\n" "Traceback (most recent call last):\n" @@ -612,13 +606,13 @@ msgid "" "IndexError: string index out of range" msgstr "" -#: ../../tutorial/introduction.rst:329 +#: ../../tutorial/introduction.rst:327 msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" msgstr "然而,超出範圍的索引值在 slice 中會被妥善的處理: ::" -#: ../../tutorial/introduction.rst:332 +#: ../../tutorial/introduction.rst:330 msgid "" ">>> word[4:42]\n" "'on'\n" @@ -630,7 +624,7 @@ msgstr "" ">>> word[42:]\n" "''" -#: ../../tutorial/introduction.rst:337 +#: ../../tutorial/introduction.rst:335 msgid "" "Python strings cannot be changed --- they are :term:`immutable`. Therefore, " "assigning to an indexed position in the string results in an error::" @@ -638,7 +632,7 @@ msgstr "" "Python 字串無法被改變 --- 它們是 :term:`immutable`。因此,嘗試對字串中某個索" "引位置賦值會產生錯誤: ::" -#: ../../tutorial/introduction.rst:340 +#: ../../tutorial/introduction.rst:338 msgid "" ">>> word[0] = 'J'\n" "Traceback (most recent call last):\n" @@ -650,11 +644,11 @@ msgid "" "TypeError: 'str' object does not support item assignment" msgstr "" -#: ../../tutorial/introduction.rst:349 +#: ../../tutorial/introduction.rst:347 msgid "If you need a different string, you should create a new one::" msgstr "如果你需要一個不一樣的字串,你必須建立一個新的: ::" -#: ../../tutorial/introduction.rst:351 +#: ../../tutorial/introduction.rst:349 msgid "" ">>> 'J' + word[1:]\n" "'Jython'\n" @@ -666,11 +660,11 @@ msgstr "" ">>> word[:2] + 'py'\n" "'Pypy'" -#: ../../tutorial/introduction.rst:356 +#: ../../tutorial/introduction.rst:354 msgid "The built-in function :func:`len` returns the length of a string::" msgstr "內建的函式 :func:`len` 回傳一個字串的長度: ::" -#: ../../tutorial/introduction.rst:358 +#: ../../tutorial/introduction.rst:356 msgid "" ">>> s = 'supercalifragilisticexpialidocious'\n" ">>> len(s)\n" @@ -680,47 +674,47 @@ msgstr "" ">>> len(s)\n" "34" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:363 msgid ":ref:`textseq`" msgstr ":ref:`textseq`" -#: ../../tutorial/introduction.rst:366 +#: ../../tutorial/introduction.rst:364 msgid "" "Strings are examples of *sequence types*, and support the common operations " "supported by such types." msgstr "字串是 *sequence 型別*\\ 的範例之一,並支援該型別常用的操作。" -#: ../../tutorial/introduction.rst:369 +#: ../../tutorial/introduction.rst:367 msgid ":ref:`string-methods`" msgstr ":ref:`string-methods`" -#: ../../tutorial/introduction.rst:370 +#: ../../tutorial/introduction.rst:368 msgid "" "Strings support a large number of methods for basic transformations and " "searching." msgstr "字串支援非常多種基本轉換和搜尋的 method(方法)。" -#: ../../tutorial/introduction.rst:373 +#: ../../tutorial/introduction.rst:371 msgid ":ref:`f-strings`" msgstr ":ref:`f-strings`" -#: ../../tutorial/introduction.rst:374 +#: ../../tutorial/introduction.rst:372 msgid "String literals that have embedded expressions." msgstr "包含有運算式的字串文本。" -#: ../../tutorial/introduction.rst:376 +#: ../../tutorial/introduction.rst:374 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../tutorial/introduction.rst:377 +#: ../../tutorial/introduction.rst:375 msgid "Information about string formatting with :meth:`str.format`." msgstr "關於透過 :meth:`str.format` 字串格式化 (string formatting) 的資訊。" -#: ../../tutorial/introduction.rst:379 +#: ../../tutorial/introduction.rst:377 msgid ":ref:`old-string-formatting`" msgstr ":ref:`old-string-formatting`" -#: ../../tutorial/introduction.rst:380 +#: ../../tutorial/introduction.rst:378 msgid "" "The old formatting operations invoked when strings are the left operand of " "the ``%`` operator are described in more detail here." @@ -728,11 +722,11 @@ msgstr "" "在字串為 ``%`` 運算子的左運算元時,將觸發舊的字串格式化操作,更多的細節在本連" "結中介紹。" -#: ../../tutorial/introduction.rst:387 +#: ../../tutorial/introduction.rst:385 msgid "Lists" msgstr "List(串列)" -#: ../../tutorial/introduction.rst:389 +#: ../../tutorial/introduction.rst:387 msgid "" "Python knows a number of *compound* data types, used to group together other " "values. The most versatile is the *list*, which can be written as a list of " @@ -743,7 +737,7 @@ msgstr "" "*list*,可以寫成一系列以逗號分隔的數值(稱之元素,即 item),包含在方括號之" "中。List 可以包合不同型別的元素,但通常這些元素會有相同的型別: ::" -#: ../../tutorial/introduction.rst:394 +#: ../../tutorial/introduction.rst:392 msgid "" ">>> squares = [1, 4, 9, 16, 25]\n" ">>> squares\n" @@ -753,7 +747,7 @@ msgstr "" ">>> squares\n" "[1, 4, 9, 16, 25]" -#: ../../tutorial/introduction.rst:398 +#: ../../tutorial/introduction.rst:396 msgid "" "Like strings (and all other built-in :term:`sequence` types), lists can be " "indexed and sliced::" @@ -761,7 +755,7 @@ msgstr "" "如同字串(以及其他內建的 :term:`sequence` 型別),list 可以被索引和切片 " "(slice): ::" -#: ../../tutorial/introduction.rst:401 +#: ../../tutorial/introduction.rst:399 msgid "" ">>> squares[0] # indexing returns the item\n" "1\n" @@ -771,11 +765,11 @@ msgid "" "[9, 16, 25]" msgstr "" -#: ../../tutorial/introduction.rst:408 +#: ../../tutorial/introduction.rst:406 msgid "Lists also support operations like concatenation::" msgstr "List 對支援如接合 (concatenation) 等操作: ::" -#: ../../tutorial/introduction.rst:410 +#: ../../tutorial/introduction.rst:408 msgid "" ">>> squares + [36, 49, 64, 81, 100]\n" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" @@ -783,7 +777,7 @@ msgstr "" ">>> squares + [36, 49, 64, 81, 100]\n" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" -#: ../../tutorial/introduction.rst:413 +#: ../../tutorial/introduction.rst:411 msgid "" "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` " "type, i.e. it is possible to change their content::" @@ -791,7 +785,7 @@ msgstr "" "不同於字串是 :term:`immutable`,list 是 :term:`mutable` 型別,即改變 list 的" "內容是可能的: ::" -#: ../../tutorial/introduction.rst:416 +#: ../../tutorial/introduction.rst:414 msgid "" ">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" ">>> 4 ** 3 # the cube of 4 is 64, not 65!\n" @@ -801,7 +795,7 @@ msgid "" "[1, 8, 27, 64, 125]" msgstr "" -#: ../../tutorial/introduction.rst:423 +#: ../../tutorial/introduction.rst:421 msgid "" "You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" @@ -809,7 +803,7 @@ msgstr "" "你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " "(method)(我們稍後會看到更多方法的說明): ::" -#: ../../tutorial/introduction.rst:426 +#: ../../tutorial/introduction.rst:424 msgid "" ">>> cubes.append(216) # add the cube of 6\n" ">>> cubes.append(7 ** 3) # and the cube of 7\n" @@ -817,7 +811,7 @@ msgid "" "[1, 8, 27, 64, 125, 216, 343]" msgstr "" -#: ../../tutorial/introduction.rst:431 +#: ../../tutorial/introduction.rst:429 msgid "" "Simple assignment in Python never copies data. When you assign a list to a " "variable, the variable refers to the *existing list*. Any changes you make " @@ -828,7 +822,7 @@ msgstr "" "\\ *現有 list*。任何透過一個變數對 list 所做的更改都將能夠透過參照該變數的所" "有其他變數看到。 ::" -#: ../../tutorial/introduction.rst:436 +#: ../../tutorial/introduction.rst:434 msgid "" ">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" ">>> rgba = rgb\n" @@ -839,7 +833,7 @@ msgid "" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" msgstr "" -#: ../../tutorial/introduction.rst:444 +#: ../../tutorial/introduction.rst:442 msgid "" "All slice operations return a new list containing the requested elements. " "This means that the following slice returns a :ref:`shallow copy " @@ -848,7 +842,7 @@ msgstr "" "所有切片操作都會回傳一個新的 list ,包含要求的元素。這意謂著以下這個切片回傳" "了原本 list 的\\ :ref:`淺複製 `: ::" -#: ../../tutorial/introduction.rst:448 +#: ../../tutorial/introduction.rst:446 msgid "" ">>> correct_rgba = rgba[:]\n" ">>> correct_rgba[-1] = \"Alpha\"\n" @@ -864,13 +858,13 @@ msgstr "" ">>> rgba\n" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" -#: ../../tutorial/introduction.rst:455 +#: ../../tutorial/introduction.rst:453 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" msgstr "也可以對 slice 賦值,這能改變 list 的大小,甚至是清空一個 list: ::" -#: ../../tutorial/introduction.rst:458 +#: ../../tutorial/introduction.rst:456 msgid "" ">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" ">>> letters\n" @@ -889,11 +883,11 @@ msgid "" "[]" msgstr "" -#: ../../tutorial/introduction.rst:474 +#: ../../tutorial/introduction.rst:472 msgid "The built-in function :func:`len` also applies to lists::" msgstr "內建的函式 :func:`len` 亦可以作用在 list 上: ::" -#: ../../tutorial/introduction.rst:476 +#: ../../tutorial/introduction.rst:474 msgid "" ">>> letters = ['a', 'b', 'c', 'd']\n" ">>> len(letters)\n" @@ -903,13 +897,13 @@ msgstr "" ">>> len(letters)\n" "4" -#: ../../tutorial/introduction.rst:480 +#: ../../tutorial/introduction.rst:478 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" msgstr "也可以嵌套多層 list (建立 list 包含其他 list),例如: ::" -#: ../../tutorial/introduction.rst:483 +#: ../../tutorial/introduction.rst:481 msgid "" ">>> a = ['a', 'b', 'c']\n" ">>> n = [1, 2, 3]\n" @@ -931,11 +925,11 @@ msgstr "" ">>> x[0][1]\n" "'b'" -#: ../../tutorial/introduction.rst:496 +#: ../../tutorial/introduction.rst:494 msgid "First Steps Towards Programming" msgstr "初探程式設計的前幾步" -#: ../../tutorial/introduction.rst:498 +#: ../../tutorial/introduction.rst:496 msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " @@ -946,7 +940,7 @@ msgstr "" "費氏數列 `_\\ 的首幾項序列: ::" -#: ../../tutorial/introduction.rst:503 +#: ../../tutorial/introduction.rst:501 msgid "" ">>> # Fibonacci series:\n" ">>> # the sum of two elements defines the next\n" @@ -964,11 +958,11 @@ msgid "" "8" msgstr "" -#: ../../tutorial/introduction.rst:518 +#: ../../tutorial/introduction.rst:516 msgid "This example introduces several new features." msgstr "這例子引入了許多新的特性。" -#: ../../tutorial/introduction.rst:520 +#: ../../tutorial/introduction.rst:518 msgid "" "The first line contains a *multiple assignment*: the variables ``a`` and " "``b`` simultaneously get the new values 0 and 1. On the last line this is " @@ -980,7 +974,7 @@ msgstr "" "同樣的賦值再被使用了一次,示範了等號的右項運算 (expression) 會先被計算 " "(evaluate),賦值再發生。右項的運算式由左至右依序被計算。" -#: ../../tutorial/introduction.rst:526 +#: ../../tutorial/introduction.rst:524 msgid "" "The :keyword:`while` loop executes as long as the condition (here: ``a < " "10``) remains true. In Python, like in C, any non-zero integer value is " @@ -998,7 +992,7 @@ msgstr "" "使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" "於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" -#: ../../tutorial/introduction.rst:535 +#: ../../tutorial/introduction.rst:533 msgid "" "The *body* of the loop is *indented*: indentation is Python's way of " "grouping statements. At the interactive prompt, you have to type a tab or " @@ -1016,7 +1010,7 @@ msgstr "" "析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方式與" "數量必須維持一致。" -#: ../../tutorial/introduction.rst:544 +#: ../../tutorial/introduction.rst:542 msgid "" "The :func:`print` function writes the value of the argument(s) it is given. " "It differs from just writing the expression you want to write (as we did " @@ -1030,7 +1024,7 @@ msgstr "" "將不帶有引號,並且不同項目間會插入一個空白,因此可以讓你容易格式化輸出,例" "如: ::" -#: ../../tutorial/introduction.rst:551 +#: ../../tutorial/introduction.rst:549 msgid "" ">>> i = 256*256\n" ">>> print('The value of i is', i)\n" @@ -1040,7 +1034,7 @@ msgstr "" ">>> print('The value of i is', i)\n" "The value of i is 65536" -#: ../../tutorial/introduction.rst:555 +#: ../../tutorial/introduction.rst:553 msgid "" "The keyword argument *end* can be used to avoid the newline after the " "output, or end the output with a different string::" @@ -1048,7 +1042,7 @@ msgstr "" "關鍵字引數 *end* 可以被用來避免額外的換行符加入到輸出中,或者以不同的字串結束" "輸出: ::" -#: ../../tutorial/introduction.rst:558 +#: ../../tutorial/introduction.rst:556 msgid "" ">>> a, b = 0, 1\n" ">>> while a < 1000:\n" @@ -1064,11 +1058,11 @@ msgstr "" "...\n" "0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987," -#: ../../tutorial/introduction.rst:567 +#: ../../tutorial/introduction.rst:565 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/introduction.rst:568 +#: ../../tutorial/introduction.rst:566 msgid "" "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted " "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " @@ -1077,7 +1071,7 @@ msgstr "" "因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" "到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" -#: ../../tutorial/introduction.rst:572 +#: ../../tutorial/introduction.rst:570 msgid "" "Unlike other languages, special characters such as ``\\n`` have the same " "meaning with both single (``'...'``) and double (``\"...\"``) quotes. The " @@ -1095,3 +1089,8 @@ msgstr "# (hash)" #: ../../tutorial/introduction.rst:21 msgid "comment" msgstr "comment(註解)" + +#~ msgid "" +#~ "produces the following output (note that the initial newline is not " +#~ "included):" +#~ msgstr "會產生以下的輸出(注意第一個換行並沒有被包含進字串值中):" diff --git a/tutorial/modules.po b/tutorial/modules.po index 02d752fd55..8c498966e7 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1156,28 +1156,29 @@ msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" #: ../../tutorial/modules.rst:588 +#, fuzzy msgid "" -"Packages support one more special attribute, :attr:`__path__`. This is " -"initialized to be a list containing the name of the directory holding the " -"package's :file:`__init__.py` before the code in that file is executed. " -"This variable can be modified; doing so affects future searches for modules " -"and subpackages contained in the package." +"Packages support one more special attribute, :attr:`~module.__path__`. This " +"is initialized to be a :term:`sequence` of strings containing the name of " +"the directory holding the package's :file:`__init__.py` before the code in " +"that file is executed. This variable can be modified; doing so affects " +"future searches for modules and subpackages contained in the package." msgstr "" "套件也支援一個特殊屬性 :attr:`__path__`。它在初始化時是一個 list,包含該套件" "的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時機是在這個檔案的程式碼被執" "行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜尋。" -#: ../../tutorial/modules.rst:594 +#: ../../tutorial/modules.rst:595 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:599 +#: ../../tutorial/modules.rst:600 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:600 +#: ../../tutorial/modules.rst:601 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 fdee4c513d..7c044379bf 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -1293,8 +1293,9 @@ msgid "" msgstr "" #: ../../using/cmdline.rst:1030 ../../using/cmdline.rst:1044 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +#: ../../using/cmdline.rst:1095 +msgid "Availability" +msgstr "" #: ../../using/cmdline.rst:1032 msgid "See :pep:`529` for more details." @@ -1383,10 +1384,6 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1095 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../using/cmdline.rst:1097 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`。" @@ -1571,3 +1568,9 @@ msgstr "" #: ../../using/cmdline.rst:1261 msgid "Needs Python configured with the :option:`--with-pydebug` build option." msgstr "" + +#~ msgid ":ref:`Availability `: Windows." +#~ msgstr ":ref:`適用 `:Windows。" + +#~ msgid ":ref:`Availability `: Unix." +#~ msgstr ":ref:`適用 `:Unix。" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index de308f3fc6..b5c9177e3c 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -688,17 +688,17 @@ msgstr "" #: ../../whatsnew/2.6.rst:505 msgid "" -"The fix for Python 2.6 adds a :attr:`__package__` attribute to modules. " -"When this attribute is present, relative imports will be relative to the " -"value of this attribute instead of the :attr:`__name__` attribute." +"The fix for Python 2.6 adds a :attr:`module.__package__` attribute. When " +"this attribute is present, relative imports will be relative to the value of " +"this attribute instead of the :attr:`~module.__name__` attribute." msgstr "" #: ../../whatsnew/2.6.rst:510 msgid "" -"PEP 302-style importers can then set :attr:`__package__` as necessary. The :" -"mod:`runpy` module that implements the :option:`-m` switch now does this, so " -"relative imports will now work correctly in scripts running from inside a " -"package." +"PEP 302-style importers can then set :attr:`~module.__package__` as " +"necessary. The :mod:`runpy` module that implements the :option:`-m` switch " +"now does this, so relative imports will now work correctly in scripts " +"running from inside a package." msgstr "" #: ../../whatsnew/2.6.rst:520 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 3c93e678fd..676d40f4b3 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -443,9 +443,9 @@ msgid "" ":pep:`3107`: Function argument and return value annotations. This provides " "a standardized way of annotating a function's parameters and return value. " "There are no semantics attached to such annotations except that they can be " -"introspected at runtime using the :attr:`__annotations__` attribute. The " -"intent is to encourage experimentation through metaclasses, decorators or " -"frameworks." +"introspected at runtime using the :attr:`~object.__annotations__` " +"attribute. The intent is to encourage experimentation through metaclasses, " +"decorators or frameworks." msgstr "" #: ../../whatsnew/3.0.rst:363 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 91c9586e38..d624b5b66a 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 18:29+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -265,7 +265,7 @@ msgstr "" "`unittest.TestCase` 的\\ `方法別名 `_\\ " "已被刪除。" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1826 msgid "New Features" msgstr "新增特性" @@ -1251,7 +1251,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1530 msgid "sqlite3" msgstr "sqlite3" @@ -1326,7 +1326,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1725 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " @@ -1498,7 +1498,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1570 msgid "unittest" msgstr "unittest" @@ -1706,12 +1706,12 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2127 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2128 msgid "Deprecated" msgstr "已棄用" #: ../../whatsnew/3.12.rst:1145 -#: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -1730,32 +1730,32 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1154 -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" #: ../../whatsnew/3.12.rst:1155 -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" #: ../../whatsnew/3.12.rst:1156 -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" #: ../../whatsnew/3.12.rst:1157 -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" #: ../../whatsnew/3.12.rst:1158 -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1160 -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" @@ -1763,7 +1763,7 @@ msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" #: ../../whatsnew/3.12.rst:1163 -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" @@ -1776,7 +1776,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1171 -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1789,7 +1789,7 @@ msgstr "" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1177 -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1844,37 +1844,37 @@ msgid "" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" #: ../../whatsnew/3.12.rst:1205 -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1206 -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1207 -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1209 -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" #: ../../whatsnew/3.12.rst:1211 -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1212 -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1214 -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" @@ -1958,7 +1958,7 @@ msgstr "" "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1267 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" @@ -1994,7 +1994,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2031,19 +2031,24 @@ msgstr "" #: ../../whatsnew/3.12.rst:1312 msgid "" -":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " -"differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " -"(Contributed by Brett Cannon in :gh:`65961`.)" +":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " +"a module differs from :attr:`__spec__.parent ` (previously it was :exc:`ImportWarning`). (Contributed by Brett " +"Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1318 +#, fuzzy msgid "" -"Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " -"will cease to be set or taken into consideration by the import system in " -"Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" +"Setting :attr:`~module.__package__` or :attr:`~module.__cached__` on a " +"module is deprecated, and will cease to be set or taken into consideration " +"by the import system in Python 3.14. (Contributed by Brett Cannon in :gh:" +"`65961`.)" msgstr "" +":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " +"系統考慮。 (:gh:`97879`)" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1322 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.16. Use ``not`` for logical negation of bools instead. " @@ -2052,7 +2057,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1328 msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " "Python 3.10 via :pep:`626`, but it only got a proper :exc:" @@ -2239,7 +2244,20 @@ msgstr "" msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -2248,7 +2266,7 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2260,7 +2278,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2272,7 +2290,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -2280,11 +2298,11 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2295,7 +2313,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2312,7 +2330,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -2320,7 +2338,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -2330,23 +2348,23 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -2356,7 +2374,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -2364,7 +2382,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -2376,7 +2394,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -2384,7 +2402,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -2398,23 +2416,39 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 #, fuzzy msgid ":mod:`ctypes`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:6 +#: ../../deprecations/pending-removal-in-3.15.rst:18 msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 #, fuzzy msgid ":mod:`http.server`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 #, fuzzy msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " @@ -2425,26 +2459,18 @@ msgstr "" "cgi`` 旗標到 ``python -m http.server``。它已經過時且很少被使用。沒有直接的替" "代方案。*任何東西*\\ 都比 CGI 更好的來介接一個帶有請求處理器的網頁伺服器。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -2458,12 +2484,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -2472,24 +2498,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -2497,7 +2523,7 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -2509,19 +2535,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -3013,32 +3039,32 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.12.rst:1344 ../../whatsnew/3.12.rst:2222 +#: ../../whatsnew/3.12.rst:1345 ../../whatsnew/3.12.rst:2223 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1348 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1350 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1357 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1359 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1362 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." @@ -3046,23 +3072,23 @@ msgstr "" ":class:`configparser.ParsingError` 不再具有 ``filename`` 屬性或引數。請改用 " "``source`` 屬性和引數。" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1364 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1366 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1370 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1372 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -3071,17 +3097,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1379 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1381 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1384 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -3089,7 +3115,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1390 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3099,25 +3125,25 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1397 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1400 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1402 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1407 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1409 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" @@ -3125,11 +3151,11 @@ msgstr "" "移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" "數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1413 +#: ../../whatsnew/3.12.rst:1414 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1416 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -3138,11 +3164,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1423 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1425 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -3151,17 +3177,17 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1431 ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1459 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1434 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "現已完成清理 :mod:`importlib` 中許多過去已經棄用的東西:" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1437 msgid "" "References to, and support for :meth:`!module_repr` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" @@ -3169,134 +3195,134 @@ msgstr "" "對 :meth:`!module_repr` 的參照和支援已刪除。(由 Barry Warsaw 在 :gh:`97850` " "中貢獻。)" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1440 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1444 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1447 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1450 ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1451 ../../whatsnew/3.12.rst:1459 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1453 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1456 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1461 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1461 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1462 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1462 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1463 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1463 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1464 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1464 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1465 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1465 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1466 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1466 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1468 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1468 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1470 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1470 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "*See below*" msgstr "*見下文*" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1474 msgid "Replace ``imp.load_source()`` with::" msgstr "用以下取代 ``imp.load_source()``: ::" -#: ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1476 msgid "" "import importlib.util\n" "import importlib.machinery\n" @@ -3313,37 +3339,37 @@ msgid "" " return module" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1489 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "移除 :mod:`!imp` 函式和屬性、沒有替代方案:" -#: ../../whatsnew/3.12.rst:1490 +#: ../../whatsnew/3.12.rst:1491 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1493 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1493 +#: ../../whatsnew/3.12.rst:1494 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1495 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1496 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1497 +#: ../../whatsnew/3.12.rst:1498 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1499 +#: ../../whatsnew/3.12.rst:1500 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " @@ -3353,11 +3379,11 @@ msgstr "" "``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" "``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1504 +#: ../../whatsnew/3.12.rst:1505 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1507 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -3366,22 +3392,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1514 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1516 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1521 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1523 msgid "" "The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:" @@ -3389,27 +3415,27 @@ msgid "" "(Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1532 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1535 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1535 +#: ../../whatsnew/3.12.rst:1536 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1538 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1540 +#: ../../whatsnew/3.12.rst:1541 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -3417,22 +3443,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1546 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1549 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1550 +#: ../../whatsnew/3.12.rst:1551 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1554 +#: ../../whatsnew/3.12.rst:1555 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -3440,7 +3466,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1561 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -3451,189 +3477,189 @@ msgid "" "`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1572 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1576 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "許多 :class:`~unittest.TestCase` 方法別名:" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Deprecated in" msgstr "已棄用於" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1581 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1580 ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1588 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1580 ../../whatsnew/3.12.rst:1581 -#: ../../whatsnew/3.12.rst:1582 ../../whatsnew/3.12.rst:1583 -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1585 -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1582 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1582 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1583 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1582 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1584 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1586 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1592 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1588 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1588 -#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1590 -#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1592 -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1588 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1598 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1600 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1604 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.5)." msgstr "" -#: ../../whatsnew/3.12.rst:1607 +#: ../../whatsnew/3.12.rst:1608 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1611 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1614 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1616 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1621 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1623 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -3642,22 +3668,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1630 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1631 +#: ../../whatsnew/3.12.rst:1632 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1638 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1640 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -3957,15 +3983,15 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1835 +#: ../../whatsnew/3.12.rst:1836 msgid "Code object constructors:" msgstr "程式碼物件建構函式:" -#: ../../whatsnew/3.12.rst:1837 +#: ../../whatsnew/3.12.rst:1838 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 重新命名)" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:1839 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" @@ -3973,11 +3999,11 @@ msgstr "" "``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " "``PyCode_NewWithPosOnlyArgs`` 重新命名)" -#: ../../whatsnew/3.12.rst:1840 +#: ../../whatsnew/3.12.rst:1841 msgid "Extra storage for code objects (:pep:`523`):" msgstr "程式碼物件的額外儲存 (:pep:`523`):" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1843 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" @@ -3985,31 +4011,31 @@ msgstr "" "``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " "``_PyEval_RequestCodeExtraIndex`` 重新命名)" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1844 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1844 +#: ../../whatsnew/3.12.rst:1845 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1846 +#: ../../whatsnew/3.12.rst:1847 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "原始名稱將可繼續使用,直到相應的 API 發生變更。" -#: ../../whatsnew/3.12.rst:1849 +#: ../../whatsnew/3.12.rst:1850 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:1852 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1854 +#: ../../whatsnew/3.12.rst:1855 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." @@ -4017,30 +4043,30 @@ msgstr "" ":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" "小。" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1857 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1858 +#: ../../whatsnew/3.12.rst:1859 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1861 +#: ../../whatsnew/3.12.rst:1862 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1865 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1866 +#: ../../whatsnew/3.12.rst:1867 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -4048,29 +4074,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1872 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1876 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1877 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1878 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1879 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1881 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -4081,7 +4107,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1889 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -4089,32 +4115,32 @@ msgid "" "bookkeeping, using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1894 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1897 +#: ../../whatsnew/3.12.rst:1898 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1899 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1900 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1901 +#: ../../whatsnew/3.12.rst:1902 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1905 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -4122,14 +4148,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1912 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1915 +#: ../../whatsnew/3.12.rst:1916 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -4138,28 +4164,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1921 +#: ../../whatsnew/3.12.rst:1922 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1925 +#: ../../whatsnew/3.12.rst:1926 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1931 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:1935 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -4169,14 +4195,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1943 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1947 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -4184,71 +4210,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1952 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1958 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1961 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1962 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1963 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1964 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "``PyObject_HEAD_INIT`` 這現在將初始化參照計數" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1965 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1966 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1967 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1968 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1969 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1970 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1971 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1974 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1976 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -4256,27 +4282,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1982 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:1990 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:1993 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:1997 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -4285,7 +4311,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2004 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -4293,13 +4319,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2009 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2012 +#: ../../whatsnew/3.12.rst:2013 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -4308,7 +4334,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2018 +#: ../../whatsnew/3.12.rst:2019 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -4317,13 +4343,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2025 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2029 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " "reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -4337,7 +4363,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2041 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -4345,7 +4371,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2046 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -4353,7 +4379,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2051 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -4361,7 +4387,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2056 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -4369,25 +4395,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2061 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2064 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2065 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2066 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2068 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -4395,14 +4421,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2073 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2076 +#: ../../whatsnew/3.12.rst:2077 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -4411,17 +4437,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2083 +#: ../../whatsnew/3.12.rst:2084 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2085 +#: ../../whatsnew/3.12.rst:2086 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2088 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -4429,20 +4455,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2093 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2096 +#: ../../whatsnew/3.12.rst:2097 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2099 +#: ../../whatsnew/3.12.rst:2100 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -4450,14 +4476,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2105 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2108 +#: ../../whatsnew/3.12.rst:2109 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4468,15 +4494,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2117 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2117 +#: ../../whatsnew/3.12.rst:2118 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2119 +#: ../../whatsnew/3.12.rst:2120 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -4485,7 +4511,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2130 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -4494,76 +4520,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2135 msgid "Deprecate global configuration variable:" msgstr "棄用全域配置變數:" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2137 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2138 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2138 +#: ../../whatsnew/3.12.rst:2139 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2140 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2140 +#: ../../whatsnew/3.12.rst:2141 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2141 +#: ../../whatsnew/3.12.rst:2142 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2143 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2143 +#: ../../whatsnew/3.12.rst:2144 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2144 +#: ../../whatsnew/3.12.rst:2145 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2146 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2146 +#: ../../whatsnew/3.12.rst:2147 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2147 +#: ../../whatsnew/3.12.rst:2148 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2148 +#: ../../whatsnew/3.12.rst:2149 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2149 +#: ../../whatsnew/3.12.rst:2150 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -4571,11 +4597,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2151 +#: ../../whatsnew/3.12.rst:2152 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2153 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -4583,7 +4609,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2153 +#: ../../whatsnew/3.12.rst:2154 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -4591,7 +4617,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2154 +#: ../../whatsnew/3.12.rst:2155 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4599,7 +4625,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2156 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4607,7 +4633,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2157 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -4615,7 +4641,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2158 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -4623,7 +4649,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2160 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -4631,25 +4657,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2163 +#: ../../whatsnew/3.12.rst:2164 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2166 +#: ../../whatsnew/3.12.rst:2167 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2169 +#: ../../whatsnew/3.12.rst:2170 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2172 +#: ../../whatsnew/3.12.rst:2173 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -4657,13 +4683,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2174 +#: ../../whatsnew/3.12.rst:2175 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2176 +#: ../../whatsnew/3.12.rst:2177 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -4671,23 +4697,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2179 +#: ../../whatsnew/3.12.rst:2180 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2181 +#: ../../whatsnew/3.12.rst:2182 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2183 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2183 +#: ../../whatsnew/3.12.rst:2184 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2185 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -4695,33 +4721,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2186 +#: ../../whatsnew/3.12.rst:2187 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2189 +#: ../../whatsnew/3.12.rst:2190 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2194 +#: ../../whatsnew/3.12.rst:2195 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2197 +#: ../../whatsnew/3.12.rst:2198 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2202 +#: ../../whatsnew/3.12.rst:2203 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -4729,7 +4755,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2205 +#: ../../whatsnew/3.12.rst:2206 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -4737,7 +4763,7 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2208 +#: ../../whatsnew/3.12.rst:2209 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" @@ -5181,54 +5207,54 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.12.rst:2224 +#: ../../whatsnew/3.12.rst:2225 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2229 +#: ../../whatsnew/3.12.rst:2230 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2231 +#: ../../whatsnew/3.12.rst:2232 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2232 +#: ../../whatsnew/3.12.rst:2233 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:2234 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2234 +#: ../../whatsnew/3.12.rst:2235 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2236 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2236 +#: ../../whatsnew/3.12.rst:2237 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2237 +#: ../../whatsnew/3.12.rst:2238 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2238 +#: ../../whatsnew/3.12.rst:2239 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2239 +#: ../../whatsnew/3.12.rst:2240 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2241 +#: ../../whatsnew/3.12.rst:2242 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 363ce192a1..87110ac562 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 18:29+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -339,7 +339,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1964 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1968 msgid "New Features" msgstr "" @@ -1125,7 +1125,7 @@ msgid "compileall" msgstr "" #: ../../whatsnew/3.13.rst:757 ../../whatsnew/3.13.rst:765 -#: ../../whatsnew/3.13.rst:1013 +#: ../../whatsnew/3.13.rst:1017 msgid "" "The default number of worker threads and processes is now selected using :" "func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " @@ -1136,7 +1136,7 @@ msgstr "" msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1608 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1612 msgid "configparser" msgstr "" @@ -1223,29 +1223,37 @@ msgid "" "projects." msgstr "" -#: ../../whatsnew/3.13.rst:819 +#: ../../whatsnew/3.13.rst:817 +msgid "" +":class:`ctypes.Structure` objects have a new :attr:`~ctypes.Structure." +"_align_` attribute which allows the alignment of the structure being packed " +"to/from memory to be specified explicitly. (Contributed by Matt Sanderson " +"in :gh:`112433`)" +msgstr "" + +#: ../../whatsnew/3.13.rst:823 msgid "dbm" msgstr "" -#: ../../whatsnew/3.13.rst:821 +#: ../../whatsnew/3.13.rst:825 msgid "" "Add :mod:`dbm.sqlite3`, a new module which implements an SQLite backend, and " "make it the default :mod:`!dbm` backend. (Contributed by Raymond Hettinger " "and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:825 +#: ../../whatsnew/3.13.rst:829 msgid "" "Allow removing all items from the database through the new :meth:`.gdbm." "clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" "`107122`.)" msgstr "" -#: ../../whatsnew/3.13.rst:831 +#: ../../whatsnew/3.13.rst:835 msgid "dis" msgstr "" -#: ../../whatsnew/3.13.rst:833 +#: ../../whatsnew/3.13.rst:837 msgid "" "Change the output of :mod:`dis` module functions to show logical labels for " "jump targets and exception handlers, rather than offsets. The offsets can be " @@ -1253,7 +1261,7 @@ msgid "" "the *show_offsets* argument. (Contributed by Irit Katriel in :gh:`112137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:840 +#: ../../whatsnew/3.13.rst:844 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " "instructions. Instead, it returns them as part of the :class:`~dis." @@ -1262,11 +1270,11 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:852 +#: ../../whatsnew/3.13.rst:856 msgid "doctest" msgstr "" -#: ../../whatsnew/3.13.rst:854 +#: ../../whatsnew/3.13.rst:858 msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " @@ -1275,18 +1283,18 @@ msgid "" "`117225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:861 +#: ../../whatsnew/3.13.rst:865 msgid "" "The :meth:`.DocTestRunner.run` method now counts the number of skipped " "tests. Add the :attr:`.DocTestRunner.skips` and :attr:`.TestResults.skipped` " "attributes. (Contributed by Victor Stinner in :gh:`108794`.)" msgstr "" -#: ../../whatsnew/3.13.rst:867 +#: ../../whatsnew/3.13.rst:871 msgid "email" msgstr "" -#: ../../whatsnew/3.13.rst:869 +#: ../../whatsnew/3.13.rst:873 msgid "" "Headers with embedded newlines are now quoted on output. The :mod:`~email." "generator` will now refuse to serialize (write) headers that are improperly " @@ -1296,7 +1304,7 @@ msgid "" "Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" -#: ../../whatsnew/3.13.rst:877 +#: ../../whatsnew/3.13.rst:881 msgid "" ":func:`~email.utils.getaddresses` and :func:`~email.utils.parseaddr` now " "return ``('', '')`` pairs in more situations where invalid email addresses " @@ -1308,11 +1316,11 @@ msgid "" "Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" -#: ../../whatsnew/3.13.rst:889 +#: ../../whatsnew/3.13.rst:893 msgid "fractions" msgstr "" -#: ../../whatsnew/3.13.rst:891 +#: ../../whatsnew/3.13.rst:895 msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " @@ -1320,22 +1328,22 @@ msgid "" "`111320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:898 +#: ../../whatsnew/3.13.rst:902 msgid "glob" msgstr "" -#: ../../whatsnew/3.13.rst:900 +#: ../../whatsnew/3.13.rst:904 msgid "" "Add :func:`~glob.translate`, a function to convert a path specification with " "shell-style wildcards to a regular expression. (Contributed by Barney Gale " "in :gh:`72904`.)" msgstr "" -#: ../../whatsnew/3.13.rst:906 +#: ../../whatsnew/3.13.rst:910 msgid "importlib" msgstr "" -#: ../../whatsnew/3.13.rst:908 +#: ../../whatsnew/3.13.rst:912 msgid "" "The following functions in :mod:`importlib.resources` now allow accessing a " "directory (or tree) of resources, using multiple positional arguments (the " @@ -1343,49 +1351,49 @@ msgid "" "keyword-only):" msgstr "" -#: ../../whatsnew/3.13.rst:913 +#: ../../whatsnew/3.13.rst:917 msgid ":func:`~importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.13.rst:914 +#: ../../whatsnew/3.13.rst:918 msgid ":func:`~importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:915 +#: ../../whatsnew/3.13.rst:919 msgid ":func:`~importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.13.rst:916 +#: ../../whatsnew/3.13.rst:920 msgid ":func:`~importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.13.rst:917 +#: ../../whatsnew/3.13.rst:921 msgid ":func:`~importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:918 +#: ../../whatsnew/3.13.rst:922 msgid ":func:`~importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.13.rst:920 +#: ../../whatsnew/3.13.rst:924 msgid "" "These functions are no longer deprecated and are not scheduled for removal. " -"(Contributed by Petr Viktorin in :gh:`106532`.)" +"(Contributed by Petr Viktorin in :gh:`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:923 +#: ../../whatsnew/3.13.rst:927 msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " "there is now no plan to remove it. (Contributed by Petr Viktorin in :gh:" -"`106532`.)" +"`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:930 +#: ../../whatsnew/3.13.rst:934 msgid "io" msgstr "" -#: ../../whatsnew/3.13.rst:932 +#: ../../whatsnew/3.13.rst:936 msgid "" "The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" "`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " @@ -1394,17 +1402,17 @@ msgid "" "build>`. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:941 +#: ../../whatsnew/3.13.rst:945 msgid "ipaddress" msgstr "" -#: ../../whatsnew/3.13.rst:943 +#: ../../whatsnew/3.13.rst:947 msgid "" "Add the :attr:`.IPv4Address.ipv6_mapped` property, which returns the IPv4-" "mapped IPv6 address. (Contributed by Charles Machalow in :gh:`109466`.)" msgstr "" -#: ../../whatsnew/3.13.rst:947 +#: ../../whatsnew/3.13.rst:951 msgid "" "Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." "IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." @@ -1412,22 +1420,22 @@ msgid "" "Stasiak in :gh:`113171`.)" msgstr "" -#: ../../whatsnew/3.13.rst:954 +#: ../../whatsnew/3.13.rst:958 msgid "itertools" msgstr "" -#: ../../whatsnew/3.13.rst:956 +#: ../../whatsnew/3.13.rst:960 msgid "" ":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" "`ValueError` if the final batch is shorter than the specified batch size. " "(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" -#: ../../whatsnew/3.13.rst:963 +#: ../../whatsnew/3.13.rst:967 msgid "marshal" msgstr "" -#: ../../whatsnew/3.13.rst:965 +#: ../../whatsnew/3.13.rst:969 msgid "" "Add the *allow_code* parameter in module functions. Passing " "``allow_code=False`` prevents serialization and de-serialization of code " @@ -1435,11 +1443,11 @@ msgid "" "Serhiy Storchaka in :gh:`113626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:972 +#: ../../whatsnew/3.13.rst:976 msgid "math" msgstr "" -#: ../../whatsnew/3.13.rst:974 +#: ../../whatsnew/3.13.rst:978 msgid "" "The new function :func:`~math.fma` performs fused multiply-add operations. " "This computes ``x * y + z`` with only a single round, and so avoids any " @@ -1449,11 +1457,11 @@ msgid "" "Stinner in :gh:`73468`.)" msgstr "" -#: ../../whatsnew/3.13.rst:984 +#: ../../whatsnew/3.13.rst:988 msgid "mimetypes" msgstr "" -#: ../../whatsnew/3.13.rst:986 +#: ../../whatsnew/3.13.rst:990 msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " @@ -1461,18 +1469,18 @@ msgid "" "`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:993 +#: ../../whatsnew/3.13.rst:997 msgid "mmap" msgstr "" -#: ../../whatsnew/3.13.rst:995 +#: ../../whatsnew/3.13.rst:999 msgid "" ":class:`~mmap.mmap` is now protected from crashing on Windows when the " "mapped memory is inaccessible due to file system errors or access " "violations. (Contributed by Jannis Weigend in :gh:`118209`.)" msgstr "" -#: ../../whatsnew/3.13.rst:999 +#: ../../whatsnew/3.13.rst:1003 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " "used when a seekable file-like object is required. The :meth:`~mmap.mmap." @@ -1480,7 +1488,7 @@ msgid "" "Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1004 +#: ../../whatsnew/3.13.rst:1008 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " @@ -1488,22 +1496,22 @@ msgid "" "gh:`78502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1011 +#: ../../whatsnew/3.13.rst:1015 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.13.rst:1019 +#: ../../whatsnew/3.13.rst:1023 msgid "os" msgstr "" -#: ../../whatsnew/3.13.rst:1021 +#: ../../whatsnew/3.13.rst:1025 msgid "" "Add :func:`~os.process_cpu_count` function to get the number of logical CPU " "cores usable by the calling thread of the current process. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1025 +#: ../../whatsnew/3.13.rst:1029 msgid "" ":func:`~os.cpu_count` and :func:`~os.process_cpu_count` can be overridden " "through the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new " @@ -1513,7 +1521,7 @@ msgid "" "Na in :gh:`109595`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1033 +#: ../../whatsnew/3.13.rst:1037 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " "file descriptors ` via :func:`~os.timerfd_create`, :func:" @@ -1524,7 +1532,7 @@ msgid "" "in :gh:`108277`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1042 +#: ../../whatsnew/3.13.rst:1046 msgid "" ":func:`~os.lchmod` and the *follow_symlinks* argument of :func:`~os.chmod` " "are both now available on Windows. Note that the default value of " @@ -1532,14 +1540,14 @@ msgid "" "by Serhiy Storchaka in :gh:`59616`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1048 +#: ../../whatsnew/3.13.rst:1052 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " "both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" "`113191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1052 +#: ../../whatsnew/3.13.rst:1056 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " @@ -1548,14 +1556,14 @@ msgid "" "Steve Dower in :gh:`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1059 +#: ../../whatsnew/3.13.rst:1063 msgid "" ":func:`~os.posix_spawn` now accepts ``None`` for the *env* argument, which " "makes the newly spawned process use the current process environment. " "(Contributed by Jakub Kulik in :gh:`113119`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1063 +#: ../../whatsnew/3.13.rst:1067 msgid "" ":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" @@ -1563,76 +1571,76 @@ msgid "" "gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1070 +#: ../../whatsnew/3.13.rst:1074 msgid "os.path" msgstr "" -#: ../../whatsnew/3.13.rst:1072 +#: ../../whatsnew/3.13.rst:1076 msgid "" "Add :func:`~os.path.isreserved` to check if a path is reserved on the " "current system. This function is only available on Windows. (Contributed by " "Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1077 +#: ../../whatsnew/3.13.rst:1081 msgid "" "On Windows, :func:`~os.path.isabs` no longer considers paths starting with " "exactly one slash (``\\`` or ``/``) to be absolute. (Contributed by Barney " "Gale and Jon Foster in :gh:`44626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1081 +#: ../../whatsnew/3.13.rst:1085 msgid "" ":func:`~os.path.realpath` now resolves MS-DOS style file names even if the " "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1087 ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1652 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.13.rst:1089 +#: ../../whatsnew/3.13.rst:1093 msgid "" "Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" "`NotImplementedError` when a path operation isn't supported. (Contributed by " "Barney Gale in :gh:`89812`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1093 +#: ../../whatsnew/3.13.rst:1097 msgid "" "Add a new constructor for creating :class:`~pathlib.Path` objects from " "'file' URIs (``file:///``), :meth:`.Path.from_uri`. (Contributed by Barney " "Gale in :gh:`107465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1097 +#: ../../whatsnew/3.13.rst:1101 msgid "" "Add :meth:`.PurePath.full_match` for matching paths with shell-style " "wildcards, including the recursive wildcard \"``**``\". (Contributed by " "Barney Gale in :gh:`73435`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1101 +#: ../../whatsnew/3.13.rst:1105 msgid "" "Add the :attr:`.PurePath.parser` class attribute to store the implementation " "of :mod:`os.path` used for low-level path parsing and joining. This will be " "either :mod:`!posixpath` or :mod:`!ntpath`." msgstr "" -#: ../../whatsnew/3.13.rst:1106 +#: ../../whatsnew/3.13.rst:1110 msgid "" "Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" "`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1110 +#: ../../whatsnew/3.13.rst:1114 msgid "" ":meth:`.Path.glob` and :meth:`~pathlib.Path.rglob` now return files and " "directories when given a pattern that ends with \"``**``\". Previously, only " "directories were returned. (Contributed by Barney Gale in :gh:`70303`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1115 +#: ../../whatsnew/3.13.rst:1119 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " "`, :meth:`Path.is_dir `, :meth:`." @@ -1640,11 +1648,11 @@ msgid "" "`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1123 +#: ../../whatsnew/3.13.rst:1127 msgid "pdb" msgstr "" -#: ../../whatsnew/3.13.rst:1125 +#: ../../whatsnew/3.13.rst:1129 msgid "" ":func:`breakpoint` and :func:`~pdb.set_trace` now enter the debugger " "immediately rather than on the next line of code to be executed. This change " @@ -1653,20 +1661,20 @@ msgid "" "Gao in :gh:`118579`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1131 +#: ../../whatsnew/3.13.rst:1135 msgid "" "``sys.path[0]`` is no longer replaced by the directory of the script being " "debugged when :attr:`sys.flags.safe_path` is set. (Contributed by Tian Gao " "and Christian Walther in :gh:`111762`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1135 +#: ../../whatsnew/3.13.rst:1139 msgid "" ":mod:`zipapp` is now supported as a debugging target. (Contributed by Tian " "Gao in :gh:`118501`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1138 +#: ../../whatsnew/3.13.rst:1142 msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " @@ -1674,101 +1682,101 @@ msgid "" "`106676`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1143 +#: ../../whatsnew/3.13.rst:1147 msgid "" "Expressions and statements whose prefix is a pdb command are now correctly " "identified and executed. (Contributed by Tian Gao in :gh:`108464`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1149 +#: ../../whatsnew/3.13.rst:1153 msgid "queue" msgstr "" -#: ../../whatsnew/3.13.rst:1151 +#: ../../whatsnew/3.13.rst:1155 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~queue.ShutDown` " "to manage queue termination. (Contributed by Laurie Opperman and Yves Duprat " "in :gh:`104750`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1157 +#: ../../whatsnew/3.13.rst:1161 msgid "random" msgstr "" -#: ../../whatsnew/3.13.rst:1159 +#: ../../whatsnew/3.13.rst:1163 msgid "" "Add a :ref:`command-line interface `. (Contributed by Hugo van " "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1164 ../../whatsnew/3.13.rst:1656 +#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1660 msgid "re" msgstr "" -#: ../../whatsnew/3.13.rst:1166 +#: ../../whatsnew/3.13.rst:1170 msgid "" "Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" "exc:`!re.error` is kept for backward compatibility." msgstr "" -#: ../../whatsnew/3.13.rst:1171 +#: ../../whatsnew/3.13.rst:1175 msgid "shutil" msgstr "" -#: ../../whatsnew/3.13.rst:1173 +#: ../../whatsnew/3.13.rst:1177 msgid "" "Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" "`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" -#: ../../whatsnew/3.13.rst:1179 +#: ../../whatsnew/3.13.rst:1183 msgid "site" msgstr "" -#: ../../whatsnew/3.13.rst:1181 +#: ../../whatsnew/3.13.rst:1185 msgid "" ":file:`.pth` files are now decoded using UTF-8 first, and then with the :" "term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " "in :gh:`117802`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1187 +#: ../../whatsnew/3.13.rst:1191 msgid "sqlite3" msgstr "" -#: ../../whatsnew/3.13.rst:1189 +#: ../../whatsnew/3.13.rst:1193 msgid "" "A :exc:`ResourceWarning` is now emitted if a :class:`~sqlite3.Connection` " "object is not :meth:`closed ` explicitly. " "(Contributed by Erlend E. Aasland in :gh:`105539`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1193 +#: ../../whatsnew/3.13.rst:1197 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " "filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" "`91602`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1199 +#: ../../whatsnew/3.13.rst:1203 msgid "ssl" msgstr "" -#: ../../whatsnew/3.13.rst:1201 +#: ../../whatsnew/3.13.rst:1205 msgid "" "The :func:`~ssl.create_default_context` API now includes :data:`~ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " "default flags." msgstr "" -#: ../../whatsnew/3.13.rst:1207 +#: ../../whatsnew/3.13.rst:1211 msgid "" ":data:`~ssl.VERIFY_X509_STRICT` may reject pre-:rfc:`5280` or malformed " "certificates that the underlying OpenSSL implementation might otherwise " "accept. Whilst disabling this is not recommended, you can do so using:" msgstr "" -#: ../../whatsnew/3.13.rst:1212 +#: ../../whatsnew/3.13.rst:1216 msgid "" "import ssl\n" "\n" @@ -1776,15 +1784,15 @@ msgid "" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgstr "" -#: ../../whatsnew/3.13.rst:1219 +#: ../../whatsnew/3.13.rst:1223 msgid "(Contributed by William Woodruff in :gh:`112389`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1223 +#: ../../whatsnew/3.13.rst:1227 msgid "statistics" msgstr "" -#: ../../whatsnew/3.13.rst:1225 +#: ../../whatsnew/3.13.rst:1229 msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " @@ -1792,24 +1800,24 @@ msgid "" "`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1230 +#: ../../whatsnew/3.13.rst:1234 msgid "" "Add :func:`~statistics.kde_random` for sampling from an estimated " "probability density function created by :func:`~statistics.kde`. " "(Contributed by Raymond Hettinger in :gh:`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1238 +#: ../../whatsnew/3.13.rst:1242 msgid "subprocess" msgstr "" -#: ../../whatsnew/3.13.rst:1240 +#: ../../whatsnew/3.13.rst:1244 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations." msgstr "" -#: ../../whatsnew/3.13.rst:1243 +#: ../../whatsnew/3.13.rst:1247 msgid "" "Notably, when *close_fds* is ``True`` (the default), :func:`~os.posix_spawn` " "will be used when the C library provides :c:func:`!" @@ -1818,7 +1826,7 @@ msgid "" "existing Linux :c:func:`!vfork` based code." msgstr "" -#: ../../whatsnew/3.13.rst:1250 +#: ../../whatsnew/3.13.rst:1254 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " "``False`` if you need to force :mod:`subprocess` to never use :func:`~os." @@ -1828,22 +1836,22 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1260 +#: ../../whatsnew/3.13.rst:1264 msgid "sys" msgstr "" -#: ../../whatsnew/3.13.rst:1262 +#: ../../whatsnew/3.13.rst:1266 msgid "" "Add the :func:`~sys._is_interned` function to test if a string was interned. " "This function is not guaranteed to exist in all implementations of Python. " "(Contributed by Serhiy Storchaka in :gh:`78573`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1268 +#: ../../whatsnew/3.13.rst:1272 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.13.rst:1270 +#: ../../whatsnew/3.13.rst:1274 msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " @@ -1851,11 +1859,11 @@ msgid "" "`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1277 +#: ../../whatsnew/3.13.rst:1281 msgid "time" msgstr "" -#: ../../whatsnew/3.13.rst:1279 +#: ../../whatsnew/3.13.rst:1283 msgid "" "On Windows, :func:`~time.monotonic` now uses the " "``QueryPerformanceCounter()`` clock for a resolution of 1 microsecond, " @@ -1863,7 +1871,7 @@ msgid "" "milliseconds. (Contributed by Victor Stinner in :gh:`88494`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1285 +#: ../../whatsnew/3.13.rst:1289 msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " @@ -1872,11 +1880,11 @@ msgid "" "`63207`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1293 +#: ../../whatsnew/3.13.rst:1297 msgid "tkinter" msgstr "" -#: ../../whatsnew/3.13.rst:1295 +#: ../../whatsnew/3.13.rst:1299 msgid "" "Add :mod:`tkinter` widget methods: :meth:`!tk_busy_hold`, :meth:`!" "tk_busy_configure`, :meth:`!tk_busy_cget`, :meth:`!tk_busy_forget`, :meth:`!" @@ -1884,7 +1892,7 @@ msgid "" "klappnase and Serhiy Storchaka in :gh:`72684`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1301 +#: ../../whatsnew/3.13.rst:1305 msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " @@ -1893,14 +1901,14 @@ msgid "" "wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1308 +#: ../../whatsnew/3.13.rst:1312 msgid "" ":meth:`!wm_attributes` can now return attributes as a :class:`dict`, by " "using the new optional keyword-only parameter *return_python_dict*. " "(Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1312 +#: ../../whatsnew/3.13.rst:1316 msgid "" ":meth:`!Text.count` can now return a simple :class:`int` when the new " "optional keyword-only parameter *return_ints* is used. Otherwise, the single " @@ -1908,27 +1916,27 @@ msgid "" "in :gh:`97928`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1317 +#: ../../whatsnew/3.13.rst:1321 msgid "" "Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." "element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " "Storchaka in :gh:`68166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1322 +#: ../../whatsnew/3.13.rst:1326 msgid "" "Add the :meth:`!after_info` method for Tkinter widgets. (Contributed by " "Cheryl Sabella in :gh:`77020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1325 +#: ../../whatsnew/3.13.rst:1329 msgid "" "Add a new :meth:`!copy_replace` method to :class:`!PhotoImage` to copy a " "region from one image to another, possibly with pixel zooming, subsampling, " "or both. (Contributed by Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1330 +#: ../../whatsnew/3.13.rst:1334 msgid "" "Add *from_coords* parameter to the :class:`!PhotoImage` methods :meth:`!" "copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* " @@ -1936,7 +1944,7 @@ msgid "" "Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1336 +#: ../../whatsnew/3.13.rst:1340 msgid "" "Add the :class:`!PhotoImage` methods :meth:`!read` to read an image from a " "file and :meth:`!data` to get the image data. Add *background* and " @@ -1944,11 +1952,11 @@ msgid "" "Storchaka in :gh:`118271`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1344 +#: ../../whatsnew/3.13.rst:1348 msgid "traceback" msgstr "" -#: ../../whatsnew/3.13.rst:1346 +#: ../../whatsnew/3.13.rst:1350 msgid "" "Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" "class:`~traceback.TracebackException`, which holds a string display of the " @@ -1958,7 +1966,7 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1355 +#: ../../whatsnew/3.13.rst:1359 msgid "" "Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." "format_exception_only` to (recursively) format the nested exceptions of a :" @@ -1966,11 +1974,11 @@ msgid "" "`105292`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1362 +#: ../../whatsnew/3.13.rst:1366 msgid "types" msgstr "" -#: ../../whatsnew/3.13.rst:1364 +#: ../../whatsnew/3.13.rst:1368 msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " @@ -1978,63 +1986,63 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1371 ../../whatsnew/3.13.rst:1681 +#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1685 msgid "typing" msgstr "" -#: ../../whatsnew/3.13.rst:1373 +#: ../../whatsnew/3.13.rst:1377 msgid "" ":pep:`705`: Add :data:`~typing.ReadOnly`, a special typing construct to mark " "a :class:`~typing.TypedDict` item as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:1376 +#: ../../whatsnew/3.13.rst:1380 msgid "" ":pep:`742`: Add :data:`~typing.TypeIs`, a typing construct that can be used " "to instruct a type checker how to narrow a type." msgstr "" -#: ../../whatsnew/3.13.rst:1379 +#: ../../whatsnew/3.13.rst:1383 msgid "" "Add :data:`~typing.NoDefault`, a sentinel object used to represent the " "defaults of some parameters in the :mod:`typing` module. (Contributed by " "Jelle Zijlstra in :gh:`116126`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1383 +#: ../../whatsnew/3.13.rst:1387 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " "defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" "`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1387 +#: ../../whatsnew/3.13.rst:1391 msgid "" "Add :func:`~typing.is_protocol` to check whether a class is a :class:" "`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1391 +#: ../../whatsnew/3.13.rst:1395 msgid "" ":data:`~typing.ClassVar` can now be nested in :data:`~typing.Final`, and " "vice versa. (Contributed by Mehdi Drissi in :gh:`89547`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1397 +#: ../../whatsnew/3.13.rst:1401 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.13.rst:1399 +#: ../../whatsnew/3.13.rst:1403 msgid "" "Update the Unicode database to `version 15.1.0`__. (Contributed by James " "Gerity in :gh:`109559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1406 +#: ../../whatsnew/3.13.rst:1410 msgid "venv" msgstr "" -#: ../../whatsnew/3.13.rst:1408 +#: ../../whatsnew/3.13.rst:1412 msgid "" "Add support for creating source control management (SCM) ignore files in a " "virtual environment's directory. By default, Git is supported. This is " @@ -2044,11 +2052,11 @@ msgid "" "Cannon in :gh:`108125`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1419 +#: ../../whatsnew/3.13.rst:1423 msgid "warnings" msgstr "" -#: ../../whatsnew/3.13.rst:1421 +#: ../../whatsnew/3.13.rst:1425 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator provides a way to " "communicate deprecations to a :term:`static type checker` and to warn on " @@ -2057,62 +2065,62 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`104003`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1430 +#: ../../whatsnew/3.13.rst:1434 msgid "xml" msgstr "" -#: ../../whatsnew/3.13.rst:1432 +#: ../../whatsnew/3.13.rst:1436 msgid "" "Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by " "adding five new methods:" msgstr "" -#: ../../whatsnew/3.13.rst:1435 +#: ../../whatsnew/3.13.rst:1439 msgid ":meth:`xml.etree.ElementTree.XMLParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1436 +#: ../../whatsnew/3.13.rst:1440 msgid ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1437 +#: ../../whatsnew/3.13.rst:1441 msgid ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1438 +#: ../../whatsnew/3.13.rst:1442 msgid ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1439 +#: ../../whatsnew/3.13.rst:1443 msgid ":meth:`!xml.sax.expatreader.ExpatParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1441 +#: ../../whatsnew/3.13.rst:1445 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1443 +#: ../../whatsnew/3.13.rst:1447 msgid "" "Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." "ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " "Storchaka in :gh:`69893`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1449 +#: ../../whatsnew/3.13.rst:1453 msgid "zipimport" msgstr "" -#: ../../whatsnew/3.13.rst:1451 +#: ../../whatsnew/3.13.rst:1455 msgid "" "Add support for ZIP64_ format files. Everybody loves huge data, right? " "(Contributed by Tim Hatch in :gh:`94146`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1459 +#: ../../whatsnew/3.13.rst:1463 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.13.rst:1461 +#: ../../whatsnew/3.13.rst:1465 msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " @@ -2123,13 +2131,13 @@ msgid "" "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1472 +#: ../../whatsnew/3.13.rst:1476 msgid "" ":func:`textwrap.indent` is now around 30% faster than before for large " "input. (Contributed by Inada Naoki in :gh:`107369`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1475 +#: ../../whatsnew/3.13.rst:1479 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations, including when *close_fds* is ``True`` (the default) on " @@ -2139,15 +2147,15 @@ msgid "" "Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1485 +#: ../../whatsnew/3.13.rst:1489 msgid "Removed Modules And APIs" msgstr "" -#: ../../whatsnew/3.13.rst:1491 +#: ../../whatsnew/3.13.rst:1495 msgid "PEP 594: Remove \"dead batteries\" from the standard library" msgstr "" -#: ../../whatsnew/3.13.rst:1493 +#: ../../whatsnew/3.13.rst:1497 msgid "" ":pep:`594` proposed removing 19 modules from the standard library, " "colloquially referred to as 'dead batteries' due to their historic, " @@ -2155,23 +2163,23 @@ msgid "" "in Python 3.11, and are now removed:" msgstr "" -#: ../../whatsnew/3.13.rst:1499 +#: ../../whatsnew/3.13.rst:1503 msgid ":mod:`!aifc`" msgstr "" -#: ../../whatsnew/3.13.rst:1500 +#: ../../whatsnew/3.13.rst:1504 msgid ":mod:`!audioop`" msgstr "" -#: ../../whatsnew/3.13.rst:1501 +#: ../../whatsnew/3.13.rst:1505 msgid ":mod:`!chunk`" msgstr "" -#: ../../whatsnew/3.13.rst:1502 +#: ../../whatsnew/3.13.rst:1506 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr "" -#: ../../whatsnew/3.13.rst:1504 +#: ../../whatsnew/3.13.rst:1508 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2179,7 +2187,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1509 +#: ../../whatsnew/3.13.rst:1513 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2187,14 +2195,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1514 +#: ../../whatsnew/3.13.rst:1518 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1518 +#: ../../whatsnew/3.13.rst:1522 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2203,7 +2211,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1526 +#: ../../whatsnew/3.13.rst:1530 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2211,41 +2219,41 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1532 +#: ../../whatsnew/3.13.rst:1536 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1537 +#: ../../whatsnew/3.13.rst:1541 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1539 +#: ../../whatsnew/3.13.rst:1543 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1541 +#: ../../whatsnew/3.13.rst:1545 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1547 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1546 +#: ../../whatsnew/3.13.rst:1550 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1551 +#: ../../whatsnew/3.13.rst:1555 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2253,83 +2261,83 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1557 +#: ../../whatsnew/3.13.rst:1561 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1559 +#: ../../whatsnew/3.13.rst:1563 msgid ":mod:`!msilib`" msgstr "" -#: ../../whatsnew/3.13.rst:1560 +#: ../../whatsnew/3.13.rst:1564 msgid ":mod:`!nis`" msgstr "" -#: ../../whatsnew/3.13.rst:1561 +#: ../../whatsnew/3.13.rst:1565 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1563 +#: ../../whatsnew/3.13.rst:1567 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1565 +#: ../../whatsnew/3.13.rst:1569 msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1567 +#: ../../whatsnew/3.13.rst:1571 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1570 +#: ../../whatsnew/3.13.rst:1574 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1572 +#: ../../whatsnew/3.13.rst:1576 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1573 +#: ../../whatsnew/3.13.rst:1577 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1575 +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1577 +#: ../../whatsnew/3.13.rst:1581 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1583 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1587 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1589 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1591 +#: ../../whatsnew/3.13.rst:1595 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1593 +#: ../../whatsnew/3.13.rst:1597 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2339,47 +2347,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1602 +#: ../../whatsnew/3.13.rst:1606 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1610 +#: ../../whatsnew/3.13.rst:1614 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1617 +#: ../../whatsnew/3.13.rst:1621 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1619 +#: ../../whatsnew/3.13.rst:1623 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1625 +#: ../../whatsnew/3.13.rst:1629 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1627 +#: ../../whatsnew/3.13.rst:1631 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1633 +#: ../../whatsnew/3.13.rst:1637 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1635 +#: ../../whatsnew/3.13.rst:1639 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2387,7 +2395,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1640 +#: ../../whatsnew/3.13.rst:1644 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2395,43 +2403,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1650 +#: ../../whatsnew/3.13.rst:1654 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1658 +#: ../../whatsnew/3.13.rst:1662 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1664 +#: ../../whatsnew/3.13.rst:1668 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1666 +#: ../../whatsnew/3.13.rst:1670 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1672 +#: ../../whatsnew/3.13.rst:1676 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1674 +#: ../../whatsnew/3.13.rst:1678 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1683 +#: ../../whatsnew/3.13.rst:1687 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2439,66 +2447,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1689 +#: ../../whatsnew/3.13.rst:1693 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1695 +#: ../../whatsnew/3.13.rst:1699 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1697 +#: ../../whatsnew/3.13.rst:1701 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1699 +#: ../../whatsnew/3.13.rst:1703 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1700 +#: ../../whatsnew/3.13.rst:1704 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1705 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1707 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1709 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1706 +#: ../../whatsnew/3.13.rst:1710 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1711 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1709 +#: ../../whatsnew/3.13.rst:1713 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1711 +#: ../../whatsnew/3.13.rst:1715 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1717 +#: ../../whatsnew/3.13.rst:1721 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1719 +#: ../../whatsnew/3.13.rst:1723 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2509,33 +2517,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1730 +#: ../../whatsnew/3.13.rst:1734 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1732 +#: ../../whatsnew/3.13.rst:1736 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1737 +#: ../../whatsnew/3.13.rst:1741 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1744 +#: ../../whatsnew/3.13.rst:1748 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1750 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1752 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2543,12 +2551,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1754 +#: ../../whatsnew/3.13.rst:1758 #: ../../deprecations/pending-removal-in-3.16.rst:13 msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1756 +#: ../../whatsnew/3.13.rst:1760 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2557,50 +2565,50 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1763 -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../whatsnew/3.13.rst:1767 +#: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1765 +#: ../../whatsnew/3.13.rst:1769 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1773 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1777 msgid ":mod:`decimal`:" msgstr "" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1779 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1780 +#: ../../whatsnew/3.13.rst:1784 msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1782 +#: ../../whatsnew/3.13.rst:1786 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1786 +#: ../../whatsnew/3.13.rst:1790 msgid ":mod:`getopt` and :mod:`optparse`:" msgstr "" -#: ../../whatsnew/3.13.rst:1788 +#: ../../whatsnew/3.13.rst:1792 msgid "" "Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " "for new projects. This is a new soft-deprecation for the :mod:`!getopt` " @@ -2608,22 +2616,22 @@ msgid "" "deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1794 +#: ../../whatsnew/3.13.rst:1798 msgid ":mod:`gettext`:" msgstr "" -#: ../../whatsnew/3.13.rst:1796 +#: ../../whatsnew/3.13.rst:1800 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1801 +#: ../../whatsnew/3.13.rst:1805 msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1803 +#: ../../whatsnew/3.13.rst:1807 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2631,12 +2639,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1808 -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../whatsnew/3.13.rst:1812 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1810 +#: ../../whatsnew/3.13.rst:1814 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2645,29 +2653,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1817 +#: ../../whatsnew/3.13.rst:1821 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1822 +#: ../../whatsnew/3.13.rst:1826 msgid ":mod:`mimetypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1824 +#: ../../whatsnew/3.13.rst:1828 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1829 +#: ../../whatsnew/3.13.rst:1833 msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1831 +#: ../../whatsnew/3.13.rst:1835 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2676,46 +2684,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1838 -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../whatsnew/3.13.rst:1842 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1840 +#: ../../whatsnew/3.13.rst:1844 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1845 -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../whatsnew/3.13.rst:1849 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1847 +#: ../../whatsnew/3.13.rst:1851 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1853 +#: ../../whatsnew/3.13.rst:1857 msgid ":mod:`pydoc`:" msgstr "" -#: ../../whatsnew/3.13.rst:1855 +#: ../../whatsnew/3.13.rst:1859 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1858 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../whatsnew/3.13.rst:1862 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1860 +#: ../../whatsnew/3.13.rst:1864 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2723,7 +2731,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1870 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2731,7 +2739,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1872 +#: ../../whatsnew/3.13.rst:1876 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2741,46 +2749,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1880 +#: ../../whatsnew/3.13.rst:1884 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1882 +#: ../../whatsnew/3.13.rst:1886 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1887 +#: ../../whatsnew/3.13.rst:1891 #: ../../deprecations/pending-removal-in-3.16.rst:39 msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1889 +#: ../../whatsnew/3.13.rst:1893 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1897 msgid ":mod:`traceback`:" msgstr "" -#: ../../whatsnew/3.13.rst:1895 +#: ../../whatsnew/3.13.rst:1899 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1899 -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../whatsnew/3.13.rst:1903 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1905 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2788,7 +2796,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1908 +#: ../../whatsnew/3.13.rst:1912 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2800,7 +2808,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1918 +#: ../../whatsnew/3.13.rst:1922 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2808,7 +2816,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1924 +#: ../../whatsnew/3.13.rst:1928 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2817,12 +2825,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1932 -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../whatsnew/3.13.rst:1936 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1934 +#: ../../whatsnew/3.13.rst:1938 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -2836,50 +2844,63 @@ msgid "Pending Removal in Python 3.14" msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " "runtime when they are accessed or used, and will be removed in Python 3.14:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2887,7 +2908,7 @@ msgid "" "Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -2895,7 +2916,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -2903,7 +2924,7 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2911,45 +2932,45 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2957,7 +2978,7 @@ msgid "" "burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2968,49 +2989,49 @@ msgid "" "``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " "a sequence instead of a :class:`dict`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -3018,13 +3039,13 @@ msgid "" "in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -3038,34 +3059,44 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:18 +msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " "been deprecated since Python 3.13. No direct replacement exists. *Anything* " "is better than CGI to interface a web server with a request handler." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 msgid ":class:`locale`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -3074,24 +3105,24 @@ msgid "" "instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -3099,7 +3130,7 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -3107,14 +3138,14 @@ msgid "" "functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3540,11 +3571,11 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1951 +#: ../../whatsnew/3.13.rst:1955 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1953 +#: ../../whatsnew/3.13.rst:1957 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3553,97 +3584,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1961 +#: ../../whatsnew/3.13.rst:1965 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1966 +#: ../../whatsnew/3.13.rst:1970 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1969 +#: ../../whatsnew/3.13.rst:1973 msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:1970 +#: ../../whatsnew/3.13.rst:1974 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1971 +#: ../../whatsnew/3.13.rst:1975 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1972 +#: ../../whatsnew/3.13.rst:1976 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1977 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:1978 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1979 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1976 +#: ../../whatsnew/3.13.rst:1980 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1981 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1978 +#: ../../whatsnew/3.13.rst:1982 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1983 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1980 +#: ../../whatsnew/3.13.rst:1984 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1985 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:1986 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1983 +#: ../../whatsnew/3.13.rst:1987 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1984 +#: ../../whatsnew/3.13.rst:1988 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:1989 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:1990 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:1991 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1989 +#: ../../whatsnew/3.13.rst:1993 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:1995 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3651,52 +3682,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1997 +#: ../../whatsnew/3.13.rst:2001 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:1999 +#: ../../whatsnew/3.13.rst:2003 msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2000 +#: ../../whatsnew/3.13.rst:2004 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2008 msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2009 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2010 msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2011 msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2009 +#: ../../whatsnew/3.13.rst:2013 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:2015 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3704,7 +3735,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2017 +#: ../../whatsnew/3.13.rst:2021 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3714,7 +3745,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2025 +#: ../../whatsnew/3.13.rst:2029 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3723,7 +3754,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2033 +#: ../../whatsnew/3.13.rst:2037 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3732,7 +3763,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2040 +#: ../../whatsnew/3.13.rst:2044 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3743,7 +3774,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2050 +#: ../../whatsnew/3.13.rst:2054 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3754,37 +3785,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2060 +#: ../../whatsnew/3.13.rst:2064 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2065 +#: ../../whatsnew/3.13.rst:2069 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2069 +#: ../../whatsnew/3.13.rst:2073 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2070 +#: ../../whatsnew/3.13.rst:2074 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2073 +#: ../../whatsnew/3.13.rst:2077 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2075 +#: ../../whatsnew/3.13.rst:2079 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -3793,7 +3824,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2082 +#: ../../whatsnew/3.13.rst:2086 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3801,35 +3832,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2087 +#: ../../whatsnew/3.13.rst:2091 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2092 +#: ../../whatsnew/3.13.rst:2096 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2097 +#: ../../whatsnew/3.13.rst:2101 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2101 +#: ../../whatsnew/3.13.rst:2105 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2106 +#: ../../whatsnew/3.13.rst:2110 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -3837,27 +3868,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2112 +#: ../../whatsnew/3.13.rst:2116 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2117 +#: ../../whatsnew/3.13.rst:2121 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2121 +#: ../../whatsnew/3.13.rst:2125 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2124 +#: ../../whatsnew/3.13.rst:2128 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -3866,7 +3897,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2132 +#: ../../whatsnew/3.13.rst:2136 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -3874,14 +3905,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2142 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2143 +#: ../../whatsnew/3.13.rst:2147 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -3889,7 +3920,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2149 +#: ../../whatsnew/3.13.rst:2153 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -3897,14 +3928,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2155 +#: ../../whatsnew/3.13.rst:2159 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2160 +#: ../../whatsnew/3.13.rst:2164 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -3913,7 +3944,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2167 +#: ../../whatsnew/3.13.rst:2171 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -3921,47 +3952,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2173 +#: ../../whatsnew/3.13.rst:2177 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2175 +#: ../../whatsnew/3.13.rst:2179 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2176 +#: ../../whatsnew/3.13.rst:2180 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2178 +#: ../../whatsnew/3.13.rst:2182 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2183 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2182 +#: ../../whatsnew/3.13.rst:2186 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2185 +#: ../../whatsnew/3.13.rst:2189 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2189 +#: ../../whatsnew/3.13.rst:2193 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2191 +#: ../../whatsnew/3.13.rst:2195 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -3974,20 +4005,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2203 +#: ../../whatsnew/3.13.rst:2207 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2207 +#: ../../whatsnew/3.13.rst:2211 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2211 +#: ../../whatsnew/3.13.rst:2215 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -3998,35 +4029,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2220 +#: ../../whatsnew/3.13.rst:2224 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2223 +#: ../../whatsnew/3.13.rst:2227 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2228 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2225 +#: ../../whatsnew/3.13.rst:2229 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2226 +#: ../../whatsnew/3.13.rst:2230 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2232 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2231 +#: ../../whatsnew/3.13.rst:2235 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4035,7 +4066,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2237 +#: ../../whatsnew/3.13.rst:2241 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4043,60 +4074,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2245 +#: ../../whatsnew/3.13.rst:2249 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2251 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2253 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2250 +#: ../../whatsnew/3.13.rst:2254 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2251 +#: ../../whatsnew/3.13.rst:2255 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2252 +#: ../../whatsnew/3.13.rst:2256 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2257 msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2254 +#: ../../whatsnew/3.13.rst:2258 msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2259 msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2261 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2263 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2265 +#: ../../whatsnew/3.13.rst:2269 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2267 +#: ../../whatsnew/3.13.rst:2271 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4106,13 +4137,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2275 +#: ../../whatsnew/3.13.rst:2279 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2278 +#: ../../whatsnew/3.13.rst:2282 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4121,13 +4152,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2286 +#: ../../whatsnew/3.13.rst:2290 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2289 +#: ../../whatsnew/3.13.rst:2293 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4138,13 +4169,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2299 +#: ../../whatsnew/3.13.rst:2303 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2302 +#: ../../whatsnew/3.13.rst:2306 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4154,21 +4185,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2311 +#: ../../whatsnew/3.13.rst:2315 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2313 +#: ../../whatsnew/3.13.rst:2317 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2315 +#: ../../whatsnew/3.13.rst:2319 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2320 +#: ../../whatsnew/3.13.rst:2324 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4179,106 +4210,106 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2330 +#: ../../whatsnew/3.13.rst:2334 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2336 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2338 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2337 +#: ../../whatsnew/3.13.rst:2341 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2339 +#: ../../whatsnew/3.13.rst:2343 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2342 +#: ../../whatsnew/3.13.rst:2346 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2344 +#: ../../whatsnew/3.13.rst:2348 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2346 +#: ../../whatsnew/3.13.rst:2350 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2348 +#: ../../whatsnew/3.13.rst:2352 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2350 +#: ../../whatsnew/3.13.rst:2354 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2356 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2358 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2357 +#: ../../whatsnew/3.13.rst:2361 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2364 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2364 +#: ../../whatsnew/3.13.rst:2368 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2369 +#: ../../whatsnew/3.13.rst:2373 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2370 +#: ../../whatsnew/3.13.rst:2374 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2375 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2377 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2379 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4287,7 +4318,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2382 +#: ../../whatsnew/3.13.rst:2386 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4296,26 +4327,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2389 +#: ../../whatsnew/3.13.rst:2393 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2394 +#: ../../whatsnew/3.13.rst:2398 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2398 +#: ../../whatsnew/3.13.rst:2402 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2401 +#: ../../whatsnew/3.13.rst:2405 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4323,79 +4354,79 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2408 +#: ../../whatsnew/3.13.rst:2412 msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2414 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2416 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2418 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2420 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2418 +#: ../../whatsnew/3.13.rst:2422 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2420 +#: ../../whatsnew/3.13.rst:2424 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2426 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2428 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2432 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2434 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2436 +#: ../../whatsnew/3.13.rst:2440 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2444 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2446 +#: ../../whatsnew/3.13.rst:2450 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4404,7 +4435,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2453 +#: ../../whatsnew/3.13.rst:2457 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4715,55 +4746,55 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2473 +#: ../../whatsnew/3.13.rst:2477 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2475 +#: ../../whatsnew/3.13.rst:2479 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2480 +#: ../../whatsnew/3.13.rst:2484 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2485 +#: ../../whatsnew/3.13.rst:2489 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2488 +#: ../../whatsnew/3.13.rst:2492 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2491 +#: ../../whatsnew/3.13.rst:2495 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2498 msgid "" "Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2498 +#: ../../whatsnew/3.13.rst:2502 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2502 +#: ../../whatsnew/3.13.rst:2506 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -4771,28 +4802,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2510 +#: ../../whatsnew/3.13.rst:2514 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2514 +#: ../../whatsnew/3.13.rst:2518 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2519 +#: ../../whatsnew/3.13.rst:2523 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2527 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -4802,27 +4833,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2532 +#: ../../whatsnew/3.13.rst:2536 msgid "Porting to Python 3.13" msgstr "" -#: ../../whatsnew/3.13.rst:2534 +#: ../../whatsnew/3.13.rst:2538 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2538 +#: ../../whatsnew/3.13.rst:2542 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.13.rst:2542 +#: ../../whatsnew/3.13.rst:2546 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2545 +#: ../../whatsnew/3.13.rst:2549 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -4834,7 +4865,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2554 +#: ../../whatsnew/3.13.rst:2558 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -4844,7 +4875,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2561 +#: ../../whatsnew/3.13.rst:2565 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -4853,7 +4884,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2567 +#: ../../whatsnew/3.13.rst:2571 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -4861,14 +4892,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2573 +#: ../../whatsnew/3.13.rst:2577 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2578 +#: ../../whatsnew/3.13.rst:2582 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -4877,13 +4908,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2584 +#: ../../whatsnew/3.13.rst:2588 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2587 +#: ../../whatsnew/3.13.rst:2591 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -4891,25 +4922,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2592 +#: ../../whatsnew/3.13.rst:2596 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2597 +#: ../../whatsnew/3.13.rst:2601 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2604 +#: ../../whatsnew/3.13.rst:2608 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.13.rst:2606 +#: ../../whatsnew/3.13.rst:2610 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -4918,7 +4949,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2612 +#: ../../whatsnew/3.13.rst:2616 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -4929,7 +4960,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2620 +#: ../../whatsnew/3.13.rst:2624 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -4939,7 +4970,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2627 +#: ../../whatsnew/3.13.rst:2631 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -4947,18 +4978,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2632 +#: ../../whatsnew/3.13.rst:2636 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2636 +#: ../../whatsnew/3.13.rst:2640 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2638 +#: ../../whatsnew/3.13.rst:2642 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -4970,11 +5001,11 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2647 +#: ../../whatsnew/3.13.rst:2651 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2649 +#: ../../whatsnew/3.13.rst:2653 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -4986,7 +5017,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2658 +#: ../../whatsnew/3.13.rst:2662 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -4994,13 +5025,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2665 +#: ../../whatsnew/3.13.rst:2669 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2672 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5014,7 +5045,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2681 +#: ../../whatsnew/3.13.rst:2685 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5023,25 +5054,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2688 +#: ../../whatsnew/3.13.rst:2692 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2693 +#: ../../whatsnew/3.13.rst:2697 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2698 +#: ../../whatsnew/3.13.rst:2702 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2700 +#: ../../whatsnew/3.13.rst:2704 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 5f49805ffb..3a0d3aae0a 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -465,8 +465,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:315 msgid "" -"Imported modules now have a :attr:`__cached__` attribute which stores the " -"name of the actual file that was imported:" +"Imported modules now have a :attr:`~module.__cached__` attribute which " +"stores the name of the actual file that was imported:" msgstr "" #: ../../whatsnew/3.2.rst:322 diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 49ff4555d8..8073aa078d 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -3268,13 +3268,13 @@ msgstr "" #: ../../whatsnew/3.4.rst:2274 msgid "" -"The module type now initializes the :attr:`__package__` and :attr:" -"`__loader__` attributes to ``None`` by default. To determine if these " -"attributes were set in a backwards-compatible fashion, use e.g. " +"The module type now initializes the :attr:`~module.__package__` and :attr:" +"`~module.__loader__` attributes to ``None`` by default. To determine if " +"these attributes were set in a backwards-compatible fashion, use e.g. " "``getattr(module, '__loader__', None) is not None``. (:issue:`17115`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2279 +#: ../../whatsnew/3.4.rst:2280 msgid "" ":meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and " "``__package__`` unconditionally to properly support reloading. If this is " @@ -3282,7 +3282,7 @@ msgid "" "use :func:`importlib.util.module_to_load` for module management." msgstr "" -#: ../../whatsnew/3.4.rst:2284 +#: ../../whatsnew/3.4.rst:2285 msgid "" "Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``, " "``__package__``, ``__file__``, ``__cached__``) unconditionally when " @@ -3290,7 +3290,7 @@ msgid "" "module is re-found when re-loaded (:issue:`19413`)." msgstr "" -#: ../../whatsnew/3.4.rst:2289 +#: ../../whatsnew/3.4.rst:2290 msgid "" "Frozen packages no longer set ``__path__`` to a list containing the package " "name, they now set it to an empty list. The previous behavior could cause " @@ -3300,7 +3300,7 @@ msgid "" "'__path__')`` (:issue:`18065`)." msgstr "" -#: ../../whatsnew/3.4.rst:2296 +#: ../../whatsnew/3.4.rst:2297 msgid "" "Frozen modules no longer define a ``__file__`` attribute. It's semantically " "incorrect for frozen modules to set the attribute as they are not loaded " @@ -3311,7 +3311,7 @@ msgid "" "use :func:`!imp.is_frozen`." msgstr "" -#: ../../whatsnew/3.4.rst:2304 +#: ../../whatsnew/3.4.rst:2305 msgid "" ":func:`py_compile.compile` now raises :exc:`FileExistsError` if the file " "path it would write to is a symlink or a non-regular file. This is to act as " @@ -3319,7 +3319,7 @@ msgid "" "regardless of what type of file path they were originally." msgstr "" -#: ../../whatsnew/3.4.rst:2309 +#: ../../whatsnew/3.4.rst:2310 msgid "" ":meth:`importlib.abc.SourceLoader.get_source` no longer raises :exc:" "`ImportError` when the source code being loaded triggers a :exc:" @@ -3331,7 +3331,7 @@ msgid "" "exceptions now." msgstr "" -#: ../../whatsnew/3.4.rst:2318 +#: ../../whatsnew/3.4.rst:2319 msgid "" ":func:`functools.update_wrapper` and :func:`functools.wraps` now correctly " "set the ``__wrapped__`` attribute to the function being wrapped, even if " @@ -3343,7 +3343,7 @@ msgid "" "function in the chain that has no ``__wrapped__`` attribute." msgstr "" -#: ../../whatsnew/3.4.rst:2328 +#: ../../whatsnew/3.4.rst:2329 msgid "" ":func:`inspect.getfullargspec` has been reimplemented on top of :func:" "`inspect.signature` and hence handles a much wider variety of callable " @@ -3353,7 +3353,7 @@ msgid "" "will fail on non-Python callables may need to be adjusted accordingly." msgstr "" -#: ../../whatsnew/3.4.rst:2336 +#: ../../whatsnew/3.4.rst:2337 msgid "" ":class:`importlib.machinery.PathFinder` now passes on the current working " "directory to objects in :data:`sys.path_hooks` for the empty string. This " @@ -3367,7 +3367,7 @@ msgid "" "`18416`)." msgstr "" -#: ../../whatsnew/3.4.rst:2347 +#: ../../whatsnew/3.4.rst:2348 msgid "" "The removal of the *strict* argument to :class:`~http.client.HTTPConnection` " "and :class:`~http.client.HTTPSConnection` changes the meaning of the " @@ -3376,7 +3376,7 @@ msgid "" "should already be specifying any additional arguments via keywords." msgstr "" -#: ../../whatsnew/3.4.rst:2353 +#: ../../whatsnew/3.4.rst:2354 msgid "" "Strings between ``from __future__ import ...`` statements now *always* raise " "a :exc:`SyntaxError`. Previously if there was no leading docstring, an " @@ -3385,7 +3385,7 @@ msgid "" "`17434`)." msgstr "" -#: ../../whatsnew/3.4.rst:2359 +#: ../../whatsnew/3.4.rst:2360 msgid "" ":meth:`ssl.SSLSocket.getpeercert` and :meth:`ssl.SSLSocket.do_handshake` now " "raise an :exc:`OSError` with ``ENOTCONN`` when the ``SSLSocket`` is not " @@ -3394,7 +3394,7 @@ msgid "" "raise a :exc:`ValueError` if the handshake has not yet been done." msgstr "" -#: ../../whatsnew/3.4.rst:2365 +#: ../../whatsnew/3.4.rst:2366 msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " @@ -3403,7 +3403,7 @@ msgid "" "`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" -#: ../../whatsnew/3.4.rst:2372 +#: ../../whatsnew/3.4.rst:2373 msgid "" "The :attr:`!file` attribute is now automatically closed when the creating :" "class:`!cgi.FieldStorage` instance is garbage collected. If you were pulling " @@ -3413,14 +3413,14 @@ msgid "" "the :class:`!cgi.FieldStorage` instance is garbage collected." msgstr "" -#: ../../whatsnew/3.4.rst:2379 +#: ../../whatsnew/3.4.rst:2380 msgid "" "Calling ``read`` or ``write`` on a closed SSL socket now raises an " "informative :exc:`ValueError` rather than the previous more mysterious :exc:" "`AttributeError` (:issue:`9177`)." msgstr "" -#: ../../whatsnew/3.4.rst:2383 +#: ../../whatsnew/3.4.rst:2384 msgid "" ":meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge " "values. As a consequence of this fix, :meth:`slice.indices` now raises a :" @@ -3428,7 +3428,7 @@ msgid "" "values (:issue:`14794`)." msgstr "" -#: ../../whatsnew/3.4.rst:2388 +#: ../../whatsnew/3.4.rst:2389 msgid "" "The :class:`complex` constructor, unlike the :mod:`cmath` functions, was " "incorrectly accepting :class:`float` values if an object's ``__complex__`` " @@ -3436,21 +3436,21 @@ msgid "" "`16290`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2393 +#: ../../whatsnew/3.4.rst:2394 msgid "" "The :class:`int` constructor in 3.2 and 3.3 erroneously accepts :class:" "`float` values for the *base* parameter. It is unlikely anyone was doing " "this, but if so, it will now raise a :exc:`TypeError` (:issue:`16772`)." msgstr "" -#: ../../whatsnew/3.4.rst:2397 +#: ../../whatsnew/3.4.rst:2398 msgid "" "Defaults for keyword-only arguments are now evaluated *after* defaults for " "regular keyword arguments, instead of before. Hopefully no one wrote any " "code that depends on the previous buggy behavior (:issue:`16967`)." msgstr "" -#: ../../whatsnew/3.4.rst:2401 +#: ../../whatsnew/3.4.rst:2402 msgid "" "Stale thread states are now cleared after :func:`~os.fork`. This may cause " "some system resources to be released that previously were incorrectly kept " @@ -3458,21 +3458,21 @@ msgid "" "storage). (:issue:`17094`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2406 +#: ../../whatsnew/3.4.rst:2407 msgid "" "Parameter names in ``__annotations__`` dicts are now mangled properly, " "similarly to :attr:`~function.__kwdefaults__`. (Contributed by Yury " "Selivanov in :issue:`20625`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2410 +#: ../../whatsnew/3.4.rst:2411 msgid "" ":attr:`hashlib.hash.name` now always returns the identifier in lower case. " "Previously some builtin hashes had uppercase names, but now that it is a " "formal public interface the naming has been made consistent (:issue:`18532`)." msgstr "" -#: ../../whatsnew/3.4.rst:2414 +#: ../../whatsnew/3.4.rst:2415 msgid "" "Because :mod:`unittest.TestSuite` now drops references to tests after they " "are run, test harnesses that reuse a :class:`~unittest.TestSuite` to re-run " @@ -3485,7 +3485,7 @@ msgid "" "__iter__`) (:issue:`11798`)." msgstr "" -#: ../../whatsnew/3.4.rst:2424 +#: ../../whatsnew/3.4.rst:2425 msgid "" ":mod:`unittest` now uses :mod:`argparse` for command line parsing. There " "are certain invalid command forms that used to work that are no longer " @@ -3494,7 +3494,7 @@ msgid "" "use." msgstr "" -#: ../../whatsnew/3.4.rst:2429 +#: ../../whatsnew/3.4.rst:2430 msgid "" "The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and " "the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of " @@ -3504,13 +3504,13 @@ msgid "" "say, a ``bytearray``, you will need to change your code." msgstr "" -#: ../../whatsnew/3.4.rst:2436 +#: ../../whatsnew/3.4.rst:2437 msgid "" ":mod:`!audioop` functions now raise an error immediately if passed string " "input, instead of failing randomly later on (:issue:`16685`)." msgstr "" -#: ../../whatsnew/3.4.rst:2439 +#: ../../whatsnew/3.4.rst:2440 msgid "" "The new *convert_charrefs* argument to :class:`~html.parser.HTMLParser` " "currently defaults to ``False`` for backward compatibility, but will " @@ -3519,14 +3519,14 @@ msgid "" "HTMLParser` calls in your code (:issue:`13633`)." msgstr "" -#: ../../whatsnew/3.4.rst:2445 +#: ../../whatsnew/3.4.rst:2446 msgid "" "Since the *digestmod* argument to the :func:`hmac.new` function will in the " "future have no default, all calls to :func:`hmac.new` should be changed to " "explicitly specify a *digestmod* (:issue:`17276`)." msgstr "" -#: ../../whatsnew/3.4.rst:2449 +#: ../../whatsnew/3.4.rst:2450 msgid "" "Calling :func:`sysconfig.get_config_var` with the ``SO`` key, or looking " "``SO`` up in the results of a call to :func:`sysconfig.get_config_vars` is " @@ -3534,7 +3534,7 @@ msgid "" "``SHLIB_SUFFIX``, depending on the context (:issue:`19555`)." msgstr "" -#: ../../whatsnew/3.4.rst:2454 +#: ../../whatsnew/3.4.rst:2455 msgid "" "Any calls to ``open`` functions that specify ``U`` should be modified. ``U`` " "is ineffective in Python3 and will eventually raise an error if used. " @@ -3544,13 +3544,13 @@ msgid "" "`15204`)." msgstr "" -#: ../../whatsnew/3.4.rst:2461 +#: ../../whatsnew/3.4.rst:2462 msgid "" "If you use ``pyvenv`` in a script and desire that pip *not* be installed, " "you must add ``--without-pip`` to your command invocation." msgstr "" -#: ../../whatsnew/3.4.rst:2465 +#: ../../whatsnew/3.4.rst:2466 msgid "" "The default behavior of :func:`json.dump` and :func:`json.dumps` when an " "indent is specified has changed: it no longer produces trailing spaces after " @@ -3559,7 +3559,7 @@ msgid "" "output (:issue:`16333`)." msgstr "" -#: ../../whatsnew/3.4.rst:2471 +#: ../../whatsnew/3.4.rst:2472 msgid "" ":mod:`doctest` now looks for doctests in extension module ``__doc__`` " "strings, so if your doctest test discovery includes extension modules that " @@ -3567,7 +3567,7 @@ msgid "" "never seen before when running your tests (:issue:`3158`)." msgstr "" -#: ../../whatsnew/3.4.rst:2476 +#: ../../whatsnew/3.4.rst:2477 msgid "" "The :mod:`collections.abc` module has been slightly refactored as part of " "the Python startup improvements. As a consequence of this, it is no longer " @@ -3577,11 +3577,11 @@ msgid "" "`20784`)." msgstr "" -#: ../../whatsnew/3.4.rst:2485 +#: ../../whatsnew/3.4.rst:2486 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.4.rst:2487 +#: ../../whatsnew/3.4.rst:2488 msgid "" ":c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, and :c:func:" "`PyObject_Str`, along with some other internal C APIs, now include a " @@ -3595,14 +3595,14 @@ msgid "" "version of Python that is compiled with assertions enabled." msgstr "" -#: ../../whatsnew/3.4.rst:2499 +#: ../../whatsnew/3.4.rst:2500 msgid "" ":c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** " "argument is not set. Previously only ``NULL`` was returned with no exception " "set." msgstr "" -#: ../../whatsnew/3.4.rst:2503 +#: ../../whatsnew/3.4.rst:2504 msgid "" "The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must now " "be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:" @@ -3611,30 +3611,30 @@ msgid "" "`16742`)" msgstr "" -#: ../../whatsnew/3.4.rst:2509 +#: ../../whatsnew/3.4.rst:2510 msgid "" ":c:func:`PyThread_set_key_value` now always set the value. In Python 3.3, " "the function did nothing if the key already exists (if the current value is " "a non-``NULL`` pointer)." msgstr "" -#: ../../whatsnew/3.4.rst:2513 +#: ../../whatsnew/3.4.rst:2514 msgid "" "The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject` " "structure has been removed to fix a bug: see :issue:`14432` for the " "rationale." msgstr "" -#: ../../whatsnew/3.4.rst:2518 +#: ../../whatsnew/3.4.rst:2519 msgid "Changed in 3.4.3" msgstr "3.4.3 中的變更" -#: ../../whatsnew/3.4.rst:2523 +#: ../../whatsnew/3.4.rst:2524 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/3.4.rst:2525 +#: ../../whatsnew/3.4.rst:2526 msgid "" ":mod:`http.client` and modules which use it, such as :mod:`urllib.request` " "and :mod:`xmlrpc.client`, will now verify that the server presents a " @@ -3643,13 +3643,13 @@ msgid "" "improving security for many applications." msgstr "" -#: ../../whatsnew/3.4.rst:2531 +#: ../../whatsnew/3.4.rst:2532 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/3.4.rst:2534 +#: ../../whatsnew/3.4.rst:2535 msgid "" "import urllib.request\n" "import ssl\n" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 8a11889a89..0cb76440d5 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-13 17:13+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-" @@ -666,7 +666,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:425 msgid "" "While these annotations are available at runtime through the usual :attr:" -"`__annotations__` attribute, *no automatic type checking happens at " +"`~object.__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 " "analysis." From 6839f7fb87292d6ae830e239a6db4058fc96f6be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 19 Oct 2024 10:41:56 +0000 Subject: [PATCH 06/14] sync with cpython fbbc79ea --- c-api/long.po | 6 +- howto/argparse.po | 86 +++++- library/argparse.po | 117 ++++---- library/datetime.po | 43 +-- library/string.po | 179 ++++++----- reference/lexical_analysis.po | 539 +++++++++++++++++----------------- tutorial/appendix.po | 6 +- using/configure.po | 6 +- whatsnew/3.13.po | 7 +- 9 files changed, 539 insertions(+), 450 deletions(-) diff --git a/c-api/long.po b/c-api/long.po index b09383a50c..8dc694f9af 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+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-" @@ -624,13 +624,13 @@ msgid "" "is subject to change." msgstr "" -#: ../../c-api/long.rst:543 +#: ../../c-api/long.rst:546 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:546 +#: ../../c-api/long.rst:549 msgid "Otherwise, the return value is undefined." msgstr "" diff --git a/howto/argparse.po b/howto/argparse.po index 7e6cfdf95d..1c399843a2 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+0000\n" "PO-Revision-Date: 2023-12-11 17:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1223,6 +1223,7 @@ msgstr "" " print(answer)" #: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 +#: ../../howto/argparse.rst:872 msgid "Output:" msgstr "結果:" @@ -1634,10 +1635,91 @@ msgid "" msgstr "若要在 :mod:`argparse` 輸出中翻譯你自己的字串,請使用 :mod:`gettext`。" #: ../../howto/argparse.rst:845 +msgid "Custom type converters" +msgstr "" + +#: ../../howto/argparse.rst:847 +msgid "" +"The :mod:`argparse` module allows you to specify custom type converters for " +"your command-line arguments. This allows you to modify user input before " +"it's stored in the :class:`argparse.Namespace`. This can be useful when you " +"need to pre-process the input before it is used in your program." +msgstr "" + +#: ../../howto/argparse.rst:852 +msgid "" +"When using a custom type converter, you can use any callable that takes a " +"single string argument (the argument value) and returns the converted value. " +"However, if you need to handle more complex scenarios, you can use a custom " +"action class with the **action** parameter instead." +msgstr "" + +#: ../../howto/argparse.rst:857 +msgid "" +"For example, let's say you want to handle arguments with different prefixes " +"and process them accordingly::" +msgstr "" + +#: ../../howto/argparse.rst:860 +#, fuzzy +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" +msgstr "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\",\n" +" type=int)\n" +"args = parser.parse_args()\n" +"print(args.square**2)" + +#: ../../howto/argparse.rst:874 +msgid "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" +msgstr "" + +#: ../../howto/argparse.rst:879 +#, fuzzy +msgid "In this example, we:" +msgstr "例如: ::" + +#: ../../howto/argparse.rst:881 +msgid "" +"Created a parser with custom prefix characters using the ``prefix_chars`` " +"parameter." +msgstr "" + +#: ../../howto/argparse.rst:884 +msgid "" +"Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " +"to create custom type converters to store the value in a tuple with the " +"prefix." +msgstr "" + +#: ../../howto/argparse.rst:887 +msgid "" +"Without the custom type converters, the arguments would have treated the ``-" +"a`` and ``+a`` as the same argument, which would have been undesirable. By " +"using custom type converters, we were able to differentiate between the two " +"arguments." +msgstr "" + +#: ../../howto/argparse.rst:892 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:847 +#: ../../howto/argparse.rst:894 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/library/argparse.po b/library/argparse.po index de332ce032..d125e78f04 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+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-" @@ -2995,7 +2995,7 @@ msgstr "" msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1790 +#: ../../library/argparse.rst:1791 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3004,7 +3004,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1796 +#: ../../library/argparse.rst:1797 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3028,7 +3028,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1807 +#: ../../library/argparse.rst:1808 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3039,7 +3039,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1815 +#: ../../library/argparse.rst:1816 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3077,13 +3077,22 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1833 +#: ../../library/argparse.rst:1834 +msgid "" +"The optional, keyword-only parameters argument_default_ and " +"conflict_handler_ allow for finer-grained control of the behavior of the " +"argument group. These parameters have the same meaning as in the :class:" +"`ArgumentParser` constructor, but apply specifically to the argument group " +"rather than the entire parser." +msgstr "" + +#: ../../library/argparse.rst:1839 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1836 +#: ../../library/argparse.rst:1842 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3091,18 +3100,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1844 +#: ../../library/argparse.rst:1850 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1848 +#: ../../library/argparse.rst:1854 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1852 +#: ../../library/argparse.rst:1858 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3128,14 +3137,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1864 +#: ../../library/argparse.rst:1870 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1868 +#: ../../library/argparse.rst:1874 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3153,7 +3162,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1876 +#: ../../library/argparse.rst:1882 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3161,7 +3170,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1882 +#: ../../library/argparse.rst:1888 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3197,7 +3206,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1905 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3205,11 +3214,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1907 +#: ../../library/argparse.rst:1913 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1911 +#: ../../library/argparse.rst:1917 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3218,7 +3227,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1917 +#: ../../library/argparse.rst:1923 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3232,12 +3241,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1923 +#: ../../library/argparse.rst:1929 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1925 +#: ../../library/argparse.rst:1931 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3251,20 +3260,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1931 +#: ../../library/argparse.rst:1937 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1937 +#: ../../library/argparse.rst:1943 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1941 +#: ../../library/argparse.rst:1947 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3276,54 +3285,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1954 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1950 +#: ../../library/argparse.rst:1956 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1956 +#: ../../library/argparse.rst:1962 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1962 +#: ../../library/argparse.rst:1968 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1966 +#: ../../library/argparse.rst:1972 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1971 +#: ../../library/argparse.rst:1977 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1976 +#: ../../library/argparse.rst:1982 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1987 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:1985 +#: ../../library/argparse.rst:1991 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3334,7 +3343,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:1994 +#: ../../library/argparse.rst:2000 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3348,7 +3357,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2001 +#: ../../library/argparse.rst:2007 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3356,11 +3365,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2008 +#: ../../library/argparse.rst:2014 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2012 +#: ../../library/argparse.rst:2018 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3368,20 +3377,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2017 +#: ../../library/argparse.rst:2023 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2021 +#: ../../library/argparse.rst:2027 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2024 +#: ../../library/argparse.rst:2030 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3391,18 +3400,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2030 +#: ../../library/argparse.rst:2036 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2034 +#: ../../library/argparse.rst:2040 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2038 +#: ../../library/argparse.rst:2044 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3416,17 +3425,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2046 +#: ../../library/argparse.rst:2052 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2057 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2056 +#: ../../library/argparse.rst:2062 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3434,7 +3443,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2061 +#: ../../library/argparse.rst:2067 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -3442,7 +3451,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2066 +#: ../../library/argparse.rst:2072 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3450,7 +3459,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2072 +#: ../../library/argparse.rst:2078 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3470,7 +3479,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2081 +#: ../../library/argparse.rst:2087 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3478,26 +3487,26 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2090 +#: ../../library/argparse.rst:2096 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2094 +#: ../../library/argparse.rst:2100 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2096 +#: ../../library/argparse.rst:2102 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2101 +#: ../../library/argparse.rst:2107 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2105 +#: ../../library/argparse.rst:2111 msgid "Guides and Tutorials" msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 9de36afc55..91307be588 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -270,7 +270,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:183 -msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" +msgid "" +"A :class:`.datetime` object ``d`` is aware if both of the following hold:" msgstr "" #: ../../library/datetime.rst:185 @@ -282,11 +283,12 @@ msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" #: ../../library/datetime.rst:188 -msgid "Otherwise, *d* is naive." +#, fuzzy +msgid "Otherwise, ``d`` is naive." msgstr "否則 *d* 會是 naive 的。" #: ../../library/datetime.rst:190 -msgid "A :class:`.time` object *t* is aware if both of the following hold:" +msgid "A :class:`.time` object ``t`` is aware if both of the following hold:" msgstr "" #: ../../library/datetime.rst:192 @@ -298,8 +300,9 @@ msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``。" #: ../../library/datetime.rst:195 -msgid "Otherwise, *t* is naive." -msgstr "" +#, fuzzy +msgid "Otherwise, ``t`` is naive." +msgstr "否則 *d* 會是 naive 的。" #: ../../library/datetime.rst:197 msgid "" @@ -594,7 +597,7 @@ msgstr "``q, r = divmod(t1, t2)``" #: ../../library/datetime.rst:359 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " -"t2``. q is an integer and r is a :class:`timedelta` object." +"t2``. ``q`` is an integer and ``r`` is a :class:`timedelta` object." msgstr "" #: ../../library/datetime.rst:364 @@ -875,7 +878,7 @@ msgstr "" #: ../../library/datetime.rst:528 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " -"For any date *d*, ``date.fromordinal(d.toordinal()) == d``." +"For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." msgstr "" #: ../../library/datetime.rst:535 @@ -1130,7 +1133,7 @@ msgstr "" #: ../../library/datetime.rst:699 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " -"1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." +"1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" @@ -1210,7 +1213,7 @@ msgstr "" "'2002-12-04'" #: ../../library/datetime.rst:752 -msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." +msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" #: ../../library/datetime.rst:757 @@ -1614,7 +1617,7 @@ msgstr "" #: ../../library/datetime.rst:1033 msgid "" -"For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." +"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" @@ -1869,15 +1872,15 @@ msgstr "" msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " -"the result is a :class:`timedelta` object *t* such that ``datetime2 + t == " +"the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " "datetime1``. No time zone adjustments are done in this case." msgstr "" #: ../../library/datetime.rst:1243 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " -"``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes. " -"The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." +"``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " +"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." "replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " "overflows." msgstr "" @@ -2088,7 +2091,7 @@ msgstr "" #: ../../library/datetime.rst:1424 msgid "" -"If :class:`.datetime` instance *d* is naive, this is the same as ``d." +"If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " "regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " "time." @@ -2096,7 +2099,7 @@ msgstr "" #: ../../library/datetime.rst:1428 msgid "" -"If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." +"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " "returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:" "`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " @@ -2325,7 +2328,7 @@ msgstr "新增 *timespec* 參數。" #: ../../library/datetime.rst:1576 msgid "" -"For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." +"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" @@ -2561,8 +2564,8 @@ msgstr "" #: ../../library/datetime.rst:1822 msgid "" -":class:`.time` objects support equality and order comparisons, where *a* is " -"considered less than *b* when *a* precedes *b* in time." +":class:`.time` objects support equality and order comparisons, where ``a`` " +"is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" #: ../../library/datetime.rst:1825 @@ -2736,7 +2739,7 @@ msgstr "" "'12:34:56'" #: ../../library/datetime.rst:1954 -msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." +msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" #: ../../library/datetime.rst:1959 diff --git a/library/string.po b/library/string.po index a51a99ac4d..284bbedd01 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -666,7 +666,7 @@ msgid "String format. This is the default type for strings and may be omitted." msgstr "" #: ../../library/string.rst:461 ../../library/string.rst:490 -#: ../../library/string.rst:577 +#: ../../library/string.rst:575 msgid "None" msgstr "None" @@ -735,7 +735,7 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:486 ../../library/string.rst:570 +#: ../../library/string.rst:486 ../../library/string.rst:568 msgid "``'n'``" msgstr "``'n'``" @@ -775,50 +775,49 @@ msgid "" "decimal point, for a total of ``p + 1`` significant digits. With no " "precision given, uses a precision of ``6`` digits after the decimal point " "for :class:`float`, and shows all coefficient digits for :class:`~decimal." -"Decimal`. If no digits follow the decimal point, the decimal point is also " -"removed unless the ``#`` option is used." +"Decimal`. If ``p=0``, the decimal point is omitted unless the ``#`` option " +"is used." msgstr "" -#: ../../library/string.rst:516 +#: ../../library/string.rst:515 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:516 +#: ../../library/string.rst:515 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:519 +#: ../../library/string.rst:518 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:519 +#: ../../library/string.rst:518 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 " "no precision given, uses a precision of ``6`` digits after the decimal point " "for :class:`float`, and uses a precision large enough to show all " -"coefficient digits for :class:`~decimal.Decimal`. If no digits follow the " -"decimal point, the decimal point is also removed unless the ``#`` option is " -"used." +"coefficient digits for :class:`~decimal.Decimal`. If ``p=0``, the decimal " +"point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:529 +#: ../../library/string.rst:527 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:529 +#: ../../library/string.rst:527 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:532 +#: ../../library/string.rst:530 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:532 +#: ../../library/string.rst:530 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 " @@ -826,7 +825,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:539 +#: ../../library/string.rst:537 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -839,7 +838,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:552 +#: ../../library/string.rst:550 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -849,40 +848,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:561 +#: ../../library/string.rst:559 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:566 +#: ../../library/string.rst:564 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:566 +#: ../../library/string.rst:564 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:570 +#: ../../library/string.rst:568 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:574 +#: ../../library/string.rst:572 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:574 +#: ../../library/string.rst:572 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:577 +#: ../../library/string.rst:575 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -891,30 +890,30 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:585 +#: ../../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:589 +#: ../../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:597 +#: ../../library/string.rst:595 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:599 +#: ../../library/string.rst:597 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:602 +#: ../../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 " @@ -923,17 +922,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:606 +#: ../../library/string.rst:604 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:609 +#: ../../library/string.rst:607 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:611 +#: ../../library/string.rst:609 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -948,11 +947,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:622 +#: ../../library/string.rst:620 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:624 +#: ../../library/string.rst:622 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -962,11 +961,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:630 +#: ../../library/string.rst:628 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:632 +#: ../../library/string.rst:630 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -983,22 +982,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:645 +#: ../../library/string.rst:643 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:647 +#: ../../library/string.rst:645 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:651 +#: ../../library/string.rst:649 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:653 +#: ../../library/string.rst:651 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1008,11 +1007,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:656 +#: ../../library/string.rst:654 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:658 +#: ../../library/string.rst:656 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1024,11 +1023,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:667 +#: ../../library/string.rst:665 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:669 +#: ../../library/string.rst:667 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1039,12 +1038,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:676 +#: ../../library/string.rst:674 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:678 +#: ../../library/string.rst:676 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1054,11 +1053,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:685 +#: ../../library/string.rst:683 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:687 +#: ../../library/string.rst:685 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1066,11 +1065,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:690 +#: ../../library/string.rst:688 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:692 +#: ../../library/string.rst:690 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1082,11 +1081,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:697 +#: ../../library/string.rst:695 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:699 +#: ../../library/string.rst:697 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1098,11 +1097,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:704 +#: ../../library/string.rst:702 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:706 +#: ../../library/string.rst:704 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1160,11 +1159,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:738 +#: ../../library/string.rst:736 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:740 +#: ../../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 " @@ -1178,17 +1177,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:750 +#: ../../library/string.rst:748 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:752 +#: ../../library/string.rst:750 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:754 +#: ../../library/string.rst:752 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1198,30 +1197,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:761 +#: ../../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:765 +#: ../../library/string.rst:763 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:768 +#: ../../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:774 +#: ../../library/string.rst:772 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:779 +#: ../../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 " @@ -1233,7 +1232,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:788 +#: ../../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 " @@ -1246,7 +1245,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:794 +#: ../../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 " @@ -1260,7 +1259,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:804 +#: ../../library/string.rst:802 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1268,18 +1267,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:812 +#: ../../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:817 +#: ../../library/string.rst:815 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:821 +#: ../../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." @@ -1287,11 +1286,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:824 +#: ../../library/string.rst:822 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:826 +#: ../../library/string.rst:824 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1325,7 +1324,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:842 +#: ../../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 " @@ -1335,7 +1334,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:847 +#: ../../library/string.rst:845 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1349,7 +1348,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:854 +#: ../../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-" @@ -1357,19 +1356,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:861 +#: ../../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:865 +#: ../../library/string.rst:863 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:869 +#: ../../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 " @@ -1378,7 +1377,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:877 +#: ../../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 " @@ -1387,7 +1386,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:885 +#: ../../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 " @@ -1396,13 +1395,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:891 +#: ../../library/string.rst:889 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:894 +#: ../../library/string.rst:892 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1410,7 +1409,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:897 +#: ../../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." @@ -1418,7 +1417,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:900 +#: ../../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." @@ -1426,7 +1425,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:903 +#: ../../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." @@ -1434,11 +1433,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:908 +#: ../../library/string.rst:906 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:912 +#: ../../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:" @@ -1519,10 +1518,10 @@ msgstr ", (逗號)" msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:748 +#: ../../library/string.rst:746 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:748 +#: ../../library/string.rst:746 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 00ed2f6f6f..c96289926a 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-19 10:40+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-" @@ -366,103 +366,98 @@ msgstr "" #: ../../reference/lexical_analysis.rst:286 msgid "" "Within the ASCII range (U+0001..U+007F), the valid characters for " -"identifiers are the same as in Python 2.x: the uppercase and lowercase " -"letters ``A`` through ``Z``, the underscore ``_`` and, except for the first " -"character, the digits ``0`` through ``9``." -msgstr "" - -#: ../../reference/lexical_analysis.rst:291 -msgid "" -"Python 3.0 introduces additional characters from outside the ASCII range " -"(see :pep:`3131`). For these characters, the classification uses the " -"version of the Unicode Character Database as included in the :mod:" +"identifiers include the uppercase and lowercase letters ``A`` through ``Z``, " +"the underscore ``_`` and, except for the first character, the digits ``0`` " +"through ``9``. Python 3.0 introduced additional characters from outside the " +"ASCII range (see :pep:`3131`). For these characters, the classification " +"uses the version of the Unicode Character Database as included in the :mod:" "`unicodedata` module." msgstr "" -#: ../../reference/lexical_analysis.rst:295 +#: ../../reference/lexical_analysis.rst:294 msgid "Identifiers are unlimited in length. Case is significant." msgstr "" -#: ../../reference/lexical_analysis.rst:304 +#: ../../reference/lexical_analysis.rst:303 msgid "The Unicode category codes mentioned above stand for:" msgstr "" -#: ../../reference/lexical_analysis.rst:306 +#: ../../reference/lexical_analysis.rst:305 msgid "*Lu* - uppercase letters" msgstr "*Lu* - 大寫字母" -#: ../../reference/lexical_analysis.rst:307 +#: ../../reference/lexical_analysis.rst:306 msgid "*Ll* - lowercase letters" msgstr "*Ll* - 小寫字母" -#: ../../reference/lexical_analysis.rst:308 +#: ../../reference/lexical_analysis.rst:307 msgid "*Lt* - titlecase letters" msgstr "" -#: ../../reference/lexical_analysis.rst:309 +#: ../../reference/lexical_analysis.rst:308 msgid "*Lm* - modifier letters" msgstr "" -#: ../../reference/lexical_analysis.rst:310 +#: ../../reference/lexical_analysis.rst:309 msgid "*Lo* - other letters" msgstr "*Lo* - 其他字母" -#: ../../reference/lexical_analysis.rst:311 +#: ../../reference/lexical_analysis.rst:310 msgid "*Nl* - letter numbers" msgstr "" -#: ../../reference/lexical_analysis.rst:312 +#: ../../reference/lexical_analysis.rst:311 msgid "*Mn* - nonspacing marks" msgstr "" -#: ../../reference/lexical_analysis.rst:313 +#: ../../reference/lexical_analysis.rst:312 msgid "*Mc* - spacing combining marks" msgstr "" -#: ../../reference/lexical_analysis.rst:314 +#: ../../reference/lexical_analysis.rst:313 msgid "*Nd* - decimal numbers" msgstr "*Nd* - 十進位數字" -#: ../../reference/lexical_analysis.rst:315 +#: ../../reference/lexical_analysis.rst:314 msgid "*Pc* - connector punctuations" msgstr "" -#: ../../reference/lexical_analysis.rst:316 +#: ../../reference/lexical_analysis.rst:315 msgid "" "*Other_ID_Start* - explicit list of characters in `PropList.txt `_ to support backwards " "compatibility" msgstr "" -#: ../../reference/lexical_analysis.rst:319 +#: ../../reference/lexical_analysis.rst:318 msgid "*Other_ID_Continue* - likewise" msgstr "" -#: ../../reference/lexical_analysis.rst:321 +#: ../../reference/lexical_analysis.rst:320 msgid "" "All identifiers are converted into the normal form NFKC while parsing; " "comparison of identifiers is based on NFKC." msgstr "" -#: ../../reference/lexical_analysis.rst:324 +#: ../../reference/lexical_analysis.rst:323 msgid "" "A non-normative HTML file listing all valid identifier characters for " "Unicode 15.1.0 can be found at https://www.unicode.org/Public/15.1.0/ucd/" "DerivedCoreProperties.txt" msgstr "" -#: ../../reference/lexical_analysis.rst:332 +#: ../../reference/lexical_analysis.rst:331 msgid "Keywords" msgstr "關鍵字" -#: ../../reference/lexical_analysis.rst:338 +#: ../../reference/lexical_analysis.rst:337 msgid "" "The following identifiers are used as reserved words, or *keywords* of the " "language, and cannot be used as ordinary identifiers. They must be spelled " "exactly as written here:" msgstr "" -#: ../../reference/lexical_analysis.rst:342 +#: ../../reference/lexical_analysis.rst:341 msgid "" "False await else import pass\n" "None break except in raise\n" @@ -480,11 +475,11 @@ msgstr "" "assert del global not with\n" "async elif if or yield" -#: ../../reference/lexical_analysis.rst:356 +#: ../../reference/lexical_analysis.rst:355 msgid "Soft Keywords" msgstr "軟關鍵字" -#: ../../reference/lexical_analysis.rst:362 +#: ../../reference/lexical_analysis.rst:361 msgid "" "Some identifiers are only reserved under specific contexts. These are known " "as *soft keywords*. The identifiers ``match``, ``case``, ``type`` and ``_`` " @@ -492,82 +487,82 @@ msgid "" "is done at the parser level, not when tokenizing." msgstr "" -#: ../../reference/lexical_analysis.rst:367 +#: ../../reference/lexical_analysis.rst:366 msgid "" "As soft keywords, their use in the grammar is possible while still " "preserving compatibility with existing code that uses these names as " "identifier names." msgstr "" -#: ../../reference/lexical_analysis.rst:371 +#: ../../reference/lexical_analysis.rst:370 msgid "" "``match``, ``case``, and ``_`` are used in the :keyword:`match` statement. " "``type`` is used in the :keyword:`type` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:374 +#: ../../reference/lexical_analysis.rst:373 msgid "``type`` is now a soft keyword." msgstr "``type`` 現在是軟關鍵字。" -#: ../../reference/lexical_analysis.rst:383 +#: ../../reference/lexical_analysis.rst:382 msgid "Reserved classes of identifiers" msgstr "" -#: ../../reference/lexical_analysis.rst:385 +#: ../../reference/lexical_analysis.rst:384 msgid "" "Certain classes of identifiers (besides keywords) have special meanings. " "These classes are identified by the patterns of leading and trailing " "underscore characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:389 +#: ../../reference/lexical_analysis.rst:388 msgid "``_*``" msgstr "``_*``" -#: ../../reference/lexical_analysis.rst:390 +#: ../../reference/lexical_analysis.rst:389 msgid "Not imported by ``from module import *``." msgstr "" -#: ../../reference/lexical_analysis.rst:392 +#: ../../reference/lexical_analysis.rst:391 msgid "``_``" msgstr "``_``" -#: ../../reference/lexical_analysis.rst:393 +#: ../../reference/lexical_analysis.rst:392 msgid "" "In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" "`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" -#: ../../reference/lexical_analysis.rst:397 +#: ../../reference/lexical_analysis.rst:396 msgid "" "Separately, the interactive interpreter makes the result of the last " "evaluation available in the variable ``_``. (It is stored in the :mod:" "`builtins` module, alongside built-in functions like ``print``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:402 +#: ../../reference/lexical_analysis.rst:401 msgid "" "Elsewhere, ``_`` is a regular identifier. It is often used to name " "\"special\" items, but it is not special to Python itself." msgstr "" -#: ../../reference/lexical_analysis.rst:407 +#: ../../reference/lexical_analysis.rst:406 msgid "" "The name ``_`` is often used in conjunction with internationalization; refer " "to the documentation for the :mod:`gettext` module for more information on " "this convention." msgstr "" -#: ../../reference/lexical_analysis.rst:411 +#: ../../reference/lexical_analysis.rst:410 msgid "It is also commonly used for unused variables." msgstr "" -#: ../../reference/lexical_analysis.rst:413 +#: ../../reference/lexical_analysis.rst:412 msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:414 +#: ../../reference/lexical_analysis.rst:413 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -577,11 +572,11 @@ msgid "" "explicitly documented use, is subject to breakage without warning." msgstr "" -#: ../../reference/lexical_analysis.rst:421 +#: ../../reference/lexical_analysis.rst:420 msgid "``__*``" msgstr "``__*``" -#: ../../reference/lexical_analysis.rst:422 +#: ../../reference/lexical_analysis.rst:421 msgid "" "Class-private names. Names in this category, when used within the context " "of a class definition, are re-written to use a mangled form to help avoid " @@ -589,23 +584,23 @@ msgid "" "section :ref:`atom-identifiers`." msgstr "" -#: ../../reference/lexical_analysis.rst:431 +#: ../../reference/lexical_analysis.rst:430 msgid "Literals" msgstr "" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:434 msgid "Literals are notations for constant values of some built-in types." msgstr "" -#: ../../reference/lexical_analysis.rst:446 +#: ../../reference/lexical_analysis.rst:445 msgid "String and Bytes literals" msgstr "" -#: ../../reference/lexical_analysis.rst:448 +#: ../../reference/lexical_analysis.rst:447 msgid "String literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:473 +#: ../../reference/lexical_analysis.rst:472 msgid "" "One syntactic restriction not indicated by these productions is that " "whitespace is not allowed between the :token:`~python-grammar:stringprefix` " @@ -615,7 +610,7 @@ msgid "" "`encodings`." msgstr "" -#: ../../reference/lexical_analysis.rst:483 +#: ../../reference/lexical_analysis.rst:482 msgid "" "In plain English: Both types of literals can be enclosed in matching single " "quotes (``'``) or double quotes (``\"``). They can also be enclosed in " @@ -628,7 +623,7 @@ msgid "" "sequences>` below for examples." msgstr "" -#: ../../reference/lexical_analysis.rst:496 +#: ../../reference/lexical_analysis.rst:495 msgid "" "Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an " "instance of the :class:`bytes` type instead of the :class:`str` type. They " @@ -636,7 +631,7 @@ msgid "" "greater must be expressed with escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:505 +#: ../../reference/lexical_analysis.rst:504 msgid "" "Both string and bytes literals may optionally be prefixed with a letter " "``'r'`` or ``'R'``; such constructs are called :dfn:`raw string literals` " @@ -645,20 +640,20 @@ msgid "" "escapes are not treated specially." msgstr "" -#: ../../reference/lexical_analysis.rst:511 +#: ../../reference/lexical_analysis.rst:510 msgid "" "The ``'rb'`` prefix of raw bytes literals has been added as a synonym of " "``'br'``." msgstr "" -#: ../../reference/lexical_analysis.rst:515 +#: ../../reference/lexical_analysis.rst:514 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " "simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:523 +#: ../../reference/lexical_analysis.rst:522 msgid "" "A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted " "string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with " @@ -666,7 +661,7 @@ msgid "" "are possible, but formatted bytes literals are not." msgstr "" -#: ../../reference/lexical_analysis.rst:528 +#: ../../reference/lexical_analysis.rst:527 msgid "" "In triple-quoted literals, unescaped newlines and quotes are allowed (and " "are retained), except that three unescaped quotes in a row terminate the " @@ -674,253 +669,253 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:550 msgid "Escape sequences" msgstr "跳脫序列" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:552 msgid "" "Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Meaning" msgstr "含義" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "\\(1)" msgstr "\\(1)" -#: ../../reference/lexical_analysis.rst:562 +#: ../../reference/lexical_analysis.rst:561 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:562 +#: ../../reference/lexical_analysis.rst:561 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:564 +#: ../../reference/lexical_analysis.rst:563 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:564 +#: ../../reference/lexical_analysis.rst:563 msgid "Single quote (``'``)" msgstr "單引號 (``'``)" -#: ../../reference/lexical_analysis.rst:566 +#: ../../reference/lexical_analysis.rst:565 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:566 +#: ../../reference/lexical_analysis.rst:565 msgid "Double quote (``\"``)" msgstr "雙引號 (``\"``)" -#: ../../reference/lexical_analysis.rst:568 +#: ../../reference/lexical_analysis.rst:567 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:568 +#: ../../reference/lexical_analysis.rst:567 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:570 +#: ../../reference/lexical_analysis.rst:569 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:570 +#: ../../reference/lexical_analysis.rst:569 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:572 +#: ../../reference/lexical_analysis.rst:571 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:572 +#: ../../reference/lexical_analysis.rst:571 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:574 +#: ../../reference/lexical_analysis.rst:573 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:574 +#: ../../reference/lexical_analysis.rst:573 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:575 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:578 +#: ../../reference/lexical_analysis.rst:577 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:578 +#: ../../reference/lexical_analysis.rst:577 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:580 +#: ../../reference/lexical_analysis.rst:579 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:580 +#: ../../reference/lexical_analysis.rst:579 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid ":samp:`\\\\\\\\{ooo}`" msgstr ":samp:`\\\\\\\\{ooo}`" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid "(2,4)" msgstr "(2,4)" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid ":samp:`\\\\x{hh}`" msgstr ":samp:`\\\\x{hh}`" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "(3,4)" msgstr "(3,4)" -#: ../../reference/lexical_analysis.rst:588 +#: ../../reference/lexical_analysis.rst:587 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid ":samp:`\\\\u{xxxx}`" msgstr ":samp:`\\\\u{xxxx}`" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid ":samp:`\\\\U{xxxxxxxx}`" msgstr ":samp:`\\\\U{xxxxxxxx}`" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "\\(7)" msgstr "\\(7)" -#: ../../reference/lexical_analysis.rst:603 +#: ../../reference/lexical_analysis.rst:602 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:606 +#: ../../reference/lexical_analysis.rst:605 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:608 +#: ../../reference/lexical_analysis.rst:607 msgid "" ">>> 'This string will not include \\\n" "... backslashes or newline characters.'\n" "'This string will not include backslashes or newline characters.'" msgstr "" -#: ../../reference/lexical_analysis.rst:612 +#: ../../reference/lexical_analysis.rst:611 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:617 +#: ../../reference/lexical_analysis.rst:616 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:619 +#: ../../reference/lexical_analysis.rst:618 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:623 +#: ../../reference/lexical_analysis.rst:622 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`SyntaxWarning`. In a future Python version they will be eventually a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:629 +#: ../../reference/lexical_analysis.rst:628 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:632 +#: ../../reference/lexical_analysis.rst:631 msgid "" "In a bytes literal, hexadecimal and octal escapes denote the byte with the " "given value. In a string literal, these escapes denote a Unicode character " "with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:637 +#: ../../reference/lexical_analysis.rst:636 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:641 +#: ../../reference/lexical_analysis.rst:640 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:643 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:650 +#: ../../reference/lexical_analysis.rst:649 msgid "" "Unlike Standard C, all unrecognized escape sequences are left in the string " "unchanged, i.e., *the backslash is left in the result*. (This behavior is " @@ -930,17 +925,17 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:657 +#: ../../reference/lexical_analysis.rst:656 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:660 +#: ../../reference/lexical_analysis.rst:659 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will be eventually a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:664 +#: ../../reference/lexical_analysis.rst:663 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -953,11 +948,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:677 +#: ../../reference/lexical_analysis.rst:676 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:679 +#: ../../reference/lexical_analysis.rst:678 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -967,14 +962,14 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:686 +#: ../../reference/lexical_analysis.rst:685 msgid "" "re.compile(\"[A-Za-z_]\" # letter or underscore\n" " \"[A-Za-z0-9_]*\" # letter, digit or underscore\n" " )" msgstr "" -#: ../../reference/lexical_analysis.rst:690 +#: ../../reference/lexical_analysis.rst:689 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -984,11 +979,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:713 +#: ../../reference/lexical_analysis.rst:712 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:717 +#: ../../reference/lexical_analysis.rst:716 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with ``'f'`` or ``'F'``. These strings may contain " @@ -997,14 +992,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:723 +#: ../../reference/lexical_analysis.rst:722 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:737 +#: ../../reference/lexical_analysis.rst:736 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -1017,7 +1012,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:747 +#: ../../reference/lexical_analysis.rst:746 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -1031,27 +1026,27 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:758 +#: ../../reference/lexical_analysis.rst:757 msgid "" ">>> f\"abc{a # This is a comment }\"\n" "... + 3}\"\n" "'abc5'" msgstr "" -#: ../../reference/lexical_analysis.rst:764 +#: ../../reference/lexical_analysis.rst:763 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:769 +#: ../../reference/lexical_analysis.rst:768 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:773 +#: ../../reference/lexical_analysis.rst:772 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -1062,18 +1057,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:781 +#: ../../reference/lexical_analysis.rst:780 msgid "The equal sign ``'='``." msgstr "等號 ``'='``。" -#: ../../reference/lexical_analysis.rst:784 +#: ../../reference/lexical_analysis.rst:783 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:788 +#: ../../reference/lexical_analysis.rst:787 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`~object.__format__` method of the " @@ -1082,7 +1077,7 @@ msgid "" "value of the whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:794 +#: ../../reference/lexical_analysis.rst:793 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -1091,17 +1086,17 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:800 +#: ../../reference/lexical_analysis.rst:799 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:803 +#: ../../reference/lexical_analysis.rst:802 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:805 +#: ../../reference/lexical_analysis.rst:804 msgid "" ">>> name = \"Fred\"\n" ">>> f\"He said his name is {name!r}.\"\n" @@ -1133,13 +1128,13 @@ msgid "" "'line = \"The mill\\'s closed\" '" msgstr "" -#: ../../reference/lexical_analysis.rst:835 +#: ../../reference/lexical_analysis.rst:834 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:838 +#: ../../reference/lexical_analysis.rst:837 msgid "" ">>> a = dict(x=2)\n" ">>> f\"abc {a[\"x\"]} def\"\n" @@ -1149,19 +1144,19 @@ msgstr "" ">>> f\"abc {a[\"x\"]} def\"\n" "'abc 2 def'" -#: ../../reference/lexical_analysis.rst:842 +#: ../../reference/lexical_analysis.rst:841 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:846 +#: ../../reference/lexical_analysis.rst:845 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:849 +#: ../../reference/lexical_analysis.rst:848 msgid "" ">>> a = [\"a\", \"b\", \"c\"]\n" ">>> print(f\"List a contains:\\n{\"\\n\".join(a)}\")\n" @@ -1177,19 +1172,19 @@ msgstr "" "b\n" "c" -#: ../../reference/lexical_analysis.rst:856 +#: ../../reference/lexical_analysis.rst:855 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:860 +#: ../../reference/lexical_analysis.rst:859 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:865 +#: ../../reference/lexical_analysis.rst:864 msgid "" ">>> def foo():\n" "... f\"Not a docstring\"\n" @@ -1198,63 +1193,63 @@ msgid "" "True" msgstr "" -#: ../../reference/lexical_analysis.rst:871 +#: ../../reference/lexical_analysis.rst:870 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:878 +#: ../../reference/lexical_analysis.rst:877 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:884 +#: ../../reference/lexical_analysis.rst:883 msgid "" "There are three types of numeric literals: integers, floating-point numbers, " "and imaginary numbers. There are no complex literals (complex numbers can " "be formed by adding a real number and an imaginary number)." msgstr "" -#: ../../reference/lexical_analysis.rst:888 +#: ../../reference/lexical_analysis.rst:887 msgid "" "Note that numeric literals do not include a sign; a phrase like ``-1`` is " "actually an expression composed of the unary operator '``-``' and the " "literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:902 +#: ../../reference/lexical_analysis.rst:901 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:903 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:918 +#: ../../reference/lexical_analysis.rst:917 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory." msgstr "" -#: ../../reference/lexical_analysis.rst:921 +#: ../../reference/lexical_analysis.rst:920 msgid "" "Underscores are ignored for determining the numeric value of the literal. " "They can be used to group digits for enhanced readability. One underscore " "can occur between digits, and after base specifiers like ``0x``." msgstr "" -#: ../../reference/lexical_analysis.rst:925 +#: ../../reference/lexical_analysis.rst:924 msgid "" "Note that leading zeros in a non-zero decimal number are not allowed. This " "is for disambiguation with C-style octal literals, which Python used before " "version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:929 +#: ../../reference/lexical_analysis.rst:928 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:931 +#: ../../reference/lexical_analysis.rst:930 msgid "" "7 2147483647 0o177 0b100110111\n" "3 79228162514264337593543950336 0o377 0xdeadbeef\n" @@ -1264,21 +1259,21 @@ msgstr "" "3 79228162514264337593543950336 0o377 0xdeadbeef\n" " 100_000_000_000 0b_1110_0101" -#: ../../reference/lexical_analysis.rst:935 -#: ../../reference/lexical_analysis.rst:967 +#: ../../reference/lexical_analysis.rst:934 +#: ../../reference/lexical_analysis.rst:966 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:946 +#: ../../reference/lexical_analysis.rst:945 msgid "Floating-point literals" msgstr "浮點數常數 (Floating-point literals)" -#: ../../reference/lexical_analysis.rst:948 +#: ../../reference/lexical_analysis.rst:947 msgid "" "Floating-point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:958 +#: ../../reference/lexical_analysis.rst:957 msgid "" "Note that the integer and exponent parts are always interpreted using radix " "10. For example, ``077e010`` is legal, and denotes the same number as " @@ -1287,23 +1282,23 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:963 +#: ../../reference/lexical_analysis.rst:962 msgid "Some examples of floating-point literals::" msgstr "一些浮點數常數的範例: ::" -#: ../../reference/lexical_analysis.rst:965 +#: ../../reference/lexical_analysis.rst:964 msgid "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" msgstr "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" -#: ../../reference/lexical_analysis.rst:976 +#: ../../reference/lexical_analysis.rst:975 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:978 +#: ../../reference/lexical_analysis.rst:977 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:983 +#: ../../reference/lexical_analysis.rst:982 msgid "" "An imaginary literal yields a complex number with a real part of 0.0. " "Complex numbers are represented as a pair of floating-point numbers and have " @@ -1312,19 +1307,19 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:989 +#: ../../reference/lexical_analysis.rst:988 msgid "3.14j 10.j 10j .001j 1e100j 3.14e-10j 3.14_15_93j" msgstr "3.14j 10.j 10j .001j 1e100j 3.14e-10j 3.14_15_93j" -#: ../../reference/lexical_analysis.rst:995 +#: ../../reference/lexical_analysis.rst:994 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:999 +#: ../../reference/lexical_analysis.rst:998 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:1001 +#: ../../reference/lexical_analysis.rst:1000 msgid "" "+ - * ** / // % @\n" "<< >> & | ^ ~ :=\n" @@ -1334,15 +1329,15 @@ msgstr "" "<< >> & | ^ ~ :=\n" "< > <= >= == !=" -#: ../../reference/lexical_analysis.rst:1012 +#: ../../reference/lexical_analysis.rst:1011 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1016 +#: ../../reference/lexical_analysis.rst:1015 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:1018 +#: ../../reference/lexical_analysis.rst:1017 msgid "" "( ) [ ] { }\n" ", : ! . ; @ =\n" @@ -1354,7 +1349,7 @@ msgstr "" "-> += -= *= /= //= %=\n" "@= &= |= ^= >>= <<= **=" -#: ../../reference/lexical_analysis.rst:1025 +#: ../../reference/lexical_analysis.rst:1024 msgid "" "The period can also occur in floating-point and imaginary literals. A " "sequence of three periods has a special meaning as an ellipsis literal. The " @@ -1362,31 +1357,31 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:1030 +#: ../../reference/lexical_analysis.rst:1029 msgid "" "The following printing ASCII characters have special meaning as part of " "other tokens or are otherwise significant to the lexical analyzer:" msgstr "" -#: ../../reference/lexical_analysis.rst:1033 +#: ../../reference/lexical_analysis.rst:1032 msgid "' \" # \\" msgstr "' \" # \\" -#: ../../reference/lexical_analysis.rst:1037 +#: ../../reference/lexical_analysis.rst:1036 msgid "" "The following printing ASCII characters are not used in Python. Their " "occurrence outside string literals and comments is an unconditional error:" msgstr "" -#: ../../reference/lexical_analysis.rst:1040 +#: ../../reference/lexical_analysis.rst:1039 msgid "$ ? `" msgstr "$ ? `" -#: ../../reference/lexical_analysis.rst:1046 +#: ../../reference/lexical_analysis.rst:1045 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1047 +#: ../../reference/lexical_analysis.rst:1046 #, fuzzy msgid "https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" @@ -1413,7 +1408,7 @@ msgstr "logical line(邏輯列)" #: ../../reference/lexical_analysis.rst:35 #: ../../reference/lexical_analysis.rst:114 -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "physical line" msgstr "physical line(物理列)" @@ -1503,315 +1498,315 @@ msgstr "identifier(識別器)" msgid "name" msgstr "name(名稱)" -#: ../../reference/lexical_analysis.rst:334 -#: ../../reference/lexical_analysis.rst:358 +#: ../../reference/lexical_analysis.rst:333 +#: ../../reference/lexical_analysis.rst:357 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/lexical_analysis.rst:334 +#: ../../reference/lexical_analysis.rst:333 msgid "reserved word" msgstr "reserved word(保留字)" -#: ../../reference/lexical_analysis.rst:358 +#: ../../reference/lexical_analysis.rst:357 msgid "soft keyword" msgstr "soft keyword(軟關鍵字)" -#: ../../reference/lexical_analysis.rst:377 +#: ../../reference/lexical_analysis.rst:376 msgid "_, identifiers" msgstr "_, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:377 +#: ../../reference/lexical_analysis.rst:376 msgid "__, identifiers" msgstr "__, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:433 +#: ../../reference/lexical_analysis.rst:432 msgid "literal" msgstr "literal(常數)" -#: ../../reference/lexical_analysis.rst:433 +#: ../../reference/lexical_analysis.rst:432 msgid "constant" msgstr "constant(常數)" -#: ../../reference/lexical_analysis.rst:438 -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:437 +#: ../../reference/lexical_analysis.rst:478 msgid "string literal" msgstr "string literal(字串常數)" -#: ../../reference/lexical_analysis.rst:438 -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:437 +#: ../../reference/lexical_analysis.rst:491 msgid "bytes literal" msgstr "bytes literal(位元組常數)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "ASCII" msgstr "ASCII" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "' (single quote)" msgstr "' (單引號)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "\" (double quote)" msgstr "\" (雙引號)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "u'" msgstr "u'" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "u\"" msgstr "u\"" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "triple-quoted string" msgstr "triple-quoted string(三引號字串)" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "Unicode Consortium" msgstr "Unicode Consortium" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "raw string" msgstr "raw string(原始字串)" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "\"\"\"" msgstr "\"\"\"" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "'''" msgstr "'''" -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:491 msgid "b'" msgstr "b'" -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:491 msgid "b\"" msgstr "b\"" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "r'" msgstr "r'" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "raw string literal" msgstr "raw string literal(原始字串常數)" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:519 +#: ../../reference/lexical_analysis.rst:518 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:519 -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:518 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:519 +#: ../../reference/lexical_analysis.rst:518 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:648 +#: ../../reference/lexical_analysis.rst:647 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:880 -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:879 +#: ../../reference/lexical_analysis.rst:892 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "floating-point literal" msgstr "floating-point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:893 -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:892 +#: ../../reference/lexical_analysis.rst:938 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:893 -#: ../../reference/lexical_analysis.rst:939 -#: ../../reference/lexical_analysis.rst:971 +#: ../../reference/lexical_analysis.rst:892 +#: ../../reference/lexical_analysis.rst:938 +#: ../../reference/lexical_analysis.rst:970 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:938 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:938 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:971 +#: ../../reference/lexical_analysis.rst:970 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:997 +#: ../../reference/lexical_analysis.rst:996 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1014 +#: ../../reference/lexical_analysis.rst:1013 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 703dc079b8..1482d56e68 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-19 10:40+0000\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgid "" "editing, history browsing, and paste mode. To disable color, see :ref:" "`using-on-controlling-color` for details. Function keys provide some " "additional functionality. :kbd:`F1` enters the interactive help browser :mod:" -"`pydoc`. :kbd:`F2` allows for browsing command-line history without output " -"nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters \"paste " +"`pydoc`. :kbd:`F2` allows for browsing command-line history with neither " +"output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters \"paste " "mode\", which makes pasting larger blocks of code easier. Press :kbd:`F3` to " "return to the regular prompt." msgstr "" diff --git a/using/configure.po b/using/configure.po index 1b0328f205..65174a6000 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-19 10:40+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-" @@ -70,7 +70,7 @@ msgstr "" #: ../../using/configure.rst:32 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 are required to regenerate the :file:" +"Autoconf 2.71 and aclocal 1.16.5 are required to regenerate the :file:" "`configure` script." msgstr "" @@ -109,7 +109,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:58 -msgid "Autoconf 2.71, aclocal 1.16.4 and SQLite 3.15.2 are now required." +msgid "Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required." msgstr "" #: ../../using/configure.rst:61 diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 87110ac562..491ba7e52e 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-19 10:40+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4784,8 +4784,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2498 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" -"`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" +"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" +"`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " +"Victor Stinner in :gh:`112090`.)" msgstr "" #: ../../whatsnew/3.13.rst:2502 From 65793b7abae05101e8077c53564ecc0fa4446659 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Oct 2024 07:01:00 +0000 Subject: [PATCH 07/14] sync with cpython 97c2e6ac --- c-api/init.po | 710 +++++++------- c-api/long.po | 4 +- c-api/monitoring.po | 8 +- c-api/typeobj.po | 878 +++++++++--------- deprecations/c-api-pending-removal-in-3.15.po | 10 +- deprecations/index.po | 10 +- library/argparse.po | 523 +++++------ library/builtins.po | 28 +- library/concurrent.futures.po | 4 +- library/importlib.metadata.po | 4 +- library/locale.po | 176 ++-- library/os.po | 4 +- tutorial/errors.po | 4 +- using/unix.po | 14 +- using/windows.po | 6 +- whatsnew/3.12.po | 10 +- whatsnew/3.13.po | 23 +- 17 files changed, 1233 insertions(+), 1183 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index 3bc72498dc..0b4d5401de 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -844,8 +844,8 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:587 ../../c-api/init.rst:826 ../../c-api/init.rst:862 -#: ../../c-api/init.rst:888 +#: ../../c-api/init.rst:587 ../../c-api/init.rst:829 ../../c-api/init.rst:865 +#: ../../c-api/init.rst:891 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." @@ -858,19 +858,19 @@ msgid "" "not modify its value." msgstr "" -#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:665 -#: ../../c-api/init.rst:686 ../../c-api/init.rst:712 ../../c-api/init.rst:900 +#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:667 +#: ../../c-api/init.rst:689 ../../c-api/init.rst:715 ../../c-api/init.rst:903 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。" -#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:668 -#: ../../c-api/init.rst:689 ../../c-api/init.rst:717 ../../c-api/init.rst:903 +#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:670 +#: ../../c-api/init.rst:692 ../../c-api/init.rst:720 ../../c-api/init.rst:906 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。" -#: ../../c-api/init.rst:605 ../../c-api/init.rst:692 +#: ../../c-api/init.rst:605 ../../c-api/init.rst:695 msgid "Get :data:`sys.executable` instead." msgstr "" @@ -884,15 +884,17 @@ msgid "" "should not modify its value. This corresponds to the :makevar:`prefix` " "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." +"available to Python code as ``sys.base_prefix``. It is only useful on Unix. " +"See also the next function." msgstr "" #: ../../c-api/init.rst:627 -msgid "Get :data:`sys.prefix` instead." +msgid "" +"Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual " +"environments ` need to be handled." msgstr "" -#: ../../c-api/init.rst:633 +#: ../../c-api/init.rst:634 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -902,11 +904,11 @@ msgid "" "caller should not modify its value. This corresponds to the :makevar:" "`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" "prefix`` argument to the :program:`configure` script at build time. The " -"value is available to Python code as ``sys.exec_prefix``. It is only useful " -"on Unix." +"value is available to Python code as ``sys.base_exec_prefix``. It is only " +"useful on Unix." msgstr "" -#: ../../c-api/init.rst:643 +#: ../../c-api/init.rst:645 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -915,7 +917,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:649 +#: ../../c-api/init.rst:651 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -929,7 +931,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:660 +#: ../../c-api/init.rst:662 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -937,11 +939,13 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:671 -msgid "Get :data:`sys.exec_prefix` instead." +#: ../../c-api/init.rst:673 +msgid "" +"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:" +"`virtual environments ` need to be handled." msgstr "" -#: ../../c-api/init.rst:680 +#: ../../c-api/init.rst:683 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -950,7 +954,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:702 +#: ../../c-api/init.rst:705 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:member:`PyConfig.program_name`) and some environment " @@ -963,21 +967,21 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:720 +#: ../../c-api/init.rst:723 msgid "Get :data:`sys.path` instead." msgstr "" -#: ../../c-api/init.rst:726 +#: ../../c-api/init.rst:729 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: ../../c-api/init.rst:729 +#: ../../c-api/init.rst:732 msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -#: ../../c-api/init.rst:733 +#: ../../c-api/init.rst:736 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -986,11 +990,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:738 +#: ../../c-api/init.rst:741 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:745 +#: ../../c-api/init.rst:748 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -1001,50 +1005,50 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:756 +#: ../../c-api/init.rst:759 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: ../../c-api/init.rst:758 +#: ../../c-api/init.rst:761 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:762 +#: ../../c-api/init.rst:765 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:768 +#: ../../c-api/init.rst:771 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: ../../c-api/init.rst:771 +#: ../../c-api/init.rst:774 msgid "\"[GCC 2.7.2.2]\"" msgstr "\"[GCC 2.7.2.2]\"" -#: ../../c-api/init.rst:775 ../../c-api/init.rst:789 +#: ../../c-api/init.rst:778 ../../c-api/init.rst:792 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:782 +#: ../../c-api/init.rst:785 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: ../../c-api/init.rst:785 +#: ../../c-api/init.rst:788 msgid "\"#67, Aug 1 1997, 22:34:28\"" msgstr "\"#67, Aug 1 1997, 22:34:28\"" -#: ../../c-api/init.rst:801 +#: ../../c-api/init.rst:804 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -1052,7 +1056,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:806 +#: ../../c-api/init.rst:809 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -1063,84 +1067,84 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:814 +#: ../../c-api/init.rst:817 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: ../../c-api/init.rst:818 +#: ../../c-api/init.rst:821 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:821 +#: ../../c-api/init.rst:824 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:829 ../../c-api/init.rst:865 +#: ../../c-api/init.rst:832 ../../c-api/init.rst:868 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:833 +#: ../../c-api/init.rst:836 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: ../../c-api/init.rst:838 +#: ../../c-api/init.rst:841 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:845 msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -#: ../../c-api/init.rst:854 +#: ../../c-api/init.rst:857 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:861 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:868 +#: ../../c-api/init.rst:871 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:875 +#: ../../c-api/init.rst:878 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:879 +#: ../../c-api/init.rst:882 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:883 +#: ../../c-api/init.rst:886 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -1148,24 +1152,24 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:896 +#: ../../c-api/init.rst:899 msgid "" "Return the default \"home\", that is, the value set by :c:member:`PyConfig." "home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " "is set." msgstr "" -#: ../../c-api/init.rst:906 +#: ../../c-api/init.rst:909 msgid "" "Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " "instead." msgstr "改為取得 :c:member:`PyConfig.home` 或 :envvar:`PYTHONHOME` 環境變數。" -#: ../../c-api/init.rst:914 +#: ../../c-api/init.rst:917 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:921 +#: ../../c-api/init.rst:924 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -1177,7 +1181,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:931 +#: ../../c-api/init.rst:934 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -1187,7 +1191,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:941 +#: ../../c-api/init.rst:944 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1195,17 +1199,17 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:947 +#: ../../c-api/init.rst:950 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:949 +#: ../../c-api/init.rst:952 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:952 +#: ../../c-api/init.rst:955 msgid "" "Save the thread state in a local variable.\n" "Release the global interpreter lock.\n" @@ -1214,29 +1218,29 @@ msgid "" "Restore the thread state from the local variable." msgstr "" -#: ../../c-api/init.rst:958 +#: ../../c-api/init.rst:961 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:960 +#: ../../c-api/init.rst:963 msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" -#: ../../c-api/init.rst:968 +#: ../../c-api/init.rst:971 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:972 +#: ../../c-api/init.rst:975 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:974 +#: ../../c-api/init.rst:977 msgid "" "PyThreadState *_save;\n" "\n" @@ -1245,7 +1249,7 @@ msgid "" "PyEval_RestoreThread(_save);" msgstr "" -#: ../../c-api/init.rst:984 +#: ../../c-api/init.rst:987 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1256,7 +1260,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:993 +#: ../../c-api/init.rst:996 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1266,11 +1270,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:1004 +#: ../../c-api/init.rst:1007 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:1006 +#: ../../c-api/init.rst:1009 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1280,7 +1284,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:1013 +#: ../../c-api/init.rst:1016 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1291,14 +1295,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:1021 +#: ../../c-api/init.rst:1024 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:1025 +#: ../../c-api/init.rst:1028 msgid "" "PyGILState_STATE gstate;\n" "gstate = PyGILState_Ensure();\n" @@ -1311,7 +1315,7 @@ msgid "" "PyGILState_Release(gstate);" msgstr "" -#: ../../c-api/init.rst:1035 +#: ../../c-api/init.rst:1038 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1320,11 +1324,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:1045 +#: ../../c-api/init.rst:1048 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:1050 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1333,7 +1337,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:1053 +#: ../../c-api/init.rst:1056 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1350,7 +1354,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:1068 +#: ../../c-api/init.rst:1071 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1363,17 +1367,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:1081 +#: ../../c-api/init.rst:1084 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:1083 +#: ../../c-api/init.rst:1086 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:1088 +#: ../../c-api/init.rst:1091 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1381,7 +1385,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:1093 +#: ../../c-api/init.rst:1096 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1389,41 +1393,41 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:1101 +#: ../../c-api/init.rst:1104 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:1106 +#: ../../c-api/init.rst:1109 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1117 +#: ../../c-api/init.rst:1120 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1119 +#: ../../c-api/init.rst:1122 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1121 +#: ../../c-api/init.rst:1124 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1124 +#: ../../c-api/init.rst:1127 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1128 +#: ../../c-api/init.rst:1131 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1138 +#: ../../c-api/init.rst:1141 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1431,7 +1435,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1146 +#: ../../c-api/init.rst:1149 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1439,8 +1443,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1152 ../../c-api/init.rst:1211 -#: ../../c-api/init.rst:1493 +#: ../../c-api/init.rst:1155 ../../c-api/init.rst:1214 +#: ../../c-api/init.rst:1496 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1449,44 +1453,44 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1160 +#: ../../c-api/init.rst:1163 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1164 +#: ../../c-api/init.rst:1167 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../c-api/init.rst:1169 +#: ../../c-api/init.rst:1172 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1173 +#: ../../c-api/init.rst:1176 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1180 +#: ../../c-api/init.rst:1183 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1185 +#: ../../c-api/init.rst:1188 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1190 +#: ../../c-api/init.rst:1193 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1499,7 +1503,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1203 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1509,13 +1513,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1207 +#: ../../c-api/init.rst:1210 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1219 +#: ../../c-api/init.rst:1222 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1523,13 +1527,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1224 +#: ../../c-api/init.rst:1227 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1230 +#: ../../c-api/init.rst:1233 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1537,7 +1541,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1238 +#: ../../c-api/init.rst:1241 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1548,13 +1552,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1250 +#: ../../c-api/init.rst:1253 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1256 +#: ../../c-api/init.rst:1259 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1562,7 +1566,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1264 +#: ../../c-api/init.rst:1267 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1570,40 +1574,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1275 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1278 +#: ../../c-api/init.rst:1281 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1284 +#: ../../c-api/init.rst:1287 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1286 +#: ../../c-api/init.rst:1289 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1288 +#: ../../c-api/init.rst:1291 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1294 +#: ../../c-api/init.rst:1297 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1298 +#: ../../c-api/init.rst:1301 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1611,13 +1615,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1303 +#: ../../c-api/init.rst:1306 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1309 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1625,40 +1629,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1311 +#: ../../c-api/init.rst:1314 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1318 +#: ../../c-api/init.rst:1321 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1325 +#: ../../c-api/init.rst:1328 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1328 +#: ../../c-api/init.rst:1331 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1335 +#: ../../c-api/init.rst:1338 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1342 +#: ../../c-api/init.rst:1345 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1666,119 +1670,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1350 +#: ../../c-api/init.rst:1353 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1352 +#: ../../c-api/init.rst:1355 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1355 +#: ../../c-api/init.rst:1358 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1357 ../../c-api/init.rst:1366 -#: ../../c-api/init.rst:1375 +#: ../../c-api/init.rst:1360 ../../c-api/init.rst:1369 +#: ../../c-api/init.rst:1378 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1364 +#: ../../c-api/init.rst:1367 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1373 +#: ../../c-api/init.rst:1376 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1382 +#: ../../c-api/init.rst:1385 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1384 +#: ../../c-api/init.rst:1387 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1391 +#: ../../c-api/init.rst:1394 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1397 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1402 +#: ../../c-api/init.rst:1405 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1404 +#: ../../c-api/init.rst:1407 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1407 ../../c-api/init.rst:1417 +#: ../../c-api/init.rst:1410 ../../c-api/init.rst:1420 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1414 +#: ../../c-api/init.rst:1417 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1424 +#: ../../c-api/init.rst:1427 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1428 +#: ../../c-api/init.rst:1431 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1435 +#: ../../c-api/init.rst:1438 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1437 +#: ../../c-api/init.rst:1440 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1440 +#: ../../c-api/init.rst:1443 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1446 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1448 +#: ../../c-api/init.rst:1451 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1450 ../../c-api/init.rst:1458 +#: ../../c-api/init.rst:1453 ../../c-api/init.rst:1461 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1456 +#: ../../c-api/init.rst:1459 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1465 +#: ../../c-api/init.rst:1468 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1787,7 +1791,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1474 +#: ../../c-api/init.rst:1477 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1799,33 +1803,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1482 +#: ../../c-api/init.rst:1485 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1488 +#: ../../c-api/init.rst:1491 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1499 +#: ../../c-api/init.rst:1502 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1507 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1510 +#: ../../c-api/init.rst:1513 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1834,17 +1838,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1516 +#: ../../c-api/init.rst:1519 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1523 +#: ../../c-api/init.rst:1526 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1525 +#: ../../c-api/init.rst:1528 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1852,7 +1856,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1530 +#: ../../c-api/init.rst:1533 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1863,31 +1867,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1537 +#: ../../c-api/init.rst:1540 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1543 +#: ../../c-api/init.rst:1546 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1549 +#: ../../c-api/init.rst:1552 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1553 +#: ../../c-api/init.rst:1556 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1557 +#: ../../c-api/init.rst:1560 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1895,44 +1899,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1565 +#: ../../c-api/init.rst:1568 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1569 +#: ../../c-api/init.rst:1572 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1574 +#: ../../c-api/init.rst:1577 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1582 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1587 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1590 +#: ../../c-api/init.rst:1593 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1597 +#: ../../c-api/init.rst:1600 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1941,37 +1945,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1604 +#: ../../c-api/init.rst:1607 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1609 +#: ../../c-api/init.rst:1612 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1616 +#: ../../c-api/init.rst:1619 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1620 +#: ../../c-api/init.rst:1623 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1624 +#: ../../c-api/init.rst:1627 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1626 +#: ../../c-api/init.rst:1629 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1640 +#: ../../c-api/init.rst:1643 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1984,13 +1988,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1650 +#: ../../c-api/init.rst:1653 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1656 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2001,7 +2005,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1662 +#: ../../c-api/init.rst:1665 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2013,13 +2017,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1673 +#: ../../c-api/init.rst:1676 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1676 +#: ../../c-api/init.rst:1679 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2043,7 +2047,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1687 +#: ../../c-api/init.rst:1690 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2051,11 +2055,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1696 +#: ../../c-api/init.rst:1699 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1698 +#: ../../c-api/init.rst:1701 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2063,7 +2067,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1704 +#: ../../c-api/init.rst:1707 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2075,7 +2079,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1718 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2085,7 +2089,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1735 +#: ../../c-api/init.rst:1738 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2094,7 +2098,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1747 +#: ../../c-api/init.rst:1750 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2104,17 +2108,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1755 +#: ../../c-api/init.rst:1758 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1760 +#: ../../c-api/init.rst:1763 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1762 +#: ../../c-api/init.rst:1765 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2126,7 +2130,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1772 +#: ../../c-api/init.rst:1775 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2140,7 +2144,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1783 +#: ../../c-api/init.rst:1786 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2148,7 +2152,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1788 +#: ../../c-api/init.rst:1791 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2158,11 +2162,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1799 +#: ../../c-api/init.rst:1802 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1801 +#: ../../c-api/init.rst:1804 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2175,7 +2179,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1811 +#: ../../c-api/init.rst:1814 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2184,7 +2188,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1817 +#: ../../c-api/init.rst:1820 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2196,25 +2200,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1828 +#: ../../c-api/init.rst:1831 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:1833 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1837 +#: ../../c-api/init.rst:1840 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1841 +#: ../../c-api/init.rst:1844 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2222,17 +2226,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1846 +#: ../../c-api/init.rst:1849 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1850 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1853 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2240,20 +2244,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1858 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:1861 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1863 +#: ../../c-api/init.rst:1866 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2263,7 +2267,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1872 +#: ../../c-api/init.rst:1875 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2271,18 +2275,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1881 +#: ../../c-api/init.rst:1884 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1886 +#: ../../c-api/init.rst:1889 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1890 +#: ../../c-api/init.rst:1893 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2292,7 +2296,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1900 +#: ../../c-api/init.rst:1903 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 " @@ -2304,66 +2308,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1912 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1912 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1911 +#: ../../c-api/init.rst:1914 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1911 ../../c-api/init.rst:1916 -#: ../../c-api/init.rst:1927 +#: ../../c-api/init.rst:1914 ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1930 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1913 +#: ../../c-api/init.rst:1916 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1913 +#: ../../c-api/init.rst:1916 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1919 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1918 +#: ../../c-api/init.rst:1921 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1918 +#: ../../c-api/init.rst:1921 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1924 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1923 -#: ../../c-api/init.rst:1925 +#: ../../c-api/init.rst:1924 ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1928 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1923 +#: ../../c-api/init.rst:1926 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1925 +#: ../../c-api/init.rst:1928 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1927 +#: ../../c-api/init.rst:1930 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1932 +#: ../../c-api/init.rst:1935 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2372,7 +2376,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1941 +#: ../../c-api/init.rst:1944 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2384,7 +2388,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1952 +#: ../../c-api/init.rst:1955 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2392,31 +2396,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1963 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1969 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1972 +#: ../../c-api/init.rst:1975 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1978 +#: ../../c-api/init.rst:1981 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1984 +#: ../../c-api/init.rst:1987 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2424,7 +2428,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1992 +#: ../../c-api/init.rst:1995 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2434,29 +2438,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1999 +#: ../../c-api/init.rst:2002 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2001 ../../c-api/init.rst:2008 -#: ../../c-api/init.rst:2027 ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:2004 ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2030 ../../c-api/init.rst:2037 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2005 +#: ../../c-api/init.rst:2008 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2010 +#: ../../c-api/init.rst:2013 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2021 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2467,28 +2471,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2028 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2031 +#: ../../c-api/init.rst:2034 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2036 +#: ../../c-api/init.rst:2039 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2045 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2051 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2498,19 +2502,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2061 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2063 +#: ../../c-api/init.rst:2066 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2071 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2519,7 +2523,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2074 +#: ../../c-api/init.rst:2077 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2527,11 +2531,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2079 ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2082 ../../c-api/init.rst:2093 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2085 +#: ../../c-api/init.rst:2088 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2539,48 +2543,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2097 +#: ../../c-api/init.rst:2100 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2102 +#: ../../c-api/init.rst:2105 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2107 +#: ../../c-api/init.rst:2110 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2112 +#: ../../c-api/init.rst:2115 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2117 +#: ../../c-api/init.rst:2120 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2126 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2129 +#: ../../c-api/init.rst:2132 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2136 +#: ../../c-api/init.rst:2139 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2140 +#: ../../c-api/init.rst:2143 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2590,19 +2594,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2150 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2150 +#: ../../c-api/init.rst:2153 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2154 +#: ../../c-api/init.rst:2157 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2610,22 +2614,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2162 +#: ../../c-api/init.rst:2165 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2164 +#: ../../c-api/init.rst:2167 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2173 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2175 +#: ../../c-api/init.rst:2178 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2633,52 +2637,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2180 +#: ../../c-api/init.rst:2183 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2186 +#: ../../c-api/init.rst:2189 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2191 +#: ../../c-api/init.rst:2194 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2193 +#: ../../c-api/init.rst:2196 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2200 +#: ../../c-api/init.rst:2203 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2207 +#: ../../c-api/init.rst:2210 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2213 +#: ../../c-api/init.rst:2216 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2218 +#: ../../c-api/init.rst:2221 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2220 +#: ../../c-api/init.rst:2223 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2686,13 +2690,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2228 +#: ../../c-api/init.rst:2231 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2234 +#: ../../c-api/init.rst:2237 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2701,7 +2705,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2243 +#: ../../c-api/init.rst:2246 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2710,31 +2714,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2252 +#: ../../c-api/init.rst:2255 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2259 +#: ../../c-api/init.rst:2262 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2267 +#: ../../c-api/init.rst:2270 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2269 +#: ../../c-api/init.rst:2272 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2274 +#: ../../c-api/init.rst:2277 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2743,62 +2747,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2279 +#: ../../c-api/init.rst:2282 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:2290 +#: ../../c-api/init.rst:2293 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2292 +#: ../../c-api/init.rst:2295 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2296 +#: ../../c-api/init.rst:2299 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2302 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2301 +#: ../../c-api/init.rst:2304 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2307 +#: ../../c-api/init.rst:2310 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2315 +#: ../../c-api/init.rst:2318 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2323 +#: ../../c-api/init.rst:2326 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2331 +#: ../../c-api/init.rst:2334 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2333 +#: ../../c-api/init.rst:2336 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2806,7 +2810,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2338 +#: ../../c-api/init.rst:2341 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2816,7 +2820,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2345 +#: ../../c-api/init.rst:2348 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2824,7 +2828,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2352 +#: ../../c-api/init.rst:2355 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2833,11 +2837,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2358 +#: ../../c-api/init.rst:2361 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2360 +#: ../../c-api/init.rst:2363 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2849,71 +2853,71 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2369 +#: ../../c-api/init.rst:2372 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " -"critical section API avoids potentital deadlocks due to reentrancy and lock " +"critical section API avoids potential deadlocks due to reentrancy and lock " "ordering by allowing the runtime to temporarily suspend the critical section " "if the code triggered by the finalizer blocks and calls :c:func:" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2377 +#: ../../c-api/init.rst:2380 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2380 ../../c-api/init.rst:2394 -#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2423 +#: ../../c-api/init.rst:2383 ../../c-api/init.rst:2397 +#: ../../c-api/init.rst:2412 ../../c-api/init.rst:2426 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2382 +#: ../../c-api/init.rst:2385 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2386 ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2389 ../../c-api/init.rst:2418 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2392 +#: ../../c-api/init.rst:2395 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2396 +#: ../../c-api/init.rst:2399 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2428 +#: ../../c-api/init.rst:2402 ../../c-api/init.rst:2431 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2405 +#: ../../c-api/init.rst:2408 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2411 +#: ../../c-api/init.rst:2414 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2421 +#: ../../c-api/init.rst:2424 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2425 +#: ../../c-api/init.rst:2428 msgid "" " PyCriticalSection_End2(&_py_cs2);\n" "}" @@ -2927,36 +2931,36 @@ msgstr "PyEval_InitThreads()" msgid "modules (in module sys)" msgstr "modules(sys 模組中)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 ../../c-api/init.rst:1133 -#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136 +#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1692 ../../c-api/init.rst:1745 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1695 ../../c-api/init.rst:1748 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -2964,7 +2968,7 @@ msgstr "Py_FinalizeEx(C 函式)" msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/init.rst:567 ../../c-api/init.rst:796 +#: ../../c-api/init.rst:567 ../../c-api/init.rst:799 msgid "main()" msgstr "main()" @@ -2972,103 +2976,103 @@ msgstr "main()" msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/init.rst:677 +#: ../../c-api/init.rst:680 msgid "executable (in module sys)" msgstr "executable(sys 模組中)" -#: ../../c-api/init.rst:731 ../../c-api/init.rst:773 ../../c-api/init.rst:787 +#: ../../c-api/init.rst:734 ../../c-api/init.rst:776 ../../c-api/init.rst:790 msgid "version (in module sys)" msgstr "version(sys 模組中)" -#: ../../c-api/init.rst:743 +#: ../../c-api/init.rst:746 msgid "platform (in module sys)" msgstr "platform(sys 模組中)" -#: ../../c-api/init.rst:760 +#: ../../c-api/init.rst:763 msgid "copyright (in module sys)" msgstr "copyright(sys 模組中)" -#: ../../c-api/init.rst:796 +#: ../../c-api/init.rst:799 msgid "Py_FatalError()" msgstr "Py_FatalError()" -#: ../../c-api/init.rst:796 +#: ../../c-api/init.rst:799 msgid "argv (in module sys)" msgstr "argv(sys 模組中)" -#: ../../c-api/init.rst:916 +#: ../../c-api/init.rst:919 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../c-api/init.rst:916 +#: ../../c-api/init.rst:919 msgid "interpreter lock" msgstr "interpreter lock(直譯器鎖)" -#: ../../c-api/init.rst:916 +#: ../../c-api/init.rst:919 msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" -#: ../../c-api/init.rst:929 +#: ../../c-api/init.rst:932 msgid "setswitchinterval (in module sys)" msgstr "setswitchinterval (sys 模組中)" -#: ../../c-api/init.rst:938 +#: ../../c-api/init.rst:941 msgid "PyThreadState (C type)" msgstr "PyThreadState(C 型別)" -#: ../../c-api/init.rst:964 +#: ../../c-api/init.rst:967 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:964 +#: ../../c-api/init.rst:967 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "Py_END_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:980 +#: ../../c-api/init.rst:983 msgid "PyEval_RestoreThread (C function)" msgstr "PyEval_RestoreThread(C 函式)" -#: ../../c-api/init.rst:980 +#: ../../c-api/init.rst:983 msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread(C 函式)" -#: ../../c-api/init.rst:1111 +#: ../../c-api/init.rst:1114 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:1111 +#: ../../c-api/init.rst:1114 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:1111 +#: ../../c-api/init.rst:1114 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:1111 +#: ../../c-api/init.rst:1114 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:1133 +#: ../../c-api/init.rst:1136 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1692 +#: ../../c-api/init.rst:1695 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1722 +#: ../../c-api/init.rst:1725 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/long.po b/c-api/long.po index 8dc694f9af..5aac705341 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -496,7 +496,7 @@ msgstr "" #: ../../c-api/long.rst:456 msgid "" "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " -"that behave most like a C cast, or a combintation of the other flags in the " +"that behave most like a C cast, or a combination of the other flags in the " "table below. Note that ``-1`` cannot be combined with other flags." msgstr "" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index 9acef77d30..bd3abe41be 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -184,9 +184,9 @@ msgstr "" msgid "" "The ``version`` argument is a pointer to a value which should be allocated " "by the user together with ``state_array`` and initialized to 0, and then set " -"only by :c:func:`!PyMonitoring_EnterScope` itelf. It allows this function to " -"determine whether event states have changed since the previous call, and to " -"return quickly if they have not." +"only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this function " +"to determine whether event states have changed since the previous call, and " +"to return quickly if they have not." msgstr "" #: ../../c-api/monitoring.rst:154 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index e5bbf105aa..50edef5ce0 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -1293,36 +1293,36 @@ msgstr "" #: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526 #: ../../c-api/typeobj.rst:540 ../../c-api/typeobj.rst:584 -#: ../../c-api/typeobj.rst:627 ../../c-api/typeobj.rst:686 -#: ../../c-api/typeobj.rst:727 ../../c-api/typeobj.rst:744 -#: ../../c-api/typeobj.rst:761 ../../c-api/typeobj.rst:779 -#: ../../c-api/typeobj.rst:803 ../../c-api/typeobj.rst:820 -#: ../../c-api/typeobj.rst:832 ../../c-api/typeobj.rst:844 -#: ../../c-api/typeobj.rst:877 ../../c-api/typeobj.rst:899 -#: ../../c-api/typeobj.rst:919 ../../c-api/typeobj.rst:940 -#: ../../c-api/typeobj.rst:966 ../../c-api/typeobj.rst:985 -#: ../../c-api/typeobj.rst:1001 ../../c-api/typeobj.rst:1040 -#: ../../c-api/typeobj.rst:1051 ../../c-api/typeobj.rst:1061 -#: ../../c-api/typeobj.rst:1071 ../../c-api/typeobj.rst:1085 -#: ../../c-api/typeobj.rst:1103 ../../c-api/typeobj.rst:1126 -#: ../../c-api/typeobj.rst:1144 ../../c-api/typeobj.rst:1157 -#: ../../c-api/typeobj.rst:1179 ../../c-api/typeobj.rst:1223 -#: ../../c-api/typeobj.rst:1244 ../../c-api/typeobj.rst:1263 -#: ../../c-api/typeobj.rst:1293 ../../c-api/typeobj.rst:1315 -#: ../../c-api/typeobj.rst:1341 ../../c-api/typeobj.rst:1426 -#: ../../c-api/typeobj.rst:1500 ../../c-api/typeobj.rst:1561 -#: ../../c-api/typeobj.rst:1597 ../../c-api/typeobj.rst:1622 -#: ../../c-api/typeobj.rst:1645 ../../c-api/typeobj.rst:1658 -#: ../../c-api/typeobj.rst:1673 ../../c-api/typeobj.rst:1687 -#: ../../c-api/typeobj.rst:1717 ../../c-api/typeobj.rst:1749 -#: ../../c-api/typeobj.rst:1775 ../../c-api/typeobj.rst:1793 -#: ../../c-api/typeobj.rst:1822 ../../c-api/typeobj.rst:1866 -#: ../../c-api/typeobj.rst:1883 ../../c-api/typeobj.rst:1924 -#: ../../c-api/typeobj.rst:1946 ../../c-api/typeobj.rst:1978 -#: ../../c-api/typeobj.rst:2006 ../../c-api/typeobj.rst:2019 -#: ../../c-api/typeobj.rst:2029 ../../c-api/typeobj.rst:2046 -#: ../../c-api/typeobj.rst:2063 ../../c-api/typeobj.rst:2077 -#: ../../c-api/typeobj.rst:2123 ../../c-api/typeobj.rst:2146 +#: ../../c-api/typeobj.rst:627 ../../c-api/typeobj.rst:699 +#: ../../c-api/typeobj.rst:740 ../../c-api/typeobj.rst:757 +#: ../../c-api/typeobj.rst:774 ../../c-api/typeobj.rst:792 +#: ../../c-api/typeobj.rst:816 ../../c-api/typeobj.rst:833 +#: ../../c-api/typeobj.rst:845 ../../c-api/typeobj.rst:857 +#: ../../c-api/typeobj.rst:890 ../../c-api/typeobj.rst:912 +#: ../../c-api/typeobj.rst:932 ../../c-api/typeobj.rst:953 +#: ../../c-api/typeobj.rst:979 ../../c-api/typeobj.rst:998 +#: ../../c-api/typeobj.rst:1014 ../../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:1157 ../../c-api/typeobj.rst:1170 +#: ../../c-api/typeobj.rst:1192 ../../c-api/typeobj.rst:1236 +#: ../../c-api/typeobj.rst:1257 ../../c-api/typeobj.rst:1276 +#: ../../c-api/typeobj.rst:1306 ../../c-api/typeobj.rst:1328 +#: ../../c-api/typeobj.rst:1354 ../../c-api/typeobj.rst:1439 +#: ../../c-api/typeobj.rst:1513 ../../c-api/typeobj.rst:1574 +#: ../../c-api/typeobj.rst:1610 ../../c-api/typeobj.rst:1635 +#: ../../c-api/typeobj.rst:1658 ../../c-api/typeobj.rst:1671 +#: ../../c-api/typeobj.rst:1686 ../../c-api/typeobj.rst:1700 +#: ../../c-api/typeobj.rst:1730 ../../c-api/typeobj.rst:1762 +#: ../../c-api/typeobj.rst:1788 ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1835 ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1896 ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1959 ../../c-api/typeobj.rst:1991 +#: ../../c-api/typeobj.rst:2019 ../../c-api/typeobj.rst:2032 +#: ../../c-api/typeobj.rst:2042 ../../c-api/typeobj.rst:2059 +#: ../../c-api/typeobj.rst:2076 ../../c-api/typeobj.rst:2090 +#: ../../c-api/typeobj.rst:2125 ../../c-api/typeobj.rst:2148 msgid "**Inheritance:**" msgstr "" @@ -1355,12 +1355,12 @@ msgid "" "class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:688 -#: ../../c-api/typeobj.rst:805 ../../c-api/typeobj.rst:901 -#: ../../c-api/typeobj.rst:921 ../../c-api/typeobj.rst:1624 -#: ../../c-api/typeobj.rst:1647 ../../c-api/typeobj.rst:1777 -#: ../../c-api/typeobj.rst:1795 ../../c-api/typeobj.rst:1868 -#: ../../c-api/typeobj.rst:1980 ../../c-api/typeobj.rst:2125 +#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:701 +#: ../../c-api/typeobj.rst:818 ../../c-api/typeobj.rst:914 +#: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1637 +#: ../../c-api/typeobj.rst:1660 ../../c-api/typeobj.rst:1790 +#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1881 +#: ../../c-api/typeobj.rst:1993 ../../c-api/typeobj.rst:2127 msgid "This field is inherited by subtypes." msgstr "" @@ -1566,28 +1566,41 @@ msgid "" "}" msgstr "" -#: ../../c-api/typeobj.rst:693 +#: ../../c-api/typeobj.rst:687 +msgid "" +"In a garbage collected Python, :c:member:`!tp_dealloc` may be called from " +"any Python thread, not just the thread which created the object (if the " +"object becomes part of a refcount cycle, that cycle might be collected by a " +"garbage collection on any thread). This is not a problem for Python API " +"calls, since the thread on which :c:member:`!tp_dealloc` is called will own " +"the Global Interpreter Lock (GIL). However, if the object being destroyed " +"in turn destroys objects from some other C or C++ library, care should be " +"taken to ensure that destroying those objects on the thread which called :c:" +"member:`!tp_dealloc` will not violate any assumptions of the library." +msgstr "" + +#: ../../c-api/typeobj.rst:706 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:698 +#: ../../c-api/typeobj.rst:711 msgid "" "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 "" -#: ../../c-api/typeobj.rst:702 +#: ../../c-api/typeobj.rst:715 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:706 +#: ../../c-api/typeobj.rst:719 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1595,13 +1608,13 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:713 +#: ../../c-api/typeobj.rst:726 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:719 +#: ../../c-api/typeobj.rst:732 msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" @@ -1611,7 +1624,7 @@ msgid "" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: ../../c-api/typeobj.rst:729 +#: ../../c-api/typeobj.rst:742 msgid "" "This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " @@ -1619,11 +1632,11 @@ msgid "" "func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: ../../c-api/typeobj.rst:738 +#: ../../c-api/typeobj.rst:751 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:740 +#: ../../c-api/typeobj.rst:753 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1631,7 +1644,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:746 ../../c-api/typeobj.rst:942 +#: ../../c-api/typeobj.rst:759 ../../c-api/typeobj.rst:955 msgid "" "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." "tp_getattro`" @@ -1639,7 +1652,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject." "tp_getattro`" -#: ../../c-api/typeobj.rst:748 +#: ../../c-api/typeobj.rst:761 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1648,12 +1661,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:755 ../../c-api/typeobj.rst:955 +#: ../../c-api/typeobj.rst:768 ../../c-api/typeobj.rst:968 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:757 +#: ../../c-api/typeobj.rst:770 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1661,7 +1674,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:763 ../../c-api/typeobj.rst:968 +#: ../../c-api/typeobj.rst:776 ../../c-api/typeobj.rst:981 msgid "" "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." "tp_setattro`" @@ -1669,7 +1682,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject." "tp_setattro`" -#: ../../c-api/typeobj.rst:765 +#: ../../c-api/typeobj.rst:778 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1678,38 +1691,38 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:772 +#: ../../c-api/typeobj.rst:785 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:776 +#: ../../c-api/typeobj.rst:789 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:781 +#: ../../c-api/typeobj.rst:794 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:789 +#: ../../c-api/typeobj.rst:802 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:792 +#: ../../c-api/typeobj.rst:805 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:794 +#: ../../c-api/typeobj.rst:807 msgid "PyObject *tp_repr(PyObject *self);" msgstr "PyObject *tp_repr(PyObject *self);" -#: ../../c-api/typeobj.rst:796 +#: ../../c-api/typeobj.rst:809 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1718,85 +1731,85 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:807 ../../c-api/typeobj.rst:886 -#: ../../c-api/typeobj.rst:923 ../../c-api/typeobj.rst:948 -#: ../../c-api/typeobj.rst:974 ../../c-api/typeobj.rst:1015 -#: ../../c-api/typeobj.rst:1570 ../../c-api/typeobj.rst:1604 -#: ../../c-api/typeobj.rst:1721 ../../c-api/typeobj.rst:1754 -#: ../../c-api/typeobj.rst:1829 ../../c-api/typeobj.rst:1870 -#: ../../c-api/typeobj.rst:1888 ../../c-api/typeobj.rst:1930 -#: ../../c-api/typeobj.rst:1951 ../../c-api/typeobj.rst:1982 +#: ../../c-api/typeobj.rst:820 ../../c-api/typeobj.rst:899 +#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:961 +#: ../../c-api/typeobj.rst:987 ../../c-api/typeobj.rst:1028 +#: ../../c-api/typeobj.rst:1583 ../../c-api/typeobj.rst:1617 +#: ../../c-api/typeobj.rst:1734 ../../c-api/typeobj.rst:1767 +#: ../../c-api/typeobj.rst:1842 ../../c-api/typeobj.rst:1883 +#: ../../c-api/typeobj.rst:1901 ../../c-api/typeobj.rst:1943 +#: ../../c-api/typeobj.rst:1964 ../../c-api/typeobj.rst:1995 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:809 +#: ../../c-api/typeobj.rst:822 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:816 +#: ../../c-api/typeobj.rst:829 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:822 +#: ../../c-api/typeobj.rst:835 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:828 +#: ../../c-api/typeobj.rst:841 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:834 +#: ../../c-api/typeobj.rst:847 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:840 +#: ../../c-api/typeobj.rst:853 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:846 +#: ../../c-api/typeobj.rst:859 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:854 +#: ../../c-api/typeobj.rst:867 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:857 +#: ../../c-api/typeobj.rst:870 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:859 +#: ../../c-api/typeobj.rst:872 msgid "Py_hash_t tp_hash(PyObject *);" msgstr "Py_hash_t tp_hash(PyObject *);" -#: ../../c-api/typeobj.rst:861 +#: ../../c-api/typeobj.rst:874 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:865 +#: ../../c-api/typeobj.rst:878 msgid "" "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " "is not set), an attempt to take the hash of the object raises :exc:" @@ -1804,7 +1817,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:869 +#: ../../c-api/typeobj.rst:882 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1815,7 +1828,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:879 ../../c-api/typeobj.rst:1563 +#: ../../c-api/typeobj.rst:892 ../../c-api/typeobj.rst:1576 msgid "" "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." "tp_richcompare`" @@ -1823,7 +1836,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject." "tp_richcompare`" -#: ../../c-api/typeobj.rst:881 +#: ../../c-api/typeobj.rst:894 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1832,22 +1845,22 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:888 +#: ../../c-api/typeobj.rst:901 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." msgstr "" -#: ../../c-api/typeobj.rst:893 +#: ../../c-api/typeobj.rst:906 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:897 +#: ../../c-api/typeobj.rst:910 msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" msgstr "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" -#: ../../c-api/typeobj.rst:906 +#: ../../c-api/typeobj.rst:919 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1856,15 +1869,15 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:911 +#: ../../c-api/typeobj.rst:924 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:913 +#: ../../c-api/typeobj.rst:926 msgid "PyObject *tp_str(PyObject *self);" msgstr "PyObject *tp_str(PyObject *self);" -#: ../../c-api/typeobj.rst:915 +#: ../../c-api/typeobj.rst:928 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1872,32 +1885,32 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:925 +#: ../../c-api/typeobj.rst:938 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:931 +#: ../../c-api/typeobj.rst:944 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:933 +#: ../../c-api/typeobj.rst:946 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:935 +#: ../../c-api/typeobj.rst:948 msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" msgstr "PyObject *tp_getattro(PyObject *self, PyObject *attr);" -#: ../../c-api/typeobj.rst:937 +#: ../../c-api/typeobj.rst:950 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:944 +#: ../../c-api/typeobj.rst:957 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1906,19 +1919,19 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:950 +#: ../../c-api/typeobj.rst:963 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:957 +#: ../../c-api/typeobj.rst:970 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:959 +#: ../../c-api/typeobj.rst:972 msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" msgstr "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" -#: ../../c-api/typeobj.rst:961 +#: ../../c-api/typeobj.rst:974 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1926,7 +1939,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:970 +#: ../../c-api/typeobj.rst:983 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1935,24 +1948,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:976 +#: ../../c-api/typeobj.rst:989 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:981 +#: ../../c-api/typeobj.rst:994 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:987 +#: ../../c-api/typeobj.rst:1000 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:993 +#: ../../c-api/typeobj.rst:1006 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1964,7 +1977,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1003 +#: ../../c-api/typeobj.rst:1016 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1980,7 +1993,7 @@ msgid "" "*really* inherited individually?" msgstr "" -#: ../../c-api/typeobj.rst:1017 +#: ../../c-api/typeobj.rst:1030 msgid "" ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." @@ -1988,11 +2001,11 @@ msgstr "" ":c:data:`PyBaseObject_Type` 使用 ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``。" -#: ../../c-api/typeobj.rst:1020 +#: ../../c-api/typeobj.rst:1033 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1024 +#: ../../c-api/typeobj.rst:1037 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." @@ -2001,7 +2014,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1031 +#: ../../c-api/typeobj.rst:1044 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 " @@ -2014,32 +2027,32 @@ msgid "" "reference cycle with their own module object." msgstr "" -#: ../../c-api/typeobj.rst:1042 ../../c-api/typeobj.rst:1053 -#: ../../c-api/typeobj.rst:1063 ../../c-api/typeobj.rst:1073 -#: ../../c-api/typeobj.rst:1105 +#: ../../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 msgid "???" msgstr "???" -#: ../../c-api/typeobj.rst:1047 +#: ../../c-api/typeobj.rst:1060 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:1058 +#: ../../c-api/typeobj.rst:1071 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1068 +#: ../../c-api/typeobj.rst:1081 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1078 +#: ../../c-api/typeobj.rst:1091 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:macro:`PyObject_GC_New` and " @@ -2049,14 +2062,14 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1087 ../../c-api/typeobj.rst:1428 -#: ../../c-api/typeobj.rst:1502 +#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1441 +#: ../../c-api/typeobj.rst:1515 msgid "" "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." "tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1089 +#: ../../c-api/typeobj.rst:1102 msgid "" "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` " @@ -2066,105 +2079,105 @@ msgid "" "values." msgstr "" -#: ../../c-api/typeobj.rst:1099 +#: ../../c-api/typeobj.rst:1112 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: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1110 +#: ../../c-api/typeobj.rst:1123 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1112 +#: ../../c-api/typeobj.rst:1125 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1114 +#: ../../c-api/typeobj.rst:1127 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1117 +#: ../../c-api/typeobj.rst:1130 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1120 +#: ../../c-api/typeobj.rst:1133 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:1128 +#: ../../c-api/typeobj.rst:1141 msgid "" "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:1134 +#: ../../c-api/typeobj.rst:1147 msgid "" "This bit indicates that instances of the class have a `~object.__dict__` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" -#: ../../c-api/typeobj.rst:1137 +#: ../../c-api/typeobj.rst:1150 msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" -#: ../../c-api/typeobj.rst:1139 +#: ../../c-api/typeobj.rst:1152 msgid "" "The type traverse function must call :c:func:`PyObject_VisitManagedDict` and " "its clear function must call :c:func:`PyObject_ClearManagedDict`." msgstr "" -#: ../../c-api/typeobj.rst:1146 +#: ../../c-api/typeobj.rst:1159 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1152 +#: ../../c-api/typeobj.rst:1165 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: ../../c-api/typeobj.rst:1159 +#: ../../c-api/typeobj.rst:1172 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1165 +#: ../../c-api/typeobj.rst:1178 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/typeobj.rst:1168 +#: ../../c-api/typeobj.rst:1181 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" ">tp_basicsize`` (which may be different in each subclass)." msgstr "" -#: ../../c-api/typeobj.rst:1173 +#: ../../c-api/typeobj.rst:1186 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: ../../c-api/typeobj.rst:1181 +#: ../../c-api/typeobj.rst:1194 msgid "This flag is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1195 +#: ../../c-api/typeobj.rst:1208 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 " @@ -2174,90 +2187,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1206 +#: ../../c-api/typeobj.rst:1219 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1211 +#: ../../c-api/typeobj.rst:1224 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:1219 +#: ../../c-api/typeobj.rst:1232 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:1225 +#: ../../c-api/typeobj.rst:1238 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1232 +#: ../../c-api/typeobj.rst:1245 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: ../../c-api/typeobj.rst:1235 +#: ../../c-api/typeobj.rst:1248 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1239 +#: ../../c-api/typeobj.rst:1252 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1241 +#: ../../c-api/typeobj.rst:1254 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1246 +#: ../../c-api/typeobj.rst:1259 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1265 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:1256 +#: ../../c-api/typeobj.rst:1269 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:1259 +#: ../../c-api/typeobj.rst:1272 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:1265 +#: ../../c-api/typeobj.rst:1278 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:1272 +#: ../../c-api/typeobj.rst:1285 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:1283 +#: ../../c-api/typeobj.rst:1296 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 " @@ -2265,23 +2278,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1290 ../../c-api/typeobj.rst:1312 +#: ../../c-api/typeobj.rst:1303 ../../c-api/typeobj.rst:1325 msgid "" ":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:1295 +#: ../../c-api/typeobj.rst:1308 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1298 ../../c-api/typeobj.rst:1320 +#: ../../c-api/typeobj.rst:1311 ../../c-api/typeobj.rst:1333 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1305 +#: ../../c-api/typeobj.rst:1318 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 " @@ -2289,53 +2302,53 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1317 +#: ../../c-api/typeobj.rst:1330 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1327 +#: ../../c-api/typeobj.rst:1340 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: ../../c-api/typeobj.rst:1331 +#: ../../c-api/typeobj.rst:1344 msgid "" "This flag is present in header files, but is not be used. It will be removed " "in a future version of CPython" msgstr "" -#: ../../c-api/typeobj.rst:1337 +#: ../../c-api/typeobj.rst:1350 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`~type.__doc__` attribute on " "the type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1343 +#: ../../c-api/typeobj.rst:1356 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1348 +#: ../../c-api/typeobj.rst:1361 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1351 +#: ../../c-api/typeobj.rst:1364 msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" msgstr "int tp_traverse(PyObject *self, visitproc visit, void *arg);" -#: ../../c-api/typeobj.rst:1353 ../../c-api/typeobj.rst:1497 +#: ../../c-api/typeobj.rst:1366 ../../c-api/typeobj.rst:1510 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1356 +#: ../../c-api/typeobj.rst:1369 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2345,7 +2358,7 @@ msgid "" "`!_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1362 +#: ../../c-api/typeobj.rst:1375 msgid "" "static int\n" "local_traverse(localobject *self, visitproc visit, void *arg)\n" @@ -2365,7 +2378,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/typeobj.rst:1371 +#: ../../c-api/typeobj.rst:1384 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`` " @@ -2373,48 +2386,48 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1375 +#: ../../c-api/typeobj.rst:1388 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:1379 +#: ../../c-api/typeobj.rst:1392 msgid "" "Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" msgstr "" -#: ../../c-api/typeobj.rst:1381 +#: ../../c-api/typeobj.rst:1394 msgid "Py_VISIT(Py_TYPE(self));" msgstr "" -#: ../../c-api/typeobj.rst:1383 +#: ../../c-api/typeobj.rst:1396 msgid "" "It is only needed since Python 3.9. To support Python 3.8 and older, this " "line must be conditional::" msgstr "" -#: ../../c-api/typeobj.rst:1386 +#: ../../c-api/typeobj.rst:1399 msgid "" "#if PY_VERSION_HEX >= 0x03090000\n" " Py_VISIT(Py_TYPE(self));\n" "#endif" msgstr "" -#: ../../c-api/typeobj.rst:1390 +#: ../../c-api/typeobj.rst:1403 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" "`PyObject_VisitManagedDict` like this::" msgstr "" -#: ../../c-api/typeobj.rst:1394 +#: ../../c-api/typeobj.rst:1407 #, fuzzy msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" msgstr "PyObject *tp_iternext(PyObject *self);" -#: ../../c-api/typeobj.rst:1397 +#: ../../c-api/typeobj.rst:1410 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:" @@ -2443,14 +2456,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1421 +#: ../../c-api/typeobj.rst:1434 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:1430 +#: ../../c-api/typeobj.rst:1443 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2458,18 +2471,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1451 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1441 +#: ../../c-api/typeobj.rst:1454 msgid "int tp_clear(PyObject *);" msgstr "int tp_clear(PyObject *);" -#: ../../c-api/typeobj.rst:1443 +#: ../../c-api/typeobj.rst:1456 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2484,7 +2497,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1466 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2492,7 +2505,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1470 msgid "" "static int\n" "local_clear(localobject *self)\n" @@ -2514,7 +2527,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/typeobj.rst:1467 +#: ../../c-api/typeobj.rst:1480 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be released (via :" @@ -2529,19 +2542,19 @@ msgid "" "performs the operations in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1479 +#: ../../c-api/typeobj.rst:1492 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" "`PyObject_ClearManagedDict` like this::" msgstr "" -#: ../../c-api/typeobj.rst:1483 +#: ../../c-api/typeobj.rst:1496 #, fuzzy msgid "PyObject_ClearManagedDict((PyObject*)self);" msgstr "PyObject *am_anext(PyObject *self);" -#: ../../c-api/typeobj.rst:1485 +#: ../../c-api/typeobj.rst:1498 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2549,7 +2562,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1504 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 " @@ -2559,7 +2572,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1504 +#: ../../c-api/typeobj.rst:1517 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" @@ -2567,22 +2580,22 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1512 +#: ../../c-api/typeobj.rst:1525 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1514 +#: ../../c-api/typeobj.rst:1527 msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" msgstr "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" -#: ../../c-api/typeobj.rst:1516 +#: ../../c-api/typeobj.rst:1529 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:1519 +#: ../../c-api/typeobj.rst:1532 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2590,50 +2603,50 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1524 +#: ../../c-api/typeobj.rst:1537 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:1530 +#: ../../c-api/typeobj.rst:1543 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1530 +#: ../../c-api/typeobj.rst:1543 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1532 +#: ../../c-api/typeobj.rst:1545 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1534 +#: ../../c-api/typeobj.rst:1547 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1549 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1538 +#: ../../c-api/typeobj.rst:1551 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1553 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1542 +#: ../../c-api/typeobj.rst:1555 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1545 +#: ../../c-api/typeobj.rst:1558 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1549 +#: ../../c-api/typeobj.rst:1562 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 " @@ -2641,15 +2654,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1555 +#: ../../c-api/typeobj.rst:1568 msgid "The returned value is a new :term:`strong reference`." msgstr "" -#: ../../c-api/typeobj.rst:1557 +#: ../../c-api/typeobj.rst:1570 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1565 +#: ../../c-api/typeobj.rst:1578 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2657,7 +2670,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1572 +#: ../../c-api/typeobj.rst:1585 msgid "" ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." "tp_richcompare` implementation, which may be inherited. However, if only :c:" @@ -2666,13 +2679,13 @@ msgid "" "comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1581 +#: ../../c-api/typeobj.rst:1594 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1584 +#: ../../c-api/typeobj.rst:1597 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 " @@ -2682,19 +2695,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1591 +#: ../../c-api/typeobj.rst:1604 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:1594 +#: ../../c-api/typeobj.rst:1607 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1599 +#: ../../c-api/typeobj.rst:1612 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 " @@ -2703,7 +2716,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1606 +#: ../../c-api/typeobj.rst:1619 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." @@ -2711,32 +2724,32 @@ msgid "" "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1614 +#: ../../c-api/typeobj.rst:1627 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:1618 +#: ../../c-api/typeobj.rst:1631 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1620 +#: ../../c-api/typeobj.rst:1633 msgid "PyObject *tp_iter(PyObject *self);" msgstr "PyObject *tp_iter(PyObject *self);" -#: ../../c-api/typeobj.rst:1629 +#: ../../c-api/typeobj.rst:1642 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1632 +#: ../../c-api/typeobj.rst:1645 msgid "PyObject *tp_iternext(PyObject *self);" msgstr "PyObject *tp_iternext(PyObject *self);" -#: ../../c-api/typeobj.rst:1634 +#: ../../c-api/typeobj.rst:1647 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2744,74 +2757,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1639 +#: ../../c-api/typeobj.rst:1652 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:1643 +#: ../../c-api/typeobj.rst:1656 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1652 +#: ../../c-api/typeobj.rst:1665 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:1655 +#: ../../c-api/typeobj.rst:1668 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:1660 +#: ../../c-api/typeobj.rst:1673 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1679 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:1670 +#: ../../c-api/typeobj.rst:1683 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:1675 +#: ../../c-api/typeobj.rst:1688 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1681 +#: ../../c-api/typeobj.rst:1694 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:1684 +#: ../../c-api/typeobj.rst:1697 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:1689 +#: ../../c-api/typeobj.rst:1702 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1695 +#: ../../c-api/typeobj.rst:1708 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2819,7 +2832,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1703 +#: ../../c-api/typeobj.rst:1716 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2827,7 +2840,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1721 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "data:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2835,27 +2848,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1714 +#: ../../c-api/typeobj.rst:1727 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1719 +#: ../../c-api/typeobj.rst:1732 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1723 +#: ../../c-api/typeobj.rst:1736 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1729 +#: ../../c-api/typeobj.rst:1742 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1731 +#: ../../c-api/typeobj.rst:1744 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2866,73 +2879,73 @@ msgid "" "be treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:1739 +#: ../../c-api/typeobj.rst:1752 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1758 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1751 +#: ../../c-api/typeobj.rst:1764 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:1756 +#: ../../c-api/typeobj.rst:1769 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1761 +#: ../../c-api/typeobj.rst:1774 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:1767 +#: ../../c-api/typeobj.rst:1780 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1769 ../../c-api/typeobj.rst:1785 -#: ../../c-api/typeobj.rst:1849 ../../c-api/typeobj.rst:1879 -#: ../../c-api/typeobj.rst:1903 +#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1862 ../../c-api/typeobj.rst:1892 +#: ../../c-api/typeobj.rst:1916 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1771 +#: ../../c-api/typeobj.rst:1784 msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" msgstr "" "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" -#: ../../c-api/typeobj.rst:1782 +#: ../../c-api/typeobj.rst:1795 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1800 msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" msgstr "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" -#: ../../c-api/typeobj.rst:1789 +#: ../../c-api/typeobj.rst:1802 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1813 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1803 +#: ../../c-api/typeobj.rst:1816 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 " @@ -2940,19 +2953,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1808 +#: ../../c-api/typeobj.rst:1821 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:1811 +#: ../../c-api/typeobj.rst:1824 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1826 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2961,13 +2974,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1819 +#: ../../c-api/typeobj.rst:1832 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1824 +#: ../../c-api/typeobj.rst:1837 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -2975,25 +2988,25 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1831 +#: ../../c-api/typeobj.rst:1844 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`~object.__dict__` gets created for " "instances." msgstr "" -#: ../../c-api/typeobj.rst:1834 +#: ../../c-api/typeobj.rst:1847 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1855 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1844 +#: ../../c-api/typeobj.rst:1857 msgid "" "This function corresponds to the :meth:`~object.__init__` method of " "classes. Like :meth:`!__init__`, it is possible to create an instance " @@ -3001,18 +3014,18 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1851 +#: ../../c-api/typeobj.rst:1864 msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" msgstr "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" -#: ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1866 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:" "`~object.__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1857 +#: ../../c-api/typeobj.rst:1870 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 :" @@ -3024,53 +3037,53 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1864 +#: ../../c-api/typeobj.rst:1877 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1872 +#: ../../c-api/typeobj.rst:1885 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1890 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1881 +#: ../../c-api/typeobj.rst:1894 msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" msgstr "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" -#: ../../c-api/typeobj.rst:1885 +#: ../../c-api/typeobj.rst:1898 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1890 +#: ../../c-api/typeobj.rst:1903 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:1894 +#: ../../c-api/typeobj.rst:1907 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1901 +#: ../../c-api/typeobj.rst:1914 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1905 +#: ../../c-api/typeobj.rst:1918 msgid "" "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" msgstr "" "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" -#: ../../c-api/typeobj.rst:1907 +#: ../../c-api/typeobj.rst:1920 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 " @@ -3079,7 +3092,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1913 +#: ../../c-api/typeobj.rst:1926 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -3091,20 +3104,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1934 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1926 +#: ../../c-api/typeobj.rst:1939 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:1932 +#: ../../c-api/typeobj.rst:1945 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 " @@ -3112,44 +3125,44 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1953 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1955 msgid "void tp_free(void *self);" msgstr "void tp_free(void *self);" -#: ../../c-api/typeobj.rst:1944 +#: ../../c-api/typeobj.rst:1957 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1948 +#: ../../c-api/typeobj.rst:1961 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1953 +#: ../../c-api/typeobj.rst:1966 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1957 +#: ../../c-api/typeobj.rst:1970 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/typeobj.rst:1962 +#: ../../c-api/typeobj.rst:1975 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1964 +#: ../../c-api/typeobj.rst:1977 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 " @@ -3161,93 +3174,93 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1972 +#: ../../c-api/typeobj.rst:1985 msgid "int tp_is_gc(PyObject *self);" msgstr "int tp_is_gc(PyObject *self);" -#: ../../c-api/typeobj.rst:1974 +#: ../../c-api/typeobj.rst:1987 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:1984 +#: ../../c-api/typeobj.rst:1997 msgid "" "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:1990 +#: ../../c-api/typeobj.rst:2003 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1992 ../../c-api/typeobj.rst:2016 +#: ../../c-api/typeobj.rst:2005 ../../c-api/typeobj.rst:2029 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:1995 +#: ../../c-api/typeobj.rst:2008 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:2002 +#: ../../c-api/typeobj.rst:2015 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:2008 ../../c-api/typeobj.rst:2031 -#: ../../c-api/typeobj.rst:2048 ../../c-api/typeobj.rst:2065 -#: ../../c-api/typeobj.rst:2079 +#: ../../c-api/typeobj.rst:2021 ../../c-api/typeobj.rst:2044 +#: ../../c-api/typeobj.rst:2061 ../../c-api/typeobj.rst:2078 +#: ../../c-api/typeobj.rst:2092 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:2013 +#: ../../c-api/typeobj.rst:2026 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:2021 +#: ../../c-api/typeobj.rst:2034 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2027 +#: ../../c-api/typeobj.rst:2040 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2036 +#: ../../c-api/typeobj.rst:2049 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2038 +#: ../../c-api/typeobj.rst:2051 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2043 +#: ../../c-api/typeobj.rst:2056 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2053 +#: ../../c-api/typeobj.rst:2066 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2058 +#: ../../c-api/typeobj.rst:2071 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -3255,25 +3268,25 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2070 +#: ../../c-api/typeobj.rst:2083 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:2075 +#: ../../c-api/typeobj.rst:2088 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2084 +#: ../../c-api/typeobj.rst:2097 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2086 +#: ../../c-api/typeobj.rst:2099 msgid "void tp_finalize(PyObject *self);" msgstr "void tp_finalize(PyObject *self);" -#: ../../c-api/typeobj.rst:2088 +#: ../../c-api/typeobj.rst:2101 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 " @@ -3283,14 +3296,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2095 +#: ../../c-api/typeobj.rst:2108 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:2098 +#: ../../c-api/typeobj.rst:2111 msgid "" "static void\n" "local_finalize(PyObject *self)\n" @@ -3307,31 +3320,18 @@ msgid "" "}" msgstr "" -#: ../../c-api/typeobj.rst:2112 -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 " -"created the object (if the object becomes part of a refcount cycle, that " -"cycle might be collected by a garbage collection on any thread). This is " -"not a problem for Python API calls, since the thread on which tp_dealloc is " -"called will own the Global Interpreter Lock (GIL). However, if the object " -"being destroyed in turn destroys objects from some other C or C++ library, " -"care should be taken to ensure that destroying those objects on the thread " -"which called tp_dealloc will not violate any assumptions of the library." -msgstr "" - -#: ../../c-api/typeobj.rst:2131 +#: ../../c-api/typeobj.rst:2133 msgid "" "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:2135 +#: ../../c-api/typeobj.rst:2137 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2140 +#: ../../c-api/typeobj.rst:2142 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -3339,65 +3339,65 @@ msgid "" "meth:`~object.__new__` and :meth:`~object.__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2148 +#: ../../c-api/typeobj.rst:2150 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2150 +#: ../../c-api/typeobj.rst:2152 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2155 +#: ../../c-api/typeobj.rst:2157 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2163 +#: ../../c-api/typeobj.rst:2165 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2165 +#: ../../c-api/typeobj.rst:2167 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:2169 +#: ../../c-api/typeobj.rst:2171 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2171 +#: ../../c-api/typeobj.rst:2173 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2173 +#: ../../c-api/typeobj.rst:2175 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:2175 +#: ../../c-api/typeobj.rst:2177 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2179 +#: ../../c-api/typeobj.rst:2181 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:2187 +#: ../../c-api/typeobj.rst:2189 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2189 +#: ../../c-api/typeobj.rst:2191 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3405,29 +3405,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2194 +#: ../../c-api/typeobj.rst:2196 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2202 +#: ../../c-api/typeobj.rst:2204 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2209 +#: ../../c-api/typeobj.rst:2211 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:2215 ../../c-api/typeobj.rst:2539 +#: ../../c-api/typeobj.rst:2217 ../../c-api/typeobj.rst:2541 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2217 +#: ../../c-api/typeobj.rst:2219 msgid "" "typedef struct {\n" " binaryfunc nb_add;\n" @@ -3515,7 +3515,7 @@ msgstr "" " binaryfunc nb_inplace_matrix_multiply;\n" "} PyNumberMethods;" -#: ../../c-api/typeobj.rst:2262 +#: ../../c-api/typeobj.rst:2264 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 " @@ -3525,31 +3525,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2271 +#: ../../c-api/typeobj.rst:2273 msgid "" "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:2316 +#: ../../c-api/typeobj.rst:2318 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2323 +#: ../../c-api/typeobj.rst:2325 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:2328 +#: ../../c-api/typeobj.rst:2330 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:2334 +#: ../../c-api/typeobj.rst:2336 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3557,7 +3557,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2342 +#: ../../c-api/typeobj.rst:2344 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" @@ -3567,17 +3567,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2353 +#: ../../c-api/typeobj.rst:2355 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2360 +#: ../../c-api/typeobj.rst:2362 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2367 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 " @@ -3585,21 +3585,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2372 +#: ../../c-api/typeobj.rst:2374 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:2378 +#: ../../c-api/typeobj.rst:2380 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:2384 +#: ../../c-api/typeobj.rst:2386 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 " @@ -3608,7 +3608,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2390 +#: ../../c-api/typeobj.rst:2392 msgid "" "Negative indexes are handled as follows: if the :c:member:" "`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " @@ -3617,7 +3617,7 @@ msgid "" "index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2397 +#: ../../c-api/typeobj.rst:2399 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:" @@ -3626,14 +3626,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2406 +#: ../../c-api/typeobj.rst:2408 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:2413 +#: ../../c-api/typeobj.rst:2415 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 " @@ -3643,7 +3643,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2422 +#: ../../c-api/typeobj.rst:2424 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 " @@ -3653,76 +3653,76 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2433 +#: ../../c-api/typeobj.rst:2435 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2441 +#: ../../c-api/typeobj.rst:2443 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:2447 ../../c-api/typeobj.rst:2496 -#: ../../c-api/typeobj.rst:2550 ../../c-api/typeobj.rst:2561 -#: ../../c-api/typeobj.rst:2573 ../../c-api/typeobj.rst:2583 +#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2552 ../../c-api/typeobj.rst:2563 +#: ../../c-api/typeobj.rst:2575 ../../c-api/typeobj.rst:2585 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2451 msgid "int (PyObject *exporter, Py_buffer *view, int flags);" msgstr "int (PyObject *exporter, Py_buffer *view, int flags);" -#: ../../c-api/typeobj.rst:2451 +#: ../../c-api/typeobj.rst:2453 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:2455 +#: ../../c-api/typeobj.rst:2457 msgid "" "Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" "expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2458 +#: ../../c-api/typeobj.rst:2460 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2460 +#: ../../c-api/typeobj.rst:2462 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2462 +#: ../../c-api/typeobj.rst:2464 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2464 +#: ../../c-api/typeobj.rst:2466 msgid "Return ``0``." msgstr "回傳 ``0``。" -#: ../../c-api/typeobj.rst:2466 +#: ../../c-api/typeobj.rst:2468 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2469 +#: ../../c-api/typeobj.rst:2471 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:2472 +#: ../../c-api/typeobj.rst:2474 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:2476 +#: ../../c-api/typeobj.rst:2478 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3730,7 +3730,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2481 +#: ../../c-api/typeobj.rst:2483 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:" @@ -3739,23 +3739,23 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2488 +#: ../../c-api/typeobj.rst:2490 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:2491 +#: ../../c-api/typeobj.rst:2493 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2500 msgid "void (PyObject *exporter, Py_buffer *view);" msgstr "void (PyObject *exporter, Py_buffer *view);" -#: ../../c-api/typeobj.rst:2500 +#: ../../c-api/typeobj.rst:2502 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 " @@ -3763,15 +3763,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2505 +#: ../../c-api/typeobj.rst:2507 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2507 +#: ../../c-api/typeobj.rst:2509 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2509 +#: ../../c-api/typeobj.rst:2511 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 " @@ -3779,30 +3779,30 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2515 +#: ../../c-api/typeobj.rst:2517 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:2520 +#: ../../c-api/typeobj.rst:2522 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2528 +#: ../../c-api/typeobj.rst:2530 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2536 +#: ../../c-api/typeobj.rst:2538 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2541 +#: ../../c-api/typeobj.rst:2543 msgid "" "typedef struct {\n" " unaryfunc am_await;\n" @@ -3818,62 +3818,62 @@ msgstr "" " sendfunc am_send;\n" "} PyAsyncMethods;" -#: ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2554 msgid "PyObject *am_await(PyObject *self);" msgstr "" -#: ../../c-api/typeobj.rst:2554 +#: ../../c-api/typeobj.rst:2556 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:2557 +#: ../../c-api/typeobj.rst:2559 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2563 +#: ../../c-api/typeobj.rst:2565 msgid "PyObject *am_aiter(PyObject *self);" msgstr "PyObject *am_aiter(PyObject *self);" -#: ../../c-api/typeobj.rst:2565 +#: ../../c-api/typeobj.rst:2567 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." "__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2568 +#: ../../c-api/typeobj.rst:2570 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2575 +#: ../../c-api/typeobj.rst:2577 msgid "PyObject *am_anext(PyObject *self);" msgstr "PyObject *am_anext(PyObject *self);" -#: ../../c-api/typeobj.rst:2577 +#: ../../c-api/typeobj.rst:2579 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2585 +#: ../../c-api/typeobj.rst:2587 msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" msgstr "" "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" -#: ../../c-api/typeobj.rst:2587 +#: ../../c-api/typeobj.rst:2589 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2596 +#: ../../c-api/typeobj.rst:2598 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2600 +#: ../../c-api/typeobj.rst:2602 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 " @@ -3887,80 +3887,80 @@ msgid "" "length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2610 +#: ../../c-api/typeobj.rst:2612 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:2617 +#: ../../c-api/typeobj.rst:2619 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2621 +#: ../../c-api/typeobj.rst:2623 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2625 +#: ../../c-api/typeobj.rst:2627 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2629 +#: ../../c-api/typeobj.rst:2631 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2633 ../../c-api/typeobj.rst:2642 +#: ../../c-api/typeobj.rst:2635 ../../c-api/typeobj.rst:2644 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2637 ../../c-api/typeobj.rst:2648 +#: ../../c-api/typeobj.rst:2639 ../../c-api/typeobj.rst:2650 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:2644 +#: ../../c-api/typeobj.rst:2646 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2651 +#: ../../c-api/typeobj.rst:2653 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2655 +#: ../../c-api/typeobj.rst:2657 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2659 +#: ../../c-api/typeobj.rst:2661 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2663 +#: ../../c-api/typeobj.rst:2665 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2667 +#: ../../c-api/typeobj.rst:2669 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2671 +#: ../../c-api/typeobj.rst:2673 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2675 +#: ../../c-api/typeobj.rst:2677 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2689 +#: ../../c-api/typeobj.rst:2691 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2705 +#: ../../c-api/typeobj.rst:2707 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2707 +#: ../../c-api/typeobj.rst:2709 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3968,11 +3968,11 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2712 +#: ../../c-api/typeobj.rst:2714 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2714 +#: ../../c-api/typeobj.rst:2716 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -3990,13 +3990,13 @@ msgid "" "};" msgstr "" -#: ../../c-api/typeobj.rst:2729 +#: ../../c-api/typeobj.rst:2731 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2732 +#: ../../c-api/typeobj.rst:2734 msgid "" "static PyTypeObject MyObject_Type = {\n" " PyVarObject_HEAD_INIT(NULL, 0)\n" @@ -4080,11 +4080,11 @@ msgstr "" " myobj_new, /* tp_new */\n" "};" -#: ../../c-api/typeobj.rst:2773 +#: ../../c-api/typeobj.rst:2775 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2775 +#: ../../c-api/typeobj.rst:2777 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -4110,14 +4110,14 @@ msgid "" "};" msgstr "" -#: ../../c-api/typeobj.rst:2798 +#: ../../c-api/typeobj.rst:2800 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2802 +#: ../../c-api/typeobj.rst:2804 msgid "" "typedef struct {\n" " PyUnicodeObject raw;\n" @@ -4135,12 +4135,12 @@ msgid "" "};" msgstr "" -#: ../../c-api/typeobj.rst:2817 +#: ../../c-api/typeobj.rst:2819 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2819 +#: ../../c-api/typeobj.rst:2821 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -4160,13 +4160,13 @@ msgstr "" " .tp_name = \"mymod.MyObject\",\n" "};" -#: ../../c-api/typeobj.rst:2828 +#: ../../c-api/typeobj.rst:2830 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: ../../c-api/typeobj.rst:2830 +#: ../../c-api/typeobj.rst:2832 msgid "" "typedef struct {\n" " PyObject_VAR_HEAD\n" @@ -4192,14 +4192,14 @@ msgstr "" " .tp_itemsize = sizeof(char *),\n" "};" -#: ../../c-api/typeobj.rst:787 ../../c-api/typeobj.rst:852 +#: ../../c-api/typeobj.rst:800 ../../c-api/typeobj.rst:865 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/typeobj.rst:787 +#: ../../c-api/typeobj.rst:800 msgid "repr" msgstr "repr" -#: ../../c-api/typeobj.rst:852 +#: ../../c-api/typeobj.rst:865 msgid "hash" msgstr "hash(雜湊)" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index 96e1201729..c4eb16475f 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -62,7 +62,9 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 #, fuzzy -msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 @@ -72,7 +74,9 @@ msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 #, fuzzy -msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 diff --git a/deprecations/index.po b/deprecations/index.po index ddad8933c8..83473bac72 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1189,7 +1189,9 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 #, fuzzy -msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 @@ -1199,7 +1201,9 @@ msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 #, fuzzy -msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 diff --git a/library/argparse.po b/library/argparse.po index d125e78f04..bd169b42cb 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+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-" @@ -1184,11 +1184,36 @@ msgstr "" #: ../../library/argparse.rst:695 msgid "" +"``'extend'`` - This stores a list and appends each item from the multi-value " +"argument list to it. The ``'extend'`` action is typically used with the " +"nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is " +"``None`` (the default) or ``'?'``, each character of the argument string " +"will be appended to the list. Example usage::" +msgstr "" + +#: ../../library/argparse.rst:703 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " +"type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " +"\"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" +msgstr "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " +"type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " +"\"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" + +#: ../../library/argparse.rst:710 +msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:698 +#: ../../library/argparse.rst:713 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1196,11 +1221,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: ../../library/argparse.rst:703 +#: ../../library/argparse.rst:718 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:705 +#: ../../library/argparse.rst:720 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1208,14 +1233,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:710 +#: ../../library/argparse.rst:725 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:714 +#: ../../library/argparse.rst:729 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1231,35 +1256,13 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:720 -msgid "" -"``'extend'`` - This stores a list, and extends each argument value to the " -"list. Example usage::" -msgstr "" - -#: ../../library/argparse.rst:724 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " -"type=str)\n" -">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " -"\"f4\"])\n" -"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -msgstr "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " -"type=str)\n" -">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " -"\"f4\"])\n" -"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" - -#: ../../library/argparse.rst:731 +#: ../../library/argparse.rst:735 msgid "" "Only actions that consume command-line arguments (e.g. ``'store'``, " "``'append'`` or ``'extend'``) can be used with positional arguments." msgstr "" -#: ../../library/argparse.rst:734 +#: ../../library/argparse.rst:738 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " "other object that implements the same interface. The " @@ -1267,7 +1270,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:739 +#: ../../library/argparse.rst:743 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1281,18 +1284,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:747 +#: ../../library/argparse.rst:751 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:751 +#: ../../library/argparse.rst:755 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:753 +#: ../../library/argparse.rst:757 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1313,15 +1316,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:771 +#: ../../library/argparse.rst:775 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:781 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:779 +#: ../../library/argparse.rst:783 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " @@ -1329,13 +1332,13 @@ msgid "" "ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" -#: ../../library/argparse.rst:784 +#: ../../library/argparse.rst:788 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:787 +#: ../../library/argparse.rst:791 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1349,13 +1352,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:793 +#: ../../library/argparse.rst:797 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:798 +#: ../../library/argparse.rst:802 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1365,7 +1368,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:805 +#: ../../library/argparse.rst:809 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1387,13 +1390,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:815 +#: ../../library/argparse.rst:819 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:818 +#: ../../library/argparse.rst:822 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1419,7 +1422,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:832 +#: ../../library/argparse.rst:836 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1427,7 +1430,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:841 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1443,14 +1446,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:846 +#: ../../library/argparse.rst:850 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:854 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1468,7 +1471,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:858 +#: ../../library/argparse.rst:862 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1477,11 +1480,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:868 +#: ../../library/argparse.rst:872 msgid "const" msgstr "" -#: ../../library/argparse.rst:870 +#: ../../library/argparse.rst:874 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1489,7 +1492,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:874 +#: ../../library/argparse.rst:878 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1499,7 +1502,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:882 +#: ../../library/argparse.rst:886 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1509,17 +1512,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:889 +#: ../../library/argparse.rst:893 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:896 +#: ../../library/argparse.rst:900 msgid "default" msgstr "" -#: ../../library/argparse.rst:898 +#: ../../library/argparse.rst:902 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1529,7 +1532,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:905 +#: ../../library/argparse.rst:909 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1545,13 +1548,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:912 +#: ../../library/argparse.rst:916 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:915 +#: ../../library/argparse.rst:919 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1563,7 +1566,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:920 +#: ../../library/argparse.rst:924 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1571,7 +1574,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:925 +#: ../../library/argparse.rst:929 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1585,13 +1588,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:931 +#: ../../library/argparse.rst:935 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:934 +#: ../../library/argparse.rst:938 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1607,20 +1610,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:941 +#: ../../library/argparse.rst:945 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:945 +#: ../../library/argparse.rst:949 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:948 +#: ../../library/argparse.rst:952 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1636,11 +1639,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:959 +#: ../../library/argparse.rst:963 msgid "type" msgstr "" -#: ../../library/argparse.rst:961 +#: ../../library/argparse.rst:965 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1649,13 +1652,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:971 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:970 +#: ../../library/argparse.rst:974 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -1663,11 +1666,11 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:975 +#: ../../library/argparse.rst:979 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:977 +#: ../../library/argparse.rst:981 #, fuzzy msgid "" "import argparse\n" @@ -1695,11 +1698,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:990 +#: ../../library/argparse.rst:994 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:992 +#: ../../library/argparse.rst:996 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1717,14 +1720,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1002 +#: ../../library/argparse.rst:1006 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1006 +#: ../../library/argparse.rst:1010 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1732,7 +1735,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1011 +#: ../../library/argparse.rst:1015 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." @@ -1740,7 +1743,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1016 +#: ../../library/argparse.rst:1020 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1750,17 +1753,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1023 +#: ../../library/argparse.rst:1027 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1030 +#: ../../library/argparse.rst:1034 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1032 +#: ../../library/argparse.rst:1036 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1769,7 +1772,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1038 +#: ../../library/argparse.rst:1042 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1789,26 +1792,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1047 +#: ../../library/argparse.rst:1051 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1051 +#: ../../library/argparse.rst:1055 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1054 +#: ../../library/argparse.rst:1058 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1057 +#: ../../library/argparse.rst:1061 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1816,11 +1819,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1066 +#: ../../library/argparse.rst:1070 msgid "required" msgstr "" -#: ../../library/argparse.rst:1068 +#: ../../library/argparse.rst:1072 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1828,7 +1831,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1073 +#: ../../library/argparse.rst:1077 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1846,24 +1849,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1081 +#: ../../library/argparse.rst:1085 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1087 +#: ../../library/argparse.rst:1091 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1094 +#: ../../library/argparse.rst:1098 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1096 +#: ../../library/argparse.rst:1100 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1871,7 +1874,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1101 +#: ../../library/argparse.rst:1105 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1880,7 +1883,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1106 +#: ../../library/argparse.rst:1110 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1906,19 +1909,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1118 +#: ../../library/argparse.rst:1122 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1121 +#: ../../library/argparse.rst:1125 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1124 +#: ../../library/argparse.rst:1128 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1936,11 +1939,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1136 +#: ../../library/argparse.rst:1140 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1138 +#: ../../library/argparse.rst:1142 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -1952,7 +1955,7 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1147 +#: ../../library/argparse.rst:1151 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1984,11 +1987,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1162 +#: ../../library/argparse.rst:1166 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1164 +#: ../../library/argparse.rst:1168 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2020,21 +2023,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1179 +#: ../../library/argparse.rst:1183 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1183 +#: ../../library/argparse.rst:1187 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1187 +#: ../../library/argparse.rst:1191 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2058,11 +2061,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1202 +#: ../../library/argparse.rst:1206 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1204 +#: ../../library/argparse.rst:1208 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2072,7 +2075,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1211 +#: ../../library/argparse.rst:1215 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2084,7 +2087,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1216 +#: ../../library/argparse.rst:1220 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2096,7 +2099,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1225 +#: ../../library/argparse.rst:1229 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2114,11 +2117,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1233 +#: ../../library/argparse.rst:1237 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1235 +#: ../../library/argparse.rst:1239 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2130,11 +2133,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1244 +#: ../../library/argparse.rst:1248 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1246 +#: ../../library/argparse.rst:1250 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2145,7 +2148,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1256 +#: ../../library/argparse.rst:1260 #, fuzzy msgid "" ">>> import argparse\n" @@ -2164,11 +2167,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1269 +#: ../../library/argparse.rst:1273 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1271 +#: ../../library/argparse.rst:1275 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " @@ -2176,7 +2179,7 @@ msgid "" "add_argument`." msgstr "" -#: ../../library/argparse.rst:1280 +#: ../../library/argparse.rst:1284 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -2185,7 +2188,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1286 +#: ../../library/argparse.rst:1290 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -2193,102 +2196,102 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1291 +#: ../../library/argparse.rst:1295 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1294 +#: ../../library/argparse.rst:1298 msgid "*parser* - The ArgumentParser object which contains this action." msgstr "" -#: ../../library/argparse.rst:1296 +#: ../../library/argparse.rst:1300 msgid "*namespace* - The :class:`Namespace` object that will be returned by" msgstr "" -#: ../../library/argparse.rst:1297 +#: ../../library/argparse.rst:1301 msgid "" ":meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this " "object using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1304 msgid "" "*values* - The associated command-line arguments, with any type conversions" msgstr "" -#: ../../library/argparse.rst:1301 +#: ../../library/argparse.rst:1305 msgid "" "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1304 +#: ../../library/argparse.rst:1308 msgid "" "*option_string* - The option string that was used to invoke this action." msgstr "" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1309 msgid "" "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1308 +#: ../../library/argparse.rst:1312 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1311 +#: ../../library/argparse.rst:1315 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1317 +#: ../../library/argparse.rst:1321 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1321 +#: ../../library/argparse.rst:1325 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1324 +#: ../../library/argparse.rst:1328 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1332 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1331 +#: ../../library/argparse.rst:1335 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1336 +#: ../../library/argparse.rst:1340 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1338 +#: ../../library/argparse.rst:1342 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1346 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2306,14 +2309,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1350 +#: ../../library/argparse.rst:1354 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1354 +#: ../../library/argparse.rst:1358 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2321,13 +2324,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1357 +#: ../../library/argparse.rst:1361 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1360 +#: ../../library/argparse.rst:1364 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2335,13 +2338,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1363 +#: ../../library/argparse.rst:1367 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1366 +#: ../../library/argparse.rst:1370 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2357,11 +2360,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1375 +#: ../../library/argparse.rst:1379 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1377 +#: ../../library/argparse.rst:1381 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2369,7 +2372,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1382 +#: ../../library/argparse.rst:1386 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2391,11 +2394,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1403 +#: ../../library/argparse.rst:1407 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1405 +#: ../../library/argparse.rst:1409 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2407,7 +2410,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1413 +#: ../../library/argparse.rst:1417 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2440,7 +2443,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1443 +#: ../../library/argparse.rst:1447 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2448,7 +2451,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1448 +#: ../../library/argparse.rst:1452 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2456,24 +2459,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1451 +#: ../../library/argparse.rst:1455 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1457 +#: ../../library/argparse.rst:1461 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1459 +#: ../../library/argparse.rst:1463 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1463 +#: ../../library/argparse.rst:1467 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2497,17 +2500,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1474 +#: ../../library/argparse.rst:1478 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1480 +#: ../../library/argparse.rst:1484 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1482 +#: ../../library/argparse.rst:1486 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -2515,7 +2518,7 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1487 +#: ../../library/argparse.rst:1491 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2541,24 +2544,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1502 +#: ../../library/argparse.rst:1506 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1506 +#: ../../library/argparse.rst:1510 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1509 +#: ../../library/argparse.rst:1513 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1513 +#: ../../library/argparse.rst:1517 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2572,14 +2575,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1519 +#: ../../library/argparse.rst:1523 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1523 +#: ../../library/argparse.rst:1527 msgid "" ">>> class C:\n" "... pass\n" @@ -2601,15 +2604,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1535 +#: ../../library/argparse.rst:1539 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1542 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1545 +#: ../../library/argparse.rst:1549 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2624,69 +2627,69 @@ msgid "" "returns an :class:`ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1557 +#: ../../library/argparse.rst:1561 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1559 +#: ../../library/argparse.rst:1563 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1563 +#: ../../library/argparse.rst:1567 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1566 +#: ../../library/argparse.rst:1570 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1574 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1573 +#: ../../library/argparse.rst:1577 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1576 +#: ../../library/argparse.rst:1580 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1579 +#: ../../library/argparse.rst:1583 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1586 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1588 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1587 +#: ../../library/argparse.rst:1591 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1589 +#: ../../library/argparse.rst:1593 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2709,7 +2712,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1608 +#: ../../library/argparse.rst:1612 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2719,7 +2722,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1615 +#: ../../library/argparse.rst:1619 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2728,7 +2731,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1623 +#: ../../library/argparse.rst:1627 #, fuzzy msgid "" ">>> parser.parse_args(['--help'])\n" @@ -2787,14 +2790,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1651 +#: ../../library/argparse.rst:1655 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1655 +#: ../../library/argparse.rst:1659 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2830,7 +2833,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1672 +#: ../../library/argparse.rst:1676 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2838,7 +2841,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1677 +#: ../../library/argparse.rst:1681 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2854,13 +2857,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1684 +#: ../../library/argparse.rst:1688 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1698 +#: ../../library/argparse.rst:1702 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2868,7 +2871,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1703 +#: ../../library/argparse.rst:1707 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2903,7 +2906,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1735 +#: ../../library/argparse.rst:1739 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2913,7 +2916,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1742 +#: ../../library/argparse.rst:1746 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2933,15 +2936,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1751 +#: ../../library/argparse.rst:1755 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1756 +#: ../../library/argparse.rst:1760 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1760 +#: ../../library/argparse.rst:1764 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2950,7 +2953,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1766 +#: ../../library/argparse.rst:1770 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2968,14 +2971,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1772 +#: ../../library/argparse.rst:1776 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1776 +#: ../../library/argparse.rst:1780 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2987,15 +2990,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1781 +#: ../../library/argparse.rst:1785 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1786 +#: ../../library/argparse.rst:1790 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1791 +#: ../../library/argparse.rst:1795 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3004,7 +3007,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1797 +#: ../../library/argparse.rst:1801 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3028,7 +3031,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1808 +#: ../../library/argparse.rst:1812 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3039,7 +3042,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1816 +#: ../../library/argparse.rst:1820 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3077,7 +3080,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1834 +#: ../../library/argparse.rst:1838 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3086,13 +3089,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1839 +#: ../../library/argparse.rst:1843 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1842 +#: ../../library/argparse.rst:1846 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3100,18 +3103,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1850 +#: ../../library/argparse.rst:1854 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1854 +#: ../../library/argparse.rst:1858 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1862 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3137,14 +3140,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1870 +#: ../../library/argparse.rst:1874 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1874 +#: ../../library/argparse.rst:1878 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3162,7 +3165,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1882 +#: ../../library/argparse.rst:1886 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3170,7 +3173,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1888 +#: ../../library/argparse.rst:1892 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3206,7 +3209,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1905 +#: ../../library/argparse.rst:1909 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3214,11 +3217,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1913 +#: ../../library/argparse.rst:1917 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1917 +#: ../../library/argparse.rst:1921 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3227,7 +3230,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1923 +#: ../../library/argparse.rst:1927 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3241,12 +3244,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1929 +#: ../../library/argparse.rst:1933 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1931 +#: ../../library/argparse.rst:1935 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3260,20 +3263,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1937 +#: ../../library/argparse.rst:1941 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1943 +#: ../../library/argparse.rst:1947 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1947 +#: ../../library/argparse.rst:1951 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3285,54 +3288,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1958 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1956 +#: ../../library/argparse.rst:1960 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1962 +#: ../../library/argparse.rst:1966 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1968 +#: ../../library/argparse.rst:1972 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1972 +#: ../../library/argparse.rst:1976 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1977 +#: ../../library/argparse.rst:1981 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1982 +#: ../../library/argparse.rst:1986 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:1987 +#: ../../library/argparse.rst:1991 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:1991 +#: ../../library/argparse.rst:1995 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3343,7 +3346,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2000 +#: ../../library/argparse.rst:2004 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3357,7 +3360,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2007 +#: ../../library/argparse.rst:2011 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3365,11 +3368,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2014 +#: ../../library/argparse.rst:2018 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2018 +#: ../../library/argparse.rst:2022 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3377,20 +3380,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2023 +#: ../../library/argparse.rst:2027 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2027 +#: ../../library/argparse.rst:2031 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2030 +#: ../../library/argparse.rst:2034 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3400,18 +3403,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2036 +#: ../../library/argparse.rst:2040 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:2044 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2044 +#: ../../library/argparse.rst:2048 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3425,17 +3428,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2052 +#: ../../library/argparse.rst:2056 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2057 +#: ../../library/argparse.rst:2061 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2062 +#: ../../library/argparse.rst:2066 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3443,7 +3446,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2067 +#: ../../library/argparse.rst:2071 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -3451,7 +3454,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2072 +#: ../../library/argparse.rst:2076 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3459,7 +3462,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2078 +#: ../../library/argparse.rst:2082 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3479,7 +3482,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2087 +#: ../../library/argparse.rst:2091 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3487,43 +3490,43 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2096 +#: ../../library/argparse.rst:2100 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2100 +#: ../../library/argparse.rst:2104 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:2106 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2107 +#: ../../library/argparse.rst:2111 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2115 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:796 +#: ../../library/argparse.rst:800 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:796 ../../library/argparse.rst:830 -#: ../../library/argparse.rst:844 +#: ../../library/argparse.rst:800 ../../library/argparse.rst:834 +#: ../../library/argparse.rst:848 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:830 +#: ../../library/argparse.rst:834 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:844 +#: ../../library/argparse.rst:848 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/builtins.po b/library/builtins.po index d2a6cc577f..63621acb64 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: 2022-02-15 20:55+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,17 +25,17 @@ msgid ":mod:`!builtins` --- Built-in objects" msgstr ":mod:`!builtins` --- 內建物件" #: ../../library/builtins.rst:9 +#, fuzzy msgid "" "This module provides direct access to all 'built-in' identifiers of Python; " "for example, ``builtins.open`` is the full name for the built-in function :" -"func:`open`. See :ref:`built-in-funcs` and :ref:`built-in-consts` for " -"documentation." +"func:`open`." msgstr "" "該模組提供對 Python 所有'內建'識別符號的直接存取;例如 ``builtins.open`` 是內" "建函式 :func:`open` 的全名。請參閱\\ :ref:`built-in-funcs`\\ 和\\ :ref:" "`built-in-consts`\\ 的文件。" -#: ../../library/builtins.rst:15 +#: ../../library/builtins.rst:12 msgid "" "This module is not normally accessed explicitly by most applications, but " "can be useful in modules that provide objects with the same name as a built-" @@ -47,7 +47,7 @@ msgstr "" "能很有用,不過其中還會需要內建該名稱。例如,在一個將內建 :func:`open` 包裝起" "來以實現另一版本 :func:`open` 函式的模組中,這個模組可以直接被使用: ::" -#: ../../library/builtins.rst:21 +#: ../../library/builtins.rst:18 msgid "" "import builtins\n" "\n" @@ -67,7 +67,7 @@ msgid "" " # ..." msgstr "" -#: ../../library/builtins.rst:38 +#: ../../library/builtins.rst:35 msgid "" "As an implementation detail, most modules have the name ``__builtins__`` " "made available as part of their globals. The value of ``__builtins__`` is " @@ -79,3 +79,19 @@ msgstr "" "以提使用。``__builtins__`` 的值通常是這個模組或者這個模組的 :attr:`~object." "__dict__` 屬性值。由於這是一個實作細節,因此 Python 的其他實作可能不會使用" "它。" + +#: ../../library/builtins.rst:43 +msgid ":ref:`built-in-consts`" +msgstr "" + +#: ../../library/builtins.rst:44 +msgid ":ref:`bltin-exceptions`" +msgstr "" + +#: ../../library/builtins.rst:45 +msgid ":ref:`built-in-funcs`" +msgstr "" + +#: ../../library/builtins.rst:46 +msgid ":ref:`bltin-types`" +msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 9374bb0d8b..2b888318aa 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -380,7 +380,7 @@ msgid "" " 'http://www.cnn.com/',\n" " 'http://europe.wsj.com/',\n" " 'http://www.bbc.co.uk/',\n" -" 'http://nonexistant-subdomain.python.org/']\n" +" 'http://nonexistent-subdomain.python.org/']\n" "\n" "# Retrieve a single page and report the URL and contents\n" "def load_url(url, timeout):\n" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 0064d10e54..5a76e0ad8a 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -878,7 +878,7 @@ msgstr "" #: ../../library/importlib.metadata.rst:558 msgid "" -"class DatabaseDistribution(importlib.metadata.Distributon):\n" +"class DatabaseDistribution(importlib.metadata.Distribution):\n" " def __init__(self, record):\n" " self.record = record\n" "\n" diff --git a/library/locale.po b/library/locale.po index 4f50c54eff..4e71503ed8 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -331,111 +331,110 @@ msgstr "" #: ../../library/locale.rst:161 msgid "" -"Return some locale-specific information as a string (or a tuple for " -"``ALT_DIGITS``). This function is not available on all systems, and the set " -"of possible options might also vary across platforms. The possible argument " -"values are numbers, for which symbolic constants are available in the locale " -"module." +"Return some locale-specific information as a string. This function is not " +"available on all systems, and the set of possible options might also vary " +"across platforms. The possible argument values are numbers, for which " +"symbolic constants are available in the locale module." msgstr "" -#: ../../library/locale.rst:167 +#: ../../library/locale.rst:166 msgid "" "The :func:`nl_langinfo` function accepts one of the following keys. Most " "descriptions are taken from the corresponding description in the GNU C " "library." msgstr "" -#: ../../library/locale.rst:173 +#: ../../library/locale.rst:172 msgid "" "Get a string with the name of the character encoding used in the selected " "locale." msgstr "" -#: ../../library/locale.rst:178 +#: ../../library/locale.rst:177 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent date and time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:183 +#: ../../library/locale.rst:182 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a date in a locale-specific way." msgstr "" -#: ../../library/locale.rst:188 +#: ../../library/locale.rst:187 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:193 +#: ../../library/locale.rst:192 msgid "" "Get a format string for :func:`time.strftime` to represent time in the am/pm " "format." msgstr "" -#: ../../library/locale.rst:204 +#: ../../library/locale.rst:203 msgid "Get the name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:208 +#: ../../library/locale.rst:207 msgid "" "This follows the US convention of :const:`DAY_1` being Sunday, not the " "international convention (ISO 8601) that Monday is the first day of the week." msgstr "" -#: ../../library/locale.rst:220 +#: ../../library/locale.rst:219 msgid "Get the abbreviated name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:235 +#: ../../library/locale.rst:234 msgid "Get the name of the n-th month." msgstr "" -#: ../../library/locale.rst:250 +#: ../../library/locale.rst:249 msgid "Get the abbreviated name of the n-th month." msgstr "" -#: ../../library/locale.rst:254 +#: ../../library/locale.rst:253 msgid "Get the radix character (decimal dot, decimal comma, etc.)." msgstr "" -#: ../../library/locale.rst:258 +#: ../../library/locale.rst:257 msgid "Get the separator character for thousands (groups of three digits)." msgstr "" -#: ../../library/locale.rst:262 +#: ../../library/locale.rst:261 msgid "" "Get a regular expression that can be used with the regex function to " "recognize a positive response to a yes/no question." msgstr "" -#: ../../library/locale.rst:267 +#: ../../library/locale.rst:266 msgid "" "Get a regular expression that can be used with the ``regex(3)`` function to " "recognize a negative response to a yes/no question." msgstr "" -#: ../../library/locale.rst:272 +#: ../../library/locale.rst:271 msgid "" "The regular expressions for :const:`YESEXPR` and :const:`NOEXPR` use syntax " "suitable for the ``regex`` function from the C library, which might differ " "from the syntax used in :mod:`re`." msgstr "" -#: ../../library/locale.rst:279 +#: ../../library/locale.rst:278 msgid "" "Get the currency symbol, preceded by \"-\" if the symbol should appear " "before the value, \"+\" if the symbol should appear after the value, or \"." "\" if the symbol should replace the radix character." msgstr "" -#: ../../library/locale.rst:285 +#: ../../library/locale.rst:284 msgid "Get a string that represents the era used in the current locale." msgstr "" -#: ../../library/locale.rst:287 +#: ../../library/locale.rst:286 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -443,7 +442,7 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:292 +#: ../../library/locale.rst:291 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " @@ -452,35 +451,38 @@ msgid "" "systems." msgstr "" -#: ../../library/locale.rst:300 +#: ../../library/locale.rst:299 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:305 +#: ../../library/locale.rst:304 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:310 +#: ../../library/locale.rst:309 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:315 -msgid "Get a tuple of up to 100 strings used to represent the values 0 to 99." +#: ../../library/locale.rst:314 +msgid "" +"Get a string consisting of up to 100 semicolon-separated symbols used to " +"represent the values 0 to 99 in a locale-specific way. In most locales this " +"is an empty string." msgstr "" -#: ../../library/locale.rst:320 +#: ../../library/locale.rst:321 msgid "" "Tries to determine the default locale settings and returns them as a tuple " "of the form ``(language code, encoding)``." msgstr "" -#: ../../library/locale.rst:323 +#: ../../library/locale.rst:324 msgid "" "According to POSIX, a program which has not called ``setlocale(LC_ALL, '')`` " "runs using the portable ``'C'`` locale. Calling ``setlocale(LC_ALL, '')`` " @@ -489,7 +491,7 @@ msgid "" "emulate the behavior in the way described above." msgstr "" -#: ../../library/locale.rst:329 +#: ../../library/locale.rst:330 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -499,21 +501,21 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:336 ../../library/locale.rst:349 +#: ../../library/locale.rst:337 ../../library/locale.rst:350 msgid "" "Except for the code ``'C'``, the language code corresponds to :rfc:`1766`. " "*language code* and *encoding* may be ``None`` if their values cannot be " "determined." msgstr "" -#: ../../library/locale.rst:345 +#: ../../library/locale.rst:346 msgid "" "Returns the current setting for the given locale category as sequence " "containing *language code*, *encoding*. *category* may be one of the :const:" "`!LC_\\*` values except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:356 +#: ../../library/locale.rst:357 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -521,72 +523,72 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:361 +#: ../../library/locale.rst:362 msgid "" "On some systems, it is necessary to invoke :func:`setlocale` to obtain the " "user preferences, so this function is not thread-safe. If invoking setlocale " "is not necessary or desired, *do_setlocale* should be set to ``False``." msgstr "" -#: ../../library/locale.rst:365 +#: ../../library/locale.rst:366 msgid "" "On Android or if the :ref:`Python UTF-8 Mode ` is enabled, always " "return ``'utf-8'``, the :term:`locale encoding` and the *do_setlocale* " "argument are ignored." msgstr "" -#: ../../library/locale.rst:369 ../../library/locale.rst:387 +#: ../../library/locale.rst:370 ../../library/locale.rst:388 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:372 +#: ../../library/locale.rst:373 msgid "" "The function now always returns ``\"utf-8\"`` on Android or if the :ref:" "`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:379 +#: ../../library/locale.rst:380 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:381 +#: ../../library/locale.rst:382 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:382 +#: ../../library/locale.rst:383 msgid "" "On Unix, return the encoding of the current :data:`LC_CTYPE` locale. Return " "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string: for " "example, if the current LC_CTYPE locale is not supported." msgstr "" -#: ../../library/locale.rst:385 +#: ../../library/locale.rst:386 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:390 +#: ../../library/locale.rst:391 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:399 +#: ../../library/locale.rst:400 msgid "" "Returns a normalized locale code for the given locale name. The returned " "locale code is formatted for use with :func:`setlocale`. If normalization " "fails, the original name is returned unchanged." msgstr "" -#: ../../library/locale.rst:403 +#: ../../library/locale.rst:404 msgid "" "If the given encoding is not known, the function defaults to the default " "encoding for the locale code just like :func:`setlocale`." msgstr "" -#: ../../library/locale.rst:409 +#: ../../library/locale.rst:410 msgid "" "Compares two strings according to the current :const:`LC_COLLATE` setting. " "As any other compare function, returns a negative, or a positive value, or " @@ -594,7 +596,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:417 +#: ../../library/locale.rst:418 msgid "" "Transforms a string to one that can be used in locale-aware comparisons. " "For example, ``strxfrm(s1) < strxfrm(s2)`` is equivalent to ``strcoll(s1, " @@ -602,7 +604,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:426 +#: ../../library/locale.rst:427 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -610,29 +612,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:431 +#: ../../library/locale.rst:432 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:434 +#: ../../library/locale.rst:435 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:437 +#: ../../library/locale.rst:438 msgid "The *monetary* keyword parameter was added." msgstr "" -#: ../../library/locale.rst:443 +#: ../../library/locale.rst:444 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:445 +#: ../../library/locale.rst:446 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -640,43 +642,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:452 +#: ../../library/locale.rst:453 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: ../../library/locale.rst:458 +#: ../../library/locale.rst:459 msgid "" "Formats a floating-point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: ../../library/locale.rst:464 +#: ../../library/locale.rst:465 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:472 +#: ../../library/locale.rst:473 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:480 +#: ../../library/locale.rst:481 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: ../../library/locale.rst:486 +#: ../../library/locale.rst:487 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:491 +#: ../../library/locale.rst:492 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -686,32 +688,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:498 +#: ../../library/locale.rst:499 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:505 +#: ../../library/locale.rst:506 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:511 +#: ../../library/locale.rst:512 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:517 +#: ../../library/locale.rst:518 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:523 +#: ../../library/locale.rst:524 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -719,13 +721,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:528 +#: ../../library/locale.rst:529 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:534 +#: ../../library/locale.rst:535 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -733,7 +735,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:542 +#: ../../library/locale.rst:543 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -743,17 +745,17 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:551 +#: ../../library/locale.rst:552 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:555 +#: ../../library/locale.rst:556 msgid "Example::" msgstr "範例: ::" -#: ../../library/locale.rst:557 +#: ../../library/locale.rst:558 msgid "" ">>> import locale\n" ">>> loc = locale.getlocale() # get current locale\n" @@ -766,11 +768,11 @@ msgid "" ">>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale" msgstr "" -#: ../../library/locale.rst:568 +#: ../../library/locale.rst:569 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:570 +#: ../../library/locale.rst:571 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -778,7 +780,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:575 +#: ../../library/locale.rst:576 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -788,7 +790,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:582 +#: ../../library/locale.rst:583 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -796,7 +798,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:588 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -807,14 +809,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:594 +#: ../../library/locale.rst:595 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:598 +#: ../../library/locale.rst:599 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -825,11 +827,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:609 +#: ../../library/locale.rst:610 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:611 +#: ../../library/locale.rst:612 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -837,7 +839,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:616 +#: ../../library/locale.rst:617 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -847,11 +849,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:627 +#: ../../library/locale.rst:628 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:636 +#: ../../library/locale.rst:637 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`gettext`, :func:" @@ -862,7 +864,7 @@ msgid "" "locating message catalogs." msgstr "" -#: ../../library/locale.rst:643 +#: ../../library/locale.rst:644 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " diff --git a/library/os.po b/library/os.po index 4f0982a091..50610fbd60 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -6287,7 +6287,7 @@ msgstr "" #: ../../library/os.rst:5544 #, fuzzy -msgid "See also the :func:`sched_getaffinity` functions." +msgid "See also the :func:`sched_getaffinity` function." msgstr ":func:`~os.setns` 函式。" #: ../../library/os.rst:5551 diff --git a/tutorial/errors.po b/tutorial/errors.po index 9931582f51..34973654d4 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -931,7 +931,7 @@ msgid "" "executing finally clause\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" -" divide(\"2\", \"0\")\n" +" divide(\"2\", \"1\")\n" " ~~~~~~^^^^^^^^^^\n" " File \"\", line 3, in divide\n" " result = x / y\n" diff --git a/using/unix.po b/using/unix.po index ebbda0b865..e19752740c 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,21 +32,23 @@ msgid "On Linux" msgstr "在 Linux 上" #: ../../using/unix.rst:18 +#, fuzzy msgid "" "Python comes preinstalled on most Linux distributions, and is available as a " "package on all others. However there are certain features you might want to " -"use that are not available on your distro's package. You can easily compile " -"the latest version of Python from source." +"use that are not available on your distro's package. You can compile the " +"latest version of Python from source." msgstr "" "在大多數 Linux 發行版上會預先安裝 Python,並作為一個套件提供給所有其他使用" "者。但是發行版提供的套件可能沒有你想要使用的某些功能,這時你可以選擇從原始碼" "編譯最新版本的 Python,做法相當容易。" #: ../../using/unix.rst:23 +#, fuzzy msgid "" -"In the event that Python doesn't come preinstalled and isn't in the " -"repositories as well, you can easily make packages for your own distro. " -"Have a look at the following links:" +"In the event that the latest version of Python doesn't come preinstalled and " +"isn't in the repositories as well, you can make packages for your own " +"distro. Have a look at the following links:" msgstr "" "如果 Python 沒有預先安裝,並且不在發行版提供的儲存庫 (repository) 中,你可以" "輕鬆地為自己使用的發行版建立套件。參閱以下連結:" diff --git a/using/windows.po b/using/windows.po index eb8767e023..aa86476b0e 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -1518,8 +1518,8 @@ msgstr "" #: ../../using/windows.rst:840 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 " +"The Company is matched on the full string, case-insensitive. The Tag is " +"matched on either 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``)." diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index d624b5b66a..c611afa660 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-10-28 06: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-" @@ -5024,7 +5024,9 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 #, fuzzy -msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 @@ -5034,7 +5036,9 @@ msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 #, fuzzy -msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 491ba7e52e..cbbe75429d 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-10-28 06:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -431,7 +431,8 @@ msgid "" " ^^^^^^^^^^^^^^\n" "AttributeError: module 'random' has no attribute 'randint' (consider " "renaming '/home/me/random.py' since it has the same name as the standard " -"library module named 'random' and the import system gives it precedence)" +"library module named 'random' and prevents importing that standard library " +"module)" msgstr "" #: ../../whatsnew/3.13.rst:279 @@ -451,8 +452,8 @@ msgid "" " np.array([1, 2, 3])\n" " ^^^^^^^^\n" "AttributeError: module 'numpy' has no attribute 'array' (consider renaming '/" -"home/me/numpy.py' if it has the same name as a third-party module you " -"intended to import)" +"home/me/numpy.py' if it has the same name as a library you intended to " +"import)" msgstr "" #: ../../whatsnew/3.13.rst:294 @@ -4370,7 +4371,6 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:2418 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" @@ -4380,7 +4380,6 @@ msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" #: ../../whatsnew/3.13.rst:2422 -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" @@ -4628,6 +4627,18 @@ msgstr "" msgid "Python initialization functions:" msgstr "" +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." +msgstr "" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." +msgstr "" + #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" "The following APIs are deprecated and will be removed, although there is " From 006a9c1923ac91341f854b67a6896ac3ec5d0001 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Nov 2024 09:23:30 +0000 Subject: [PATCH 08/14] sync with cpython fd9c2a37 --- c-api/allocation.po | 23 +- c-api/init.po | 422 ++++---- deprecations/index.po | 196 ++-- deprecations/pending-removal-in-3.14.po | 118 +-- deprecations/pending-removal-in-3.15.po | 22 +- deprecations/pending-removal-in-3.16.po | 58 +- glossary.po | 741 +++++++------ howto/logging-cookbook.po | 565 +++++----- library/aifc.po | 281 +---- library/argparse.po | 623 ++++++----- library/asynchat.po | 39 + library/asyncio-eventloop.po | 7 +- library/asyncore.po | 39 + library/audioop.po | 356 +------ library/cgi.po | 1023 +++--------------- library/cgitb.po | 136 +-- library/chunk.po | 227 +--- library/cmath.po | 75 +- library/configparser.po | 178 ++-- library/contextvars.po | 116 +- library/crypt.po | 356 ++----- library/ctypes.po | 450 ++++---- library/dis.po | 4 +- library/distutils.po | 36 + library/enum.po | 4 +- library/functions.po | 676 ++++++------ library/getopt.po | 49 +- library/imghdr.po | 215 ++-- library/imp.po | 41 + library/importlib.metadata.po | 11 +- library/mailcap.po | 139 +-- library/math.po | 1278 +++++++++++++++++------ library/msilib.po | 614 +---------- library/nis.po | 95 +- library/nntplib.po | 821 +++------------ library/os.po | 374 +++---- library/ossaudiodev.po | 617 ++--------- library/pipes.po | 164 +-- library/pprint.po | 5 +- library/pydoc.po | 29 +- library/removed.po | 28 + library/smtpd.po | 41 + library/sndhdr.po | 338 +++--- library/socket.po | 488 +++++---- library/spwd.po | 241 ++--- library/sqlite3.po | 106 +- library/stdtypes.po | 4 +- library/string.po | 316 +++--- library/sunau.po | 621 +++++------ library/sys.po | 551 +++++----- library/telnetlib.po | 452 ++------ library/time.po | 322 +++--- library/typing.po | 29 +- library/urllib.parse.po | 189 ++-- library/uu.po | 100 +- library/warnings.po | 168 +-- library/xdrlib.po | 375 +------ reference/compound_stmts.po | 804 +++++++------- reference/datamodel.po | 781 +++++++------- reference/expressions.po | 644 ++++++------ tutorial/controlflow.po | 382 +++---- tutorial/datastructures.po | 15 +- tutorial/inputoutput.po | 211 ++-- using/configure.po | 613 +++++------ using/windows.po | 24 +- whatsnew/3.12.po | 842 +++++++-------- whatsnew/3.13.po | 773 +++++++------- whatsnew/3.8.po | 4 +- 68 files changed, 8907 insertions(+), 11778 deletions(-) create mode 100644 library/asynchat.po create mode 100644 library/asyncore.po create mode 100644 library/distutils.po create mode 100644 library/imp.po create mode 100644 library/removed.po create mode 100644 library/smtpd.po diff --git a/c-api/allocation.po b/c-api/allocation.po index c4605012ef..84d1377750 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,18 +27,17 @@ msgid "Allocating Objects on the Heap" msgstr "在 heap 上分配物件" #: ../../c-api/allocation.rst:17 +#, fuzzy msgid "" "Initialize a newly allocated object *op* with its type and initial " -"reference. Returns the initialized object. If *type* indicates that the " -"object participates in the cyclic garbage detector, it is added to the " -"detector's set of observed objects. Other fields of the object are not " -"affected." +"reference. Returns the initialized object. Other fields of the object are " +"not affected." msgstr "" "用它的型別和初始參照來初始化新分配物件 *op*。已初始化的物件會被回傳。如果 " "*type* 表示了該物件參與迴圈垃圾檢查器,則將其新增到檢查器的觀察物件集合中。物" "件的其他欄位不受影響。" -#: ../../c-api/allocation.rst:26 +#: ../../c-api/allocation.rst:24 msgid "" "This does everything :c:func:`PyObject_Init` does, and also initializes the " "length information for a variable-size object." @@ -46,7 +45,7 @@ msgstr "" "它會做到 :c:func:`PyObject_Init` 的所有功能,並且會初始化一個大小可變物件的長" "度資訊。" -#: ../../c-api/allocation.rst:32 +#: ../../c-api/allocation.rst:30 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " @@ -60,7 +59,7 @@ msgstr "" "化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小" "由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。" -#: ../../c-api/allocation.rst:43 +#: ../../c-api/allocation.rst:41 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " @@ -79,7 +78,7 @@ msgstr "" "於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌" "入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。" -#: ../../c-api/allocation.rst:57 +#: ../../c-api/allocation.rst:55 msgid "" "Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:" "macro:`PyObject_NewVar`. This is normally called from the :c:member:" @@ -92,7 +91,7 @@ msgstr "" "handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的" "記憶體已不再是一個有效的 Python 物件。" -#: ../../c-api/allocation.rst:66 +#: ../../c-api/allocation.rst:64 msgid "" "Object which is visible in Python as ``None``. This should only be accessed " "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " @@ -101,10 +100,10 @@ msgstr "" "這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" "取,該巨集的拿到指向該物件的指標。" -#: ../../c-api/allocation.rst:73 +#: ../../c-api/allocation.rst:71 msgid ":c:func:`PyModule_Create`" msgstr ":c:func:`PyModule_Create`" -#: ../../c-api/allocation.rst:74 +#: ../../c-api/allocation.rst:72 msgid "To allocate and create extension modules." msgstr "分配記憶體和建立擴充模組。" diff --git a/c-api/init.po b/c-api/init.po index 0b4d5401de..5c3e37a1fe 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1444,7 +1444,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1155 ../../c-api/init.rst:1214 -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1499 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1655,14 +1655,18 @@ msgid "" "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1338 +#: ../../c-api/init.rst:1335 +msgid "The :c:member:`PyThreadState.on_delete` callback was removed." +msgstr "" + +#: ../../c-api/init.rst:1341 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1345 +#: ../../c-api/init.rst:1348 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1670,119 +1674,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1353 +#: ../../c-api/init.rst:1356 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1355 +#: ../../c-api/init.rst:1358 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1358 +#: ../../c-api/init.rst:1361 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1360 ../../c-api/init.rst:1369 -#: ../../c-api/init.rst:1378 +#: ../../c-api/init.rst:1363 ../../c-api/init.rst:1372 +#: ../../c-api/init.rst:1381 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1367 +#: ../../c-api/init.rst:1370 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1376 +#: ../../c-api/init.rst:1379 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1385 +#: ../../c-api/init.rst:1388 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1390 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1397 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1397 +#: ../../c-api/init.rst:1400 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1405 +#: ../../c-api/init.rst:1408 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1407 +#: ../../c-api/init.rst:1410 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1410 ../../c-api/init.rst:1420 +#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1423 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1417 +#: ../../c-api/init.rst:1420 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1427 +#: ../../c-api/init.rst:1430 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1434 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1438 +#: ../../c-api/init.rst:1441 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1440 +#: ../../c-api/init.rst:1443 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1446 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1446 +#: ../../c-api/init.rst:1449 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1451 +#: ../../c-api/init.rst:1454 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1453 ../../c-api/init.rst:1461 +#: ../../c-api/init.rst:1456 ../../c-api/init.rst:1464 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1459 +#: ../../c-api/init.rst:1462 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1468 +#: ../../c-api/init.rst:1471 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1791,7 +1795,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1477 +#: ../../c-api/init.rst:1480 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1803,33 +1807,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1485 +#: ../../c-api/init.rst:1488 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1491 +#: ../../c-api/init.rst:1494 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1502 +#: ../../c-api/init.rst:1505 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1507 +#: ../../c-api/init.rst:1510 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1513 +#: ../../c-api/init.rst:1516 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1838,17 +1842,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1522 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1526 +#: ../../c-api/init.rst:1529 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1528 +#: ../../c-api/init.rst:1531 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1856,7 +1860,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1533 +#: ../../c-api/init.rst:1536 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1867,31 +1871,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1543 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1546 +#: ../../c-api/init.rst:1549 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1552 +#: ../../c-api/init.rst:1555 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1556 +#: ../../c-api/init.rst:1559 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1560 +#: ../../c-api/init.rst:1563 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1899,44 +1903,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1568 +#: ../../c-api/init.rst:1571 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1575 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1577 +#: ../../c-api/init.rst:1580 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1585 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1587 +#: ../../c-api/init.rst:1590 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1596 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1600 +#: ../../c-api/init.rst:1603 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1945,37 +1949,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1607 +#: ../../c-api/init.rst:1610 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1615 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1622 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:1626 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1627 +#: ../../c-api/init.rst:1630 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1632 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1646 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1988,13 +1992,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1656 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1656 +#: ../../c-api/init.rst:1659 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2005,7 +2009,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1668 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2017,13 +2021,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1676 +#: ../../c-api/init.rst:1679 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1682 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2047,7 +2051,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1690 +#: ../../c-api/init.rst:1693 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2055,11 +2059,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1699 +#: ../../c-api/init.rst:1702 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1701 +#: ../../c-api/init.rst:1704 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2067,7 +2071,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1707 +#: ../../c-api/init.rst:1710 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2079,7 +2083,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1718 +#: ../../c-api/init.rst:1721 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2089,7 +2093,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1741 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2098,7 +2102,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1753 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2108,17 +2112,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1758 +#: ../../c-api/init.rst:1761 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1763 +#: ../../c-api/init.rst:1766 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1765 +#: ../../c-api/init.rst:1768 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2130,7 +2134,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1775 +#: ../../c-api/init.rst:1778 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2144,7 +2148,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1786 +#: ../../c-api/init.rst:1789 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2152,7 +2156,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1794 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2162,11 +2166,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1805 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1804 +#: ../../c-api/init.rst:1807 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2179,7 +2183,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1814 +#: ../../c-api/init.rst:1817 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2188,7 +2192,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1823 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2200,25 +2204,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1831 +#: ../../c-api/init.rst:1834 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1833 +#: ../../c-api/init.rst:1836 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1840 +#: ../../c-api/init.rst:1843 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:1847 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2226,17 +2230,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1852 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1853 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1853 +#: ../../c-api/init.rst:1856 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2244,20 +2248,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:1861 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1861 +#: ../../c-api/init.rst:1864 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1869 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2267,7 +2271,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1878 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2275,18 +2279,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1887 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:1892 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1893 +#: ../../c-api/init.rst:1896 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2296,7 +2300,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:1906 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 " @@ -2308,66 +2312,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:1915 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:1915 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1914 +#: ../../c-api/init.rst:1917 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1914 ../../c-api/init.rst:1919 -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1917 ../../c-api/init.rst:1922 +#: ../../c-api/init.rst:1933 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1919 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1919 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1922 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1924 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1924 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1924 +#: ../../c-api/init.rst:1927 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1924 ../../c-api/init.rst:1926 -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1927 ../../c-api/init.rst:1929 +#: ../../c-api/init.rst:1931 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1929 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1931 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1933 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1938 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2376,7 +2380,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1947 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2388,7 +2392,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1955 +#: ../../c-api/init.rst:1958 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2396,31 +2400,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:1966 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1969 +#: ../../c-api/init.rst:1972 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1975 +#: ../../c-api/init.rst:1978 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1981 +#: ../../c-api/init.rst:1984 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1987 +#: ../../c-api/init.rst:1990 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2428,7 +2432,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1995 +#: ../../c-api/init.rst:1998 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2438,29 +2442,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2002 +#: ../../c-api/init.rst:2005 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2004 ../../c-api/init.rst:2011 -#: ../../c-api/init.rst:2030 ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2007 ../../c-api/init.rst:2014 +#: ../../c-api/init.rst:2033 ../../c-api/init.rst:2040 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2008 +#: ../../c-api/init.rst:2011 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2013 +#: ../../c-api/init.rst:2016 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2021 +#: ../../c-api/init.rst:2024 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2471,28 +2475,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2031 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:2037 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2039 +#: ../../c-api/init.rst:2042 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2045 +#: ../../c-api/init.rst:2048 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2054 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2502,19 +2506,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2061 +#: ../../c-api/init.rst:2064 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2066 +#: ../../c-api/init.rst:2069 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2071 +#: ../../c-api/init.rst:2074 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2523,7 +2527,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2077 +#: ../../c-api/init.rst:2080 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2531,11 +2535,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2082 ../../c-api/init.rst:2093 +#: ../../c-api/init.rst:2085 ../../c-api/init.rst:2096 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:2091 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2543,48 +2547,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2100 +#: ../../c-api/init.rst:2103 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2105 +#: ../../c-api/init.rst:2108 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2110 +#: ../../c-api/init.rst:2113 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2115 +#: ../../c-api/init.rst:2118 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2120 +#: ../../c-api/init.rst:2123 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2129 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2132 +#: ../../c-api/init.rst:2135 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2139 +#: ../../c-api/init.rst:2142 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2143 +#: ../../c-api/init.rst:2146 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2594,19 +2598,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2150 +#: ../../c-api/init.rst:2153 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2153 +#: ../../c-api/init.rst:2156 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2160 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2614,22 +2618,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2165 +#: ../../c-api/init.rst:2168 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2167 +#: ../../c-api/init.rst:2170 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2176 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2178 +#: ../../c-api/init.rst:2181 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2637,52 +2641,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2186 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2189 +#: ../../c-api/init.rst:2192 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2194 +#: ../../c-api/init.rst:2197 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2196 +#: ../../c-api/init.rst:2199 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2203 +#: ../../c-api/init.rst:2206 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2210 +#: ../../c-api/init.rst:2213 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2216 +#: ../../c-api/init.rst:2219 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2221 +#: ../../c-api/init.rst:2224 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2226 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2690,13 +2694,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2231 +#: ../../c-api/init.rst:2234 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2237 +#: ../../c-api/init.rst:2240 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2705,7 +2709,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2246 +#: ../../c-api/init.rst:2249 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2714,31 +2718,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2255 +#: ../../c-api/init.rst:2258 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2262 +#: ../../c-api/init.rst:2265 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:2273 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2272 +#: ../../c-api/init.rst:2275 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2277 +#: ../../c-api/init.rst:2280 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2747,62 +2751,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2282 +#: ../../c-api/init.rst:2285 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:2293 +#: ../../c-api/init.rst:2296 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2295 +#: ../../c-api/init.rst:2298 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2302 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2302 +#: ../../c-api/init.rst:2305 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2304 +#: ../../c-api/init.rst:2307 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2310 +#: ../../c-api/init.rst:2313 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2318 +#: ../../c-api/init.rst:2321 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2326 +#: ../../c-api/init.rst:2329 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:2337 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2336 +#: ../../c-api/init.rst:2339 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2810,7 +2814,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2341 +#: ../../c-api/init.rst:2344 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2820,7 +2824,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2348 +#: ../../c-api/init.rst:2351 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2828,7 +2832,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2355 +#: ../../c-api/init.rst:2358 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2837,11 +2841,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2361 +#: ../../c-api/init.rst:2364 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2363 +#: ../../c-api/init.rst:2366 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2853,7 +2857,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2372 +#: ../../c-api/init.rst:2375 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2863,61 +2867,61 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2380 +#: ../../c-api/init.rst:2383 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2383 ../../c-api/init.rst:2397 -#: ../../c-api/init.rst:2412 ../../c-api/init.rst:2426 +#: ../../c-api/init.rst:2386 ../../c-api/init.rst:2400 +#: ../../c-api/init.rst:2415 ../../c-api/init.rst:2429 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2385 +#: ../../c-api/init.rst:2388 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2389 ../../c-api/init.rst:2418 +#: ../../c-api/init.rst:2392 ../../c-api/init.rst:2421 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2395 +#: ../../c-api/init.rst:2398 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2399 +#: ../../c-api/init.rst:2402 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2402 ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2405 ../../c-api/init.rst:2434 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2408 +#: ../../c-api/init.rst:2411 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2414 +#: ../../c-api/init.rst:2417 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2427 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2428 +#: ../../c-api/init.rst:2431 msgid "" " PyCriticalSection_End2(&_py_cs2);\n" "}" @@ -2936,19 +2940,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136 -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "sys" msgstr "sys" @@ -2960,7 +2964,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1695 ../../c-api/init.rst:1748 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1698 ../../c-api/init.rst:1751 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3056,23 +3060,23 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1695 +#: ../../c-api/init.rst:1698 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1728 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/deprecations/index.po b/deprecations/index.po index 83473bac72..f2e0f900b0 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,19 +26,6 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 -#: ../../deprecations/pending-removal-in-3.15.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -48,7 +35,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:9 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -57,38 +44,39 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:20 +#: ../../deprecations/pending-removal-in-3.14.rst:13 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:21 +#: ../../deprecations/pending-removal-in-3.14.rst:14 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:15 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:23 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:17 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:26 +#: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:29 +#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:31 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -100,7 +88,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:37 +#: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -112,7 +100,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:43 +#: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -123,7 +111,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:48 +#: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -135,7 +123,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -143,39 +131,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:60 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:65 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:68 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:70 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -186,7 +174,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:76 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -203,7 +191,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -211,7 +199,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -221,27 +209,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:100 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -251,27 +239,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:106 -msgid "" -"date and datetime adapter, date and timestamp converter: see the :mod:" -"`sqlite3` documentation for suggested replacement recipes." -msgstr "" -"date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" -"參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" - -#: ../../deprecations/pending-removal-in-3.14.rst:109 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" -":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:116 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -279,7 +247,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:119 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -293,6 +261,11 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" +#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid "The import system:" +msgstr "" + #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" "Setting :attr:`~module.__cached__` on a module while failing to set :attr:" @@ -402,12 +375,30 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:62 #, fuzzy -msgid ":mod:`typing`:" +msgid ":mod:`types`:" msgstr ":mod:`pty`:" #: ../../deprecations/pending-removal-in-3.15.rst:64 #, fuzzy msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" +":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.15.rst:71 +#, fuzzy +msgid ":mod:`typing`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:73 +#, fuzzy +msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " "has been deprecated since Python 3.13. Use the class-based syntax or the " @@ -417,19 +408,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:70 +#: ../../deprecations/pending-removal-in-3.15.rst:79 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:84 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:86 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -441,29 +432,24 @@ msgstr "" "3.15 中被移除。 (由 Victor Stinner 於 :gh:`105096` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +#, fuzzy +msgid "Pending removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.16.rst:4 -#: ../../deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr ":mod:`builtins`:" - #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " -"deprecated since Python 3.12, as it produces surprising and unintuitive " -"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " -"of a Boolean. In the rare case that you need the bitwise inversion of the " -"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:13 +#: ../../deprecations/pending-removal-in-3.16.rst:11 #, fuzzy msgid ":mod:`array`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.16.rst:15 +#: ../../deprecations/pending-removal-in-3.16.rst:13 msgid "" "The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " "documentation since Python 3.3 and at runtime since Python 3.13. Use the " @@ -471,46 +457,67 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:26 +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:35 #, fuzzy msgid ":mod:`shutil`:" msgstr ":mod:`msilib`" -#: ../../deprecations/pending-removal-in-3.16.rst:23 +#: ../../deprecations/pending-removal-in-3.16.rst:37 msgid "" "The :class:`!ExecError` exception has been deprecated since Python 3.14. It " "has not been used by any function in :mod:`!shutil` since Python 3.4, and is " "now an alias of :exc:`RuntimeError`." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:28 +#: ../../deprecations/pending-removal-in-3.16.rst:42 #, fuzzy msgid ":mod:`symtable`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.16.rst:30 +#: ../../deprecations/pending-removal-in-3.16.rst:44 msgid "" "The :meth:`Class.get_methods ` method has been " "deprecated since Python 3.14." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:33 +#: ../../deprecations/pending-removal-in-3.16.rst:47 #, fuzzy msgid ":mod:`sys`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.16.rst:35 +#: ../../deprecations/pending-removal-in-3.16.rst:49 msgid "" "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " "since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:39 +#: ../../deprecations/pending-removal-in-3.16.rst:53 #, fuzzy msgid ":mod:`tarfile`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.16.rst:41 +#: ../../deprecations/pending-removal-in-3.16.rst:55 msgid "" "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " "deprecated since Python 3.13." @@ -1376,6 +1383,13 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" +#~ msgid "" +#~ "date and datetime adapter, date and timestamp converter: see the :mod:" +#~ "`sqlite3` documentation for suggested replacement recipes." +#~ msgstr "" +#~ "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 " +#~ "(converter):請參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" + #~ msgid "" #~ ":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set " #~ "or taken into consideration by the import system (:gh:`97879`)." diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 6b433dac75..e6ff4172f6 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,18 +21,6 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -42,7 +30,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:9 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -51,38 +39,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:20 +#: ../../deprecations/pending-removal-in-3.14.rst:13 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:21 +#: ../../deprecations/pending-removal-in-3.14.rst:14 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:15 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:23 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:17 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:26 +#: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:29 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:31 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -94,7 +82,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:37 +#: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -106,7 +94,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:43 +#: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -117,7 +105,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:48 +#: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -129,7 +117,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -137,39 +125,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:60 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:65 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:68 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:70 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -180,7 +168,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:76 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -197,7 +185,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -205,7 +193,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -215,27 +203,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:100 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -245,27 +233,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:106 -msgid "" -"date and datetime adapter, date and timestamp converter: see the :mod:" -"`sqlite3` documentation for suggested replacement recipes." -msgstr "" -"date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" -"參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" - -#: ../../deprecations/pending-removal-in-3.14.rst:109 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" -":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:116 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -273,7 +241,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:119 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -282,6 +250,24 @@ msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" +#~ msgid "" +#~ "date and datetime adapter, date and timestamp converter: see the :mod:" +#~ "`sqlite3` documentation for suggested replacement recipes." +#~ msgstr "" +#~ "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 " +#~ "(converter):請參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" + +#~ msgid "" +#~ ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +#~ "deprecated in :pep:`626` since 3.10 and was planned to be removed in " +#~ "3.12, but it only got a proper :exc:`DeprecationWarning` in 3.12. May be " +#~ "removed in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" +#~ msgstr "" +#~ ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" +#~ "在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +#~ "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" +#~ "`101866` 貢獻。)" + #~ msgid "" #~ ":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set " #~ "or taken into consideration by the import system (:gh:`97879`)." diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 4d95ff9016..9b28c4aad5 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -127,10 +127,22 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:62 -msgid ":mod:`typing`:" +msgid ":mod:`types`:" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:64 +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:71 +msgid ":mod:`typing`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:73 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -142,18 +154,18 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:70 +#: ../../deprecations/pending-removal-in-3.15.rst:79 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:86 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index f9dd3fe363..9219dffea2 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,70 +16,94 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +#, fuzzy +msgid "Pending removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:4 -msgid ":mod:`builtins`:" +msgid "The import system:" msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " -"deprecated since Python 3.12, as it produces surprising and unintuitive " -"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " -"of a Boolean. In the rare case that you need the bitwise inversion of the " -"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:13 +#: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:15 +#: ../../deprecations/pending-removal-in-3.16.rst:13 msgid "" "The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " "documentation since Python 3.3 and at runtime since Python 3.13. Use the " "``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." msgstr "" +#: ../../deprecations/pending-removal-in-3.16.rst:19 +msgid ":mod:`asyncio`:" +msgstr "" + #: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:26 +msgid ":mod:`builtins`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:35 msgid ":mod:`shutil`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:23 +#: ../../deprecations/pending-removal-in-3.16.rst:37 msgid "" "The :class:`!ExecError` exception has been deprecated since Python 3.14. It " "has not been used by any function in :mod:`!shutil` since Python 3.4, and is " "now an alias of :exc:`RuntimeError`." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:28 +#: ../../deprecations/pending-removal-in-3.16.rst:42 msgid ":mod:`symtable`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:30 +#: ../../deprecations/pending-removal-in-3.16.rst:44 msgid "" "The :meth:`Class.get_methods ` method has been " "deprecated since Python 3.14." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:33 +#: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:35 +#: ../../deprecations/pending-removal-in-3.16.rst:49 msgid "" "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " "since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:39 +#: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:41 +#: ../../deprecations/pending-removal-in-3.16.rst:55 msgid "" "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " "deprecated since Python 3.13." diff --git a/glossary.po b/glossary.po index 0e2464d8e3..c75b153e71 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -595,43 +595,73 @@ msgstr "" "忽略它們。" #: ../../glossary.rst:262 -msgid "context manager" +#, fuzzy +msgid "context" msgstr "context manager(情境管理器)" #: ../../glossary.rst:264 msgid "" -"An object which controls the environment seen in a :keyword:`with` statement " -"by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " -"See :pep:`343`." +"This term has different meanings depending on where and how it is used. Some " +"common meanings:" msgstr "" -"一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" -"`343`。" #: ../../glossary.rst:267 +msgid "" +"The temporary state or environment established by a :term:`context manager` " +"via a :keyword:`with` statement." +msgstr "" + +#: ../../glossary.rst:269 +msgid "" +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." +msgstr "" + +#: ../../glossary.rst:273 +msgid "" +"A :class:`contextvars.Context` object. Also see :term:`current context`." +msgstr "" + +#: ../../glossary.rst:275 +#, fuzzy +msgid "context management protocol" +msgstr "context manager(情境管理器)" + +#: ../../glossary.rst:277 +msgid "" +"The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " +"the :keyword:`with` statement. See :pep:`343`." +msgstr "" + +#: ../../glossary.rst:279 +msgid "context manager" +msgstr "context manager(情境管理器)" + +#: ../../glossary.rst:281 +msgid "" +"An object which implements the :term:`context management protocol` and " +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." +msgstr "" + +#: ../../glossary.rst:284 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:269 +#: ../../glossary.rst:286 msgid "" -"A variable which can have different values depending on its context. This is " -"similar to Thread-Local Storage in which each execution thread may have a " -"different value for a variable. However, with context variables, there may " -"be several contexts in one execution thread and the main usage for context " -"variables is to keep track of variables in concurrent asynchronous tasks. " -"See :mod:`contextvars`." +"A variable whose value depends on which context is the :term:`current " +"context`. Values are accessed via :class:`contextvars.ContextVar` objects. " +"Context variables are primarily used to isolate state between concurrent " +"asynchronous tasks." msgstr "" -"一個變數,其值可以根據上下文的情境而有所不同。這類似執行緒區域儲存區 (Thread-" -"Local Storage),在其中,一個變數在每個執行緒可能具有不同的值。然而,關於情境" -"變數,在一個執行緒中可能會有多個情境,而情境變數的主要用途,是在並行的非同步" -"任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" -"`contextvars`。" -#: ../../glossary.rst:276 +#: ../../glossary.rst:290 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:280 +#: ../../glossary.rst:294 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -648,11 +678,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:288 +#: ../../glossary.rst:302 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:290 +#: ../../glossary.rst:304 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -663,11 +693,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:295 +#: ../../glossary.rst:309 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:297 +#: ../../glossary.rst:311 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -678,11 +708,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " "for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:302 +#: ../../glossary.rst:316 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:304 +#: ../../glossary.rst:318 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -693,11 +723,25 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:308 +#: ../../glossary.rst:322 +msgid "current context" +msgstr "" + +#: ../../glossary.rst:324 +msgid "" +"The :term:`context` (:class:`contextvars.Context` object) that is currently " +"used by :class:`~contextvars.ContextVar` objects to access (get or set) the " +"values of :term:`context variables `. Each thread has its " +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." +msgstr "" + +#: ../../glossary.rst:330 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:310 +#: ../../glossary.rst:332 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -707,13 +751,13 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`。" -#: ../../glossary.rst:314 +#: ../../glossary.rst:336 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::" -#: ../../glossary.rst:317 +#: ../../glossary.rst:339 msgid "" "def f(arg):\n" " ...\n" @@ -731,7 +775,7 @@ msgstr "" "def f(arg):\n" " ..." -#: ../../glossary.rst:325 +#: ../../glossary.rst:347 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -740,11 +784,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:328 +#: ../../glossary.rst:350 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:330 +#: ../../glossary.rst:352 msgid "" "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." "__set__`, or :meth:`~object.__delete__`. When a class attribute is a " @@ -764,7 +808,7 @@ msgstr "" "們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" "靜態 method,以及對 super class(父類別)的參照。" -#: ../../glossary.rst:341 +#: ../../glossary.rst:363 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -772,11 +816,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `。" -#: ../../glossary.rst:343 +#: ../../glossary.rst:365 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:345 +#: ../../glossary.rst:367 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " @@ -786,11 +830,11 @@ msgstr "" "有 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` method 的物件。在 Perl " "中被稱為雜湊 (hash)。" -#: ../../glossary.rst:349 +#: ../../glossary.rst:371 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:351 +#: ../../glossary.rst:373 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -801,11 +845,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:355 +#: ../../glossary.rst:377 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:357 +#: ../../glossary.rst:379 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -818,11 +862,11 @@ msgstr "" "反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:363 +#: ../../glossary.rst:385 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:365 +#: ../../glossary.rst:387 #, fuzzy msgid "" "A string literal which appears as the first expression in a class, function " @@ -836,11 +880,11 @@ msgstr "" "__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:371 +#: ../../glossary.rst:393 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:373 +#: ../../glossary.rst:395 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -861,11 +905,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:382 +#: ../../glossary.rst:404 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:384 +#: ../../glossary.rst:406 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -880,11 +924,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:390 +#: ../../glossary.rst:412 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:392 +#: ../../glossary.rst:414 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -900,11 +944,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" "式,而不是運算式。" -#: ../../glossary.rst:399 +#: ../../glossary.rst:421 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:401 +#: ../../glossary.rst:423 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -912,11 +956,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:403 +#: ../../glossary.rst:425 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:405 +#: ../../glossary.rst:427 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -925,11 +969,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:408 +#: ../../glossary.rst:430 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:410 +#: ../../glossary.rst:432 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -944,7 +988,7 @@ msgstr "" "衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案" "物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:440 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -956,19 +1000,19 @@ msgstr "" "term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" "面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:423 +#: ../../glossary.rst:445 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:425 +#: ../../glossary.rst:447 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:426 +#: ../../glossary.rst:448 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:428 +#: ../../glossary.rst:450 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -976,7 +1020,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:431 +#: ../../glossary.rst:453 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -985,7 +1029,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:435 +#: ../../glossary.rst:457 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -994,7 +1038,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:439 +#: ../../glossary.rst:461 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -1006,22 +1050,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:444 +#: ../../glossary.rst:466 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:445 +#: ../../glossary.rst:467 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:447 +#: ../../glossary.rst:469 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:450 +#: ../../glossary.rst:472 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項目尋檢器 (path " "entry finder) ` 會使用 :data:`sys.path_hooks`。" -#: ../../glossary.rst:454 +#: ../../glossary.rst:476 #, fuzzy msgid "" "See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." msgstr "請參閱 :ref:`importsystem` 和 :mod:`importlib` 以了解更多細節。" -#: ../../glossary.rst:455 +#: ../../glossary.rst:477 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:457 +#: ../../glossary.rst:479 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1054,11 +1098,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:462 +#: ../../glossary.rst:484 msgid "free threading" msgstr "" -#: ../../glossary.rst:464 +#: ../../glossary.rst:486 msgid "" "A threading model where multiple threads can run Python bytecode " "simultaneously within the same interpreter. This is in contrast to the :" @@ -1066,12 +1110,12 @@ msgid "" "Python bytecode at a time. See :pep:`703`." msgstr "" -#: ../../glossary.rst:468 +#: ../../glossary.rst:490 #, fuzzy msgid "free variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:470 +#: ../../glossary.rst:492 msgid "" "Formally, as defined in the :ref:`language execution model `, a " "free variable is any variable used in a namespace which is not a local " @@ -1081,11 +1125,11 @@ msgid "" "variable`." msgstr "" -#: ../../glossary.rst:475 +#: ../../glossary.rst:497 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:477 +#: ../../glossary.rst:499 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1097,15 +1141,15 @@ msgstr "" "`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " "章節。" -#: ../../glossary.rst:481 +#: ../../glossary.rst:503 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:483 +#: ../../glossary.rst:505 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:485 +#: ../../glossary.rst:507 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1114,7 +1158,7 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到" "兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:490 +#: ../../glossary.rst:512 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1122,11 +1166,11 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: ../../glossary.rst:493 +#: ../../glossary.rst:515 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:495 +#: ../../glossary.rst:517 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1135,11 +1179,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:499 +#: ../../glossary.rst:521 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:501 +#: ../../glossary.rst:523 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1155,7 +1199,7 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:509 +#: ../../glossary.rst:531 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1165,11 +1209,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: ../../glossary.rst:512 +#: ../../glossary.rst:534 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:514 +#: ../../glossary.rst:536 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1181,11 +1225,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:519 ../../glossary.rst:520 +#: ../../glossary.rst:541 ../../glossary.rst:542 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:522 +#: ../../glossary.rst:544 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1196,7 +1240,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:549 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1205,15 +1249,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:530 +#: ../../glossary.rst:552 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:532 +#: ../../glossary.rst:554 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:534 +#: ../../glossary.rst:556 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1224,11 +1268,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:540 ../../glossary.rst:541 +#: ../../glossary.rst:562 ../../glossary.rst:563 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:565 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1240,17 +1284,17 @@ msgstr "" "變數、範圍以及一個選擇性的 :keyword:`!if` 子句。該組合運算式會為外層函式產生" "多個值: ::" -#: ../../glossary.rst:548 +#: ../../glossary.rst:570 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" msgstr "" -#: ../../glossary.rst:550 +#: ../../glossary.rst:572 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:552 +#: ../../glossary.rst:574 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1259,7 +1303,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:556 +#: ../../glossary.rst:578 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1267,11 +1311,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." "singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:558 +#: ../../glossary.rst:580 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:560 +#: ../../glossary.rst:582 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1281,7 +1325,7 @@ msgstr "" "`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:565 +#: ../../glossary.rst:587 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1289,19 +1333,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" "`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:567 +#: ../../glossary.rst:589 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:569 +#: ../../glossary.rst:591 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:570 +#: ../../glossary.rst:592 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:572 +#: ../../glossary.rst:594 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1318,7 +1362,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:581 +#: ../../glossary.rst:603 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1329,7 +1373,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:586 +#: ../../glossary.rst:608 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " @@ -1339,11 +1383,11 @@ msgid "" "core CPUs efficiently. For more details, see :pep:`703`." msgstr "" -#: ../../glossary.rst:592 +#: ../../glossary.rst:614 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:594 +#: ../../glossary.rst:616 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1352,11 +1396,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:597 +#: ../../glossary.rst:619 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:599 +#: ../../glossary.rst:621 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " @@ -1368,7 +1412,7 @@ msgstr "" "`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" "多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:605 +#: ../../glossary.rst:627 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1376,7 +1420,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:608 +#: ../../glossary.rst:630 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1391,11 +1435,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:615 +#: ../../glossary.rst:637 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:617 +#: ../../glossary.rst:639 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1405,28 +1449,28 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:620 +#: ../../glossary.rst:642 msgid "immortal" msgstr "" -#: ../../glossary.rst:622 +#: ../../glossary.rst:644 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." msgstr "" -#: ../../glossary.rst:625 +#: ../../glossary.rst:647 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" -#: ../../glossary.rst:628 +#: ../../glossary.rst:650 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:630 +#: ../../glossary.rst:652 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1438,11 +1482,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:635 +#: ../../glossary.rst:657 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:637 +#: ../../glossary.rst:659 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1454,11 +1498,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:642 +#: ../../glossary.rst:664 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:644 +#: ../../glossary.rst:666 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1466,11 +1510,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:646 +#: ../../glossary.rst:668 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:648 +#: ../../glossary.rst:670 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1478,11 +1522,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:672 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:652 +#: ../../glossary.rst:674 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1496,11 +1540,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:659 +#: ../../glossary.rst:681 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:661 +#: ../../glossary.rst:683 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1514,11 +1558,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:668 +#: ../../glossary.rst:690 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:670 +#: ../../glossary.rst:692 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1536,18 +1580,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:679 +#: ../../glossary.rst:701 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:703 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:683 +#: ../../glossary.rst:705 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1563,7 +1607,7 @@ msgstr "" "`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物件就是可" "疊代物件。" -#: ../../glossary.rst:691 +#: ../../glossary.rst:713 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1583,11 +1627,11 @@ msgstr "" "數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" "term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:701 +#: ../../glossary.rst:723 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:703 +#: ../../glossary.rst:725 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1616,11 +1660,11 @@ msgstr "" "此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:718 +#: ../../glossary.rst:740 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:722 +#: ../../glossary.rst:744 #, fuzzy msgid "" "CPython does not consistently apply the requirement that an iterator define :" @@ -1630,11 +1674,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." "__iter__`\\ 」這個規定。" -#: ../../glossary.rst:727 +#: ../../glossary.rst:749 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:729 +#: ../../glossary.rst:751 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1644,7 +1688,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:756 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1656,7 +1700,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:740 +#: ../../glossary.rst:762 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1673,19 +1717,19 @@ msgstr "" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:747 +#: ../../glossary.rst:769 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:749 ../../glossary.rst:1053 +#: ../../glossary.rst:771 ../../glossary.rst:1075 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:750 +#: ../../glossary.rst:772 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:752 +#: ../../glossary.rst:774 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1695,11 +1739,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:755 +#: ../../glossary.rst:777 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:757 +#: ../../glossary.rst:779 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1710,7 +1754,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:762 +#: ../../glossary.rst:784 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1724,11 +1768,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:767 +#: ../../glossary.rst:789 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:769 +#: ../../glossary.rst:791 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1738,11 +1782,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:772 +#: ../../glossary.rst:794 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:774 +#: ../../glossary.rst:796 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1756,11 +1800,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:780 +#: ../../glossary.rst:802 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:782 +#: ../../glossary.rst:804 #, fuzzy msgid "" "An object that loads a module. It must define a method named :meth:" @@ -1771,24 +1815,24 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`。" -#: ../../glossary.rst:786 +#: ../../glossary.rst:808 msgid ":ref:`finders-and-loaders`" msgstr "" -#: ../../glossary.rst:787 +#: ../../glossary.rst:809 msgid ":class:`importlib.abc.Loader`" msgstr "" -#: ../../glossary.rst:788 +#: ../../glossary.rst:810 #, fuzzy msgid ":pep:`302`" msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:789 +#: ../../glossary.rst:811 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:791 +#: ../../glossary.rst:813 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1796,36 +1840,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:794 +#: ../../glossary.rst:816 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:796 +#: ../../glossary.rst:818 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:798 +#: ../../glossary.rst:820 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:800 +#: ../../glossary.rst:822 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:801 +#: ../../glossary.rst:823 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:805 +#: ../../glossary.rst:827 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:806 +#: ../../glossary.rst:828 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:808 +#: ../../glossary.rst:830 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1840,11 +1884,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:836 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:816 +#: ../../glossary.rst:838 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:842 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:822 +#: ../../glossary.rst:844 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:824 +#: ../../glossary.rst:846 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1885,15 +1929,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:834 +#: ../../glossary.rst:856 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:803 ../../glossary.rst:835 ../../glossary.rst:1198 +#: ../../glossary.rst:825 ../../glossary.rst:857 ../../glossary.rst:1220 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:837 +#: ../../glossary.rst:859 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1905,11 +1949,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:841 +#: ../../glossary.rst:863 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:843 +#: ../../glossary.rst:865 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -1918,11 +1962,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:846 +#: ../../glossary.rst:868 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:848 +#: ../../glossary.rst:870 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1932,15 +1976,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:852 +#: ../../glossary.rst:874 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:853 +#: ../../glossary.rst:875 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:855 +#: ../../glossary.rst:877 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1948,24 +1992,24 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:858 +#: ../../glossary.rst:880 #, fuzzy msgid "See also :ref:`module-specs`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:859 +#: ../../glossary.rst:881 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:861 +#: ../../glossary.rst:883 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:862 +#: ../../glossary.rst:884 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:864 +#: ../../glossary.rst:886 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1973,11 +2017,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:866 +#: ../../glossary.rst:888 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:868 +#: ../../glossary.rst:890 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1987,7 +2031,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:872 +#: ../../glossary.rst:894 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1996,7 +2040,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:876 +#: ../../glossary.rst:898 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2006,7 +2050,7 @@ msgid "" "True" msgstr "" -#: ../../glossary.rst:883 +#: ../../glossary.rst:905 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2023,11 +2067,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:891 +#: ../../glossary.rst:913 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:893 +#: ../../glossary.rst:915 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -2047,11 +2091,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:903 +#: ../../glossary.rst:925 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:905 +#: ../../glossary.rst:927 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -2062,15 +2106,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:910 +#: ../../glossary.rst:932 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:911 +#: ../../glossary.rst:933 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:913 +#: ../../glossary.rst:935 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2085,11 +2129,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:920 +#: ../../glossary.rst:942 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:922 +#: ../../glossary.rst:944 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2101,11 +2145,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:927 +#: ../../glossary.rst:949 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:929 +#: ../../glossary.rst:951 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2113,11 +2157,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:954 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:934 +#: ../../glossary.rst:956 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2128,11 +2172,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:941 +#: ../../glossary.rst:963 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:943 +#: ../../glossary.rst:965 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2142,17 +2186,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:947 +#: ../../glossary.rst:969 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:948 +#: ../../glossary.rst:970 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:950 +#: ../../glossary.rst:972 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2162,7 +2206,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:954 +#: ../../glossary.rst:976 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2173,11 +2217,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:959 +#: ../../glossary.rst:981 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:963 +#: ../../glossary.rst:985 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2188,11 +2232,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:968 +#: ../../glossary.rst:990 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:972 +#: ../../glossary.rst:994 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2205,11 +2249,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:978 +#: ../../glossary.rst:1000 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:980 +#: ../../glossary.rst:1002 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2221,11 +2265,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:986 +#: ../../glossary.rst:1008 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:988 +#: ../../glossary.rst:1010 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2236,14 +2280,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:994 +#: ../../glossary.rst:1016 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:997 +#: ../../glossary.rst:1019 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2254,11 +2298,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1001 +#: ../../glossary.rst:1023 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1003 +#: ../../glossary.rst:1025 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2266,11 +2310,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1005 +#: ../../glossary.rst:1027 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1029 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2280,7 +2324,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1033 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2288,11 +2332,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1035 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1037 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2302,11 +2346,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1040 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1042 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2314,11 +2358,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1022 +#: ../../glossary.rst:1044 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1024 +#: ../../glossary.rst:1046 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2336,11 +2380,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1032 +#: ../../glossary.rst:1054 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1056 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2351,7 +2395,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1062 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2363,15 +2407,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1068 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1047 +#: ../../glossary.rst:1069 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1049 +#: ../../glossary.rst:1071 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2379,15 +2423,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1051 +#: ../../glossary.rst:1073 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1054 +#: ../../glossary.rst:1076 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1078 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2403,7 +2447,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1087 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2412,7 +2456,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1091 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2421,19 +2465,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1094 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1096 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1075 +#: ../../glossary.rst:1097 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1099 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2442,11 +2486,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1102 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1082 +#: ../../glossary.rst:1104 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2460,7 +2504,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1111 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2468,11 +2512,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1092 +#: ../../glossary.rst:1114 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1094 +#: ../../glossary.rst:1116 msgid "" "for piece in food:\n" " print(piece)" @@ -2480,11 +2524,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1118 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1120 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2495,7 +2539,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1125 msgid "" ">>> class C:\n" "... class D:\n" @@ -2521,7 +2565,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1137 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2530,7 +2574,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1119 +#: ../../glossary.rst:1141 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2540,11 +2584,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1144 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:1146 #, fuzzy msgid "" "The number of references to an object. When the reference count of an " @@ -2561,11 +2605,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1132 +#: ../../glossary.rst:1154 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:1156 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2573,25 +2617,25 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1159 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1138 +#: ../../glossary.rst:1160 msgid "REPL" msgstr "" -#: ../../glossary.rst:1140 +#: ../../glossary.rst:1162 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." msgstr "" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1164 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1144 +#: ../../glossary.rst:1166 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2604,11 +2648,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1171 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1173 #, fuzzy msgid "" "An :term:`iterable` which supports efficient element access using integer " @@ -2628,7 +2672,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` " "鍵,而不是整數。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1182 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2645,11 +2689,11 @@ msgstr "" "用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" "\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1169 +#: ../../glossary.rst:1191 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1193 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2660,11 +2704,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1197 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1199 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2672,11 +2716,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1179 +#: ../../glossary.rst:1201 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1203 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2688,34 +2732,34 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1185 +#: ../../glossary.rst:1207 msgid "soft deprecated" msgstr "" -#: ../../glossary.rst:1187 +#: ../../glossary.rst:1209 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " "will not be enhanced further." msgstr "" -#: ../../glossary.rst:1191 +#: ../../glossary.rst:1213 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "" -#: ../../glossary.rst:1194 +#: ../../glossary.rst:1216 msgid "" "See `PEP 387: Soft Deprecation `_." msgstr "" -#: ../../glossary.rst:1196 +#: ../../glossary.rst:1218 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1222 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2726,11 +2770,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1204 +#: ../../glossary.rst:1226 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1228 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2740,11 +2784,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1231 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1211 +#: ../../glossary.rst:1233 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2754,11 +2798,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1214 +#: ../../glossary.rst:1236 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1216 +#: ../../glossary.rst:1238 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2769,7 +2813,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1244 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2779,15 +2823,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1227 +#: ../../glossary.rst:1249 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1250 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1252 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 " @@ -2796,7 +2840,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1234 +#: ../../glossary.rst:1256 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2804,7 +2848,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1237 +#: ../../glossary.rst:1259 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2812,11 +2856,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1262 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1264 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2830,7 +2874,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1271 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2838,11 +2882,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1273 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1253 +#: ../../glossary.rst:1275 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2857,11 +2901,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1282 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1262 +#: ../../glossary.rst:1284 #, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " @@ -2872,22 +2916,22 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1266 +#: ../../glossary.rst:1288 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1268 +#: ../../glossary.rst:1290 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1270 +#: ../../glossary.rst:1292 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1295 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2897,11 +2941,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1299 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1279 +#: ../../glossary.rst:1301 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2913,15 +2957,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1284 ../../glossary.rst:1298 +#: ../../glossary.rst:1306 ../../glossary.rst:1320 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1285 +#: ../../glossary.rst:1307 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1287 +#: ../../glossary.rst:1309 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2929,7 +2973,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1312 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -2939,7 +2983,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1294 +#: ../../glossary.rst:1316 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2947,11 +2991,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1299 +#: ../../glossary.rst:1321 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1301 +#: ../../glossary.rst:1323 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2964,20 +3008,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1328 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1308 +#: ../../glossary.rst:1330 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1310 +#: ../../glossary.rst:1332 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1312 +#: ../../glossary.rst:1334 msgid "" "class C:\n" " field: 'annotation'" @@ -2985,7 +3029,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1315 +#: ../../glossary.rst:1337 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2993,15 +3037,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1319 +#: ../../glossary.rst:1341 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1343 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1345 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3010,11 +3054,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1327 +#: ../../glossary.rst:1349 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1329 +#: ../../glossary.rst:1351 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3025,15 +3069,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1356 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1335 +#: ../../glossary.rst:1357 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1337 +#: ../../glossary.rst:1359 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3041,11 +3085,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1339 +#: ../../glossary.rst:1361 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1341 +#: ../../glossary.rst:1363 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3054,22 +3098,45 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:278 +#: ../../glossary.rst:292 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:278 +#: ../../glossary.rst:292 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:803 +#: ../../glossary.rst:825 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1198 +#: ../../glossary.rst:1220 msgid "special" msgstr "special" +#~ msgid "" +#~ "An object which controls the environment seen in a :keyword:`with` " +#~ "statement by defining :meth:`~object.__enter__` and :meth:`~object." +#~ "__exit__` methods. See :pep:`343`." +#~ msgstr "" +#~ "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" +#~ "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :" +#~ "pep:`343`。" + +#~ msgid "" +#~ "A variable which can have different values depending on its context. This " +#~ "is similar to Thread-Local Storage in which each execution thread may " +#~ "have a different value for a variable. However, with context variables, " +#~ "there may be several contexts in one execution thread and the main usage " +#~ "for context variables is to keep track of variables in concurrent " +#~ "asynchronous tasks. See :mod:`contextvars`." +#~ msgstr "" +#~ "一個變數,其值可以根據上下文的情境而有所不同。這類似執行緒區域儲存區 " +#~ "(Thread-Local Storage),在其中,一個變數在每個執行緒可能具有不同的值。然" +#~ "而,關於情境變數,在一個執行緒中可能會有多個情境,而情境變數的主要用途,是" +#~ "在並行的非同步任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。" +#~ "請參閱 :mod:`contextvars`。" + #~ msgid "2to3" #~ msgstr "2to3" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index abe416bd57..49586c6a54 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -1653,14 +1653,11 @@ msgstr "" msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " -"serialize access to the file from your processes. The existing :class:" -"`FileHandler` and subclasses do not make use of :mod:`multiprocessing` at " -"present, though they may do so in the future. Note that at present, the :mod:" -"`multiprocessing` module does not provide working lock functionality on all " -"platforms (see https://bugs.python.org/issue3770)." +"serialize access to the file from your processes. The stdlib :class:" +"`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" -#: ../../howto/logging-cookbook.rst:1278 +#: ../../howto/logging-cookbook.rst:1275 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 " @@ -1675,7 +1672,7 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1289 +#: ../../howto/logging-cookbook.rst:1286 msgid "" "# You'll need these imports in your own code\n" "import logging\n" @@ -1795,13 +1792,13 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1394 +#: ../../howto/logging-cookbook.rst:1391 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1397 +#: ../../howto/logging-cookbook.rst:1394 msgid "" "import logging\n" "import logging.config\n" @@ -1898,7 +1895,7 @@ msgid "" " lp.join()" msgstr "" -#: ../../howto/logging-cookbook.rst:1489 +#: ../../howto/logging-cookbook.rst:1486 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 " @@ -1908,36 +1905,36 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1496 +#: ../../howto/logging-cookbook.rst:1493 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1498 +#: ../../howto/logging-cookbook.rst:1495 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:1502 +#: ../../howto/logging-cookbook.rst:1499 msgid "queue = multiprocessing.Queue(-1)" msgstr "" -#: ../../howto/logging-cookbook.rst:1506 +#: ../../howto/logging-cookbook.rst:1503 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1508 +#: ../../howto/logging-cookbook.rst:1505 msgid "" "queue = multiprocessing.Manager().Queue(-1) # also works with the examples " "above" msgstr "" -#: ../../howto/logging-cookbook.rst:1512 +#: ../../howto/logging-cookbook.rst:1509 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1514 +#: ../../howto/logging-cookbook.rst:1511 msgid "" "workers = []\n" "for i in range(10):\n" @@ -1949,22 +1946,22 @@ msgid "" " w.join()" msgstr "" -#: ../../howto/logging-cookbook.rst:1523 +#: ../../howto/logging-cookbook.rst:1520 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1525 +#: ../../howto/logging-cookbook.rst:1522 msgid "" "with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" " for i in range(10):\n" " executor.submit(worker_process, queue, worker_configurer)" msgstr "" -#: ../../howto/logging-cookbook.rst:1530 +#: ../../howto/logging-cookbook.rst:1527 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1532 +#: ../../howto/logging-cookbook.rst:1529 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -1976,11 +1973,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1542 +#: ../../howto/logging-cookbook.rst:1539 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1547 +#: ../../howto/logging-cookbook.rst:1544 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, " @@ -1989,7 +1986,7 @@ msgid "" "usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1553 +#: ../../howto/logging-cookbook.rst:1550 msgid "" "import glob\n" "import logging\n" @@ -2018,13 +2015,13 @@ msgid "" " print(filename)" msgstr "" -#: ../../howto/logging-cookbook.rst:1579 +#: ../../howto/logging-cookbook.rst:1576 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1582 +#: ../../howto/logging-cookbook.rst:1579 msgid "" "logging_rotatingfile_example.out\n" "logging_rotatingfile_example.out.1\n" @@ -2034,7 +2031,7 @@ msgid "" "logging_rotatingfile_example.out.5" msgstr "" -#: ../../howto/logging-cookbook.rst:1591 +#: ../../howto/logging-cookbook.rst:1588 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 " @@ -2042,17 +2039,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1596 +#: ../../howto/logging-cookbook.rst:1593 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:1604 +#: ../../howto/logging-cookbook.rst:1601 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1606 +#: ../../howto/logging-cookbook.rst:1603 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -2061,7 +2058,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1612 +#: ../../howto/logging-cookbook.rst:1609 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -2074,7 +2071,7 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1622 +#: ../../howto/logging-cookbook.rst:1619 msgid "" ">>> import logging\n" ">>> root = logging.getLogger()\n" @@ -2099,21 +2096,21 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1646 +#: ../../howto/logging-cookbook.rst:1643 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:1650 +#: ../../howto/logging-cookbook.rst:1647 msgid "" ">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" "2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1654 +#: ../../howto/logging-cookbook.rst:1651 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -2129,7 +2126,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1667 +#: ../../howto/logging-cookbook.rst:1664 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 " @@ -2138,7 +2135,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1673 ../../howto/logging-cookbook.rst:2761 +#: ../../howto/logging-cookbook.rst:1670 ../../howto/logging-cookbook.rst:2758 msgid "" "class BraceMessage:\n" " def __init__(self, fmt, /, *args, **kwargs):\n" @@ -2176,7 +2173,7 @@ msgstr "" " from string import Template\n" " return Template(self.fmt).substitute(**self.kwargs)" -#: ../../howto/logging-cookbook.rst:1691 +#: ../../howto/logging-cookbook.rst:1688 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 " @@ -2187,14 +2184,14 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1699 +#: ../../howto/logging-cookbook.rst:1696 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:1703 +#: ../../howto/logging-cookbook.rst:1700 msgid "" ">>> from wherever import BraceMessage as __\n" ">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" @@ -2213,14 +2210,14 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1721 +#: ../../howto/logging-cookbook.rst:1718 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:1725 +#: ../../howto/logging-cookbook.rst:1722 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 " @@ -2231,13 +2228,13 @@ msgid "" "sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1733 +#: ../../howto/logging-cookbook.rst:1730 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:1736 +#: ../../howto/logging-cookbook.rst:1733 msgid "" "import logging\n" "\n" @@ -2266,17 +2263,17 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1762 +#: ../../howto/logging-cookbook.rst:1759 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.8 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1771 +#: ../../howto/logging-cookbook.rst:1768 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1773 +#: ../../howto/logging-cookbook.rst:1770 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:" @@ -2287,13 +2284,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1780 +#: ../../howto/logging-cookbook.rst:1777 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:1783 +#: ../../howto/logging-cookbook.rst:1780 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -2302,27 +2299,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1789 +#: ../../howto/logging-cookbook.rst:1786 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:1792 +#: ../../howto/logging-cookbook.rst:1789 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:1795 +#: ../../howto/logging-cookbook.rst:1792 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:1799 +#: ../../howto/logging-cookbook.rst:1796 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -2330,7 +2327,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1804 +#: ../../howto/logging-cookbook.rst:1801 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 " @@ -2339,11 +2336,11 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1810 +#: ../../howto/logging-cookbook.rst:1807 msgid "logger = logging.getLogger(__name__)" msgstr "logger = logging.getLogger(__name__)" -#: ../../howto/logging-cookbook.rst:1812 +#: ../../howto/logging-cookbook.rst:1809 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` " @@ -2353,7 +2350,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1818 +#: ../../howto/logging-cookbook.rst:1815 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 " @@ -2363,7 +2360,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1825 +#: ../../howto/logging-cookbook.rst:1822 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 " @@ -2371,7 +2368,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1829 +#: ../../howto/logging-cookbook.rst:1826 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -2383,7 +2380,7 @@ msgid "" "logging.setLogRecordFactory(record_factory)" msgstr "" -#: ../../howto/logging-cookbook.rst:1838 +#: ../../howto/logging-cookbook.rst:1835 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -2393,22 +2390,22 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1850 +#: ../../howto/logging-cookbook.rst:1847 msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1853 ../../howto/logging-cookbook.rst:1986 +#: ../../howto/logging-cookbook.rst:1850 ../../howto/logging-cookbook.rst:1983 msgid "Subclass ``QueueHandler``" msgstr "" -#: ../../howto/logging-cookbook.rst:1855 +#: ../../howto/logging-cookbook.rst:1852 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:1859 +#: ../../howto/logging-cookbook.rst:1856 msgid "" "import zmq # using pyzmq, the Python binding for ZeroMQ\n" "import json # for serializing records portably\n" @@ -2425,13 +2422,13 @@ msgid "" "handler = ZeroMQSocketHandler(sock)" msgstr "" -#: ../../howto/logging-cookbook.rst:1874 +#: ../../howto/logging-cookbook.rst:1871 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:1877 +#: ../../howto/logging-cookbook.rst:1874 msgid "" "class ZeroMQSocketHandler(QueueHandler):\n" " def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" @@ -2447,17 +2444,17 @@ msgid "" " self.queue.close()" msgstr "" -#: ../../howto/logging-cookbook.rst:1892 ../../howto/logging-cookbook.rst:1922 +#: ../../howto/logging-cookbook.rst:1889 ../../howto/logging-cookbook.rst:1919 msgid "Subclass ``QueueListener``" msgstr "" -#: ../../howto/logging-cookbook.rst:1894 +#: ../../howto/logging-cookbook.rst:1891 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:1897 +#: ../../howto/logging-cookbook.rst:1894 msgid "" "class ZeroMQSocketListener(QueueListener):\n" " def __init__(self, uri, /, *handlers, **kwargs):\n" @@ -2473,11 +2470,11 @@ msgid "" " return logging.makeLogRecord(msg)" msgstr "" -#: ../../howto/logging-cookbook.rst:1912 +#: ../../howto/logging-cookbook.rst:1909 msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" msgstr "" -#: ../../howto/logging-cookbook.rst:1914 +#: ../../howto/logging-cookbook.rst:1911 msgid "" "In a similar way to the above section, we can implement a listener and " "handler using :pypi:`pynng`, which is a Python binding to `NNG `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:2160 +#: ../../howto/logging-cookbook.rst:2157 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:2162 +#: ../../howto/logging-cookbook.rst:2159 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:2165 +#: ../../howto/logging-cookbook.rst:2162 msgid "" "import gzip\n" "import logging\n" @@ -2860,12 +2857,12 @@ msgstr "" "for i in range(1000):\n" " root.info(f'Message no. {i + 1}')" -#: ../../howto/logging-cookbook.rst:2193 +#: ../../howto/logging-cookbook.rst:2190 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2195 +#: ../../howto/logging-cookbook.rst:2192 msgid "" "$ ls rotated.log*\n" "rotated.log rotated.log.2.gz rotated.log.4.gz\n" @@ -2883,11 +2880,11 @@ msgstr "" "2023-01-20 02:28:17,767 Message no. 997\n" "2023-01-20 02:28:17,767 Message no. 998" -#: ../../howto/logging-cookbook.rst:2206 +#: ../../howto/logging-cookbook.rst:2203 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2208 +#: ../../howto/logging-cookbook.rst:2205 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -2895,7 +2892,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2213 +#: ../../howto/logging-cookbook.rst:2210 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 " @@ -2908,13 +2905,13 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2223 +#: ../../howto/logging-cookbook.rst:2220 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2226 +#: ../../howto/logging-cookbook.rst:2223 msgid "" "import logging\n" "import logging.config\n" @@ -3137,11 +3134,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2435 +#: ../../howto/logging-cookbook.rst:2432 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2437 +#: ../../howto/logging-cookbook.rst:2434 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 " @@ -3150,7 +3147,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2443 +#: ../../howto/logging-cookbook.rst:2440 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 " @@ -3158,7 +3155,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2449 +#: ../../howto/logging-cookbook.rst:2446 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 " @@ -3167,37 +3164,37 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2455 +#: ../../howto/logging-cookbook.rst:2452 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:2459 +#: ../../howto/logging-cookbook.rst:2456 msgid "'ASCII section\\ufeffUnicode section'" msgstr "" -#: ../../howto/logging-cookbook.rst:2461 +#: ../../howto/logging-cookbook.rst:2458 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:2464 +#: ../../howto/logging-cookbook.rst:2461 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:2468 +#: ../../howto/logging-cookbook.rst:2465 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:2472 +#: ../../howto/logging-cookbook.rst:2469 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -3206,11 +3203,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2479 +#: ../../howto/logging-cookbook.rst:2476 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2481 +#: ../../howto/logging-cookbook.rst:2478 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -3222,7 +3219,7 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2489 +#: ../../howto/logging-cookbook.rst:2486 msgid "" "import json\n" "import logging\n" @@ -3241,11 +3238,11 @@ msgid "" "logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2502 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2507 +#: ../../howto/logging-cookbook.rst:2504 msgid "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" @@ -3253,19 +3250,19 @@ msgstr "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" -#: ../../howto/logging-cookbook.rst:2511 ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2508 ../../howto/logging-cookbook.rst:2550 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2511 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:2517 +#: ../../howto/logging-cookbook.rst:2514 msgid "" "import json\n" "import logging\n" @@ -3298,19 +3295,19 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2547 +#: ../../howto/logging-cookbook.rst:2544 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2546 msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" msgstr "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" -#: ../../howto/logging-cookbook.rst:2562 +#: ../../howto/logging-cookbook.rst:2559 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2564 +#: ../../howto/logging-cookbook.rst:2561 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 " @@ -3320,7 +3317,7 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2571 +#: ../../howto/logging-cookbook.rst:2568 msgid "" "def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" " if owner:\n" @@ -3336,13 +3333,13 @@ msgstr "" " shutil.chown(filename, *owner)\n" " return logging.FileHandler(filename, mode, encoding)" -#: ../../howto/logging-cookbook.rst:2578 +#: ../../howto/logging-cookbook.rst:2575 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:2581 +#: ../../howto/logging-cookbook.rst:2578 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -3375,14 +3372,14 @@ msgid "" "}" msgstr "" -#: ../../howto/logging-cookbook.rst:2611 +#: ../../howto/logging-cookbook.rst:2608 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:2615 +#: ../../howto/logging-cookbook.rst:2612 msgid "" "import logging, logging.config, os, shutil\n" "\n" @@ -3428,11 +3425,11 @@ msgid "" "logger.debug('A debug message')" msgstr "" -#: ../../howto/logging-cookbook.rst:2658 +#: ../../howto/logging-cookbook.rst:2655 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2660 +#: ../../howto/logging-cookbook.rst:2657 msgid "" "$ sudo python3.3 chowntest.py\n" "$ cat chowntest.log\n" @@ -3441,7 +3438,7 @@ msgid "" "-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" msgstr "" -#: ../../howto/logging-cookbook.rst:2668 +#: ../../howto/logging-cookbook.rst:2665 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 " @@ -3450,25 +3447,25 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2674 +#: ../../howto/logging-cookbook.rst:2671 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:2677 +#: ../../howto/logging-cookbook.rst:2674 msgid "'()': owned_file_handler," msgstr "'()': owned_file_handler," -#: ../../howto/logging-cookbook.rst:2679 +#: ../../howto/logging-cookbook.rst:2676 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2681 +#: ../../howto/logging-cookbook.rst:2678 msgid "'()': 'ext://project.util.owned_file_handler'," msgstr "'()': 'ext://project.util.owned_file_handler'," -#: ../../howto/logging-cookbook.rst:2683 +#: ../../howto/logging-cookbook.rst:2680 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://" @@ -3476,25 +3473,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2688 +#: ../../howto/logging-cookbook.rst:2685 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:2692 +#: ../../howto/logging-cookbook.rst:2689 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:2702 +#: ../../howto/logging-cookbook.rst:2699 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2704 +#: ../../howto/logging-cookbook.rst:2701 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -3505,7 +3502,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:2708 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -3520,7 +3517,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2723 +#: ../../howto/logging-cookbook.rst:2720 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -3528,7 +3525,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2727 +#: ../../howto/logging-cookbook.rst:2724 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 " @@ -3536,11 +3533,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2734 +#: ../../howto/logging-cookbook.rst:2731 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2736 +#: ../../howto/logging-cookbook.rst:2733 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 " @@ -3555,17 +3552,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2747 +#: ../../howto/logging-cookbook.rst:2744 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2752 +#: ../../howto/logging-cookbook.rst:2749 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2754 +#: ../../howto/logging-cookbook.rst:2751 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -3575,7 +3572,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2779 +#: ../../howto/logging-cookbook.rst:2776 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 " @@ -3586,13 +3583,13 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2787 +#: ../../howto/logging-cookbook.rst:2784 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2790 +#: ../../howto/logging-cookbook.rst:2787 msgid "" ">>> __ = BraceMessage\n" ">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" @@ -3607,11 +3604,11 @@ msgid "" "Message with coordinates: (0.50, 0.50)" msgstr "" -#: ../../howto/logging-cookbook.rst:2801 +#: ../../howto/logging-cookbook.rst:2798 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2803 +#: ../../howto/logging-cookbook.rst:2800 msgid "" ">>> __ = DollarMessage\n" ">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" @@ -3619,7 +3616,7 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:2808 +#: ../../howto/logging-cookbook.rst:2805 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 " @@ -3631,11 +3628,11 @@ msgid "" "shown above." msgstr "" -#: ../../howto/logging-cookbook.rst:2822 +#: ../../howto/logging-cookbook.rst:2819 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2824 +#: ../../howto/logging-cookbook.rst:2821 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). " @@ -3650,7 +3647,7 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2835 +#: ../../howto/logging-cookbook.rst:2832 msgid "" "import logging\n" "import logging.config\n" @@ -3736,26 +3733,26 @@ msgstr "" " logging.debug('hello')\n" " logging.debug('hello - noshow')" -#: ../../howto/logging-cookbook.rst:2877 +#: ../../howto/logging-cookbook.rst:2874 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:2881 +#: ../../howto/logging-cookbook.rst:2878 msgid "changed: hello" msgstr "changed: hello" -#: ../../howto/logging-cookbook.rst:2885 +#: ../../howto/logging-cookbook.rst:2882 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2887 +#: ../../howto/logging-cookbook.rst:2884 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2889 +#: ../../howto/logging-cookbook.rst:2886 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 " @@ -3765,7 +3762,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2896 +#: ../../howto/logging-cookbook.rst:2893 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 " @@ -3774,11 +3771,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2905 +#: ../../howto/logging-cookbook.rst:2902 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2907 +#: ../../howto/logging-cookbook.rst:2904 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, " @@ -3786,7 +3783,7 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2912 +#: ../../howto/logging-cookbook.rst:2909 msgid "" "import logging\n" "\n" @@ -3825,11 +3822,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2948 +#: ../../howto/logging-cookbook.rst:2945 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2950 +#: ../../howto/logging-cookbook.rst:2947 msgid "" "28/01/2015 07:21:23|INFO|Sample message|\n" "28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by " @@ -3843,18 +3840,18 @@ msgstr "" "in main\\n x = 1 / 0\\nZeroDivisionError: integer division or modulo by " "zero'|" -#: ../../howto/logging-cookbook.rst:2955 +#: ../../howto/logging-cookbook.rst:2952 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:2962 +#: ../../howto/logging-cookbook.rst:2959 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2964 +#: ../../howto/logging-cookbook.rst:2961 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 " @@ -3871,7 +3868,7 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2977 +#: ../../howto/logging-cookbook.rst:2974 msgid "" "import logging\n" "import subprocess\n" @@ -3903,24 +3900,24 @@ msgid "" " sys.exit(main())" msgstr "" -#: ../../howto/logging-cookbook.rst:3006 +#: ../../howto/logging-cookbook.rst:3003 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:3008 +#: ../../howto/logging-cookbook.rst:3005 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:3016 +#: ../../howto/logging-cookbook.rst:3013 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:3018 +#: ../../howto/logging-cookbook.rst:3015 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 " @@ -3930,7 +3927,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:3025 +#: ../../howto/logging-cookbook.rst:3022 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 " @@ -3943,7 +3940,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:3035 +#: ../../howto/logging-cookbook.rst:3032 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 " @@ -3952,7 +3949,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:3041 +#: ../../howto/logging-cookbook.rst:3038 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 " @@ -3964,11 +3961,11 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:3049 +#: ../../howto/logging-cookbook.rst:3046 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:3051 +#: ../../howto/logging-cookbook.rst:3048 msgid "" "import logging\n" "from logging.handlers import MemoryHandler\n" @@ -4034,11 +4031,11 @@ msgid "" " assert decorated_foo(True)" msgstr "" -#: ../../howto/logging-cookbook.rst:3112 +#: ../../howto/logging-cookbook.rst:3109 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:3114 +#: ../../howto/logging-cookbook.rst:3111 msgid "" "Calling undecorated foo with False\n" "about to log at DEBUG ...\n" @@ -4067,29 +4064,29 @@ msgid "" "Actually logged at CRITICAL" msgstr "" -#: ../../howto/logging-cookbook.rst:3142 +#: ../../howto/logging-cookbook.rst:3139 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:3146 +#: ../../howto/logging-cookbook.rst:3143 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:3148 +#: ../../howto/logging-cookbook.rst:3145 msgid "" "@log_if_errors(logger)\n" "def foo(fail=False):\n" " ..." msgstr "" -#: ../../howto/logging-cookbook.rst:3156 +#: ../../howto/logging-cookbook.rst:3153 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:3158 +#: ../../howto/logging-cookbook.rst:3155 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." @@ -4100,7 +4097,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3166 +#: ../../howto/logging-cookbook.rst:3163 msgid "" "import logging\n" "import logging.handlers\n" @@ -4168,7 +4165,7 @@ msgid "" " h.close()" msgstr "" -#: ../../howto/logging-cookbook.rst:3230 +#: ../../howto/logging-cookbook.rst:3227 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 " @@ -4176,17 +4173,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3238 +#: ../../howto/logging-cookbook.rst:3235 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3240 +#: ../../howto/logging-cookbook.rst:3237 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:3243 +#: ../../howto/logging-cookbook.rst:3240 msgid "" "import logging\n" "import time\n" @@ -4195,7 +4192,7 @@ msgid "" " converter = time.gmtime" msgstr "" -#: ../../howto/logging-cookbook.rst:3249 +#: ../../howto/logging-cookbook.rst:3246 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 " @@ -4203,7 +4200,7 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3254 +#: ../../howto/logging-cookbook.rst:3251 msgid "" "import logging\n" "import logging.config\n" @@ -4244,27 +4241,27 @@ msgid "" " logging.warning('The local time is %s', time.asctime())" msgstr "" -#: ../../howto/logging-cookbook.rst:3292 +#: ../../howto/logging-cookbook.rst:3289 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3294 +#: ../../howto/logging-cookbook.rst:3291 msgid "" "2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" "2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgstr "" -#: ../../howto/logging-cookbook.rst:3299 +#: ../../howto/logging-cookbook.rst:3296 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3306 +#: ../../howto/logging-cookbook.rst:3303 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3308 +#: ../../howto/logging-cookbook.rst:3305 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 " @@ -4274,7 +4271,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3315 +#: ../../howto/logging-cookbook.rst:3312 msgid "" "import logging\n" "import sys\n" @@ -4303,7 +4300,7 @@ msgid "" " # implicit return of None => don't swallow exceptions" msgstr "" -#: ../../howto/logging-cookbook.rst:3341 +#: ../../howto/logging-cookbook.rst:3338 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 " @@ -4312,13 +4309,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3347 +#: ../../howto/logging-cookbook.rst:3344 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3350 +#: ../../howto/logging-cookbook.rst:3347 msgid "" "if __name__ == '__main__':\n" " logger = logging.getLogger('foo')\n" @@ -4338,7 +4335,7 @@ msgid "" " logger.debug('7. This should not appear.')" msgstr "" -#: ../../howto/logging-cookbook.rst:3365 +#: ../../howto/logging-cookbook.rst:3362 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 " @@ -4351,11 +4348,11 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3375 +#: ../../howto/logging-cookbook.rst:3372 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3377 +#: ../../howto/logging-cookbook.rst:3374 msgid "" "$ python logctx.py\n" "1. This should appear just once on stderr.\n" @@ -4365,23 +4362,23 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: ../../howto/logging-cookbook.rst:3386 +#: ../../howto/logging-cookbook.rst:3383 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:3389 +#: ../../howto/logging-cookbook.rst:3386 msgid "" "$ python logctx.py 2>/dev/null\n" "5. This should appear twice - once on stderr and once on stdout." msgstr "" -#: ../../howto/logging-cookbook.rst:3394 +#: ../../howto/logging-cookbook.rst:3391 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3396 +#: ../../howto/logging-cookbook.rst:3393 msgid "" "$ python logctx.py >/dev/null\n" "1. This should appear just once on stderr.\n" @@ -4390,42 +4387,42 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: ../../howto/logging-cookbook.rst:3404 +#: ../../howto/logging-cookbook.rst:3401 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3406 +#: ../../howto/logging-cookbook.rst:3403 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:3414 +#: ../../howto/logging-cookbook.rst:3411 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3416 +#: ../../howto/logging-cookbook.rst:3413 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3418 +#: ../../howto/logging-cookbook.rst:3415 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3419 +#: ../../howto/logging-cookbook.rst:3416 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3421 +#: ../../howto/logging-cookbook.rst:3418 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3423 +#: ../../howto/logging-cookbook.rst:3420 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 " @@ -4436,7 +4433,7 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3431 +#: ../../howto/logging-cookbook.rst:3428 msgid "" "import argparse\n" "import importlib\n" @@ -4483,13 +4480,13 @@ msgid "" " sys.exit(main())" msgstr "" -#: ../../howto/logging-cookbook.rst:3472 +#: ../../howto/logging-cookbook.rst:3469 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3475 +#: ../../howto/logging-cookbook.rst:3472 msgid "" "# start.py\n" "import logging\n" @@ -4502,11 +4499,11 @@ msgid "" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" -#: ../../howto/logging-cookbook.rst:3485 +#: ../../howto/logging-cookbook.rst:3482 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3487 +#: ../../howto/logging-cookbook.rst:3484 msgid "" "# stop.py\n" "import logging\n" @@ -4528,11 +4525,11 @@ msgid "" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" -#: ../../howto/logging-cookbook.rst:3506 +#: ../../howto/logging-cookbook.rst:3503 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3508 +#: ../../howto/logging-cookbook.rst:3505 msgid "" "# restart.py\n" "import logging\n" @@ -4554,13 +4551,13 @@ msgid "" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" -#: ../../howto/logging-cookbook.rst:3527 +#: ../../howto/logging-cookbook.rst:3524 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3529 +#: ../../howto/logging-cookbook.rst:3526 msgid "" "$ python app.py start foo\n" "INFO start Started the 'foo' service.\n" @@ -4572,19 +4569,19 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: ../../howto/logging-cookbook.rst:3540 +#: ../../howto/logging-cookbook.rst:3537 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:3543 +#: ../../howto/logging-cookbook.rst:3540 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:3546 +#: ../../howto/logging-cookbook.rst:3543 msgid "" "$ python app.py --log-level DEBUG start foo\n" "DEBUG start About to start foo\n" @@ -4599,28 +4596,28 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: ../../howto/logging-cookbook.rst:3560 +#: ../../howto/logging-cookbook.rst:3557 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3562 +#: ../../howto/logging-cookbook.rst:3559 msgid "" "$ python app.py --log-level WARNING start foo\n" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" -#: ../../howto/logging-cookbook.rst:3568 +#: ../../howto/logging-cookbook.rst:3565 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:3574 +#: ../../howto/logging-cookbook.rst:3571 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3576 +#: ../../howto/logging-cookbook.rst:3573 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-" @@ -4628,7 +4625,7 @@ msgid "" "`PyQt5` libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3581 +#: ../../howto/logging-cookbook.rst:3578 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 " @@ -4638,14 +4635,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3588 +#: ../../howto/logging-cookbook.rst:3585 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:3592 +#: ../../howto/logging-cookbook.rst:3589 msgid "" "The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " "``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " @@ -4653,7 +4650,7 @@ msgid "" "more detailed information." msgstr "" -#: ../../howto/logging-cookbook.rst:3597 +#: ../../howto/logging-cookbook.rst:3594 msgid "" "import datetime\n" "import logging\n" @@ -4904,11 +4901,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:3829 +#: ../../howto/logging-cookbook.rst:3826 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3831 +#: ../../howto/logging-cookbook.rst:3828 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -4918,14 +4915,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3838 +#: ../../howto/logging-cookbook.rst:3835 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:3842 +#: ../../howto/logging-cookbook.rst:3839 msgid "" "import datetime\n" "import logging.handlers\n" @@ -4995,7 +4992,7 @@ msgid "" "{sdata} {msg}'" msgstr "" -#: ../../howto/logging-cookbook.rst:3904 +#: ../../howto/logging-cookbook.rst:3901 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 " @@ -5004,7 +5001,7 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3909 +#: ../../howto/logging-cookbook.rst:3906 msgid "" "sd = {\n" " 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" @@ -5015,11 +5012,11 @@ msgid "" "logger.debug('Message %d', i, extra=extra)" msgstr "" -#: ../../howto/logging-cookbook.rst:3918 +#: ../../howto/logging-cookbook.rst:3915 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3920 +#: ../../howto/logging-cookbook.rst:3917 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 " @@ -5027,7 +5024,7 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3925 +#: ../../howto/logging-cookbook.rst:3922 msgid "" "import logging\n" "\n" @@ -5065,23 +5062,23 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:3960 +#: ../../howto/logging-cookbook.rst:3957 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3962 +#: ../../howto/logging-cookbook.rst:3959 msgid "" "INFO:demo:An INFO message\n" "DEBUG:demo:A DEBUG message" msgstr "" -#: ../../howto/logging-cookbook.rst:3967 +#: ../../howto/logging-cookbook.rst:3964 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3970 +#: ../../howto/logging-cookbook.rst:3967 msgid "" "import sys\n" "\n" @@ -5089,7 +5086,7 @@ msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)" msgstr "" -#: ../../howto/logging-cookbook.rst:3977 +#: ../../howto/logging-cookbook.rst:3974 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." @@ -5097,7 +5094,7 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3982 +#: ../../howto/logging-cookbook.rst:3979 msgid "" ">>> print('Foo')\n" "INFO:demo:Foo\n" @@ -5106,31 +5103,31 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:3990 +#: ../../howto/logging-cookbook.rst:3987 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:3994 +#: ../../howto/logging-cookbook.rst:3991 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:3998 +#: ../../howto/logging-cookbook.rst:3995 msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" -#: ../../howto/logging-cookbook.rst:4003 +#: ../../howto/logging-cookbook.rst:4000 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:4005 +#: ../../howto/logging-cookbook.rst:4002 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "\n" @@ -5149,7 +5146,7 @@ msgid "" "WARNING:demo:division by zero" msgstr "" -#: ../../howto/logging-cookbook.rst:4021 +#: ../../howto/logging-cookbook.rst:4018 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -5159,7 +5156,7 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:4027 +#: ../../howto/logging-cookbook.rst:4024 msgid "" "class BufferingLoggerWriter(LoggerWriter):\n" " def __init__(self, logger, level):\n" @@ -5179,13 +5176,13 @@ msgid "" " self.logger.log(self.level, part)" msgstr "" -#: ../../howto/logging-cookbook.rst:4046 +#: ../../howto/logging-cookbook.rst:4043 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:4049 +#: ../../howto/logging-cookbook.rst:4046 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " @@ -5197,11 +5194,11 @@ msgid "" "WARNING:demo:ZeroDivisionError: division by zero" msgstr "" -#: ../../howto/logging-cookbook.rst:4062 +#: ../../howto/logging-cookbook.rst:4059 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:4064 +#: ../../howto/logging-cookbook.rst:4061 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 " @@ -5209,11 +5206,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:4070 +#: ../../howto/logging-cookbook.rst:4067 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:4072 +#: ../../howto/logging-cookbook.rst:4069 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. " @@ -5221,32 +5218,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:4077 +#: ../../howto/logging-cookbook.rst:4074 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:4080 +#: ../../howto/logging-cookbook.rst:4077 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:4083 +#: ../../howto/logging-cookbook.rst:4080 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:4087 +#: ../../howto/logging-cookbook.rst:4084 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:4090 +#: ../../howto/logging-cookbook.rst:4087 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 " @@ -5255,7 +5252,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:4096 +#: ../../howto/logging-cookbook.rst:4093 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 " @@ -5265,17 +5262,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:4103 +#: ../../howto/logging-cookbook.rst:4100 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:4107 +#: ../../howto/logging-cookbook.rst:4104 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:4109 +#: ../../howto/logging-cookbook.rst:4106 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 " @@ -5286,13 +5283,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:4118 +#: ../../howto/logging-cookbook.rst:4115 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: ../../howto/logging-cookbook.rst:4120 +#: ../../howto/logging-cookbook.rst:4117 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5300,11 +5297,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:4126 +#: ../../howto/logging-cookbook.rst:4123 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:4128 +#: ../../howto/logging-cookbook.rst:4125 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. " @@ -5315,38 +5312,38 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:4139 +#: ../../howto/logging-cookbook.rst:4136 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:4143 +#: ../../howto/logging-cookbook.rst:4140 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:4144 +#: ../../howto/logging-cookbook.rst:4141 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4146 +#: ../../howto/logging-cookbook.rst:4143 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:4147 +#: ../../howto/logging-cookbook.rst:4144 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4149 +#: ../../howto/logging-cookbook.rst:4146 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:4150 +#: ../../howto/logging-cookbook.rst:4147 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4152 +#: ../../howto/logging-cookbook.rst:4149 msgid ":ref:`Basic Tutorial `" msgstr ":ref:`基礎教學 `" -#: ../../howto/logging-cookbook.rst:4154 +#: ../../howto/logging-cookbook.rst:4151 msgid ":ref:`Advanced Tutorial `" msgstr ":ref:`進階教學 `" diff --git a/library/aifc.po b/library/aifc.po index e5750661b5..554a31336c 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,267 +20,50 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/aifc.rst:2 -msgid ":mod:`aifc` --- Read and write AIFF and AIFC files" +#, fuzzy +msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" msgstr ":mod:`aifc` --- 讀寫 AIFF 與 AIFC 檔案" -#: ../../library/aifc.rst:8 -msgid "**Source code:** :source:`Lib/aifc.py`" -msgstr "**原始碼:**\\ :source:`Lib/aifc.py`" - -#: ../../library/aifc.rst:16 -msgid "" -"The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " -"details)." -msgstr "" -":mod:`aifc` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#aifc>`\\ )。" - -#: ../../library/aifc.rst:22 -msgid "" -"This module provides support for reading and writing AIFF and AIFF-C files. " -"AIFF is Audio Interchange File Format, a format for storing digital audio " -"samples in a file. AIFF-C is a newer version of the format that includes " -"the ability to compress the audio data." -msgstr "" - -#: ../../library/aifc.rst:27 -msgid "" -"Audio files have a number of parameters that describe the audio data. The " -"sampling rate or frame rate is the number of times per second the sound is " -"sampled. The number of channels indicate if the audio is mono, stereo, or " -"quadro. Each frame consists of one sample per channel. The sample size is " -"the size in bytes of each sample. Thus a frame consists of ``nchannels * " -"samplesize`` bytes, and a second's worth of audio consists of ``nchannels * " -"samplesize * framerate`` bytes." -msgstr "" - -#: ../../library/aifc.rst:35 -msgid "" -"For example, CD quality audio has a sample size of two bytes (16 bits), uses " -"two channels (stereo) and has a frame rate of 44,100 frames/second. This " -"gives a frame size of 4 bytes (2\\*2), and a second's worth occupies " -"2\\*2\\*44100 bytes (176,400 bytes)." -msgstr "" - -#: ../../library/aifc.rst:40 -msgid "Module :mod:`aifc` defines the following function:" -msgstr ":mod:`aifc` 模組定義了以下函式:" - -#: ../../library/aifc.rst:45 -msgid "" -"Open an AIFF or AIFF-C file and return an object instance with methods that " -"are described below. The argument *file* is either a string naming a file " -"or a :term:`file object`. *mode* must be ``'r'`` or ``'rb'`` when the file " -"must be opened for reading, or ``'w'`` or ``'wb'`` when the file must be " -"opened for writing. If omitted, ``file.mode`` is used if it exists, " -"otherwise ``'rb'`` is used. When used for writing, the file object should " -"be seekable, unless you know ahead of time how many samples you are going to " -"write in total and use :meth:`writeframesraw` and :meth:`setnframes`. The :" -"func:`.open` function may be used in a :keyword:`with` statement. When the :" -"keyword:`!with` block completes, the :meth:`~aifc.close` method is called." -msgstr "" - -#: ../../library/aifc.rst:56 -msgid "Support for the :keyword:`with` statement was added." -msgstr "" - -#: ../../library/aifc.rst:59 -msgid "" -"Objects returned by :func:`.open` when a file is opened for reading have the " -"following methods:" -msgstr "" - -#: ../../library/aifc.rst:65 -msgid "Return the number of audio channels (1 for mono, 2 for stereo)." -msgstr "" - -#: ../../library/aifc.rst:70 -msgid "Return the size in bytes of individual samples." -msgstr "" - -#: ../../library/aifc.rst:75 -msgid "Return the sampling rate (number of audio frames per second)." -msgstr "" - -#: ../../library/aifc.rst:80 -msgid "Return the number of audio frames in the file." -msgstr "" - -#: ../../library/aifc.rst:85 -msgid "" -"Return a bytes array of length 4 describing the type of compression used in " -"the audio file. For AIFF files, the returned value is ``b'NONE'``." -msgstr "" - -#: ../../library/aifc.rst:92 -msgid "" -"Return a bytes array convertible to a human-readable description of the type " -"of compression used in the audio file. For AIFF files, the returned value " -"is ``b'not compressed'``." -msgstr "" - -#: ../../library/aifc.rst:99 -msgid "" -"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " -"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" -"`get\\*` methods." -msgstr "" - -#: ../../library/aifc.rst:106 -msgid "" -"Return a list of markers in the audio file. A marker consists of a tuple of " -"three elements. The first is the mark ID (an integer), the second is the " -"mark position in frames from the beginning of the data (an integer), the " -"third is the name of the mark (a string)." -msgstr "" - -#: ../../library/aifc.rst:114 -msgid "" -"Return the tuple as described in :meth:`getmarkers` for the mark with the " -"given *id*." -msgstr "" - -#: ../../library/aifc.rst:120 -msgid "" -"Read and return the next *nframes* frames from the audio file. The returned " -"data is a string containing for each frame the uncompressed samples of all " -"channels." -msgstr "" - -#: ../../library/aifc.rst:127 -msgid "" -"Rewind the read pointer. The next :meth:`readframes` will start from the " -"beginning." -msgstr "" - -#: ../../library/aifc.rst:133 -msgid "Seek to the specified frame number." -msgstr "" - -#: ../../library/aifc.rst:138 -msgid "Return the current frame number." -msgstr "" - -#: ../../library/aifc.rst:143 -msgid "" -"Close the AIFF file. After calling this method, the object can no longer be " -"used." -msgstr "" - -#: ../../library/aifc.rst:146 -msgid "" -"Objects returned by :func:`.open` when a file is opened for writing have all " -"the above methods, except for :meth:`readframes` and :meth:`setpos`. In " -"addition the following methods exist. The :meth:`get\\*` methods can only " -"be called after the corresponding :meth:`set\\*` methods have been called. " -"Before the first :meth:`writeframes` or :meth:`writeframesraw`, all " -"parameters except for the number of frames must be filled in." -msgstr "" - -#: ../../library/aifc.rst:156 -msgid "" -"Create an AIFF file. The default is that an AIFF-C file is created, unless " -"the name of the file ends in ``'.aiff'`` in which case the default is an " -"AIFF file." -msgstr "" - -#: ../../library/aifc.rst:162 -msgid "" -"Create an AIFF-C file. The default is that an AIFF-C file is created, " -"unless the name of the file ends in ``'.aiff'`` in which case the default is " -"an AIFF file." -msgstr "" - -#: ../../library/aifc.rst:169 -msgid "Specify the number of channels in the audio file." -msgstr "" - -#: ../../library/aifc.rst:174 -msgid "Specify the size in bytes of audio samples." -msgstr "" - -#: ../../library/aifc.rst:179 -msgid "Specify the sampling frequency in frames per second." -msgstr "" - -#: ../../library/aifc.rst:184 -msgid "" -"Specify the number of frames that are to be written to the audio file. If " -"this parameter is not set, or not set correctly, the file needs to support " -"seeking." -msgstr "" - -#: ../../library/aifc.rst:195 -msgid "" -"Specify the compression type. If not specified, the audio data will not be " -"compressed. In AIFF files, compression is not possible. The name parameter " -"should be a human-readable description of the compression type as a bytes " -"array, the type parameter should be a bytes array of length 4. Currently " -"the following compression types are supported: ``b'NONE'``, ``b'ULAW'``, " -"``b'ALAW'``, ``b'G722'``." -msgstr "" - -#: ../../library/aifc.rst:205 -msgid "" -"Set all the above parameters at once. The argument is a tuple consisting of " -"the various parameters. This means that it is possible to use the result of " -"a :meth:`getparams` call as argument to :meth:`setparams`." -msgstr "" - -#: ../../library/aifc.rst:212 -msgid "" -"Add a mark with the given id (larger than 0), and the given name at the " -"given position. This method can be called at any time before :meth:`close`." -msgstr "" - -#: ../../library/aifc.rst:219 +#: ../../library/aifc.rst:10 msgid "" -"Return the current write position in the output file. Useful in combination " -"with :meth:`setmark`." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/aifc.rst:225 +#: ../../library/aifc.rst:14 msgid "" -"Write data to the output file. This method can only be called after the " -"audio file parameters have been set." +"The last version of Python that provided the :mod:`!aifc` module was `Python " +"3.12 `_." msgstr "" -#: ../../library/aifc.rst:228 ../../library/aifc.rst:237 -msgid "Any :term:`bytes-like object` is now accepted." -msgstr "" +#~ msgid "**Source code:** :source:`Lib/aifc.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/aifc.py`" -#: ../../library/aifc.rst:234 -msgid "" -"Like :meth:`writeframes`, except that the header of the audio file is not " -"updated." -msgstr "" +#~ msgid "" +#~ "The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " +#~ "details)." +#~ msgstr "" +#~ ":mod:`aifc` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#aifc>`\\ )。" -#: ../../library/aifc.rst:244 -msgid "" -"Close the AIFF file. The header of the file is updated to reflect the " -"actual size of the audio data. After calling this method, the object can no " -"longer be used." -msgstr "" +#~ msgid "Module :mod:`aifc` defines the following function:" +#~ msgstr ":mod:`aifc` 模組定義了以下函式:" -#: ../../library/aifc.rst:10 -msgid "Audio Interchange File Format" -msgstr "Audio Interchange File Format(音訊交換檔案格式)" +#~ msgid "Audio Interchange File Format" +#~ msgstr "Audio Interchange File Format(音訊交換檔案格式)" -#: ../../library/aifc.rst:10 -msgid "AIFF" -msgstr "AIFF" +#~ msgid "AIFF" +#~ msgstr "AIFF" -#: ../../library/aifc.rst:10 -msgid "AIFF-C" -msgstr "AIFF-C" +#~ msgid "AIFF-C" +#~ msgstr "AIFF-C" -#: ../../library/aifc.rst:190 -msgid "u-LAW" -msgstr "u-LAW" +#~ msgid "u-LAW" +#~ msgstr "u-LAW" -#: ../../library/aifc.rst:190 -msgid "A-LAW" -msgstr "A-LAW" +#~ msgid "A-LAW" +#~ msgstr "A-LAW" -#: ../../library/aifc.rst:190 -msgid "G.722" -msgstr "G.722" +#~ msgid "G.722" +#~ msgstr "G.722" diff --git a/library/argparse.po b/library/argparse.po index bd169b42cb..2d5ad6cd0f 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -94,8 +94,9 @@ msgstr "" #: ../../library/argparse.rst:53 msgid "" -"If you're looking a guide about how to upgrade optparse code to argparse, " -"see :ref:`Upgrading Optparse Code `." +"If you're looking for a guide about how to upgrade :mod:`optparse` code to :" +"mod:`!argparse`, see :ref:`Upgrading Optparse Code `." msgstr "" #: ../../library/argparse.rst:57 @@ -176,8 +177,8 @@ msgstr "" #: ../../library/argparse.rst:103 msgid "" -"exit_on_error_ - Determines whether or not ArgumentParser exits with error " -"info when an error occurs. (default: ``True``)" +"exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " +"with error info when an error occurs. (default: ``True``)" msgstr "" #: ../../library/argparse.rst:106 @@ -615,7 +616,7 @@ msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " "for options like ``+f`` or ``/foo``, may specify them using the " -"``prefix_chars=`` argument to the ArgumentParser constructor::" +"``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" msgstr "" #: ../../library/argparse.rst:377 @@ -843,9 +844,9 @@ msgstr "add_help" #: ../../library/argparse.rst:506 msgid "" -"By default, ArgumentParser objects add an option which simply displays the " -"parser's help message. If ``-h`` or ``--help`` is supplied at the command " -"line, the ArgumentParser help will be printed." +"By default, :class:`ArgumentParser` objects add an option which simply " +"displays the parser's help message. If ``-h`` or ``--help`` is supplied at " +"the command line, the :class:`!ArgumentParser` help will be printed." msgstr "" #: ../../library/argparse.rst:510 @@ -952,8 +953,8 @@ msgstr "" #: ../../library/argparse.rst:569 msgid "" -"`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " -"or ``-f, --foo``." +"`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " +"or ``'-f', '--foo'``." msgstr "" #: ../../library/argparse.rst:572 @@ -1262,15 +1263,15 @@ msgid "" "``'append'`` or ``'extend'``) can be used with positional arguments." msgstr "" -#: ../../library/argparse.rst:738 +#: ../../library/argparse.rst:740 msgid "" -"You may also specify an arbitrary action by passing an Action subclass or " -"other object that implements the same interface. The " -"``BooleanOptionalAction`` is available in ``argparse`` and adds support for " +"You may also specify an arbitrary action by passing an :class:`Action` " +"subclass or other object that implements the same interface. The :class:`!" +"BooleanOptionalAction` is available in :mod:`!argparse` and adds support for " "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:743 +#: ../../library/argparse.rst:745 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1284,18 +1285,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:751 +#: ../../library/argparse.rst:753 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " -"overriding the ``__call__`` method and optionally the ``__init__`` and " -"``format_usage`` methods." +"overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " +"and :meth:`!format_usage` methods." msgstr "" -#: ../../library/argparse.rst:755 +#: ../../library/argparse.rst:757 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:759 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1316,29 +1317,30 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:775 +#: ../../library/argparse.rst:777 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:781 +#: ../../library/argparse.rst:783 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:783 +#: ../../library/argparse.rst:785 msgid "" -"ArgumentParser objects usually associate a single command-line argument with " -"a single action to be taken. The ``nargs`` keyword argument associates a " -"different number of command-line arguments with a single action. See also :" -"ref:`specifying-ambiguous-arguments`. The supported values are:" +":class:`ArgumentParser` objects usually associate a single command-line " +"argument with a single action to be taken. The ``nargs`` keyword argument " +"associates a different number of command-line arguments with a single " +"action. See also :ref:`specifying-ambiguous-arguments`. The supported values " +"are:" msgstr "" -#: ../../library/argparse.rst:788 +#: ../../library/argparse.rst:790 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:791 +#: ../../library/argparse.rst:793 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1352,13 +1354,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:797 +#: ../../library/argparse.rst:799 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:802 +#: ../../library/argparse.rst:804 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1368,7 +1370,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:809 +#: ../../library/argparse.rst:811 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1390,13 +1392,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:819 +#: ../../library/argparse.rst:821 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:822 +#: ../../library/argparse.rst:824 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1422,7 +1424,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:836 +#: ../../library/argparse.rst:838 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1430,7 +1432,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:841 +#: ../../library/argparse.rst:843 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1446,14 +1448,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:852 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:854 +#: ../../library/argparse.rst:856 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1471,7 +1473,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:862 +#: ../../library/argparse.rst:864 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1480,11 +1482,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:872 +#: ../../library/argparse.rst:874 msgid "const" msgstr "" -#: ../../library/argparse.rst:874 +#: ../../library/argparse.rst:876 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1492,7 +1494,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:878 +#: ../../library/argparse.rst:880 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1502,7 +1504,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:886 +#: ../../library/argparse.rst:888 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1512,17 +1514,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:895 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:900 +#: ../../library/argparse.rst:902 msgid "default" msgstr "" -#: ../../library/argparse.rst:902 +#: ../../library/argparse.rst:904 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1532,7 +1534,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:909 +#: ../../library/argparse.rst:911 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1548,13 +1550,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:916 +#: ../../library/argparse.rst:918 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:919 +#: ../../library/argparse.rst:921 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1566,7 +1568,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:924 +#: ../../library/argparse.rst:926 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1574,7 +1576,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:929 +#: ../../library/argparse.rst:931 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1588,13 +1590,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:935 +#: ../../library/argparse.rst:937 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:938 +#: ../../library/argparse.rst:940 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1610,20 +1612,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:945 +#: ../../library/argparse.rst:947 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:949 +#: ../../library/argparse.rst:951 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:952 +#: ../../library/argparse.rst:954 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1639,11 +1641,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:963 +#: ../../library/argparse.rst:965 msgid "type" msgstr "" -#: ../../library/argparse.rst:965 +#: ../../library/argparse.rst:967 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1652,13 +1654,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:971 +#: ../../library/argparse.rst:973 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:974 +#: ../../library/argparse.rst:976 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -1666,11 +1668,11 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:979 +#: ../../library/argparse.rst:981 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:981 +#: ../../library/argparse.rst:983 #, fuzzy msgid "" "import argparse\n" @@ -1698,11 +1700,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:994 +#: ../../library/argparse.rst:996 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:996 +#: ../../library/argparse.rst:998 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1720,14 +1722,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1006 +#: ../../library/argparse.rst:1008 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:1012 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1735,7 +1737,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1015 +#: ../../library/argparse.rst:1017 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." @@ -1743,7 +1745,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1020 +#: ../../library/argparse.rst:1022 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1753,17 +1755,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1027 +#: ../../library/argparse.rst:1029 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1034 +#: ../../library/argparse.rst:1036 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1038 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1772,7 +1774,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1042 +#: ../../library/argparse.rst:1044 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1792,26 +1794,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1051 +#: ../../library/argparse.rst:1053 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1055 +#: ../../library/argparse.rst:1057 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1058 +#: ../../library/argparse.rst:1060 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1061 +#: ../../library/argparse.rst:1063 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1819,19 +1821,19 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1070 +#: ../../library/argparse.rst:1072 msgid "required" msgstr "" -#: ../../library/argparse.rst:1072 +#: ../../library/argparse.rst:1074 msgid "" -"In general, the :mod:`argparse` module assumes that flags like ``-f`` and " +"In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " "command line. To make an option *required*, ``True`` can be specified for " "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1077 +#: ../../library/argparse.rst:1079 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1849,24 +1851,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1085 +#: ../../library/argparse.rst:1087 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1091 +#: ../../library/argparse.rst:1093 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1098 +#: ../../library/argparse.rst:1100 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:1102 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1874,7 +1876,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1105 +#: ../../library/argparse.rst:1107 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1883,7 +1885,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1110 +#: ../../library/argparse.rst:1112 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1909,19 +1911,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1122 +#: ../../library/argparse.rst:1124 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1125 +#: ../../library/argparse.rst:1127 msgid "" -":mod:`argparse` supports silencing the help entry for certain options, by " +":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1128 +#: ../../library/argparse.rst:1130 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1939,23 +1941,23 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1140 +#: ../../library/argparse.rst:1142 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1142 +#: ../../library/argparse.rst:1144 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " -"refer to each expected argument. By default, ArgumentParser objects use the " -"dest_ value as the \"name\" of each object. By default, for positional " -"argument actions, the dest_ value is used directly, and for optional " -"argument actions, the dest_ value is uppercased. So, a single positional " -"argument with ``dest='bar'`` will be referred to as ``bar``. A single " -"optional argument ``--foo`` that should be followed by a single command-line " -"argument will be referred to as ``FOO``. An example::" +"refer to each expected argument. By default, :class:`!ArgumentParser` " +"objects use the dest_ value as the \"name\" of each object. By default, for " +"positional argument actions, the dest_ value is used directly, and for " +"optional argument actions, the dest_ value is uppercased. So, a single " +"positional argument with ``dest='bar'`` will be referred to as ``bar``. A " +"single optional argument ``--foo`` that should be followed by a single " +"command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1151 +#: ../../library/argparse.rst:1153 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1987,11 +1989,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1166 +#: ../../library/argparse.rst:1168 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1168 +#: ../../library/argparse.rst:1170 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2023,21 +2025,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1183 +#: ../../library/argparse.rst:1185 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1187 +#: ../../library/argparse.rst:1189 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1191 +#: ../../library/argparse.rst:1193 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2061,11 +2063,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1206 +#: ../../library/argparse.rst:1208 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1210 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2075,7 +2077,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1215 +#: ../../library/argparse.rst:1217 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2087,7 +2089,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1220 +#: ../../library/argparse.rst:1222 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2099,7 +2101,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1229 +#: ../../library/argparse.rst:1231 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2117,11 +2119,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1237 +#: ../../library/argparse.rst:1239 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1239 +#: ../../library/argparse.rst:1241 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2133,11 +2135,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1248 +#: ../../library/argparse.rst:1250 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1252 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2148,7 +2150,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1260 +#: ../../library/argparse.rst:1262 #, fuzzy msgid "" ">>> import argparse\n" @@ -2167,131 +2169,124 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1273 -msgid "Action classes" -msgstr "" - #: ../../library/argparse.rst:1275 -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:`~ArgumentParser." -"add_argument`." +msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1284 +#: ../../library/argparse.rst:1277 msgid "" -"Action objects are used by an ArgumentParser to represent the information " -"needed to parse a single argument from one or more strings from the command " -"line. The Action class must accept the two positional arguments plus any " -"keyword arguments passed to :meth:`ArgumentParser.add_argument` except for " -"the ``action`` itself." +":class:`!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:" +"`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1290 +#: ../../library/argparse.rst:1286 msgid "" -"Instances of Action (or return value of any callable to the ``action`` " -"parameter) should have attributes \"dest\", \"option_strings\", \"default\", " -"\"type\", \"required\", \"help\", etc. defined. The easiest way to ensure " -"these attributes are defined is to call ``Action.__init__``." +":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " +"the information needed to parse a single argument from one or more strings " +"from the command line. The :class:`!Action` class must accept the two " +"positional arguments plus any keyword arguments passed to :meth:" +"`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1295 +#: ../../library/argparse.rst:1292 msgid "" -"Action instances should be callable, so subclasses must override the " -"``__call__`` method, which should accept four parameters:" -msgstr "" - -#: ../../library/argparse.rst:1298 -msgid "*parser* - The ArgumentParser object which contains this action." +"Instances of :class:`!Action` (or return value of any callable to the " +"``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" +"option_strings`, :attr:`!default`, :attr:`!type`, :attr:`!required`, :attr:`!" +"help`, etc. defined. The easiest way to ensure these attributes are defined " +"is to call :meth:`!Action.__init__`." msgstr "" #: ../../library/argparse.rst:1300 -msgid "*namespace* - The :class:`Namespace` object that will be returned by" -msgstr "" - -#: ../../library/argparse.rst:1301 msgid "" -":meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this " -"object using :func:`setattr`." +":class:`!Action` instances should be callable, so subclasses must override " +"the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1304 +#: ../../library/argparse.rst:1303 msgid "" -"*values* - The associated command-line arguments, with any type conversions" +"*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" #: ../../library/argparse.rst:1305 msgid "" -"applied. Type conversions are specified with the type_ keyword argument to :" -"meth:`~ArgumentParser.add_argument`." +"*namespace* - The :class:`Namespace` object that will be returned by :meth:" +"`~ArgumentParser.parse_args`. Most actions add an attribute to this object " +"using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1308 +#: ../../library/argparse.rst:1309 msgid "" -"*option_string* - The option string that was used to invoke this action." +"*values* - The associated command-line arguments, with any type conversions " +"applied. Type conversions are specified with the type_ keyword argument to :" +"meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1313 msgid "" -"The ``option_string`` argument is optional, and will be absent if the action " -"is associated with a positional argument." +"*option_string* - The option string that was used to invoke this action. The " +"``option_string`` argument is optional, and will be absent if the action is " +"associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1312 +#: ../../library/argparse.rst:1317 msgid "" -"The ``__call__`` method may perform arbitrary actions, but will typically " -"set attributes on the ``namespace`` based on ``dest`` and ``values``." +"The :meth:`!__call__` method may perform arbitrary actions, but will " +"typically set attributes on the ``namespace`` based on ``dest`` and " +"``values``." msgstr "" -#: ../../library/argparse.rst:1315 +#: ../../library/argparse.rst:1322 msgid "" -"Action subclasses can define a ``format_usage`` method that takes no " -"argument and return a string which will be used when printing the usage of " -"the program. If such method is not provided, a sensible default will be used." +":class:`!Action` subclasses can define a :meth:`!format_usage` method that " +"takes no argument and return a string which will be used when printing the " +"usage of the program. If such method is not provided, a sensible default " +"will be used." msgstr "" -#: ../../library/argparse.rst:1321 +#: ../../library/argparse.rst:1328 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1325 +#: ../../library/argparse.rst:1332 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1335 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " -"created and how they are assigned. See the documentation for :meth:" -"`add_argument` for details." +"created and how they are assigned. See the documentation for :meth:`!" +"add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1332 +#: ../../library/argparse.rst:1339 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1335 +#: ../../library/argparse.rst:1342 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1340 +#: ../../library/argparse.rst:1347 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1349 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1346 +#: ../../library/argparse.rst:1353 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2309,14 +2304,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1354 +#: ../../library/argparse.rst:1361 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1358 +#: ../../library/argparse.rst:1365 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2324,13 +2319,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1361 +#: ../../library/argparse.rst:1368 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1364 +#: ../../library/argparse.rst:1371 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2338,13 +2333,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1374 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1370 +#: ../../library/argparse.rst:1377 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2360,11 +2355,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1386 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1381 +#: ../../library/argparse.rst:1388 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2372,7 +2367,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1386 +#: ../../library/argparse.rst:1393 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2394,11 +2389,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1407 +#: ../../library/argparse.rst:1414 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1409 +#: ../../library/argparse.rst:1416 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2410,7 +2405,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1417 +#: ../../library/argparse.rst:1424 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2443,7 +2438,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1447 +#: ../../library/argparse.rst:1454 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2451,7 +2446,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1452 +#: ../../library/argparse.rst:1459 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2459,24 +2454,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1455 +#: ../../library/argparse.rst:1462 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1461 +#: ../../library/argparse.rst:1468 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1463 +#: ../../library/argparse.rst:1470 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1467 +#: ../../library/argparse.rst:1474 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2500,25 +2495,25 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1478 +#: ../../library/argparse.rst:1485 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1491 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1486 +#: ../../library/argparse.rst:1493 msgid "" -"Sometimes it may be useful to have an ArgumentParser parse arguments other " -"than those of :data:`sys.argv`. This can be accomplished by passing a list " -"of strings to :meth:`~ArgumentParser.parse_args`. This is useful for " -"testing at the interactive prompt::" +"Sometimes it may be useful to have an :class:`ArgumentParser` parse " +"arguments other than those of :data:`sys.argv`. This can be accomplished by " +"passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is " +"useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1491 +#: ../../library/argparse.rst:1498 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2544,24 +2539,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1506 +#: ../../library/argparse.rst:1513 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1510 +#: ../../library/argparse.rst:1517 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1513 +#: ../../library/argparse.rst:1520 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1517 +#: ../../library/argparse.rst:1524 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2575,14 +2570,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1523 +#: ../../library/argparse.rst:1530 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1527 +#: ../../library/argparse.rst:1534 msgid "" ">>> class C:\n" "... pass\n" @@ -2604,92 +2599,92 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1539 +#: ../../library/argparse.rst:1546 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1542 +#: ../../library/argparse.rst:1549 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1556 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " "``svn update``, and ``svn commit``. Splitting up functionality this way can " "be a particularly good idea when a program performs several different " "functions which require different kinds of command-line arguments. :class:" -"`ArgumentParser` supports the creation of such subcommands with the :meth:" -"`add_subparsers` method. The :meth:`add_subparsers` method is normally " +"`ArgumentParser` supports the creation of such subcommands 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:`~_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." +"command name and any :class:`!ArgumentParser` constructor arguments, and " +"returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1561 +#: ../../library/argparse.rst:1568 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1563 +#: ../../library/argparse.rst:1570 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1567 +#: ../../library/argparse.rst:1574 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1577 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1574 +#: ../../library/argparse.rst:1581 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " -"default the class of the current parser (e.g. ArgumentParser)" +"default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1577 +#: ../../library/argparse.rst:1584 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1580 +#: ../../library/argparse.rst:1587 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1583 +#: ../../library/argparse.rst:1590 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1586 +#: ../../library/argparse.rst:1593 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1588 +#: ../../library/argparse.rst:1595 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1591 +#: ../../library/argparse.rst:1598 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1593 +#: ../../library/argparse.rst:1600 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2712,7 +2707,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1612 +#: ../../library/argparse.rst:1619 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2722,7 +2717,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1619 +#: ../../library/argparse.rst:1626 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2731,7 +2726,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1627 +#: ../../library/argparse.rst:1634 #, fuzzy msgid "" ">>> parser.parse_args(['--help'])\n" @@ -2790,14 +2785,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1655 +#: ../../library/argparse.rst:1662 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1659 +#: ../../library/argparse.rst:1666 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2833,7 +2828,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1676 +#: ../../library/argparse.rst:1683 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2841,7 +2836,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1681 +#: ../../library/argparse.rst:1688 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2857,13 +2852,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1688 +#: ../../library/argparse.rst:1695 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1709 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2871,7 +2866,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1707 +#: ../../library/argparse.rst:1714 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2906,7 +2901,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1739 +#: ../../library/argparse.rst:1746 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2916,7 +2911,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1746 +#: ../../library/argparse.rst:1753 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2936,15 +2931,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1755 -msgid "New *required* keyword argument." +#: ../../library/argparse.rst:1762 +msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1760 +#: ../../library/argparse.rst:1767 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1764 +#: ../../library/argparse.rst:1771 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2953,7 +2948,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1770 +#: ../../library/argparse.rst:1777 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2971,14 +2966,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1776 +#: ../../library/argparse.rst:1783 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1780 +#: ../../library/argparse.rst:1787 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2990,24 +2985,24 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1785 +#: ../../library/argparse.rst:1792 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1790 +#: ../../library/argparse.rst:1797 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1795 +#: ../../library/argparse.rst:1802 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " "there is a better conceptual grouping of arguments than this default one, " -"appropriate groups can be created using the :meth:`add_argument_group` " +"appropriate groups can be created using the :meth:`!add_argument_group` " "method::" msgstr "" -#: ../../library/argparse.rst:1801 +#: ../../library/argparse.rst:1808 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3031,18 +3026,18 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1812 +#: ../../library/argparse.rst:1819 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" "class:`ArgumentParser`. When an argument is added to the group, the parser " "treats it just like a normal argument, but displays the argument in a " -"separate group for help messages. The :meth:`add_argument_group` method " +"separate group for help messages. The :meth:`!add_argument_group` method " "accepts *title* and *description* arguments which can be used to customize " "this display::" msgstr "" -#: ../../library/argparse.rst:1820 +#: ../../library/argparse.rst:1827 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3080,7 +3075,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1838 +#: ../../library/argparse.rst:1845 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3089,13 +3084,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1843 +#: ../../library/argparse.rst:1850 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1846 +#: ../../library/argparse.rst:1853 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3103,18 +3098,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1854 +#: ../../library/argparse.rst:1861 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1865 msgid "" -"Create a mutually exclusive group. :mod:`argparse` will make sure that only " +"Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1862 +#: ../../library/argparse.rst:1869 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3140,14 +3135,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1874 +#: ../../library/argparse.rst:1881 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1878 +#: ../../library/argparse.rst:1885 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3165,7 +3160,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1886 +#: ../../library/argparse.rst:1893 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3173,7 +3168,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1892 +#: ../../library/argparse.rst:1899 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3209,7 +3204,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1909 +#: ../../library/argparse.rst:1916 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3217,11 +3212,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1917 +#: ../../library/argparse.rst:1924 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1921 +#: ../../library/argparse.rst:1928 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3230,7 +3225,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1927 +#: ../../library/argparse.rst:1934 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3244,12 +3239,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1933 +#: ../../library/argparse.rst:1940 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1935 +#: ../../library/argparse.rst:1942 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3263,20 +3258,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1941 +#: ../../library/argparse.rst:1948 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1947 +#: ../../library/argparse.rst:1954 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1951 +#: ../../library/argparse.rst:1958 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3288,54 +3283,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1958 +#: ../../library/argparse.rst:1965 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1960 +#: ../../library/argparse.rst:1967 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1966 +#: ../../library/argparse.rst:1973 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1972 +#: ../../library/argparse.rst:1979 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1976 +#: ../../library/argparse.rst:1983 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1988 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1986 +#: ../../library/argparse.rst:1993 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:1991 +#: ../../library/argparse.rst:1998 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:1995 +#: ../../library/argparse.rst:2002 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3346,7 +3341,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2004 +#: ../../library/argparse.rst:2011 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3360,7 +3355,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2011 +#: ../../library/argparse.rst:2018 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3368,11 +3363,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2018 +#: ../../library/argparse.rst:2025 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2022 +#: ../../library/argparse.rst:2029 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3380,20 +3375,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2027 +#: ../../library/argparse.rst:2034 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2031 +#: ../../library/argparse.rst:2038 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2034 +#: ../../library/argparse.rst:2041 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3403,18 +3398,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:2047 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2044 +#: ../../library/argparse.rst:2051 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2048 +#: ../../library/argparse.rst:2055 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3428,17 +3423,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2056 +#: ../../library/argparse.rst:2063 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2061 +#: ../../library/argparse.rst:2068 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2066 +#: ../../library/argparse.rst:2073 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3446,15 +3441,15 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:2078 msgid "" -"These parsers do not support all the argparse features, and will raise " -"exceptions if unsupported features are used. In particular, subparsers, and " -"mutually exclusive groups that include both optionals and positionals are " -"not supported." +"These parsers do not support all the :mod:`!argparse` features, and will " +"raise 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:2076 +#: ../../library/argparse.rst:2083 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3462,7 +3457,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2082 +#: ../../library/argparse.rst:2089 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3482,7 +3477,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2091 +#: ../../library/argparse.rst:2098 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3490,43 +3485,43 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2100 +#: ../../library/argparse.rst:2107 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2104 +#: ../../library/argparse.rst:2111 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:2113 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2118 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2115 +#: ../../library/argparse.rst:2122 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:800 +#: ../../library/argparse.rst:802 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:800 ../../library/argparse.rst:834 -#: ../../library/argparse.rst:848 +#: ../../library/argparse.rst:802 ../../library/argparse.rst:836 +#: ../../library/argparse.rst:850 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:834 +#: ../../library/argparse.rst:836 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:848 +#: ../../library/argparse.rst:850 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/asynchat.po b/library/asynchat.po new file mode 100644 index 0000000000..2b8afdd76d --- /dev/null +++ b/library/asynchat.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/asynchat.rst:2 +msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" +msgstr "" + +#: ../../library/asynchat.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" + +#: ../../library/asynchat.rst:14 +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "" + +#: ../../library/asynchat.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!asynchat` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 5db2d5a11f..7a232640e8 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -2685,9 +2685,10 @@ msgid "" msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" #: ../../library/asyncio-eventloop.rst:1793 +#, fuzzy msgid "" -"`MSDN documentation on I/O Completion Ports `_." +"`MSDN documentation on I/O Completion Ports `_." msgstr "" "`I/O 完成埠(I/O Completion Ports)的 MSDN 文件 `_。" diff --git a/library/asyncore.po b/library/asyncore.po new file mode 100644 index 0000000000..84467a75b1 --- /dev/null +++ b/library/asyncore.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/asyncore.rst:2 +msgid ":mod:`!asyncore` --- Asynchronous socket handler" +msgstr "" + +#: ../../library/asyncore.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" + +#: ../../library/asyncore.rst:14 +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "" + +#: ../../library/asyncore.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!asyncore` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/audioop.po b/library/audioop.po index 4de310eb6f..10bbbf1b0c 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,348 +20,38 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/audioop.rst:2 -msgid ":mod:`audioop` --- Manipulate raw audio data" +#, fuzzy +msgid ":mod:`!audioop` --- Manipulate raw audio data" msgstr ":mod:`audioop` --- 操作原始聲音檔案" -#: ../../library/audioop.rst:8 +#: ../../library/audioop.rst:10 msgid "" -"The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " -"for details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " -"<594#audioop>`\\ )。" #: ../../library/audioop.rst:14 msgid "" -"The :mod:`audioop` module contains some useful operations on sound " -"fragments. It operates on sound fragments consisting of signed integer " -"samples 8, 16, 24 or 32 bits wide, stored in :term:`bytes-like objects " -"`. All scalar items are integers, unless specified " -"otherwise." +"The last version of Python that provided the :mod:`!audioop` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/audioop.rst:19 -msgid "" -"Support for 24-bit samples was added. All functions now accept any :term:" -"`bytes-like object`. String input now results in an immediate error." -msgstr "" - -#: ../../library/audioop.rst:30 -msgid "" -"This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings." -msgstr "" - -#: ../../library/audioop.rst:34 -msgid "" -"A few of the more complicated operations only take 16-bit samples, otherwise " -"the sample size (in bytes) is always a parameter of the operation." -msgstr "" - -#: ../../library/audioop.rst:37 -msgid "The module defines the following variables and functions:" -msgstr "" - -#: ../../library/audioop.rst:42 -msgid "" -"This exception is raised on all errors, such as unknown number of bytes per " -"sample, etc." -msgstr "" - -#: ../../library/audioop.rst:48 -msgid "" -"Return a fragment which is the addition of the two samples passed as " -"parameters. *width* is the sample width in bytes, either ``1``, ``2``, ``3`` " -"or ``4``. Both fragments should have the same length. Samples are " -"truncated in case of overflow." -msgstr "" - -#: ../../library/audioop.rst:55 -msgid "" -"Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See the " -"description of :func:`lin2adpcm` for details on ADPCM coding. Return a tuple " -"``(sample, newstate)`` where the sample has the width specified in *width*." -msgstr "" - -#: ../../library/audioop.rst:62 -msgid "" -"Convert sound fragments in a-LAW encoding to linearly encoded sound " -"fragments. a-LAW encoding always uses 8 bits samples, so *width* refers only " -"to the sample width of the output fragment here." -msgstr "" - -#: ../../library/audioop.rst:69 -msgid "Return the average over all samples in the fragment." -msgstr "" - -#: ../../library/audioop.rst:74 -msgid "" -"Return the average peak-peak value over all samples in the fragment. No " -"filtering is done, so the usefulness of this routine is questionable." -msgstr "" - -#: ../../library/audioop.rst:80 -msgid "" -"Return a fragment that is the original fragment with a bias added to each " -"sample. Samples wrap around in case of overflow." -msgstr "" - -#: ../../library/audioop.rst:86 -msgid "" -"\"Byteswap\" all samples in a fragment and returns the modified fragment. " -"Converts big-endian samples to little-endian and vice versa." -msgstr "" - -#: ../../library/audioop.rst:94 -msgid "" -"Return the number of zero crossings in the fragment passed as an argument." -msgstr "" - -#: ../../library/audioop.rst:99 -msgid "" -"Return a factor *F* such that ``rms(add(fragment, mul(reference, -F)))`` is " -"minimal, i.e., return the factor with which you should multiply *reference* " -"to make it match as well as possible to *fragment*. The fragments should " -"both contain 2-byte samples." -msgstr "" - -#: ../../library/audioop.rst:104 -msgid "The time taken by this routine is proportional to ``len(fragment)``." -msgstr "" - -#: ../../library/audioop.rst:109 -msgid "" -"Try to match *reference* as well as possible to a portion of *fragment* " -"(which should be the longer fragment). This is (conceptually) done by " -"taking slices out of *fragment*, using :func:`findfactor` to compute the " -"best match, and minimizing the result. The fragments should both contain 2-" -"byte samples. Return a tuple ``(offset, factor)`` where *offset* is the " -"(integer) offset into *fragment* where the optimal match started and " -"*factor* is the (floating-point) factor as per :func:`findfactor`." -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." -msgstr "" - -#: ../../library/audioop.rst:124 -msgid "The routine takes time proportional to ``len(fragment)``." -msgstr "" - -#: ../../library/audioop.rst:129 -msgid "Return the value of sample *index* from the fragment." -msgstr "" - -#: ../../library/audioop.rst:134 -msgid "" -"Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an " -"adaptive coding scheme, whereby each 4 bit number is the difference between " -"one sample and the next, divided by a (varying) step. The Intel/DVI ADPCM " -"algorithm has been selected for use by the IMA, so it may well become a " -"standard." -msgstr "" - -#: ../../library/audioop.rst:139 -msgid "" -"*state* is a tuple containing the state of the coder. The coder returns a " -"tuple ``(adpcmfrag, newstate)``, and the *newstate* should be passed to the " -"next call of :func:`lin2adpcm`. In the initial call, ``None`` can be passed " -"as the state. *adpcmfrag* is the ADPCM coded fragment packed 2 4-bit values " -"per byte." -msgstr "" - -#: ../../library/audioop.rst:147 -msgid "" -"Convert samples in the audio fragment to a-LAW encoding and return this as a " -"bytes object. a-LAW is an audio encoding format whereby you get a dynamic " -"range of about 13 bits using only 8 bit samples. It is used by the Sun " -"audio hardware, among others." -msgstr "" - -#: ../../library/audioop.rst:155 -msgid "Convert samples between 1-, 2-, 3- and 4-byte formats." -msgstr "" - -#: ../../library/audioop.rst:159 -msgid "" -"In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are " -"signed, but 8 bit samples are unsigned. So when converting to 8 bit wide " -"samples for these formats, you need to also add 128 to the result::" -msgstr "" - -#: ../../library/audioop.rst:163 -msgid "" -"new_frames = audioop.lin2lin(frames, old_width, 1)\n" -"new_frames = audioop.bias(new_frames, 1, 128)" -msgstr "" - -#: ../../library/audioop.rst:166 -msgid "" -"The same, in reverse, has to be applied when converting from 8 to 16, 24 or " -"32 bit width samples." -msgstr "" - -#: ../../library/audioop.rst:172 -msgid "" -"Convert samples in the audio fragment to u-LAW encoding and return this as a " -"bytes object. u-LAW is an audio encoding format whereby you get a dynamic " -"range of about 14 bits using only 8 bit samples. It is used by the Sun " -"audio hardware, among others." -msgstr "" - -#: ../../library/audioop.rst:180 -msgid "" -"Return the maximum of the *absolute value* of all samples in a fragment." -msgstr "" - -#: ../../library/audioop.rst:185 -msgid "Return the maximum peak-peak value in the sound fragment." -msgstr "" - -#: ../../library/audioop.rst:190 -msgid "" -"Return a tuple consisting of the minimum and maximum values of all samples " -"in the sound fragment." -msgstr "" - -#: ../../library/audioop.rst:196 -msgid "" -"Return a fragment that has all samples in the original fragment multiplied " -"by the floating-point value *factor*. Samples are truncated in case of " -"overflow." -msgstr "" - -#: ../../library/audioop.rst:202 -msgid "Convert the frame rate of the input fragment." -msgstr "" - -#: ../../library/audioop.rst:204 -msgid "" -"*state* is a tuple containing the state of the converter. The converter " -"returns a tuple ``(newfragment, newstate)``, and *newstate* should be passed " -"to the next call of :func:`ratecv`. The initial call should pass ``None`` " -"as the state." -msgstr "" - -#: ../../library/audioop.rst:208 -msgid "" -"The *weightA* and *weightB* arguments are parameters for a simple digital " -"filter and default to ``1`` and ``0`` respectively." -msgstr "" - -#: ../../library/audioop.rst:214 -msgid "Reverse the samples in a fragment and returns the modified fragment." -msgstr "" - -#: ../../library/audioop.rst:219 -msgid "" -"Return the root-mean-square of the fragment, i.e. ``sqrt(sum(S_i^2)/n)``." -msgstr "" - -#: ../../library/audioop.rst:221 -msgid "This is a measure of the power in an audio signal." -msgstr "" - -#: ../../library/audioop.rst:226 -msgid "" -"Convert a stereo fragment to a mono fragment. The left channel is " -"multiplied by *lfactor* and the right channel by *rfactor* before adding the " -"two channels to give a mono signal." -msgstr "" - -#: ../../library/audioop.rst:233 -msgid "" -"Generate a stereo fragment from a mono fragment. Each pair of samples in " -"the stereo fragment are computed from the mono sample, whereby left channel " -"samples are multiplied by *lfactor* and right channel samples by *rfactor*." -msgstr "" - -#: ../../library/audioop.rst:240 -msgid "" -"Convert sound fragments in u-LAW encoding to linearly encoded sound " -"fragments. u-LAW encoding always uses 8 bits samples, so *width* refers only " -"to the sample width of the output fragment here." -msgstr "" - -#: ../../library/audioop.rst:244 -msgid "" -"Note that operations such as :func:`.mul` or :func:`.max` make no " -"distinction between mono and stereo fragments, i.e. all samples are treated " -"equal. If this is a problem the stereo fragment should be split into two " -"mono fragments first and recombined later. Here is an example of how to do " -"that::" -msgstr "" - -#: ../../library/audioop.rst:249 -msgid "" -"def mul_stereo(sample, width, lfactor, rfactor):\n" -" lsample = audioop.tomono(sample, width, 1, 0)\n" -" rsample = audioop.tomono(sample, width, 0, 1)\n" -" lsample = audioop.mul(lsample, width, lfactor)\n" -" rsample = audioop.mul(rsample, width, rfactor)\n" -" lsample = audioop.tostereo(lsample, width, 1, 0)\n" -" rsample = audioop.tostereo(rsample, width, 0, 1)\n" -" return audioop.add(lsample, rsample, width)" -msgstr "" - -#: ../../library/audioop.rst:258 -msgid "" -"If you use the ADPCM coder to build network packets and you want your " -"protocol to be stateless (i.e. to be able to tolerate packet loss) you " -"should not only transmit the data but also the state. Note that you should " -"send the *initial* state (the one you passed to :func:`lin2adpcm`) along to " -"the decoder, not the final state (as returned by the coder). If you want to " -"use :class:`struct.Struct` to store the state in binary you can code the " -"first element (the predicted value) in 16 bits and the second (the delta " -"index) in 8." -msgstr "" - -#: ../../library/audioop.rst:266 -msgid "" -"The ADPCM coders have never been tried against other ADPCM coders, only " -"against themselves. It could well be that I misinterpreted the standards in " -"which case they will not be interoperable with the respective standards." -msgstr "" - -#: ../../library/audioop.rst:270 -msgid "" -"The :func:`find\\*` routines might look a bit funny at first sight. They are " -"primarily meant to do echo cancellation. A reasonably fast way to do this " -"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:275 -msgid "" -"def echocancel(outputdata, inputdata):\n" -" pos = audioop.findmax(outputdata, 800) # one tenth second\n" -" out_test = outputdata[pos*2:]\n" -" in_test = inputdata[pos*2:]\n" -" ipos, factor = audioop.findfit(in_test, out_test)\n" -" # Optional (for better cancellation):\n" -" # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],\n" -" # out_test)\n" -" prefill = '\\0'*(pos+ipos)*2\n" -" postfill = '\\0'*(len(inputdata)-len(prefill)-len(outputdata))\n" -" outputdata = prefill + audioop.mul(outputdata, 2, -factor) + postfill\n" -" return audioop.add(inputdata, outputdata, 2)" -msgstr "" +#~ msgid "" +#~ "The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " +#~ "for details)." +#~ msgstr "" +#~ ":mod:`audioop` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#audioop>`\\ )。" -#: ../../library/audioop.rst:24 -msgid "Intel/DVI ADPCM" -msgstr "Intel/DVI ADPCM" +#~ msgid "Intel/DVI ADPCM" +#~ msgstr "Intel/DVI ADPCM" -#: ../../library/audioop.rst:24 -msgid "ADPCM, Intel/DVI" -msgstr "ADPCM, Intel/DVI" +#~ msgid "ADPCM, Intel/DVI" +#~ msgstr "ADPCM, Intel/DVI" -#: ../../library/audioop.rst:24 -msgid "a-LAW" -msgstr "a-LAW" +#~ msgid "a-LAW" +#~ msgstr "a-LAW" -#: ../../library/audioop.rst:24 -msgid "u-LAW" -msgstr "u-LAW" +#~ msgid "u-LAW" +#~ msgstr "u-LAW" diff --git a/library/cgi.po b/library/cgi.po index 8f7890bfa5..cecddac9d7 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -19,871 +19,174 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/cgi.rst:2 -msgid ":mod:`cgi` --- Common Gateway Interface support" +#, fuzzy +msgid ":mod:`!cgi` --- Common Gateway Interface support" msgstr ":mod:`cgi` --- 通用閘道器介面支援" -#: ../../library/cgi.rst:8 -msgid "**Source code:** :source:`Lib/cgi.py`" -msgstr "**原始碼:**\\ :source:`Lib/cgi.py`" - -#: ../../library/cgi.rst:18 -msgid "" -"The :mod:`cgi` module is deprecated (see :pep:`PEP 594 <594#cgi>` for " -"details and alternatives)." -msgstr "" -":mod:`cgi` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " -"<594#cgi>`\\ )。" - -#: ../../library/cgi.rst:22 -msgid "" -"The :class:`FieldStorage` class can typically be replaced with :func:`urllib." -"parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." -"message` module or :pypi:`multipart` for ``POST`` and ``PUT``. Most :ref:" -"`utility functions ` have replacements." -msgstr "" - -#: ../../library/cgi.rst:30 -msgid "Support module for Common Gateway Interface (CGI) scripts." -msgstr "" - -#: ../../library/cgi.rst:32 -msgid "" -"This module defines a number of utilities for use by CGI scripts written in " -"Python." -msgstr "" - -#: ../../library/cgi.rst:35 -msgid "" -"The global variable ``maxlen`` can be set to an integer indicating the " -"maximum size of a POST request. POST requests larger than this size will " -"result in a :exc:`ValueError` being raised during parsing. The default value " -"of this variable is ``0``, meaning the request size is unlimited." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/cgi.rst:43 -msgid "Introduction" -msgstr "簡介" - -#: ../../library/cgi.rst:47 -msgid "" -"A CGI script is invoked by an HTTP server, usually to process user input " -"submitted through an HTML ``
`` or ```` element." -msgstr "" - -#: ../../library/cgi.rst:50 -msgid "" -"Most often, CGI scripts live in the server's special :file:`cgi-bin` " -"directory. The HTTP server places all sorts of information about the request " -"(such as the client's hostname, the requested URL, the query string, and " -"lots of other goodies) in the script's shell environment, executes the " -"script, and sends the script's output back to the client." -msgstr "" - -#: ../../library/cgi.rst:56 -msgid "" -"The script's input is connected to the client too, and sometimes the form " -"data is read this way; at other times the form data is passed via the " -"\"query string\" part of the URL. This module is intended to take care of " -"the different cases and provide a simpler interface to the Python script. " -"It also provides a number of utilities that help in debugging scripts, and " -"the latest addition is support for file uploads from a form (if your browser " -"supports it)." -msgstr "" - -#: ../../library/cgi.rst:63 -msgid "" -"The output of a CGI script should consist of two sections, separated by a " -"blank line. The first section contains a number of headers, telling the " -"client what kind of data is following. Python code to generate a minimal " -"header section looks like this::" -msgstr "" - -#: ../../library/cgi.rst:68 -msgid "" -"print(\"Content-Type: text/html\") # HTML is following\n" -"print() # blank line, end of headers" -msgstr "" - -#: ../../library/cgi.rst:71 -msgid "" -"The second section is usually HTML, which allows the client software to " -"display nicely formatted text with header, in-line images, etc. Here's " -"Python code that prints a simple piece of HTML::" -msgstr "" - -#: ../../library/cgi.rst:75 -msgid "" -"print(\"CGI script output\")\n" -"print(\"

This is my first CGI script

\")\n" -"print(\"Hello, world!\")" -msgstr "" -"print(\"CGI script output\")\n" -"print(\"

This is my first CGI script

\")\n" -"print(\"Hello, world!\")" - -#: ../../library/cgi.rst:83 -msgid "Using the cgi module" -msgstr "使用 cgi 模組" - -#: ../../library/cgi.rst:85 -msgid "Begin by writing ``import cgi``." -msgstr "" - -#: ../../library/cgi.rst:87 -msgid "When you write a new script, consider adding these lines::" -msgstr "" - -#: ../../library/cgi.rst:89 ../../library/cgi.rst:505 -msgid "" -"import cgitb\n" -"cgitb.enable()" -msgstr "" -"import cgitb\n" -"cgitb.enable()" - -#: ../../library/cgi.rst:92 -msgid "" -"This activates a special exception handler that will display detailed " -"reports in the web browser if any errors occur. If you'd rather not show " -"the guts of your program to users of your script, you can have the reports " -"saved to files instead, with code like this::" -msgstr "" - -#: ../../library/cgi.rst:97 -msgid "" -"import cgitb\n" -"cgitb.enable(display=0, logdir=\"/path/to/logdir\")" -msgstr "" -"import cgitb\n" -"cgitb.enable(display=0, logdir=\"/path/to/logdir\")" - -#: ../../library/cgi.rst:100 -msgid "" -"It's very helpful to use this feature during script development. The reports " -"produced by :mod:`cgitb` provide information that can save you a lot of time " -"in tracking down bugs. You can always remove the ``cgitb`` line later when " -"you have tested your script and are confident that it works correctly." -msgstr "" - -#: ../../library/cgi.rst:105 -msgid "" -"To get at submitted form data, use the :class:`FieldStorage` class. If the " -"form contains non-ASCII characters, use the *encoding* keyword parameter set " -"to the value of the encoding defined for the document. It is usually " -"contained in the META tag in the HEAD section of the HTML document or by " -"the :mailheader:`Content-Type` header. This reads the form contents from " -"the standard input or the environment (depending on the value of various " -"environment variables set according to the CGI standard). Since it may " -"consume standard input, it should be instantiated only once." -msgstr "" - -#: ../../library/cgi.rst:114 -msgid "" -"The :class:`FieldStorage` instance can be indexed like a Python dictionary. " -"It allows membership testing with the :keyword:`in` operator, and also " -"supports the standard dictionary method :meth:`~dict.keys` and the built-in " -"function :func:`len`. Form fields containing empty strings are ignored and " -"do not appear in the dictionary; to keep such values, provide a true value " -"for the optional *keep_blank_values* keyword parameter when creating the :" -"class:`FieldStorage` instance." -msgstr "" - -#: ../../library/cgi.rst:122 -msgid "" -"For instance, the following code (which assumes that the :mailheader:" -"`Content-Type` header and blank line have already been printed) checks that " -"the fields ``name`` and ``addr`` are both set to a non-empty string::" -msgstr "" - -#: ../../library/cgi.rst:127 -msgid "" -"form = cgi.FieldStorage()\n" -"if \"name\" not in form or \"addr\" not in form:\n" -" print(\"

Error

\")\n" -" print(\"Please fill in the name and addr fields.\")\n" -" return\n" -"print(\"

name:\", form[\"name\"].value)\n" -"print(\"

addr:\", form[\"addr\"].value)\n" -"...further form processing here..." -msgstr "" - -#: ../../library/cgi.rst:136 -msgid "" -"Here the fields, accessed through ``form[key]``, are themselves instances " -"of :class:`FieldStorage` (or :class:`MiniFieldStorage`, depending on the " -"form encoding). The :attr:`~FieldStorage.value` attribute of the instance " -"yields the string value of the field. The :meth:`~FieldStorage.getvalue` " -"method returns this string value directly; it also accepts an optional " -"second argument as a default to return if the requested key is not present." -msgstr "" - -#: ../../library/cgi.rst:143 -msgid "" -"If the submitted form data contains more than one field with the same name, " -"the object retrieved by ``form[key]`` is not a :class:`FieldStorage` or :" -"class:`MiniFieldStorage` instance but a list of such instances. Similarly, " -"in this situation, ``form.getvalue(key)`` would return a list of strings. If " -"you expect this possibility (when your HTML form contains multiple fields " -"with the same name), use the :meth:`~FieldStorage.getlist` method, which " -"always returns a list of values (so that you do not need to special-case the " -"single item case). For example, this code concatenates any number of " -"username fields, separated by commas::" -msgstr "" - -#: ../../library/cgi.rst:153 -msgid "" -"value = form.getlist(\"username\")\n" -"usernames = \",\".join(value)" -msgstr "" -"value = form.getlist(\"username\")\n" -"usernames = \",\".join(value)" - -#: ../../library/cgi.rst:156 -msgid "" -"If a field represents an uploaded file, accessing the value via the :attr:" -"`~FieldStorage.value` attribute or the :meth:`~FieldStorage.getvalue` method " -"reads the entire file in memory as bytes. This may not be what you want. " -"You can test for an uploaded file by testing either the :attr:`~FieldStorage." -"filename` attribute or the :attr:`~FieldStorage.file` attribute. You can " -"then read the data from the :attr:`!file` attribute before it is " -"automatically closed as part of the garbage collection of the :class:" -"`FieldStorage` instance (the :func:`~io.RawIOBase.read` and :func:`~io." -"IOBase.readline` methods will return bytes)::" -msgstr "" - -#: ../../library/cgi.rst:167 -msgid "" -"fileitem = form[\"userfile\"]\n" -"if fileitem.file:\n" -" # It's an uploaded file; count lines\n" -" linecount = 0\n" -" while True:\n" -" line = fileitem.file.readline()\n" -" if not line: break\n" -" linecount = linecount + 1" -msgstr "" - -#: ../../library/cgi.rst:176 -msgid "" -":class:`FieldStorage` objects also support being used in a :keyword:`with` " -"statement, which will automatically close them when done." -msgstr "" - -#: ../../library/cgi.rst:179 -msgid "" -"If an error is encountered when obtaining the contents of an uploaded file " -"(for example, when the user interrupts the form submission by clicking on a " -"Back or Cancel button) the :attr:`~FieldStorage.done` attribute of the " -"object for the field will be set to the value -1." -msgstr "" - -#: ../../library/cgi.rst:184 -msgid "" -"The file upload draft standard entertains the possibility of uploading " -"multiple files from one field (using a recursive :mimetype:`multipart/\\*` " -"encoding). When this occurs, the item will be a dictionary-like :class:" -"`FieldStorage` item. This can be determined by testing its :attr:`!type` " -"attribute, which should be :mimetype:`multipart/form-data` (or perhaps " -"another MIME type matching :mimetype:`multipart/\\*`). In this case, it can " -"be iterated over recursively just like the top-level form object." -msgstr "" - -#: ../../library/cgi.rst:192 -msgid "" -"When a form is submitted in the \"old\" format (as the query string or as a " -"single data part of type :mimetype:`application/x-www-form-urlencoded`), the " -"items will actually be instances of the class :class:`MiniFieldStorage`. In " -"this case, the :attr:`!list`, :attr:`!file`, and :attr:`filename` attributes " -"are always ``None``." -msgstr "" - -#: ../../library/cgi.rst:197 -msgid "" -"A form submitted via POST that also has a query string will contain both :" -"class:`FieldStorage` and :class:`MiniFieldStorage` items." -msgstr "" - -#: ../../library/cgi.rst:200 -msgid "" -"The :attr:`~FieldStorage.file` attribute is automatically closed upon the " -"garbage collection of the creating :class:`FieldStorage` instance." -msgstr "" - -#: ../../library/cgi.rst:204 -msgid "" -"Added support for the context management protocol to the :class:" -"`FieldStorage` class." -msgstr "" - -#: ../../library/cgi.rst:210 -msgid "Higher Level Interface" -msgstr "" - -#: ../../library/cgi.rst:212 -msgid "" -"The previous section explains how to read CGI form data using the :class:" -"`FieldStorage` class. This section describes a higher level interface which " -"was added to this class to allow one to do it in a more readable and " -"intuitive way. The interface doesn't make the techniques described in " -"previous sections obsolete --- they are still useful to process file uploads " -"efficiently, for example." -msgstr "" - -#: ../../library/cgi.rst:221 -msgid "" -"The interface consists of two simple methods. Using the methods you can " -"process form data in a generic way, without the need to worry whether only " -"one or more values were posted under one name." -msgstr "" - -#: ../../library/cgi.rst:225 -msgid "" -"In the previous section, you learned to write following code anytime you " -"expected a user to post more than one value under one name::" -msgstr "" - -#: ../../library/cgi.rst:228 -msgid "" -"item = form.getvalue(\"item\")\n" -"if isinstance(item, list):\n" -" # The user is requesting more than one item.\n" -"else:\n" -" # The user is requesting only one item." -msgstr "" - -#: ../../library/cgi.rst:234 -msgid "" -"This situation is common for example when a form contains a group of " -"multiple checkboxes with the same name::" -msgstr "" - -#: ../../library/cgi.rst:237 -msgid "" -"\n" -"" -msgstr "" -"\n" -"" - -#: ../../library/cgi.rst:240 -msgid "" -"In most situations, however, there's only one form control with a particular " -"name in a form and then you expect and need only one value associated with " -"this name. So you write a script containing for example this code::" -msgstr "" - -#: ../../library/cgi.rst:244 -msgid "user = form.getvalue(\"user\").upper()" -msgstr "user = form.getvalue(\"user\").upper()" - -#: ../../library/cgi.rst:246 -msgid "" -"The problem with the code is that you should never expect that a client will " -"provide valid input to your scripts. For example, if a curious user appends " -"another ``user=foo`` pair to the query string, then the script would crash, " -"because in this situation the ``getvalue(\"user\")`` method call returns a " -"list instead of a string. Calling the :meth:`~str.upper` method on a list " -"is not valid (since lists do not have a method of this name) and results in " -"an :exc:`AttributeError` exception." -msgstr "" - -#: ../../library/cgi.rst:254 -msgid "" -"Therefore, the appropriate way to read form data values was to always use " -"the code which checks whether the obtained value is a single value or a list " -"of values. That's annoying and leads to less readable scripts." -msgstr "" - -#: ../../library/cgi.rst:258 -msgid "" -"A more convenient approach is to use the methods :meth:`~FieldStorage." -"getfirst` and :meth:`~FieldStorage.getlist` provided by this higher level " -"interface." -msgstr "" - -#: ../../library/cgi.rst:264 -msgid "" -"This method always returns only one value associated with form field *name*. " -"The method returns only the first value in case that more values were posted " -"under such name. Please note that the order in which the values are " -"received may vary from browser to browser and should not be counted on. " -"[#]_ If no such form field or value exists then the method returns the " -"value specified by the optional parameter *default*. This parameter " -"defaults to ``None`` if not specified." -msgstr "" - -#: ../../library/cgi.rst:275 -msgid "" -"This method always returns a list of values associated with form field " -"*name*. The method returns an empty list if no such form field or value " -"exists for *name*. It returns a list consisting of one item if only one " -"such value exists." -msgstr "" - -#: ../../library/cgi.rst:279 -msgid "Using these methods you can write nice compact code::" -msgstr "" - -#: ../../library/cgi.rst:281 -msgid "" -"import cgi\n" -"form = cgi.FieldStorage()\n" -"user = form.getfirst(\"user\", \"\").upper() # This way it's safe.\n" -"for item in form.getlist(\"item\"):\n" -" do_something(item)" -msgstr "" -"import cgi\n" -"form = cgi.FieldStorage()\n" -"user = form.getfirst(\"user\", \"\").upper() # 這是安全的方式。\n" -"for item in form.getlist(\"item\"):\n" -" do_something(item)" - -#: ../../library/cgi.rst:291 -msgid "Functions" -msgstr "函式" - -#: ../../library/cgi.rst:293 -msgid "" -"These are useful if you want more control, or if you want to employ some of " -"the algorithms implemented in this module in other circumstances." -msgstr "" - -#: ../../library/cgi.rst:299 -msgid "" -"Parse a query in the environment or from a file (the file defaults to ``sys." -"stdin``). The *keep_blank_values*, *strict_parsing* and *separator* " -"parameters are passed to :func:`urllib.parse.parse_qs` unchanged." -msgstr "" - -#: ../../library/cgi.rst:303 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced by calling :func:`urllib.parse.parse_qs` directly on the desired " -"query string (except for ``multipart/form-data`` input, which can be handled " -"as described for :func:`parse_multipart`)." -msgstr "" - -#: ../../library/cgi.rst:312 -msgid "" -"Parse input of type :mimetype:`multipart/form-data` (for file uploads). " -"Arguments are *fp* for the input file, *pdict* for a dictionary containing " -"other parameters in the :mailheader:`Content-Type` header, and *encoding*, " -"the request encoding." -msgstr "" - -#: ../../library/cgi.rst:317 -msgid "" -"Returns a dictionary just like :func:`urllib.parse.parse_qs`: keys are the " -"field names, each value is a list of values for that field. For non-file " -"fields, the value is a list of strings." -msgstr "" - -#: ../../library/cgi.rst:321 -msgid "" -"This is easy to use but not much good if you are expecting megabytes to be " -"uploaded --- in that case, use the :class:`FieldStorage` class instead which " -"is much more flexible." -msgstr "" - -#: ../../library/cgi.rst:325 -msgid "" -"Added the *encoding* and *errors* parameters. For non-file fields, the " -"value is now a list of strings, not bytes." -msgstr "" - -#: ../../library/cgi.rst:329 -msgid "Added the *separator* parameter." -msgstr "新增 *separator* 參數。" - -#: ../../library/cgi.rst:332 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced with the functionality in the :mod:`email` package (e.g. :class:" -"`email.message.EmailMessage`/:class:`email.message.Message`) which " -"implements the same MIME RFCs, or with the :pypi:`multipart` PyPI project." -msgstr "" - -#: ../../library/cgi.rst:342 -msgid "" -"Parse a MIME header (such as :mailheader:`Content-Type`) into a main value " -"and a dictionary of parameters." -msgstr "" - -#: ../../library/cgi.rst:345 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced with the functionality in the :mod:`email` package, which " -"implements the same MIME RFCs." -msgstr "" - -#: ../../library/cgi.rst:350 -msgid "For example, with :class:`email.message.EmailMessage`::" -msgstr "" - -#: ../../library/cgi.rst:352 -msgid "" -"from email.message import EmailMessage\n" -"msg = EmailMessage()\n" -"msg['content-type'] = 'application/json; charset=\"utf8\"'\n" -"main, params = msg.get_content_type(), msg['content-type'].params" -msgstr "" -"from email.message import EmailMessage\n" -"msg = EmailMessage()\n" -"msg['content-type'] = 'application/json; charset=\"utf8\"'\n" -"main, params = msg.get_content_type(), msg['content-type'].params" - -#: ../../library/cgi.rst:360 -msgid "" -"Robust test CGI script, usable as main program. Writes minimal HTTP headers " -"and formats all information provided to the script in HTML format." -msgstr "" - -#: ../../library/cgi.rst:366 -msgid "Format the shell environment in HTML." -msgstr "" - -#: ../../library/cgi.rst:371 -msgid "Format a form in HTML." -msgstr "" - -#: ../../library/cgi.rst:376 -msgid "Format the current directory in HTML." -msgstr "" - -#: ../../library/cgi.rst:381 -msgid "Print a list of useful (used by CGI) environment variables in HTML." -msgstr "" - -#: ../../library/cgi.rst:387 -msgid "Caring about security" -msgstr "" - -#: ../../library/cgi.rst:391 -msgid "" -"There's one important rule: if you invoke an external program (via :func:`os." -"system`, :func:`os.popen` or other functions with similar functionality), " -"make very sure you don't pass arbitrary strings received from the client to " -"the shell. This is a well-known security hole whereby clever hackers " -"anywhere on the web can exploit a gullible CGI script to invoke arbitrary " -"shell commands. Even parts of the URL or field names cannot be trusted, " -"since the request doesn't have to come from your form!" -msgstr "" - -#: ../../library/cgi.rst:399 -msgid "" -"To be on the safe side, if you must pass a string gotten from a form to a " -"shell command, you should make sure the string contains only alphanumeric " -"characters, dashes, underscores, and periods." -msgstr "" - -#: ../../library/cgi.rst:405 -msgid "Installing your CGI script on a Unix system" -msgstr "" - -#: ../../library/cgi.rst:407 -msgid "" -"Read the documentation for your HTTP server and check with your local system " -"administrator to find the directory where CGI scripts should be installed; " -"usually this is in a directory :file:`cgi-bin` in the server tree." -msgstr "" - -#: ../../library/cgi.rst:411 -msgid "" -"Make sure that your script is readable and executable by \"others\"; the " -"Unix file mode should be ``0o755`` octal (use ``chmod 0755 filename``). " -"Make sure that the first line of the script contains ``#!`` starting in " -"column 1 followed by the pathname of the Python interpreter, for instance::" -msgstr "" - -#: ../../library/cgi.rst:416 -msgid "#!/usr/local/bin/python" -msgstr "#!/usr/local/bin/python" - -#: ../../library/cgi.rst:418 -msgid "" -"Make sure the Python interpreter exists and is executable by \"others\"." -msgstr "" - -#: ../../library/cgi.rst:420 -msgid "" -"Make sure that any files your script needs to read or write are readable or " -"writable, respectively, by \"others\" --- their mode should be ``0o644`` for " -"readable and ``0o666`` for writable. This is because, for security reasons, " -"the HTTP server executes your script as user \"nobody\", without any special " -"privileges. It can only read (write, execute) files that everybody can read " -"(write, execute). The current directory at execution time is also different " -"(it is usually the server's cgi-bin directory) and the set of environment " -"variables is also different from what you get when you log in. In " -"particular, don't count on the shell's search path for executables (:envvar:" -"`PATH`) or the Python module search path (:envvar:`PYTHONPATH`) to be set to " -"anything interesting." -msgstr "" - -#: ../../library/cgi.rst:431 -msgid "" -"If you need to load modules from a directory which is not on Python's " -"default module search path, you can change the path in your script, before " -"importing other modules. For example::" -msgstr "" - -#: ../../library/cgi.rst:435 -msgid "" -"import sys\n" -"sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" -"sys.path.insert(0, \"/usr/local/lib/python\")" -msgstr "" -"import sys\n" -"sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" -"sys.path.insert(0, \"/usr/local/lib/python\")" - -#: ../../library/cgi.rst:439 -msgid "(This way, the directory inserted last will be searched first!)" -msgstr "" - -#: ../../library/cgi.rst:441 -msgid "" -"Instructions for non-Unix systems will vary; check your HTTP server's " -"documentation (it will usually have a section on CGI scripts)." -msgstr "" - -#: ../../library/cgi.rst:446 -msgid "Testing your CGI script" -msgstr "" - -#: ../../library/cgi.rst:448 -msgid "" -"Unfortunately, a CGI script will generally not run when you try it from the " -"command line, and a script that works perfectly from the command line may " -"fail mysteriously when run from the server. There's one reason why you " -"should still test your script from the command line: if it contains a syntax " -"error, the Python interpreter won't execute it at all, and the HTTP server " -"will most likely send a cryptic error to the client." -msgstr "" - -#: ../../library/cgi.rst:455 -msgid "" -"Assuming your script has no syntax errors, yet it does not work, you have no " -"choice but to read the next section." -msgstr "" - -#: ../../library/cgi.rst:460 -msgid "Debugging CGI scripts" -msgstr "" - -#: ../../library/cgi.rst:464 -msgid "" -"First of all, check for trivial installation errors --- reading the section " -"above on installing your CGI script carefully can save you a lot of time. " -"If you wonder whether you have understood the installation procedure " -"correctly, try installing a copy of this module file (:file:`cgi.py`) as a " -"CGI script. When invoked as a script, the file will dump its environment " -"and the contents of the form in HTML format. Give it the right mode etc., " -"and send it a request. If it's installed in the standard :file:`cgi-bin` " -"directory, it should be possible to send it a request by entering a URL into " -"your browser of the form:" -msgstr "" - -#: ../../library/cgi.rst:473 -msgid "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" -msgstr "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" - -#: ../../library/cgi.rst:477 -msgid "" -"If this gives an error of type 404, the server cannot find the script -- " -"perhaps you need to install it in a different directory. If it gives " -"another error, there's an installation problem that you should fix before " -"trying to go any further. If you get a nicely formatted listing of the " -"environment and form content (in this example, the fields should be listed " -"as \"addr\" with value \"At Home\" and \"name\" with value \"Joe Blow\"), " -"the :file:`cgi.py` script has been installed correctly. If you follow the " -"same procedure for your own script, you should now be able to debug it." -msgstr "" - -#: ../../library/cgi.rst:486 -msgid "" -"The next step could be to call the :mod:`cgi` module's :func:`test` function " -"from your script: replace its main code with the single statement ::" -msgstr "" - -#: ../../library/cgi.rst:489 -msgid "cgi.test()" -msgstr "cgi.test()" - -#: ../../library/cgi.rst:491 -msgid "" -"This should produce the same results as those gotten from installing the :" -"file:`cgi.py` file itself." -msgstr "" - -#: ../../library/cgi.rst:494 -msgid "" -"When an ordinary Python script raises an unhandled exception (for whatever " -"reason: of a typo in a module name, a file that can't be opened, etc.), the " -"Python interpreter prints a nice traceback and exits. While the Python " -"interpreter will still do this when your CGI script raises an exception, " -"most likely the traceback will end up in one of the HTTP server's log files, " -"or be discarded altogether." -msgstr "" - -#: ../../library/cgi.rst:501 -msgid "" -"Fortunately, once you have managed to get your script to execute *some* " -"code, you can easily send tracebacks to the web browser using the :mod:" -"`cgitb` module. If you haven't done so already, just add the lines::" -msgstr "" - -#: ../../library/cgi.rst:508 -msgid "" -"to the top of your script. Then try running it again; when a problem " -"occurs, you should see a detailed report that will likely make apparent the " -"cause of the crash." -msgstr "" - -#: ../../library/cgi.rst:512 -msgid "" -"If you suspect that there may be a problem in importing the :mod:`cgitb` " -"module, you can use an even more robust approach (which only uses built-in " -"modules)::" -msgstr "" - -#: ../../library/cgi.rst:515 -msgid "" -"import sys\n" -"sys.stderr = sys.stdout\n" -"print(\"Content-Type: text/plain\")\n" -"print()\n" -"...your code here..." -msgstr "" - -#: ../../library/cgi.rst:521 -msgid "" -"This relies on the Python interpreter to print the traceback. The content " -"type of the output is set to plain text, which disables all HTML " -"processing. If your script works, the raw HTML will be displayed by your " -"client. If it raises an exception, most likely after the first two lines " -"have been printed, a traceback will be displayed. Because no HTML " -"interpretation is going on, the traceback will be readable." -msgstr "" - -#: ../../library/cgi.rst:530 -msgid "Common problems and solutions" -msgstr "" - -#: ../../library/cgi.rst:532 -msgid "" -"Most HTTP servers buffer the output from CGI scripts until the script is " -"completed. This means that it is not possible to display a progress report " -"on the client's display while the script is running." -msgstr "" - -#: ../../library/cgi.rst:536 -msgid "Check the installation instructions above." -msgstr "" - -#: ../../library/cgi.rst:538 -msgid "" -"Check the HTTP server's log files. (``tail -f logfile`` in a separate " -"window may be useful!)" -msgstr "" - -#: ../../library/cgi.rst:541 -msgid "" -"Always check a script for syntax errors first, by doing something like " -"``python script.py``." -msgstr "" - -#: ../../library/cgi.rst:544 -msgid "" -"If your script does not have any syntax errors, try adding ``import cgitb; " -"cgitb.enable()`` to the top of the script." -msgstr "" - -#: ../../library/cgi.rst:547 -msgid "" -"When invoking external programs, make sure they can be found. Usually, this " -"means using absolute path names --- :envvar:`PATH` is usually not set to a " -"very useful value in a CGI script." -msgstr "" - -#: ../../library/cgi.rst:551 +#: ../../library/cgi.rst:10 msgid "" -"When reading or writing external files, make sure they can be read or " -"written by the userid under which your CGI script will be running: this is " -"typically the userid under which the web server is running, or some " -"explicitly specified userid for a web server's ``suexec`` feature." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/cgi.rst:556 +#: ../../library/cgi.rst:14 msgid "" -"Don't try to give a CGI script a set-uid mode. This doesn't work on most " -"systems, and is a security liability as well." +"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " +"is a copy of the cgi module, no longer maintained or supported by the core " +"Python team." msgstr "" -#: ../../library/cgi.rst:560 -msgid "Footnotes" -msgstr "註解" - -#: ../../library/cgi.rst:561 +#: ../../library/cgi.rst:18 msgid "" -"Note that some recent versions of the HTML specification do state what order " -"the field values should be supplied in, but knowing whether a request was " -"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 "WWW" - -#: ../../library/cgi.rst:10 -msgid "server" -msgstr "server(伺服器)" - -#: ../../library/cgi.rst:10 ../../library/cgi.rst:389 ../../library/cgi.rst:462 -msgid "CGI" -msgstr "CGI" - -#: ../../library/cgi.rst:10 -msgid "protocol" -msgstr "protocol(協定)" - -#: ../../library/cgi.rst:10 -msgid "HTTP" -msgstr "HTTP" - -#: ../../library/cgi.rst:10 -msgid "MIME" -msgstr "MIME" - -#: ../../library/cgi.rst:10 -msgid "headers" -msgstr "headers(標頭)" - -#: ../../library/cgi.rst:10 -msgid "URL" -msgstr "URL(統一資源定位器)" - -#: ../../library/cgi.rst:10 -msgid "Common Gateway Interface" -msgstr "Common Gateway Interface(通用閘道器介面)" - -#: ../../library/cgi.rst:389 -msgid "security" -msgstr "security(安全)" - -#: ../../library/cgi.rst:462 -msgid "debugging" -msgstr "debugging(除錯)" +"The last version of Python that provided the :mod:`!cgi` module was `Python " +"3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/cgi.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/cgi.py`" + +#~ msgid "" +#~ "The :mod:`cgi` module is deprecated (see :pep:`PEP 594 <594#cgi>` for " +#~ "details and alternatives)." +#~ msgstr "" +#~ ":mod:`cgi` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +#~ "<594#cgi>`\\ )。" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + +#~ msgid "Introduction" +#~ msgstr "簡介" + +#~ msgid "" +#~ "print(\"CGI script output\")\n" +#~ "print(\"

This is my first CGI script

\")\n" +#~ "print(\"Hello, world!\")" +#~ msgstr "" +#~ "print(\"CGI script output\")\n" +#~ "print(\"

This is my first CGI script

\")\n" +#~ "print(\"Hello, world!\")" + +#~ msgid "Using the cgi module" +#~ msgstr "使用 cgi 模組" + +#~ msgid "" +#~ "import cgitb\n" +#~ "cgitb.enable()" +#~ msgstr "" +#~ "import cgitb\n" +#~ "cgitb.enable()" + +#~ msgid "" +#~ "import cgitb\n" +#~ "cgitb.enable(display=0, logdir=\"/path/to/logdir\")" +#~ msgstr "" +#~ "import cgitb\n" +#~ "cgitb.enable(display=0, logdir=\"/path/to/logdir\")" + +#~ msgid "" +#~ "value = form.getlist(\"username\")\n" +#~ "usernames = \",\".join(value)" +#~ msgstr "" +#~ "value = form.getlist(\"username\")\n" +#~ "usernames = \",\".join(value)" + +#~ msgid "" +#~ "\n" +#~ "" +#~ msgstr "" +#~ "\n" +#~ "" + +#~ msgid "user = form.getvalue(\"user\").upper()" +#~ msgstr "user = form.getvalue(\"user\").upper()" + +#~ msgid "" +#~ "import cgi\n" +#~ "form = cgi.FieldStorage()\n" +#~ "user = form.getfirst(\"user\", \"\").upper() # This way it's safe.\n" +#~ "for item in form.getlist(\"item\"):\n" +#~ " do_something(item)" +#~ msgstr "" +#~ "import cgi\n" +#~ "form = cgi.FieldStorage()\n" +#~ "user = form.getfirst(\"user\", \"\").upper() # 這是安全的方式。\n" +#~ "for item in form.getlist(\"item\"):\n" +#~ " do_something(item)" + +#~ msgid "Functions" +#~ msgstr "函式" + +#~ msgid "Added the *separator* parameter." +#~ msgstr "新增 *separator* 參數。" + +#~ msgid "" +#~ "from email.message import EmailMessage\n" +#~ "msg = EmailMessage()\n" +#~ "msg['content-type'] = 'application/json; charset=\"utf8\"'\n" +#~ "main, params = msg.get_content_type(), msg['content-type'].params" +#~ msgstr "" +#~ "from email.message import EmailMessage\n" +#~ "msg = EmailMessage()\n" +#~ "msg['content-type'] = 'application/json; charset=\"utf8\"'\n" +#~ "main, params = msg.get_content_type(), msg['content-type'].params" + +#~ msgid "#!/usr/local/bin/python" +#~ msgstr "#!/usr/local/bin/python" + +#~ msgid "" +#~ "import sys\n" +#~ "sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" +#~ "sys.path.insert(0, \"/usr/local/lib/python\")" +#~ msgstr "" +#~ "import sys\n" +#~ "sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" +#~ "sys.path.insert(0, \"/usr/local/lib/python\")" + +#~ msgid "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" +#~ msgstr "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" + +#~ msgid "cgi.test()" +#~ msgstr "cgi.test()" + +#~ msgid "Footnotes" +#~ msgstr "註解" + +#~ msgid "WWW" +#~ msgstr "WWW" + +#~ msgid "server" +#~ msgstr "server(伺服器)" + +#~ msgid "CGI" +#~ msgstr "CGI" + +#~ msgid "protocol" +#~ msgstr "protocol(協定)" + +#~ msgid "HTTP" +#~ msgstr "HTTP" + +#~ msgid "MIME" +#~ msgstr "MIME" + +#~ msgid "headers" +#~ msgstr "headers(標頭)" + +#~ msgid "URL" +#~ msgstr "URL(統一資源定位器)" + +#~ msgid "Common Gateway Interface" +#~ msgstr "Common Gateway Interface(通用閘道器介面)" + +#~ msgid "security" +#~ msgstr "security(安全)" + +#~ msgid "debugging" +#~ msgstr "debugging(除錯)" diff --git a/library/cgitb.po b/library/cgitb.po index e608145917..16bb7426ce 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,118 +20,58 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/cgitb.rst:2 -msgid ":mod:`cgitb` --- Traceback manager for CGI scripts" +#, fuzzy +msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" msgstr ":mod:`cgitb` --- CGI 腳本的回溯 (traceback) 管理程式" -#: ../../library/cgitb.rst:11 -msgid "**Source code:** :source:`Lib/cgitb.py`" -msgstr "**原始碼:**\\ :source:`Lib/cgitb.py`" - -#: ../../library/cgitb.rst:19 -msgid "" -"The :mod:`cgitb` module is deprecated (see :pep:`PEP 594 <594#cgitb>` for " -"details)." -msgstr "" -":mod:`cgitb` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#cgitb>`\\ )。" - -#: ../../library/cgitb.rst:25 -msgid "" -"The :mod:`cgitb` module provides a special exception handler for Python " -"scripts. (Its name is a bit misleading. It was originally designed to " -"display extensive traceback information in HTML for CGI scripts. It was " -"later generalized to also display this information in plain text.) After " -"this module is activated, if an uncaught exception occurs, a detailed, " -"formatted report will be displayed. The report includes a traceback showing " -"excerpts of the source code for each level, as well as the values of the " -"arguments and local variables to currently running functions, to help you " -"debug the problem. Optionally, you can save this information to a file " -"instead of sending it to the browser." -msgstr "" - -#: ../../library/cgitb.rst:35 -msgid "To enable this feature, simply add this to the top of your CGI script::" -msgstr "" - -#: ../../library/cgitb.rst:37 +#: ../../library/cgitb.rst:10 msgid "" -"import cgitb\n" -"cgitb.enable()" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -"import cgitb\n" -"cgitb.enable()" -#: ../../library/cgitb.rst:40 +#: ../../library/cgitb.rst:14 msgid "" -"The options to the :func:`enable` function control whether the report is " -"displayed in the browser and whether the report is logged to a file for " -"later analysis." +"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " +"This is a copy of the cgi module, no longer maintained or supported by the " +"core Python team." msgstr "" -#: ../../library/cgitb.rst:49 +#: ../../library/cgitb.rst:18 msgid "" -"This function causes the :mod:`cgitb` module to take over the interpreter's " -"default handling for exceptions by setting the value of :attr:`sys." -"excepthook`." +"The last version of Python that provided the :mod:`!cgitb` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/cgitb.rst:52 -msgid "" -"The optional argument *display* defaults to ``1`` and can be set to ``0`` to " -"suppress sending the traceback to the browser. If the argument *logdir* is " -"present, the traceback reports are written to files. The value of *logdir* " -"should be a directory where these files will be placed. The optional " -"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\"``." -msgstr "" +#~ msgid "**Source code:** :source:`Lib/cgitb.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/cgitb.py`" -#: ../../library/cgitb.rst:64 -msgid "" -"This function handles the exception described by *info* (a 3-tuple " -"containing the result of :func:`sys.exc_info`), formatting its traceback as " -"text and returning the result as a string. The optional 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``." -msgstr "" +#~ msgid "" +#~ "The :mod:`cgitb` module is deprecated (see :pep:`PEP 594 <594#cgitb>` for " +#~ "details)." +#~ msgstr "" +#~ ":mod:`cgitb` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#cgitb>`\\ )。" -#: ../../library/cgitb.rst:73 -msgid "" -"This function handles the exception described by *info* (a 3-tuple " -"containing the result of :func:`sys.exc_info`), formatting its traceback as " -"HTML and returning the result as a string. The optional 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``." -msgstr "" - -#: ../../library/cgitb.rst:82 -msgid "" -"This function handles an exception using the default settings (that is, show " -"a report in the browser, but don't log to a file). This can be used when " -"you've caught an exception and want to report it using :mod:`cgitb`. The " -"optional *info* argument should be a 3-tuple containing an exception type, " -"exception value, and traceback object, exactly like the tuple returned by :" -"func:`sys.exc_info`. If the *info* argument is not supplied, the current " -"exception is obtained from :func:`sys.exc_info`." -msgstr "" +#~ msgid "" +#~ "import cgitb\n" +#~ "cgitb.enable()" +#~ msgstr "" +#~ "import cgitb\n" +#~ "cgitb.enable()" -#: ../../library/cgitb.rst:13 -msgid "CGI" -msgstr "CGI" +#~ msgid "CGI" +#~ msgstr "CGI" -#: ../../library/cgitb.rst:13 -msgid "exceptions" -msgstr "exceptions(例外)" +#~ msgid "exceptions" +#~ msgstr "exceptions(例外)" -#: ../../library/cgitb.rst:13 -msgid "tracebacks" -msgstr "tracebacks(回溯)" +#~ msgid "tracebacks" +#~ msgstr "tracebacks(回溯)" -#: ../../library/cgitb.rst:13 -msgid "in CGI scripts" -msgstr "於 CGI 腳本中" +#~ msgid "in CGI scripts" +#~ msgstr "於 CGI 腳本中" -#: ../../library/cgitb.rst:47 -msgid "excepthook() (in module sys)" -msgstr "excepthook() (sys 模組中)" +#~ msgid "excepthook() (in module sys)" +#~ msgstr "excepthook() (sys 模組中)" diff --git a/library/chunk.po b/library/chunk.po index 96bf1cfea3..1603398782 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,206 +20,71 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/chunk.rst:2 -msgid ":mod:`chunk` --- Read IFF chunked data" +#, fuzzy +msgid ":mod:`!chunk` --- Read IFF chunked data" msgstr ":mod:`chunk` --- 讀取 IFF 分塊資料" -#: ../../library/chunk.rst:11 -msgid "**Source code:** :source:`Lib/chunk.py`" -msgstr "**原始碼:**\\ :source:`Lib/chunk.py`" - -#: ../../library/chunk.rst:20 +#: ../../library/chunk.rst:10 msgid "" -"The :mod:`chunk` module is deprecated (see :pep:`PEP 594 <594#chunk>` for " -"details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`chunk` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#chunk>`\\ )。" -#: ../../library/chunk.rst:26 +#: ../../library/chunk.rst:14 msgid "" -"This module provides an interface for reading files that use EA IFF 85 " -"chunks. [#]_ This format is used in at least the Audio Interchange File " -"Format (AIFF/AIFF-C) and the Real Media File Format (RMFF). The WAVE audio " -"file format is closely related and can also be read using this module." -msgstr "" - -#: ../../library/chunk.rst:31 -msgid "A chunk has the following structure:" -msgstr "" - -#: ../../library/chunk.rst:34 -msgid "Offset" -msgstr "" - -#: ../../library/chunk.rst:34 -msgid "Length" -msgstr "長度" - -#: ../../library/chunk.rst:34 -msgid "Contents" -msgstr "內容" - -#: ../../library/chunk.rst:36 -msgid "0" -msgstr "0" - -#: ../../library/chunk.rst:36 ../../library/chunk.rst:38 -msgid "4" -msgstr "4" - -#: ../../library/chunk.rst:36 -msgid "Chunk ID" -msgstr "" - -#: ../../library/chunk.rst:38 -msgid "Size of chunk in big-endian byte order, not including the header" +"The last version of Python that provided the :mod:`!chunk` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/chunk.rst:42 -msgid "8" -msgstr "8" +#~ msgid "**Source code:** :source:`Lib/chunk.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/chunk.py`" -#: ../../library/chunk.rst:42 -msgid "*n*" -msgstr "*n*" +#~ msgid "" +#~ "The :mod:`chunk` module is deprecated (see :pep:`PEP 594 <594#chunk>` for " +#~ "details)." +#~ msgstr "" +#~ ":mod:`chunk` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#chunk>`\\ )。" -#: ../../library/chunk.rst:42 -msgid "Data bytes, where *n* is the size given in the preceding field" -msgstr "" +#~ msgid "Length" +#~ msgstr "長度" -#: ../../library/chunk.rst:46 -msgid "8 + *n*" -msgstr "8 + *n*" +#~ msgid "Contents" +#~ msgstr "內容" -#: ../../library/chunk.rst:46 -msgid "0 or 1" -msgstr "0 或 1" +#~ msgid "0" +#~ msgstr "0" -#: ../../library/chunk.rst:46 -msgid "Pad byte needed if *n* is odd and chunk alignment is used" -msgstr "" +#~ msgid "4" +#~ msgstr "4" -#: ../../library/chunk.rst:50 -msgid "The ID is a 4-byte string which identifies the type of chunk." -msgstr "" +#~ msgid "8" +#~ msgstr "8" -#: ../../library/chunk.rst:52 -msgid "" -"The size field (a 32-bit value, encoded using big-endian byte order) gives " -"the size of the chunk data, not including the 8-byte header." -msgstr "" +#~ msgid "*n*" +#~ msgstr "*n*" -#: ../../library/chunk.rst:55 -msgid "" -"Usually an IFF-type file consists of one or more chunks. The proposed usage " -"of the :class:`Chunk` class defined here is to instantiate an instance at " -"the start of each chunk and read from the instance until it reaches the end, " -"after which a new instance can be instantiated. At the end of the file, " -"creating a new instance will fail with an :exc:`EOFError` exception." -msgstr "" +#~ msgid "8 + *n*" +#~ msgstr "8 + *n*" -#: ../../library/chunk.rst:64 -msgid "" -"Class which represents a chunk. The *file* argument is expected to be a " -"file-like object. An instance of this class is specifically allowed. The " -"only method that is needed is :meth:`~io.IOBase.read`. If the methods :meth:" -"`~io.IOBase.seek` and :meth:`~io.IOBase.tell` are present and don't raise an " -"exception, they are also used. If these methods are present and raise an " -"exception, they are expected to not have altered the object. If the " -"optional argument *align* is true, chunks are assumed to be aligned on 2-" -"byte boundaries. If *align* is false, no alignment is assumed. The default " -"value is true. If the optional argument *bigendian* is false, the chunk " -"size is assumed to be in little-endian order. This is needed for WAVE audio " -"files. The default value is true. If the optional argument *inclheader* is " -"true, the size given in the chunk header includes the size of the header. " -"The default value is false." -msgstr "" - -#: ../../library/chunk.rst:78 -msgid "A :class:`Chunk` object supports the following methods:" -msgstr "" +#~ msgid "0 or 1" +#~ msgstr "0 或 1" -#: ../../library/chunk.rst:83 -msgid "" -"Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk." -msgstr "" - -#: ../../library/chunk.rst:89 -msgid "Returns the size of the chunk." -msgstr "" - -#: ../../library/chunk.rst:94 -msgid "" -"Close and skip to the end of the chunk. This does not close the underlying " -"file." -msgstr "" - -#: ../../library/chunk.rst:97 -msgid "" -"The remaining methods will raise :exc:`OSError` if called after the :meth:" -"`close` method has been called. Before Python 3.3, they used to raise :exc:" -"`IOError`, now an alias of :exc:`OSError`." -msgstr "" - -#: ../../library/chunk.rst:104 -msgid "Returns ``False``." -msgstr "" - -#: ../../library/chunk.rst:109 -msgid "" -"Set the chunk's current position. The *whence* argument is optional and " -"defaults to ``0`` (absolute file positioning); other values are ``1`` (seek " -"relative to the current position) and ``2`` (seek relative to the file's " -"end). There is no return value. If the underlying file does not allow seek, " -"only forward seeks are allowed." -msgstr "" - -#: ../../library/chunk.rst:118 -msgid "Return the current position into the chunk." -msgstr "" - -#: ../../library/chunk.rst:123 -msgid "" -"Read at most *size* bytes from the chunk (less if the read hits the end of " -"the chunk before obtaining *size* bytes). If the *size* argument is " -"negative or omitted, read all data until the end of the chunk. An empty " -"bytes object is returned when the end of the chunk is encountered " -"immediately." -msgstr "" - -#: ../../library/chunk.rst:132 -msgid "" -"Skip to the end of the chunk. All further calls to :meth:`read` for the " -"chunk will return ``b''``. If you are not interested in the contents of the " -"chunk, this method should be called so that the file points to the start of " -"the next chunk." -msgstr "" - -#: ../../library/chunk.rst:139 -msgid "Footnotes" -msgstr "註解" - -#: ../../library/chunk.rst:140 -msgid "" -"\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " -"Electronic Arts, January 1985." -msgstr "" +#~ msgid "Footnotes" +#~ msgstr "註解" -#: ../../library/chunk.rst:13 -msgid "Audio Interchange File Format" -msgstr "Audio Interchange File Format(音訊交換檔案格式)" +#~ msgid "Audio Interchange File Format" +#~ msgstr "Audio Interchange File Format(音訊交換檔案格式)" -#: ../../library/chunk.rst:13 -msgid "AIFF" -msgstr "AIFF" +#~ msgid "AIFF" +#~ msgstr "AIFF" -#: ../../library/chunk.rst:13 -msgid "AIFF-C" -msgstr "AIFF-C" +#~ msgid "AIFF-C" +#~ msgstr "AIFF-C" -#: ../../library/chunk.rst:13 -msgid "Real Media File Format" -msgstr "Real Media File Format(Real Media 檔案格式)" +#~ msgid "Real Media File Format" +#~ msgstr "Real Media File Format(Real Media 檔案格式)" -#: ../../library/chunk.rst:13 -msgid "RMFF" -msgstr "RMFF" +#~ msgid "RMFF" +#~ msgstr "RMFF" diff --git a/library/cmath.po b/library/cmath.po index 40159235bf..3282049b43 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-03-14 09:26+0800\n" "Last-Translator: Enkai Huang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -309,42 +309,39 @@ msgid "" msgstr "如果 *a* 和 *b* 的值相互接近,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/cmath.rst:223 +#, fuzzy msgid "" "Whether or not two values are considered close is determined according to " -"given absolute and relative tolerances." +"given absolute and relative tolerances. If no errors occur, the result will " +"be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "" "兩個值是否被認為相互接近是由給定的絕對和相對容許偏差 (tolerance) 所決定的。" -#: ../../library/cmath.rst:226 +#: ../../library/cmath.rst:227 +#, fuzzy 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*. " "For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default " "tolerance is ``1e-09``, which assures that the two values are the same " -"within about 9 decimal digits. *rel_tol* must be greater than zero." +"within about 9 decimal digits. *rel_tol* must be nonnegative and less than " +"``1.0``." msgstr "" "*rel_tol* 是相對容許偏差 -- 它是 *a* 和 *b* 之間的最大容許偏差值,相對於 *a* " "或 *b* 的較大絕對值。例如,要設定 5% 的容許偏差,請傳遞 ``rel_tol=0.05``。預" "設容許偏差是 ``1e-09``,它確保兩個值在大約 9 位十進制數字內相同。 *rel_tol* " "必須大於零。" -#: ../../library/cmath.rst:232 +#: ../../library/cmath.rst:234 msgid "" -"*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " -"zero. *abs_tol* must be at least zero." +"*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " +"nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " +"as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and " +"rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument " +"to the call." msgstr "" -"*abs_tol* 是最小絕對容許偏差 -- 對於接近零的比較很有用。 *abs_tol* 必須至少為" -"零。" -#: ../../library/cmath.rst:235 -msgid "" -"If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " -"max(abs(a), abs(b)), abs_tol)``." -msgstr "" -"如果未發生錯誤,結果將為: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), " -"abs_tol)``。" - -#: ../../library/cmath.rst:238 +#: ../../library/cmath.rst:240 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -355,49 +352,49 @@ msgstr "" "體來說, ``NaN`` 不被認為接近任何其他值,包括 ``NaN``。 ``inf`` 和 ``-inf`` " "只被認為是接近它們自己的。" -#: ../../library/cmath.rst:247 +#: ../../library/cmath.rst:249 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` -- 一個用來測試近似相等的函式" -#: ../../library/cmath.rst:251 +#: ../../library/cmath.rst:253 msgid "Constants" msgstr "常數" -#: ../../library/cmath.rst:255 +#: ../../library/cmath.rst:257 msgid "The mathematical constant *π*, as a float." msgstr "數學常數 *π*,作為一個浮點數。" -#: ../../library/cmath.rst:260 +#: ../../library/cmath.rst:262 msgid "The mathematical constant *e*, as a float." msgstr "數學常數 *e*,作為一個浮點數。" -#: ../../library/cmath.rst:265 +#: ../../library/cmath.rst:267 msgid "The mathematical constant *τ*, as a float." msgstr "數學常數 *τ*,作為一個浮點數。" -#: ../../library/cmath.rst:272 +#: ../../library/cmath.rst:274 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." msgstr "正無窮大的浮點數。相當於 ``float('inf')``。" -#: ../../library/cmath.rst:279 +#: ../../library/cmath.rst:281 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." msgstr "實部為零和虛部為正無窮的複數。相當於 ``complex(0.0, float('inf'))``。" -#: ../../library/cmath.rst:287 +#: ../../library/cmath.rst:289 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." msgstr "浮點「非數字」 (NaN) 值。相當於 ``float('nan')``。" -#: ../../library/cmath.rst:295 +#: ../../library/cmath.rst:297 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." msgstr "實部為零和虛部為 NaN 的複數。相當於 ``complex(0.0, float('nan'))``。" -#: ../../library/cmath.rst:303 +#: ../../library/cmath.rst:305 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 " @@ -413,7 +410,7 @@ msgstr "" "sqrt(-1)`` 引發異常,也不願它回傳複數。另請注意, :mod:`cmath` 中所定義的函式" "始終都會回傳複數,即使答案可以表示為實數(在這種情況下,複數的虛部為零)。" -#: ../../library/cmath.rst:311 +#: ../../library/cmath.rst:313 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. " @@ -428,17 +425,31 @@ msgstr "" "所有關於複變函數的(不是太初級的)書籍以獲得啟發。對於如何正確地基於數值目的" "選擇分枝切割的相關訊息,以下內容應該是一個很好的參考:" -#: ../../library/cmath.rst:321 +#: ../../library/cmath.rst:323 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 " "art in numerical analysis. Clarendon Press (1987) pp165--211." msgstr "" -#: ../../library/cmath.rst:301 +#: ../../library/cmath.rst:303 msgid "module" msgstr "module(模組)" -#: ../../library/cmath.rst:301 +#: ../../library/cmath.rst:303 msgid "math" msgstr "math(數學)" + +#~ msgid "" +#~ "*abs_tol* is the minimum absolute tolerance -- useful for comparisons " +#~ "near zero. *abs_tol* must be at least zero." +#~ msgstr "" +#~ "*abs_tol* 是最小絕對容許偏差 -- 對於接近零的比較很有用。 *abs_tol* 必須至" +#~ "少為零。" + +#~ msgid "" +#~ "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " +#~ "max(abs(a), abs(b)), abs_tol)``." +#~ msgstr "" +#~ "如果未發生錯誤,結果將為: ``abs(a-b) <= max(rel_tol * max(abs(a), " +#~ "abs(b)), abs_tol)``。" diff --git a/library/configparser.po b/library/configparser.po index acab0efbd0..ce0e346f68 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -187,7 +187,7 @@ msgid "" "and stored in lowercase [1]_." msgstr "" -#: ../../library/configparser.rst:148 ../../library/configparser.rst:993 +#: ../../library/configparser.rst:148 ../../library/configparser.rst:1003 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " @@ -197,7 +197,7 @@ msgid "" "``example.ini`` file." msgstr "" -#: ../../library/configparser.rst:155 ../../library/configparser.rst:1000 +#: ../../library/configparser.rst:155 ../../library/configparser.rst:1010 msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" @@ -205,7 +205,7 @@ msgstr "" "[DEFAULT]\n" "ServerAliveInterval = -1" -#: ../../library/configparser.rst:160 ../../library/configparser.rst:1005 +#: ../../library/configparser.rst:160 ../../library/configparser.rst:1015 msgid "" ">>> config_override = configparser.ConfigParser()\n" ">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" @@ -1329,7 +1329,7 @@ msgstr "" msgid "ConfigParser Objects" msgstr "ConfigParser 物件" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:953 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -1337,7 +1337,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:952 +#: ../../library/configparser.rst:958 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -1346,7 +1346,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:958 +#: ../../library/configparser.rst:964 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1359,7 +1359,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:968 +#: ../../library/configparser.rst:974 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1369,7 +1369,7 @@ msgid "" "settings to a new config file." msgstr "" -#: ../../library/configparser.rst:975 +#: ../../library/configparser.rst:981 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1378,7 +1378,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:981 +#: ../../library/configparser.rst:987 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1387,7 +1387,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:987 +#: ../../library/configparser.rst:993 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -1396,50 +1396,62 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:1018 +#: ../../library/configparser.rst:999 +msgid "" +"When *allow_unnamed_section* is ``True`` (default: ``False``), the first " +"section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-" +"sections>`_." +msgstr "" + +#: ../../library/configparser.rst:1028 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:1021 +#: ../../library/configparser.rst:1031 ../../library/configparser.rst:1320 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:1026 +#: ../../library/configparser.rst:1036 ../../library/configparser.rst:1325 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:1029 +#: ../../library/configparser.rst:1039 msgid "" "The *defaults* argument is read with :meth:`read_dict`, providing consistent " "behavior across the parser: non-string keys and values are implicitly " "converted to strings." msgstr "" -#: ../../library/configparser.rst:1034 ../../library/configparser.rst:1306 +#: ../../library/configparser.rst:1044 ../../library/configparser.rst:1328 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:1038 +#: ../../library/configparser.rst:1048 msgid "" "Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " "and a key without a value is continued with an indented line." msgstr "" -#: ../../library/configparser.rst:1044 +#: ../../library/configparser.rst:1052 ../../library/configparser.rst:1332 +#, fuzzy +msgid "The *allow_unnamed_section* argument was added." +msgstr "新增 *converters* 引數。" + +#: ../../library/configparser.rst:1057 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:1049 +#: ../../library/configparser.rst:1062 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:1055 +#: ../../library/configparser.rst:1068 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1447,34 +1459,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1060 +#: ../../library/configparser.rst:1073 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1066 +#: ../../library/configparser.rst:1079 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1072 +#: ../../library/configparser.rst:1085 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1077 +#: ../../library/configparser.rst:1090 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1084 +#: ../../library/configparser.rst:1097 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1087 +#: ../../library/configparser.rst:1100 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1485,7 +1497,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1096 +#: ../../library/configparser.rst:1109 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1493,7 +1505,7 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1102 +#: ../../library/configparser.rst:1115 msgid "" "import configparser, os\n" "\n" @@ -1509,49 +1521,49 @@ msgstr "" "config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" " encoding='cp1250')" -#: ../../library/configparser.rst:1109 +#: ../../library/configparser.rst:1122 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1113 +#: ../../library/configparser.rst:1126 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1116 +#: ../../library/configparser.rst:1129 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1122 +#: ../../library/configparser.rst:1135 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1125 +#: ../../library/configparser.rst:1138 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`!name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1129 +#: ../../library/configparser.rst:1142 msgid "Replaces :meth:`!readfp`." msgstr "取代 :meth:`!readfp`。" -#: ../../library/configparser.rst:1134 +#: ../../library/configparser.rst:1147 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1136 +#: ../../library/configparser.rst:1149 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1145 +#: ../../library/configparser.rst:1158 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1560,17 +1572,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1151 +#: ../../library/configparser.rst:1164 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1154 +#: ../../library/configparser.rst:1167 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1161 +#: ../../library/configparser.rst:1174 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1579,35 +1591,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1167 +#: ../../library/configparser.rst:1180 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1171 +#: ../../library/configparser.rst:1184 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1179 +#: ../../library/configparser.rst:1192 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1186 +#: ../../library/configparser.rst:1199 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating-point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1193 +#: ../../library/configparser.rst:1206 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1619,34 +1631,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1206 +#: ../../library/configparser.rst:1219 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1209 +#: ../../library/configparser.rst:1222 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1213 +#: ../../library/configparser.rst:1226 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1221 +#: ../../library/configparser.rst:1234 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1228 +#: ../../library/configparser.rst:1241 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1655,27 +1667,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1236 +#: ../../library/configparser.rst:1249 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1244 +#: ../../library/configparser.rst:1257 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1252 +#: ../../library/configparser.rst:1265 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1258 +#: ../../library/configparser.rst:1271 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1684,7 +1696,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1264 +#: ../../library/configparser.rst:1277 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1692,7 +1704,7 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1269 +#: ../../library/configparser.rst:1282 msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" @@ -1700,30 +1712,30 @@ msgstr "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" -#: ../../library/configparser.rst:1272 +#: ../../library/configparser.rst:1285 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1278 +#: ../../library/configparser.rst:1291 msgid "" "A special object representing a section name used to reference the unnamed " "section (see :ref:`unnamed-sections`)." msgstr "" -#: ../../library/configparser.rst:1283 +#: ../../library/configparser.rst:1296 msgid "" "The maximum depth for recursive interpolation for :meth:`~configparser." "ConfigParser.get` when the *raw* parameter is false. This is relevant only " "when the default *interpolation* is used." msgstr "" -#: ../../library/configparser.rst:1291 +#: ../../library/configparser.rst:1304 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1301 +#: ../../library/configparser.rst:1315 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1731,27 +1743,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1311 +#: ../../library/configparser.rst:1336 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1318 +#: ../../library/configparser.rst:1343 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1322 +#: ../../library/configparser.rst:1347 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1328 +#: ../../library/configparser.rst:1353 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1761,7 +1773,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1335 +#: ../../library/configparser.rst:1360 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1769,32 +1781,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1342 +#: ../../library/configparser.rst:1367 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1346 +#: ../../library/configparser.rst:1371 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1351 +#: ../../library/configparser.rst:1376 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1356 +#: ../../library/configparser.rst:1381 msgid "" "Exception raised if :meth:`~ConfigParser.add_section` is called with the " "name of a section that is already present or in strict parsers when a " "section if found more than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1360 +#: ../../library/configparser.rst:1385 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" -#: ../../library/configparser.rst:1367 +#: ../../library/configparser.rst:1392 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1802,64 +1814,64 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1375 +#: ../../library/configparser.rst:1400 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1381 +#: ../../library/configparser.rst:1406 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1387 +#: ../../library/configparser.rst:1412 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1394 +#: ../../library/configparser.rst:1419 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1400 +#: ../../library/configparser.rst:1425 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1406 +#: ../../library/configparser.rst:1431 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1412 +#: ../../library/configparser.rst:1437 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1414 +#: ../../library/configparser.rst:1439 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1420 +#: ../../library/configparser.rst:1445 msgid "" "Exception raised when a key without a corresponding value is continued with " "an indented line." msgstr "" -#: ../../library/configparser.rst:1426 +#: ../../library/configparser.rst:1451 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1427 +#: ../../library/configparser.rst:1452 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/contextvars.po b/library/contextvars.po index 0d55f6ec27..60997afbaf 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -203,45 +203,91 @@ msgstr "" #: ../../library/contextvars.rst:147 msgid "" -"Every thread will have a different top-level :class:`~contextvars.Context` " -"object. This means that a :class:`ContextVar` object behaves in a similar " -"fashion to :func:`threading.local` when values are assigned in different " -"threads." +"Each thread has its own effective stack of :class:`!Context` objects. The :" +"term:`current context` is the :class:`!Context` object at the top of the " +"current thread's stack. All :class:`!Context` objects in the stacks are " +"considered to be *entered*." msgstr "" #: ../../library/contextvars.rst:152 -msgid "Context implements the :class:`collections.abc.Mapping` interface." +msgid "" +"*Entering* a context, which can be done by calling its :meth:`~Context.run` " +"method, makes the context the current context by pushing it onto the top of " +"the current thread's context stack." msgstr "" #: ../../library/contextvars.rst:156 msgid "" -"Execute ``callable(*args, **kwargs)`` code in the context object the *run* " -"method is called on. Return the result of the execution or propagate an " -"exception if one occurred." +"*Exiting* from the current context, which can be done by returning from the " +"callback passed to the :meth:`~Context.run` method, restores the current " +"context to what it was before the context was entered by popping the context " +"off the top of the context stack." msgstr "" -#: ../../library/contextvars.rst:160 +#: ../../library/contextvars.rst:161 msgid "" -"Any changes to any context variables that *callable* makes will be contained " -"in the context object::" +"Since each thread has its own context stack, :class:`ContextVar` objects " +"behave in a similar fashion to :func:`threading.local` when values are " +"assigned in different threads." msgstr "" -#: ../../library/contextvars.rst:163 +#: ../../library/contextvars.rst:165 msgid "" -"var = ContextVar('var')\n" +"Attempting to enter an already entered context, including contexts entered " +"in other threads, raises a :exc:`RuntimeError`." +msgstr "" + +#: ../../library/contextvars.rst:168 +msgid "After exiting a context, it can later be re-entered (from any thread)." +msgstr "" + +#: ../../library/contextvars.rst:170 +msgid "" +"Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " +"method are recorded in the current context. The :meth:`ContextVar.get` " +"method returns the value associated with the current context. Exiting a " +"context effectively reverts any changes made to context variables while the " +"context was entered (if needed, the values can be restored by re-entering " +"the context)." +msgstr "" + +#: ../../library/contextvars.rst:177 +msgid "Context implements the :class:`collections.abc.Mapping` interface." +msgstr "" + +#: ../../library/contextvars.rst:181 +msgid "" +"Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " +"Context. Returns *callable*'s return value, or propagates an exception if " +"one occurred." +msgstr "" + +#: ../../library/contextvars.rst:185 +#, fuzzy +msgid "Example:" +msgstr "舉例來說: ::" + +#: ../../library/contextvars.rst:187 +msgid "" +"import contextvars\n" +"\n" +"var = contextvars.ContextVar('var')\n" "var.set('spam')\n" +"print(var.get()) # 'spam'\n" +"\n" +"ctx = contextvars.copy_context()\n" "\n" "def main():\n" " # 'var' was set to 'spam' before\n" " # calling 'copy_context()' and 'ctx.run(main)', so:\n" -" # var.get() == ctx[var] == 'spam'\n" +" print(var.get()) # 'spam'\n" +" print(ctx[var]) # 'spam'\n" "\n" " var.set('ham')\n" "\n" " # Now, after setting 'var' to 'ham':\n" -" # var.get() == ctx[var] == 'ham'\n" -"\n" -"ctx = copy_context()\n" +" print(var.get()) # 'ham'\n" +" print(ctx[var]) # 'ham'\n" "\n" "# Any changes that the 'main' function makes to 'var'\n" "# will be contained in 'ctx'.\n" @@ -249,67 +295,61 @@ msgid "" "\n" "# The 'main()' function was run in the 'ctx' context,\n" "# so changes to 'var' are contained in it:\n" -"# ctx[var] == 'ham'\n" +"print(ctx[var]) # 'ham'\n" "\n" "# However, outside of 'ctx', 'var' is still set to 'spam':\n" -"# var.get() == 'spam'" -msgstr "" - -#: ../../library/contextvars.rst:189 -msgid "" -"The method raises a :exc:`RuntimeError` when called on the same context " -"object from more than one OS thread, or when called recursively." +"print(var.get()) # 'spam'" msgstr "" -#: ../../library/contextvars.rst:195 +#: ../../library/contextvars.rst:233 msgid "Return a shallow copy of the context object." msgstr "" -#: ../../library/contextvars.rst:199 +#: ../../library/contextvars.rst:237 msgid "" "Return ``True`` if the *context* has a value for *var* set; return ``False`` " "otherwise." msgstr "" -#: ../../library/contextvars.rst:204 +#: ../../library/contextvars.rst:242 msgid "" "Return the value of the *var* :class:`ContextVar` variable. If the variable " "is not set in the context object, a :exc:`KeyError` is raised." msgstr "" -#: ../../library/contextvars.rst:210 +#: ../../library/contextvars.rst:248 msgid "" "Return the value for *var* if *var* has the value in the context object. " "Return *default* otherwise. If *default* is not given, return ``None``." msgstr "" -#: ../../library/contextvars.rst:216 +#: ../../library/contextvars.rst:254 msgid "Return an iterator over the variables stored in the context object." msgstr "" -#: ../../library/contextvars.rst:221 +#: ../../library/contextvars.rst:259 msgid "Return the number of variables set in the context object." msgstr "" -#: ../../library/contextvars.rst:225 +#: ../../library/contextvars.rst:263 msgid "Return a list of all variables in the context object." msgstr "" -#: ../../library/contextvars.rst:229 +#: ../../library/contextvars.rst:267 msgid "Return a list of all variables' values in the context object." msgstr "" -#: ../../library/contextvars.rst:234 +#: ../../library/contextvars.rst:272 msgid "" "Return a list of 2-tuples containing all variables and their values in the " "context object." msgstr "" -#: ../../library/contextvars.rst:239 +#: ../../library/contextvars.rst:277 msgid "asyncio support" msgstr "" -#: ../../library/contextvars.rst:241 +#: ../../library/contextvars.rst:279 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " @@ -317,7 +357,7 @@ msgid "" "available in the Task that handles that client::" msgstr "" -#: ../../library/contextvars.rst:247 +#: ../../library/contextvars.rst:285 msgid "" "import asyncio\n" "import contextvars\n" diff --git a/library/crypt.po b/library/crypt.po index 4f37bcb814..68a9c63f16 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -18,260 +18,118 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/crypt.rst:2 -msgid ":mod:`crypt` --- Function to check Unix passwords" +#, fuzzy +msgid ":mod:`!crypt` --- Function to check Unix passwords" msgstr ":mod:`crypt` --- 用於檢查 Unix 密碼的函式" -#: ../../library/crypt.rst:13 -msgid "**Source code:** :source:`Lib/crypt.py`" -msgstr "**原始碼:**\\ :source:`Lib/crypt.py`" - -#: ../../library/crypt.rst:19 -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. The :pypi:`passlib` package can replace " -"all use cases of this module." -msgstr "" - -#: ../../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 " -"the Unix man page for further details. Possible uses include storing hashed " -"passwords so you can check passwords without storing the actual password, or " -"attempting to crack Unix passwords with a dictionary." -msgstr "" - -#: ../../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. " -"Therefore, any extensions available on the current implementation will also " -"be available on this module." -msgstr "" - -#: ../../library/crypt.rst:40 -msgid ":ref:`Availability `: Unix, not VxWorks." -msgstr ":ref:`適用 `:Unix,非 VxWorks。" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/crypt.rst:45 -msgid "Hashing Methods" -msgstr "雜湊方法" - -#: ../../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: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: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:64 -msgid "" -"Another Modular Crypt Format method with 22 character salt and 31 character " -"hash based on the Blowfish cipher." -msgstr "" - -#: ../../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:76 -msgid "" -"The traditional method with a 2 character salt and 13 characters of hash. " -"This is the weakest method." -msgstr "" - -#: ../../library/crypt.rst:81 -msgid "Module Attributes" -msgstr "模組屬性" - -#: ../../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:93 -msgid "Module Functions" -msgstr "模組函式" - -#: ../../library/crypt.rst:95 -msgid "The :mod:`crypt` module defines the following functions:" -msgstr ":mod:`crypt` 模組定義了以下函式:" - -#: ../../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 " -"from :func:`mksalt`, one of the ``crypt.METHOD_*`` values (though not all " -"may be available on all platforms), or a full encrypted password including " -"salt, as returned by this function. If *salt* is not provided, the " -"strongest method available in :attr:`methods` will be used." -msgstr "" - -#: ../../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: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 " -"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$``." -msgstr "" - -#: ../../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: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:125 -msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." -msgstr "" - -#: ../../library/crypt.rst:131 +#: ../../library/crypt.rst:10 msgid "" -"Return a randomly generated salt of the specified method. If no *method* is " -"given, the strongest method available in :attr:`methods` is used." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/crypt.rst:135 +#: ../../library/crypt.rst:14 msgid "" -"The return value is a string suitable for passing as the *salt* argument to :" -"func:`crypt`." +"Applications can use the :mod:`hashlib` module from the standard library. " +"Other possible replacements are third-party libraries from PyPI: :pypi:" +"`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`. " +"These are not supported or maintained by the Python core team." msgstr "" -#: ../../library/crypt.rst:138 -msgid "" -"*rounds* specifies the number of rounds for ``METHOD_SHA256``, " -"``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " -"``METHOD_SHA512`` it must be an integer between ``1000`` and " -"``999_999_999``, the default is ``5000``. For ``METHOD_BLOWFISH`` it must " -"be a power of two between ``16`` (2\\ :sup:`4`) and ``2_147_483_648`` (2\\ :" -"sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." -msgstr "" - -#: ../../library/crypt.rst:148 -msgid "Added the *rounds* parameter." -msgstr "新增 *rounds* 參數。" - -#: ../../library/crypt.rst:153 -msgid "Examples" -msgstr "範例" - -#: ../../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:159 -msgid "" -"import pwd\n" -"import crypt\n" -"import getpass\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"def login():\n" -" username = input('Python login: ')\n" -" cryptedpasswd = pwd.getpwnam(username)[1]\n" -" if cryptedpasswd:\n" -" if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" -" raise ValueError('no support for shadow passwords')\n" -" cleartext = getpass.getpass()\n" -" return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " -"cryptedpasswd)\n" -" else:\n" -" return True" -msgstr "" -"import pwd\n" -"import crypt\n" -"import getpass\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"def login():\n" -" username = input('Python login: ')\n" -" cryptedpasswd = pwd.getpwnam(username)[1]\n" -" if cryptedpasswd:\n" -" if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" -" raise ValueError('no support for shadow passwords')\n" -" cleartext = getpass.getpass()\n" -" return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " -"cryptedpasswd)\n" -" else:\n" -" return True" - -#: ../../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:178 +#: ../../library/crypt.rst:19 msgid "" -"import crypt\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"hashed = crypt.crypt(plaintext)\n" -"if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" -" raise ValueError(\"hashed version doesn't validate against original\")" -msgstr "" -"import crypt\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"hashed = crypt.crypt(plaintext)\n" -"if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" -" raise ValueError(\"hashed version doesn't validate against original\")" - -#: ../../library/crypt.rst:15 ../../library/crypt.rst:33 -#: ../../library/crypt.rst:119 -msgid "crypt(3)" -msgstr "crypt(3)" - -#: ../../library/crypt.rst:15 -msgid "cipher" -msgstr "cipher" - -#: ../../library/crypt.rst:15 -msgid "DES" -msgstr "DES" +"The last version of Python that provided the :mod:`!crypt` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/crypt.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/crypt.py`" + +#~ msgid ":ref:`Availability `: Unix, not VxWorks." +#~ msgstr ":ref:`適用 `:Unix,非 VxWorks。" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + +#~ msgid "Hashing Methods" +#~ msgstr "雜湊方法" + +#~ msgid "Module Attributes" +#~ msgstr "模組屬性" + +#~ msgid "Module Functions" +#~ msgstr "模組函式" + +#~ msgid "The :mod:`crypt` module defines the following functions:" +#~ msgstr ":mod:`crypt` 模組定義了以下函式:" + +#~ msgid "Added the *rounds* parameter." +#~ msgstr "新增 *rounds* 參數。" + +#~ msgid "Examples" +#~ msgstr "範例" + +#~ msgid "" +#~ "import pwd\n" +#~ "import crypt\n" +#~ "import getpass\n" +#~ "from hmac import compare_digest as compare_hash\n" +#~ "\n" +#~ "def login():\n" +#~ " username = input('Python login: ')\n" +#~ " cryptedpasswd = pwd.getpwnam(username)[1]\n" +#~ " if cryptedpasswd:\n" +#~ " if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" +#~ " raise ValueError('no support for shadow passwords')\n" +#~ " cleartext = getpass.getpass()\n" +#~ " return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " +#~ "cryptedpasswd)\n" +#~ " else:\n" +#~ " return True" +#~ msgstr "" +#~ "import pwd\n" +#~ "import crypt\n" +#~ "import getpass\n" +#~ "from hmac import compare_digest as compare_hash\n" +#~ "\n" +#~ "def login():\n" +#~ " username = input('Python login: ')\n" +#~ " cryptedpasswd = pwd.getpwnam(username)[1]\n" +#~ " if cryptedpasswd:\n" +#~ " if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" +#~ " raise ValueError('no support for shadow passwords')\n" +#~ " cleartext = getpass.getpass()\n" +#~ " return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " +#~ "cryptedpasswd)\n" +#~ " else:\n" +#~ " return True" + +#~ msgid "" +#~ "import crypt\n" +#~ "from hmac import compare_digest as compare_hash\n" +#~ "\n" +#~ "hashed = crypt.crypt(plaintext)\n" +#~ "if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" +#~ " raise ValueError(\"hashed version doesn't validate against original\")" +#~ msgstr "" +#~ "import crypt\n" +#~ "from hmac import compare_digest as compare_hash\n" +#~ "\n" +#~ "hashed = crypt.crypt(plaintext)\n" +#~ "if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" +#~ " raise ValueError(\"hashed version doesn't validate against original\")" + +#~ msgid "crypt(3)" +#~ msgstr "crypt(3)" + +#~ msgid "cipher" +#~ msgstr "cipher" + +#~ msgid "DES" +#~ msgstr "DES" diff --git a/library/ctypes.po b/library/ctypes.po index 2b037a09a0..dbadfd09fa 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -376,7 +376,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2203 +#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2213 msgid "Fundamental data types" msgstr "" @@ -809,7 +809,7 @@ msgstr "" #: ../../library/ctypes.rst:386 msgid "" -"On those platforms it is required to specify the :attr:`~_FuncPtr.argtypes` " +"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` " "attribute for the regular, non-variadic, function arguments:" msgstr "" @@ -820,7 +820,7 @@ msgstr "libc.printf.argtypes = [ctypes.c_char_p]" #: ../../library/ctypes.rst:393 msgid "" "Because specifying the attribute does not inhibit portability it is advised " -"to always specify :attr:`~_FuncPtr.argtypes` for all variadic functions." +"to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." msgstr "" #: ../../library/ctypes.rst:400 @@ -872,12 +872,12 @@ msgstr "" #: ../../library/ctypes.rst:428 msgid "" "It is possible to specify the required argument types of functions exported " -"from DLLs by setting the :attr:`~_FuncPtr.argtypes` attribute." +"from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." msgstr "" #: ../../library/ctypes.rst:431 msgid "" -":attr:`~_FuncPtr.argtypes` must be a sequence of C data types (the :func:`!" +":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!" "printf` function is probably not a good example here, because it takes a " "variable number and different types of parameters depending on the format " "string, on the other hand this is quite handy to experiment with this " @@ -931,7 +931,7 @@ msgstr "" msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`~_CData.from_param` class method for them to be " -"able to use them in the :attr:`~_FuncPtr.argtypes` sequence. The :meth:" +"able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:" "`~_CData.from_param` class method receives the Python object passed to the " "function call, it should do a typecheck or whatever is needed to make sure " "this object is acceptable, and then return the object itself, its :attr:`!" @@ -948,7 +948,7 @@ msgstr "" #: ../../library/ctypes.rst:478 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " -"return types can be specified by setting the :attr:`~_FuncPtr.restype` " +"return types can be specified by setting the :attr:`~_CFuncPtr.restype` " "attribute of the function object." msgstr "" @@ -964,7 +964,7 @@ msgid ">>> libc.time.restype = c_time_t" msgstr ">>> libc.time.restype = c_time_t" #: ../../library/ctypes.rst:488 -msgid "The argument types can be specified using :attr:`~_FuncPtr.argtypes`::" +msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" msgstr "" #: ../../library/ctypes.rst:490 @@ -1016,7 +1016,7 @@ msgstr "" #: ../../library/ctypes.rst:510 msgid "" "If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " -"the :attr:`~_FuncPtr.argtypes` attribute, and the second argument will be " +"the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be " "converted from a single character Python bytes object into a C char:" msgstr "" @@ -1053,11 +1053,11 @@ msgstr "" #: ../../library/ctypes.rst:529 msgid "" "You can also use a callable Python object (a function or a class for " -"example) as the :attr:`~_FuncPtr.restype` attribute, if the foreign function " -"returns an integer. The callable will be called with the *integer* the C " -"function returns, and the result of this call will be used as the result of " -"your function call. This is useful to check for error return values and " -"automatically raise an exception::" +"example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign " +"function returns an integer. The callable will be called with the *integer* " +"the C function returns, and the result of this call will be used as the " +"result of your function call. This is useful to check for error return " +"values and automatically raise an exception::" msgstr "" #: ../../library/ctypes.rst:535 @@ -1107,7 +1107,7 @@ msgstr "" #: ../../library/ctypes.rst:557 msgid "" "Please note that a much more powerful error checking mechanism is available " -"through the :attr:`~_FuncPtr.errcheck` attribute; see the reference manual " +"through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual " "for details." msgstr "" @@ -1665,7 +1665,7 @@ msgstr "" #: ../../library/ctypes.rst:861 msgid "" "Usually, ctypes does strict type checking. This means, if you have " -"``POINTER(c_int)`` in the :attr:`~_FuncPtr.argtypes` list of a function or " +"``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " "as the type of a member field in a structure definition, only instances of " "exactly the same type are accepted. There are some exceptions to this rule, " "where ctypes accepts other objects. For example, you can pass compatible " @@ -1706,7 +1706,7 @@ msgstr "" #: ../../library/ctypes.rst:882 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " -"type (such as ``POINTER(c_int)``) in :attr:`~_FuncPtr.argtypes`, an object " +"type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " "of the pointed type (``c_int`` in this case) can be passed to the function. " "ctypes will apply the required :func:`byref` conversion in this case " "automatically." @@ -2497,7 +2497,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:1977 +#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:1987 msgid "The exact functionality is system dependent." msgstr "" @@ -2875,32 +2875,48 @@ msgid "" "attributes of loaded shared libraries. The function objects created in this " "way by default accept any number of arguments, accept any ctypes data " "instances as arguments, and return the default result type specified by the " -"library loader. They are instances of a private class:" +"library loader." msgstr "" -#: ../../library/ctypes.rst:1617 +#: ../../library/ctypes.rst:1613 +msgid "" +"They are instances of a private local class :class:`!_FuncPtr` (not exposed " +"in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" +msgstr "" + +#: ../../library/ctypes.rst:1616 +msgid "" +">>> import ctypes\n" +">>> lib = ctypes.CDLL(None)\n" +">>> issubclass(lib._FuncPtr, ctypes._CFuncPtr)\n" +"True\n" +">>> lib._FuncPtr is ctypes._CFuncPtr\n" +"False" +msgstr "" + +#: ../../library/ctypes.rst:1627 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1619 +#: ../../library/ctypes.rst:1629 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1622 +#: ../../library/ctypes.rst:1632 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1627 +#: ../../library/ctypes.rst:1637 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1630 +#: ../../library/ctypes.rst:1640 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -2910,7 +2926,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1639 +#: ../../library/ctypes.rst:1649 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -2919,7 +2935,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1645 +#: ../../library/ctypes.rst:1655 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -2929,7 +2945,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1652 +#: ../../library/ctypes.rst:1662 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -2937,44 +2953,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1659 +#: ../../library/ctypes.rst:1669 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1666 +#: ../../library/ctypes.rst:1676 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1679 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1673 +#: ../../library/ctypes.rst:1683 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1677 +#: ../../library/ctypes.rst:1687 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1684 +#: ../../library/ctypes.rst:1694 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1688 ../../library/ctypes.rst:1690 +#: ../../library/ctypes.rst:1698 ../../library/ctypes.rst:1700 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -2983,18 +2999,18 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1696 ../../library/ctypes.rst:1698 +#: ../../library/ctypes.rst:1706 ../../library/ctypes.rst:1708 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1704 +#: ../../library/ctypes.rst:1714 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1706 +#: ../../library/ctypes.rst:1716 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -3005,7 +3021,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1717 +#: ../../library/ctypes.rst:1727 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -3014,37 +3030,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1737 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1745 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1738 +#: ../../library/ctypes.rst:1748 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1745 +#: ../../library/ctypes.rst:1755 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1752 +#: ../../library/ctypes.rst:1762 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1759 +#: ../../library/ctypes.rst:1769 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -3052,7 +3068,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1769 +#: ../../library/ctypes.rst:1779 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -3060,79 +3076,79 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1774 +#: ../../library/ctypes.rst:1784 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1778 +#: ../../library/ctypes.rst:1788 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1781 +#: ../../library/ctypes.rst:1791 msgid "" -"*paramflags* must be a tuple of the same length as :attr:`~_FuncPtr." +"*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" -#: ../../library/ctypes.rst:1783 +#: ../../library/ctypes.rst:1793 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1786 +#: ../../library/ctypes.rst:1796 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1789 +#: ../../library/ctypes.rst:1799 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1800 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1792 +#: ../../library/ctypes.rst:1802 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1803 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1795 +#: ../../library/ctypes.rst:1805 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1796 +#: ../../library/ctypes.rst:1806 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1798 +#: ../../library/ctypes.rst:1808 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1801 +#: ../../library/ctypes.rst:1811 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1804 +#: ../../library/ctypes.rst:1814 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1808 +#: ../../library/ctypes.rst:1818 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3148,11 +3164,11 @@ msgstr "" " LPCWSTR lpCaption,\n" " UINT uType);" -#: ../../library/ctypes.rst:1815 ../../library/ctypes.rst:1838 +#: ../../library/ctypes.rst:1825 ../../library/ctypes.rst:1848 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1817 +#: ../../library/ctypes.rst:1827 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3168,11 +3184,11 @@ msgstr "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -#: ../../library/ctypes.rst:1823 +#: ../../library/ctypes.rst:1833 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1825 +#: ../../library/ctypes.rst:1835 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" @@ -3182,7 +3198,7 @@ msgstr "" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" -#: ../../library/ctypes.rst:1829 +#: ../../library/ctypes.rst:1839 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3190,7 +3206,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1833 +#: ../../library/ctypes.rst:1843 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -3202,7 +3218,7 @@ msgstr "" " HWND hWnd,\n" " LPRECT lpRect);" -#: ../../library/ctypes.rst:1840 +#: ../../library/ctypes.rst:1850 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3220,7 +3236,7 @@ msgstr "" "paramflags)\n" ">>>" -#: ../../library/ctypes.rst:1847 +#: ../../library/ctypes.rst:1857 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3228,16 +3244,16 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1852 +#: ../../library/ctypes.rst:1862 msgid "" -"Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " +"Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " "``GetWindowRect`` api function returns a ``BOOL`` to signal success or " "failure, so this function could do the error checking, and raises an " "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1867 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3255,16 +3271,16 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1865 +#: ../../library/ctypes.rst:1875 msgid "" -"If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " +"If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " "the output parameters. If you want to return a tuple of window coordinates " "instead of a ``RECT`` instance, you can retrieve the fields in the function " "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1871 +#: ../../library/ctypes.rst:1881 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3284,17 +3300,17 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1894 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1888 +#: ../../library/ctypes.rst:1898 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1891 +#: ../../library/ctypes.rst:1901 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -3302,34 +3318,34 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1896 +#: ../../library/ctypes.rst:1906 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1902 +#: ../../library/ctypes.rst:1912 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1916 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1908 +#: ../../library/ctypes.rst:1918 msgid "(((char *)&obj) + offset)" msgstr "(((char *)&obj) + offset)" -#: ../../library/ctypes.rst:1910 +#: ../../library/ctypes.rst:1920 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1916 +#: ../../library/ctypes.rst:1926 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -3337,19 +3353,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1924 +#: ../../library/ctypes.rst:1934 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1927 +#: ../../library/ctypes.rst:1937 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1930 +#: ../../library/ctypes.rst:1940 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -3358,7 +3374,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1935 +#: ../../library/ctypes.rst:1945 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3366,19 +3382,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1940 +#: ../../library/ctypes.rst:1950 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1943 +#: ../../library/ctypes.rst:1953 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1946 +#: ../../library/ctypes.rst:1956 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -3387,7 +3403,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1952 +#: ../../library/ctypes.rst:1962 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3395,21 +3411,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1957 +#: ../../library/ctypes.rst:1967 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1964 +#: ../../library/ctypes.rst:1974 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1972 +#: ../../library/ctypes.rst:1982 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -3417,94 +3433,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1993 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1987 +#: ../../library/ctypes.rst:1997 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1994 +#: ../../library/ctypes.rst:2004 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:2001 +#: ../../library/ctypes.rst:2011 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2007 +#: ../../library/ctypes.rst:2017 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2010 +#: ../../library/ctypes.rst:2020 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2014 +#: ../../library/ctypes.rst:2024 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2027 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2021 +#: ../../library/ctypes.rst:2031 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2028 +#: ../../library/ctypes.rst:2038 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2035 +#: ../../library/ctypes.rst:2045 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2042 +#: ../../library/ctypes.rst:2052 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2045 +#: ../../library/ctypes.rst:2055 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2051 +#: ../../library/ctypes.rst:2061 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -3512,13 +3528,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2059 +#: ../../library/ctypes.rst:2069 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2062 +#: ../../library/ctypes.rst:2072 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -3526,14 +3542,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2077 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2071 +#: ../../library/ctypes.rst:2081 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -3541,19 +3557,19 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_last_error``。" -#: ../../library/ctypes.rst:2076 +#: ../../library/ctypes.rst:2086 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2082 +#: ../../library/ctypes.rst:2092 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2086 +#: ../../library/ctypes.rst:2096 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." @@ -3561,7 +3577,7 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "string_at``。" -#: ../../library/ctypes.rst:2091 +#: ../../library/ctypes.rst:2101 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of :exc:`OSError`. If *code* is not specified, " @@ -3570,20 +3586,20 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2097 +#: ../../library/ctypes.rst:2107 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:2114 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2109 +#: ../../library/ctypes.rst:2119 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." @@ -3591,11 +3607,11 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "wstring_at``。" -#: ../../library/ctypes.rst:2115 +#: ../../library/ctypes.rst:2125 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2120 +#: ../../library/ctypes.rst:2130 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -3605,13 +3621,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2127 +#: ../../library/ctypes.rst:2137 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2132 +#: ../../library/ctypes.rst:2142 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3620,7 +3636,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2138 ../../library/ctypes.rst:2148 +#: ../../library/ctypes.rst:2148 ../../library/ctypes.rst:2158 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3628,7 +3644,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2142 +#: ../../library/ctypes.rst:2152 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3636,45 +3652,45 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2162 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2155 ../../library/ctypes.rst:2157 +#: ../../library/ctypes.rst:2165 ../../library/ctypes.rst:2167 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2163 +#: ../../library/ctypes.rst:2173 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " -"foreign function's :attr:`~_FuncPtr.argtypes` tuple; it must return an " +"foreign function's :attr:`~_CFuncPtr.argtypes` tuple; it must return an " "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2178 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2174 +#: ../../library/ctypes.rst:2184 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2178 +#: ../../library/ctypes.rst:2188 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2182 +#: ../../library/ctypes.rst:2192 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -3682,13 +3698,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2199 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2194 +#: ../../library/ctypes.rst:2204 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -3696,7 +3712,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2207 +#: ../../library/ctypes.rst:2217 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -3705,11 +3721,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:2223 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2227 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -3717,7 +3733,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2222 +#: ../../library/ctypes.rst:2232 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -3725,17 +3741,17 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2228 +#: ../../library/ctypes.rst:2238 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " "transparently converted to native Python types. In other words, if a " -"foreign function has a :attr:`~_FuncPtr.restype` of :class:`c_char_p`, you " +"foreign function has a :attr:`~_CFuncPtr.restype` of :class:`c_char_p`, you " "will always receive a Python bytes object, *not* a :class:`c_char_p` " "instance." msgstr "" -#: ../../library/ctypes.rst:2236 +#: ../../library/ctypes.rst:2246 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -3743,25 +3759,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2241 +#: ../../library/ctypes.rst:2251 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2245 +#: ../../library/ctypes.rst:2255 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2252 +#: ../../library/ctypes.rst:2262 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2259 +#: ../../library/ctypes.rst:2269 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -3769,182 +3785,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2267 +#: ../../library/ctypes.rst:2277 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2273 +#: ../../library/ctypes.rst:2283 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2279 +#: ../../library/ctypes.rst:2289 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2285 +#: ../../library/ctypes.rst:2295 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2292 +#: ../../library/ctypes.rst:2302 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2298 +#: ../../library/ctypes.rst:2308 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2304 +#: ../../library/ctypes.rst:2314 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2310 +#: ../../library/ctypes.rst:2320 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2316 +#: ../../library/ctypes.rst:2326 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2322 +#: ../../library/ctypes.rst:2332 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2328 +#: ../../library/ctypes.rst:2338 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2334 +#: ../../library/ctypes.rst:2344 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2339 +#: ../../library/ctypes.rst:2349 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2346 +#: ../../library/ctypes.rst:2356 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2353 +#: ../../library/ctypes.rst:2363 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2360 +#: ../../library/ctypes.rst:2370 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2367 +#: ../../library/ctypes.rst:2377 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2373 +#: ../../library/ctypes.rst:2383 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2379 +#: ../../library/ctypes.rst:2389 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2385 +#: ../../library/ctypes.rst:2395 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2401 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2397 +#: ../../library/ctypes.rst:2407 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2403 +#: ../../library/ctypes.rst:2413 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2409 +#: ../../library/ctypes.rst:2419 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2415 +#: ../../library/ctypes.rst:2425 msgid "" "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 "" -#: ../../library/ctypes.rst:2422 +#: ../../library/ctypes.rst:2432 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2429 +#: ../../library/ctypes.rst:2439 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2436 +#: ../../library/ctypes.rst:2446 msgid "" "Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2442 +#: ../../library/ctypes.rst:2452 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2445 +#: ../../library/ctypes.rst:2455 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -3952,41 +3968,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2453 +#: ../../library/ctypes.rst:2463 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2458 +#: ../../library/ctypes.rst:2468 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2473 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2469 +#: ../../library/ctypes.rst:2479 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2475 +#: ../../library/ctypes.rst:2485 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2480 +#: ../../library/ctypes.rst:2490 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2482 +#: ../../library/ctypes.rst:2492 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2488 +#: ../../library/ctypes.rst:2498 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2500 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -3994,34 +4010,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2498 +#: ../../library/ctypes.rst:2508 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2502 +#: ../../library/ctypes.rst:2512 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2506 +#: ../../library/ctypes.rst:2516 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2509 +#: ../../library/ctypes.rst:2519 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2513 +#: ../../library/ctypes.rst:2523 msgid "" "class List(Structure):\n" " pass\n" @@ -4035,7 +4051,7 @@ msgstr "" " ...\n" " ]" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2529 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -4043,14 +4059,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2524 +#: ../../library/ctypes.rst:2534 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2531 +#: ../../library/ctypes.rst:2541 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -4058,21 +4074,21 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2539 +#: ../../library/ctypes.rst:2549 msgid "" "An optional small integer that allows overriding the alignment of the " "structure when being packed or unpacked to/from memory. Setting this " "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2547 +#: ../../library/ctypes.rst:2557 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2551 +#: ../../library/ctypes.rst:2561 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4080,11 +4096,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2556 +#: ../../library/ctypes.rst:2566 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2558 +#: ../../library/ctypes.rst:2568 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4106,7 +4122,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2569 +#: ../../library/ctypes.rst:2579 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4116,7 +4132,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2576 +#: ../../library/ctypes.rst:2586 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4128,7 +4144,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2581 +#: ../../library/ctypes.rst:2591 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4136,7 +4152,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2586 +#: ../../library/ctypes.rst:2596 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4146,15 +4162,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2597 +#: ../../library/ctypes.rst:2607 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2601 +#: ../../library/ctypes.rst:2611 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2603 +#: ../../library/ctypes.rst:2613 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4164,46 +4180,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2623 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2620 +#: ../../library/ctypes.rst:2630 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2623 +#: ../../library/ctypes.rst:2633 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2628 +#: ../../library/ctypes.rst:2638 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:2632 +#: ../../library/ctypes.rst:2642 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2648 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2640 +#: ../../library/ctypes.rst:2650 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2644 +#: ../../library/ctypes.rst:2654 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4212,11 +4228,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2654 +#: ../../library/ctypes.rst:2664 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2658 +#: ../../library/ctypes.rst:2668 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/dis.po b/library/dis.po index 811ad61b57..3ee0a161f6 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -1709,7 +1709,7 @@ msgstr "" #: ../../library/dis.rst:1553 msgid "" "Pushes a new function object on the stack built from the code object at " -"``STACK[1]``." +"``STACK[-1]``." msgstr "" #: ../../library/dis.rst:1555 diff --git a/library/distutils.po b/library/distutils.po new file mode 100644 index 0000000000..e4bdeb715f --- /dev/null +++ b/library/distutils.po @@ -0,0 +1,36 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/distutils.rst:2 +msgid ":mod:`!distutils` --- Building and installing Python modules" +msgstr "" + +#: ../../library/distutils.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being " +"deprecated in Python 3.10. The removal was decided in :pep:`632`, which has " +"`migration advice `_." +msgstr "" + +#: ../../library/distutils.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!distutils` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/enum.po b/library/enum.po index d67a0bd1b5..f316dee80c 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,7 +83,7 @@ msgid "" "... BLUE = 3\n" "\n" ">>> # functional syntax\n" -">>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])" +">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" msgstr "" #: ../../library/enum.rst:49 diff --git a/library/functions.po b/library/functions.po index 550f981d9e..1ea494ad91 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,8 +514,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:141 ../../library/functions.rst:932 -#: ../../library/functions.rst:1312 +#: ../../library/functions.rst:141 ../../library/functions.rst:942 +#: ../../library/functions.rst:1323 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -535,7 +535,7 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:156 ../../library/functions.rst:797 +#: ../../library/functions.rst:156 ../../library/functions.rst:807 msgid "The parameter is now positional-only." msgstr "現在為僅限位置參數。" @@ -933,8 +933,8 @@ msgid "" "number from real and imaginary parts." msgstr "" -#: ../../library/functions.rst:384 ../../library/functions.rst:742 -#: ../../library/functions.rst:988 +#: ../../library/functions.rst:384 ../../library/functions.rst:752 +#: ../../library/functions.rst:998 msgid "Examples:" msgstr "例如: ::" @@ -1023,8 +1023,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:447 ../../library/functions.rst:794 -#: ../../library/functions.rst:1037 +#: ../../library/functions.rst:447 ../../library/functions.rst:804 +#: ../../library/functions.rst:1047 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -1229,7 +1229,13 @@ msgstr "引發" msgid "Syntax errors are reported as exceptions." msgstr "" -#: ../../library/functions.rst:591 +#: ../../library/functions.rst:593 ../../library/functions.rst:654 +msgid "" +"This function executes arbitrary code. Calling it with user-supplied input " +"may lead to security vulnerabilities." +msgstr "" + +#: ../../library/functions.rst:596 #, fuzzy msgid "" "The *expression* argument is parsed and evaluated as a Python expression " @@ -1258,11 +1264,11 @@ msgstr "" "func:`eval` 被呼叫的環境中執行運算式。請注意,*eval()* 在封閉 (enclosing) 環" "境中無法存取\\ :term:`巢狀作用域 ` (non-locals)。" -#: ../../library/functions.rst:607 +#: ../../library/functions.rst:612 msgid "Example:" msgstr "範例:" -#: ../../library/functions.rst:613 +#: ../../library/functions.rst:618 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 " @@ -1273,7 +1279,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:618 +#: ../../library/functions.rst:623 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1284,13 +1290,13 @@ msgstr "" "函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :func:" "`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:623 +#: ../../library/functions.rst:628 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "如果給定來源是一個字串,那麼其前後的空格和定位字元會被移除。" -#: ../../library/functions.rst:626 +#: ../../library/functions.rst:631 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1298,8 +1304,8 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:629 ../../library/functions.rst:631 -#: ../../library/functions.rst:686 ../../library/functions.rst:688 +#: ../../library/functions.rst:634 ../../library/functions.rst:636 +#: ../../library/functions.rst:696 ../../library/functions.rst:698 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1307,17 +1313,17 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發程式碼編譯事件。" -#: ../../library/functions.rst:636 ../../library/functions.rst:708 +#: ../../library/functions.rst:641 ../../library/functions.rst:718 msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" -#: ../../library/functions.rst:640 ../../library/functions.rst:712 +#: ../../library/functions.rst:645 ../../library/functions.rst:722 msgid "" "The semantics of the default *locals* namespace have been adjusted as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:647 +#: ../../library/functions.rst:657 #, fuzzy msgid "" "This function supports dynamic execution of Python code. *source* must be " @@ -1338,7 +1344,7 @@ msgstr "" "`nonlocal`、:keyword:`yield` 和 :keyword:`return` 陳述式也不能在函式之外使" "用。該函式回傳值是 ``None``。" -#: ../../library/functions.rst:658 +#: ../../library/functions.rst:668 #, fuzzy msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " @@ -1355,7 +1361,7 @@ msgstr "" "供了 *locals* 引數,則它可以是任何映射物件。請記住在 module 層級中全域性和本" "地變數是相同的 dictionary。" -#: ../../library/functions.rst:668 +#: ../../library/functions.rst:678 msgid "" "When ``exec`` gets two separate objects as *globals* and *locals*, the code " "will be executed as if it were embedded in a class definition. This means " @@ -1364,7 +1370,7 @@ msgid "" "are treated as class variables in a class definition)." msgstr "" -#: ../../library/functions.rst:674 +#: ../../library/functions.rst:684 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:" @@ -1377,7 +1383,7 @@ msgstr "" "dictionary 傳入 :func:`exec` 之前,你可以透過將它插入 *globals* 來控制你需要" "哪些內建函式來執行程式碼。" -#: ../../library/functions.rst:680 +#: ../../library/functions.rst:690 #, fuzzy msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " @@ -1389,7 +1395,7 @@ msgstr "" "只有在 *object* 是一個含有自由變數 (free variable) 的程式碼物件時,它才有效。" "Tuple 的長度必須與程式碼物件所引用的自由變數數量完全匹配。" -#: ../../library/functions.rst:693 +#: ../../library/functions.rst:703 #, fuzzy msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " @@ -1399,7 +1405,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:699 +#: ../../library/functions.rst:709 #, fuzzy msgid "" "The default *locals* act as described for function :func:`locals` below. " @@ -1410,11 +1416,11 @@ msgstr "" "預設的 *locals* dictionary。如果你想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:703 +#: ../../library/functions.rst:713 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:718 +#: ../../library/functions.rst:728 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1426,7 +1432,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個識別性函式,即 *iterable* 中所有假值" "元素會被移除。" -#: ../../library/functions.rst:724 +#: ../../library/functions.rst:734 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1437,7 +1443,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:729 +#: ../../library/functions.rst:739 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1445,11 +1451,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:740 +#: ../../library/functions.rst:750 msgid "Return a floating-point number constructed from a number or a string." msgstr "回傳從數字或字串生成的浮點數。" -#: ../../library/functions.rst:744 +#: ../../library/functions.rst:754 msgid "" ">>> float('+1.23')\n" "1.23\n" @@ -1473,7 +1479,7 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../library/functions.rst:757 +#: ../../library/functions.rst:767 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 " @@ -1488,7 +1494,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 :token:`~float:floatvalue` 的生成規則:" -#: ../../library/functions.rst:778 +#: ../../library/functions.rst:788 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1496,7 +1502,7 @@ msgstr "" "字母大小寫不影響,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表" "示正無窮大。" -#: ../../library/functions.rst:781 +#: ../../library/functions.rst:791 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 " @@ -1506,7 +1512,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:786 +#: ../../library/functions.rst:796 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1515,22 +1521,22 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 會委派給 ``x.__float__()``。如果未" "定義 :meth:`~object.__float__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:790 +#: ../../library/functions.rst:800 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:792 +#: ../../library/functions.rst:802 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:800 +#: ../../library/functions.rst:810 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" "如果 :meth:`~object.__float__` 未定義,則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:810 +#: ../../library/functions.rst:820 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1541,7 +1547,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:815 +#: ../../library/functions.rst:825 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1549,7 +1555,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:818 +#: ../../library/functions.rst:828 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1563,7 +1569,7 @@ msgstr "" "實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," "或是 *format_spec* 或回傳值不是字串,則會引發 :exc:`TypeError`。" -#: ../../library/functions.rst:825 +#: ../../library/functions.rst:835 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1571,7 +1577,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:834 +#: ../../library/functions.rst:844 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1581,7 +1587,7 @@ msgstr "" "``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:838 +#: ../../library/functions.rst:848 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." @@ -1589,7 +1595,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:846 +#: ../../library/functions.rst:856 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 " @@ -1604,7 +1610,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:855 +#: ../../library/functions.rst:865 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1615,7 +1621,7 @@ msgstr "" "發生在編譯期,因此你必須手動改編私有屬性(有兩個前導底線的屬性)的名稱,才能" "使用 :func:`getattr` 來取得它。" -#: ../../library/functions.rst:863 +#: ../../library/functions.rst:873 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1624,7 +1630,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:870 +#: ../../library/functions.rst:880 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. " @@ -1635,7 +1641,7 @@ msgstr "" "則回傳 ``False``。(此功能是透過呼叫 ``getattr(object, name)`` 並檢查是否引" "發 :exc:`AttributeError` 來實作的。)" -#: ../../library/functions.rst:878 +#: ../../library/functions.rst:888 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 " @@ -1646,7 +1652,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:885 +#: ../../library/functions.rst:895 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1654,7 +1660,7 @@ msgstr "" "請注意,如果物件帶有自訂的 :meth:`~object.__hash__` 方法,:func:`hash` 將根據" "運行機器的位元長度來截斷回傳值。" -#: ../../library/functions.rst:892 +#: ../../library/functions.rst:902 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 " @@ -1668,7 +1674,7 @@ msgstr "" "關鍵字或說明文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任" "意物件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:899 +#: ../../library/functions.rst:909 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 " @@ -1679,12 +1685,12 @@ msgstr "" "前面的參數是僅限位置 (positional-only) 參數。有關更多資訊,請參閱\\ :ref:`常" "見問答集中的僅限位置參數條目 `。" -#: ../../library/functions.rst:904 +#: ../../library/functions.rst:914 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "此函式會被 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:906 +#: ../../library/functions.rst:916 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1692,7 +1698,7 @@ msgstr "" "對於 :mod:`pydoc` 和 :mod:`inspect` 的變更,使得可呼叫物件回報的的簽名 " "(signature) 更加全面和一致。" -#: ../../library/functions.rst:913 +#: ../../library/functions.rst:923 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 :" @@ -1702,7 +1708,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:922 +#: ../../library/functions.rst:932 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 " @@ -1711,20 +1717,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:934 +#: ../../library/functions.rst:944 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:939 +#: ../../library/functions.rst:949 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:945 +#: ../../library/functions.rst:955 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. " @@ -1734,18 +1740,18 @@ msgstr "" "回傳物件的 \"識別性\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:950 +#: ../../library/functions.rst:960 msgid "This is the address of the object in memory." msgstr "這是該物件在記憶體中的位址。" -#: ../../library/functions.rst:952 +#: ../../library/functions.rst:962 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:958 +#: ../../library/functions.rst:968 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, " @@ -1756,7 +1762,7 @@ msgstr "" "從輸入中讀取一行,將其轉換為字串(去除末尾的換行符)並回傳。當讀取到 EOF 時," "則引發 :exc:`EOFError`。例如: ::" -#: ../../library/functions.rst:963 +#: ../../library/functions.rst:973 msgid "" ">>> s = input('--> ') \n" "--> Monty Python's Flying Circus\n" @@ -1768,7 +1774,7 @@ msgstr "" ">>> s \n" "\"Monty Python's Flying Circus\"" -#: ../../library/functions.rst:968 +#: ../../library/functions.rst:978 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1776,7 +1782,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:971 ../../library/functions.rst:973 +#: ../../library/functions.rst:981 ../../library/functions.rst:983 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1784,7 +1790,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:976 ../../library/functions.rst:978 +#: ../../library/functions.rst:986 ../../library/functions.rst:988 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1792,13 +1798,13 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:985 +#: ../../library/functions.rst:995 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." msgstr "" -#: ../../library/functions.rst:990 +#: ../../library/functions.rst:1000 msgid "" ">>> int(123.45)\n" "123\n" @@ -1826,7 +1832,7 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -#: ../../library/functions.rst:1005 +#: ../../library/functions.rst:1015 msgid "" "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." "__int__()``. If the argument defines :meth:`~object.__index__`, it returns " @@ -1839,7 +1845,7 @@ msgstr "" "義了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數,則會向零" "的方向無條件捨去。" -#: ../../library/functions.rst:1011 +#: ../../library/functions.rst:1021 msgid "" "If the argument is not a number or if *base* is given, then it must be a " "string, :class:`bytes`, or :class:`bytearray` instance representing an " @@ -1852,7 +1858,7 @@ msgstr "" "以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、或在" "數字間有單一底線。" -#: ../../library/functions.rst:1017 +#: ../../library/functions.rst:1027 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 " @@ -1874,11 +1880,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:1028 +#: ../../library/functions.rst:1038 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱\\ :ref:`typesnumeric`。" -#: ../../library/functions.rst:1030 +#: ../../library/functions.rst:1040 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 " @@ -1890,22 +1896,22 @@ msgstr "" "的版本使用 :meth:`base.__int__ ` 而不是 :meth:`base." "__index__ `。" -#: ../../library/functions.rst:1040 +#: ../../library/functions.rst:1050 msgid "The first parameter is now positional-only." msgstr "第一個參數為僅限位置參數。" -#: ../../library/functions.rst:1043 +#: ../../library/functions.rst:1053 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" "如果未定義 :meth:`~object.__int__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:1046 +#: ../../library/functions.rst:1056 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "對 :meth:`~object.__trunc__` 的委派已棄用。" -#: ../../library/functions.rst:1049 +#: ../../library/functions.rst:1059 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 " @@ -1919,7 +1925,7 @@ msgstr "" "`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱\\ :ref:`整" "數字串轉換的長度限制 `\\ 說明文件。" -#: ../../library/functions.rst:1059 +#: ../../library/functions.rst:1069 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 " @@ -1959,7 +1965,7 @@ msgstr "" "是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:1091 +#: ../../library/functions.rst:1101 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1983,11 +1989,11 @@ msgstr "" "__next__` 時會不帶引數地呼叫 *object*;如果回傳的結果是 *sentinel* 則引發 :" "exc:`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:1105 +#: ../../library/functions.rst:1115 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1107 +#: ../../library/functions.rst:1117 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 " @@ -1996,7 +2002,7 @@ msgstr "" ":func:`iter` 的第二種形式有一個好用的應用,是能夠建立一個區塊閱讀器 (block-" "reader)。例如,從二進位資料庫檔案中讀取固定寬度的區塊,直到檔案的結尾: ::" -#: ../../library/functions.rst:1111 +#: ../../library/functions.rst:1121 msgid "" "from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" @@ -2008,7 +2014,7 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -#: ../../library/functions.rst:1119 +#: ../../library/functions.rst:1129 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 " @@ -2017,7 +2023,7 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1125 +#: ../../library/functions.rst:1135 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2025,7 +2031,7 @@ msgstr "" "如果物件長度大於 :data:`sys.maxsize`,像是 :class:`range(2 ** 100) `," "則 ``len`` 會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:1134 +#: ../../library/functions.rst:1144 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2033,33 +2039,33 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1140 +#: ../../library/functions.rst:1150 msgid "" "Return a mapping object representing the current local symbol table, with " "variable names as the keys, and their currently bound references as the " "values." msgstr "" -#: ../../library/functions.rst:1144 +#: ../../library/functions.rst:1154 msgid "" "At module scope, as well as when using :func:`exec` or :func:`eval` with a " "single namespace, this function returns the same namespace as :func:" "`globals`." msgstr "" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1158 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:1161 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -#: ../../library/functions.rst:1154 +#: ../../library/functions.rst:1164 msgid "" "In all of the above cases, each call to ``locals()`` in a given frame of " "execution will return the *same* mapping object. Changes made through the " @@ -2069,7 +2075,7 @@ msgid "" "returned mapping object." msgstr "" -#: ../../library/functions.rst:1161 +#: ../../library/functions.rst:1171 msgid "" "In an :term:`optimized scope` (including functions, generators, and " "coroutines), each call to ``locals()`` instead returns a fresh dictionary " @@ -2081,7 +2087,7 @@ msgid "" "previously returned dictionaries." msgstr "" -#: ../../library/functions.rst:1170 +#: ../../library/functions.rst:1180 msgid "" "Calling ``locals()`` as part of a comprehension in a function, generator, or " "coroutine is equivalent to calling it in the containing scope, except that " @@ -2090,19 +2096,19 @@ msgid "" "function." msgstr "" -#: ../../library/functions.rst:1176 +#: ../../library/functions.rst:1186 msgid "" "Calling ``locals()`` as part of a generator expression is equivalent to " "calling it in a nested generator function." msgstr "" -#: ../../library/functions.rst:1179 +#: ../../library/functions.rst:1189 msgid "" "The behaviour of ``locals()`` in a comprehension has been updated as " "described in :pep:`709`." msgstr "" -#: ../../library/functions.rst:1183 +#: ../../library/functions.rst:1193 msgid "" "As part of :pep:`667`, the semantics of mutating the mapping objects " "returned from this function are now defined. The behavior in :term:" @@ -2111,7 +2117,7 @@ msgid "" "versions." msgstr "" -#: ../../library/functions.rst:1193 +#: ../../library/functions.rst:1203 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2126,13 +2132,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經被編排為引數的 tuple," "請參閱 :func:`itertools.starmap`。" -#: ../../library/functions.rst:1205 +#: ../../library/functions.rst:1215 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個以上的引數中最大的。" -#: ../../library/functions.rst:1208 +#: ../../library/functions.rst:1218 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 " @@ -2141,7 +2147,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1213 ../../library/functions.rst:1251 +#: ../../library/functions.rst:1223 ../../library/functions.rst:1261 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 " @@ -2154,7 +2160,7 @@ msgstr "" "的物件。如果 iterable 為空,並且沒有提供 *default*,則會引發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:1219 +#: ../../library/functions.rst:1229 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2165,15 +2171,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1224 ../../library/functions.rst:1262 +#: ../../library/functions.rst:1234 ../../library/functions.rst:1272 msgid "Added the *default* keyword-only parameter." msgstr "新增 *default* 僅限關鍵字參數。" -#: ../../library/functions.rst:1227 ../../library/functions.rst:1265 +#: ../../library/functions.rst:1237 ../../library/functions.rst:1275 msgid "The *key* can be ``None``." msgstr "*key* 可以為 ``None``。" -#: ../../library/functions.rst:1235 +#: ../../library/functions.rst:1245 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2181,13 +2187,13 @@ msgstr "" "回傳由給定的引數所建立之「memory view(記憶體檢視)」物件。有關詳細資訊,請參" "閱\\ :ref:`typememoryview`。" -#: ../../library/functions.rst:1243 +#: ../../library/functions.rst:1253 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個以上的引數中最小的。" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1256 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 " @@ -2196,7 +2202,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1257 +#: ../../library/functions.rst:1267 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2207,7 +2213,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1272 +#: ../../library/functions.rst:1282 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 " @@ -2217,16 +2223,18 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1289 +#, fuzzy 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 " -"function does not accept any arguments." +"This is the ultimate base class of all other classes. It has methods that " +"are common to all instances of Python classes. When the constructor is " +"called, it returns a new featureless object. The constructor does not accept " +"any arguments." msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1285 +#: ../../library/functions.rst:1296 #, fuzzy msgid "" ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " @@ -2235,7 +2243,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1292 +#: ../../library/functions.rst:1303 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` " @@ -2246,7 +2254,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1302 +#: ../../library/functions.rst:1313 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." @@ -2254,7 +2262,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1319 +#: ../../library/functions.rst:1330 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 " @@ -2264,7 +2272,7 @@ msgstr "" "啟,則引發 :exc:`OSError`。關於使用此函式的更多方法,請參閱\\ :ref:`tut-" "files`。" -#: ../../library/functions.rst:1323 +#: ../../library/functions.rst:1334 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 " @@ -2277,7 +2285,7 @@ msgstr "" "器 (file descriptor)。(如果有給定檔案描述器,它會隨著回傳的 I/O 物件關閉而關" "閉,除非 *closefd* 被設為 ``False``。)" -#: ../../library/functions.rst:1329 +#: ../../library/functions.rst:1340 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. " @@ -2298,71 +2306,71 @@ msgstr "" "getencoding` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模" "式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1346 +#: ../../library/functions.rst:1357 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1346 +#: ../../library/functions.rst:1357 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1359 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1359 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1360 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1360 msgid "open for writing, truncating the file first" msgstr "寫入,會先清除檔案內容" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1361 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1361 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性建立,如果文件已存在則會失敗" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1362 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1362 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果檔案存在則在其末端附加內容" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1363 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1352 ../../library/functions.rst:1496 +#: ../../library/functions.rst:1363 ../../library/functions.rst:1507 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1364 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1364 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1354 +#: ../../library/functions.rst:1365 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1354 +#: ../../library/functions.rst:1365 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1368 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 " @@ -2372,7 +2380,7 @@ msgstr "" "``'w+b'`` 模式會開啟並清除檔案。``'r+'`` 和 ``'r+b'`` 模式會開啟且保留檔案內" "容。" -#: ../../library/functions.rst:1361 +#: ../../library/functions.rst:1372 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* " @@ -2388,7 +2396,7 @@ msgstr "" "``'t'``),檔案的內容會以 :class:`str` 回傳,其位元組已經先被解碼,使用的是取" "決於平台的編碼系統或是給定的 *encoding*。" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1382 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 " @@ -2397,7 +2405,7 @@ msgstr "" "Python 不會使用底層作業系統對於文字檔案的操作概念;所有的處理都是由 Python 獨" "自完成的,因此能獨立於不同平台。" -#: ../../library/functions.rst:1375 +#: ../../library/functions.rst:1386 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 " @@ -2418,7 +2426,7 @@ msgstr "" "``write_through`` 旗標。若未給定 *buffering* 引數,則預設的緩衝策略會運作如" "下:" -#: ../../library/functions.rst:1385 +#: ../../library/functions.rst:1396 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 " @@ -2430,7 +2438,7 @@ msgstr "" "DEFAULT_BUFFER_SIZE`。在許多系統上,緩衝區的長度通常為 4096 或 8192 個位元" "組。" -#: ../../library/functions.rst:1390 +#: ../../library/functions.rst:1401 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2439,7 +2447,7 @@ msgstr "" "「互動式」文字檔(:meth:`~io.IOBase.isatty` 回傳 ``True`` 的檔案)會使用列緩" "衝。其他文字檔則使用上述的二進制檔案緩衝策略。" -#: ../../library/functions.rst:1394 +#: ../../library/functions.rst:1405 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 " @@ -2452,7 +2460,7 @@ msgstr "" "Python 支援的任何 :term:`text encoding`\\ (文字編碼)都是可以使用的。關於支" "援的編碼系統清單,請參閱 :mod:`codecs` module。" -#: ../../library/functions.rst:1400 +#: ../../library/functions.rst:1411 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 " @@ -2465,7 +2473,7 @@ msgstr "" "handlers`\\ 有列出清單),不過任何已註冊到 :func:`codecs.register_error` 的錯" "誤處理程式名稱也都是有效的。標準的名稱包括:" -#: ../../library/functions.rst:1408 +#: ../../library/functions.rst:1419 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2473,20 +2481,20 @@ msgstr "" "``'strict'`` 如果發生編碼錯誤,則引發 :exc:`ValueError` 例外。預設值 " "``None`` 也有相同的效果。" -#: ../../library/functions.rst:1412 +#: ../../library/functions.rst:1423 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "``'ignore'`` 忽略錯誤。請注意,忽略編碼錯誤可能導致資料遺失。" -#: ../../library/functions.rst:1415 +#: ../../library/functions.rst:1426 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" "``'replace'`` 會在格式不正確的資料位置插入一個替換標誌(像是 ``'?'``)。" -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1429 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2499,7 +2507,7 @@ msgstr "" "被還原回 ``surrogateescape`` 錯誤處理程式當時所處理的那些相同位元組。這對於處" "理未知編碼方式的檔案會很好用。" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1436 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2508,7 +2516,7 @@ msgstr "" "``'xmlcharrefreplace'`` 僅在寫入檔案時可支援。編碼系統不支援的字元會被替換為" "適當的 XML 字元參考 (character reference) ``&#nnn;``。" -#: ../../library/functions.rst:1429 +#: ../../library/functions.rst:1440 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2516,7 +2524,7 @@ msgstr "" "``'backslashreplace'`` 會用 Python 的反斜線跳脫序列 (backslashed escape " "sequence) 替換格式不正確的資料。" -#: ../../library/functions.rst:1432 +#: ../../library/functions.rst:1443 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2524,7 +2532,7 @@ msgstr "" "``'namereplace'``\\ (也僅在寫入時支援)會將不支援的字元替換為 ``\\N{...}`` " "跳脫序列。" -#: ../../library/functions.rst:1440 +#: ../../library/functions.rst:1451 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2533,7 +2541,7 @@ msgstr "" "*newline* 會決定如何剖析資料串流 (stream) 中的換行字元。它可以是 ``None``、" "``''``、``'\\n'``、``'\\r'`` 或 ``'\\r\\n'``。它的運作規則如下:" -#: ../../library/functions.rst:1444 +#: ../../library/functions.rst:1455 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2549,7 +2557,7 @@ msgstr "" "傳給呼叫方時,行尾符號不會被轉換。如果它是任何其他有效的值,則輸入資料的行只" "會由給定的字串做結尾,且在回傳給呼叫方時,行尾符號不會被轉換。" -#: ../../library/functions.rst:1452 +#: ../../library/functions.rst:1463 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2562,7 +2570,7 @@ msgstr "" "``''`` 或 ``'\\n'``,則不做任何轉換。如果 *newline* 是任何其他有效的值,則寫" "入的任何 ``'\\n'`` 字元都將轉換為給定的字串。" -#: ../../library/functions.rst:1458 +#: ../../library/functions.rst:1469 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 " @@ -2573,7 +2581,7 @@ msgstr "" "則當檔案關閉時,底層的檔案描述器會保持開啟狀態。如果有給定一個檔名,則 " "*closefd* 必須是 ``True``\\ (預設值);否則將引發錯誤。" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1474 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 " @@ -2586,11 +2594,11 @@ msgstr "" "必須回傳一個開啟的檔案描述器(將 :mod:`os.open` 作為 *opener* 傳入,在功能上" "的結果會相當於傳入 ``None``)。" -#: ../../library/functions.rst:1469 +#: ../../library/functions.rst:1480 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1471 +#: ../../library/functions.rst:1482 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::" @@ -2598,7 +2606,7 @@ msgstr "" "下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," "從給定的目錄中用相對路徑開啟檔案: ::" -#: ../../library/functions.rst:1474 +#: ../../library/functions.rst:1485 msgid "" ">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" @@ -2611,7 +2619,7 @@ msgid "" ">>> os.close(dir_fd) # don't leak a file descriptor" msgstr "" -#: ../../library/functions.rst:1484 +#: ../../library/functions.rst:1495 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 " @@ -2635,7 +2643,7 @@ msgstr "" "BufferedRandom`。當緩衝被停用時,會回傳原始資料串流 :class:`io.FileIO`,它" "是 :class:`io.RawIOBase` 的一個 subclass。" -#: ../../library/functions.rst:1505 +#: ../../library/functions.rst:1516 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2645,7 +2653,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1509 +#: ../../library/functions.rst:1520 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2653,25 +2661,25 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1511 +#: ../../library/functions.rst:1522 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推論 (infer)。" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1527 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1517 +#: ../../library/functions.rst:1528 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1518 +#: ../../library/functions.rst:1529 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去引發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1519 +#: ../../library/functions.rst:1530 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2679,11 +2687,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1524 +#: ../../library/functions.rst:1535 msgid "The file is now non-inheritable." msgstr "檔案在此版本開始是不可繼承的。" -#: ../../library/functions.rst:1528 +#: ../../library/functions.rst:1539 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 :" @@ -2692,15 +2700,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有引發例外,此函式現在會重試系統呼叫,而" "不是引發 :exc:`InterruptedError` 例外(原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1542 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1546 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對於實作 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1536 +#: ../../library/functions.rst:1547 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2708,11 +2716,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1539 +#: ../../library/functions.rst:1550 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1544 +#: ../../library/functions.rst:1555 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2723,7 +2731,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1552 +#: ../../library/functions.rst:1563 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) % " @@ -2734,7 +2742,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1557 +#: ../../library/functions.rst:1568 #, fuzzy msgid "" "The arguments must have numeric types. With mixed operand types, the " @@ -2757,7 +2765,7 @@ msgstr "" "數,且指數 (exponent) 不是整數,則會得到一個複數的結果。例如,``pow(-9, " "0.5)`` 會回傳一個接近 ``3j`` 的值。" -#: ../../library/functions.rst:1569 +#: ../../library/functions.rst:1580 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 " @@ -2770,11 +2778,11 @@ msgstr "" "與 *mod* 互質。在這種情況下,會回傳 ``pow(inv_base, -exp, mod)``,其中 " "*inv_base* 是 *base* 對 *mod* 的模倒數 (inverse modulo)。" -#: ../../library/functions.rst:1575 +#: ../../library/functions.rst:1586 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "以下是一個計算 ``38`` 對 ``97`` 取模倒數的範例: ::" -#: ../../library/functions.rst:1577 +#: ../../library/functions.rst:1588 msgid "" ">>> pow(38, -1, mod=97)\n" "23\n" @@ -2786,7 +2794,7 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -#: ../../library/functions.rst:1582 +#: ../../library/functions.rst:1593 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2794,12 +2802,12 @@ msgstr "" "對於 :class:`int` 運算元,現在 ``pow`` 的三引數形式允許第二個引數為負數,也容" "許模倒數的計算。" -#: ../../library/functions.rst:1587 +#: ../../library/functions.rst:1598 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "允許關鍵字引數。在此之前只支援位置引數。" -#: ../../library/functions.rst:1594 +#: ../../library/functions.rst:1605 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 " @@ -2808,7 +2816,7 @@ msgstr "" "將 *objects* 列印到文字資料串流 *file*,用 *sep* 分隔並以 *end* 結尾。如果有" "給定 *sep*、*end*、*file* 和 *flush*,那麼它們必須是關鍵字引數的形式。" -#: ../../library/functions.rst:1598 +#: ../../library/functions.rst:1609 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* " @@ -2821,7 +2829,7 @@ msgstr "" "以是 ``None``,這表示使用預設值。如果沒有給定 *objects*,:func:`print` 就只會" "寫入 *end*。" -#: ../../library/functions.rst:1604 +#: ../../library/functions.rst:1615 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 " @@ -2833,7 +2841,7 @@ msgstr "" "串,所以 :func:`print` 不能用於二進位模式的檔案物件。對於此類物件,請改用 " "``file.write(...)``。" -#: ../../library/functions.rst:1609 +#: ../../library/functions.rst:1620 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2841,15 +2849,15 @@ msgstr "" "輸出緩衝通常會由 *file* 決定。但是如果 *flush* 為 true,則資料串流會被強制清" "除。" -#: ../../library/functions.rst:1613 +#: ../../library/functions.rst:1624 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1619 +#: ../../library/functions.rst:1630 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1621 +#: ../../library/functions.rst:1632 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 " @@ -2858,11 +2866,11 @@ msgstr "" "*fget* 是一個用於取得屬性值的函式,*fset* 是一個用於設定屬性值的函式,*fdel* " "是一個用於刪除屬性值的函式,而 *doc* 會為該屬性建立一個說明字串。" -#: ../../library/functions.rst:1625 +#: ../../library/functions.rst:1636 msgid "A typical use is to define a managed attribute ``x``::" msgstr "一個典型的用途是定義一個受管理的屬性 ``x``: ::" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1638 msgid "" "class C:\n" " def __init__(self):\n" @@ -2894,7 +2902,7 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../library/functions.rst:1642 +#: ../../library/functions.rst:1653 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." @@ -2902,7 +2910,7 @@ msgstr "" "如果 *c* 是 *C* 的一個實例,則 ``c.x`` 將會呼叫取得器 (getter),``c.x = " "value`` 會呼叫設定器 (setter),而 ``del c.x`` 會呼叫刪除器 (deleter)。" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1656 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 " @@ -2913,7 +2921,7 @@ msgstr "" "*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使用 :func:" "`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" -#: ../../library/functions.rst:1649 +#: ../../library/functions.rst:1660 msgid "" "class Parrot:\n" " def __init__(self):\n" @@ -2925,14 +2933,14 @@ msgid "" " return self._voltage" msgstr "" -#: ../../library/functions.rst:1658 +#: ../../library/functions.rst:1669 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:1666 +#: ../../library/functions.rst:1677 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2940,7 +2948,7 @@ msgid "" "with an example:" msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1682 msgid "" "class C:\n" " def __init__(self):\n" @@ -2976,36 +2984,36 @@ msgstr "" " def x(self):\n" " del self._x" -#: ../../library/functions.rst:1690 +#: ../../library/functions.rst:1701 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:1694 +#: ../../library/functions.rst:1705 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1697 +#: ../../library/functions.rst:1708 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1702 +#: ../../library/functions.rst:1713 msgid "" "Attribute holding the name of the property. The name of the property can be " "changed at runtime." msgstr "" -#: ../../library/functions.rst:1713 +#: ../../library/functions.rst:1724 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:1719 +#: ../../library/functions.rst:1730 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 " @@ -3018,11 +3026,11 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1730 +#: ../../library/functions.rst:1741 msgid "This class has a custom representation that can be evaluated::" msgstr "" -#: ../../library/functions.rst:1732 +#: ../../library/functions.rst:1743 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3040,7 +3048,7 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -#: ../../library/functions.rst:1743 +#: ../../library/functions.rst:1754 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -3048,14 +3056,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1751 +#: ../../library/functions.rst:1762 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:1755 +#: ../../library/functions.rst:1766 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 " @@ -3066,13 +3074,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1764 +#: ../../library/functions.rst:1775 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1769 +#: ../../library/functions.rst:1780 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 " @@ -3081,21 +3089,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1781 +#: ../../library/functions.rst:1792 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:1785 +#: ../../library/functions.rst:1796 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:1792 +#: ../../library/functions.rst:1803 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 " @@ -3104,7 +3112,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1798 +#: ../../library/functions.rst:1809 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:" @@ -3113,21 +3121,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1806 +#: ../../library/functions.rst:1817 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:1815 +#: ../../library/functions.rst:1826 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1834 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3135,48 +3143,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1828 +#: ../../library/functions.rst:1839 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" "`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" -#: ../../library/functions.rst:1833 +#: ../../library/functions.rst:1844 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1839 +#: ../../library/functions.rst:1850 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1841 +#: ../../library/functions.rst:1852 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1843 +#: ../../library/functions.rst:1854 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:1847 +#: ../../library/functions.rst:1858 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:1850 +#: ../../library/functions.rst:1861 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1853 +#: ../../library/functions.rst:1864 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 " @@ -3184,7 +3192,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1858 +#: ../../library/functions.rst:1869 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3196,22 +3204,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1878 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1871 +#: ../../library/functions.rst:1882 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1873 +#: ../../library/functions.rst:1884 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1876 +#: ../../library/functions.rst:1887 msgid "" "class C:\n" " @staticmethod\n" @@ -3221,7 +3229,7 @@ msgstr "" " @staticmethod\n" " def f(arg1, arg2, argN): ..." -#: ../../library/functions.rst:1880 +#: ../../library/functions.rst:1891 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3229,7 +3237,7 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1883 +#: ../../library/functions.rst:1894 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3237,14 +3245,14 @@ msgid "" "(such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1888 +#: ../../library/functions.rst:1899 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:1892 +#: ../../library/functions.rst:1903 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 " @@ -3253,7 +3261,7 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1898 +#: ../../library/functions.rst:1909 msgid "" "def regular_function():\n" " ...\n" @@ -3267,11 +3275,11 @@ msgstr "" "class C:\n" " method = staticmethod(regular_function)" -#: ../../library/functions.rst:1904 +#: ../../library/functions.rst:1915 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1906 +#: ../../library/functions.rst:1917 #, fuzzy msgid "" "Static methods now inherit the method attributes (:attr:`~function." @@ -3283,25 +3291,25 @@ msgstr "" "``__qualname__``、``__doc__`` 和 ``__annotations__``),並擁有一個新的 " "``__wrapped__`` 屬性。" -#: ../../library/functions.rst:1922 +#: ../../library/functions.rst:1933 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1924 +#: ../../library/functions.rst:1935 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1930 +#: ../../library/functions.rst:1941 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:1934 +#: ../../library/functions.rst:1945 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 ``''." @@ -3310,37 +3318,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1940 +#: ../../library/functions.rst:1951 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:1954 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -#: ../../library/functions.rst:1950 +#: ../../library/functions.rst:1961 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:1954 +#: ../../library/functions.rst:1965 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:1958 +#: ../../library/functions.rst:1969 msgid "" "For example, if :attr:`~type.__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:1962 +#: ../../library/functions.rst:1973 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" @@ -3348,7 +3356,7 @@ msgid "" "whenever the inheritance hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1967 +#: ../../library/functions.rst:1978 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. " @@ -3356,7 +3364,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1972 +#: ../../library/functions.rst:1983 msgid "" "When called directly within an ordinary method of a class, both arguments " "may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " @@ -3366,7 +3374,7 @@ msgid "" "including generator expressions, which implicitly create nested functions.)" msgstr "" -#: ../../library/functions.rst:1979 +#: ../../library/functions.rst:1990 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 " @@ -3374,7 +3382,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1984 +#: ../../library/functions.rst:1995 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 " @@ -3387,11 +3395,11 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1994 +#: ../../library/functions.rst:2005 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1996 +#: ../../library/functions.rst:2007 msgid "" "class C(B):\n" " def method(self, arg):\n" @@ -3399,14 +3407,14 @@ msgid "" " # super(C, self).method(arg)" msgstr "" -#: ../../library/functions.rst:2001 +#: ../../library/functions.rst:2012 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:2005 +#: ../../library/functions.rst:2016 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3416,7 +3424,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:2013 +#: ../../library/functions.rst:2024 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 " @@ -3426,33 +3434,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:2020 +#: ../../library/functions.rst:2031 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:2030 +#: ../../library/functions.rst:2041 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:2039 +#: ../../library/functions.rst:2050 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:2043 +#: ../../library/functions.rst:2054 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:2046 +#: ../../library/functions.rst:2057 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 " @@ -3465,22 +3473,22 @@ msgid "" "type` objects:" msgstr "" -#: ../../library/functions.rst:2061 +#: ../../library/functions.rst:2072 msgid "See also:" msgstr "" -#: ../../library/functions.rst:2063 +#: ../../library/functions.rst:2074 msgid "" ":ref:`Documentation on attributes and methods on classes `." msgstr "" -#: ../../library/functions.rst:2064 +#: ../../library/functions.rst:2075 #, fuzzy msgid ":ref:`bltin-type-objects`" msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:2066 +#: ../../library/functions.rst:2077 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3488,23 +3496,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:2071 +#: ../../library/functions.rst:2082 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:2073 +#: ../../library/functions.rst:2084 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:2080 +#: ../../library/functions.rst:2091 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`!__dict__` attribute." msgstr "" -#: ../../library/functions.rst:2083 +#: ../../library/functions.rst:2094 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -3512,34 +3520,34 @@ msgid "" "MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:2088 +#: ../../library/functions.rst:2099 msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "" -#: ../../library/functions.rst:2090 +#: ../../library/functions.rst:2101 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:2096 +#: ../../library/functions.rst:2107 msgid "" "The result of calling this function without an argument has been updated as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:2102 +#: ../../library/functions.rst:2113 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:2105 +#: ../../library/functions.rst:2116 msgid "Example::" msgstr "例如: ::" -#: ../../library/functions.rst:2107 +#: ../../library/functions.rst:2118 msgid "" ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" @@ -3555,27 +3563,27 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -#: ../../library/functions.rst:2114 +#: ../../library/functions.rst:2125 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:2117 +#: ../../library/functions.rst:2128 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:2121 +#: ../../library/functions.rst:2132 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:2125 +#: ../../library/functions.rst:2136 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 " @@ -3583,14 +3591,14 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:2130 +#: ../../library/functions.rst:2141 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:2134 +#: ../../library/functions.rst:2145 msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" @@ -3598,14 +3606,14 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -#: ../../library/functions.rst:2137 +#: ../../library/functions.rst:2148 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:2141 +#: ../../library/functions.rst:2152 msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" @@ -3613,37 +3621,37 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../library/functions.rst:2144 +#: ../../library/functions.rst:2155 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:2162 +#: ../../library/functions.rst:2173 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:2166 +#: ../../library/functions.rst:2177 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:2170 +#: ../../library/functions.rst:2181 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:2173 +#: ../../library/functions.rst:2184 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:2175 +#: ../../library/functions.rst:2186 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 " @@ -3652,13 +3660,13 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:2181 +#: ../../library/functions.rst:2192 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2184 +#: ../../library/functions.rst:2195 msgid "" ">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" @@ -3676,17 +3684,17 @@ msgstr "" ">>> x == list(x2) and y == list(y2)\n" "True" -#: ../../library/functions.rst:2192 +#: ../../library/functions.rst:2203 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2204 +#: ../../library/functions.rst:2215 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2207 +#: ../../library/functions.rst:2218 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3698,7 +3706,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2216 +#: ../../library/functions.rst:2227 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3708,7 +3716,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2223 +#: ../../library/functions.rst:2234 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3717,7 +3725,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2229 +#: ../../library/functions.rst:2240 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 " @@ -3725,37 +3733,37 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2234 +#: ../../library/functions.rst:2245 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2237 +#: ../../library/functions.rst:2248 msgid "spam = __import__('spam', globals(), locals(), [], 0)" msgstr "spam = __import__('spam', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2239 +#: ../../library/functions.rst:2250 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2241 +#: ../../library/functions.rst:2252 msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2243 +#: ../../library/functions.rst:2254 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:2246 +#: ../../library/functions.rst:2257 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2249 +#: ../../library/functions.rst:2260 msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" @@ -3765,36 +3773,36 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -#: ../../library/functions.rst:2253 +#: ../../library/functions.rst:2264 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:2257 +#: ../../library/functions.rst:2268 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2260 +#: ../../library/functions.rst:2271 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2264 +#: ../../library/functions.rst:2275 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:2269 +#: ../../library/functions.rst:2280 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2270 +#: ../../library/functions.rst:2281 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 " @@ -3807,107 +3815,107 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:154 ../../library/functions.rst:2037 +#: ../../library/functions.rst:154 ../../library/functions.rst:2048 msgid "type" msgstr "type(型別)" -#: ../../library/functions.rst:643 +#: ../../library/functions.rst:648 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/functions.rst:643 +#: ../../library/functions.rst:648 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:736 +#: ../../library/functions.rst:746 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:736 +#: ../../library/functions.rst:746 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:804 +#: ../../library/functions.rst:814 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:804 ../../library/functions.rst:1914 +#: ../../library/functions.rst:814 ../../library/functions.rst:1925 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:804 +#: ../../library/functions.rst:814 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1314 +#: ../../library/functions.rst:1325 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1314 ../../library/functions.rst:1435 +#: ../../library/functions.rst:1325 ../../library/functions.rst:1446 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1353 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1353 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1435 +#: ../../library/functions.rst:1446 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "line-buffered I/O" msgstr "line-buffered I/O(行緩衝 I/O)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1496 ../../library/functions.rst:2198 +#: ../../library/functions.rst:1507 ../../library/functions.rst:2209 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1496 +#: ../../library/functions.rst:1507 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1914 +#: ../../library/functions.rst:1925 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:2037 +#: ../../library/functions.rst:2048 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2198 +#: ../../library/functions.rst:2209 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2198 +#: ../../library/functions.rst:2209 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2198 +#: ../../library/functions.rst:2209 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/getopt.po b/library/getopt.po index f4467adec5..1e4506b15c 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2016-01-31 07:19+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -132,15 +132,44 @@ msgstr "" msgid "An example using only Unix style options:" msgstr "" -#: ../../library/getopt.rst:110 +#: ../../library/getopt.rst:100 +msgid "" +">>> import getopt\n" +">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" +">>> args\n" +"['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n" +">>> optlist, args = getopt.getopt(args, 'abc:d:')\n" +">>> optlist\n" +"[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n" +">>> args\n" +"['a1', 'a2']" +msgstr "" + +#: ../../library/getopt.rst:112 msgid "Using long option names is equally easy:" msgstr "" -#: ../../library/getopt.rst:123 -msgid "In a script, typical usage is something like this::" +#: ../../library/getopt.rst:114 +msgid "" +">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" +">>> args = s.split()\n" +">>> args\n" +"['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', " +"'a2']\n" +">>> optlist, args = getopt.getopt(args, 'x', [\n" +"... 'condition=', 'output-file=', 'testing'])\n" +">>> optlist\n" +"[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-" +"x', '')]\n" +">>> args\n" +"['a1', 'a2']" +msgstr "" + +#: ../../library/getopt.rst:127 +msgid "In a script, typical usage is something like this:" msgstr "" -#: ../../library/getopt.rst:125 +#: ../../library/getopt.rst:129 msgid "" "import getopt, sys\n" "\n" @@ -172,14 +201,14 @@ msgid "" " main()" msgstr "" -#: ../../library/getopt.rst:152 +#: ../../library/getopt.rst:158 msgid "" "Note that an equivalent command line interface could be produced with less " "code and more informative help and error messages by using the :mod:" -"`argparse` module::" +"`argparse` module:" msgstr "" -#: ../../library/getopt.rst:155 +#: ../../library/getopt.rst:161 msgid "" "import argparse\n" "\n" @@ -192,10 +221,10 @@ msgid "" " # ... do something with args.verbose .." msgstr "" -#: ../../library/getopt.rst:167 +#: ../../library/getopt.rst:175 msgid "Module :mod:`argparse`" msgstr ":mod:`argparse` 模組" -#: ../../library/getopt.rst:168 +#: ../../library/getopt.rst:176 msgid "Alternative command line option and argument parsing library." msgstr "" diff --git a/library/imghdr.po b/library/imghdr.po index f190c8b9c3..3cc521ab7b 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2022-05-22 02:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,190 +20,93 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/imghdr.rst:2 -msgid ":mod:`imghdr` --- Determine the type of an image" +#, fuzzy +msgid ":mod:`!imghdr` --- Determine the type of an image" msgstr ":mod:`imghdr` --- 推測圖片種類" -#: ../../library/imghdr.rst:8 -msgid "**Source code:** :source:`Lib/imghdr.py`" -msgstr "**原始碼:**\\ :source:`Lib/imghdr.py`" - #: ../../library/imghdr.rst:10 msgid "" -"The :mod:`imghdr` module is deprecated (see :pep:`PEP 594 <594#imghdr>` for " -"details and alternatives)." -msgstr "" -":mod:`imghdr` 模組 (module) 即將被棄用(詳情與替代方案見 :pep:`PEP 594 " -"<594#imghdr>`\\ )。" - -#: ../../library/imghdr.rst:16 -msgid "" -"The :mod:`imghdr` module determines the type of image contained in a file or " -"byte stream." -msgstr "" - -#: ../../library/imghdr.rst:19 -msgid "The :mod:`imghdr` module defines the following function:" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/imghdr.rst:24 +#: ../../library/imghdr.rst:14 msgid "" -"Test the image data contained in the file named *file* and return a string " -"describing the image type. If *h* is provided, the *file* argument is " -"ignored and *h* is assumed to contain the byte stream to test." -msgstr "" - -#: ../../library/imghdr.rst:28 -msgid "Accepts a :term:`path-like object`." +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not " +"supported or maintained by the Python core team." msgstr "" -#: ../../library/imghdr.rst:31 +#: ../../library/imghdr.rst:18 msgid "" -"The following image types are recognized, as listed below with the return " -"value from :func:`what`:" -msgstr "" - -#: ../../library/imghdr.rst:35 -msgid "Value" -msgstr "" - -#: ../../library/imghdr.rst:35 -msgid "Image format" -msgstr "" - -#: ../../library/imghdr.rst:37 -msgid "``'rgb'``" -msgstr "``'rgb'``" - -#: ../../library/imghdr.rst:37 -msgid "SGI ImgLib Files" -msgstr "" - -#: ../../library/imghdr.rst:39 -msgid "``'gif'``" -msgstr "``'gif'``" - -#: ../../library/imghdr.rst:39 -msgid "GIF 87a and 89a Files" -msgstr "" - -#: ../../library/imghdr.rst:41 -msgid "``'pbm'``" -msgstr "``'pbm'``" - -#: ../../library/imghdr.rst:41 -msgid "Portable Bitmap Files" -msgstr "" - -#: ../../library/imghdr.rst:43 -msgid "``'pgm'``" -msgstr "``'pgm'``" - -#: ../../library/imghdr.rst:43 -msgid "Portable Graymap Files" -msgstr "" - -#: ../../library/imghdr.rst:45 -msgid "``'ppm'``" -msgstr "``'ppm'``" - -#: ../../library/imghdr.rst:45 -msgid "Portable Pixmap Files" +"The last version of Python that provided the :mod:`!imghdr` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/imghdr.rst:47 -msgid "``'tiff'``" -msgstr "``'tiff'``" +#~ msgid "**Source code:** :source:`Lib/imghdr.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/imghdr.py`" -#: ../../library/imghdr.rst:47 -msgid "TIFF Files" -msgstr "TIFF 檔案" +#~ msgid "" +#~ "The :mod:`imghdr` module is deprecated (see :pep:`PEP 594 <594#imghdr>` " +#~ "for details and alternatives)." +#~ msgstr "" +#~ ":mod:`imghdr` 模組 (module) 即將被棄用(詳情與替代方案見 :pep:`PEP 594 " +#~ "<594#imghdr>`\\ )。" -#: ../../library/imghdr.rst:49 -msgid "``'rast'``" -msgstr "``'rast'``" +#~ msgid "``'rgb'``" +#~ msgstr "``'rgb'``" -#: ../../library/imghdr.rst:49 -msgid "Sun Raster Files" -msgstr "" +#~ msgid "``'gif'``" +#~ msgstr "``'gif'``" -#: ../../library/imghdr.rst:51 -msgid "``'xbm'``" -msgstr "``'xbm'``" - -#: ../../library/imghdr.rst:51 -msgid "X Bitmap Files" -msgstr "" +#~ msgid "``'pbm'``" +#~ msgstr "``'pbm'``" -#: ../../library/imghdr.rst:53 -msgid "``'jpeg'``" -msgstr "``'jpeg'``" +#~ msgid "``'pgm'``" +#~ msgstr "``'pgm'``" -#: ../../library/imghdr.rst:53 -msgid "JPEG data in JFIF or Exif formats" -msgstr "" +#~ msgid "``'ppm'``" +#~ msgstr "``'ppm'``" -#: ../../library/imghdr.rst:55 -msgid "``'bmp'``" -msgstr "``'bmp'``" +#~ msgid "``'tiff'``" +#~ msgstr "``'tiff'``" -#: ../../library/imghdr.rst:55 -msgid "BMP files" -msgstr "BMP 檔案" +#~ msgid "TIFF Files" +#~ msgstr "TIFF 檔案" -#: ../../library/imghdr.rst:57 -msgid "``'png'``" -msgstr "``'png'``" +#~ msgid "``'rast'``" +#~ msgstr "``'rast'``" -#: ../../library/imghdr.rst:57 -msgid "Portable Network Graphics" -msgstr "" +#~ msgid "``'xbm'``" +#~ msgstr "``'xbm'``" -#: ../../library/imghdr.rst:59 -msgid "``'webp'``" -msgstr "``'webp'``" +#~ msgid "``'jpeg'``" +#~ msgstr "``'jpeg'``" -#: ../../library/imghdr.rst:59 -msgid "WebP files" -msgstr "WebP 檔案" +#~ msgid "``'bmp'``" +#~ msgstr "``'bmp'``" -#: ../../library/imghdr.rst:61 -msgid "``'exr'``" -msgstr "``'exr'``" +#~ msgid "BMP files" +#~ msgstr "BMP 檔案" -#: ../../library/imghdr.rst:61 -msgid "OpenEXR Files" -msgstr "OpenEXR 檔案" +#~ msgid "``'png'``" +#~ msgstr "``'png'``" -#: ../../library/imghdr.rst:64 -msgid "The *exr* and *webp* formats were added." -msgstr "新增 *exr* 與 *webp* 格式。" +#~ msgid "``'webp'``" +#~ msgstr "``'webp'``" -#: ../../library/imghdr.rst:68 -msgid "" -"You can extend the list of file types :mod:`imghdr` can recognize by " -"appending to this variable:" -msgstr "" +#~ msgid "WebP files" +#~ msgstr "WebP 檔案" -#: ../../library/imghdr.rst:74 -msgid "" -"A list of functions performing the individual tests. Each function takes " -"two arguments: the byte-stream and an open file-like object. When :func:" -"`what` is called with a byte-stream, the file-like object will be ``None``." -msgstr "" +#~ msgid "``'exr'``" +#~ msgstr "``'exr'``" -#: ../../library/imghdr.rst:78 -msgid "" -"The test function should return a string describing the image type if the " -"test succeeded, or ``None`` if it failed." -msgstr "" +#~ msgid "OpenEXR Files" +#~ msgstr "OpenEXR 檔案" -#: ../../library/imghdr.rst:81 -msgid "Example::" -msgstr "範例: ::" +#~ msgid "The *exr* and *webp* formats were added." +#~ msgstr "新增 *exr* 與 *webp* 格式。" -#: ../../library/imghdr.rst:83 -msgid "" -">>> import imghdr\n" -">>> imghdr.what('bass.gif')\n" -"'gif'" -msgstr "" +#~ msgid "Example::" +#~ msgstr "範例: ::" diff --git a/library/imp.po b/library/imp.po new file mode 100644 index 0000000000..0d4399577a --- /dev/null +++ b/library/imp.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/imp.rst:2 +msgid ":mod:`!imp` --- Access the import internals" +msgstr "" + +#: ../../library/imp.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.4." +msgstr "" + +#: ../../library/imp.rst:14 +msgid "" +"The :ref:`removal notice ` includes guidance for " +"migrating code from :mod:`!imp` to :mod:`importlib`." +msgstr "" + +#: ../../library/imp.rst:17 +msgid "" +"The last version of Python that provided the :mod:`!imp` module was `Python " +"3.11 `_." +msgstr "" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 5a76e0ad8a..34903fb7ff 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -369,13 +369,10 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:231 -msgid "A concrete implementation of the" -msgstr "" - -#: ../../library/importlib.metadata.rst:232 msgid "" -"`PackageMetadata protocol `_." +"A concrete implementation of the `PackageMetadata protocol `_." msgstr "" #: ../../library/importlib.metadata.rst:234 diff --git a/library/mailcap.po b/library/mailcap.po index 6b778d0178..ac84dcbdff 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -19,130 +19,33 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/mailcap.rst:2 -msgid ":mod:`mailcap` --- Mailcap file handling" +#, fuzzy +msgid ":mod:`!mailcap` --- Mailcap file handling" msgstr ":mod:`mailcap` --- Mailcap 檔案處理" -#: ../../library/mailcap.rst:8 -msgid "**Source code:** :source:`Lib/mailcap.py`" -msgstr "**原始碼:**\\ :source:`Lib/mailcap.py`" - #: ../../library/mailcap.rst:10 msgid "" -"The :mod:`mailcap` module is deprecated (see :pep:`PEP 594 <594#mailcap>` " -"for details). The :mod:`mimetypes` module provides an alternative." -msgstr "" - -#: ../../library/mailcap.rst:17 -msgid "" -"Mailcap files are used to configure how MIME-aware applications such as mail " -"readers and web browsers react to files with different MIME types. (The name " -"\"mailcap\" is derived from the phrase \"mail capability\".) For example, a " -"mailcap file might contain a line like ``video/mpeg; xmpeg %s``. Then, if " -"the user encounters an email message or web document with the MIME type :" -"mimetype:`video/mpeg`, ``%s`` will be replaced by a filename (usually one " -"belonging to a temporary file) and the :program:`xmpeg` program can be " -"automatically started to view the file." -msgstr "" - -#: ../../library/mailcap.rst:26 -msgid "" -"The mailcap format is documented in :rfc:`1524`, \"A User Agent " -"Configuration Mechanism For Multimedia Mail Format Information\", but is not " -"an internet standard. However, mailcap files are supported on most Unix " -"systems." -msgstr "" - -#: ../../library/mailcap.rst:33 -msgid "" -"Return a 2-tuple; the first element is a string containing the command line " -"to be executed (which can be passed to :func:`os.system`), and the second " -"element is the mailcap entry for a given MIME type. If no matching MIME " -"type can be found, ``(None, None)`` is returned." -msgstr "" - -#: ../../library/mailcap.rst:38 -msgid "" -"*key* is the name of the field desired, which represents the type of " -"activity to be performed; the default value is 'view', since in the most " -"common case you simply want to view the body of the MIME-typed data. Other " -"possible values might be 'compose' and 'edit', if you wanted to create a new " -"body of the given MIME type or alter the existing body data. See :rfc:" -"`1524` for a complete list of these fields." -msgstr "" - -#: ../../library/mailcap.rst:45 -msgid "" -"*filename* is the filename to be substituted for ``%s`` in the command line; " -"the default value is ``'/dev/null'`` which is almost certainly not what you " -"want, so usually you'll override it by specifying a filename." -msgstr "" - -#: ../../library/mailcap.rst:49 -msgid "" -"*plist* can be a list containing named parameters; the default value is " -"simply an empty list. Each entry in the list must be a string containing " -"the parameter name, an equals sign (``'='``), and the parameter's value. " -"Mailcap entries can contain named parameters like ``%{foo}``, which will be " -"replaced by the value of the parameter named 'foo'. For example, if the " -"command line ``showpartial %{id} %{number} %{total}`` was in a mailcap file, " -"and *plist* was set to ``['id=1', 'number=2', 'total=3']``, the resulting " -"command line would be ``'showpartial 1 2 3'``." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/mailcap.rst:58 +#: ../../library/mailcap.rst:14 msgid "" -"In a mailcap file, the \"test\" field can optionally be specified to test " -"some external condition (such as the machine architecture, or the window " -"system in use) to determine whether or not the mailcap line applies. :func:" -"`findmatch` will automatically check such conditions and skip the entry if " -"the check fails." +"The last version of Python that provided the :mod:`!mailcap` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/mailcap.rst:65 -msgid "" -"To prevent security issues with shell metacharacters (symbols that have " -"special effects in a shell command line), ``findmatch`` will refuse to " -"inject ASCII characters other than alphanumerics and ``@+=:,./-_`` into the " -"returned command line." -msgstr "" +#~ msgid "**Source code:** :source:`Lib/mailcap.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/mailcap.py`" -#: ../../library/mailcap.rst:70 -msgid "" -"If a disallowed character appears in *filename*, ``findmatch`` will always " -"return ``(None, None)`` as if no entry was found. If such a character " -"appears elsewhere (a value in *plist* or in *MIMEtype*), ``findmatch`` will " -"ignore all mailcap entries which use that value. A :mod:`warning ` " -"will be raised in either case." -msgstr "" - -#: ../../library/mailcap.rst:78 -msgid "" -"Returns a dictionary mapping MIME types to a list of mailcap file entries. " -"This dictionary must be passed to the :func:`findmatch` function. An entry " -"is stored as a list of dictionaries, but it shouldn't be necessary to know " -"the details of this representation." -msgstr "" - -#: ../../library/mailcap.rst:83 -msgid "" -"The information is derived from all of the mailcap files found on the " -"system. Settings in the user's mailcap file :file:`$HOME/.mailcap` will " -"override settings in the system mailcap files :file:`/etc/mailcap`, :file:`/" -"usr/etc/mailcap`, and :file:`/usr/local/etc/mailcap`." -msgstr "" - -#: ../../library/mailcap.rst:88 -msgid "An example usage::" -msgstr "" - -#: ../../library/mailcap.rst:90 -msgid "" -">>> import mailcap\n" -">>> d = mailcap.getcaps()\n" -">>> mailcap.findmatch(d, 'video/mpeg', filename='tmp1223')\n" -"('xmpeg tmp1223', {'view': 'xmpeg %s'})" -msgstr "" -">>> import mailcap\n" -">>> d = mailcap.getcaps()\n" -">>> mailcap.findmatch(d, 'video/mpeg', filename='tmp1223')\n" -"('xmpeg tmp1223', {'view': 'xmpeg %s'})" +#~ msgid "" +#~ ">>> import mailcap\n" +#~ ">>> d = mailcap.getcaps()\n" +#~ ">>> mailcap.findmatch(d, 'video/mpeg', filename='tmp1223')\n" +#~ "('xmpeg tmp1223', {'view': 'xmpeg %s'})" +#~ msgstr "" +#~ ">>> import mailcap\n" +#~ ">>> d = mailcap.getcaps()\n" +#~ ">>> mailcap.findmatch(d, 'video/mpeg', filename='tmp1223')\n" +#~ "('xmpeg tmp1223', {'view': 'xmpeg %s'})" diff --git a/library/math.po b/library/math.po index b691fbe5dc..af930c8ef7 100644 --- a/library/math.po +++ b/library/math.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-04-26 15:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,32 +52,577 @@ msgid "" msgstr "此模組提供下列函式。除非特意註明,否則回傳值皆為浮點數。" #: ../../library/math.rst:30 -msgid "Number-theoretic and representation functions" +#, fuzzy +msgid "**Number-theoretic functions**" msgstr "數論與表現函式" +#: ../../library/math.rst:32 +msgid ":func:`comb(n, k) `" +msgstr "" + +#: ../../library/math.rst:32 +#, fuzzy +msgid "" +"Number of ways to choose *k* items from *n* items without repetition and " +"without order" +msgstr "回傳從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。" + +#: ../../library/math.rst:33 +msgid ":func:`factorial(n) `" +msgstr "" + +#: ../../library/math.rst:33 +msgid "*n* factorial" +msgstr "" + +#: ../../library/math.rst:34 +msgid ":func:`gcd(*integers) `" +msgstr "" + #: ../../library/math.rst:34 +msgid "Greatest common divisor of the integer arguments" +msgstr "" + +#: ../../library/math.rst:35 +msgid ":func:`isqrt(n) `" +msgstr "" + +#: ../../library/math.rst:35 +msgid "Integer square root of a nonnegative integer *n*" +msgstr "" + +#: ../../library/math.rst:36 +msgid ":func:`lcm(*integers) `" +msgstr "" + +#: ../../library/math.rst:36 +msgid "Least common multiple of the integer arguments" +msgstr "" + +#: ../../library/math.rst:37 +msgid ":func:`perm(n, k) `" +msgstr "" + +#: ../../library/math.rst:37 +#, fuzzy msgid "" -"Return the ceiling of *x*, the smallest integer greater than or equal to " -"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +"Number of ways to choose *k* items from *n* items without repetition and " +"with order" +msgstr "回傳從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。" + +#: ../../library/math.rst:39 +msgid "**Floating point arithmetic**" +msgstr "" + +#: ../../library/math.rst:41 +msgid ":func:`ceil(x) `" msgstr "" -"回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." -"Integral` 型別的值。" #: ../../library/math.rst:41 +msgid "Ceiling of *x*, the smallest integer greater than or equal to *x*" +msgstr "" + +#: ../../library/math.rst:42 +msgid ":func:`fabs(x) `" +msgstr "" + +#: ../../library/math.rst:42 +#, fuzzy +msgid "Absolute value of *x*" +msgstr "回傳 *x* 的絕對值。" + +#: ../../library/math.rst:43 +msgid ":func:`floor(x) `" +msgstr "" + +#: ../../library/math.rst:43 +msgid "Floor of *x*, the largest integer less than or equal to *x*" +msgstr "" + +#: ../../library/math.rst:44 +msgid ":func:`fma(x, y, z) `" +msgstr "" + +#: ../../library/math.rst:44 +msgid "Fused multiply-add operation: ``(x * y) + z``" +msgstr "" + +#: ../../library/math.rst:45 +msgid ":func:`fmod(x, y) `" +msgstr "" + +#: ../../library/math.rst:45 +msgid "Remainder of division ``x / y``" +msgstr "" + +#: ../../library/math.rst:46 +msgid ":func:`modf(x) `" +msgstr "" + +#: ../../library/math.rst:46 +msgid "Fractional and integer parts of *x*" +msgstr "" + +#: ../../library/math.rst:47 +msgid ":func:`remainder(x, y) `" +msgstr "" + +#: ../../library/math.rst:47 +msgid "Remainder of *x* with respect to *y*" +msgstr "" + +#: ../../library/math.rst:48 +msgid ":func:`trunc(x) `" +msgstr "" + +#: ../../library/math.rst:48 +msgid "Integer part of *x*" +msgstr "" + +#: ../../library/math.rst:50 +msgid "**Floating point manipulation functions**" +msgstr "" + +#: ../../library/math.rst:52 +msgid ":func:`copysign(x, y) `" +msgstr "" + +#: ../../library/math.rst:52 +msgid "Magnitude (absolute value) of *x* with the sign of *y*" +msgstr "" + +#: ../../library/math.rst:53 +msgid ":func:`frexp(x) `" +msgstr "" + +#: ../../library/math.rst:53 +msgid "Mantissa and exponent of *x*" +msgstr "" + +#: ../../library/math.rst:54 +msgid ":func:`isclose(a, b, rel_tol, abs_tol) `" +msgstr "" + +#: ../../library/math.rst:54 +#, fuzzy +msgid "Check if the values *a* and *b* are close to each other" +msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" + +#: ../../library/math.rst:55 +msgid ":func:`isfinite(x) `" +msgstr "" + +#: ../../library/math.rst:55 +msgid "Check if *x* is neither an infinity nor a NaN" +msgstr "" + +#: ../../library/math.rst:56 +msgid ":func:`isinf(x) `" +msgstr "" + +#: ../../library/math.rst:56 +#, fuzzy +msgid "Check if *x* is a positive or negative infinity" +msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" + +#: ../../library/math.rst:57 +msgid ":func:`isnan(x) `" +msgstr "" + +#: ../../library/math.rst:57 +msgid "Check if *x* is a NaN (not a number)" +msgstr "" + +#: ../../library/math.rst:58 +msgid ":func:`ldexp(x, i) `" +msgstr "" + +#: ../../library/math.rst:58 +#, fuzzy +msgid "``x * (2**i)``, inverse of function :func:`frexp`" +msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" + +#: ../../library/math.rst:59 +msgid ":func:`nextafter(x, y, steps) `" +msgstr "" + +#: ../../library/math.rst:59 +msgid "Floating-point value *steps* steps after *x* towards *y*" +msgstr "" + +#: ../../library/math.rst:60 +msgid ":func:`ulp(x) `" +msgstr "" + +#: ../../library/math.rst:60 +msgid "Value of the least significant bit of *x*" +msgstr "" + +#: ../../library/math.rst:62 +msgid "**Power, exponential and logarithmic functions**" +msgstr "" + +#: ../../library/math.rst:64 +msgid ":func:`cbrt(x) `" +msgstr "" + +#: ../../library/math.rst:64 +msgid "Cube root of *x*" +msgstr "" + +#: ../../library/math.rst:65 +msgid ":func:`exp(x) `" +msgstr "" + +#: ../../library/math.rst:65 +msgid "*e* raised to the power *x*" +msgstr "" + +#: ../../library/math.rst:66 +msgid ":func:`exp2(x) `" +msgstr "" + +#: ../../library/math.rst:66 +msgid "*2* raised to the power *x*" +msgstr "" + +#: ../../library/math.rst:67 +msgid ":func:`expm1(x) `" +msgstr "" + +#: ../../library/math.rst:67 +msgid "*e* raised to the power *x*, minus 1" +msgstr "" + +#: ../../library/math.rst:68 +msgid ":func:`log(x, base) `" +msgstr "" + +#: ../../library/math.rst:68 +msgid "Logarithm of *x* to the given base (*e* by default)" +msgstr "" + +#: ../../library/math.rst:69 +msgid ":func:`log1p(x) `" +msgstr "" + +#: ../../library/math.rst:69 +msgid "Natural logarithm of *1+x* (base *e*)" +msgstr "" + +#: ../../library/math.rst:70 +msgid ":func:`log2(x) `" +msgstr "" + +#: ../../library/math.rst:70 +msgid "Base-2 logarithm of *x*" +msgstr "" + +#: ../../library/math.rst:71 +msgid ":func:`log10(x) `" +msgstr "" + +#: ../../library/math.rst:71 +msgid "Base-10 logarithm of *x*" +msgstr "" + +#: ../../library/math.rst:72 +msgid ":func:`pow(x, y) `" +msgstr "" + +#: ../../library/math.rst:72 +msgid "*x* raised to the power *y*" +msgstr "" + +#: ../../library/math.rst:73 +msgid ":func:`sqrt(x) `" +msgstr "" + +#: ../../library/math.rst:73 +msgid "Square root of *x*" +msgstr "" + +#: ../../library/math.rst:75 +msgid "**Summation and product functions**" +msgstr "" + +#: ../../library/math.rst:77 +msgid ":func:`dist(p, q) `" +msgstr "" + +#: ../../library/math.rst:77 +msgid "" +"Euclidean distance between two points *p* and *q* given as an iterable of " +"coordinates" +msgstr "" + +#: ../../library/math.rst:78 +msgid ":func:`fsum(iterable) `" +msgstr "" + +#: ../../library/math.rst:78 +msgid "Sum of values in the input *iterable*" +msgstr "" + +#: ../../library/math.rst:79 +msgid ":func:`hypot(*coordinates) `" +msgstr "" + +#: ../../library/math.rst:79 +msgid "Euclidean norm of an iterable of coordinates" +msgstr "" + +#: ../../library/math.rst:80 +msgid ":func:`prod(iterable, start) `" +msgstr "" + +#: ../../library/math.rst:80 +msgid "Product of elements in the input *iterable* with a *start* value" +msgstr "" + +#: ../../library/math.rst:81 +msgid ":func:`sumprod(p, q) `" +msgstr "" + +#: ../../library/math.rst:81 +msgid "Sum of products from two iterables *p* and *q*" +msgstr "" + +#: ../../library/math.rst:83 +msgid "**Angular conversion**" +msgstr "" + +#: ../../library/math.rst:85 +msgid ":func:`degrees(x) `" +msgstr "" + +#: ../../library/math.rst:85 +msgid "Convert angle *x* from radians to degrees" +msgstr "" + +#: ../../library/math.rst:86 +msgid ":func:`radians(x) `" +msgstr "" + +#: ../../library/math.rst:86 +msgid "Convert angle *x* from degrees to radians" +msgstr "" + +#: ../../library/math.rst:88 +msgid "**Trigonometric functions**" +msgstr "" + +#: ../../library/math.rst:90 +msgid ":func:`acos(x) `" +msgstr "" + +#: ../../library/math.rst:90 +msgid "Arc cosine of *x*" +msgstr "" + +#: ../../library/math.rst:91 +msgid ":func:`asin(x) `" +msgstr "" + +#: ../../library/math.rst:91 +msgid "Arc sine of *x*" +msgstr "" + +#: ../../library/math.rst:92 +msgid ":func:`atan(x) `" +msgstr "" + +#: ../../library/math.rst:92 +msgid "Arc tangent of *x*" +msgstr "" + +#: ../../library/math.rst:93 +msgid ":func:`atan2(y, x) `" +msgstr "" + +#: ../../library/math.rst:93 +msgid "``atan(y / x)``" +msgstr "" + +#: ../../library/math.rst:94 +msgid ":func:`cos(x) `" +msgstr "" + +#: ../../library/math.rst:94 +msgid "Cosine of *x*" +msgstr "" + +#: ../../library/math.rst:95 +msgid ":func:`sin(x) `" +msgstr "" + +#: ../../library/math.rst:95 +msgid "Sine of *x*" +msgstr "" + +#: ../../library/math.rst:96 +msgid ":func:`tan(x) `" +msgstr "" + +#: ../../library/math.rst:96 +msgid "Tangent of *x*" +msgstr "" + +#: ../../library/math.rst:98 +msgid "**Hyperbolic functions**" +msgstr "" + +#: ../../library/math.rst:100 +msgid ":func:`acosh(x) `" +msgstr "" + +#: ../../library/math.rst:100 +msgid "Inverse hyperbolic cosine of *x*" +msgstr "" + +#: ../../library/math.rst:101 +msgid ":func:`asinh(x) `" +msgstr "" + +#: ../../library/math.rst:101 +msgid "Inverse hyperbolic sine of *x*" +msgstr "" + +#: ../../library/math.rst:102 +msgid ":func:`atanh(x) `" +msgstr "" + +#: ../../library/math.rst:102 +msgid "Inverse hyperbolic tangent of *x*" +msgstr "" + +#: ../../library/math.rst:103 +msgid ":func:`cosh(x) `" +msgstr "" + +#: ../../library/math.rst:103 +msgid "Hyperbolic cosine of *x*" +msgstr "" + +#: ../../library/math.rst:104 +msgid ":func:`sinh(x) `" +msgstr "" + +#: ../../library/math.rst:104 +msgid "Hyperbolic sine of *x*" +msgstr "" + +#: ../../library/math.rst:105 +msgid ":func:`tanh(x) `" +msgstr "" + +#: ../../library/math.rst:105 +msgid "Hyperbolic tangent of *x*" +msgstr "" + +#: ../../library/math.rst:107 +msgid "**Special functions**" +msgstr "" + +#: ../../library/math.rst:109 +msgid ":func:`erf(x) `" +msgstr "" + +#: ../../library/math.rst:109 +msgid "`Error function `_ at *x*" +msgstr "" + +#: ../../library/math.rst:110 +msgid ":func:`erfc(x) `" +msgstr "" + +#: ../../library/math.rst:110 +msgid "" +"`Complementary error function `_ at *x*" +msgstr "" + +#: ../../library/math.rst:111 +msgid ":func:`gamma(x) `" +msgstr "" + +#: ../../library/math.rst:111 +msgid "`Gamma function `_ at *x*" +msgstr "" + +#: ../../library/math.rst:112 +msgid ":func:`lgamma(x) `" +msgstr "" + +#: ../../library/math.rst:112 +msgid "" +"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" +msgstr "" + +#: ../../library/math.rst:114 +#, fuzzy +msgid "**Constants**" +msgstr "常數" + +#: ../../library/math.rst:116 +msgid ":data:`pi`" +msgstr "" + +#: ../../library/math.rst:116 +msgid "*π* = 3.141592..." +msgstr "" + +#: ../../library/math.rst:117 +msgid ":data:`e`" +msgstr "" + +#: ../../library/math.rst:117 +msgid "*e* = 2.718281..." +msgstr "" + +#: ../../library/math.rst:118 +msgid ":data:`tau`" +msgstr "" + +#: ../../library/math.rst:118 +msgid "*τ* = 2\\ *π* = 6.283185..." +msgstr "" + +#: ../../library/math.rst:119 +msgid ":data:`inf`" +msgstr "" + +#: ../../library/math.rst:119 +msgid "Positive infinity" +msgstr "" + +#: ../../library/math.rst:120 +msgid ":data:`nan`" +msgstr "" + +#: ../../library/math.rst:120 +msgid "\"Not a number\" (NaN)" +msgstr "" + +#: ../../library/math.rst:125 +#, fuzzy +msgid "Number-theoretic functions" +msgstr "數論與表現函式" + +#: ../../library/math.rst:129 msgid "" "Return the number of ways to choose *k* items from *n* items without " "repetition and without order." msgstr "回傳從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。" -#: ../../library/math.rst:44 +#: ../../library/math.rst:132 msgid "" "Evaluates to ``n! / (k! * (n - k)!)`` when ``k <= n`` and evaluates to zero " "when ``k > n``." msgstr "當 ``k <= n`` 時其值為 ``n! / (k! * (n - k)!)``,否則其值為 ``0``。" -#: ../../library/math.rst:47 +#: ../../library/math.rst:135 msgid "" "Also called the binomial coefficient because it is equivalent to the " "coefficient of k-th term in polynomial expansion of ``(1 + x)ⁿ``." @@ -85,7 +630,7 @@ msgstr "" "因為此值等同於 ``(1 + x)ⁿ`` 進行多項式展開後第 k 項的係數,所以又稱為二項式係" "數。" -#: ../../library/math.rst:51 ../../library/math.rst:274 +#: ../../library/math.rst:139 ../../library/math.rst:205 msgid "" "Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" "exc:`ValueError` if either of the arguments are negative." @@ -93,32 +638,105 @@ msgstr "" "當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引發 :exc:" "`ValueError`。" -#: ../../library/math.rst:59 -msgid "" -"Return a float with the magnitude (absolute value) of *x* but the sign of " -"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " -"returns *-1.0*." -msgstr "" -"回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," -"``copysign(1.0, -0.0)`` 回傳 *-1.0*。" - -#: ../../library/math.rst:66 -msgid "Return the absolute value of *x*." -msgstr "回傳 *x* 的絕對值。" - -#: ../../library/math.rst:71 +#: ../../library/math.rst:147 msgid "" "Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not " "integral or is negative." msgstr "" "以整數回傳 *n* 的階乘。若 *n* 非整數型別或其值為負會引發 :exc:`ValueError`。" -#: ../../library/math.rst:74 +#: ../../library/math.rst:150 #, fuzzy msgid "Floats with integral values (like ``5.0``) are no longer accepted." msgstr "允許傳入其值為整數的浮點數(如:``5.0``)已被棄用。" -#: ../../library/math.rst:80 +#: ../../library/math.rst:156 +msgid "" +"Return the greatest common divisor of the specified integer arguments. If " +"any of the arguments is nonzero, then the returned value is the largest " +"positive integer that is a divisor of all arguments. If all arguments are " +"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " +"``0``." +msgstr "" +"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中" +"最大的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數" +"也將回傳 ``0``。" + +#: ../../library/math.rst:164 +msgid "" +"Added support for an arbitrary number of arguments. Formerly, only two " +"arguments were supported." +msgstr "新增支援任意數量的引數。先前僅支援兩個引數。" + +#: ../../library/math.rst:171 +msgid "" +"Return the integer square root of the nonnegative integer *n*. This is the " +"floor of the exact square root of *n*, or equivalently the greatest integer " +"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." +msgstr "" +"回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" +"足 *a*\\ ² |nbsp| ≤ |nbsp| *n* 的最大整數值 *a*。" + +#: ../../library/math.rst:175 +msgid "" +"For some applications, it may be more convenient to have the least integer " +"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " +"the exact square root of *n*. For positive *n*, this can be computed using " +"``a = 1 + isqrt(n - 1)``." +msgstr "" +"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或" +"者說 *n* 精確平方根經上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = " +"1 + isqrt(n - 1)`` 計算。" + +#: ../../library/math.rst:185 +msgid "" +"Return the least common multiple of the specified integer arguments. If all " +"arguments are nonzero, then the returned value is the smallest positive " +"integer that is a multiple of all arguments. If any of the arguments is " +"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " +"``1``." +msgstr "" +"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中" +"最小的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何" +"引數將回傳 ``1``。" + +#: ../../library/math.rst:196 +msgid "" +"Return the number of ways to choose *k* items from *n* items without " +"repetition and with order." +msgstr "" + +#: ../../library/math.rst:199 +msgid "" +"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " +"``k > n``." +msgstr "" + +#: ../../library/math.rst:202 +msgid "" +"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " +"function returns ``n!``." +msgstr "" + +#: ../../library/math.rst:212 +msgid "Floating point arithmetic" +msgstr "" + +#: ../../library/math.rst:216 +msgid "" +"Return the ceiling of *x*, the smallest integer greater than or equal to " +"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +msgstr "" +"回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" +"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." +"Integral` 型別的值。" + +#: ../../library/math.rst:223 +msgid "Return the absolute value of *x*." +msgstr "回傳 *x* 的絕對值。" + +#: ../../library/math.rst:228 msgid "" "Return the floor of *x*, the largest integer less than or equal to *x*. If " "*x* is not a float, delegates to :meth:`x.__floor__ `, " @@ -128,7 +746,7 @@ msgstr "" "將委派給 :meth:`x.__floor__ `,並回傳 :class:`~numbers." "Integral` 型別的值。" -#: ../../library/math.rst:87 +#: ../../library/math.rst:235 msgid "" "Fused multiply-add operation. Return ``(x * y) + z``, computed as though " "with infinite precision and range followed by a single round to the " @@ -136,7 +754,7 @@ msgid "" "direct expression ``(x * y) + z``." msgstr "" -#: ../../library/math.rst:92 +#: ../../library/math.rst:240 msgid "" "This function follows the specification of the fusedMultiplyAdd operation " "described in the IEEE 754 standard. The standard leaves one case " @@ -145,7 +763,7 @@ msgid "" "not raise any exception." msgstr "" -#: ../../library/math.rst:103 +#: ../../library/math.rst:251 msgid "" "Return ``fmod(x, y)``, as defined by the platform C library. Note that the " "Python expression ``x % y`` may not return the same result. The intent of " @@ -169,107 +787,133 @@ msgstr "" "示成浮點數,並會四捨五入為出乎意料的 ``1e100``。因此,處理浮點數時通常會選擇" "函式 :func:`fmod`,而處理整數時會選擇 Python 運算式 ``x % y``。" -#: ../../library/math.rst:118 +#: ../../library/math.rst:266 msgid "" -"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " -"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " -"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " -"to \"pick apart\" the internal representation of a float in a portable way." +"Return the fractional and integer parts of *x*. Both results carry the sign " +"of *x* and are floats." msgstr "" -"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" -"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " -"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" -#: ../../library/math.rst:126 +#: ../../library/math.rst:269 msgid "" -"Return an accurate floating-point sum of values in the iterable. Avoids " -"loss of precision by tracking multiple intermediate partial sums." +"Note that :func:`modf` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." msgstr "" -"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" -"(partial sum)以避免精確度損失。" -#: ../../library/math.rst:129 +#: ../../library/math.rst:277 msgid "" -"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " -"typical case where the rounding mode is half-even. On some non-Windows " -"builds, the underlying C library uses extended precision addition and may " -"occasionally double-round an intermediate sum causing it to be off in its " -"least significant bit." +"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " +"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " +"is the closest integer to the exact value of the quotient ``x / y``. If " +"``x / y`` is exactly halfway between two consecutive integers, the nearest " +"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " +"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" -"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" -"程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:135 +#: ../../library/math.rst:284 msgid "" -"For further discussion and two alternative approaches, see the `ASPN " -"cookbook recipes for accurate floating-point summation `_\\." +"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " +"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " +"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " +"remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -"更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " -"`_。" -#: ../../library/math.rst:142 +#: ../../library/math.rst:290 msgid "" -"Return the greatest common divisor of the specified integer arguments. If " -"any of the arguments is nonzero, then the returned value is the largest " -"positive integer that is a divisor of all arguments. If all arguments are " -"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " -"``0``." +"On platforms using IEEE 754 binary floating point, the result of this " +"operation is always exactly representable: no rounding error is introduced." msgstr "" -"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中" -"最大的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數" -"也將回傳 ``0``。" -#: ../../library/math.rst:150 +#: ../../library/math.rst:298 msgid "" -"Added support for an arbitrary number of arguments. Formerly, only two " -"arguments were supported." -msgstr "新增支援任意數量的引數。先前僅支援兩個引數。" +"Return *x* with the fractional part removed, leaving the integer part. This " +"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " +"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " +"delegates to :meth:`x.__trunc__ `, which should return an :" +"class:`~numbers.Integral` value." +msgstr "" + +#: ../../library/math.rst:305 +msgid "" +"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " +"*all* floating-point numbers of sufficiently large magnitude are exact " +"integers. Python floats typically carry no more than 53 bits of precision " +"(the same as the platform C double type), in which case any float *x* with " +"``abs(x) >= 2**52`` necessarily has no fractional bits." +msgstr "" + +#: ../../library/math.rst:313 +msgid "Floating point manipulation functions" +msgstr "" -#: ../../library/math.rst:157 +#: ../../library/math.rst:317 +msgid "" +"Return a float with the magnitude (absolute value) of *x* but the sign of " +"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " +"returns *-1.0*." +msgstr "" +"回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," +"``copysign(1.0, -0.0)`` 回傳 *-1.0*。" + +#: ../../library/math.rst:324 +msgid "" +"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " +"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " +"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " +"to \"pick apart\" the internal representation of a float in a portable way." +msgstr "" +"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" +"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " +"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" + +#: ../../library/math.rst:329 +msgid "" +"Note that :func:`frexp` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." +msgstr "" + +#: ../../library/math.rst:336 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:160 +#: ../../library/math.rst:339 +#, fuzzy msgid "" "Whether or not two values are considered close is determined according to " -"given absolute and relative tolerances." +"given absolute and relative tolerances. If no errors occur, the result will " +"be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "兩數是否足夠接近取決於給定的絕對及相對容許偏差(tolerance)。" -#: ../../library/math.rst:163 +#: ../../library/math.rst:343 +#, fuzzy 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*. " "For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default " "tolerance is ``1e-09``, which assures that the two values are the same " -"within about 9 decimal digits. *rel_tol* must be greater than zero." +"within about 9 decimal digits. *rel_tol* must be nonnegative and less than " +"``1.0``." msgstr "" "*rel_tol* 為相對容許偏差 ── *a* 與 *b* 兩數差的最大容許值,與 *a* 及 *b* 兩數" -"的絕對值中較大者相關。例如欲設置 5% 的容許偏差,則傳入 ``rel_tol=0.05``。其預" -"設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須大於 " -"``0``。" - -#: ../../library/math.rst:169 -msgid "" -"*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " -"zero. *abs_tol* must be at least zero." -msgstr "" -"*abs_tol* 為最小絕對容許偏差 ── 於接近零的比較時很有用。*abs_tol* 須大於等於 " +"的絕對值中較大者相關。例如欲設置 5% 的容許偏差,則傳入 ``rel_tol=0.05``。其預" +"設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須大於 " "``0``。" -#: ../../library/math.rst:172 +#: ../../library/math.rst:350 msgid "" -"If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " -"max(abs(a), abs(b)), abs_tol)``." +"*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " +"nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " +"as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and " +"rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument " +"to the call." msgstr "" -"若未發生任何錯誤,函式結果為 ``abs(a-b) <= max(rel_tol * max(abs(a), " -"abs(b)), abs_tol)``。" -#: ../../library/math.rst:175 +#: ../../library/math.rst:356 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -280,11 +924,11 @@ msgstr "" "處理。更明確地說,``NaN`` 不會與包含自身在內的任何數字足夠接近,而 ``inf`` " "及 ``-inf`` 皆只與自身接近。" -#: ../../library/math.rst:184 +#: ../../library/math.rst:365 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` ── 用於測試近似相等的函式" -#: ../../library/math.rst:189 +#: ../../library/math.rst:370 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" @@ -292,269 +936,128 @@ msgstr "" "若 *x* 不是無限值或 ``NaN`` 便回傳 ``True``,否則回傳 ``False``。(注意 " "``0.0`` 被視為有限數。)" -#: ../../library/math.rst:197 +#: ../../library/math.rst:378 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:203 +#: ../../library/math.rst:384 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" "若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" "傳 ``False``。" -#: ../../library/math.rst:208 -msgid "" -"Return the integer square root of the nonnegative integer *n*. This is the " -"floor of the exact square root of *n*, or equivalently the greatest integer " -"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." -msgstr "" -"回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" -"足 *a*\\ ² |nbsp| ≤ |nbsp| *n* 的最大整數值 *a*。" - -#: ../../library/math.rst:212 -msgid "" -"For some applications, it may be more convenient to have the least integer " -"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " -"the exact square root of *n*. For positive *n*, this can be computed using " -"``a = 1 + isqrt(n - 1)``." -msgstr "" -"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或" -"者說 *n* 精確平方根經上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = " -"1 + isqrt(n - 1)`` 計算。" - -#: ../../library/math.rst:222 -msgid "" -"Return the least common multiple of the specified integer arguments. If all " -"arguments are nonzero, then the returned value is the smallest positive " -"integer that is a multiple of all arguments. If any of the arguments is " -"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " -"``1``." -msgstr "" -"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中" -"最小的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何" -"引數將回傳 ``1``。" - -#: ../../library/math.rst:233 +#: ../../library/math.rst:389 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" -#: ../../library/math.rst:239 -msgid "" -"Return the fractional and integer parts of *x*. Both results carry the sign " -"of *x* and are floats." -msgstr "" - -#: ../../library/math.rst:245 +#: ../../library/math.rst:395 msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: ../../library/math.rst:247 +#: ../../library/math.rst:397 msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: ../../library/math.rst:249 +#: ../../library/math.rst:399 msgid "Examples:" msgstr "範例:" -#: ../../library/math.rst:251 +#: ../../library/math.rst:401 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: ../../library/math.rst:252 +#: ../../library/math.rst:402 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: ../../library/math.rst:253 +#: ../../library/math.rst:403 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: ../../library/math.rst:254 +#: ../../library/math.rst:404 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: ../../library/math.rst:256 +#: ../../library/math.rst:406 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/math.rst:260 +#: ../../library/math.rst:410 msgid "Added the *steps* argument." msgstr "新增 *steps* 引數。" -#: ../../library/math.rst:265 -msgid "" -"Return the number of ways to choose *k* items from *n* items without " -"repetition and with order." -msgstr "" - -#: ../../library/math.rst:268 -msgid "" -"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " -"``k > n``." -msgstr "" - -#: ../../library/math.rst:271 -msgid "" -"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " -"function returns ``n!``." -msgstr "" - -#: ../../library/math.rst:282 -msgid "" -"Calculate the product of all the elements in the input *iterable*. The " -"default *start* value for the product is ``1``." -msgstr "" - -#: ../../library/math.rst:285 -msgid "" -"When the iterable is empty, return the start value. This function is " -"intended specifically for use with numeric values and may reject non-numeric " -"types." -msgstr "" - -#: ../../library/math.rst:294 -msgid "" -"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " -"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " -"is the closest integer to the exact value of the quotient ``x / y``. If " -"``x / y`` is exactly halfway between two consecutive integers, the nearest " -"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " -"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." -msgstr "" - -#: ../../library/math.rst:301 -msgid "" -"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " -"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " -"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " -"remainder operation is zero, that zero will have the same sign as *x*." -msgstr "" - -#: ../../library/math.rst:307 -msgid "" -"On platforms using IEEE 754 binary floating point, the result of this " -"operation is always exactly representable: no rounding error is introduced." -msgstr "" - -#: ../../library/math.rst:315 -msgid "Return the sum of products of values from two iterables *p* and *q*." -msgstr "" - -#: ../../library/math.rst:317 -msgid "Raises :exc:`ValueError` if the inputs do not have the same length." -msgstr "" - -#: ../../library/math.rst:319 ../../library/math.rst:514 -msgid "Roughly equivalent to::" -msgstr "" - -#: ../../library/math.rst:321 -msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" -msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" - -#: ../../library/math.rst:323 -msgid "" -"For float and mixed int/float inputs, the intermediate products and sums are " -"computed with extended precision." -msgstr "" - -#: ../../library/math.rst:331 -msgid "" -"Return *x* with the fractional part removed, leaving the integer part. This " -"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " -"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " -"delegates to :meth:`x.__trunc__ `, which should return an :" -"class:`~numbers.Integral` value." -msgstr "" - -#: ../../library/math.rst:339 +#: ../../library/math.rst:416 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: ../../library/math.rst:341 +#: ../../library/math.rst:418 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: ../../library/math.rst:342 +#: ../../library/math.rst:419 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "" -#: ../../library/math.rst:343 +#: ../../library/math.rst:420 msgid "If *x* is a positive infinity, return *x*." msgstr "" -#: ../../library/math.rst:344 +#: ../../library/math.rst:421 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" "data:`sys.float_info.min `)." msgstr "" -#: ../../library/math.rst:347 +#: ../../library/math.rst:424 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: ../../library/math.rst:350 +#: ../../library/math.rst:427 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: ../../library/math.rst:354 +#: ../../library/math.rst:431 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: ../../library/math.rst:356 +#: ../../library/math.rst:433 msgid "" "See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." msgstr "" -#: ../../library/math.rst:362 -msgid "" -"Note that :func:`frexp` and :func:`modf` have a different call/return " -"pattern than their C equivalents: they take a single argument and return a " -"pair of values, rather than returning their second return value through an " -"'output parameter' (there is no such thing in Python)." -msgstr "" - -#: ../../library/math.rst:367 -msgid "" -"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " -"*all* floating-point numbers of sufficiently large magnitude are exact " -"integers. Python floats typically carry no more than 53 bits of precision " -"(the same as the platform C double type), in which case any float *x* with " -"``abs(x) >= 2**52`` necessarily has no fractional bits." -msgstr "" - -#: ../../library/math.rst:375 -msgid "Power and logarithmic functions" +#: ../../library/math.rst:440 +msgid "Power, exponential and logarithmic functions" msgstr "" -#: ../../library/math.rst:379 +#: ../../library/math.rst:444 msgid "Return the cube root of *x*." msgstr "" -#: ../../library/math.rst:386 +#: ../../library/math.rst:451 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: ../../library/math.rst:393 +#: ../../library/math.rst:458 msgid "Return *2* raised to the power *x*." msgstr "" -#: ../../library/math.rst:400 +#: ../../library/math.rst:465 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " @@ -563,221 +1066,290 @@ msgid "" "compute this quantity to full precision:" msgstr "" -#: ../../library/math.rst:417 +#: ../../library/math.rst:482 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: ../../library/math.rst:419 +#: ../../library/math.rst:484 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: ../../library/math.rst:425 +#: ../../library/math.rst:490 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: ../../library/math.rst:431 +#: ../../library/math.rst:496 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: ../../library/math.rst:438 +#: ../../library/math.rst:503 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: ../../library/math.rst:444 +#: ../../library/math.rst:509 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: ../../library/math.rst:450 +#: ../../library/math.rst:515 msgid "" -"Return ``x`` raised to the power ``y``. Exceptional cases follow the IEEE " -"754 standard as far as possible. In particular, ``pow(1.0, x)`` and " -"``pow(x, 0.0)`` always return ``1.0``, even when ``x`` is a zero or a NaN. " -"If both ``x`` and ``y`` are finite, ``x`` is negative, and ``y`` is not an " -"integer then ``pow(x, y)`` is undefined, and raises :exc:`ValueError`." +"Return *x* raised to the power *y*. Exceptional cases follow the IEEE 754 " +"standard as far as possible. In particular, ``pow(1.0, x)`` and ``pow(x, " +"0.0)`` always return ``1.0``, even when *x* is a zero or a NaN. If both *x* " +"and *y* are finite, *x* is negative, and *y* is not an integer then ``pow(x, " +"y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: ../../library/math.rst:457 +#: ../../library/math.rst:522 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: ../../library/math.rst:461 +#: ../../library/math.rst:526 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: ../../library/math.rst:469 +#: ../../library/math.rst:534 msgid "Return the square root of *x*." msgstr "" -#: ../../library/math.rst:473 -msgid "Trigonometric functions" +#: ../../library/math.rst:538 +msgid "Summation and product functions" msgstr "" -#: ../../library/math.rst:477 +#: ../../library/math.rst:542 msgid "" -"Return the arc cosine of *x*, in radians. The result is between ``0`` and " -"``pi``." +"Return the Euclidean distance between two points *p* and *q*, each given as " +"a sequence (or iterable) of coordinates. The two points must have the same " +"dimension." msgstr "" -#: ../../library/math.rst:483 -msgid "" -"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " -"``pi/2``." +#: ../../library/math.rst:546 ../../library/math.rst:607 +msgid "Roughly equivalent to::" msgstr "" -#: ../../library/math.rst:489 -msgid "" -"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " -"and ``pi/2``." -msgstr "" +#: ../../library/math.rst:548 +msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" +msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -#: ../../library/math.rst:495 +#: ../../library/math.rst:555 msgid "" -"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " -"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " -"this angle with the positive X axis. The point of :func:`atan2` is that the " -"signs of both inputs are known to it, so it can compute the correct quadrant " -"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " -"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +"Return an accurate floating-point sum of values in the iterable. Avoids " +"loss of precision by tracking multiple intermediate partial sums." msgstr "" +"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" +"(partial sum)以避免精確度損失。" -#: ../../library/math.rst:505 -msgid "Return the cosine of *x* radians." +#: ../../library/math.rst:558 +msgid "" +"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " +"typical case where the rounding mode is half-even. On some non-Windows " +"builds, the underlying C library uses extended precision addition and may " +"occasionally double-round an intermediate sum causing it to be off in its " +"least significant bit." msgstr "" +"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" +"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" +"程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:510 +#: ../../library/math.rst:564 msgid "" -"Return the Euclidean distance between two points *p* and *q*, each given as " -"a sequence (or iterable) of coordinates. The two points must have the same " -"dimension." +"For further discussion and two alternative approaches, see the `ASPN " +"cookbook recipes for accurate floating-point summation `_\\." msgstr "" +"更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " +"`_。" -#: ../../library/math.rst:516 -msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" - -#: ../../library/math.rst:523 +#: ../../library/math.rst:571 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: ../../library/math.rst:527 +#: ../../library/math.rst:575 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: ../../library/math.rst:531 +#: ../../library/math.rst:579 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: ../../library/math.rst:535 +#: ../../library/math.rst:583 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: ../../library/math.rst:543 -msgid "Return the sine of *x* radians." +#: ../../library/math.rst:591 +msgid "" +"Calculate the product of all the elements in the input *iterable*. The " +"default *start* value for the product is ``1``." msgstr "" -#: ../../library/math.rst:548 -msgid "Return the tangent of *x* radians." +#: ../../library/math.rst:594 +msgid "" +"When the iterable is empty, return the start value. This function is " +"intended specifically for use with numeric values and may reject non-numeric " +"types." +msgstr "" + +#: ../../library/math.rst:603 +msgid "Return the sum of products of values from two iterables *p* and *q*." +msgstr "" + +#: ../../library/math.rst:605 +msgid "Raises :exc:`ValueError` if the inputs do not have the same length." +msgstr "" + +#: ../../library/math.rst:609 +msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" +msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" + +#: ../../library/math.rst:611 +msgid "" +"For float and mixed int/float inputs, the intermediate products and sums are " +"computed with extended precision." msgstr "" -#: ../../library/math.rst:552 +#: ../../library/math.rst:618 msgid "Angular conversion" msgstr "" -#: ../../library/math.rst:556 +#: ../../library/math.rst:622 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: ../../library/math.rst:561 +#: ../../library/math.rst:627 msgid "Convert angle *x* from degrees to radians." msgstr "" -#: ../../library/math.rst:565 +#: ../../library/math.rst:631 +msgid "Trigonometric functions" +msgstr "" + +#: ../../library/math.rst:635 +msgid "" +"Return the arc cosine of *x*, in radians. The result is between ``0`` and " +"``pi``." +msgstr "" + +#: ../../library/math.rst:641 +msgid "" +"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " +"``pi/2``." +msgstr "" + +#: ../../library/math.rst:647 +msgid "" +"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " +"and ``pi/2``." +msgstr "" + +#: ../../library/math.rst:653 +msgid "" +"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " +"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " +"this angle with the positive X axis. The point of :func:`atan2` is that the " +"signs of both inputs are known to it, so it can compute the correct quadrant " +"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " +"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +msgstr "" + +#: ../../library/math.rst:663 +msgid "Return the cosine of *x* radians." +msgstr "" + +#: ../../library/math.rst:668 +msgid "Return the sine of *x* radians." +msgstr "" + +#: ../../library/math.rst:673 +msgid "Return the tangent of *x* radians." +msgstr "" + +#: ../../library/math.rst:677 msgid "Hyperbolic functions" msgstr "" -#: ../../library/math.rst:567 +#: ../../library/math.rst:679 msgid "" "`Hyperbolic functions `_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: ../../library/math.rst:573 +#: ../../library/math.rst:685 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:578 +#: ../../library/math.rst:690 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:583 +#: ../../library/math.rst:695 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:588 +#: ../../library/math.rst:700 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:593 +#: ../../library/math.rst:705 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:598 +#: ../../library/math.rst:710 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:602 +#: ../../library/math.rst:714 msgid "Special functions" msgstr "" -#: ../../library/math.rst:606 +#: ../../library/math.rst:718 msgid "" "Return the `error function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:609 +#: ../../library/math.rst:721 msgid "" "The :func:`erf` function can be used to compute traditional statistical " "functions such as the `cumulative standard normal distribution `_::" msgstr "" -#: ../../library/math.rst:613 +#: ../../library/math.rst:725 msgid "" "def phi(x):\n" " 'Cumulative distribution function for the standard normal distribution'\n" " return (1.0 + erf(x / sqrt(2.0))) / 2.0" msgstr "" -#: ../../library/math.rst:622 +#: ../../library/math.rst:734 msgid "" "Return the complementary error function at *x*. The `complementary error " "function `_ is defined as " @@ -786,31 +1358,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: ../../library/math.rst:633 +#: ../../library/math.rst:745 msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:641 +#: ../../library/math.rst:753 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: ../../library/math.rst:648 +#: ../../library/math.rst:760 msgid "Constants" msgstr "常數" -#: ../../library/math.rst:652 +#: ../../library/math.rst:764 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: ../../library/math.rst:657 +#: ../../library/math.rst:769 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: ../../library/math.rst:662 +#: ../../library/math.rst:774 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -819,13 +1391,13 @@ msgid "" "celebrating `Tau day `_ by eating twice as much pie!" msgstr "" -#: ../../library/math.rst:673 +#: ../../library/math.rst:785 msgid "" "A floating-point positive infinity. (For negative infinity, use ``-math." "inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: ../../library/math.rst:681 +#: ../../library/math.rst:793 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,605 +19,35 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/msilib.rst:2 -msgid ":mod:`msilib` --- Read and write Microsoft Installer files" +#, fuzzy +msgid ":mod:`!msilib` --- Read and write Microsoft Installer files" msgstr ":mod:`msilib` --- 讀寫 Microsoft Installer 檔案" -#: ../../library/msilib.rst:12 -msgid "**Source code:** :source:`Lib/msilib/__init__.py`" -msgstr "**原始碼:**\\ :source:`Lib/msilib/__init__.py`" - -#: ../../library/msilib.rst:16 -msgid "" -"The :mod:`msilib` module is deprecated (see :pep:`PEP 594 <594#msilib>` for " -"details)." -msgstr "" -":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " -"<594#msilib>`\\ )。" - -#: ../../library/msilib.rst:22 -msgid "" -"The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) " -"files. Because these files often contain an embedded \"cabinet\" file (``." -"cab``), it also exposes an API to create CAB files. Support for reading ``." -"cab`` files is currently not implemented; read support for the ``.msi`` " -"database is possible." -msgstr "" - -#: ../../library/msilib.rst:27 -msgid "" -"This package aims to provide complete access to all tables in an ``.msi`` " -"file, therefore, it is a fairly low-level API. One primary application of " -"this package is the creation of Python installer package itself (although " -"that currently uses a different version of ``msilib``)." -msgstr "" - -#: ../../library/msilib.rst:32 -msgid "" -"The package contents can be roughly split into four parts: low-level CAB " -"routines, low-level MSI routines, higher-level MSI routines, and standard " -"table structures." -msgstr "" - -#: ../../library/msilib.rst:39 -msgid "" -"Create a new CAB file named *cabname*. *files* must be a list of tuples, " -"each containing the name of the file on disk, and the name of the file " -"inside the CAB file." -msgstr "" - -#: ../../library/msilib.rst:43 -msgid "" -"The files are added to the CAB file in the order they appear in the list. " -"All files are added into a single CAB file, using the MSZIP compression " -"algorithm." -msgstr "" - -#: ../../library/msilib.rst:46 -msgid "" -"Callbacks to Python for the various steps of MSI creation are currently not " -"exposed." -msgstr "" - -#: ../../library/msilib.rst:52 -msgid "" -"Return the string representation of a new unique identifier. This wraps the " -"Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`." -msgstr "" - -#: ../../library/msilib.rst:58 -msgid "" -"Return a new database object by calling MsiOpenDatabase. *path* is the " -"file name of the MSI file; *persist* can be one of the constants " -"``MSIDBOPEN_CREATEDIRECT``, ``MSIDBOPEN_CREATE``, ``MSIDBOPEN_DIRECT``, " -"``MSIDBOPEN_READONLY``, or ``MSIDBOPEN_TRANSACT``, and may include the flag " -"``MSIDBOPEN_PATCHFILE``. See the Microsoft documentation for the meaning of " -"these flags; depending on the flags, an existing database is opened, or a " -"new one created." -msgstr "" - -#: ../../library/msilib.rst:69 -msgid "" -"Return a new record object by calling :c:func:`MSICreateRecord`. *count* is " -"the number of fields of the record." -msgstr "" - -#: ../../library/msilib.rst:75 -msgid "" -"Create and return a new database *name*, initialize it with *schema*, and " -"set the properties *ProductName*, *ProductCode*, *ProductVersion*, and " -"*Manufacturer*." -msgstr "" - -#: ../../library/msilib.rst:79 -msgid "" -"*schema* must be a module object containing ``tables`` and " -"``_Validation_records`` attributes; typically, :mod:`msilib.schema` should " -"be used." -msgstr "" - -#: ../../library/msilib.rst:83 -msgid "" -"The database will contain just the schema and the validation records when " -"this function returns." -msgstr "" - -#: ../../library/msilib.rst:89 -msgid "Add all *records* to the table named *table* in *database*." -msgstr "" - -#: ../../library/msilib.rst:91 -msgid "" -"The *table* argument must be one of the predefined tables in the MSI schema, " -"e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, " -"``'Control'``, etc." -msgstr "" - -#: ../../library/msilib.rst:95 -msgid "" -"*records* should be a list of tuples, each one containing all fields of a " -"record according to the schema of the table. For optional fields, ``None`` " -"can be passed." -msgstr "" - -#: ../../library/msilib.rst:99 -msgid "Field values can be ints, strings, or instances of the Binary class." -msgstr "" - -#: ../../library/msilib.rst:104 -msgid "" -"Represents entries in the Binary table; inserting such an object using :func:" -"`add_data` reads the file named *filename* into the table." -msgstr "" - -#: ../../library/msilib.rst:110 -msgid "" -"Add all table content from *module* to *database*. *module* must contain an " -"attribute *tables* listing all tables for which content should be added, and " -"one attribute per table that has the actual content." -msgstr "" - -#: ../../library/msilib.rst:114 -msgid "This is typically used to install the sequence tables." -msgstr "" - -#: ../../library/msilib.rst:119 -msgid "" -"Add the file *path* into the ``_Stream`` table of *database*, with the " -"stream name *name*." -msgstr "" - -#: ../../library/msilib.rst:125 -msgid "" -"Return a new UUID, in the format that MSI typically requires (i.e. in curly " -"braces, and with all hexdigits in uppercase)." -msgstr "" - -#: ../../library/msilib.rst:131 -msgid "" -"`FCICreate `_ " -"`UuidCreate `_ `UuidToString `_" -msgstr "" - -#: ../../library/msilib.rst:138 -msgid "Database Objects" -msgstr "" - -#: ../../library/msilib.rst:143 -msgid "" -"Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the " -"SQL statement to execute." -msgstr "" - -#: ../../library/msilib.rst:149 -msgid "" -"Commit the changes pending in the current transaction, by calling :c:func:" -"`MSIDatabaseCommit`." -msgstr "" - -#: ../../library/msilib.rst:155 -msgid "" -"Return a new summary information object, by calling :c:func:" -"`MsiGetSummaryInformation`. *count* is the maximum number of updated values." -msgstr "" - -#: ../../library/msilib.rst:161 -msgid "Close the database object, through :c:func:`MsiCloseHandle`." -msgstr "" - -#: ../../library/msilib.rst:167 -msgid "" -"`MSIDatabaseOpenView `_ `MSIDatabaseCommit `_ `MSIGetSummaryInformation " -"`_ " -"`MsiCloseHandle `_" -msgstr "" - -#: ../../library/msilib.rst:175 -msgid "View Objects" -msgstr "" - -#: ../../library/msilib.rst:180 -msgid "" -"Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If " -"*params* is not ``None``, it is a record describing actual values of the " -"parameter tokens in the query." -msgstr "" - -#: ../../library/msilib.rst:187 -msgid "" -"Return a record describing the columns of the view, through calling :c:func:" -"`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or " -"``MSICOLINFO_TYPES``." -msgstr "" - -#: ../../library/msilib.rst:194 -msgid "" -"Return a result record of the query, through calling :c:func:`MsiViewFetch`." -msgstr "" - -#: ../../library/msilib.rst:199 -msgid "" -"Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of " -"``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``, " -"``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``, " -"``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``, " -"``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``, " -"``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``." -msgstr "" - -#: ../../library/msilib.rst:206 -msgid "*data* must be a record describing the new data." -msgstr "" - -#: ../../library/msilib.rst:211 -msgid "Close the view, through :c:func:`MsiViewClose`." -msgstr "" - -#: ../../library/msilib.rst:216 -msgid "" -"`MsiViewExecute `_ `MSIViewGetColumnInfo `_ `MsiViewFetch `_ `MsiViewModify " -"`_ " -"`MsiViewClose `_" -msgstr "" - -#: ../../library/msilib.rst:225 -msgid "Summary Information Objects" -msgstr "" - -#: ../../library/msilib.rst:230 -msgid "" -"Return a property of the summary, through :c:func:" -"`MsiSummaryInfoGetProperty`. *field* is the name of the property, and can be " -"one of the constants ``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, " -"``PID_AUTHOR``, ``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, " -"``PID_LASTAUTHOR``, ``PID_REVNUMBER``, ``PID_LASTPRINTED``, " -"``PID_CREATE_DTM``, ``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, " -"``PID_WORDCOUNT``, ``PID_CHARCOUNT``, ``PID_APPNAME``, or ``PID_SECURITY``." -msgstr "" - -#: ../../library/msilib.rst:241 -msgid "" -"Return the number of summary properties, through :c:func:" -"`MsiSummaryInfoGetPropertyCount`." -msgstr "" - -#: ../../library/msilib.rst:247 -msgid "" -"Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have " -"the same values as in :meth:`GetProperty`, *value* is the new value of the " -"property. Possible value types are integer and string." -msgstr "" - -#: ../../library/msilib.rst:254 -msgid "" -"Write the modified properties to the summary information stream, using :c:" -"func:`MsiSummaryInfoPersist`." -msgstr "" - -#: ../../library/msilib.rst:260 -msgid "" -"`MsiSummaryInfoGetProperty `_ `MsiSummaryInfoGetPropertyCount `_ " -"`MsiSummaryInfoSetProperty `_ `MsiSummaryInfoPersist `_" -msgstr "" - -#: ../../library/msilib.rst:268 -msgid "Record Objects" -msgstr "" - -#: ../../library/msilib.rst:273 -msgid "" -"Return the number of fields of the record, through :c:func:" -"`MsiRecordGetFieldCount`." -msgstr "" - -#: ../../library/msilib.rst:279 -msgid "" -"Return the value of *field* as an integer where possible. *field* must be " -"an integer." -msgstr "" - -#: ../../library/msilib.rst:285 -msgid "" -"Return the value of *field* as a string where possible. *field* must be an " -"integer." -msgstr "" - -#: ../../library/msilib.rst:291 -msgid "" -"Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be " -"an integer; *value* a string." -msgstr "" - -#: ../../library/msilib.rst:297 -msgid "" -"Set *field* to the contents of the file named *value*, through :c:func:" -"`MsiRecordSetStream`. *field* must be an integer; *value* a string." -msgstr "" - -#: ../../library/msilib.rst:303 -msgid "" -"Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* " -"and *value* must be an integer." -msgstr "" - -#: ../../library/msilib.rst:309 -msgid "" -"Set all fields of the record to 0, through :c:func:`MsiRecordClearData`." -msgstr "" - -#: ../../library/msilib.rst:314 -msgid "" -"`MsiRecordGetFieldCount `_ `MsiRecordSetString `_ `MsiRecordSetStream `_ " -"`MsiRecordSetInteger `_ `MsiRecordClearData `_" -msgstr "" - -#: ../../library/msilib.rst:323 -msgid "Errors" -msgstr "" - -#: ../../library/msilib.rst:325 -msgid "" -"All wrappers around MSI functions raise :exc:`MSIError`; the string inside " -"the exception will contain more detail." -msgstr "" - -#: ../../library/msilib.rst:332 -msgid "CAB Objects" -msgstr "CAB 物件" - -#: ../../library/msilib.rst:337 -msgid "" -"The class :class:`CAB` represents a CAB file. During MSI construction, files " -"will be added simultaneously to the ``Files`` table, and to a CAB file. " -"Then, when all files have been added, the CAB file can be written, then " -"added to the MSI file." -msgstr "" - -#: ../../library/msilib.rst:342 -msgid "*name* is the name of the CAB file in the MSI file." -msgstr "" - -#: ../../library/msilib.rst:347 -msgid "" -"Add the file with the pathname *full* to the CAB file, under the name " -"*logical*. If there is already a file named *logical*, a new file name is " -"created." -msgstr "" - -#: ../../library/msilib.rst:351 -msgid "" -"Return the index of the file in the CAB file, and the new name of the file " -"inside the CAB file." -msgstr "" - -#: ../../library/msilib.rst:357 -msgid "" -"Generate a CAB file, add it as a stream to the MSI file, put it into the " -"``Media`` table, and remove the generated file from the disk." -msgstr "" - -#: ../../library/msilib.rst:364 -msgid "Directory Objects" -msgstr "" - -#: ../../library/msilib.rst:369 -msgid "" -"Create a new directory in the Directory table. There is a current component " -"at each point in time for the directory, which is either explicitly created " -"through :meth:`start_component`, or implicitly when files are added for the " -"first time. Files are added into the current component, and into the cab " -"file. To create a directory, a base directory object needs to be specified " -"(can be ``None``), the path to the physical directory, and a logical " -"directory name. *default* specifies the DefaultDir slot in the directory " -"table. *componentflags* specifies the default flags that new components get." -msgstr "" - -#: ../../library/msilib.rst:381 -msgid "" -"Add an entry to the Component table, and make this component the current " -"component for this directory. If no component name is given, the directory " -"name is used. If no *feature* is given, the current feature is used. If no " -"*flags* are given, the directory's default flags are used. If no *keyfile* " -"is given, the KeyPath is left null in the Component table." -msgstr "" - -#: ../../library/msilib.rst:390 -msgid "" -"Add a file to the current component of the directory, starting a new one if " -"there is no current component. By default, the file name in the source and " -"the file table will be identical. If the *src* file is specified, it is " -"interpreted relative to the current directory. Optionally, a *version* and a " -"*language* can be specified for the entry in the File table." -msgstr "" - -#: ../../library/msilib.rst:399 -msgid "" -"Add a list of files to the current component as specified in the glob " -"pattern. Individual files can be excluded in the *exclude* list." -msgstr "" - -#: ../../library/msilib.rst:405 -msgid "Remove ``.pyc`` files on uninstall." -msgstr "" - -#: ../../library/msilib.rst:410 -msgid "" -"`Directory Table `_ `File Table `_ `Component Table `_ `FeatureComponents Table " -"`_" -msgstr "" - -#: ../../library/msilib.rst:418 -msgid "Features" -msgstr "" - -#: ../../library/msilib.rst:423 -msgid "" -"Add a new record to the ``Feature`` table, using the values *id*, *parent." -"id*, *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The " -"resulting feature object can be passed to the :meth:`start_component` method " -"of :class:`Directory`." -msgstr "" - -#: ../../library/msilib.rst:431 -msgid "" -"Make this feature the current feature of :mod:`msilib`. New components are " -"automatically added to the default feature, unless a feature is explicitly " -"specified." -msgstr "" - -#: ../../library/msilib.rst:438 -msgid "" -"`Feature Table `_" -msgstr "" - -#: ../../library/msilib.rst:443 -msgid "GUI classes" -msgstr "" - -#: ../../library/msilib.rst:445 -msgid "" -":mod:`msilib` provides several classes that wrap the GUI tables in an MSI " -"database. However, no standard user interface is provided." -msgstr "" - -#: ../../library/msilib.rst:451 -msgid "" -"Base class of the dialog controls. *dlg* is the dialog object the control " -"belongs to, and *name* is the control's name." -msgstr "" - -#: ../../library/msilib.rst:457 -msgid "Make an entry into the ``ControlEvent`` table for this control." -msgstr "" - -#: ../../library/msilib.rst:462 -msgid "Make an entry into the ``EventMapping`` table for this control." -msgstr "" - -#: ../../library/msilib.rst:467 -msgid "Make an entry into the ``ControlCondition`` table for this control." -msgstr "" - -#: ../../library/msilib.rst:472 -msgid "" -"Create a radio button control named *name*. *property* is the installer " -"property that gets set when a radio button is selected." -msgstr "" - -#: ../../library/msilib.rst:478 -msgid "" -"Add a radio button named *name* to the group, at the coordinates *x*, *y*, " -"*width*, *height*, and with the label *text*. If *value* is ``None``, it " -"defaults to *name*." -msgstr "" - -#: ../../library/msilib.rst:485 +#: ../../library/msilib.rst:10 msgid "" -"Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is " -"made, with the specified coordinates, dialog attributes, title, name of the " -"first, default, and cancel controls." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/msilib.rst:492 -msgid "" -"Return a new :class:`Control` object. An entry in the ``Control`` table is " -"made with the specified parameters." -msgstr "" - -#: ../../library/msilib.rst:495 -msgid "" -"This is a generic method; for specific types, specialized methods are " -"provided." -msgstr "" - -#: ../../library/msilib.rst:501 -msgid "Add and return a ``Text`` control." -msgstr "" - -#: ../../library/msilib.rst:506 -msgid "Add and return a ``Bitmap`` control." -msgstr "" - -#: ../../library/msilib.rst:511 -msgid "Add and return a ``Line`` control." -msgstr "" - -#: ../../library/msilib.rst:516 -msgid "Add and return a ``PushButton`` control." -msgstr "" - -#: ../../library/msilib.rst:521 -msgid "Add and return a ``RadioButtonGroup`` control." -msgstr "" - -#: ../../library/msilib.rst:526 -msgid "Add and return a ``CheckBox`` control." -msgstr "" - -#: ../../library/msilib.rst:531 +#: ../../library/msilib.rst:14 msgid "" -"`Dialog Table `_ `Control Table `_ `Control Types `_ `ControlCondition Table " -"`_ " -"`ControlEvent Table `_ `EventMapping Table `_ `RadioButton Table `_" +"The last version of Python that provided the :mod:`!msilib` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/msilib.rst:542 -msgid "Precomputed tables" -msgstr "" +#~ msgid "**Source code:** :source:`Lib/msilib/__init__.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/msilib/__init__.py`" -#: ../../library/msilib.rst:544 -msgid "" -":mod:`msilib` provides a few subpackages that contain only schema and table " -"definitions. Currently, these definitions are based on MSI version 2.0." -msgstr "" +#~ msgid "" +#~ "The :mod:`msilib` module is deprecated (see :pep:`PEP 594 <594#msilib>` " +#~ "for details)." +#~ msgstr "" +#~ ":mod:`msilib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#msilib>`\\ )。" -#: ../../library/msilib.rst:550 -msgid "" -"This is the standard MSI schema for MSI 2.0, with the *tables* variable " -"providing a list of table definitions, and *_Validation_records* providing " -"the data for MSI validation." -msgstr "" +#~ msgid "CAB Objects" +#~ msgstr "CAB 物件" -#: ../../library/msilib.rst:557 -msgid "" -"This module contains table contents for the standard sequence tables: " -"*AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*, " -"*InstallExecuteSequence*, and *InstallUISequence*." -msgstr "" - -#: ../../library/msilib.rst:564 -msgid "" -"This module contains definitions for the UIText and ActionText tables, for " -"the standard installer actions." -msgstr "" - -#: ../../library/msilib.rst:14 -msgid "msi" -msgstr "msi" +#~ msgid "msi" +#~ msgstr "msi" diff --git a/library/nis.po b/library/nis.po index 4f16e11b08..1c57966a1d 100644 --- a/library/nis.po +++ b/library/nis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -18,83 +18,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/nis.rst:3 -msgid ":mod:`nis` --- Interface to Sun's NIS (Yellow Pages)" +#: ../../library/nis.rst:2 +#, fuzzy +msgid ":mod:`!nis` --- Interface to Sun’s NIS (Yellow Pages)" msgstr ":mod:`nis` --- Sun NIS (Yellow Pages) 介面" -#: ../../library/nis.rst:13 +#: ../../library/nis.rst:10 msgid "" -"The :mod:`nis` module is deprecated (see :pep:`PEP 594 <594#nis>` for " -"details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`nis` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#nis>`\\ )。" -#: ../../library/nis.rst:19 +#: ../../library/nis.rst:14 msgid "" -"The :mod:`nis` module gives a thin wrapper around the NIS library, useful " -"for central administration of several hosts." +"The last version of Python that provided the :mod:`!nis` module was `Python " +"3.12 `_." msgstr "" -#: ../../library/nis.rst:22 -msgid "" -"Because NIS exists only on Unix systems, this module is only available for " -"Unix." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/nis.rst:26 -msgid "The :mod:`nis` module defines the following functions:" -msgstr "" - -#: ../../library/nis.rst:31 -msgid "" -"Return the match for *key* in map *mapname*, or raise an error (:exc:`nis." -"error`) if there is none. Both should be strings, *key* is 8-bit clean. " -"Return value is an arbitrary array of bytes (may contain ``NULL`` and other " -"joys)." -msgstr "" - -#: ../../library/nis.rst:36 ../../library/nis.rst:48 -msgid "Note that *mapname* is first checked if it is an alias to another name." -msgstr "" +#~ msgid "" +#~ "The :mod:`nis` module is deprecated (see :pep:`PEP 594 <594#nis>` for " +#~ "details)." +#~ msgstr "" +#~ ":mod:`nis` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#nis>`\\ )。" -#: ../../library/nis.rst:38 ../../library/nis.rst:50 ../../library/nis.rst:58 -msgid "" -"The *domain* argument allows overriding the NIS domain used for the lookup. " -"If unspecified, lookup is in the default NIS domain." -msgstr "" - -#: ../../library/nis.rst:44 -msgid "" -"Return a dictionary mapping *key* to *value* such that ``match(key, " -"mapname)==value``. Note that both keys and values of the dictionary are " -"arbitrary arrays of bytes." -msgstr "" - -#: ../../library/nis.rst:56 -msgid "Return a list of all valid maps." -msgstr "" - -#: ../../library/nis.rst:64 -msgid "Return the system default NIS domain." -msgstr "" - -#: ../../library/nis.rst:67 -msgid "The :mod:`nis` module defines the following exception:" -msgstr "" - -#: ../../library/nis.rst:71 -msgid "An error raised when a NIS function returns an error code." -msgstr "" +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/nntplib.po b/library/nntplib.po index d0720d6f85..4881b8b4fa 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -18,671 +18,166 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/nntplib.rst:2 -msgid ":mod:`nntplib` --- NNTP protocol client" +#, fuzzy +msgid ":mod:`!nntplib` --- NNTP protocol client" msgstr ":mod:`nntplib` --- NNTP 協定客戶端" -#: ../../library/nntplib.rst:8 -msgid "**Source code:** :source:`Lib/nntplib.py`" -msgstr "**原始碼:**\\ :source:`Lib/nntplib.py`" - -#: ../../library/nntplib.rst:14 -msgid "The :mod:`nntplib` module is deprecated (see :pep:`594` for details)." -msgstr ":mod:`nntlib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" - -#: ../../library/nntplib.rst:36 -msgid "" -"This module defines the class :class:`NNTP` which implements the client side " -"of the Network News Transfer Protocol. It can be used to implement a news " -"reader or poster, or automated news processors. It is compatible with :rfc:" -"`3977` as well as the older :rfc:`977` and :rfc:`2980`." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/nntplib.rst:43 -msgid "" -"Here are two small examples of how it can be used. To list some statistics " -"about a newsgroup and print the subjects of the last 10 articles::" -msgstr "" - -#: ../../library/nntplib.rst:46 -msgid "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> resp, count, first, last, name = s.group('gmane.comp.python." -"committers')\n" -">>> print('Group', name, 'has', count, 'articles, range', first, 'to', " -"last)\n" -"Group gmane.comp.python.committers has 1096 articles, range 1 to 1096\n" -">>> resp, overviews = s.over((last - 9, last))\n" -">>> for id, over in overviews:\n" -"... print(id, nntplib.decode_header(over['subject']))\n" -"...\n" -"1087 Re: Commit privileges for Łukasz Langa\n" -"1088 Re: 3.2 alpha 2 freeze\n" -"1089 Re: 3.2 alpha 2 freeze\n" -"1090 Re: Commit privileges for Łukasz Langa\n" -"1091 Re: Commit privileges for Łukasz Langa\n" -"1092 Updated ssh key\n" -"1093 Re: Updated ssh key\n" -"1094 Re: Updated ssh key\n" -"1095 Hello fellow committers!\n" -"1096 Re: Hello fellow committers!\n" -">>> s.quit()\n" -"'205 Bye!'" -msgstr "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> resp, count, first, last, name = s.group('gmane.comp.python." -"committers')\n" -">>> print('Group', name, 'has', count, 'articles, range', first, 'to', " -"last)\n" -"Group gmane.comp.python.committers has 1096 articles, range 1 to 1096\n" -">>> resp, overviews = s.over((last - 9, last))\n" -">>> for id, over in overviews:\n" -"... print(id, nntplib.decode_header(over['subject']))\n" -"...\n" -"1087 Re: Commit privileges for Łukasz Langa\n" -"1088 Re: 3.2 alpha 2 freeze\n" -"1089 Re: 3.2 alpha 2 freeze\n" -"1090 Re: Commit privileges for Łukasz Langa\n" -"1091 Re: Commit privileges for Łukasz Langa\n" -"1092 Updated ssh key\n" -"1093 Re: Updated ssh key\n" -"1094 Re: Updated ssh key\n" -"1095 Hello fellow committers!\n" -"1096 Re: Hello fellow committers!\n" -">>> s.quit()\n" -"'205 Bye!'" - -#: ../../library/nntplib.rst:67 -msgid "" -"To post an article from a binary file (this assumes that the article has " -"valid headers, and that you have right to post on the particular newsgroup)::" -msgstr "" - -#: ../../library/nntplib.rst:70 -msgid "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> f = open('article.txt', 'rb')\n" -">>> s.post(f)\n" -"'240 Article posted successfully.'\n" -">>> s.quit()\n" -"'205 Bye!'" -msgstr "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> f = open('article.txt', 'rb')\n" -">>> s.post(f)\n" -"'240 Article posted successfully.'\n" -">>> s.quit()\n" -"'205 Bye!'" - -#: ../../library/nntplib.rst:77 -msgid "The module itself defines the following classes:" -msgstr "" - -#: ../../library/nntplib.rst:82 -msgid "" -"Return a new :class:`NNTP` object, representing a connection to the NNTP " -"server running on host *host*, listening at port *port*. An optional " -"*timeout* can be specified for the socket connection. If the optional *user* " -"and *password* are provided, or if suitable credentials are present in :file:" -"`/.netrc` and the optional flag *usenetrc* is true, the ``AUTHINFO USER`` " -"and ``AUTHINFO PASS`` commands are used to identify and authenticate the " -"user to the server. If the optional flag *readermode* is true, then a " -"``mode reader`` command is sent before authentication is performed. Reader " -"mode is sometimes necessary if you are connecting to an NNTP server on the " -"local machine and intend to call reader-specific commands, such as " -"``group``. If you get unexpected :exc:`NNTPPermanentError`\\ s, you might " -"need to set *readermode*. The :class:`NNTP` class supports the :keyword:" -"`with` statement to unconditionally consume :exc:`OSError` exceptions and to " -"close the NNTP connection when done, e.g.:" -msgstr "" - -#: ../../library/nntplib.rst:105 ../../library/nntplib.rst:137 -msgid "" -"Raises an :ref:`auditing event ` ``nntplib.connect`` with " -"arguments ``self``, ``host``, ``port``." -msgstr "" -"引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " -"` ``nntplib.connect``。" - -#: ../../library/nntplib.rst:107 ../../library/nntplib.rst:109 -#: ../../library/nntplib.rst:139 ../../library/nntplib.rst:141 -msgid "" -"All commands will raise an :ref:`auditing event ` ``nntplib." -"putline`` with arguments ``self`` and ``line``, where ``line`` is the bytes " -"about to be sent to the remote host." -msgstr "" - -#: ../../library/nntplib.rst:113 -msgid "*usenetrc* is now ``False`` by default." -msgstr "" - -#: ../../library/nntplib.rst:116 -msgid "Support for the :keyword:`with` statement was added." -msgstr "" - -#: ../../library/nntplib.rst:119 ../../library/nntplib.rst:152 -msgid "" -"If the *timeout* parameter is set to be zero, it will raise a :class:" -"`ValueError` to prevent the creation of a non-blocking socket." -msgstr "" - -#: ../../library/nntplib.rst:125 -msgid "" -"Return a new :class:`NNTP_SSL` object, representing an encrypted connection " -"to the NNTP server running on host *host*, listening at port *port*. :class:" -"`NNTP_SSL` objects have the same methods as :class:`NNTP` objects. If " -"*port* is omitted, port 563 (NNTPS) is used. *ssl_context* is also optional, " -"and is a :class:`~ssl.SSLContext` object. Please read :ref:`ssl-security` " -"for best practices. All other parameters behave the same as for :class:" -"`NNTP`." -msgstr "" - -#: ../../library/nntplib.rst:133 -msgid "" -"Note that SSL-on-563 is discouraged per :rfc:`4642`, in favor of STARTTLS as " -"described below. However, some servers only support the former." -msgstr "" - -#: ../../library/nntplib.rst:147 -msgid "" -"The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." -msgstr "" - -#: ../../library/nntplib.rst:158 -msgid "" -"Derived from the standard exception :exc:`Exception`, this is the base class " -"for all exceptions raised by the :mod:`nntplib` module. Instances of this " -"class have the following attribute:" -msgstr "" - -#: ../../library/nntplib.rst:164 -msgid "The response of the server if available, as a :class:`str` object." -msgstr "" - -#: ../../library/nntplib.rst:169 -msgid "Exception raised when an unexpected reply is received from the server." -msgstr "" - -#: ../../library/nntplib.rst:174 -msgid "" -"Exception raised when a response code in the range 400--499 is received." -msgstr "" - -#: ../../library/nntplib.rst:179 -msgid "" -"Exception raised when a response code in the range 500--599 is received." -msgstr "" - -#: ../../library/nntplib.rst:184 -msgid "" -"Exception raised when a reply is received from the server that does not " -"begin with a digit in the range 1--5." -msgstr "" - -#: ../../library/nntplib.rst:190 -msgid "Exception raised when there is some error in the response data." -msgstr "" - -#: ../../library/nntplib.rst:196 -msgid "NNTP Objects" -msgstr "NNTP 物件" - -#: ../../library/nntplib.rst:198 -msgid "" -"When connected, :class:`NNTP` and :class:`NNTP_SSL` objects support the " -"following methods and attributes." -msgstr "" - -#: ../../library/nntplib.rst:202 -msgid "Attributes" -msgstr "屬性" - -#: ../../library/nntplib.rst:206 -msgid "" -"An integer representing the version of the NNTP protocol supported by the " -"server. In practice, this should be ``2`` for servers advertising :rfc:" -"`3977` compliance and ``1`` for others." -msgstr "" - -#: ../../library/nntplib.rst:214 -msgid "" -"A string describing the software name and version of the NNTP server, or :" -"const:`None` if not advertised by the server." -msgstr "" - -#: ../../library/nntplib.rst:220 -msgid "Methods" -msgstr "方法" - -#: ../../library/nntplib.rst:222 -msgid "" -"The *response* that is returned as the first item in the return tuple of " -"almost all methods is the server's response: a string beginning with a three-" -"digit code. If the server's response indicates an error, the method raises " -"one of the above exceptions." -msgstr "" - -#: ../../library/nntplib.rst:227 -msgid "" -"Many of the following methods take an optional keyword-only argument *file*. " -"When the *file* argument is supplied, it must be either a :term:`file " -"object` opened for binary writing, or the name of an on-disk file to be " -"written to. The method will then write any data returned by the server " -"(except for the response line and the terminating dot) to the file; any list " -"of lines, tuples or objects that the method normally returns will be empty." -msgstr "" - -#: ../../library/nntplib.rst:234 -msgid "" -"Many of the following methods have been reworked and fixed, which makes them " -"incompatible with their 3.1 counterparts." -msgstr "" - -#: ../../library/nntplib.rst:241 -msgid "" -"Send a ``QUIT`` command and close the connection. Once this method has been " -"called, no other methods of the NNTP object should be called." -msgstr "" - -#: ../../library/nntplib.rst:247 -msgid "" -"Return the welcome message sent by the server in reply to the initial " -"connection. (This message sometimes contains disclaimers or help " -"information that may be relevant to the user.)" -msgstr "" - -#: ../../library/nntplib.rst:254 -msgid "" -"Return the :rfc:`3977` capabilities advertised by the server, as a :class:" -"`dict` instance mapping capability names to (possibly empty) lists of " -"values. On legacy servers which don't understand the ``CAPABILITIES`` " -"command, an empty dictionary is returned instead." -msgstr "" - -#: ../../library/nntplib.rst:268 -msgid "" -"Send ``AUTHINFO`` commands with the user name and password. If *user* and " -"*password* are ``None`` and *usenetrc* is true, credentials from ``~/." -"netrc`` will be used if possible." -msgstr "" - -#: ../../library/nntplib.rst:272 -msgid "" -"Unless intentionally delayed, login is normally performed during the :class:" -"`NNTP` object initialization and separately calling this function is " -"unnecessary. To force authentication to be delayed, you must not set *user* " -"or *password* when creating the object, and must set *usenetrc* to False." -msgstr "" - -#: ../../library/nntplib.rst:283 -msgid "" -"Send a ``STARTTLS`` command. This will enable encryption on the NNTP " -"connection. The *context* argument is optional and should be a :class:`ssl." -"SSLContext` object. Please read :ref:`ssl-security` for best practices." -msgstr "" - -#: ../../library/nntplib.rst:288 -msgid "" -"Note that this may not be done after authentication information has been " -"transmitted, and authentication occurs by default if possible during a :" -"class:`NNTP` object initialization. See :meth:`NNTP.login` for information " -"on suppressing this behavior." -msgstr "" - -#: ../../library/nntplib.rst:295 -msgid "" -"The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." -msgstr "" - -#: ../../library/nntplib.rst:302 -msgid "" -"Send a ``NEWGROUPS`` command. The *date* argument should be a :class:" -"`datetime.date` or :class:`datetime.datetime` object. Return a pair " -"``(response, groups)`` where *groups* is a list representing the groups that " -"are new since the given *date*. If *file* is supplied, though, then *groups* " -"will be empty." -msgstr "" - -#: ../../library/nntplib.rst:318 -msgid "" -"Send a ``NEWNEWS`` command. Here, *group* is a group name or ``'*'``, and " -"*date* has the same meaning as for :meth:`newgroups`. Return a pair " -"``(response, articles)`` where *articles* is a list of message ids." -msgstr "" - -#: ../../library/nntplib.rst:322 -msgid "This command is frequently disabled by NNTP server administrators." -msgstr "" - -#: ../../library/nntplib.rst:327 -msgid "" -"Send a ``LIST`` or ``LIST ACTIVE`` command. Return a pair ``(response, " -"list)`` where *list* is a list of tuples representing all the groups " -"available from this NNTP server, optionally matching the pattern string " -"*group_pattern*. Each tuple has the form ``(group, last, first, flag)``, " -"where *group* is a group name, *last* and *first* are the last and first " -"article numbers, and *flag* usually takes one of these values:" -msgstr "" - -#: ../../library/nntplib.rst:335 -msgid "``y``: Local postings and articles from peers are allowed." -msgstr "" - -#: ../../library/nntplib.rst:336 -msgid "``m``: The group is moderated and all postings must be approved." -msgstr "" - -#: ../../library/nntplib.rst:337 -msgid "``n``: No local postings are allowed, only articles from peers." -msgstr "" - -#: ../../library/nntplib.rst:338 -msgid "``j``: Articles from peers are filed in the junk group instead." -msgstr "" - -#: ../../library/nntplib.rst:339 -msgid "``x``: No local postings, and articles from peers are ignored." -msgstr "" - -#: ../../library/nntplib.rst:340 -msgid "``=foo.bar``: Articles are filed in the ``foo.bar`` group instead." -msgstr "" - -#: ../../library/nntplib.rst:342 -msgid "" -"If *flag* has another value, then the status of the newsgroup should be " -"considered unknown." -msgstr "" - -#: ../../library/nntplib.rst:345 -msgid "" -"This command can return very large results, especially if *group_pattern* is " -"not specified. It is best to cache the results offline unless you really " -"need to refresh them." -msgstr "" - -#: ../../library/nntplib.rst:349 -msgid "*group_pattern* was added." -msgstr "新增 *group_pattern*。" - -#: ../../library/nntplib.rst:355 -msgid "" -"Send a ``LIST NEWSGROUPS`` command, where *grouppattern* is a wildmat string " -"as specified in :rfc:`3977` (it's essentially the same as DOS or UNIX shell " -"wildcard strings). Return a pair ``(response, descriptions)``, where " -"*descriptions* is a dictionary mapping group names to textual descriptions." -msgstr "" - -#: ../../library/nntplib.rst:369 -msgid "" -"Get a description for a single group *group*. If more than one group " -"matches (if 'group' is a real wildmat string), return the first match. If " -"no group matches, return an empty string." -msgstr "" - -#: ../../library/nntplib.rst:373 -msgid "" -"This elides the response code from the server. If the response code is " -"needed, use :meth:`descriptions`." -msgstr "" - -#: ../../library/nntplib.rst:379 -msgid "" -"Send a ``GROUP`` command, where *name* is the group name. The group is " -"selected as the current group, if it exists. Return a tuple ``(response, " -"count, first, last, name)`` where *count* is the (estimated) number of " -"articles in the group, *first* is the first article number in the group, " -"*last* is the last article number in the group, and *name* is the group name." -msgstr "" - -#: ../../library/nntplib.rst:389 -msgid "" -"Send an ``OVER`` command, or an ``XOVER`` command on legacy servers. " -"*message_spec* can be either a string representing a message id, or a " -"``(first, last)`` tuple of numbers indicating a range of articles in the " -"current group, or a ``(first, None)`` tuple indicating a range of articles " -"starting from *first* to the last article in the current group, or :const:" -"`None` to select the current article in the current group." -msgstr "" - -#: ../../library/nntplib.rst:396 -msgid "" -"Return a pair ``(response, overviews)``. *overviews* is a list of " -"``(article_number, overview)`` tuples, one for each article selected by " -"*message_spec*. Each *overview* is a dictionary with the same number of " -"items, but this number depends on the server. These items are either " -"message headers (the key is then the lower-cased header name) or metadata " -"items (the key is then the metadata name prepended with ``\":\"``). The " -"following items are guaranteed to be present by the NNTP specification:" -msgstr "" - -#: ../../library/nntplib.rst:404 -msgid "" -"the ``subject``, ``from``, ``date``, ``message-id`` and ``references`` " -"headers" -msgstr "" - -#: ../../library/nntplib.rst:406 -msgid "" -"the ``:bytes`` metadata: the number of bytes in the entire raw article " -"(including headers and body)" -msgstr "" - -#: ../../library/nntplib.rst:408 -msgid "the ``:lines`` metadata: the number of lines in the article body" -msgstr "" - -#: ../../library/nntplib.rst:410 -msgid "" -"The value of each item is either a string, or :const:`None` if not present." -msgstr "" - -#: ../../library/nntplib.rst:412 -msgid "" -"It is advisable to use the :func:`decode_header` function on header values " -"when they may contain non-ASCII characters::" -msgstr "" - -#: ../../library/nntplib.rst:415 -msgid "" -">>> _, _, first, last, _ = s.group('gmane.comp.python.devel')\n" -">>> resp, overviews = s.over((last, last))\n" -">>> art_num, over = overviews[0]\n" -">>> art_num\n" -"117216\n" -">>> list(over.keys())\n" -"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', " -"'subject']\n" -">>> over['from']\n" -"'=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= '\n" -">>> nntplib.decode_header(over['from'])\n" -"'\"Martin v. Löwis\" '" -msgstr "" -">>> _, _, first, last, _ = s.group('gmane.comp.python.devel')\n" -">>> resp, overviews = s.over((last, last))\n" -">>> art_num, over = overviews[0]\n" -">>> art_num\n" -"117216\n" -">>> list(over.keys())\n" -"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', " -"'subject']\n" -">>> over['from']\n" -"'=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= '\n" -">>> nntplib.decode_header(over['from'])\n" -"'\"Martin v. Löwis\" '" - -#: ../../library/nntplib.rst:432 -msgid "" -"Send a ``HELP`` command. Return a pair ``(response, list)`` where *list* is " -"a list of help strings." -msgstr "" - -#: ../../library/nntplib.rst:438 -msgid "" -"Send a ``STAT`` command, where *message_spec* is either a message id " -"(enclosed in ``'<'`` and ``'>'``) or an article number in the current group. " -"If *message_spec* is omitted or :const:`None`, the current article in the " -"current group is considered. Return a triple ``(response, number, id)`` " -"where *number* is the article number and *id* is the message id." -msgstr "" - -#: ../../library/nntplib.rst:452 -msgid "Send a ``NEXT`` command. Return as for :meth:`.stat`." -msgstr "" - -#: ../../library/nntplib.rst:457 -msgid "Send a ``LAST`` command. Return as for :meth:`.stat`." -msgstr "" - -#: ../../library/nntplib.rst:462 -msgid "" -"Send an ``ARTICLE`` command, where *message_spec* has the same meaning as " -"for :meth:`.stat`. Return a tuple ``(response, info)`` where *info* is a :" -"class:`~collections.namedtuple` with three attributes *number*, *message_id* " -"and *lines* (in that order). *number* is the article number in the group " -"(or 0 if the information is not available), *message_id* the message id as a " -"string, and *lines* a list of lines (without terminating newlines) " -"comprising the raw message including headers and body." -msgstr "" - -#: ../../library/nntplib.rst:487 -msgid "" -"Same as :meth:`article`, but sends a ``HEAD`` command. The *lines* returned " -"(or written to *file*) will only contain the message headers, not the body." -msgstr "" - -#: ../../library/nntplib.rst:494 -msgid "" -"Same as :meth:`article`, but sends a ``BODY`` command. The *lines* returned " -"(or written to *file*) will only contain the message body, not the headers." -msgstr "" - -#: ../../library/nntplib.rst:501 -msgid "" -"Post an article using the ``POST`` command. The *data* argument is either " -"a :term:`file object` opened for binary reading, or any iterable of bytes " -"objects (representing raw lines of the article to be posted). It should " -"represent a well-formed news article, including the required headers. The :" -"meth:`post` method automatically escapes lines beginning with ``.`` and " -"appends the termination line." -msgstr "" - -#: ../../library/nntplib.rst:508 -msgid "" -"If the method succeeds, the server's response is returned. If the server " -"refuses posting, a :class:`NNTPReplyError` is raised." -msgstr "" - -#: ../../library/nntplib.rst:514 -msgid "" -"Send an ``IHAVE`` command. *message_id* is the id of the message to send to " -"the server (enclosed in ``'<'`` and ``'>'``). The *data* parameter and the " -"return value are the same as for :meth:`post`." -msgstr "" - -#: ../../library/nntplib.rst:521 -msgid "" -"Return a pair ``(response, date)``. *date* is a :class:`~datetime.datetime` " -"object containing the current date and time of the server." -msgstr "" - -#: ../../library/nntplib.rst:527 -msgid "Send a ``SLAVE`` command. Return the server's *response*." -msgstr "" - -#: ../../library/nntplib.rst:532 -msgid "" -"Set the instance's debugging level. This controls the amount of debugging " -"output printed. The default, ``0``, produces no debugging output. A value " -"of ``1`` produces a moderate amount of debugging output, generally a single " -"line per request or response. A value of ``2`` or higher produces the " -"maximum amount of debugging output, logging each line sent and received on " -"the connection (including message text)." -msgstr "" - -#: ../../library/nntplib.rst:540 -msgid "" -"The following are optional NNTP extensions defined in :rfc:`2980`. Some of " -"them have been superseded by newer commands in :rfc:`3977`." -msgstr "" - -#: ../../library/nntplib.rst:546 -msgid "" -"Send an ``XHDR`` command. The *hdr* argument is a header keyword, e.g. " -"``'subject'``. The *str* argument should have the form ``'first-last'`` " -"where *first* and *last* are the first and last article numbers to search. " -"Return a pair ``(response, list)``, where *list* is a list of pairs ``(id, " -"text)``, where *id* is an article number (as a string) and *text* is the " -"text of the requested header for that article. If the *file* parameter is " -"supplied, then the output of the ``XHDR`` command is stored in a file. If " -"*file* is a string, then the method will open a file with that name, write " -"to it then close it. If *file* is a :term:`file object`, then it will start " -"calling :meth:`write` on it to store the lines of the command output. If " -"*file* is supplied, then the returned *list* is an empty list." -msgstr "" - -#: ../../library/nntplib.rst:561 -msgid "" -"Send an ``XOVER`` command. *start* and *end* are article numbers delimiting " -"the range of articles to select. The return value is the same of for :meth:" -"`over`. It is recommended to use :meth:`over` instead, since it will " -"automatically use the newer ``OVER`` command if available." -msgstr "" - -#: ../../library/nntplib.rst:569 -msgid "Utility functions" -msgstr "" - -#: ../../library/nntplib.rst:571 -msgid "The module also defines the following utility function:" -msgstr "" - -#: ../../library/nntplib.rst:576 +#: ../../library/nntplib.rst:10 msgid "" -"Decode a header value, un-escaping any escaped non-ASCII characters. " -"*header_str* must be a :class:`str` object. The unescaped value is " -"returned. Using this function is recommended to display some headers in a " -"human readable form::" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/nntplib.rst:581 +#: ../../library/nntplib.rst:14 msgid "" -">>> decode_header(\"Some subject\")\n" -"'Some subject'\n" -">>> decode_header(\"=?ISO-8859-15?Q?D=E9buter_en_Python?=\")\n" -"'Débuter en Python'\n" -">>> decode_header(\"Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=\")\n" -"'Re: problème de matrice'" -msgstr "" -">>> decode_header(\"Some subject\")\n" -"'Some subject'\n" -">>> decode_header(\"=?ISO-8859-15?Q?D=E9buter_en_Python?=\")\n" -"'Débuter en Python'\n" -">>> decode_header(\"Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=\")\n" -"'Re: problème de matrice'" - -#: ../../library/nntplib.rst:10 -msgid "NNTP" -msgstr "NNTP" - -#: ../../library/nntplib.rst:10 -msgid "protocol" -msgstr "protocol(協定)" - -#: ../../library/nntplib.rst:10 -msgid "Network News Transfer Protocol" -msgstr "Network News Transfer Protocol(網路新聞傳輸協定)" +"The last version of Python that provided the :mod:`!nntplib` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/nntplib.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/nntplib.py`" + +#~ msgid "" +#~ "The :mod:`nntplib` module is deprecated (see :pep:`594` for details)." +#~ msgstr ":mod:`nntlib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + +#~ msgid "" +#~ ">>> s = nntplib.NNTP('news.gmane.io')\n" +#~ ">>> resp, count, first, last, name = s.group('gmane.comp.python." +#~ "committers')\n" +#~ ">>> print('Group', name, 'has', count, 'articles, range', first, 'to', " +#~ "last)\n" +#~ "Group gmane.comp.python.committers has 1096 articles, range 1 to 1096\n" +#~ ">>> resp, overviews = s.over((last - 9, last))\n" +#~ ">>> for id, over in overviews:\n" +#~ "... print(id, nntplib.decode_header(over['subject']))\n" +#~ "...\n" +#~ "1087 Re: Commit privileges for Łukasz Langa\n" +#~ "1088 Re: 3.2 alpha 2 freeze\n" +#~ "1089 Re: 3.2 alpha 2 freeze\n" +#~ "1090 Re: Commit privileges for Łukasz Langa\n" +#~ "1091 Re: Commit privileges for Łukasz Langa\n" +#~ "1092 Updated ssh key\n" +#~ "1093 Re: Updated ssh key\n" +#~ "1094 Re: Updated ssh key\n" +#~ "1095 Hello fellow committers!\n" +#~ "1096 Re: Hello fellow committers!\n" +#~ ">>> s.quit()\n" +#~ "'205 Bye!'" +#~ msgstr "" +#~ ">>> s = nntplib.NNTP('news.gmane.io')\n" +#~ ">>> resp, count, first, last, name = s.group('gmane.comp.python." +#~ "committers')\n" +#~ ">>> print('Group', name, 'has', count, 'articles, range', first, 'to', " +#~ "last)\n" +#~ "Group gmane.comp.python.committers has 1096 articles, range 1 to 1096\n" +#~ ">>> resp, overviews = s.over((last - 9, last))\n" +#~ ">>> for id, over in overviews:\n" +#~ "... print(id, nntplib.decode_header(over['subject']))\n" +#~ "...\n" +#~ "1087 Re: Commit privileges for Łukasz Langa\n" +#~ "1088 Re: 3.2 alpha 2 freeze\n" +#~ "1089 Re: 3.2 alpha 2 freeze\n" +#~ "1090 Re: Commit privileges for Łukasz Langa\n" +#~ "1091 Re: Commit privileges for Łukasz Langa\n" +#~ "1092 Updated ssh key\n" +#~ "1093 Re: Updated ssh key\n" +#~ "1094 Re: Updated ssh key\n" +#~ "1095 Hello fellow committers!\n" +#~ "1096 Re: Hello fellow committers!\n" +#~ ">>> s.quit()\n" +#~ "'205 Bye!'" + +#~ msgid "" +#~ ">>> s = nntplib.NNTP('news.gmane.io')\n" +#~ ">>> f = open('article.txt', 'rb')\n" +#~ ">>> s.post(f)\n" +#~ "'240 Article posted successfully.'\n" +#~ ">>> s.quit()\n" +#~ "'205 Bye!'" +#~ msgstr "" +#~ ">>> s = nntplib.NNTP('news.gmane.io')\n" +#~ ">>> f = open('article.txt', 'rb')\n" +#~ ">>> s.post(f)\n" +#~ "'240 Article posted successfully.'\n" +#~ ">>> s.quit()\n" +#~ "'205 Bye!'" + +#~ msgid "" +#~ "Raises an :ref:`auditing event ` ``nntplib.connect`` with " +#~ "arguments ``self``, ``host``, ``port``." +#~ msgstr "" +#~ "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " +#~ "` ``nntplib.connect``。" + +#~ msgid "NNTP Objects" +#~ msgstr "NNTP 物件" + +#~ msgid "Attributes" +#~ msgstr "屬性" + +#~ msgid "Methods" +#~ msgstr "方法" + +#~ msgid "*group_pattern* was added." +#~ msgstr "新增 *group_pattern*。" + +#~ msgid "" +#~ ">>> _, _, first, last, _ = s.group('gmane.comp.python.devel')\n" +#~ ">>> resp, overviews = s.over((last, last))\n" +#~ ">>> art_num, over = overviews[0]\n" +#~ ">>> art_num\n" +#~ "117216\n" +#~ ">>> list(over.keys())\n" +#~ "['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', " +#~ "'subject']\n" +#~ ">>> over['from']\n" +#~ "'=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= '\n" +#~ ">>> nntplib.decode_header(over['from'])\n" +#~ "'\"Martin v. Löwis\" '" +#~ msgstr "" +#~ ">>> _, _, first, last, _ = s.group('gmane.comp.python.devel')\n" +#~ ">>> resp, overviews = s.over((last, last))\n" +#~ ">>> art_num, over = overviews[0]\n" +#~ ">>> art_num\n" +#~ "117216\n" +#~ ">>> list(over.keys())\n" +#~ "['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', " +#~ "'subject']\n" +#~ ">>> over['from']\n" +#~ "'=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= '\n" +#~ ">>> nntplib.decode_header(over['from'])\n" +#~ "'\"Martin v. Löwis\" '" + +#~ msgid "" +#~ ">>> decode_header(\"Some subject\")\n" +#~ "'Some subject'\n" +#~ ">>> decode_header(\"=?ISO-8859-15?Q?D=E9buter_en_Python?=\")\n" +#~ "'Débuter en Python'\n" +#~ ">>> decode_header(\"Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=\")\n" +#~ "'Re: problème de matrice'" +#~ msgstr "" +#~ ">>> decode_header(\"Some subject\")\n" +#~ "'Some subject'\n" +#~ ">>> decode_header(\"=?ISO-8859-15?Q?D=E9buter_en_Python?=\")\n" +#~ "'Débuter en Python'\n" +#~ ">>> decode_header(\"Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=\")\n" +#~ "'Re: problème de matrice'" + +#~ msgid "NNTP" +#~ msgstr "NNTP" + +#~ msgid "protocol" +#~ msgstr "protocol(協定)" + +#~ msgid "Network News Transfer Protocol" +#~ msgstr "Network News Transfer Protocol(網路新聞傳輸協定)" diff --git a/library/os.po b/library/os.po index 50610fbd60..ee33ceb55f 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,26 +351,26 @@ msgstr "" #: ../../library/os.rst:2592 ../../library/os.rst:2614 #: ../../library/os.rst:3322 ../../library/os.rst:3456 #: ../../library/os.rst:3479 ../../library/os.rst:3493 -#: ../../library/os.rst:3712 ../../library/os.rst:3737 -#: ../../library/os.rst:3762 ../../library/os.rst:3816 -#: ../../library/os.rst:3825 ../../library/os.rst:3834 -#: ../../library/os.rst:3842 ../../library/os.rst:3851 -#: ../../library/os.rst:3860 ../../library/os.rst:3932 -#: ../../library/os.rst:3995 ../../library/os.rst:4005 -#: ../../library/os.rst:4023 ../../library/os.rst:4032 -#: ../../library/os.rst:4042 ../../library/os.rst:4052 -#: ../../library/os.rst:4062 ../../library/os.rst:4073 -#: ../../library/os.rst:4218 ../../library/os.rst:4287 -#: ../../library/os.rst:4322 ../../library/os.rst:4330 -#: ../../library/os.rst:4337 ../../library/os.rst:4344 -#: ../../library/os.rst:4351 ../../library/os.rst:4358 -#: ../../library/os.rst:4365 ../../library/os.rst:4372 -#: ../../library/os.rst:4380 ../../library/os.rst:4388 -#: ../../library/os.rst:4395 ../../library/os.rst:4402 -#: ../../library/os.rst:4411 ../../library/os.rst:4419 -#: ../../library/os.rst:4427 ../../library/os.rst:4434 -#: ../../library/os.rst:4441 ../../library/os.rst:4490 -#: ../../library/os.rst:4517 ../../library/os.rst:4541 +#: ../../library/os.rst:3713 ../../library/os.rst:3738 +#: ../../library/os.rst:3763 ../../library/os.rst:3817 +#: ../../library/os.rst:3826 ../../library/os.rst:3835 +#: ../../library/os.rst:3843 ../../library/os.rst:3852 +#: ../../library/os.rst:3861 ../../library/os.rst:3933 +#: ../../library/os.rst:3996 ../../library/os.rst:4006 +#: ../../library/os.rst:4024 ../../library/os.rst:4033 +#: ../../library/os.rst:4043 ../../library/os.rst:4053 +#: ../../library/os.rst:4063 ../../library/os.rst:4074 +#: ../../library/os.rst:4219 ../../library/os.rst:4288 +#: ../../library/os.rst:4323 ../../library/os.rst:4331 +#: ../../library/os.rst:4338 ../../library/os.rst:4345 +#: ../../library/os.rst:4352 ../../library/os.rst:4359 +#: ../../library/os.rst:4366 ../../library/os.rst:4373 +#: ../../library/os.rst:4381 ../../library/os.rst:4389 +#: ../../library/os.rst:4396 ../../library/os.rst:4403 +#: ../../library/os.rst:4412 ../../library/os.rst:4420 +#: ../../library/os.rst:4428 ../../library/os.rst:4435 +#: ../../library/os.rst:4442 ../../library/os.rst:4491 +#: ../../library/os.rst:4518 ../../library/os.rst:4541 #: ../../library/os.rst:4557 ../../library/os.rst:4564 #: ../../library/os.rst:4575 ../../library/os.rst:4585 #: ../../library/os.rst:4594 ../../library/os.rst:4626 @@ -1519,8 +1519,8 @@ msgstr "" #: ../../library/os.rst:2759 ../../library/os.rst:3049 #: ../../library/os.rst:3336 ../../library/os.rst:3500 #: ../../library/os.rst:3516 ../../library/os.rst:3556 -#: ../../library/os.rst:3655 ../../library/os.rst:3716 -#: ../../library/os.rst:4113 ../../library/os.rst:4293 +#: ../../library/os.rst:3656 ../../library/os.rst:3717 +#: ../../library/os.rst:4114 ../../library/os.rst:4294 #: ../../library/os.rst:4859 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -3388,9 +3388,9 @@ msgid "" "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:3014 ../../library/os.rst:4092 -#: ../../library/os.rst:4108 ../../library/os.rst:4124 -#: ../../library/os.rst:4144 +#: ../../library/os.rst:3014 ../../library/os.rst:4093 +#: ../../library/os.rst:4109 ../../library/os.rst:4125 +#: ../../library/os.rst:4145 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." @@ -3410,7 +3410,7 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:3030 ../../library/os.rst:3799 +#: ../../library/os.rst:3030 ../../library/os.rst:3800 msgid "Example::" msgstr "範例: ::" @@ -4089,7 +4089,7 @@ msgid "" "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3621 ../../library/os.rst:3682 +#: ../../library/os.rst:3621 ../../library/os.rst:3683 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 " @@ -4126,10 +4126,11 @@ msgid "" " for name in files:\n" " os.remove(os.path.join(root, name))\n" " for name in dirs:\n" -" os.rmdir(os.path.join(root, name))" +" os.rmdir(os.path.join(root, name))\n" +"os.rmdir(top)" msgstr "" -#: ../../library/os.rst:3649 +#: ../../library/os.rst:3650 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -4137,25 +4138,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3651 +#: ../../library/os.rst:3652 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:3665 +#: ../../library/os.rst:3666 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:3668 +#: ../../library/os.rst:3669 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:3671 +#: ../../library/os.rst:3672 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4163,14 +4164,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3678 +#: ../../library/os.rst:3679 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:3686 +#: ../../library/os.rst:3687 msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):\n" @@ -4182,13 +4183,13 @@ msgid "" " dirs.remove('CVS') # don't visit CVS directories" msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3696 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::" msgstr "" -#: ../../library/os.rst:3699 +#: ../../library/os.rst:3700 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4202,7 +4203,7 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: ../../library/os.rst:3710 +#: ../../library/os.rst:3711 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4210,11 +4211,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3719 +#: ../../library/os.rst:3720 msgid "Added support for :class:`bytes` paths." msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3725 +#: ../../library/os.rst:3726 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 " @@ -4222,7 +4223,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3730 +#: ../../library/os.rst:3731 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/" @@ -4232,15 +4233,15 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3760 +#: ../../library/os.rst:3761 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3764 +#: ../../library/os.rst:3765 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3771 +#: ../../library/os.rst:3772 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." @@ -4249,7 +4250,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3777 +#: ../../library/os.rst:3778 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be a 32 bit unsigned integer. Please note that the initial value is limited " @@ -4257,39 +4258,39 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3782 +#: ../../library/os.rst:3783 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3785 +#: ../../library/os.rst:3786 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:3788 +#: ../../library/os.rst:3789 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:3792 +#: ../../library/os.rst:3793 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3795 +#: ../../library/os.rst:3796 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:3801 +#: ../../library/os.rst:3802 msgid "" "import os\n" "\n" @@ -4307,64 +4308,64 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3822 +#: ../../library/os.rst:3823 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:3831 +#: ../../library/os.rst:3832 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:3840 +#: ../../library/os.rst:3841 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3848 +#: ../../library/os.rst:3849 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3858 msgid "" "Provide semaphore-like semantics for reads from an :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3868 +#: ../../library/os.rst:3869 msgid "Timer File Descriptors" msgstr "" -#: ../../library/os.rst:3872 +#: ../../library/os.rst:3873 msgid "" "These functions provide support for Linux's *timer file descriptor* API. " "Naturally, they are all only available on Linux." msgstr "" -#: ../../library/os.rst:3877 +#: ../../library/os.rst:3878 msgid "Create and return a timer file descriptor (*timerfd*)." msgstr "" -#: ../../library/os.rst:3879 +#: ../../library/os.rst:3880 msgid "The file descriptor returned by :func:`timerfd_create` supports:" msgstr "" -#: ../../library/os.rst:3881 +#: ../../library/os.rst:3882 msgid ":func:`read`" msgstr "" -#: ../../library/os.rst:3882 +#: ../../library/os.rst:3883 msgid ":func:`~select.select`" msgstr "" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3884 msgid ":func:`~select.poll`" msgstr "" -#: ../../library/os.rst:3885 +#: ../../library/os.rst:3886 msgid "" "The file descriptor's :func:`read` method can be called with a buffer size " "of 8. If the timer has already expired one or more times, :func:`read` " @@ -4373,32 +4374,32 @@ msgid "" "byteorder)``." msgstr "" -#: ../../library/os.rst:3890 +#: ../../library/os.rst:3891 msgid "" ":func:`~select.select` and :func:`~select.poll` can be used to wait until " "timer expires and the file descriptor is readable." msgstr "" -#: ../../library/os.rst:3893 +#: ../../library/os.rst:3894 msgid "" "*clockid* must be a valid :ref:`clock ID `, as " "defined in the :py:mod:`time` module:" msgstr "" -#: ../../library/os.rst:3896 +#: ../../library/os.rst:3897 #, fuzzy msgid ":const:`time.CLOCK_REALTIME`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:3897 +#: ../../library/os.rst:3898 msgid ":const:`time.CLOCK_MONOTONIC`" msgstr "" -#: ../../library/os.rst:3898 +#: ../../library/os.rst:3899 msgid ":const:`time.CLOCK_BOOTTIME` (Since Linux 3.15 for timerfd_create)" msgstr "" -#: ../../library/os.rst:3900 +#: ../../library/os.rst:3901 msgid "" "If *clockid* is :const:`time.CLOCK_REALTIME`, a settable system-wide real-" "time clock is used. If system clock is changed, timer setting need to be " @@ -4406,37 +4407,37 @@ msgid "" "`TFD_TIMER_CANCEL_ON_SET`." msgstr "" -#: ../../library/os.rst:3905 +#: ../../library/os.rst:3906 msgid "" "If *clockid* is :const:`time.CLOCK_MONOTONIC`, a non-settable monotonically " "increasing clock is used. Even if the system clock is changed, the timer " "setting will not be affected." msgstr "" -#: ../../library/os.rst:3909 +#: ../../library/os.rst:3910 msgid "" "If *clockid* is :const:`time.CLOCK_BOOTTIME`, same as :const:`time." "CLOCK_MONOTONIC` except it includes any time that the system is suspended." msgstr "" -#: ../../library/os.rst:3912 +#: ../../library/os.rst:3913 msgid "" "The file descriptor's behaviour can be modified by specifying a *flags* " "value. Any of the following variables may used, combined using bitwise OR " "(the ``|`` operator):" msgstr "" -#: ../../library/os.rst:3916 +#: ../../library/os.rst:3917 #, fuzzy msgid ":const:`TFD_NONBLOCK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:3917 +#: ../../library/os.rst:3918 #, fuzzy msgid ":const:`TFD_CLOEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:3919 +#: ../../library/os.rst:3920 msgid "" "If :const:`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks until the " "timer expires. If it is set as a flag, :func:`read` doesn't block, but If " @@ -4444,49 +4445,49 @@ msgid "" "raises :class:`OSError` with ``errno`` is set to :const:`errno.EAGAIN`." msgstr "" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3926 msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." msgstr "" -#: ../../library/os.rst:3927 +#: ../../library/os.rst:3928 msgid "" "The file descriptor must be closed with :func:`os.close` when it is no " "longer needed, or else the file descriptor will be leaked." msgstr "" -#: ../../library/os.rst:3930 +#: ../../library/os.rst:3931 #, fuzzy msgid "The :manpage:`timerfd_create(2)` man page." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3939 +#: ../../library/os.rst:3940 msgid "" "Alter a timer file descriptor's internal timer. This function operates the " "same interval timer as :func:`timerfd_settime_ns`." msgstr "" -#: ../../library/os.rst:3942 +#: ../../library/os.rst:3943 msgid "*fd* must be a valid timer file descriptor." msgstr "" -#: ../../library/os.rst:3944 +#: ../../library/os.rst:3945 msgid "" "The timer's behaviour can be modified by specifying a *flags* value. Any of " "the following variables may used, combined using bitwise OR (the ``|`` " "operator):" msgstr "" -#: ../../library/os.rst:3948 +#: ../../library/os.rst:3949 #, fuzzy msgid ":const:`TFD_TIMER_ABSTIME`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:3949 +#: ../../library/os.rst:3950 #, fuzzy msgid ":const:`TFD_TIMER_CANCEL_ON_SET`" msgstr ":const:`SEEK_SET`" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3952 msgid "" "The timer is disabled by setting *initial* to zero (``0``). If *initial* is " "equal to or greater than zero, the timer is enabled. If *initial* is less " @@ -4494,20 +4495,20 @@ msgid "" "const:`errno.EINVAL`" msgstr "" -#: ../../library/os.rst:3956 +#: ../../library/os.rst:3957 msgid "" "By default the timer will fire when *initial* seconds have elapsed. (If " "*initial* is zero, timer will fire immediately.)" msgstr "" -#: ../../library/os.rst:3959 +#: ../../library/os.rst:3960 msgid "" "However, if the :const:`TFD_TIMER_ABSTIME` flag is set, the timer will fire " "when the timer's clock (set by *clockid* in :func:`timerfd_create`) reaches " "*initial* seconds." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3964 msgid "" "The timer's interval is set by the *interval* :py:class:`float`. If " "*interval* is zero, the timer only fires once, on the initial expiration. If " @@ -4517,7 +4518,7 @@ msgid "" "EINVAL`" msgstr "" -#: ../../library/os.rst:3970 +#: ../../library/os.rst:3971 msgid "" "If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along with :const:" "`TFD_TIMER_ABSTIME` and the clock for this timer is :const:`time." @@ -4526,86 +4527,86 @@ msgid "" "ECANCELED." msgstr "" -#: ../../library/os.rst:3976 +#: ../../library/os.rst:3977 msgid "" "Linux manages system clock as UTC. A daylight-savings time transition is " "done by changing time offset only and doesn't cause discontinuous system " "clock change." msgstr "" -#: ../../library/os.rst:3980 +#: ../../library/os.rst:3981 msgid "" "Discontinuous system clock change will be caused by the following events:" msgstr "" -#: ../../library/os.rst:3982 +#: ../../library/os.rst:3983 msgid "``settimeofday``" msgstr "" -#: ../../library/os.rst:3983 +#: ../../library/os.rst:3984 msgid "``clock_settime``" msgstr "" -#: ../../library/os.rst:3984 +#: ../../library/os.rst:3985 msgid "set the system date and time by ``date`` command" msgstr "" -#: ../../library/os.rst:3986 +#: ../../library/os.rst:3987 msgid "" "Return a two-item tuple of (``next_expiration``, ``interval``) from the " "previous timer state, before this function executed." msgstr "" -#: ../../library/os.rst:3991 +#: ../../library/os.rst:3992 msgid "" ":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" "`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." msgstr "" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:4003 msgid "" "Similar to :func:`timerfd_settime`, but use time as nanoseconds. This " "function operates the same interval timer as :func:`timerfd_settime`." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4013 msgid "Return a two-item tuple of floats (``next_expiration``, ``interval``)." msgstr "" -#: ../../library/os.rst:4014 +#: ../../library/os.rst:4015 msgid "" "``next_expiration`` denotes the relative time until next the timer next " "fires, regardless of if the :const:`TFD_TIMER_ABSTIME` flag is set." msgstr "" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4018 msgid "" "``interval`` denotes the timer's interval. If zero, the timer will only fire " "once, after ``next_expiration`` seconds have elapsed." msgstr "" -#: ../../library/os.rst:4021 +#: ../../library/os.rst:4022 msgid ":manpage:`timerfd_gettime(2)`" msgstr "" -#: ../../library/os.rst:4030 +#: ../../library/os.rst:4031 msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." msgstr "" -#: ../../library/os.rst:4038 +#: ../../library/os.rst:4039 msgid "" "A flag for the :func:`timerfd_create` function, which sets the :const:" "`O_NONBLOCK` status flag for the new timer file descriptor. If :const:" "`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." msgstr "" -#: ../../library/os.rst:4048 +#: ../../library/os.rst:4049 msgid "" "A flag for the :func:`timerfd_create` function, If :const:`TFD_CLOEXEC` is " "set as a flag, set close-on-exec flag for new file descriptor." msgstr "" -#: ../../library/os.rst:4058 +#: ../../library/os.rst:4059 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions. If this flag is set, *initial* is interpreted as an absolute " @@ -4613,22 +4614,22 @@ msgid "" "Epoch)." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4069 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions along with :const:`TFD_TIMER_ABSTIME`. The timer is cancelled when " "the time of the underlying clock changes discontinuously." msgstr "" -#: ../../library/os.rst:4079 +#: ../../library/os.rst:4080 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:4083 +#: ../../library/os.rst:4084 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:4087 +#: ../../library/os.rst:4088 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4636,7 +4637,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:4095 +#: ../../library/os.rst:4096 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4644,12 +4645,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:4097 ../../library/os.rst:4129 -#: ../../library/os.rst:4154 +#: ../../library/os.rst:4098 ../../library/os.rst:4130 +#: ../../library/os.rst:4155 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:4103 +#: ../../library/os.rst:4104 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4657,14 +4658,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:4111 +#: ../../library/os.rst:4112 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:4119 +#: ../../library/os.rst:4120 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4672,7 +4673,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:4127 +#: ../../library/os.rst:4128 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4680,7 +4681,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:4135 +#: ../../library/os.rst:4136 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4692,13 +4693,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:4149 +#: ../../library/os.rst:4150 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:4152 +#: ../../library/os.rst:4153 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4706,33 +4707,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:4160 +#: ../../library/os.rst:4161 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:4166 +#: ../../library/os.rst:4167 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:4172 +#: ../../library/os.rst:4173 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:4179 +#: ../../library/os.rst:4180 msgid "Process Management" msgstr "行程管理" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4182 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:4183 +#: ../../library/os.rst:4184 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 " @@ -4743,7 +4744,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4195 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 " @@ -4752,31 +4753,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:4203 +#: ../../library/os.rst:4204 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4206 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:4209 +#: ../../library/os.rst:4210 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:4212 +#: ../../library/os.rst:4213 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:4216 +#: ../../library/os.rst:4217 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4784,7 +4785,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4221 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4792,14 +4793,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:4227 +#: ../../library/os.rst:4228 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:4242 +#: ../../library/os.rst:4243 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 " @@ -4807,7 +4808,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4248 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 " @@ -4815,7 +4816,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:4253 +#: ../../library/os.rst:4254 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4828,7 +4829,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:4262 +#: ../../library/os.rst:4263 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4842,7 +4843,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4274 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 " @@ -4852,7 +4853,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:4280 +#: ../../library/os.rst:4281 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 " @@ -4861,7 +4862,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4286 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4869,25 +4870,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4289 +#: ../../library/os.rst:4290 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4298 +#: ../../library/os.rst:4299 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4303 +#: ../../library/os.rst:4304 msgid "" "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:4306 +#: ../../library/os.rst:4307 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 " @@ -4895,139 +4896,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4312 +#: ../../library/os.rst:4313 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:4319 +#: ../../library/os.rst:4320 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:4327 +#: ../../library/os.rst:4328 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4336 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4343 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4349 +#: ../../library/os.rst:4350 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4357 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4370 +#: ../../library/os.rst:4371 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4377 +#: ../../library/os.rst:4378 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:4385 +#: ../../library/os.rst:4386 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:4393 +#: ../../library/os.rst:4394 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4400 +#: ../../library/os.rst:4401 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4408 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:4416 +#: ../../library/os.rst:4417 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4424 +#: ../../library/os.rst:4425 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:4432 +#: ../../library/os.rst:4433 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4439 +#: ../../library/os.rst:4440 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4446 +#: ../../library/os.rst:4447 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:4449 +#: ../../library/os.rst:4450 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4452 +#: ../../library/os.rst:4453 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4456 +#: ../../library/os.rst:4457 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4461 ../../library/os.rst:4505 +#: ../../library/os.rst:4462 ../../library/os.rst:4506 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4465 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4468 +#: ../../library/os.rst:4469 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: ../../library/os.rst:4472 +#: ../../library/os.rst:4473 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -5038,21 +5039,21 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4481 +#: ../../library/os.rst:4482 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: ../../library/os.rst:4485 +#: ../../library/os.rst:4486 msgid "" "See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4496 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, " @@ -5061,39 +5062,38 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4501 +#: ../../library/os.rst:4502 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4508 +#: ../../library/os.rst:4509 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4512 +#: ../../library/os.rst:4513 msgid "" "If Python is able to detect that your process has multiple threads, this now " "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -#: ../../library/os.rst:4526 +#: ../../library/os.rst:4527 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:4529 +#: ../../library/os.rst:4530 msgid "" "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." +"be set to *sig*." msgstr "" #: ../../library/os.rst:4537 @@ -6526,7 +6526,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4522 ../../library/os.rst:4549 +#: ../../library/os.rst:4523 ../../library/os.rst:4549 msgid "process" msgstr "process" @@ -6580,7 +6580,7 @@ msgstr "pty" #: ../../library/os.rst:2045 ../../library/os.rst:2457 #: ../../library/os.rst:2658 ../../library/os.rst:3562 -#: ../../library/os.rst:3661 +#: ../../library/os.rst:3662 msgid "directory" msgstr "directory(目錄)" @@ -6604,19 +6604,19 @@ msgstr "以及 os.makedirs()" msgid "stat" msgstr "stat" -#: ../../library/os.rst:3562 ../../library/os.rst:3661 +#: ../../library/os.rst:3562 ../../library/os.rst:3662 msgid "walking" msgstr "" -#: ../../library/os.rst:3562 ../../library/os.rst:3661 +#: ../../library/os.rst:3562 ../../library/os.rst:3662 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4522 ../../library/os.rst:4549 +#: ../../library/os.rst:4523 ../../library/os.rst:4549 msgid "killing" msgstr "" -#: ../../library/os.rst:4522 ../../library/os.rst:4549 +#: ../../library/os.rst:4523 ../../library/os.rst:4549 msgid "signalling" msgstr "signalling(信號)" diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po index 4daa2201eb..ba87ddd325 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2022-05-22 02:10+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,584 +20,95 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/ossaudiodev.rst:2 -msgid ":mod:`ossaudiodev` --- Access to OSS-compatible audio devices" +#, fuzzy +msgid ":mod:`!ossaudiodev` --- Access to OSS-compatible audio devices" msgstr ":mod:`ossaudiodev` --- 對 OSS 相容聲音裝置的存取" -#: ../../library/ossaudiodev.rst:9 +#: ../../library/ossaudiodev.rst:10 msgid "" -"The :mod:`ossaudiodev` module is deprecated (see :pep:`PEP 594 " -"<594#ossaudiodev>` for details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`ossaudiodev` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " -"<594#ossaudiodev>`\\ )。" -#: ../../library/ossaudiodev.rst:15 +#: ../../library/ossaudiodev.rst:14 msgid "" -"This module allows you to access the OSS (Open Sound System) audio " -"interface. OSS is available for a wide range of open-source and commercial " -"Unices, and is the standard audio interface for Linux and recent versions of " -"FreeBSD." +"The last version of Python that provided the :mod:`!ossaudiodev` module was " +"`Python 3.12 `_." msgstr "" -#: ../../library/ossaudiodev.rst:47 -msgid "" -"Operations in this module now raise :exc:`OSError` where :exc:`IOError` was " -"raised." -msgstr "" - -#: ../../library/ossaudiodev.rst:54 -msgid "" -"`Open Sound System Programmer's Guide `_" -msgstr "" - -#: ../../library/ossaudiodev.rst:55 -msgid "the official documentation for the OSS C API" -msgstr "" - -#: ../../library/ossaudiodev.rst:57 -msgid "" -"The module defines a large number of constants supplied by the OSS device " -"driver; see ```` on either Linux or FreeBSD for a listing." -msgstr "" - -#: ../../library/ossaudiodev.rst:60 -msgid ":mod:`ossaudiodev` defines the following variables and functions:" -msgstr "" - -#: ../../library/ossaudiodev.rst:65 -msgid "" -"This exception is raised on certain errors. The argument is a string " -"describing what went wrong." -msgstr "" - -#: ../../library/ossaudiodev.rst:68 -msgid "" -"(If :mod:`ossaudiodev` receives an error from a system call such as :c:func:" -"`open`, :c:func:`write`, or :c:func:`ioctl`, it raises :exc:`OSError`. " -"Errors detected directly by :mod:`ossaudiodev` result in :exc:" -"`OSSAudioError`.)" -msgstr "" - -#: ../../library/ossaudiodev.rst:72 -msgid "" -"(For backwards compatibility, the exception class is also available as " -"``ossaudiodev.error``.)" -msgstr "" - -#: ../../library/ossaudiodev.rst:79 -msgid "" -"Open an audio device and return an OSS audio device object. This object " -"supports many file-like methods, such as :meth:`read`, :meth:`write`, and :" -"meth:`fileno` (although there are subtle differences between conventional " -"Unix read/write semantics and those of OSS audio devices). It also supports " -"a number of audio-specific methods; see below for the complete list of " -"methods." -msgstr "" - -#: ../../library/ossaudiodev.rst:85 -msgid "" -"*device* is the audio device filename to use. If it is not specified, this " -"module first looks in the environment variable :envvar:`AUDIODEV` for a " -"device to use. If not found, it falls back to :file:`/dev/dsp`." -msgstr "" - -#: ../../library/ossaudiodev.rst:89 -msgid "" -"*mode* is one of ``'r'`` for read-only (record) access, ``'w'`` for write-" -"only (playback) access and ``'rw'`` for both. Since many sound cards only " -"allow one process to have the recorder or player open at a time, it is a " -"good idea to open the device only for the activity needed. Further, some " -"sound cards are half-duplex: they can be opened for reading or writing, but " -"not both at once." -msgstr "" - -#: ../../library/ossaudiodev.rst:96 -msgid "" -"Note the unusual calling syntax: the *first* argument is optional, and the " -"second is required. This is a historical artifact for compatibility with " -"the older :mod:`linuxaudiodev` module which :mod:`ossaudiodev` supersedes." -msgstr "" - -#: ../../library/ossaudiodev.rst:107 -msgid "" -"Open a mixer device and return an OSS mixer device object. *device* is the " -"mixer device filename to use. If it is not specified, this module first " -"looks in the environment variable :envvar:`MIXERDEV` for a device to use. " -"If not found, it falls back to :file:`/dev/mixer`." -msgstr "" - -#: ../../library/ossaudiodev.rst:116 -msgid "Audio Device Objects" -msgstr "" - -#: ../../library/ossaudiodev.rst:118 -msgid "" -"Before you can write to or read from an audio device, you must call three " -"methods in the correct order:" -msgstr "" - -#: ../../library/ossaudiodev.rst:121 -msgid ":meth:`setfmt` to set the output format" -msgstr "" - -#: ../../library/ossaudiodev.rst:123 -msgid ":meth:`channels` to set the number of channels" -msgstr "" - -#: ../../library/ossaudiodev.rst:125 -msgid ":meth:`speed` to set the sample rate" -msgstr "" - -#: ../../library/ossaudiodev.rst:127 -msgid "" -"Alternately, you can use the :meth:`setparameters` method to set all three " -"audio parameters at once. This is more convenient, but may not be as " -"flexible in all cases." -msgstr "" - -#: ../../library/ossaudiodev.rst:131 -msgid "" -"The audio device objects returned by :func:`.open` define the following " -"methods and (read-only) attributes:" -msgstr "" - -#: ../../library/ossaudiodev.rst:137 -msgid "" -"Explicitly close the audio device. When you are done writing to or reading " -"from an audio device, you should explicitly close it. A closed device " -"cannot be used again." -msgstr "" - -#: ../../library/ossaudiodev.rst:144 -msgid "Return the file descriptor associated with the device." -msgstr "" - -#: ../../library/ossaudiodev.rst:149 -msgid "" -"Read *size* bytes from the audio input and return them as a Python string. " -"Unlike most Unix device drivers, OSS audio devices in blocking mode (the " -"default) will block :func:`read` until the entire requested amount of data " -"is available." -msgstr "" - -#: ../../library/ossaudiodev.rst:157 -msgid "" -"Write a :term:`bytes-like object` *data* to the audio device and return the " -"number of bytes written. If the audio device is in blocking mode (the " -"default), the entire data is always written (again, this is different from " -"usual Unix device semantics). If the device is in non-blocking mode, some " -"data may not be written---see :meth:`writeall`." -msgstr "" - -#: ../../library/ossaudiodev.rst:163 ../../library/ossaudiodev.rst:177 -msgid "Writable :term:`bytes-like object` is now accepted." -msgstr "" - -#: ../../library/ossaudiodev.rst:169 -msgid "" -"Write a :term:`bytes-like object` *data* to the audio device: waits until " -"the audio device is able to accept data, writes as much data as it will " -"accept, and repeats until *data* has been completely written. If the device " -"is in blocking mode (the default), this has the same effect as :meth:" -"`write`; :meth:`writeall` is only useful in non-blocking mode. Has no " -"return value, since the amount of data written is always equal to the amount " -"of data supplied." -msgstr "" - -#: ../../library/ossaudiodev.rst:181 -msgid "" -"Audio device objects also support the context management protocol, i.e. they " -"can be used in a :keyword:`with` statement." -msgstr "" - -#: ../../library/ossaudiodev.rst:186 -msgid "" -"The following methods each map to exactly one :c:func:`ioctl` system call. " -"The correspondence is obvious: for example, :meth:`setfmt` corresponds to " -"the ``SNDCTL_DSP_SETFMT`` ioctl, and :meth:`sync` to ``SNDCTL_DSP_SYNC`` " -"(this can be useful when consulting the OSS documentation). If the " -"underlying :c:func:`ioctl` fails, they all raise :exc:`OSError`." -msgstr "" - -#: ../../library/ossaudiodev.rst:195 -msgid "" -"Put the device into non-blocking mode. Once in non-blocking mode, there is " -"no way to return it to blocking mode." -msgstr "" +#~ msgid "" +#~ "The :mod:`ossaudiodev` module is deprecated (see :pep:`PEP 594 " +#~ "<594#ossaudiodev>` for details)." +#~ msgstr "" +#~ ":mod:`ossaudiodev` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#ossaudiodev>`\\ )。" -#: ../../library/ossaudiodev.rst:201 -msgid "" -"Return a bitmask of the audio output formats supported by the soundcard. " -"Some of the formats supported by OSS are:" -msgstr "" +#~ msgid "Format" +#~ msgstr "格式" -#: ../../library/ossaudiodev.rst:205 -msgid "Format" -msgstr "格式" +#~ msgid "Description" +#~ msgstr "描述" -#: ../../library/ossaudiodev.rst:205 ../../library/ossaudiodev.rst:259 -msgid "Description" -msgstr "描述" +#~ msgid ":const:`AFMT_MU_LAW`" +#~ msgstr ":const:`AFMT_MU_LAW`" -#: ../../library/ossaudiodev.rst:207 -msgid ":const:`AFMT_MU_LAW`" -msgstr ":const:`AFMT_MU_LAW`" +#~ msgid ":const:`AFMT_A_LAW`" +#~ msgstr ":const:`AFMT_A_LAW`" -#: ../../library/ossaudiodev.rst:207 -msgid "" -"a logarithmic encoding (used by Sun ``.au`` files and :file:`/dev/audio`)" -msgstr "" - -#: ../../library/ossaudiodev.rst:210 -msgid ":const:`AFMT_A_LAW`" -msgstr ":const:`AFMT_A_LAW`" - -#: ../../library/ossaudiodev.rst:210 -msgid "a logarithmic encoding" -msgstr "" +#~ msgid ":const:`AFMT_IMA_ADPCM`" +#~ msgstr ":const:`AFMT_IMA_ADPCM`" -#: ../../library/ossaudiodev.rst:212 -msgid ":const:`AFMT_IMA_ADPCM`" -msgstr ":const:`AFMT_IMA_ADPCM`" - -#: ../../library/ossaudiodev.rst:212 -msgid "" -"a 4:1 compressed format defined by the Interactive Multimedia Association" -msgstr "" - -#: ../../library/ossaudiodev.rst:215 -msgid ":const:`AFMT_U8`" -msgstr ":const:`AFMT_U8`" - -#: ../../library/ossaudiodev.rst:215 -msgid "Unsigned, 8-bit audio" -msgstr "" +#~ msgid ":const:`AFMT_U8`" +#~ msgstr ":const:`AFMT_U8`" -#: ../../library/ossaudiodev.rst:217 -msgid ":const:`AFMT_S16_LE`" -msgstr ":const:`AFMT_S16_LE`" +#~ msgid ":const:`AFMT_S16_LE`" +#~ msgstr ":const:`AFMT_S16_LE`" -#: ../../library/ossaudiodev.rst:217 -msgid "" -"Signed, 16-bit audio, little-endian byte order (as used by Intel processors)" -msgstr "" +#~ msgid ":const:`AFMT_S16_BE`" +#~ msgstr ":const:`AFMT_S16_BE`" -#: ../../library/ossaudiodev.rst:220 -msgid ":const:`AFMT_S16_BE`" -msgstr ":const:`AFMT_S16_BE`" +#~ msgid ":const:`AFMT_S8`" +#~ msgstr ":const:`AFMT_S8`" -#: ../../library/ossaudiodev.rst:220 -msgid "" -"Signed, 16-bit audio, big-endian byte order (as used by 68k, PowerPC, Sparc)" -msgstr "" +#~ msgid ":const:`AFMT_U16_LE`" +#~ msgstr ":const:`AFMT_U16_LE`" -#: ../../library/ossaudiodev.rst:223 -msgid ":const:`AFMT_S8`" -msgstr ":const:`AFMT_S8`" +#~ msgid ":const:`AFMT_U16_BE`" +#~ msgstr ":const:`AFMT_U16_BE`" -#: ../../library/ossaudiodev.rst:223 -msgid "Signed, 8 bit audio" -msgstr "" +#~ msgid "8000" +#~ msgstr "8000" -#: ../../library/ossaudiodev.rst:225 -msgid ":const:`AFMT_U16_LE`" -msgstr ":const:`AFMT_U16_LE`" +#~ msgid "11025" +#~ msgstr "11025" -#: ../../library/ossaudiodev.rst:225 -msgid "Unsigned, 16-bit little-endian audio" -msgstr "" +#~ msgid "22050" +#~ msgstr "22050" -#: ../../library/ossaudiodev.rst:227 -msgid ":const:`AFMT_U16_BE`" -msgstr ":const:`AFMT_U16_BE`" +#~ msgid "44100" +#~ msgstr "44100" -#: ../../library/ossaudiodev.rst:227 -msgid "Unsigned, 16-bit big-endian audio" -msgstr "" +#~ msgid "96000" +#~ msgstr "96000" -#: ../../library/ossaudiodev.rst:230 -msgid "" -"Consult the OSS documentation for a full list of audio formats, and note " -"that most devices support only a subset of these formats. Some older " -"devices only support :const:`AFMT_U8`; the most common format used today is :" -"const:`AFMT_S16_LE`." -msgstr "" +#~ msgid "For example, ::" +#~ msgstr "舉例來說: ::" -#: ../../library/ossaudiodev.rst:238 -msgid "" -"Try to set the current audio format to *format*---see :meth:`getfmts` for a " -"list. Returns the audio format that the device was set to, which may not be " -"the requested format. May also be used to return the current audio format---" -"do this by passing an \"audio format\" of :const:`AFMT_QUERY`." -msgstr "" +#~ msgid "(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)" +#~ msgstr "(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)" -#: ../../library/ossaudiodev.rst:246 -msgid "" -"Set the number of output channels to *nchannels*. A value of 1 indicates " -"monophonic sound, 2 stereophonic. Some devices may have more than 2 " -"channels, and some high-end devices may not support mono. Returns the number " -"of channels the device was set to." -msgstr "" +#~ msgid "is equivalent to ::" +#~ msgstr "等價於: ::" -#: ../../library/ossaudiodev.rst:254 -msgid "" -"Try to set the audio sampling rate to *samplerate* samples per second. " -"Returns the rate actually set. Most sound devices don't support arbitrary " -"sampling rates. Common rates are:" -msgstr "" - -#: ../../library/ossaudiodev.rst:259 -msgid "Rate" -msgstr "" - -#: ../../library/ossaudiodev.rst:261 -msgid "8000" -msgstr "8000" - -#: ../../library/ossaudiodev.rst:261 -msgid "default rate for :file:`/dev/audio`" -msgstr "" - -#: ../../library/ossaudiodev.rst:263 -msgid "11025" -msgstr "11025" - -#: ../../library/ossaudiodev.rst:263 -msgid "speech recording" -msgstr "" - -#: ../../library/ossaudiodev.rst:265 -msgid "22050" -msgstr "22050" - -#: ../../library/ossaudiodev.rst:267 -msgid "44100" -msgstr "44100" - -#: ../../library/ossaudiodev.rst:267 -msgid "CD quality audio (at 16 bits/sample and 2 channels)" -msgstr "" - -#: ../../library/ossaudiodev.rst:270 -msgid "96000" -msgstr "96000" - -#: ../../library/ossaudiodev.rst:270 -msgid "DVD quality audio (at 24 bits/sample)" -msgstr "" - -#: ../../library/ossaudiodev.rst:276 -msgid "" -"Wait until the sound device has played every byte in its buffer. (This " -"happens implicitly when the device is closed.) The OSS documentation " -"recommends closing and re-opening the device rather than using :meth:`sync`." -msgstr "" - -#: ../../library/ossaudiodev.rst:283 -msgid "" -"Immediately stop playing or recording and return the device to a state where " -"it can accept commands. The OSS documentation recommends closing and re-" -"opening the device after calling :meth:`reset`." -msgstr "" - -#: ../../library/ossaudiodev.rst:290 -msgid "" -"Tell the driver that there is likely to be a pause in the output, making it " -"possible for the device to handle the pause more intelligently. You might " -"use this after playing a spot sound effect, before waiting for user input, " -"or before doing disk I/O." -msgstr "" - -#: ../../library/ossaudiodev.rst:295 -msgid "" -"The following convenience methods combine several ioctls, or one ioctl and " -"some simple calculations." -msgstr "" - -#: ../../library/ossaudiodev.rst:301 -msgid "" -"Set the key audio sampling parameters---sample format, number of channels, " -"and sampling rate---in one method call. *format*, *nchannels*, and " -"*samplerate* should be as specified in the :meth:`setfmt`, :meth:`channels`, " -"and :meth:`speed` methods. If *strict* is true, :meth:`setparameters` " -"checks to see if each parameter was actually set to the requested value, and " -"raises :exc:`OSSAudioError` if not. Returns a tuple (*format*, *nchannels*, " -"*samplerate*) indicating the parameter values that were actually set by the " -"device driver (i.e., the same as the return values of :meth:`setfmt`, :meth:" -"`channels`, and :meth:`speed`)." -msgstr "" - -#: ../../library/ossaudiodev.rst:311 -msgid "For example, ::" -msgstr "舉例來說: ::" - -#: ../../library/ossaudiodev.rst:313 -msgid "(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)" -msgstr "(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)" - -#: ../../library/ossaudiodev.rst:315 -msgid "is equivalent to ::" -msgstr "等價於: ::" - -#: ../../library/ossaudiodev.rst:317 -msgid "" -"fmt = dsp.setfmt(fmt)\n" -"channels = dsp.channels(channels)\n" -"rate = dsp.rate(rate)" -msgstr "" -"fmt = dsp.setfmt(fmt)\n" -"channels = dsp.channels(channels)\n" -"rate = dsp.rate(rate)" - -#: ../../library/ossaudiodev.rst:324 -msgid "Returns the size of the hardware buffer, in samples." -msgstr "" - -#: ../../library/ossaudiodev.rst:329 -msgid "" -"Returns the number of samples that are in the hardware buffer yet to be " -"played." -msgstr "" - -#: ../../library/ossaudiodev.rst:334 -msgid "" -"Returns the number of samples that could be queued into the hardware buffer " -"to be played without blocking." -msgstr "" - -#: ../../library/ossaudiodev.rst:337 -msgid "Audio device objects also support several read-only attributes:" -msgstr "" - -#: ../../library/ossaudiodev.rst:342 -msgid "Boolean indicating whether the device has been closed." -msgstr "" - -#: ../../library/ossaudiodev.rst:347 -msgid "String containing the name of the device file." -msgstr "" - -#: ../../library/ossaudiodev.rst:352 -msgid "The I/O mode for the file, either ``\"r\"``, ``\"rw\"``, or ``\"w\"``." -msgstr "" - -#: ../../library/ossaudiodev.rst:358 -msgid "Mixer Device Objects" -msgstr "" - -#: ../../library/ossaudiodev.rst:360 -msgid "The mixer object provides two file-like methods:" -msgstr "" - -#: ../../library/ossaudiodev.rst:365 -msgid "" -"This method closes the open mixer device file. Any further attempts to use " -"the mixer after this file is closed will raise an :exc:`OSError`." -msgstr "" - -#: ../../library/ossaudiodev.rst:371 -msgid "Returns the file handle number of the open mixer device file." -msgstr "" - -#: ../../library/ossaudiodev.rst:373 -msgid "Mixer objects also support the context management protocol." -msgstr "" - -#: ../../library/ossaudiodev.rst:377 -msgid "The remaining methods are specific to audio mixing:" -msgstr "" - -#: ../../library/ossaudiodev.rst:382 -msgid "" -"This method returns a bitmask specifying the available mixer controls " -"(\"Control\" being a specific mixable \"channel\", such as :const:" -"`SOUND_MIXER_PCM` or :const:`SOUND_MIXER_SYNTH`). This bitmask indicates a " -"subset of all available mixer controls---the :const:`SOUND_MIXER_\\*` " -"constants defined at module level. To determine if, for example, the current " -"mixer object supports a PCM mixer, use the following Python code::" -msgstr "" - -#: ../../library/ossaudiodev.rst:389 -msgid "" -"mixer=ossaudiodev.openmixer()\n" -"if mixer.controls() & (1 << ossaudiodev.SOUND_MIXER_PCM):\n" -" # PCM is supported\n" -" ... code ..." -msgstr "" - -#: ../../library/ossaudiodev.rst:394 -msgid "" -"For most purposes, the :const:`SOUND_MIXER_VOLUME` (master volume) and :" -"const:`SOUND_MIXER_PCM` controls should suffice---but code that uses the " -"mixer should be flexible when it comes to choosing mixer controls. On the " -"Gravis Ultrasound, for example, :const:`SOUND_MIXER_VOLUME` does not exist." -msgstr "" - -#: ../../library/ossaudiodev.rst:402 -msgid "" -"Returns a bitmask indicating stereo mixer controls. If a bit is set, the " -"corresponding control is stereo; if it is unset, the control is either " -"monophonic or not supported by the mixer (use in combination with :meth:" -"`controls` to determine which)." -msgstr "" - -#: ../../library/ossaudiodev.rst:407 -msgid "" -"See the code example for the :meth:`controls` function for an example of " -"getting data from a bitmask." -msgstr "" - -#: ../../library/ossaudiodev.rst:413 -msgid "" -"Returns a bitmask specifying the mixer controls that may be used to record. " -"See the code example for :meth:`controls` for an example of reading from a " -"bitmask." -msgstr "" - -#: ../../library/ossaudiodev.rst:419 -msgid "" -"Returns the volume of a given mixer control. The returned volume is a 2-" -"tuple ``(left_volume,right_volume)``. Volumes are specified as numbers from " -"0 (silent) to 100 (full volume). If the control is monophonic, a 2-tuple is " -"still returned, but both volumes are the same." -msgstr "" - -#: ../../library/ossaudiodev.rst:424 -msgid "" -"Raises :exc:`OSSAudioError` if an invalid control is specified, or :exc:" -"`OSError` if an unsupported control is specified." -msgstr "" - -#: ../../library/ossaudiodev.rst:430 -msgid "" -"Sets the volume for a given mixer control to ``(left,right)``. ``left`` and " -"``right`` must be ints and between 0 (silent) and 100 (full volume). On " -"success, the new volume is returned as a 2-tuple. Note that this may not be " -"exactly the same as the volume specified, because of the limited resolution " -"of some soundcard's mixers." -msgstr "" - -#: ../../library/ossaudiodev.rst:436 -msgid "" -"Raises :exc:`OSSAudioError` if an invalid mixer control was specified, or if " -"the specified volumes were out-of-range." -msgstr "" - -#: ../../library/ossaudiodev.rst:442 -msgid "" -"This method returns a bitmask indicating which control(s) are currently " -"being used as a recording source." -msgstr "" - -#: ../../library/ossaudiodev.rst:448 -msgid "" -"Call this function to specify a recording source. Returns a bitmask " -"indicating the new recording source (or sources) if successful; raises :exc:" -"`OSError` if an invalid source was specified. To set the current recording " -"source to the microphone input::" -msgstr "" +#~ msgid "" +#~ "fmt = dsp.setfmt(fmt)\n" +#~ "channels = dsp.channels(channels)\n" +#~ "rate = dsp.rate(rate)" +#~ msgstr "" +#~ "fmt = dsp.setfmt(fmt)\n" +#~ "channels = dsp.channels(channels)\n" +#~ "rate = dsp.rate(rate)" -#: ../../library/ossaudiodev.rst:453 -msgid "mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)" -msgstr "mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)" +#~ msgid "mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)" +#~ msgstr "mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)" diff --git a/library/pipes.po b/library/pipes.po index 67d5298f5b..08adfd96bf 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -19,126 +19,58 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/pipes.rst:2 -msgid ":mod:`pipes` --- Interface to shell pipelines" +#, fuzzy +msgid ":mod:`!pipes` --- Interface to shell pipelines" msgstr ":mod:`pipes` --- shell pipelines 介面" -#: ../../library/pipes.rst:11 -msgid "**Source code:** :source:`Lib/pipes.py`" -msgstr "**原始碼:**\\ :source:`Lib/pipes.py`" - -#: ../../library/pipes.rst:13 -msgid "" -"The :mod:`pipes` module is deprecated (see :pep:`PEP 594 <594#pipes>` for " -"details). Please use the :mod:`subprocess` module instead." -msgstr "" -":mod:`pipes` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#pipes>`\\ )。" -"請改用 :mod:`subprocess`。" - -#: ../../library/pipes.rst:20 -msgid "" -"The :mod:`pipes` module defines a class to abstract the concept of a " -"*pipeline* --- a sequence of converters from one file to another." -msgstr "" - -#: ../../library/pipes.rst:23 -msgid "" -"Because the module uses :program:`/bin/sh` command lines, a POSIX or " -"compatible shell for :func:`os.system` and :func:`os.popen` is required." -msgstr "" - -#: ../../library/pipes.rst:26 -msgid ":ref:`Availability `: Unix, not VxWorks." -msgstr ":ref:`適用 `:Unix,非 VxWorks。" - -#: ../../library/pipes.rst:28 -msgid "The :mod:`pipes` module defines the following class:" -msgstr "" - -#: ../../library/pipes.rst:33 -msgid "An abstraction of a pipeline." -msgstr "" - -#: ../../library/pipes.rst:35 -msgid "Example::" -msgstr "範例: ::" - -#: ../../library/pipes.rst:37 -msgid "" -">>> import pipes\n" -">>> t = pipes.Template()\n" -">>> t.append('tr a-z A-Z', '--')\n" -">>> f = t.open('pipefile', 'w')\n" -">>> f.write('hello world')\n" -">>> f.close()\n" -">>> open('pipefile').read()\n" -"'HELLO WORLD'" -msgstr "" -">>> import pipes\n" -">>> t = pipes.Template()\n" -">>> t.append('tr a-z A-Z', '--')\n" -">>> f = t.open('pipefile', 'w')\n" -">>> f.write('hello world')\n" -">>> f.close()\n" -">>> open('pipefile').read()\n" -"'HELLO WORLD'" - -#: ../../library/pipes.rst:50 -msgid "Template Objects" -msgstr "" - -#: ../../library/pipes.rst:52 -msgid "Template objects following methods:" -msgstr "" - -#: ../../library/pipes.rst:57 -msgid "Restore a pipeline template to its initial state." -msgstr "" - -#: ../../library/pipes.rst:62 -msgid "Return a new, equivalent, pipeline template." -msgstr "" - -#: ../../library/pipes.rst:67 -msgid "" -"If *flag* is true, turn debugging on. Otherwise, turn debugging off. When " -"debugging is on, commands to be executed are printed, and the shell is given " -"``set -x`` command to be more verbose." -msgstr "" - -#: ../../library/pipes.rst:74 +#: ../../library/pipes.rst:10 msgid "" -"Append a new action at the end. The *cmd* variable must be a valid bourne " -"shell command. The *kind* variable consists of two letters." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/pipes.rst:77 -msgid "" -"The first letter can be either of ``'-'`` (which means the command reads its " -"standard input), ``'f'`` (which means the commands reads a given file on the " -"command line) or ``'.'`` (which means the commands reads no input, and hence " -"must be first.)" -msgstr "" - -#: ../../library/pipes.rst:82 -msgid "" -"Similarly, the second letter can be either of ``'-'`` (which means the " -"command writes to standard output), ``'f'`` (which means the command writes " -"a file on the command line) or ``'.'`` (which means the command does not " -"write anything, and hence must be last.)" -msgstr "" - -#: ../../library/pipes.rst:90 -msgid "" -"Add a new action at the beginning. See :meth:`append` for explanations of " -"the arguments." +#: ../../library/pipes.rst:14 +msgid "Applications should use the :mod:`subprocess` module instead." msgstr "" -#: ../../library/pipes.rst:96 +#: ../../library/pipes.rst:16 msgid "" -"Return a file-like object, open to *file*, but read from or written to by " -"the pipeline. Note that only one of ``'r'``, ``'w'`` may be given." -msgstr "" - -#: ../../library/pipes.rst:102 -msgid "Copy *infile* to *outfile* through the pipe." -msgstr "" +"The last version of Python that provided the :mod:`!pipes` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/pipes.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/pipes.py`" + +#~ msgid "" +#~ "The :mod:`pipes` module is deprecated (see :pep:`PEP 594 <594#pipes>` for " +#~ "details). Please use the :mod:`subprocess` module instead." +#~ msgstr "" +#~ ":mod:`pipes` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#pipes>`\\ )。請改用 :mod:`subprocess`。" + +#~ msgid ":ref:`Availability `: Unix, not VxWorks." +#~ msgstr ":ref:`適用 `:Unix,非 VxWorks。" + +#~ msgid "Example::" +#~ msgstr "範例: ::" + +#~ msgid "" +#~ ">>> import pipes\n" +#~ ">>> t = pipes.Template()\n" +#~ ">>> t.append('tr a-z A-Z', '--')\n" +#~ ">>> f = t.open('pipefile', 'w')\n" +#~ ">>> f.write('hello world')\n" +#~ ">>> f.close()\n" +#~ ">>> open('pipefile').read()\n" +#~ "'HELLO WORLD'" +#~ msgstr "" +#~ ">>> import pipes\n" +#~ ">>> t = pipes.Template()\n" +#~ ">>> t.append('tr a-z A-Z', '--')\n" +#~ ">>> f = t.open('pipefile', 'w')\n" +#~ ">>> f.write('hello world')\n" +#~ ">>> f.close()\n" +#~ ">>> open('pipefile').read()\n" +#~ "'HELLO WORLD'" diff --git a/library/pprint.po b/library/pprint.po index ce89afcb1b..04f34ec116 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -262,11 +262,12 @@ msgid "" msgstr "" #: ../../library/pprint.rst:267 +#, fuzzy msgid "" ">>> import json\n" ">>> import pprint\n" ">>> from urllib.request import urlopen\n" -">>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp:\n" +">>> with urlopen('https://pypi.org/pypi/sampleproject/1.2.0/json') as resp:\n" "... project_info = json.load(resp)['info']" msgstr "" ">>> import json\n" diff --git a/library/pydoc.po b/library/pydoc.po index 49c034420c..da3f4dccc3 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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,18 +80,19 @@ msgstr "" #: ../../library/pydoc.rst:54 msgid "" "When printing output to the console, :program:`pydoc` attempts to paginate " -"the output for easier reading. If the :envvar:`PAGER` environment variable " -"is set, :program:`pydoc` will use its value as a pagination program." +"the output for easier reading. If either the :envvar:`MANPAGER` or the :" +"envvar:`PAGER` environment variable is set, :program:`pydoc` will use its " +"value as a pagination program. When both are set, :envvar:`MANPAGER` is used." msgstr "" -#: ../../library/pydoc.rst:58 +#: ../../library/pydoc.rst:59 msgid "" "Specifying a ``-w`` flag before the argument will cause HTML documentation " "to be written out to a file in the current directory, instead of displaying " "text on the console." msgstr "" -#: ../../library/pydoc.rst:62 +#: ../../library/pydoc.rst:63 msgid "" "Specifying a ``-k`` flag before the argument will search the synopsis lines " "of all available modules for the keyword given as the argument, again in a " @@ -99,7 +100,7 @@ msgid "" "module is the first line of its documentation string." msgstr "" -#: ../../library/pydoc.rst:67 +#: ../../library/pydoc.rst:68 msgid "" "You can also use :program:`pydoc` to start an HTTP server on the local " "machine that will serve documentation to visiting web browsers. :program:" @@ -109,7 +110,7 @@ msgid "" "arbitrary unused port." msgstr "" -#: ../../library/pydoc.rst:73 +#: ../../library/pydoc.rst:74 msgid "" ":program:`python -m pydoc -n ` will start the server listening at " "the given hostname. By default the hostname is 'localhost' but if you want " @@ -118,7 +119,7 @@ msgid "" "especially useful if you want to run pydoc from within a container." msgstr "" -#: ../../library/pydoc.rst:79 +#: ../../library/pydoc.rst:80 msgid "" ":program:`python -m pydoc -b` will start the server and additionally open a " "web browser to a module index page. Each served page has a navigation bar " @@ -127,7 +128,7 @@ msgid "" "*Topics* and *Keywords* pages." msgstr "" -#: ../../library/pydoc.rst:85 +#: ../../library/pydoc.rst:86 msgid "" "When :program:`pydoc` generates documentation, it uses the current " "environment and path to locate modules. Thus, invoking :program:`pydoc " @@ -135,7 +136,7 @@ msgid "" "started the Python interpreter and typed ``import spam``." msgstr "" -#: ../../library/pydoc.rst:90 +#: ../../library/pydoc.rst:91 msgid "" "Module docs for core modules are assumed to reside in ``https://docs.python." "org/X.Y/library/`` where ``X`` and ``Y`` are the major and minor version " @@ -144,21 +145,21 @@ msgid "" "directory containing the Library Reference Manual pages." msgstr "" -#: ../../library/pydoc.rst:97 +#: ../../library/pydoc.rst:98 msgid "Added the ``-b`` option." msgstr "新增 ``-b`` 選項。" -#: ../../library/pydoc.rst:100 +#: ../../library/pydoc.rst:101 msgid "The ``-g`` command line option was removed." msgstr "" -#: ../../library/pydoc.rst:103 +#: ../../library/pydoc.rst:104 msgid "" ":mod:`!pydoc` now uses :func:`inspect.signature` rather than :func:`inspect." "getfullargspec` to extract signature information from callables." msgstr "" -#: ../../library/pydoc.rst:108 +#: ../../library/pydoc.rst:109 msgid "Added the ``-n`` option." msgstr "新增 ``-n`` 選項。" diff --git a/library/removed.po b/library/removed.po new file mode 100644 index 0000000000..d3f43dcf2b --- /dev/null +++ b/library/removed.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/removed.rst:7 +msgid "Removed Modules" +msgstr "" + +#: ../../library/removed.rst:9 +msgid "" +"The modules described in this chapter have been removed from the Python " +"standard library. They are documented here to help people find replacements." +msgstr "" diff --git a/library/smtpd.po b/library/smtpd.po new file mode 100644 index 0000000000..feabe511b2 --- /dev/null +++ b/library/smtpd.po @@ -0,0 +1,41 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/smtpd.rst:2 +msgid ":mod:`!smtpd` --- SMTP Server" +msgstr "" + +#: ../../library/smtpd.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" + +#: ../../library/smtpd.rst:14 +msgid "" +"A possible replacement is the third-party :pypi:`aiosmtpd` library. This " +"library is not maintained or supported by the Python core team." +msgstr "" + +#: ../../library/smtpd.rst:17 +msgid "" +"The last version of Python that provided the :mod:`!smtpd` module was " +"`Python 3.11 `_." +msgstr "" diff --git a/library/sndhdr.po b/library/sndhdr.po index 13eead7a74..91114e0f23 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -23,209 +23,151 @@ msgstr "" "X-Generator: Poedit 3.1\n" #: ../../library/sndhdr.rst:2 -msgid ":mod:`sndhdr` --- Determine type of sound file" +#, fuzzy +msgid ":mod:`!sndhdr` --- Determine type of sound file" msgstr ":mod:`sndhdr` --- 判定聲音檔案的型別" -#: ../../library/sndhdr.rst:11 -msgid "**Source code:** :source:`Lib/sndhdr.py`" -msgstr "**原始碼:**\\ :source:`Lib/sndhdr.py`" - -#: ../../library/sndhdr.rst:17 -msgid "" -"The :mod:`sndhdr` module is deprecated (see :pep:`PEP 594 <594#sndhdr>` for " -"details and alternatives)." -msgstr "" -":mod:`sndhdr` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " -"<594#sndhdr>`)。" - -#: ../../library/sndhdr.rst:23 +#: ../../library/sndhdr.rst:10 msgid "" -"The :mod:`sndhdr` provides utility functions which attempt to determine the " -"type of sound data which is in a file. When these functions are able to " -"determine what type of sound data is stored in a file, they return a :func:" -"`~collections.namedtuple`, containing five attributes: (``filetype``, " -"``framerate``, ``nchannels``, ``nframes``, ``sampwidth``). The value for " -"*type* indicates the data type and will be one of the strings ``'aifc'``, " -"``'aiff'``, ``'au'``, ``'hcom'``, ``'sndr'``, ``'sndt'``, ``'voc'``, " -"``'wav'``, ``'8svx'``, ``'sb'``, ``'ub'``, or ``'ul'``. The *sampling_rate* " -"will be either the actual value or ``0`` if unknown or difficult to decode. " -"Similarly, *channels* will be either the number of channels or ``0`` if it " -"cannot be determined or if the value is difficult to decode. The value for " -"*frames* will be either the number of frames or ``-1``. The last item in " -"the tuple, *bits_per_sample*, will either be the sample size in bits or " -"``'A'`` for A-LAW or ``'U'`` for u-LAW." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`sndhdr` 提供了企圖猜測檔案中聲音資料型別的工具函式。當這些函式可以推測" -"出儲存在檔案中聲音資料的型別,它們分別回傳一個 :func:`collections." -"namedtuple`,包含了五種屬性:(``filetype``、``framerate``、``nchannels``、" -"``nframes``、``sampwidth``)。這些 *type* 的值表示資料的型別,會是以下字串之" -"一:``'aifc'``、``'aiff'``、``'au'``、``'hcom'``、``'sndr'``、``'sndt'``、" -"``'voc'``、``'wav'``、``'8svx'``、``'sb'``、``'ub'`` 或 ``'ul'``。" -"*sampling_rate*\\ (取樣頻率)可能是實際值、或者當未知或者難以解碼時為 " -"``0``。同樣的,*channels*\\ (影像通道數)也會回傳實際值或者在無法推測或難以" -"解碼時回傳 ``0``。*frames*\\ (幀數)則是實際值或 ``-1``。tuple 的最後一項," -"*bits_per_sample* 為位元表示的取樣大小,或者在 A-LAW 時為 ``'A'``,u-LAW 時" -"為 ``'U'``。" - -#: ../../library/sndhdr.rst:40 -msgid "" -"Determines the type of sound data stored in the file *filename* using :func:" -"`whathdr`. If it succeeds, returns a namedtuple as described above, " -"otherwise ``None`` is returned." -msgstr "" -"使用 :func:`whathdr` 推測儲存在 *filename* 檔案中聲音資料的型別。如果成功,回" -"傳上述的 namedtuple(附名元組),否則回傳 ``None``。" - -#: ../../library/sndhdr.rst:44 ../../library/sndhdr.rst:54 -msgid "Result changed from a tuple to a namedtuple." -msgstr "結果從 tuple 改為 namedtuple。" -#: ../../library/sndhdr.rst:50 +#: ../../library/sndhdr.rst:14 msgid "" -"Determines the type of sound data stored in a file based on the file " -"header. The name of the file is given by *filename*. This function returns " -"a namedtuple as described above on success, or ``None``." +"Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :" +"pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or " +"maintained by the Python core team." msgstr "" -"根據檔案標頭 (header) 推測儲存在檔案中的聲音資料型別。檔名由 *filename* 給" -"定。這個函式在成功時回傳上述 namedtuple,或在失敗時回傳 ``None``。" -#: ../../library/sndhdr.rst:57 +#: ../../library/sndhdr.rst:18 msgid "" -"The following sound header types are recognized, as listed below with the " -"return value from :func:`whathdr`: and :func:`what`:" -msgstr "" - -#: ../../library/sndhdr.rst:61 -msgid "Value" -msgstr "" - -#: ../../library/sndhdr.rst:61 -msgid "Sound header format" -msgstr "" - -#: ../../library/sndhdr.rst:63 -msgid "``'aifc'``" -msgstr "``'aifc'``" - -#: ../../library/sndhdr.rst:63 -msgid "Compressed Audio Interchange Files" -msgstr "" - -#: ../../library/sndhdr.rst:65 -msgid "``'aiff'``" -msgstr "``'aiff'``" - -#: ../../library/sndhdr.rst:65 -msgid "Audio Interchange Files" -msgstr "" - -#: ../../library/sndhdr.rst:67 -msgid "``'au'``" -msgstr "``'au'``" - -#: ../../library/sndhdr.rst:67 -msgid "Au Files" -msgstr "Au 檔案" - -#: ../../library/sndhdr.rst:69 -msgid "``'hcom'``" -msgstr "``'hcom'``" - -#: ../../library/sndhdr.rst:69 -msgid "HCOM Files" -msgstr "HCOM 檔案" - -#: ../../library/sndhdr.rst:71 -msgid "``'sndt'``" -msgstr "``'sndt'``" - -#: ../../library/sndhdr.rst:71 -msgid "Sndtool Sound Files" -msgstr "" - -#: ../../library/sndhdr.rst:73 -msgid "``'voc'``" -msgstr "``'voc'``" - -#: ../../library/sndhdr.rst:73 -msgid "Creative Labs Audio Files" -msgstr "" - -#: ../../library/sndhdr.rst:75 -msgid "``'wav'``" -msgstr "``'wav'``" - -#: ../../library/sndhdr.rst:75 -msgid "Waveform Audio File Format Files" -msgstr "" - -#: ../../library/sndhdr.rst:77 -msgid "``'8svx'``" -msgstr "``'8svx'``" - -#: ../../library/sndhdr.rst:77 -msgid "8-Bit Sampled Voice Files" -msgstr "" - -#: ../../library/sndhdr.rst:79 -msgid "``'sb'``" -msgstr "``'sb'``" - -#: ../../library/sndhdr.rst:79 -msgid "Signed Byte Audio Data Files" -msgstr "" - -#: ../../library/sndhdr.rst:81 -msgid "``'ub'``" -msgstr "``'ub'``" - -#: ../../library/sndhdr.rst:81 -msgid "UB Files" -msgstr "UB 檔案" - -#: ../../library/sndhdr.rst:83 -msgid "``'ul'``" -msgstr "``'ul'``" - -#: ../../library/sndhdr.rst:83 -msgid "uLAW Audio Files" -msgstr "uLAW 音檔" - -#: ../../library/sndhdr.rst:88 -msgid "" -"A list of functions performing the individual tests. Each function takes " -"two arguments: the byte-stream and an open file-like object. When :func:" -"`what` is called with a byte-stream, the file-like object will be ``None``." -msgstr "" - -#: ../../library/sndhdr.rst:92 -msgid "" -"The test function should return a string describing the image type if the " -"test succeeded, or ``None`` if it failed." -msgstr "" - -#: ../../library/sndhdr.rst:95 -msgid "Example:" -msgstr "範例:" - -#: ../../library/sndhdr.rst:97 -msgid "" -">>> import sndhdr\n" -">>> imghdr.what('bass.wav')\n" -"'wav'\n" -">>> imghdr.whathdr('bass.wav')\n" -"'wav'" -msgstr "" -">>> import sndhdr\n" -">>> imghdr.what('bass.wav')\n" -"'wav'\n" -">>> imghdr.whathdr('bass.wav')\n" -"'wav'" - -#: ../../library/sndhdr.rst:13 -msgid "A-LAW" -msgstr "A-LAW" - -#: ../../library/sndhdr.rst:13 -msgid "u-LAW" -msgstr "u-LAW" +"The last version of Python that provided the :mod:`!sndhdr` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/sndhdr.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/sndhdr.py`" + +#~ msgid "" +#~ "The :mod:`sndhdr` module is deprecated (see :pep:`PEP 594 <594#sndhdr>` " +#~ "for details and alternatives)." +#~ msgstr "" +#~ ":mod:`sndhdr` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +#~ "<594#sndhdr>`)。" + +#~ msgid "" +#~ "The :mod:`sndhdr` provides utility functions which attempt to determine " +#~ "the type of sound data which is in a file. When these functions are able " +#~ "to determine what type of sound data is stored in a file, they return a :" +#~ "func:`~collections.namedtuple`, containing five attributes: " +#~ "(``filetype``, ``framerate``, ``nchannels``, ``nframes``, ``sampwidth``). " +#~ "The value for *type* indicates the data type and will be one of the " +#~ "strings ``'aifc'``, ``'aiff'``, ``'au'``, ``'hcom'``, ``'sndr'``, " +#~ "``'sndt'``, ``'voc'``, ``'wav'``, ``'8svx'``, ``'sb'``, ``'ub'``, or " +#~ "``'ul'``. The *sampling_rate* will be either the actual value or ``0`` " +#~ "if unknown or difficult to decode. Similarly, *channels* will be either " +#~ "the number of channels or ``0`` if it cannot be determined or if the " +#~ "value is difficult to decode. The value for *frames* will be either the " +#~ "number of frames or ``-1``. The last item in the tuple, " +#~ "*bits_per_sample*, will either be the sample size in bits or ``'A'`` for " +#~ "A-LAW or ``'U'`` for u-LAW." +#~ msgstr "" +#~ ":mod:`sndhdr` 提供了企圖猜測檔案中聲音資料型別的工具函式。當這些函式可以推" +#~ "測出儲存在檔案中聲音資料的型別,它們分別回傳一個 :func:`collections." +#~ "namedtuple`,包含了五種屬性:(``filetype``、``framerate``、" +#~ "``nchannels``、``nframes``、``sampwidth``)。這些 *type* 的值表示資料的型" +#~ "別,會是以下字串之一:``'aifc'``、``'aiff'``、``'au'``、``'hcom'``、" +#~ "``'sndr'``、``'sndt'``、``'voc'``、``'wav'``、``'8svx'``、``'sb'``、" +#~ "``'ub'`` 或 ``'ul'``。*sampling_rate*\\ (取樣頻率)可能是實際值、或者當未" +#~ "知或者難以解碼時為 ``0``。同樣的,*channels*\\ (影像通道數)也會回傳實際" +#~ "值或者在無法推測或難以解碼時回傳 ``0``。*frames*\\ (幀數)則是實際值或 " +#~ "``-1``。tuple 的最後一項,*bits_per_sample* 為位元表示的取樣大小,或者在 " +#~ "A-LAW 時為 ``'A'``,u-LAW 時為 ``'U'``。" + +#~ msgid "" +#~ "Determines the type of sound data stored in the file *filename* using :" +#~ "func:`whathdr`. If it succeeds, returns a namedtuple as described above, " +#~ "otherwise ``None`` is returned." +#~ msgstr "" +#~ "使用 :func:`whathdr` 推測儲存在 *filename* 檔案中聲音資料的型別。如果成" +#~ "功,回傳上述的 namedtuple(附名元組),否則回傳 ``None``。" + +#~ msgid "Result changed from a tuple to a namedtuple." +#~ msgstr "結果從 tuple 改為 namedtuple。" + +#~ msgid "" +#~ "Determines the type of sound data stored in a file based on the file " +#~ "header. The name of the file is given by *filename*. This function " +#~ "returns a namedtuple as described above on success, or ``None``." +#~ msgstr "" +#~ "根據檔案標頭 (header) 推測儲存在檔案中的聲音資料型別。檔名由 *filename* 給" +#~ "定。這個函式在成功時回傳上述 namedtuple,或在失敗時回傳 ``None``。" + +#~ msgid "``'aifc'``" +#~ msgstr "``'aifc'``" + +#~ msgid "``'aiff'``" +#~ msgstr "``'aiff'``" + +#~ msgid "``'au'``" +#~ msgstr "``'au'``" + +#~ msgid "Au Files" +#~ msgstr "Au 檔案" + +#~ msgid "``'hcom'``" +#~ msgstr "``'hcom'``" + +#~ msgid "HCOM Files" +#~ msgstr "HCOM 檔案" + +#~ msgid "``'sndt'``" +#~ msgstr "``'sndt'``" + +#~ msgid "``'voc'``" +#~ msgstr "``'voc'``" + +#~ msgid "``'wav'``" +#~ msgstr "``'wav'``" + +#~ msgid "``'8svx'``" +#~ msgstr "``'8svx'``" + +#~ msgid "``'sb'``" +#~ msgstr "``'sb'``" + +#~ msgid "``'ub'``" +#~ msgstr "``'ub'``" + +#~ msgid "UB Files" +#~ msgstr "UB 檔案" + +#~ msgid "``'ul'``" +#~ msgstr "``'ul'``" + +#~ msgid "uLAW Audio Files" +#~ msgstr "uLAW 音檔" + +#~ msgid "Example:" +#~ msgstr "範例:" + +#~ msgid "" +#~ ">>> import sndhdr\n" +#~ ">>> imghdr.what('bass.wav')\n" +#~ "'wav'\n" +#~ ">>> imghdr.whathdr('bass.wav')\n" +#~ "'wav'" +#~ msgstr "" +#~ ">>> import sndhdr\n" +#~ ">>> imghdr.what('bass.wav')\n" +#~ "'wav'\n" +#~ ">>> imghdr.whathdr('bass.wav')\n" +#~ "'wav'" + +#~ msgid "A-LAW" +#~ msgstr "A-LAW" + +#~ msgid "u-LAW" +#~ msgstr "u-LAW" diff --git a/library/socket.po b/library/socket.po index ad7273c1dc..3d7a96d3d0 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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,22 +51,22 @@ msgstr "" #: ../../library/socket.rst:658 ../../library/socket.rst:667 #: ../../library/socket.rst:684 ../../library/socket.rst:699 #: ../../library/socket.rst:709 ../../library/socket.rst:898 -#: ../../library/socket.rst:994 ../../library/socket.rst:1010 -#: ../../library/socket.rst:1023 ../../library/socket.rst:1038 -#: ../../library/socket.rst:1055 ../../library/socket.rst:1066 -#: ../../library/socket.rst:1077 ../../library/socket.rst:1088 -#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 -#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 -#: ../../library/socket.rst:1275 ../../library/socket.rst:1286 -#: ../../library/socket.rst:1313 ../../library/socket.rst:1330 -#: ../../library/socket.rst:1347 ../../library/socket.rst:1361 -#: ../../library/socket.rst:1412 ../../library/socket.rst:1459 -#: ../../library/socket.rst:1473 ../../library/socket.rst:1493 -#: ../../library/socket.rst:1540 ../../library/socket.rst:1585 -#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 -#: ../../library/socket.rst:1867 ../../library/socket.rst:1885 -#: ../../library/socket.rst:1969 ../../library/socket.rst:1979 -#: ../../library/socket.rst:1991 ../../includes/wasm-notavail.rst:3 +#: ../../library/socket.rst:1023 ../../library/socket.rst:1039 +#: ../../library/socket.rst:1052 ../../library/socket.rst:1067 +#: ../../library/socket.rst:1084 ../../library/socket.rst:1095 +#: ../../library/socket.rst:1106 ../../library/socket.rst:1117 +#: ../../library/socket.rst:1206 ../../library/socket.rst:1226 +#: ../../library/socket.rst:1252 ../../library/socket.rst:1275 +#: ../../library/socket.rst:1304 ../../library/socket.rst:1315 +#: ../../library/socket.rst:1342 ../../library/socket.rst:1359 +#: ../../library/socket.rst:1376 ../../library/socket.rst:1390 +#: ../../library/socket.rst:1441 ../../library/socket.rst:1488 +#: ../../library/socket.rst:1502 ../../library/socket.rst:1522 +#: ../../library/socket.rst:1569 ../../library/socket.rst:1614 +#: ../../library/socket.rst:1744 ../../library/socket.rst:1788 +#: ../../library/socket.rst:1896 ../../library/socket.rst:1914 +#: ../../library/socket.rst:1998 ../../library/socket.rst:2008 +#: ../../library/socket.rst:2020 ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" @@ -140,8 +140,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1160 -#: ../../library/socket.rst:1202 ../../library/socket.rst:1963 +#: ../../library/socket.rst:66 ../../library/socket.rst:1189 +#: ../../library/socket.rst:1231 ../../library/socket.rst:1992 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -737,7 +737,7 @@ msgid "" "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:579 ../../library/socket.rst:1575 +#: ../../library/socket.rst:579 ../../library/socket.rst:1604 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" @@ -850,7 +850,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:741 ../../library/socket.rst:887 -#: ../../library/socket.rst:1394 ../../library/socket.rst:1488 +#: ../../library/socket.rst:1423 ../../library/socket.rst:1517 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" @@ -1079,6 +1079,11 @@ msgstr "" #: ../../library/socket.rst:925 msgid "" +"This function wraps the C function ``getaddrinfo`` of the underlying system." +msgstr "" + +#: ../../library/socket.rst:927 +msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " "service. *host* is a domain name, a string representation of an IPv4/v6 " @@ -1087,26 +1092,31 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:932 +#: ../../library/socket.rst:934 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " -"order to narrow the list of addresses returned. Passing zero as a value for " -"each of these arguments selects the full range of results. The *flags* " -"argument can be one or several of the ``AI_*`` constants, and will influence " -"how results are computed and returned. For example, :const:`AI_NUMERICHOST` " -"will disable domain name resolution and will raise an error if *host* is a " -"domain name." +"order to provide options and limit the list of addresses returned. Pass " +"their default values (:data:`AF_UNSPEC`, 0, and 0, respectively) to not " +"limit the results. See the note below for details." msgstr "" -#: ../../library/socket.rst:940 +#: ../../library/socket.rst:939 +msgid "" +"The *flags* argument can be one or several of the ``AI_*`` constants, and " +"will influence how results are computed and returned. For example, :const:" +"`AI_NUMERICHOST` will disable domain name resolution and will raise an error " +"if *host* is a domain name." +msgstr "" + +#: ../../library/socket.rst:944 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:942 +#: ../../library/socket.rst:946 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:944 +#: ../../library/socket.rst:948 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`~socket.socket` function. *canonname* will be a " @@ -1118,7 +1128,39 @@ msgid "" "`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:960 +msgid "" +"If you intend to use results from :func:`!getaddrinfo` to create a socket " +"(rather than, for example, retrieve *canonname*), consider limiting the " +"results by *type* (e.g. :data:`SOCK_STREAM` or :data:`SOCK_DGRAM`) and/or " +"*proto* (e.g. :data:`IPPROTO_TCP` or :data:`IPPROTO_UDP`) that your " +"application can handle." +msgstr "" + +#: ../../library/socket.rst:966 +msgid "" +"The behavior with default values of *family*, *type*, *proto* and *flags* is " +"system-specific." +msgstr "" + +#: ../../library/socket.rst:969 +msgid "" +"Many systems (for example, most Linux configurations) will return a sorted " +"list of all matching addresses. These addresses should generally be tried in " +"order until a connection succeeds (possibly tried in parallel, for example, " +"using a `Happy Eyeballs`_ algorithm). In these cases, limiting the *type* " +"and/or *proto* can help eliminate unsuccessful or unusable connecton " +"attempts." +msgstr "" + +#: ../../library/socket.rst:976 +msgid "" +"Some systems will, however, only return a single address. (For example, this " +"was reported on Solaris and AIX configurations.) On these systems, limiting " +"the *type* and/or *proto* helps ensure that this address is usable." +msgstr "" + +#: ../../library/socket.rst:981 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1126,14 +1168,14 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:956 +#: ../../library/socket.rst:983 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:960 +#: ../../library/socket.rst:987 msgid "" ">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" "[(socket.AF_INET6, socket.SOCK_STREAM,\n" @@ -1147,17 +1189,17 @@ msgstr "" " (socket.AF_INET, socket.SOCK_STREAM,\n" " 6, '', ('93.184.216.34', 80))]" -#: ../../library/socket.rst:966 +#: ../../library/socket.rst:993 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:969 +#: ../../library/socket.rst:996 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:975 +#: ../../library/socket.rst:1004 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1168,7 +1210,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:986 +#: ../../library/socket.rst:1015 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1178,7 +1220,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:992 ../../library/socket.rst:1008 +#: ../../library/socket.rst:1021 ../../library/socket.rst:1037 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1186,7 +1228,7 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:999 +#: ../../library/socket.rst:1028 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1198,26 +1240,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:1015 +#: ../../library/socket.rst:1044 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1018 +#: ../../library/socket.rst:1047 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1020 +#: ../../library/socket.rst:1049 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1028 +#: ../../library/socket.rst:1057 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1228,7 +1270,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1065 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1236,7 +1278,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1043 +#: ../../library/socket.rst:1072 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1244,18 +1286,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1048 +#: ../../library/socket.rst:1077 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1051 +#: ../../library/socket.rst:1080 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1082 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1263,7 +1305,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1060 +#: ../../library/socket.rst:1089 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`~socket." @@ -1272,14 +1314,14 @@ msgid "" "is chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1071 +#: ../../library/socket.rst:1100 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1104 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1287,14 +1329,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1111 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1086 +#: ../../library/socket.rst:1115 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1302,40 +1344,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1093 +#: ../../library/socket.rst:1122 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1129 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1104 ../../library/socket.rst:1122 +#: ../../library/socket.rst:1133 ../../library/socket.rst:1151 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1140 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1118 +#: ../../library/socket.rst:1147 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1129 +#: ../../library/socket.rst:1158 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1344,26 +1386,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1135 +#: ../../library/socket.rst:1164 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1138 +#: ../../library/socket.rst:1167 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1142 +#: ../../library/socket.rst:1171 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1148 +#: ../../library/socket.rst:1177 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1373,7 +1415,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1155 +#: ../../library/socket.rst:1184 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1381,7 +1423,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1166 +#: ../../library/socket.rst:1195 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1389,7 +1431,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1171 +#: ../../library/socket.rst:1200 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1398,11 +1440,11 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1179 ../../library/socket.rst:1199 +#: ../../library/socket.rst:1208 ../../library/socket.rst:1228 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1185 +#: ../../library/socket.rst:1214 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1411,7 +1453,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1192 +#: ../../library/socket.rst:1221 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1419,7 +1461,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1214 +#: ../../library/socket.rst:1243 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1430,12 +1472,12 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1225 ../../library/socket.rst:1717 -#: ../../library/socket.rst:1761 ../../library/socket.rst:1869 +#: ../../library/socket.rst:1254 ../../library/socket.rst:1746 +#: ../../library/socket.rst:1790 ../../library/socket.rst:1898 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1232 +#: ../../library/socket.rst:1261 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1445,7 +1487,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1240 +#: ../../library/socket.rst:1269 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1453,31 +1495,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1248 +#: ../../library/socket.rst:1277 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1255 +#: ../../library/socket.rst:1284 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1262 +#: ../../library/socket.rst:1291 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1270 +#: ../../library/socket.rst:1299 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1273 +#: ../../library/socket.rst:1302 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1485,102 +1527,102 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1282 +#: ../../library/socket.rst:1311 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1290 ../../library/socket.rst:1317 -#: ../../library/socket.rst:1334 +#: ../../library/socket.rst:1319 ../../library/socket.rst:1346 +#: ../../library/socket.rst:1363 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1295 +#: ../../library/socket.rst:1324 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1298 +#: ../../library/socket.rst:1327 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1299 +#: ../../library/socket.rst:1328 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1300 +#: ../../library/socket.rst:1329 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1301 +#: ../../library/socket.rst:1330 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1303 +#: ../../library/socket.rst:1332 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1309 +#: ../../library/socket.rst:1338 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1321 ../../library/socket.rst:1338 +#: ../../library/socket.rst:1350 ../../library/socket.rst:1367 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1326 +#: ../../library/socket.rst:1355 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1343 +#: ../../library/socket.rst:1372 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`~socket.sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1349 ../../library/socket.rst:1363 +#: ../../library/socket.rst:1378 ../../library/socket.rst:1392 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1357 +#: ../../library/socket.rst:1386 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." "recvmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1370 +#: ../../library/socket.rst:1399 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1376 +#: ../../library/socket.rst:1405 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1407 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1382 +#: ../../library/socket.rst:1411 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1389 +#: ../../library/socket.rst:1418 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1589,27 +1631,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1396 ../../library/socket.rst:1490 +#: ../../library/socket.rst:1425 ../../library/socket.rst:1519 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1399 ../../library/socket.rst:1630 -#: ../../library/socket.rst:1644 ../../library/socket.rst:1721 -#: ../../library/socket.rst:1794 ../../library/socket.rst:1813 -#: ../../library/socket.rst:1830 ../../library/socket.rst:1875 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1659 +#: ../../library/socket.rst:1673 ../../library/socket.rst:1750 +#: ../../library/socket.rst:1823 ../../library/socket.rst:1842 +#: ../../library/socket.rst:1859 ../../library/socket.rst:1904 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1436 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1410 +#: ../../library/socket.rst:1439 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1617,7 +1659,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1417 +#: ../../library/socket.rst:1446 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile` are " @@ -1626,33 +1668,33 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1423 +#: ../../library/socket.rst:1452 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1427 +#: ../../library/socket.rst:1456 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1433 +#: ../../library/socket.rst:1462 msgid "" ":meth:`close` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " "connection in a timely fashion, call :meth:`shutdown` before :meth:`close`." msgstr "" -#: ../../library/socket.rst:1441 +#: ../../library/socket.rst:1470 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1444 +#: ../../library/socket.rst:1473 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1662,7 +1704,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 +#: ../../library/socket.rst:1480 ../../library/socket.rst:1500 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1670,7 +1712,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1453 +#: ../../library/socket.rst:1482 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1678,7 +1720,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1464 +#: ../../library/socket.rst:1493 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1688,38 +1730,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1477 +#: ../../library/socket.rst:1506 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1486 +#: ../../library/socket.rst:1515 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1498 +#: ../../library/socket.rst:1527 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1501 +#: ../../library/socket.rst:1530 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1536 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1516 +#: ../../library/socket.rst:1545 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1727,14 +1769,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1524 +#: ../../library/socket.rst:1553 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1531 +#: ../../library/socket.rst:1560 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `_ for more information." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1598 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1572 +#: ../../library/socket.rst:1601 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1580 +#: ../../library/socket.rst:1609 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1798,11 +1840,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1587 +#: ../../library/socket.rst:1616 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1596 +#: ../../library/socket.rst:1625 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1811,28 +1853,28 @@ msgid "" "``'b'``, or a combination of those." msgstr "" -#: ../../library/socket.rst:1602 +#: ../../library/socket.rst:1631 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1606 +#: ../../library/socket.rst:1635 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1612 +#: ../../library/socket.rst:1641 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1619 +#: ../../library/socket.rst:1648 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1842,13 +1884,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1627 +#: ../../library/socket.rst:1656 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1638 +#: ../../library/socket.rst:1667 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1858,14 +1900,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1649 +#: ../../library/socket.rst:1678 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1656 +#: ../../library/socket.rst:1685 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1876,7 +1918,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1666 +#: ../../library/socket.rst:1695 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1891,7 +1933,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1680 +#: ../../library/socket.rst:1709 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1904,7 +1946,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1691 +#: ../../library/socket.rst:1720 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1913,7 +1955,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1698 +#: ../../library/socket.rst:1727 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1922,7 +1964,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1704 +#: ../../library/socket.rst:1733 msgid "" "import socket, array\n" "\n" @@ -1939,7 +1981,7 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1729 +#: ../../library/socket.rst:1758 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1952,7 +1994,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1740 +#: ../../library/socket.rst:1769 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1960,11 +2002,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1745 +#: ../../library/socket.rst:1774 msgid "Example::" msgstr "範例: ::" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1776 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -1990,7 +2032,7 @@ msgstr "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -#: ../../library/socket.rst:1768 +#: ../../library/socket.rst:1797 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -2000,7 +2042,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1778 +#: ../../library/socket.rst:1807 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -2009,7 +2051,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1787 +#: ../../library/socket.rst:1816 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2019,7 +2061,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1831 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2029,13 +2071,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1809 +#: ../../library/socket.rst:1838 msgid "" "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:1822 +#: ../../library/socket.rst:1851 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2044,7 +2086,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1828 +#: ../../library/socket.rst:1857 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2052,7 +2094,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1867 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2072,14 +2114,14 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1858 +#: ../../library/socket.rst:1887 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1891 msgid "" "import socket, array\n" "\n" @@ -2093,7 +2135,7 @@ msgstr "" " return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." "array(\"i\", fds))])" -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1900 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2101,14 +2143,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1882 +#: ../../library/socket.rst:1911 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1891 +#: ../../library/socket.rst:1920 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2122,38 +2164,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1907 +#: ../../library/socket.rst:1936 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1915 +#: ../../library/socket.rst:1944 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1947 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1949 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1922 +#: ../../library/socket.rst:1951 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1924 +#: ../../library/socket.rst:1953 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1960 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" @@ -2163,19 +2205,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1938 +#: ../../library/socket.rst:1967 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1940 +#: ../../library/socket.rst:1969 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1953 +#: ../../library/socket.rst:1982 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in this module " @@ -2188,11 +2230,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1966 +#: ../../library/socket.rst:1995 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1974 +#: ../../library/socket.rst:2003 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2200,7 +2242,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1984 +#: ../../library/socket.rst:2013 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2211,48 +2253,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1996 +#: ../../library/socket.rst:2025 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1999 +#: ../../library/socket.rst:2028 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:2005 +#: ../../library/socket.rst:2034 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2010 +#: ../../library/socket.rst:2039 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2015 +#: ../../library/socket.rst:2044 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2022 +#: ../../library/socket.rst:2051 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2024 +#: ../../library/socket.rst:2053 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2057 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2031 +#: ../../library/socket.rst:2060 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2260,14 +2302,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2036 +#: ../../library/socket.rst:2065 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2041 +#: ../../library/socket.rst:2070 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2276,11 +2318,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2048 +#: ../../library/socket.rst:2077 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2050 +#: ../../library/socket.rst:2079 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2290,24 +2332,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2087 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2089 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2064 +#: ../../library/socket.rst:2093 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2067 +#: ../../library/socket.rst:2096 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2315,11 +2357,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2076 +#: ../../library/socket.rst:2105 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2078 +#: ../../library/socket.rst:2107 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2332,11 +2374,11 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2088 +#: ../../library/socket.rst:2117 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2090 +#: ../../library/socket.rst:2119 msgid "" "# Echo server program\n" "import socket\n" @@ -2355,7 +2397,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2108 +#: ../../library/socket.rst:2137 msgid "" "# Echo client program\n" "import socket\n" @@ -2369,7 +2411,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2119 +#: ../../library/socket.rst:2148 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2379,7 +2421,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2126 +#: ../../library/socket.rst:2155 msgid "" "# Echo server program\n" "import socket\n" @@ -2416,7 +2458,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2162 +#: ../../library/socket.rst:2191 msgid "" "# Echo client program\n" "import socket\n" @@ -2449,14 +2491,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2191 +#: ../../library/socket.rst:2220 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2195 +#: ../../library/socket.rst:2224 msgid "" "import socket\n" "\n" @@ -2480,29 +2522,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2216 +#: ../../library/socket.rst:2245 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2249 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -#: ../../library/socket.rst:2222 +#: ../../library/socket.rst:2251 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2226 +#: ../../library/socket.rst:2255 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2228 +#: ../../library/socket.rst:2257 msgid "" "import socket\n" "import struct\n" @@ -2544,29 +2586,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2266 +#: ../../library/socket.rst:2295 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2269 +#: ../../library/socket.rst:2298 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2271 +#: ../../library/socket.rst:2300 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2274 +#: ../../library/socket.rst:2303 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2277 +#: ../../library/socket.rst:2306 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2576,30 +2618,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2281 +#: ../../library/socket.rst:2310 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2287 +#: ../../library/socket.rst:2316 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2289 +#: ../../library/socket.rst:2318 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2291 +#: ../../library/socket.rst:2320 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2294 +#: ../../library/socket.rst:2323 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2618,19 +2660,19 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1623 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1623 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1980 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1980 msgid "struct" msgstr "struct" diff --git a/library/spwd.po b/library/spwd.po index 3a1dae13ce..8a2c4d0a1e 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,207 +20,106 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/spwd.rst:2 -msgid ":mod:`spwd` --- The shadow password database" +#, fuzzy +msgid ":mod:`!spwd` --- The shadow password database" msgstr ":mod:`spwd` --- shadow 密碼資料庫" -#: ../../library/spwd.rst:9 +#: ../../library/spwd.rst:10 msgid "" -"The :mod:`spwd` module is deprecated (see :pep:`PEP 594 <594#spwd>` for " -"details and alternatives)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`spwd` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " -"<594#spwd>`\\ )。" -#: ../../library/spwd.rst:15 +#: ../../library/spwd.rst:14 msgid "" -"This module provides access to the Unix shadow password database. It is " -"available on various Unix versions." +"A possible replacement is the third-party library :pypi:`python-pam`. This " +"library is not supported or maintained by the Python core team." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/spwd.rst:20 +#: ../../library/spwd.rst:17 msgid "" -"You must have enough privileges to access the shadow password database (this " -"usually means you have to be root)." +"The last version of Python that provided the :mod:`!spwd` module was `Python " +"3.12 `_." msgstr "" -#: ../../library/spwd.rst:23 -msgid "" -"Shadow password database entries are reported as a tuple-like object, whose " -"attributes correspond to the members of the ``spwd`` structure (Attribute " -"field below, see ````):" -msgstr "" - -#: ../../library/spwd.rst:28 -msgid "Index" -msgstr "" - -#: ../../library/spwd.rst:28 -msgid "Attribute" -msgstr "屬性" - -#: ../../library/spwd.rst:28 -msgid "Meaning" -msgstr "含義" +#~ msgid "" +#~ "The :mod:`spwd` module is deprecated (see :pep:`PEP 594 <594#spwd>` for " +#~ "details and alternatives)." +#~ msgstr "" +#~ ":mod:`spwd` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " +#~ "<594#spwd>`\\ )。" -#: ../../library/spwd.rst:30 -msgid "0" -msgstr "0" +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/spwd.rst:30 -msgid "``sp_namp``" -msgstr "``sp_namp``" +#~ msgid "Attribute" +#~ msgstr "屬性" -#: ../../library/spwd.rst:30 -msgid "Login name" -msgstr "" +#~ msgid "Meaning" +#~ msgstr "含義" -#: ../../library/spwd.rst:32 -msgid "1" -msgstr "1" +#~ msgid "0" +#~ msgstr "0" -#: ../../library/spwd.rst:32 -msgid "``sp_pwdp``" -msgstr "``sp_pwdp``" +#~ msgid "``sp_namp``" +#~ msgstr "``sp_namp``" -#: ../../library/spwd.rst:32 -msgid "Encrypted password" -msgstr "" +#~ msgid "1" +#~ msgstr "1" -#: ../../library/spwd.rst:34 -msgid "2" -msgstr "2" +#~ msgid "``sp_pwdp``" +#~ msgstr "``sp_pwdp``" -#: ../../library/spwd.rst:34 -msgid "``sp_lstchg``" -msgstr "``sp_lstchg``" +#~ msgid "2" +#~ msgstr "2" -#: ../../library/spwd.rst:34 -msgid "Date of last change" -msgstr "" +#~ msgid "``sp_lstchg``" +#~ msgstr "``sp_lstchg``" -#: ../../library/spwd.rst:36 -msgid "3" -msgstr "3" +#~ msgid "3" +#~ msgstr "3" -#: ../../library/spwd.rst:36 -msgid "``sp_min``" -msgstr "``sp_min``" +#~ msgid "``sp_min``" +#~ msgstr "``sp_min``" -#: ../../library/spwd.rst:36 -msgid "Minimal number of days between changes" -msgstr "" +#~ msgid "4" +#~ msgstr "4" -#: ../../library/spwd.rst:39 -msgid "4" -msgstr "4" +#~ msgid "``sp_max``" +#~ msgstr "``sp_max``" -#: ../../library/spwd.rst:39 -msgid "``sp_max``" -msgstr "``sp_max``" +#~ msgid "5" +#~ msgstr "5" -#: ../../library/spwd.rst:39 -msgid "Maximum number of days between changes" -msgstr "" +#~ msgid "``sp_warn``" +#~ msgstr "``sp_warn``" -#: ../../library/spwd.rst:42 -msgid "5" -msgstr "5" +#~ msgid "6" +#~ msgstr "6" -#: ../../library/spwd.rst:42 -msgid "``sp_warn``" -msgstr "``sp_warn``" +#~ msgid "``sp_inact``" +#~ msgstr "``sp_inact``" -#: ../../library/spwd.rst:42 -msgid "Number of days before password expires to warn user about it" -msgstr "" +#~ msgid "7" +#~ msgstr "7" -#: ../../library/spwd.rst:45 -msgid "6" -msgstr "6" +#~ msgid "``sp_expire``" +#~ msgstr "``sp_expire``" -#: ../../library/spwd.rst:45 -msgid "``sp_inact``" -msgstr "``sp_inact``" +#~ msgid "8" +#~ msgstr "8" -#: ../../library/spwd.rst:45 -msgid "Number of days after password expires until account is disabled" -msgstr "" - -#: ../../library/spwd.rst:49 -msgid "7" -msgstr "7" - -#: ../../library/spwd.rst:49 -msgid "``sp_expire``" -msgstr "``sp_expire``" - -#: ../../library/spwd.rst:49 -msgid "Number of days since 1970-01-01 when account expires" -msgstr "" +#~ msgid "``sp_flag``" +#~ msgstr "``sp_flag``" -#: ../../library/spwd.rst:52 -msgid "8" -msgstr "8" +#~ msgid "Module :mod:`grp`" +#~ msgstr ":mod:`grp` 模組" -#: ../../library/spwd.rst:52 -msgid "``sp_flag``" -msgstr "``sp_flag``" - -#: ../../library/spwd.rst:52 -msgid "Reserved" -msgstr "" - -#: ../../library/spwd.rst:55 -msgid "" -"The sp_namp and sp_pwdp items are strings, all others are integers. :exc:" -"`KeyError` is raised if the entry asked for cannot be found." -msgstr "" - -#: ../../library/spwd.rst:58 -msgid "The following functions are defined:" -msgstr "" - -#: ../../library/spwd.rst:63 -msgid "Return the shadow password database entry for the given user name." -msgstr "" - -#: ../../library/spwd.rst:65 -msgid "" -"Raises a :exc:`PermissionError` instead of :exc:`KeyError` if the user " -"doesn't have privileges." -msgstr "" - -#: ../../library/spwd.rst:71 -msgid "" -"Return a list of all available shadow password database entries, in " -"arbitrary order." -msgstr "" - -#: ../../library/spwd.rst:77 -msgid "Module :mod:`grp`" -msgstr ":mod:`grp` 模組" - -#: ../../library/spwd.rst:78 -msgid "An interface to the group database, similar to this." -msgstr "" - -#: ../../library/spwd.rst:80 -msgid "Module :mod:`pwd`" -msgstr ":mod:`pwd` 模組" - -#: ../../library/spwd.rst:81 -msgid "An interface to the normal password database, similar to this." -msgstr "" +#~ msgid "Module :mod:`pwd`" +#~ msgstr ":mod:`pwd` 模組" diff --git a/library/sqlite3.po b/library/sqlite3.po index a4b0b34ec1..67b9e51d9c 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -2956,24 +2956,26 @@ msgid "Open a database in read-only mode:" msgstr "" #: ../../library/sqlite3.rst:2457 +#, fuzzy msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" "Traceback (most recent call last):\n" -"OperationalError: attempt to write a readonly database" +"OperationalError: attempt to write a readonly database\n" +">>> con.close()" msgstr "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" "Traceback (most recent call last):\n" "OperationalError: attempt to write a readonly database" -#: ../../library/sqlite3.rst:2464 +#: ../../library/sqlite3.rst:2465 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:2467 +#: ../../library/sqlite3.rst:2468 msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" @@ -2983,11 +2985,11 @@ msgstr "" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" -#: ../../library/sqlite3.rst:2474 +#: ../../library/sqlite3.rst:2475 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2476 +#: ../../library/sqlite3.rst:2477 msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" "con1 = sqlite3.connect(db, uri=True)\n" @@ -3013,24 +3015,24 @@ msgstr "" "con1.close()\n" "con2.close()" -#: ../../library/sqlite3.rst:2490 +#: ../../library/sqlite3.rst:2491 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2499 +#: ../../library/sqlite3.rst:2500 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2501 +#: ../../library/sqlite3.rst:2502 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:2506 +#: ../../library/sqlite3.rst:2507 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -3038,7 +3040,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2511 +#: ../../library/sqlite3.rst:2512 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -3046,7 +3048,7 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2516 +#: ../../library/sqlite3.rst:2517 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" @@ -3054,11 +3056,11 @@ msgstr "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" -#: ../../library/sqlite3.rst:2521 +#: ../../library/sqlite3.rst:2522 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2523 +#: ../../library/sqlite3.rst:2524 msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" ">>> row = res.fetchone()\n" @@ -3073,7 +3075,7 @@ msgid "" ">>> con.close()" msgstr "" -#: ../../library/sqlite3.rst:2539 +#: ../../library/sqlite3.rst:2540 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 " @@ -3081,13 +3083,13 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2544 +#: ../../library/sqlite3.rst:2545 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:2547 +#: ../../library/sqlite3.rst:2548 msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" @@ -3097,12 +3099,12 @@ msgstr "" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" -#: ../../library/sqlite3.rst:2553 +#: ../../library/sqlite3.rst:2554 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2555 +#: ../../library/sqlite3.rst:2556 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = dict_factory\n" @@ -3118,11 +3120,11 @@ msgstr "" "{'a': 1, 'b': 2}\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2564 +#: ../../library/sqlite3.rst:2565 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2566 +#: ../../library/sqlite3.rst:2567 msgid "" "from collections import namedtuple\n" "\n" @@ -3138,11 +3140,11 @@ msgstr "" " cls = namedtuple(\"Row\", fields)\n" " return cls._make(row)" -#: ../../library/sqlite3.rst:2575 +#: ../../library/sqlite3.rst:2576 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2577 +#: ../../library/sqlite3.rst:2578 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = namedtuple_factory\n" @@ -3168,18 +3170,18 @@ msgstr "" "2\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2591 +#: ../../library/sqlite3.rst:2592 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:2599 +#: ../../library/sqlite3.rst:2600 msgid "How to handle non-UTF-8 text encodings" msgstr "" -#: ../../library/sqlite3.rst:2601 +#: ../../library/sqlite3.rst:2602 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " @@ -3187,7 +3189,7 @@ msgid "" "`~Connection.text_factory` to handle such cases." msgstr "" -#: ../../library/sqlite3.rst:2607 +#: ../../library/sqlite3.rst:2608 msgid "" "Because of SQLite's `flexible typing`_, it is not uncommon to encounter " "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " @@ -3198,39 +3200,39 @@ msgid "" "text using this :attr:`~Connection.text_factory`:" msgstr "" -#: ../../library/sqlite3.rst:2616 +#: ../../library/sqlite3.rst:2617 msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" msgstr "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -#: ../../library/sqlite3.rst:2620 +#: ../../library/sqlite3.rst:2621 msgid "" "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " "can use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" -#: ../../library/sqlite3.rst:2623 +#: ../../library/sqlite3.rst:2624 msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" msgstr "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -#: ../../library/sqlite3.rst:2629 +#: ../../library/sqlite3.rst:2630 msgid "" "The :mod:`!sqlite3` module API does not support strings containing " "surrogates." msgstr "" -#: ../../library/sqlite3.rst:2634 +#: ../../library/sqlite3.rst:2635 msgid ":ref:`unicode-howto`" msgstr ":ref:`unicode-howto`" -#: ../../library/sqlite3.rst:2640 +#: ../../library/sqlite3.rst:2641 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2646 +#: ../../library/sqlite3.rst:2647 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2648 +#: ../../library/sqlite3.rst:2649 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -3238,24 +3240,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2657 +#: ../../library/sqlite3.rst:2658 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2659 +#: ../../library/sqlite3.rst:2660 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2664 +#: ../../library/sqlite3.rst:2665 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2668 +#: ../../library/sqlite3.rst:2669 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -3264,21 +3266,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2673 +#: ../../library/sqlite3.rst:2674 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2674 +#: ../../library/sqlite3.rst:2675 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2675 +#: ../../library/sqlite3.rst:2676 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2678 +#: ../../library/sqlite3.rst:2679 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -3287,25 +3289,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2686 +#: ../../library/sqlite3.rst:2687 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2695 +#: ../../library/sqlite3.rst:2696 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2699 +#: ../../library/sqlite3.rst:2700 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2703 +#: ../../library/sqlite3.rst:2704 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -3313,7 +3315,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2709 +#: ../../library/sqlite3.rst:2710 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -3327,7 +3329,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2722 +#: ../../library/sqlite3.rst:2723 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -3337,20 +3339,20 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2730 +#: ../../library/sqlite3.rst:2731 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:2734 +#: ../../library/sqlite3.rst:2735 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2738 +#: ../../library/sqlite3.rst:2739 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." diff --git a/library/stdtypes.po b/library/stdtypes.po index 1db6d495b0..c1709ecb21 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -6448,7 +6448,7 @@ msgstr "" msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " -"from the method). or an iterable of key/value pairs (as tuples or other " +"from the method) or an iterable of key/value pairs (as tuples or other " "iterables of length two). If keyword arguments are specified, the dictionary " "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" diff --git a/library/string.po b/library/string.po index 284bbedd01..b74343801a 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -457,13 +457,13 @@ msgstr "" msgid "The meaning of the various alignment options is as follows:" msgstr "" -#: ../../library/string.rst:342 ../../library/string.rst:373 +#: ../../library/string.rst:342 ../../library/string.rst:374 msgid "Option" msgstr "選項" -#: ../../library/string.rst:342 ../../library/string.rst:373 -#: ../../library/string.rst:456 ../../library/string.rst:467 -#: ../../library/string.rst:502 +#: ../../library/string.rst:342 ../../library/string.rst:374 +#: ../../library/string.rst:457 ../../library/string.rst:468 +#: ../../library/string.rst:503 msgid "Meaning" msgstr "含義" @@ -495,19 +495,20 @@ msgstr "``'='``" 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 " -"alignment option is only valid for numeric types. It becomes the default " -"for numbers when '0' immediately precedes the field width." +"alignment option is only valid for numeric types, excluding :class:" +"`complex`. It becomes the default for numbers when '0' immediately precedes " +"the field width." msgstr "" -#: ../../library/string.rst:356 +#: ../../library/string.rst:357 msgid "``'^'``" msgstr "``'^'``" -#: ../../library/string.rst:356 +#: ../../library/string.rst:357 msgid "Forces the field to be centered within the available space." msgstr "強制欄位在可用空間內置中。" -#: ../../library/string.rst:360 +#: ../../library/string.rst:361 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 " @@ -516,54 +517,54 @@ msgstr "" "請注意,除非有定義了最小欄位寬度,否則欄位寬度將始終與填充它的資料大小相同," "故在該情況下的對齊選項是沒有意義的。" -#: ../../library/string.rst:364 +#: ../../library/string.rst:365 msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" msgstr "*sign* 選項只適用於數字型別,並可為以下之一:" -#: ../../library/string.rst:375 +#: ../../library/string.rst:376 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/string.rst:375 +#: ../../library/string.rst:376 msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." msgstr "表示正數與負數均需使用符號。" -#: ../../library/string.rst:378 +#: ../../library/string.rst:379 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/string.rst:378 +#: ../../library/string.rst:379 msgid "" "indicates that a sign should be used only for negative numbers (this is the " "default behavior)." msgstr "" -#: ../../library/string.rst:367 ../../library/string.rst:381 +#: ../../library/string.rst:368 ../../library/string.rst:382 msgid "space" msgstr "" -#: ../../library/string.rst:381 +#: ../../library/string.rst:382 msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." msgstr "表示正數應使用前導空格,負數應使用減號。" -#: ../../library/string.rst:388 +#: ../../library/string.rst:389 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:392 +#: ../../library/string.rst:393 msgid "Added the ``'z'`` option (see also :pep:`682`)." msgstr "新增 ``'z'`` 選項(請見 :pep:`682`\\ )。" -#: ../../library/string.rst:397 +#: ../../library/string.rst:398 msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " @@ -577,17 +578,17 @@ msgid "" "and ``'G'`` conversions, trailing zeros are not removed from the result." msgstr "" -#: ../../library/string.rst:411 +#: ../../library/string.rst:412 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:415 +#: ../../library/string.rst:416 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:420 +#: ../../library/string.rst:421 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating-point presentation types and for integer presentation " @@ -599,11 +600,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:427 +#: ../../library/string.rst:428 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:430 +#: ../../library/string.rst:431 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " @@ -612,24 +613,25 @@ msgstr "" "*width* 是一個十進位整數,定義了最小總欄位寬度,包括任何前綴、分隔符號和其他" "格式字元。如果未指定,則欄位寬度將由內容決定。" -#: ../../library/string.rst:434 +#: ../../library/string.rst:435 +#, fuzzy 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 " -"is equivalent to a *fill* character of ``'0'`` with an *alignment* type of " -"``'='``." +"(``'0'``) character enables sign-aware zero-padding for numeric types, " +"excluding :class:`complex`. This is equivalent to a *fill* character of " +"``'0'`` with an *alignment* type of ``'='``." msgstr "" "當未給予明確的對齊指示,在 *width* 欄位前面填入零 (``'0'``) 字元將會為數值型" "別啟用有符號察覺的零填充 (sign-aware zero-padding)。這相當於使用 ``'0'`` 為 " "*fill* 字元且對齊類型為 ``'='``。" -#: ../../library/string.rst:439 +#: ../../library/string.rst:440 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "在 *width* 欄位前面加上 ``'0'`` 不再影響字串的預設對齊方式。" -#: ../../library/string.rst:443 +#: ../../library/string.rst:444 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -644,89 +646,89 @@ msgstr "" "示類型,該欄位指定最大欄位大小 - 換言之,將使用欄位中的多少字元。整數表示類型" "不允許使用 *precision*。" -#: ../../library/string.rst:451 +#: ../../library/string.rst:452 msgid "Finally, the *type* determines how the data should be presented." msgstr "最終,型別決定了資料將會如何呈現" -#: ../../library/string.rst:453 +#: ../../library/string.rst:454 msgid "The available string presentation types are:" msgstr "可用的字串表示型別有:" -#: ../../library/string.rst:456 ../../library/string.rst:467 -#: ../../library/string.rst:502 +#: ../../library/string.rst:457 ../../library/string.rst:468 +#: ../../library/string.rst:503 msgid "Type" msgstr "型別" -#: ../../library/string.rst:458 +#: ../../library/string.rst:459 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:458 +#: ../../library/string.rst:459 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:461 ../../library/string.rst:490 -#: ../../library/string.rst:575 +#: ../../library/string.rst:462 ../../library/string.rst:491 +#: ../../library/string.rst:576 msgid "None" msgstr "None" -#: ../../library/string.rst:461 +#: ../../library/string.rst:462 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:464 +#: ../../library/string.rst:465 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:469 +#: ../../library/string.rst:470 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:469 +#: ../../library/string.rst:470 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:471 +#: ../../library/string.rst:472 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:471 +#: ../../library/string.rst:472 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:474 +#: ../../library/string.rst:475 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:474 +#: ../../library/string.rst:475 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:476 +#: ../../library/string.rst:477 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:476 +#: ../../library/string.rst:477 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:478 +#: ../../library/string.rst:479 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:478 +#: ../../library/string.rst:479 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" -#: ../../library/string.rst:481 +#: ../../library/string.rst:482 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:481 +#: ../../library/string.rst:482 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 " @@ -735,21 +737,21 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:486 ../../library/string.rst:568 +#: ../../library/string.rst:487 ../../library/string.rst:569 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:486 +#: ../../library/string.rst:487 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:490 +#: ../../library/string.rst:491 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:493 +#: ../../library/string.rst:494 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating-point presentation types listed below (except ``'n'`` and " @@ -757,17 +759,17 @@ msgid "" "floating-point number before formatting." msgstr "" -#: ../../library/string.rst:498 +#: ../../library/string.rst:499 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:504 +#: ../../library/string.rst:505 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:504 +#: ../../library/string.rst:505 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -779,21 +781,21 @@ msgid "" "is used." msgstr "" -#: ../../library/string.rst:515 +#: ../../library/string.rst:516 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:515 +#: ../../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:518 +#: ../../library/string.rst:519 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:518 +#: ../../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 " @@ -803,21 +805,21 @@ msgid "" "point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:527 +#: ../../library/string.rst:528 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:527 +#: ../../library/string.rst:528 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:530 +#: ../../library/string.rst:531 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:530 +#: ../../library/string.rst:531 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 " @@ -825,7 +827,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:537 +#: ../../library/string.rst:538 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -838,7 +840,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:550 +#: ../../library/string.rst:551 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -848,40 +850,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:559 +#: ../../library/string.rst:560 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:565 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:564 +#: ../../library/string.rst:565 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:569 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:573 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:572 +#: ../../library/string.rst:573 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:576 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -890,30 +892,42 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:583 +#: ../../library/string.rst:584 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:587 +#: ../../library/string.rst:588 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:595 +#: ../../library/string.rst:592 +msgid "" +"The available presentation types for :class:`complex` are the same as those " +"for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " +"components of a complex number are formatted as floating-point numbers, " +"according to the specified presentation type. They are separated by the " +"mandatory sign of the imaginary part, the latter being terminated by a ``j`` " +"suffix. If the presentation type is missing, the result will match the " +"output of :func:`str` (complex numbers with a non-zero real part are also " +"surrounded by parentheses), possibly altered by other format modifiers." +msgstr "" + +#: ../../library/string.rst:605 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:597 +#: ../../library/string.rst:607 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:600 +#: ../../library/string.rst:610 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 " @@ -922,17 +936,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:604 +#: ../../library/string.rst:614 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:607 +#: ../../library/string.rst:617 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:609 +#: ../../library/string.rst:619 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -947,11 +961,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:620 +#: ../../library/string.rst:630 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:622 +#: ../../library/string.rst:632 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -961,11 +975,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:628 +#: ../../library/string.rst:638 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:630 +#: ../../library/string.rst:640 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -982,22 +996,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:643 +#: ../../library/string.rst:653 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:645 +#: ../../library/string.rst:655 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:649 +#: ../../library/string.rst:659 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:651 +#: ../../library/string.rst:661 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1007,11 +1021,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:654 +#: ../../library/string.rst:664 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:656 +#: ../../library/string.rst:666 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1023,11 +1037,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:665 +#: ../../library/string.rst:675 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:667 +#: ../../library/string.rst:677 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1038,12 +1052,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:674 +#: ../../library/string.rst:684 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:676 +#: ../../library/string.rst:686 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1053,11 +1067,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:683 +#: ../../library/string.rst:693 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:685 +#: ../../library/string.rst:695 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1065,11 +1079,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:688 +#: ../../library/string.rst:698 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:690 +#: ../../library/string.rst:700 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1081,11 +1095,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:695 +#: ../../library/string.rst:705 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:697 +#: ../../library/string.rst:707 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1097,11 +1111,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:702 +#: ../../library/string.rst:712 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:704 +#: ../../library/string.rst:714 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1159,11 +1173,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:736 +#: ../../library/string.rst:746 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:738 +#: ../../library/string.rst:748 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1177,17 +1191,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:748 +#: ../../library/string.rst:758 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:750 +#: ../../library/string.rst:760 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:752 +#: ../../library/string.rst:762 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1197,30 +1211,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:759 +#: ../../library/string.rst:769 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:763 +#: ../../library/string.rst:773 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:766 +#: ../../library/string.rst:776 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:772 +#: ../../library/string.rst:782 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:777 +#: ../../library/string.rst:787 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1232,7 +1246,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:786 +#: ../../library/string.rst:796 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1245,7 +1259,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:792 +#: ../../library/string.rst:802 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 " @@ -1259,7 +1273,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:802 +#: ../../library/string.rst:812 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1267,18 +1281,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:810 +#: ../../library/string.rst:820 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:815 +#: ../../library/string.rst:825 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:819 +#: ../../library/string.rst:829 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." @@ -1286,11 +1300,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:822 +#: ../../library/string.rst:832 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:824 +#: ../../library/string.rst:834 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1324,7 +1338,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:840 +#: ../../library/string.rst:850 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1334,7 +1348,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:845 +#: ../../library/string.rst:855 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1348,7 +1362,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:852 +#: ../../library/string.rst:862 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1356,19 +1370,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:859 +#: ../../library/string.rst:869 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:863 +#: ../../library/string.rst:873 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:867 +#: ../../library/string.rst:877 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1377,7 +1391,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:875 +#: ../../library/string.rst:885 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1386,7 +1400,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:883 +#: ../../library/string.rst:893 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1395,13 +1409,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:889 +#: ../../library/string.rst:899 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:892 +#: ../../library/string.rst:902 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1409,7 +1423,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:895 +#: ../../library/string.rst:905 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1417,7 +1431,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:898 +#: ../../library/string.rst:908 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1425,7 +1439,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:901 +#: ../../library/string.rst:911 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1433,11 +1447,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:906 +#: ../../library/string.rst:916 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:910 +#: ../../library/string.rst:920 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1456,9 +1470,9 @@ msgid "{} (curly brackets)" msgstr "{} (花括號)" #: ../../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 +#: ../../library/string.rst:368 ../../library/string.rst:387 +#: ../../library/string.rst:396 ../../library/string.rst:410 +#: ../../library/string.rst:419 msgid "in string formatting" msgstr "於字串格式化" @@ -1494,34 +1508,34 @@ msgstr "= (等於)" msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/string.rst:367 +#: ../../library/string.rst:368 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/string.rst:367 +#: ../../library/string.rst:368 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/string.rst:386 +#: ../../library/string.rst:387 msgid "z" msgstr "z" -#: ../../library/string.rst:395 +#: ../../library/string.rst:396 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/string.rst:409 +#: ../../library/string.rst:410 msgid ", (comma)" msgstr ", (逗號)" -#: ../../library/string.rst:418 +#: ../../library/string.rst:419 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:746 +#: ../../library/string.rst:756 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:746 +#: ../../library/string.rst:756 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/sunau.po b/library/sunau.po index c4917b1d20..3914ecd2f4 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,366 +21,317 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/sunau.rst:2 -msgid ":mod:`sunau` --- Read and write Sun AU files" +#, fuzzy +msgid ":mod:`!sunau` --- Read and write Sun AU files" msgstr ":mod:`sunau` --- 讀寫 Sun AU 檔案" #: ../../library/sunau.rst:10 -msgid "**Source code:** :source:`Lib/sunau.py`" -msgstr "**原始碼:**\\ :source:`Lib/sunau.py`" - -#: ../../library/sunau.rst:12 -msgid "" -"The :mod:`sunau` module is deprecated (see :pep:`PEP 594 <594#sunau>` for " -"details)." -msgstr "" -":mod:`sunau` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#sunau>`\\ )。" - -#: ../../library/sunau.rst:18 -msgid "" -"The :mod:`sunau` module provides a convenient interface to the Sun AU sound " -"format. Note that this module is interface-compatible with the modules :mod:" -"`aifc` and :mod:`wave`." -msgstr "" -":mod:`sunau` 模組 (module) 提供了一個處理 Sun AU 聲音格式的便利介面。請注意此" -"模組與 :mod:`aifc` 和 :mod:`wave` 的介面是相容的。" - -#: ../../library/sunau.rst:22 -msgid "" -"An audio file consists of a header followed by the data. The fields of the " -"header are:" -msgstr "音訊檔案由標頭 (header) 和資料組成。標頭包含以下欄位:" - -#: ../../library/sunau.rst:26 -msgid "Field" -msgstr "欄位" - -#: ../../library/sunau.rst:26 -msgid "Contents" -msgstr "內容" - -#: ../../library/sunau.rst:28 -msgid "magic word" -msgstr "magic word" - -#: ../../library/sunau.rst:28 -msgid "The four bytes ``.snd``." -msgstr "四個位元組 ``.snd``。" - -#: ../../library/sunau.rst:30 -msgid "header size" -msgstr "header size" - -#: ../../library/sunau.rst:30 -msgid "Size of the header, including info, in bytes." -msgstr "標頭的大小,包括資訊,以位元組為單位。" - -#: ../../library/sunau.rst:32 -msgid "data size" -msgstr "data size" - -#: ../../library/sunau.rst:32 -msgid "Physical size of the data, in bytes." -msgstr "資料的物理大小,以位元組為單位。" - -#: ../../library/sunau.rst:34 -msgid "encoding" -msgstr "encoding" - -#: ../../library/sunau.rst:34 -msgid "Indicates how the audio samples are encoded." -msgstr "表示音訊取樣的編碼方式。" - -#: ../../library/sunau.rst:36 -msgid "sample rate" -msgstr "sample rate" - -#: ../../library/sunau.rst:36 -msgid "The sampling rate." -msgstr "取樣頻率。" - -#: ../../library/sunau.rst:38 -msgid "# of channels" -msgstr "# of channels" - -#: ../../library/sunau.rst:38 -msgid "The number of channels in the samples." -msgstr "取樣中的聲道數。" - -#: ../../library/sunau.rst:40 -msgid "info" -msgstr "info" - -#: ../../library/sunau.rst:40 msgid "" -"ASCII string giving a description of the audio file (padded with null bytes)." -msgstr "音訊檔案描述的 ASCII 字串(會以空位元組填補 (pad))。" - -#: ../../library/sunau.rst:44 -msgid "" -"Apart from the info field, all header fields are 4 bytes in size. They are " -"all 32-bit unsigned integers encoded in big-endian byte order." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -"除了 info 欄位以外,所有其他標頭中欄位的大小都是 4 位元組,他們都是以 big-" -"endian 位元組順序所編碼的 32-bit(位元)unsigned integers(無符號整數)" - -#: ../../library/sunau.rst:47 -msgid "The :mod:`sunau` module defines the following functions:" -msgstr ":mod:`sunau` 模組定義了以下函式:" -#: ../../library/sunau.rst:52 +#: ../../library/sunau.rst:14 msgid "" -"If *file* is a string, open the file by that name, otherwise treat it as a " -"seekable file-like object. *mode* can be any of" +"The last version of Python that provided the :mod:`!sunau` module was " +"`Python 3.12 `_." msgstr "" -"如 *file* 是一個字串,則以此名開啟檔案,否則把它當作一個可以被搜尋的 file-" -"like object(類檔案物件)。*mode* 可以是以下任一" -#: ../../library/sunau.rst:55 -msgid "``'r'``" -msgstr "``'r'``" +#~ msgid "**Source code:** :source:`Lib/sunau.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/sunau.py`" -#: ../../library/sunau.rst:56 -msgid "Read only mode." -msgstr "唯讀模式。" +#~ msgid "" +#~ "The :mod:`sunau` module is deprecated (see :pep:`PEP 594 <594#sunau>` for " +#~ "details)." +#~ msgstr "" +#~ ":mod:`sunau` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#sunau>`\\ )。" -#: ../../library/sunau.rst:58 -msgid "``'w'``" -msgstr "``'w'``" +#~ msgid "" +#~ "The :mod:`sunau` module provides a convenient interface to the Sun AU " +#~ "sound format. Note that this module is interface-compatible with the " +#~ "modules :mod:`aifc` and :mod:`wave`." +#~ msgstr "" +#~ ":mod:`sunau` 模組 (module) 提供了一個處理 Sun AU 聲音格式的便利介面。請注" +#~ "意此模組與 :mod:`aifc` 和 :mod:`wave` 的介面是相容的。" -#: ../../library/sunau.rst:59 -msgid "Write only mode." -msgstr "唯寫模式。" +#~ msgid "" +#~ "An audio file consists of a header followed by the data. The fields of " +#~ "the header are:" +#~ msgstr "音訊檔案由標頭 (header) 和資料組成。標頭包含以下欄位:" -#: ../../library/sunau.rst:61 -msgid "Note that it does not allow read/write files." -msgstr "請注意這並不允許讀/寫檔案。" +#~ msgid "Field" +#~ msgstr "欄位" -#: ../../library/sunau.rst:63 -msgid "" -"A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of " -"``'w'`` or ``'wb'`` returns an :class:`AU_write` object." -msgstr "" -"*mode* 若設為 ``'r'`` 則會回傳一個 :class:`AU_read` 物件,若設為 ``'w'`` 或 " -"``'wb'`` 則回傳 :class:`AU_write` 物件。" +#~ msgid "Contents" +#~ msgstr "內容" -#: ../../library/sunau.rst:67 -msgid "The :mod:`sunau` module defines the following exception:" -msgstr ":mod:`sunau` 模組定義了以下例外:" +#~ msgid "magic word" +#~ msgstr "magic word" -#: ../../library/sunau.rst:71 -msgid "" -"An error raised when something is impossible because of Sun AU specs or " -"implementation deficiency." -msgstr "在不符合 Sun AU 規格或實作上有所不足而無法達成某些目的時會引發的錯誤。" +#~ msgid "The four bytes ``.snd``." +#~ msgstr "四個位元組 ``.snd``。" -#: ../../library/sunau.rst:75 -msgid "The :mod:`sunau` module defines the following data items:" -msgstr ":mod:`sunau` 模組定義了以下資料條目:" +#~ msgid "header size" +#~ msgstr "header size" -#: ../../library/sunau.rst:79 -msgid "" -"An integer every valid Sun AU file begins with, stored in big-endian form. " -"This is the string ``.snd`` interpreted as an integer." -msgstr "" -"每個 Sun AU 檔案都會作為開頭的一個整數,以 big-endian 形式儲存。這也是 ``." -"snd`` 所直接轉譯成一個整數的字串。" +#~ msgid "Size of the header, including info, in bytes." +#~ msgstr "標頭的大小,包括資訊,以位元組為單位。" -#: ../../library/sunau.rst:90 -msgid "" -"Values of the encoding field from the AU header which are supported by this " -"module." -msgstr "此模組有支援的 AU 標頭中 encoding 欄位值。" +#~ msgid "data size" +#~ msgstr "data size" -#: ../../library/sunau.rst:101 -msgid "" -"Additional known values of the encoding field from the AU header, but which " -"are not supported by this module." -msgstr "額外已知的 AU 標頭中 encoding 欄位值,但不被此模組支援。" +#~ msgid "Physical size of the data, in bytes." +#~ msgstr "資料的物理大小,以位元組為單位。" -#: ../../library/sunau.rst:108 -msgid "AU_read Objects" -msgstr "AU_read 物件" +#~ msgid "encoding" +#~ msgstr "encoding" -#: ../../library/sunau.rst:110 -msgid "" -"AU_read objects, as returned by :func:`.open` above, have the following " -"methods:" -msgstr "如上述 :func:`.open` 所回傳的 AU_read 物件擁有以下 method(方法):" - -#: ../../library/sunau.rst:115 -msgid "" -"Close the stream, and make the instance unusable. (This is called " -"automatically on deletion.)" -msgstr "關閉串流 (stream),並使該實例無法被使用。(這會自動在刪除時呼叫。)" +#~ msgid "Indicates how the audio samples are encoded." +#~ msgstr "表示音訊取樣的編碼方式。" -#: ../../library/sunau.rst:121 -msgid "Returns number of audio channels (1 for mono, 2 for stereo)." -msgstr "回傳音訊聲道數量(單聲道為 1,雙聲道為 2)。" +#~ msgid "sample rate" +#~ msgstr "sample rate" -#: ../../library/sunau.rst:126 -msgid "Returns sample width in bytes." -msgstr "回傳取樣位元組長度。" +#~ msgid "The sampling rate." +#~ msgstr "取樣頻率。" -#: ../../library/sunau.rst:131 -msgid "Returns sampling frequency." -msgstr "回傳取樣頻率。" +#~ msgid "# of channels" +#~ msgstr "# of channels" -#: ../../library/sunau.rst:136 -msgid "Returns number of audio frames." -msgstr "回傳音訊總幀數。" +#~ msgid "The number of channels in the samples." +#~ msgstr "取樣中的聲道數。" -#: ../../library/sunau.rst:141 -msgid "" -"Returns compression type. Supported compression types are ``'ULAW'``, " -"``'ALAW'`` and ``'NONE'``." -msgstr "回傳壓縮種類。支援的壓縮種類有 ``'ULAW'``、``'ALAW'`` 和 ``'NONE'``。" +#~ msgid "info" +#~ msgstr "info" -#: ../../library/sunau.rst:147 -msgid "" -"Human-readable version of :meth:`getcomptype`. The supported types have the " -"respective names ``'CCITT G.711 u-law'``, ``'CCITT G.711 A-law'`` and ``'not " -"compressed'``." -msgstr "" -"可被人類讀懂 (human-readable) 的 :meth:`getcomptype`。有被支援的種類分別有這" -"些名稱 ``'CCITT G.711 u-law'``、``'CCITT G.711 A-law'`` 和 ``'not " -"compressed'``。" +#~ msgid "" +#~ "ASCII string giving a description of the audio file (padded with null " +#~ "bytes)." +#~ msgstr "音訊檔案描述的 ASCII 字串(會以空位元組填補 (pad))。" -#: ../../library/sunau.rst:154 -msgid "" -"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " -"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" -"`get\\*` methods." -msgstr "" -"回傳一個 :func:`~collections.namedtuple` ``(nchannels, sampwidth, framerate, " -"nframes, comptype, compname)``,與 :meth:`get\\*` methods 的輸出相同。" - -#: ../../library/sunau.rst:161 -msgid "" -"Reads and returns at most *n* frames of audio, as a :class:`bytes` object. " -"The data will be returned in linear format. If the original data is in u-" -"LAW format, it will be converted." -msgstr "" -"讀取並以 :class:`bytes` 物件形式回傳音檔中至多 *n* 幀,資料會以線性格式 " -"(linear format) 回傳,如果原始資料是 u-LAW 格式,則它會被轉換。" - -#: ../../library/sunau.rst:168 -msgid "Rewind the file pointer to the beginning of the audio stream." -msgstr "重置檔案指標 (file pointer) 至音訊開頭。" - -#: ../../library/sunau.rst:170 -msgid "" -"The following two methods define a term \"position\" which is compatible " -"between them, and is otherwise implementation dependent." -msgstr "" -"以下兩個 methods 都定義了在它們之間相容的 \"position\",否則會與實作相依。" - -#: ../../library/sunau.rst:176 -msgid "" -"Set the file pointer to the specified position. Only values returned from :" -"meth:`tell` should be used for *pos*." -msgstr "" -"設定檔案指標至指定的位置,只有 :meth:`tell` 的回傳值應被做為 *pos* 使用。" - -#: ../../library/sunau.rst:182 -msgid "" -"Return current file pointer position. Note that the returned value has " -"nothing to do with the actual position in the file." -msgstr "回傳當前檔案指標位置,要注意回傳值和真實檔案中的位置無關。" - -#: ../../library/sunau.rst:185 -msgid "" -"The following two functions are defined for compatibility with the :mod:" -"`aifc`, and don't do anything interesting." -msgstr "以下兩個函式單純是為了和 :mod:`aifc` 相容而定義,並沒有做什麼特別的。" - -#: ../../library/sunau.rst:191 -msgid "Returns ``None``." -msgstr "回傳 ``None``。" - -#: ../../library/sunau.rst:196 -msgid "Raise an error." -msgstr "引發錯誤。" - -#: ../../library/sunau.rst:202 -msgid "AU_write Objects" -msgstr "AU_write 物件" - -#: ../../library/sunau.rst:204 -msgid "" -"AU_write objects, as returned by :func:`.open` above, have the following " -"methods:" -msgstr "如上述 :func:`.open` 所回傳的 AU_write 物件擁有以下 methods:" - -#: ../../library/sunau.rst:209 -msgid "Set the number of channels." -msgstr "設定聲道數。" - -#: ../../library/sunau.rst:214 -msgid "Set the sample width (in bytes.)" -msgstr "設定取樣寬度(以位元組為單位)。" - -#: ../../library/sunau.rst:216 -msgid "Added support for 24-bit samples." -msgstr "新增對於 24-bit 取樣的支援。" - -#: ../../library/sunau.rst:222 -msgid "Set the frame rate." -msgstr "設定影格率 (frame rate)。" - -#: ../../library/sunau.rst:227 -msgid "" -"Set the number of frames. This can be later changed, when and if more " -"frames are written." -msgstr "設定幀數,該值可以在寫入更多幀後修改。" - -#: ../../library/sunau.rst:233 -msgid "" -"Set the compression type and description. Only ``'NONE'`` and ``'ULAW'`` are " -"supported on output." -msgstr "設定壓縮種類和敘述,輸出只支援 ``'NONE'`` 和 ``'ULAW'``。" - -#: ../../library/sunau.rst:239 -msgid "" -"The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, " -"compname)``, with values valid for the :meth:`set\\*` methods. Set all " -"parameters." -msgstr "" -"*tuple* 應為 ``(nchannels, sampwidth, framerate, nframes, comptype, " -"compname)`` 形式,各個值應該要是 :meth:`set\\*` methods 能有效接受的值。該函" -"數會一次設定所有參數。" - -#: ../../library/sunau.rst:246 -msgid "" -"Return current position in the file, with the same disclaimer for the :meth:" -"`AU_read.tell` and :meth:`AU_read.setpos` methods." -msgstr "" -"回傳當前檔案中的位置,帶有和 :meth:`AU_read.tell` 與 :meth:`AU_read.setpos` " -"方法相同的免責聲明 (disclaimer)。" - -#: ../../library/sunau.rst:252 -msgid "Write audio frames, without correcting *nframes*." -msgstr "寫入音訊資料但不更新 *nframes*。" - -#: ../../library/sunau.rst:254 ../../library/sunau.rst:262 -msgid "Any :term:`bytes-like object` is now accepted." -msgstr "現在可接受任意 :term:`bytes-like object`。" - -#: ../../library/sunau.rst:260 -msgid "Write audio frames and make sure *nframes* is correct." -msgstr "寫入音訊資料並更新 *nframes* 以確保其正確性。" - -#: ../../library/sunau.rst:268 -msgid "Make sure *nframes* is correct, and close the file." -msgstr "確保 *nframes* 是正確的,並關閉檔案。" - -#: ../../library/sunau.rst:270 -msgid "This method is called upon deletion." -msgstr "此 method 會在刪除時呼叫。" - -#: ../../library/sunau.rst:272 -msgid "" -"Note that it is invalid to set any parameters after calling :meth:" -"`writeframes` or :meth:`writeframesraw`." -msgstr "" -"請注意,在呼叫 :meth:`writeframes` 或 :meth:`writeframesraw` 後設定任何參數都" -"是無效的。" +#~ msgid "" +#~ "Apart from the info field, all header fields are 4 bytes in size. They " +#~ "are all 32-bit unsigned integers encoded in big-endian byte order." +#~ msgstr "" +#~ "除了 info 欄位以外,所有其他標頭中欄位的大小都是 4 位元組,他們都是以 big-" +#~ "endian 位元組順序所編碼的 32-bit(位元)unsigned integers(無符號整數)" + +#~ msgid "The :mod:`sunau` module defines the following functions:" +#~ msgstr ":mod:`sunau` 模組定義了以下函式:" + +#~ msgid "" +#~ "If *file* is a string, open the file by that name, otherwise treat it as " +#~ "a seekable file-like object. *mode* can be any of" +#~ msgstr "" +#~ "如 *file* 是一個字串,則以此名開啟檔案,否則把它當作一個可以被搜尋的 file-" +#~ "like object(類檔案物件)。*mode* 可以是以下任一" + +#~ msgid "``'r'``" +#~ msgstr "``'r'``" + +#~ msgid "Read only mode." +#~ msgstr "唯讀模式。" + +#~ msgid "``'w'``" +#~ msgstr "``'w'``" + +#~ msgid "Write only mode." +#~ msgstr "唯寫模式。" + +#~ msgid "Note that it does not allow read/write files." +#~ msgstr "請注意這並不允許讀/寫檔案。" + +#~ msgid "" +#~ "A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of " +#~ "``'w'`` or ``'wb'`` returns an :class:`AU_write` object." +#~ msgstr "" +#~ "*mode* 若設為 ``'r'`` 則會回傳一個 :class:`AU_read` 物件,若設為 ``'w'`` " +#~ "或 ``'wb'`` 則回傳 :class:`AU_write` 物件。" + +#~ msgid "The :mod:`sunau` module defines the following exception:" +#~ msgstr ":mod:`sunau` 模組定義了以下例外:" + +#~ msgid "" +#~ "An error raised when something is impossible because of Sun AU specs or " +#~ "implementation deficiency." +#~ msgstr "" +#~ "在不符合 Sun AU 規格或實作上有所不足而無法達成某些目的時會引發的錯誤。" + +#~ msgid "The :mod:`sunau` module defines the following data items:" +#~ msgstr ":mod:`sunau` 模組定義了以下資料條目:" + +#~ msgid "" +#~ "An integer every valid Sun AU file begins with, stored in big-endian " +#~ "form. This is the string ``.snd`` interpreted as an integer." +#~ msgstr "" +#~ "每個 Sun AU 檔案都會作為開頭的一個整數,以 big-endian 形式儲存。這也是 ``." +#~ "snd`` 所直接轉譯成一個整數的字串。" + +#~ msgid "" +#~ "Values of the encoding field from the AU header which are supported by " +#~ "this module." +#~ msgstr "此模組有支援的 AU 標頭中 encoding 欄位值。" + +#~ msgid "" +#~ "Additional known values of the encoding field from the AU header, but " +#~ "which are not supported by this module." +#~ msgstr "額外已知的 AU 標頭中 encoding 欄位值,但不被此模組支援。" + +#~ msgid "AU_read Objects" +#~ msgstr "AU_read 物件" + +#~ msgid "" +#~ "AU_read objects, as returned by :func:`.open` above, have the following " +#~ "methods:" +#~ msgstr "如上述 :func:`.open` 所回傳的 AU_read 物件擁有以下 method(方法):" + +#~ msgid "" +#~ "Close the stream, and make the instance unusable. (This is called " +#~ "automatically on deletion.)" +#~ msgstr "關閉串流 (stream),並使該實例無法被使用。(這會自動在刪除時呼叫。)" + +#~ msgid "Returns number of audio channels (1 for mono, 2 for stereo)." +#~ msgstr "回傳音訊聲道數量(單聲道為 1,雙聲道為 2)。" + +#~ msgid "Returns sample width in bytes." +#~ msgstr "回傳取樣位元組長度。" + +#~ msgid "Returns sampling frequency." +#~ msgstr "回傳取樣頻率。" + +#~ msgid "Returns number of audio frames." +#~ msgstr "回傳音訊總幀數。" + +#~ msgid "" +#~ "Returns compression type. Supported compression types are ``'ULAW'``, " +#~ "``'ALAW'`` and ``'NONE'``." +#~ msgstr "" +#~ "回傳壓縮種類。支援的壓縮種類有 ``'ULAW'``、``'ALAW'`` 和 ``'NONE'``。" + +#~ msgid "" +#~ "Human-readable version of :meth:`getcomptype`. The supported types have " +#~ "the respective names ``'CCITT G.711 u-law'``, ``'CCITT G.711 A-law'`` and " +#~ "``'not compressed'``." +#~ msgstr "" +#~ "可被人類讀懂 (human-readable) 的 :meth:`getcomptype`。有被支援的種類分別有" +#~ "這些名稱 ``'CCITT G.711 u-law'``、``'CCITT G.711 A-law'`` 和 ``'not " +#~ "compressed'``。" + +#~ msgid "" +#~ "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " +#~ "framerate, nframes, comptype, compname)``, equivalent to output of the :" +#~ "meth:`get\\*` methods." +#~ msgstr "" +#~ "回傳一個 :func:`~collections.namedtuple` ``(nchannels, sampwidth, " +#~ "framerate, nframes, comptype, compname)``,與 :meth:`get\\*` methods 的輸" +#~ "出相同。" + +#~ msgid "" +#~ "Reads and returns at most *n* frames of audio, as a :class:`bytes` " +#~ "object. The data will be returned in linear format. If the original " +#~ "data is in u-LAW format, it will be converted." +#~ msgstr "" +#~ "讀取並以 :class:`bytes` 物件形式回傳音檔中至多 *n* 幀,資料會以線性格式 " +#~ "(linear format) 回傳,如果原始資料是 u-LAW 格式,則它會被轉換。" + +#~ msgid "Rewind the file pointer to the beginning of the audio stream." +#~ msgstr "重置檔案指標 (file pointer) 至音訊開頭。" + +#~ msgid "" +#~ "The following two methods define a term \"position\" which is compatible " +#~ "between them, and is otherwise implementation dependent." +#~ msgstr "" +#~ "以下兩個 methods 都定義了在它們之間相容的 \"position\",否則會與實作相依。" + +#~ msgid "" +#~ "Set the file pointer to the specified position. Only values returned " +#~ "from :meth:`tell` should be used for *pos*." +#~ msgstr "" +#~ "設定檔案指標至指定的位置,只有 :meth:`tell` 的回傳值應被做為 *pos* 使用。" + +#~ msgid "" +#~ "Return current file pointer position. Note that the returned value has " +#~ "nothing to do with the actual position in the file." +#~ msgstr "回傳當前檔案指標位置,要注意回傳值和真實檔案中的位置無關。" + +#~ msgid "" +#~ "The following two functions are defined for compatibility with the :mod:" +#~ "`aifc`, and don't do anything interesting." +#~ msgstr "" +#~ "以下兩個函式單純是為了和 :mod:`aifc` 相容而定義,並沒有做什麼特別的。" + +#~ msgid "Returns ``None``." +#~ msgstr "回傳 ``None``。" + +#~ msgid "Raise an error." +#~ msgstr "引發錯誤。" + +#~ msgid "AU_write Objects" +#~ msgstr "AU_write 物件" + +#~ msgid "" +#~ "AU_write objects, as returned by :func:`.open` above, have the following " +#~ "methods:" +#~ msgstr "如上述 :func:`.open` 所回傳的 AU_write 物件擁有以下 methods:" + +#~ msgid "Set the number of channels." +#~ msgstr "設定聲道數。" + +#~ msgid "Set the sample width (in bytes.)" +#~ msgstr "設定取樣寬度(以位元組為單位)。" + +#~ msgid "Added support for 24-bit samples." +#~ msgstr "新增對於 24-bit 取樣的支援。" + +#~ msgid "Set the frame rate." +#~ msgstr "設定影格率 (frame rate)。" + +#~ msgid "" +#~ "Set the number of frames. This can be later changed, when and if more " +#~ "frames are written." +#~ msgstr "設定幀數,該值可以在寫入更多幀後修改。" + +#~ msgid "" +#~ "Set the compression type and description. Only ``'NONE'`` and ``'ULAW'`` " +#~ "are supported on output." +#~ msgstr "設定壓縮種類和敘述,輸出只支援 ``'NONE'`` 和 ``'ULAW'``。" + +#~ msgid "" +#~ "The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, " +#~ "comptype, compname)``, with values valid for the :meth:`set\\*` methods. " +#~ "Set all parameters." +#~ msgstr "" +#~ "*tuple* 應為 ``(nchannels, sampwidth, framerate, nframes, comptype, " +#~ "compname)`` 形式,各個值應該要是 :meth:`set\\*` methods 能有效接受的值。該" +#~ "函數會一次設定所有參數。" + +#~ msgid "" +#~ "Return current position in the file, with the same disclaimer for the :" +#~ "meth:`AU_read.tell` and :meth:`AU_read.setpos` methods." +#~ msgstr "" +#~ "回傳當前檔案中的位置,帶有和 :meth:`AU_read.tell` 與 :meth:`AU_read." +#~ "setpos` 方法相同的免責聲明 (disclaimer)。" + +#~ msgid "Write audio frames, without correcting *nframes*." +#~ msgstr "寫入音訊資料但不更新 *nframes*。" + +#~ msgid "Any :term:`bytes-like object` is now accepted." +#~ msgstr "現在可接受任意 :term:`bytes-like object`。" + +#~ msgid "Write audio frames and make sure *nframes* is correct." +#~ msgstr "寫入音訊資料並更新 *nframes* 以確保其正確性。" + +#~ msgid "Make sure *nframes* is correct, and close the file." +#~ msgstr "確保 *nframes* 是正確的,並關閉檔案。" + +#~ msgid "This method is called upon deletion." +#~ msgstr "此 method 會在刪除時呼叫。" + +#~ msgid "" +#~ "Note that it is invalid to set any parameters after calling :meth:" +#~ "`writeframes` or :meth:`writeframesraw`." +#~ msgstr "" +#~ "請注意,在呼叫 :meth:`writeframes` 或 :meth:`writeframesraw` 後設定任何參" +#~ "數都是無效的。" diff --git a/library/sys.po b/library/sys.po index 2df11db85e..082123fe64 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,10 +44,10 @@ msgstr "" #: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369 #: ../../library/sys.rst:760 ../../library/sys.rst:778 -#: ../../library/sys.rst:991 ../../library/sys.rst:1490 -#: ../../library/sys.rst:1731 ../../library/sys.rst:1746 -#: ../../library/sys.rst:1754 ../../library/sys.rst:1770 -#: ../../library/sys.rst:2014 +#: ../../library/sys.rst:1020 ../../library/sys.rst:1519 +#: ../../library/sys.rst:1760 ../../library/sys.rst:1775 +#: ../../library/sys.rst:1783 ../../library/sys.rst:1799 +#: ../../library/sys.rst:2043 msgid "Availability" msgstr "" @@ -1177,15 +1177,48 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" +#: ../../library/sys.rst:925 +msgid "" +"This function only exists if CPython was built using the specialized " +"configure option :option:`--with-trace-refs`. It is intended only for " +"debugging garbage-collection issues." +msgstr "" + #: ../../library/sys.rst:929 +msgid "" +"Return a list of up to *limit* dynamically allocated Python objects. If " +"*type* is given, only objects of that exact type (not subtypes) are included." +msgstr "" + +#: ../../library/sys.rst:933 +msgid "" +"Objects from the list are not safe to use. Specifically, the result will " +"include objects from all interpreters that share their object allocator " +"state (that is, ones created with :c:member:`PyInterpreterConfig." +"use_main_obmalloc` set to 1 or using :c:func:`Py_NewInterpreter`, and the :" +"ref:`main interpreter `). Mixing objects from " +"different interpreters may lead to crashes or other unexpected behavior." +msgstr "" + +#: ../../library/sys.rst:944 +msgid "" +"This function should be used for specialized purposes only. It is not " +"guaranteed to exist in all implementations of Python." +msgstr "" + +#: ../../library/sys.rst:949 +msgid "The result may include objects from other interpreters." +msgstr "" + +#: ../../library/sys.rst:958 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:967 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:971 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1193,7 +1226,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:950 +#: ../../library/sys.rst:979 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1205,54 +1238,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:961 +#: ../../library/sys.rst:990 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:963 +#: ../../library/sys.rst:992 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:995 msgid "Constant" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:995 msgid "Meaning" msgstr "含義" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:997 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:997 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:999 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:999 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:973 +#: ../../library/sys.rst:1002 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:973 +#: ../../library/sys.rst:1002 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:977 +#: ../../library/sys.rst:1006 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:981 +#: ../../library/sys.rst:1010 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1260,24 +1293,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:987 +#: ../../library/sys.rst:1016 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:993 +#: ../../library/sys.rst:1022 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1026 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:1003 +#: ../../library/sys.rst:1032 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1287,71 +1320,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:1010 +#: ../../library/sys.rst:1039 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`。" -#: ../../library/sys.rst:1014 ../../library/sys.rst:1702 +#: ../../library/sys.rst:1043 ../../library/sys.rst:1731 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1049 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1026 ../../library/sys.rst:1723 +#: ../../library/sys.rst:1055 ../../library/sys.rst:1752 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:1032 +#: ../../library/sys.rst:1061 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:1038 +#: ../../library/sys.rst:1067 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1042 +#: ../../library/sys.rst:1071 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1046 +#: ../../library/sys.rst:1075 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1050 +#: ../../library/sys.rst:1079 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1054 +#: ../../library/sys.rst:1083 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1058 +#: ../../library/sys.rst:1087 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1062 +#: ../../library/sys.rst:1091 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1095 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1099 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*、*hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1076 +#: ../../library/sys.rst:1105 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1359,7 +1392,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1080 +#: ../../library/sys.rst:1109 msgid "" "if sys.hexversion >= 0x010502F0:\n" " # use some advanced feature\n" @@ -1369,7 +1402,7 @@ msgid "" " ..." msgstr "" -#: ../../library/sys.rst:1087 +#: ../../library/sys.rst:1116 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. " @@ -1377,25 +1410,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1092 +#: ../../library/sys.rst:1121 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1097 +#: ../../library/sys.rst:1126 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:1101 +#: ../../library/sys.rst:1130 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:1105 +#: ../../library/sys.rst:1134 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 " @@ -1407,13 +1440,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1144 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1118 +#: ../../library/sys.rst:1147 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 " @@ -1422,7 +1455,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1125 +#: ../../library/sys.rst:1154 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1432,41 +1465,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1165 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1170 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1146 +#: ../../library/sys.rst:1175 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1151 +#: ../../library/sys.rst:1180 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1155 +#: ../../library/sys.rst:1184 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1189 msgid "" "The 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:1167 +#: ../../library/sys.rst:1196 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1474,7 +1507,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1202 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:1179 ../../library/sys.rst:1181 +#: ../../library/sys.rst:1208 ../../library/sys.rst:1210 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:1190 +#: ../../library/sys.rst:1219 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 " @@ -1501,29 +1534,29 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1227 msgid "" "Interned strings are not :term:`immortal`; you must keep a reference to the " "return value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1204 +#: ../../library/sys.rst:1233 msgid "" "Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it " "is disabled." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1241 msgid "" "Return :const:`True` if the main Python interpreter is :term:`shutting down " "`. Return :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1215 +#: ../../library/sys.rst:1244 msgid "See also the :exc:`PythonFinalizationError` exception." msgstr "" -#: ../../library/sys.rst:1221 +#: ../../library/sys.rst:1250 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1534,44 +1567,44 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1233 +#: ../../library/sys.rst:1262 msgid "" "Return :const:`True` if the given string is \"interned\", :const:`False` " "otherwise." msgstr "" -#: ../../library/sys.rst:1240 +#: ../../library/sys.rst:1269 msgid "It is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1276 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1282 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:1260 +#: ../../library/sys.rst:1289 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1292 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:1271 +#: ../../library/sys.rst:1300 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 " @@ -1584,40 +1617,40 @@ msgid "" "``None`` if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1313 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1314 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1316 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1317 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1323 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1328 msgid "" "Removed the fallback that looked for a :meth:`!find_module` method if a :" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" -#: ../../library/sys.rst:1305 +#: ../../library/sys.rst:1334 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 " @@ -1629,13 +1662,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1346 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1349 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1643,68 +1676,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1332 +#: ../../library/sys.rst:1361 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:1336 +#: ../../library/sys.rst:1365 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:1340 +#: ../../library/sys.rst:1369 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1342 +#: ../../library/sys.rst:1371 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1344 +#: ../../library/sys.rst:1373 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1347 +#: ../../library/sys.rst:1376 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:1350 +#: ../../library/sys.rst:1379 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:1356 +#: ../../library/sys.rst:1385 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1361 +#: ../../library/sys.rst:1390 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:1365 ../../library/sys.rst:1376 +#: ../../library/sys.rst:1394 ../../library/sys.rst:1405 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1370 +#: ../../library/sys.rst:1399 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 " @@ -1712,92 +1745,92 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1381 +#: ../../library/sys.rst:1410 msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1413 msgid "System" msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1413 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1415 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1415 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1416 msgid "Android" msgstr "" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1416 #, fuzzy msgid "``'android'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1417 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1417 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1418 msgid "iOS" msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1418 msgid "``'ios'``" msgstr "" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1419 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1419 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1420 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1420 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1421 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1421 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1422 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1422 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1423 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1423 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1426 msgid "" "On Unix systems not listed in the table, the value is the lowercased OS name " "as returned by ``uname -s``, with the first part of the version as returned " @@ -1806,81 +1839,81 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1403 +#: ../../library/sys.rst:1432 msgid "" "if sys.platform.startswith('freebsd'):\n" " # FreeBSD-specific code here..." msgstr "" -#: ../../library/sys.rst:1406 +#: ../../library/sys.rst:1435 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1439 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1443 msgid "" "On Android, :data:`sys.platform` now returns ``'android'`` rather than " "``'linux'``." msgstr "" -#: ../../library/sys.rst:1420 +#: ../../library/sys.rst:1449 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1452 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1458 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:1432 +#: ../../library/sys.rst:1461 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:1436 +#: ../../library/sys.rst:1465 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1438 +#: ../../library/sys.rst:1467 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:1441 +#: ../../library/sys.rst:1470 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1472 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1451 +#: ../../library/sys.rst:1480 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1889,14 +1922,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1457 +#: ../../library/sys.rst:1486 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:1472 +#: ../../library/sys.rst:1501 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1906,7 +1939,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1482 +#: ../../library/sys.rst:1511 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 " @@ -1917,14 +1950,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1523 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:1506 +#: ../../library/sys.rst:1535 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 " @@ -1939,14 +1972,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1518 +#: ../../library/sys.rst:1547 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1522 +#: ../../library/sys.rst:1551 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1954,71 +1987,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1527 ../../library/sys.rst:1614 +#: ../../library/sys.rst:1556 ../../library/sys.rst:1643 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1529 ../../library/sys.rst:1616 +#: ../../library/sys.rst:1558 ../../library/sys.rst:1645 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1530 +#: ../../library/sys.rst:1559 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1533 ../../library/sys.rst:1631 +#: ../../library/sys.rst:1562 ../../library/sys.rst:1660 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1534 +#: ../../library/sys.rst:1563 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:1538 +#: ../../library/sys.rst:1567 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1568 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:1542 +#: ../../library/sys.rst:1571 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1572 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1574 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1546 +#: ../../library/sys.rst:1575 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1577 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1553 +#: ../../library/sys.rst:1582 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:1557 +#: ../../library/sys.rst:1586 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 " @@ -2026,19 +2059,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1562 +#: ../../library/sys.rst:1591 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1594 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1572 +#: ../../library/sys.rst:1601 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2049,7 +2082,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1618 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 " @@ -2058,7 +2091,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1594 +#: ../../library/sys.rst:1623 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2066,7 +2099,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1628 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 " @@ -2074,36 +2107,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1633 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1607 +#: ../../library/sys.rst:1636 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:1611 +#: ../../library/sys.rst:1640 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1646 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:1621 +#: ../../library/sys.rst:1650 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1622 +#: ../../library/sys.rst:1651 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``; " @@ -2113,7 +2146,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1632 +#: ../../library/sys.rst:1661 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 " @@ -2121,22 +2154,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1666 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1667 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:1642 +#: ../../library/sys.rst:1671 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1643 +#: ../../library/sys.rst:1672 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 " @@ -2146,13 +2179,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1650 +#: ../../library/sys.rst:1679 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:1653 +#: ../../library/sys.rst:1682 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 " @@ -2166,17 +2199,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1664 +#: ../../library/sys.rst:1693 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1666 +#: ../../library/sys.rst:1695 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" -#: ../../library/sys.rst:1670 +#: ../../library/sys.rst:1699 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2184,13 +2217,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1677 +#: ../../library/sys.rst:1706 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1682 +#: ../../library/sys.rst:1711 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2199,7 +2232,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1717 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2207,7 +2240,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1690 +#: ../../library/sys.rst:1719 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2215,20 +2248,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1692 +#: ../../library/sys.rst:1721 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:1695 +#: ../../library/sys.rst:1724 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:1707 +#: ../../library/sys.rst:1736 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2237,111 +2270,111 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1743 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:1718 +#: ../../library/sys.rst:1747 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1728 +#: ../../library/sys.rst:1757 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1766 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1767 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1771 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1773 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1752 +#: ../../library/sys.rst:1781 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1789 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:1764 +#: ../../library/sys.rst:1793 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1767 +#: ../../library/sys.rst:1796 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1802 msgid "" "Changing the filesystem encoding after Python startup is risky because the " "old fsencoding or paths encoded by the old fsencoding may be cached " "somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1806 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1809 msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1787 +#: ../../library/sys.rst:1816 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1790 +#: ../../library/sys.rst:1819 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1792 +#: ../../library/sys.rst:1821 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:1794 +#: ../../library/sys.rst:1823 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1796 +#: ../../library/sys.rst:1825 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:1800 +#: ../../library/sys.rst:1829 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:1803 +#: ../../library/sys.rst:1832 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 " @@ -2352,14 +2385,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1812 +#: ../../library/sys.rst:1841 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:1817 +#: ../../library/sys.rst:1846 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2368,7 +2401,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1824 +#: ../../library/sys.rst:1853 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2377,19 +2410,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1830 +#: ../../library/sys.rst:1859 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1865 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:1840 +#: ../../library/sys.rst:1869 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 " @@ -2397,7 +2430,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1879 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2405,7 +2438,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1855 +#: ../../library/sys.rst:1884 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, " @@ -2413,7 +2446,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1861 +#: ../../library/sys.rst:1890 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2421,12 +2454,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1869 +#: ../../library/sys.rst:1898 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1871 +#: ../../library/sys.rst:1900 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 " @@ -2434,7 +2467,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1905 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 " @@ -2442,60 +2475,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1881 +#: ../../library/sys.rst:1910 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1888 +#: ../../library/sys.rst:1917 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1922 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1895 +#: ../../library/sys.rst:1924 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1925 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1926 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1899 +#: ../../library/sys.rst:1928 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1932 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1905 +#: ../../library/sys.rst:1934 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1935 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1907 +#: ../../library/sys.rst:1936 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1911 +#: ../../library/sys.rst:1940 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1919 +#: ../../library/sys.rst:1948 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2504,73 +2537,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1956 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1929 +#: ../../library/sys.rst:1958 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:1933 +#: ../../library/sys.rst:1962 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1964 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1936 +#: ../../library/sys.rst:1965 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1937 +#: ../../library/sys.rst:1966 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1967 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1939 +#: ../../library/sys.rst:1968 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1941 +#: ../../library/sys.rst:1970 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1945 +#: ../../library/sys.rst:1974 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1950 +#: ../../library/sys.rst:1979 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1954 +#: ../../library/sys.rst:1983 msgid "" "Storing :attr:`!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:1958 +#: ../../library/sys.rst:1987 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1962 ../../library/sys.rst:1964 +#: ../../library/sys.rst:1991 ../../library/sys.rst:1993 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2578,7 +2611,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1973 +#: ../../library/sys.rst:2002 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2587,13 +2620,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1982 +#: ../../library/sys.rst:2011 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:1988 +#: ../../library/sys.rst:2017 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2604,18 +2637,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1996 +#: ../../library/sys.rst:2025 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:2001 +#: ../../library/sys.rst:2030 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:2008 +#: ../../library/sys.rst:2037 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 " @@ -2624,20 +2657,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:2020 +#: ../../library/sys.rst:2049 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:2026 +#: ../../library/sys.rst:2055 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:2030 +#: ../../library/sys.rst:2059 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2657,18 +2690,18 @@ msgstr "" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" -#: ../../library/sys.rst:2042 +#: ../../library/sys.rst:2071 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:2050 +#: ../../library/sys.rst:2079 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2051 +#: ../../library/sys.rst:2080 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/" @@ -2689,51 +2722,51 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:925 ../../library/sys.rst:1502 +#: ../../library/sys.rst:954 ../../library/sys.rst:1531 msgid "profile function" msgstr "" -#: ../../library/sys.rst:925 ../../library/sys.rst:1502 +#: ../../library/sys.rst:954 ../../library/sys.rst:1531 msgid "profiler" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1585 +#: ../../library/sys.rst:963 ../../library/sys.rst:1614 msgid "trace function" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1585 +#: ../../library/sys.rst:963 ../../library/sys.rst:1614 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "..." msgstr "..." diff --git a/library/telnetlib.po b/library/telnetlib.po index 20603a5420..c6259d635c 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -19,351 +19,119 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/telnetlib.rst:2 -msgid ":mod:`telnetlib` --- Telnet client" +#, fuzzy +msgid ":mod:`!telnetlib` --- Telnet client" msgstr ":mod:`telnetlib` --- Telnet 客戶端" #: ../../library/telnetlib.rst:10 -msgid "**Source code:** :source:`Lib/telnetlib.py`" -msgstr "**原始碼:**\\ :source:`Lib/telnetlib.py`" - -#: ../../library/telnetlib.rst:14 -msgid "" -"The :mod:`telnetlib` module is deprecated (see :pep:`PEP 594 " -"<594#telnetlib>` for details and alternatives)." -msgstr "" -":mod:`telnetlib` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP 594 " -"<594#telnetlib>`\\ )。" - -#: ../../library/telnetlib.rst:20 -msgid "" -"The :mod:`telnetlib` module provides a :class:`Telnet` class that implements " -"the Telnet protocol. See :rfc:`854` for details about the protocol. In " -"addition, it provides symbolic constants for the protocol characters (see " -"below), and for the telnet options. The symbolic names of the telnet options " -"follow the definitions in ``arpa/telnet.h``, with the leading ``TELOPT_`` " -"removed. For symbolic names of options which are traditionally not included " -"in ``arpa/telnet.h``, see the module source itself." -msgstr "" - -#: ../../library/telnetlib.rst:28 -msgid "" -"The symbolic constants for the telnet commands are: IAC, DONT, DO, WONT, " -"WILL, SE (Subnegotiation End), NOP (No Operation), DM (Data Mark), BRK " -"(Break), IP (Interrupt process), AO (Abort output), AYT (Are You There), EC " -"(Erase Character), EL (Erase Line), GA (Go Ahead), SB (Subnegotiation Begin)." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#: ../../library/telnetlib.rst:37 msgid "" -":class:`Telnet` represents a connection to a Telnet server. The instance is " -"initially not connected by default; the :meth:`~Telnet.open` method must be " -"used to establish a connection. Alternatively, the host name and optional " -"port number can be passed to the constructor too, in which case the " -"connection to the server will be established before the constructor " -"returns. The optional *timeout* parameter specifies a timeout in seconds " -"for blocking operations like the connection attempt (if not specified, the " -"global default timeout setting will be used)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/telnetlib.rst:46 -msgid "Do not reopen an already connected instance." -msgstr "" - -#: ../../library/telnetlib.rst:48 -msgid "" -"This class has many :meth:`read_\\*` methods. Note that some of them " -"raise :exc:`EOFError` when the end of the connection is read, because they " -"can return an empty string for other reasons. See the individual " -"descriptions below." -msgstr "" - -#: ../../library/telnetlib.rst:52 -msgid "" -"A :class:`Telnet` object is a context manager and can be used in a :keyword:" -"`with` statement. When the :keyword:`!with` block ends, the :meth:`close` " -"method is called::" -msgstr "" - -#: ../../library/telnetlib.rst:56 -msgid "" -">>> from telnetlib import Telnet\n" -">>> with Telnet('localhost', 23) as tn:\n" -"... tn.interact()\n" -"..." -msgstr "" -">>> from telnetlib import Telnet\n" -">>> with Telnet('localhost', 23) as tn:\n" -"... tn.interact()\n" -"..." - -#: ../../library/telnetlib.rst:61 -msgid "Context manager support added" -msgstr "" - -#: ../../library/telnetlib.rst:66 -msgid ":rfc:`854` - Telnet Protocol Specification" -msgstr "" - -#: ../../library/telnetlib.rst:67 -msgid "Definition of the Telnet protocol." -msgstr "" - -#: ../../library/telnetlib.rst:73 -msgid "Telnet Objects" -msgstr "" - -#: ../../library/telnetlib.rst:75 -msgid ":class:`Telnet` instances have the following methods:" -msgstr "" - -#: ../../library/telnetlib.rst:80 -msgid "" -"Read until a given byte string, *expected*, is encountered or until " -"*timeout* seconds have passed." -msgstr "" - -#: ../../library/telnetlib.rst:83 -msgid "" -"When no match is found, return whatever is available instead, possibly empty " -"bytes. Raise :exc:`EOFError` if the connection is closed and no cooked data " -"is available." -msgstr "" - -#: ../../library/telnetlib.rst:90 -msgid "Read all data until EOF as bytes; block until connection closed." -msgstr "" - -#: ../../library/telnetlib.rst:95 -msgid "" -"Read at least one byte of cooked data unless EOF is hit. Return ``b''`` if " -"EOF is hit. Block if no data is immediately available." -msgstr "" - -#: ../../library/telnetlib.rst:101 -msgid "Read everything that can be without blocking in I/O (eager)." -msgstr "" - -#: ../../library/telnetlib.rst:103 ../../library/telnetlib.rst:112 -msgid "" -"Raise :exc:`EOFError` if connection closed and no cooked data available. " -"Return ``b''`` if no cooked data available otherwise. Do not block unless in " -"the midst of an IAC sequence." -msgstr "" - -#: ../../library/telnetlib.rst:110 -msgid "Read readily available data." -msgstr "" - -#: ../../library/telnetlib.rst:119 -msgid "Process and return data already in the queues (lazy)." -msgstr "" - -#: ../../library/telnetlib.rst:121 -msgid "" -"Raise :exc:`EOFError` if connection closed and no data available. Return " -"``b''`` if no cooked data available otherwise. Do not block unless in the " -"midst of an IAC sequence." -msgstr "" - -#: ../../library/telnetlib.rst:128 -msgid "Return any data available in the cooked queue (very lazy)." -msgstr "" - -#: ../../library/telnetlib.rst:130 -msgid "" -"Raise :exc:`EOFError` if connection closed and no data available. Return " -"``b''`` if no cooked data available otherwise. This method never blocks." -msgstr "" - -#: ../../library/telnetlib.rst:136 -msgid "" -"Return the data collected between a SB/SE pair (suboption begin/end). The " -"callback should access these data when it was invoked with a ``SE`` command. " -"This method never blocks." -msgstr "" - -#: ../../library/telnetlib.rst:143 -msgid "" -"Connect to a host. The optional second argument is the port number, which " -"defaults to the standard Telnet port (23). The optional *timeout* parameter " -"specifies a timeout in seconds for blocking operations like the connection " -"attempt (if not specified, the global default timeout setting will be used)." -msgstr "" - -#: ../../library/telnetlib.rst:148 -msgid "Do not try to reopen an already connected instance." -msgstr "" - -#: ../../library/telnetlib.rst:150 -msgid "" -"Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " -"arguments ``self``, ``host``, ``port``." -msgstr "" -"引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " -"` ``telnetlib.Telnet.open``。" - -#: ../../library/telnetlib.rst:155 -msgid "" -"Print a debug message when the debug level is ``>`` 0. If extra arguments " -"are present, they are substituted in the message using the standard string " -"formatting operator." -msgstr "" - -#: ../../library/telnetlib.rst:162 -msgid "" -"Set the debug level. The higher the value of *debuglevel*, the more debug " -"output you get (on ``sys.stdout``)." -msgstr "" - -#: ../../library/telnetlib.rst:168 -msgid "Close the connection." -msgstr "" - -#: ../../library/telnetlib.rst:173 -msgid "Return the socket object used internally." -msgstr "" - -#: ../../library/telnetlib.rst:178 -msgid "Return the file descriptor of the socket object used internally." -msgstr "" - -#: ../../library/telnetlib.rst:183 -msgid "" -"Write a byte string to the socket, doubling any IAC characters. This can " -"block if the connection is blocked. May raise :exc:`OSError` if the " -"connection is closed." -msgstr "" - -#: ../../library/telnetlib.rst:187 -msgid "" -"Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " -"arguments ``self``, ``buffer``." -msgstr "" -"引發一個附帶引數 ``self``、``buffer`` 的\\ :ref:`稽核事件 ` " -"``telnetlib.Telnet.write``。" - -#: ../../library/telnetlib.rst:189 -msgid "" -"This method used to raise :exc:`socket.error`, which is now an alias of :exc:" -"`OSError`." -msgstr "" - -#: ../../library/telnetlib.rst:196 -msgid "Interaction function, emulates a very dumb Telnet client." -msgstr "" - -#: ../../library/telnetlib.rst:201 -msgid "Multithreaded version of :meth:`interact`." -msgstr "" - -#: ../../library/telnetlib.rst:206 -msgid "Read until one from a list of a regular expressions matches." -msgstr "" - -#: ../../library/telnetlib.rst:208 -msgid "" -"The first argument is a list of regular expressions, either compiled (:ref:" -"`regex objects `) or uncompiled (byte strings). The optional " -"second argument is a timeout, in seconds; the default is to block " -"indefinitely." -msgstr "" - -#: ../../library/telnetlib.rst:213 -msgid "" -"Return a tuple of three items: the index in the list of the first regular " -"expression that matches; the match object returned; and the bytes read up " -"till and including the match." -msgstr "" - -#: ../../library/telnetlib.rst:217 -msgid "" -"If end of file is found and no bytes were read, raise :exc:`EOFError`. " -"Otherwise, when nothing matches, return ``(-1, None, data)`` where *data* is " -"the bytes received so far (may be empty bytes if a timeout happened)." -msgstr "" - -#: ../../library/telnetlib.rst:221 -msgid "" -"If a regular expression ends with a greedy match (such as ``.*``) or if more " -"than one expression can match the same input, the results are non-" -"deterministic, and may depend on the I/O timing." -msgstr "" - -#: ../../library/telnetlib.rst:228 -msgid "" -"Each time a telnet option is read on the input flow, this *callback* (if " -"set) is called with the following parameters: callback(telnet socket, " -"command (DO/DONT/WILL/WONT), option). No other action is done afterwards by " -"telnetlib." -msgstr "" - -#: ../../library/telnetlib.rst:236 -msgid "Telnet Example" -msgstr "Telnet 範例" - -#: ../../library/telnetlib.rst:241 -msgid "A simple example illustrating typical use::" -msgstr "" - -#: ../../library/telnetlib.rst:243 +#: ../../library/telnetlib.rst:14 msgid "" -"import getpass\n" -"import telnetlib\n" -"\n" -"HOST = \"localhost\"\n" -"user = input(\"Enter your remote account: \")\n" -"password = getpass.getpass()\n" -"\n" -"tn = telnetlib.Telnet(HOST)\n" -"\n" -"tn.read_until(b\"login: \")\n" -"tn.write(user.encode('ascii') + b\"\\n\")\n" -"if password:\n" -" tn.read_until(b\"Password: \")\n" -" tn.write(password.encode('ascii') + b\"\\n\")\n" -"\n" -"tn.write(b\"ls\\n\")\n" -"tn.write(b\"exit\\n\")\n" -"\n" -"print(tn.read_all().decode('ascii'))" -msgstr "" -"import getpass\n" -"import telnetlib\n" -"\n" -"HOST = \"localhost\"\n" -"user = input(\"Enter your remote account: \")\n" -"password = getpass.getpass()\n" -"\n" -"tn = telnetlib.Telnet(HOST)\n" -"\n" -"tn.read_until(b\"login: \")\n" -"tn.write(user.encode('ascii') + b\"\\n\")\n" -"if password:\n" -" tn.read_until(b\"Password: \")\n" -" tn.write(password.encode('ascii') + b\"\\n\")\n" -"\n" -"tn.write(b\"ls\\n\")\n" -"tn.write(b\"exit\\n\")\n" -"\n" -"print(tn.read_all().decode('ascii'))" - -#: ../../library/telnetlib.rst:12 -msgid "protocol" -msgstr "protocol(協定)" - -#: ../../library/telnetlib.rst:12 -msgid "Telnet" -msgstr "Telnet" +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`telnetlib3` or :pypi:`Exscript`. These are not supported or maintained by " +"the Python core team." +msgstr "" + +#: ../../library/telnetlib.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!telnetlib` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/telnetlib.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/telnetlib.py`" + +#~ msgid "" +#~ "The :mod:`telnetlib` module is deprecated (see :pep:`PEP 594 " +#~ "<594#telnetlib>` for details and alternatives)." +#~ msgstr "" +#~ ":mod:`telnetlib` 模組 (module) 即將被棄用(詳情與替代方案請見 :pep:`PEP " +#~ "594 <594#telnetlib>`\\ )。" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" + +#~ msgid "" +#~ ">>> from telnetlib import Telnet\n" +#~ ">>> with Telnet('localhost', 23) as tn:\n" +#~ "... tn.interact()\n" +#~ "..." +#~ msgstr "" +#~ ">>> from telnetlib import Telnet\n" +#~ ">>> with Telnet('localhost', 23) as tn:\n" +#~ "... tn.interact()\n" +#~ "..." + +#~ msgid "" +#~ "Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " +#~ "arguments ``self``, ``host``, ``port``." +#~ msgstr "" +#~ "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " +#~ "` ``telnetlib.Telnet.open``。" + +#~ msgid "" +#~ "Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` " +#~ "with arguments ``self``, ``buffer``." +#~ msgstr "" +#~ "引發一個附帶引數 ``self``、``buffer`` 的\\ :ref:`稽核事件 ` " +#~ "``telnetlib.Telnet.write``。" + +#~ msgid "Telnet Example" +#~ msgstr "Telnet 範例" + +#~ msgid "" +#~ "import getpass\n" +#~ "import telnetlib\n" +#~ "\n" +#~ "HOST = \"localhost\"\n" +#~ "user = input(\"Enter your remote account: \")\n" +#~ "password = getpass.getpass()\n" +#~ "\n" +#~ "tn = telnetlib.Telnet(HOST)\n" +#~ "\n" +#~ "tn.read_until(b\"login: \")\n" +#~ "tn.write(user.encode('ascii') + b\"\\n\")\n" +#~ "if password:\n" +#~ " tn.read_until(b\"Password: \")\n" +#~ " tn.write(password.encode('ascii') + b\"\\n\")\n" +#~ "\n" +#~ "tn.write(b\"ls\\n\")\n" +#~ "tn.write(b\"exit\\n\")\n" +#~ "\n" +#~ "print(tn.read_all().decode('ascii'))" +#~ msgstr "" +#~ "import getpass\n" +#~ "import telnetlib\n" +#~ "\n" +#~ "HOST = \"localhost\"\n" +#~ "user = input(\"Enter your remote account: \")\n" +#~ "password = getpass.getpass()\n" +#~ "\n" +#~ "tn = telnetlib.Telnet(HOST)\n" +#~ "\n" +#~ "tn.read_until(b\"login: \")\n" +#~ "tn.write(user.encode('ascii') + b\"\\n\")\n" +#~ "if password:\n" +#~ " tn.read_until(b\"Password: \")\n" +#~ " tn.write(password.encode('ascii') + b\"\\n\")\n" +#~ "\n" +#~ "tn.write(b\"ls\\n\")\n" +#~ "tn.write(b\"exit\\n\")\n" +#~ "\n" +#~ "print(tn.read_all().decode('ascii'))" + +#~ msgid "protocol" +#~ msgstr "protocol(協定)" + +#~ msgid "Telnet" +#~ msgstr "Telnet" diff --git a/library/time.po b/library/time.po index 23a3fed4e7..c57cecb22f 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-08-14 16:05+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,14 +266,14 @@ msgstr "" #: ../../library/time.rst:149 ../../library/time.rst:161 #: ../../library/time.rst:174 ../../library/time.rst:183 #: ../../library/time.rst:196 ../../library/time.rst:205 -#: ../../library/time.rst:721 ../../library/time.rst:745 -#: ../../library/time.rst:841 ../../library/time.rst:852 -#: ../../library/time.rst:862 ../../library/time.rst:872 -#: ../../library/time.rst:881 ../../library/time.rst:890 -#: ../../library/time.rst:899 ../../library/time.rst:910 -#: ../../library/time.rst:918 ../../library/time.rst:929 -#: ../../library/time.rst:940 ../../library/time.rst:949 -#: ../../library/time.rst:962 +#: ../../library/time.rst:734 ../../library/time.rst:758 +#: ../../library/time.rst:854 ../../library/time.rst:865 +#: ../../library/time.rst:875 ../../library/time.rst:885 +#: ../../library/time.rst:894 ../../library/time.rst:903 +#: ../../library/time.rst:912 ../../library/time.rst:923 +#: ../../library/time.rst:931 ../../library/time.rst:942 +#: ../../library/time.rst:953 ../../library/time.rst:962 +#: ../../library/time.rst:975 msgid "Availability" msgstr "" @@ -476,7 +476,7 @@ msgstr "" "示)。該時鐘不受系統時鐘更新的影響。回傳值的參考點沒有定義,因此只有兩次呼叫" "結果之間的差異才是有效的。" -#: ../../library/time.rst:290 ../../library/time.rst:687 +#: ../../library/time.rst:290 ../../library/time.rst:700 msgid "Clock:" msgstr "" @@ -534,8 +534,8 @@ msgstr "" #: ../../library/time.rst:330 msgid "" -"On CPython, use the same clock than :func:`time.monotonic` and is a " -"monotonic clock, i.e. a clock that cannot go backwards." +"On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " +"clock, i.e. a clock that cannot go backwards." msgstr "" #: ../../library/time.rst:333 @@ -551,7 +551,7 @@ msgstr "在 Windows 上,此函式現在涵蓋整個系統。" #: ../../library/time.rst:341 #, fuzzy -msgid "Use the same clock than :func:`time.monotonic`." +msgid "Use the same clock as :func:`time.monotonic`." msgstr "``'monotonic'``::func:`time.monotonic`" #: ../../library/time.rst:347 @@ -605,13 +605,14 @@ msgid "" msgstr "由於系統中其他活動的調度,暫停時間可能會比請求的時間長任意的量。" #: ../../library/time.rst:388 +#, fuzzy msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " "threads ready to run, the function returns immediately, and the thread " "continues execution. On Windows 8.1 and newer the implementation uses a " -"`high-resolution timer `_ which provides resolution of 100 " +"`high-resolution timer `_ which provides resolution of 100 " "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" "在 Windows 上,如果 *secs* 為零,則執行緒將其剩餘的時間片段讓給任何準備運行的" @@ -846,23 +847,32 @@ msgstr "" "一年中的週數(星期天作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期天之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:478 ../../library/time.rst:489 +#: ../../library/time.rst:478 ../../library/time.rst:492 msgid "\\(4)" msgstr "\\(4)" #: ../../library/time.rst:486 +msgid "``%u``" +msgstr "" + +#: ../../library/time.rst:486 +#, fuzzy +msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." +msgstr "月份中的日期,表示為十進位數 [01,31]。" + +#: ../../library/time.rst:489 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:486 +#: ../../library/time.rst:489 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "週間日,表示為十進位數 [0(星期天),6]。" -#: ../../library/time.rst:489 +#: ../../library/time.rst:492 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:489 +#: ../../library/time.rst:492 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " @@ -871,43 +881,43 @@ msgstr "" "一年中的週數(星期一作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期一之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:497 +#: ../../library/time.rst:500 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:497 +#: ../../library/time.rst:500 msgid "Locale's appropriate date representation." msgstr "區域設定的合適的日期表示法。" -#: ../../library/time.rst:500 +#: ../../library/time.rst:503 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:500 +#: ../../library/time.rst:503 msgid "Locale's appropriate time representation." msgstr "區域設定的合適的時間表示法。" -#: ../../library/time.rst:503 +#: ../../library/time.rst:506 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:503 +#: ../../library/time.rst:506 msgid "Year without century as a decimal number [00,99]." msgstr "去掉世紀的年份,表示為十進位數 [00,99]。" -#: ../../library/time.rst:506 +#: ../../library/time.rst:509 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:506 +#: ../../library/time.rst:509 msgid "Year with century as a decimal number." msgstr "帶世紀的年份,表示為十進位數。" -#: ../../library/time.rst:509 +#: ../../library/time.rst:512 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:509 +#: ../../library/time.rst:512 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " @@ -916,27 +926,49 @@ msgstr "" "時區偏移量,表示與 UTC/GMT 的正或負時間差,形式為 +HHMM 或 -HHMM,其中 H 代表" "十進位的小時數碼 (digits),M 代表十進位的分鐘數碼 [-23:59, +23:59]。 [1]_" -#: ../../library/time.rst:515 +#: ../../library/time.rst:518 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:515 +#: ../../library/time.rst:518 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "時區名稱(如果不存在時區,則無字元)。已被棄用。 [1]_" -#: ../../library/time.rst:518 +#: ../../library/time.rst:521 +msgid "``%G``" +msgstr "" + +#: ../../library/time.rst:521 +msgid "" +"ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " +"calendar year). The year starts with the week that contains the first " +"Thursday of the calendar year." +msgstr "" + +#: ../../library/time.rst:526 +msgid "``%V``" +msgstr "" + +#: ../../library/time.rst:526 +msgid "" +"ISO 8601 week number (as a decimal number [01,53]). The first week of the " +"year is the one that contains the first Thursday of the year. Weeks start on " +"Monday." +msgstr "" + +#: ../../library/time.rst:531 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:518 +#: ../../library/time.rst:531 msgid "A literal ``'%'`` character." msgstr "字面意義上的 ``'%'`` 字元。" -#: ../../library/time.rst:521 +#: ../../library/time.rst:534 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:524 +#: ../../library/time.rst:537 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -947,7 +979,7 @@ msgstr "" "在 :meth:`datetime.datetime.strptime` 和 :meth:`datetime.datetime.strftime` " "其中的 ``%f`` 格式的指令\\ :ref:`適用於微秒 `。" -#: ../../library/time.rst:530 +#: ../../library/time.rst:543 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " @@ -956,7 +988,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%p`` 指令僅在使用 ``%I`` 指令剖析小時" "時影響輸出小時的欄位。" -#: ../../library/time.rst:536 +#: ../../library/time.rst:549 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " @@ -965,7 +997,7 @@ msgstr "" "範圍確實是從 ``0`` 到 ``61``;數值 ``60`` 在表示 `leap seconds`_ 的時間戳中是" "有效的,而數值 ``61`` 是出於歷史因素而被支援。" -#: ../../library/time.rst:541 +#: ../../library/time.rst:554 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." @@ -973,7 +1005,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%U`` 和 ``%W`` 僅在指定週間的某天和年" "份時用於計算中。" -#: ../../library/time.rst:544 +#: ../../library/time.rst:557 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" @@ -981,7 +1013,7 @@ msgstr "" "以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼" "容的格式。 [1]_: ::" -#: ../../library/time.rst:547 +#: ../../library/time.rst:560 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" @@ -991,7 +1023,7 @@ msgstr "" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" -#: ../../library/time.rst:551 +#: ../../library/time.rst:564 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -1001,7 +1033,7 @@ msgstr "" "某些平台可能支援額外的指令,但只有這裡列出的指令具有 ANSI C 標準化的意義。要" "查看你的平台上支援的完整格式碼集,請參閱 :manpage:`strftime(3)` 文件。" -#: ../../library/time.rst:556 +#: ../../library/time.rst:569 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -1011,7 +1043,7 @@ msgstr "" "在某些平台上,可選的欄位寬度和精度規範可以以此順序緊跟在指令初始的 ``'%'`` 之" "後;這也是不可攜 (portable) 的。欄位寬度通常為 2,除了 ``%j`` 為 3。" -#: ../../library/time.rst:567 +#: ../../library/time.rst:580 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." @@ -1019,7 +1051,7 @@ msgstr "" "根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同由 :func:" "`gmtime` 或 :func:`localtime` 回傳的一樣。" -#: ../../library/time.rst:571 +#: ../../library/time.rst:584 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -1035,11 +1067,11 @@ msgstr "" "時,用來填充任何缺失資料的預設值為 ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``。" "*string* 和 *format* 都必須是字串。" -#: ../../library/time.rst:579 +#: ../../library/time.rst:592 msgid "For example:" msgstr "例如:" -#: ../../library/time.rst:586 +#: ../../library/time.rst:599 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -1050,7 +1082,7 @@ msgstr "" "因此,除了識別始終已知的 UTC 和 GMT(且被考慮為非日光節約時區)外,這是特定於" "平台的。" -#: ../../library/time.rst:591 +#: ../../library/time.rst:604 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -1062,7 +1094,7 @@ msgstr "" "提供比列出的還要更多的指令。但是 ``strptime()`` 與任何平台無關,因此不一定支" "援所有未記載為支援的指令。" -#: ../../library/time.rst:600 +#: ../../library/time.rst:613 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -1073,110 +1105,110 @@ msgstr "" "別。它是一個具有 :term:`named tuple` 介面的物件:值可以通過索引和屬性名稱存" "取。包含以下值:" -#: ../../library/time.rst:607 +#: ../../library/time.rst:620 msgid "Index" msgstr "索引" -#: ../../library/time.rst:608 +#: ../../library/time.rst:621 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:609 +#: ../../library/time.rst:622 msgid "Values" msgstr "值" -#: ../../library/time.rst:611 +#: ../../library/time.rst:624 msgid "0" msgstr "0" -#: ../../library/time.rst:613 +#: ../../library/time.rst:626 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:615 +#: ../../library/time.rst:628 msgid "1" msgstr "1" -#: ../../library/time.rst:617 +#: ../../library/time.rst:630 msgid "range [1, 12]" msgstr "範圍 [1, 12]" -#: ../../library/time.rst:619 +#: ../../library/time.rst:632 msgid "2" msgstr "2" -#: ../../library/time.rst:621 +#: ../../library/time.rst:634 msgid "range [1, 31]" msgstr "範圍 [1, 31]" -#: ../../library/time.rst:623 +#: ../../library/time.rst:636 msgid "3" msgstr "3" -#: ../../library/time.rst:625 +#: ../../library/time.rst:638 msgid "range [0, 23]" msgstr "範圍 [0, 23]" -#: ../../library/time.rst:627 +#: ../../library/time.rst:640 msgid "4" msgstr "4" -#: ../../library/time.rst:629 +#: ../../library/time.rst:642 msgid "range [0, 59]" msgstr "範圍 [0, 59]" -#: ../../library/time.rst:631 +#: ../../library/time.rst:644 msgid "5" msgstr "5" -#: ../../library/time.rst:633 +#: ../../library/time.rst:646 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" "範圍 [0, 61];參見 :func:`strftime` 中的\\ :ref:`註釋 (2) `" -#: ../../library/time.rst:635 +#: ../../library/time.rst:648 msgid "6" msgstr "6" -#: ../../library/time.rst:637 +#: ../../library/time.rst:650 msgid "range [0, 6]; Monday is 0" msgstr "範圍 [0, 6];星期一是 0" -#: ../../library/time.rst:639 +#: ../../library/time.rst:652 msgid "7" msgstr "7" -#: ../../library/time.rst:641 +#: ../../library/time.rst:654 msgid "range [1, 366]" msgstr "範圍 [1, 366]" -#: ../../library/time.rst:643 +#: ../../library/time.rst:656 msgid "8" msgstr "8" -#: ../../library/time.rst:645 +#: ../../library/time.rst:658 msgid "0, 1 or -1; see below" msgstr "0、1 或 -1;見下文" -#: ../../library/time.rst:647 ../../library/time.rst:651 +#: ../../library/time.rst:660 ../../library/time.rst:664 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:649 +#: ../../library/time.rst:662 msgid "abbreviation of timezone name" msgstr "時區名稱的縮寫" -#: ../../library/time.rst:653 +#: ../../library/time.rst:666 msgid "offset east of UTC in seconds" msgstr "UTC 向東的偏移量(以秒為單位)" -#: ../../library/time.rst:655 +#: ../../library/time.rst:668 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "請注意,與 C 結構不同,月份值的範圍是 [1, 12],而不是 [0, 11]。" -#: ../../library/time.rst:658 +#: ../../library/time.rst:671 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1186,7 +1218,7 @@ msgstr "" "在呼叫 :func:`mktime` 時,當日光節約時間生效的時候,:attr:`tm_isdst` 可以設定" "為 1,不生效時設定為 0。值 -1 表示未知是否生效,通常結果會填入正確的狀態。" -#: ../../library/time.rst:662 +#: ../../library/time.rst:675 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" @@ -1195,7 +1227,7 @@ msgstr "" "當一個長度不正確的元組被傳遞給預期得到 :class:`struct_time` 的函式時,或者其" "中有元素型別錯誤時,將引發 :exc:`TypeError`。" -#: ../../library/time.rst:668 +#: ../../library/time.rst:681 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1207,7 +1239,7 @@ msgstr "" "關的。在 Windows 和大多數 Unix 系統上,閏秒不計入自 epoch_ 起的秒數中。這通常" "被稱為 `Unix 時間 `_。" -#: ../../library/time.rst:674 +#: ../../library/time.rst:687 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1219,7 +1251,7 @@ msgstr "" "間。雖然此函式通常回傳非遞減的值,但如果在兩次呼叫之間系統時鐘被回調,則它可" "能回傳比之前呼叫更小的值。" -#: ../../library/time.rst:680 +#: ../../library/time.rst:693 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1233,31 +1265,31 @@ msgstr "" "為當地時間。在這兩種情況下都會回傳一個 :class:`struct_time` 物件,從中可以作" "為屬性存取日曆日期的組成部分。" -#: ../../library/time.rst:689 +#: ../../library/time.rst:702 msgid "On Windows, call ``GetSystemTimeAsFileTime()``." msgstr "" -#: ../../library/time.rst:690 +#: ../../library/time.rst:703 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." msgstr "" -#: ../../library/time.rst:691 +#: ../../library/time.rst:704 msgid "Otherwise, call ``gettimeofday()``." msgstr "" -#: ../../library/time.rst:693 +#: ../../library/time.rst:706 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "使用 :func:`time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:699 +#: ../../library/time.rst:712 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "類似於 :func:`~time.time`,但回傳自 epoch_ 起的以奈秒為單位的整數。" -#: ../../library/time.rst:712 +#: ../../library/time.rst:725 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1266,21 +1298,21 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:718 +#: ../../library/time.rst:731 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:723 +#: ../../library/time.rst:736 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:730 +#: ../../library/time.rst:743 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:737 +#: ../../library/time.rst:750 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1291,46 +1323,46 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:749 +#: ../../library/time.rst:762 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: ../../library/time.rst:753 +#: ../../library/time.rst:766 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:755 +#: ../../library/time.rst:768 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:758 +#: ../../library/time.rst:771 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" -#: ../../library/time.rst:760 +#: ../../library/time.rst:773 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:762 +#: ../../library/time.rst:775 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:763 +#: ../../library/time.rst:776 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:766 +#: ../../library/time.rst:779 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:767 +#: ../../library/time.rst:780 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1338,41 +1370,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:772 +#: ../../library/time.rst:785 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:773 +#: ../../library/time.rst:786 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: ../../library/time.rst:776 +#: ../../library/time.rst:789 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:777 +#: ../../library/time.rst:790 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: ../../library/time.rst:780 +#: ../../library/time.rst:793 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:781 +#: ../../library/time.rst:794 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:784 +#: ../../library/time.rst:797 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:785 +#: ../../library/time.rst:798 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 " @@ -1380,13 +1412,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:791 +#: ../../library/time.rst:804 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: ../../library/time.rst:796 +#: ../../library/time.rst:809 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1406,7 +1438,7 @@ msgstr "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" -#: ../../library/time.rst:805 +#: ../../library/time.rst:818 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1417,7 +1449,7 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:813 +#: ../../library/time.rst:826 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1429,23 +1461,23 @@ msgid "" "('EET', 'EEST')" msgstr "" -#: ../../library/time.rst:826 +#: ../../library/time.rst:839 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:828 +#: ../../library/time.rst:841 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:833 +#: ../../library/time.rst:846 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:836 +#: ../../library/time.rst:849 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1453,87 +1485,87 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:848 +#: ../../library/time.rst:861 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:859 +#: ../../library/time.rst:872 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:869 +#: ../../library/time.rst:882 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:878 +#: ../../library/time.rst:891 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." msgstr "" -#: ../../library/time.rst:888 ../../library/time.rst:897 +#: ../../library/time.rst:901 ../../library/time.rst:910 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:905 +#: ../../library/time.rst:918 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:907 +#: ../../library/time.rst:920 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:916 +#: ../../library/time.rst:929 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:925 +#: ../../library/time.rst:938 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:936 +#: ../../library/time.rst:949 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:946 +#: ../../library/time.rst:959 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." msgstr "" -#: ../../library/time.rst:953 +#: ../../library/time.rst:966 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:959 +#: ../../library/time.rst:972 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:970 +#: ../../library/time.rst:983 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:974 +#: ../../library/time.rst:987 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1541,25 +1573,25 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:980 +#: ../../library/time.rst:993 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:984 +#: ../../library/time.rst:997 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: ../../library/time.rst:989 +#: ../../library/time.rst:1002 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:995 +#: ../../library/time.rst:1008 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1569,40 +1601,40 @@ msgid "" "func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:1004 +#: ../../library/time.rst:1017 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:1005 +#: ../../library/time.rst:1018 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:1007 +#: ../../library/time.rst:1020 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:1008 +#: ../../library/time.rst:1021 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:1011 +#: ../../library/time.rst:1024 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:1012 +#: ../../library/time.rst:1025 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:1016 +#: ../../library/time.rst:1029 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:1017 +#: ../../library/time.rst:1030 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1642,23 +1674,23 @@ msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" #: ../../library/time.rst:319 ../../library/time.rst:354 -#: ../../library/time.rst:707 +#: ../../library/time.rst:720 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:354 ../../library/time.rst:707 +#: ../../library/time.rst:354 ../../library/time.rst:720 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:354 ../../library/time.rst:707 +#: ../../library/time.rst:354 ../../library/time.rst:720 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:416 ../../library/time.rst:562 +#: ../../library/time.rst:416 ../../library/time.rst:575 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:416 ../../library/time.rst:562 +#: ../../library/time.rst:416 ../../library/time.rst:575 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/typing.po b/library/typing.po index 9277c0665d..97bc0ad9df 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-07-11 11:12+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2787,13 +2787,14 @@ msgstr "" #: ../../library/typing.rst:1729 msgid "" -"This syntax can also be used to create bound and constrained type variables::" +"This syntax can also be used to create bounded and constrained type " +"variables::" msgstr "" #: ../../library/typing.rst:1732 msgid "" -"class StrSequence[S: str]: # S is a TypeVar bound to str\n" -" ...\n" +"class StrSequence[S: str]: # S is a TypeVar with a `str` upper bound;\n" +" ... # we can say that S is \"bounded by `str`\"\n" "\n" "\n" "class StrOrBytesSequence[A: (str, bytes)]: # A is a TypeVar constrained to " @@ -2842,8 +2843,8 @@ msgstr "" #: ../../library/typing.rst:1766 msgid "" -"Note that type variables can be *bound*, *constrained*, or neither, but " -"cannot be both bound *and* constrained." +"Note that type variables can be *bounded*, *constrained*, or neither, but " +"cannot be both bounded *and* constrained." msgstr "" #: ../../library/typing.rst:1769 @@ -2858,9 +2859,9 @@ msgstr "" #: ../../library/typing.rst:1777 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::" +"Bounded type variables and constrained type variables have different " +"semantics in several important ways. Using a *bounded* type variable means " +"that the ``TypeVar`` will be solved using the most specific type possible::" msgstr "" #: ../../library/typing.rst:1781 @@ -2879,8 +2880,8 @@ msgstr "" #: ../../library/typing.rst:1792 msgid "" -"Type variables can be bound to concrete types, abstract types (ABCs or " -"protocols), and even unions of types::" +"The upper bound of a type variable can be a concrete type, abstract type " +"(ABC or Protocol), or even a union of types::" msgstr "" #: ../../library/typing.rst:1795 @@ -2935,7 +2936,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:1837 -msgid "The bound of the type variable, if any." +msgid "The upper bound of the type variable, if any." msgstr "" #: ../../library/typing.rst:1841 @@ -3248,8 +3249,8 @@ msgstr "" #: ../../library/typing.rst:2062 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:" +"use a :class:`TypeVar` with upper bound ``Callable[..., Any]``. However " +"this causes two problems:" msgstr "" #: ../../library/typing.rst:2066 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index d522fd40ff..2f6c7a681b 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -190,22 +190,22 @@ msgid "" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Attribute" msgstr "屬性" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Index" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Value" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Value if not present" msgstr "" @@ -214,7 +214,7 @@ msgid ":attr:`scheme`" msgstr ":attr:`scheme`" #: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:312 -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid "0" msgstr "0" @@ -231,7 +231,7 @@ msgid ":attr:`netloc`" msgstr ":attr:`netloc`" #: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid "1" msgstr "1" @@ -243,8 +243,8 @@ msgstr "" #: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:132 #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:314 #: ../../library/urllib.parse.rst:316 ../../library/urllib.parse.rst:318 -#: ../../library/urllib.parse.rst:320 ../../library/urllib.parse.rst:425 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:320 ../../library/urllib.parse.rst:434 +#: ../../library/urllib.parse.rst:436 msgid "empty string" msgstr "" @@ -285,7 +285,7 @@ msgid "Query component" msgstr "" #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:320 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid ":attr:`fragment`" msgstr ":attr:`fragment`" @@ -294,7 +294,7 @@ msgid "5" msgstr "5" #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:320 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid "Fragment identifier" msgstr "" @@ -523,7 +523,7 @@ msgid "" msgstr "" "(addressing scheme, network location, path, query, fragment identifier)." -#: ../../library/urllib.parse.rst:306 ../../library/urllib.parse.rst:419 +#: ../../library/urllib.parse.rst:306 ../../library/urllib.parse.rst:428 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" @@ -597,11 +597,20 @@ msgid "" "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:409 +#: ../../library/urllib.parse.rst:408 +msgid "" +"Because an absolute URL may be passed as the ``url`` parameter, it is " +"generally **not secure** to use ``urljoin`` with an attacker-controlled " +"``url``. For example in, ``urljoin(\"https://website.com/users/\", " +"username)``, if ``username`` can contain an absolute URL, the result of " +"``urljoin`` will be the absolute URL." +msgstr "" + +#: ../../library/urllib.parse.rst:418 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:414 +#: ../../library/urllib.parse.rst:423 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -609,25 +618,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid ":attr:`url`" msgstr ":attr:`url`" -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:430 +#: ../../library/urllib.parse.rst:439 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:433 +#: ../../library/urllib.parse.rst:442 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:438 +#: ../../library/urllib.parse.rst:447 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -635,11 +644,11 @@ msgid "" "without changes." msgstr "" -#: ../../library/urllib.parse.rst:446 +#: ../../library/urllib.parse.rst:455 msgid "URL parsing security" msgstr "" -#: ../../library/urllib.parse.rst:448 +#: ../../library/urllib.parse.rst:457 msgid "" "The :func:`urlsplit` and :func:`urlparse` APIs do not perform **validation** " "of inputs. They may not raise errors on inputs that other applications " @@ -648,14 +657,14 @@ msgid "" "rather than purity." msgstr "" -#: ../../library/urllib.parse.rst:454 +#: ../../library/urllib.parse.rst:463 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:458 +#: ../../library/urllib.parse.rst:467 msgid "" "We recommend that users of these APIs where the values may be used anywhere " "with security implications code defensively. Do some verification within " @@ -664,7 +673,7 @@ msgid "" "that ``hostname``? etc." msgstr "" -#: ../../library/urllib.parse.rst:464 +#: ../../library/urllib.parse.rst:473 msgid "" "What constitutes a URL is not universally well defined. Different " "applications have different needs and desired constraints. For instance the " @@ -676,11 +685,11 @@ msgid "" "API behavior changes." msgstr "" -#: ../../library/urllib.parse.rst:475 +#: ../../library/urllib.parse.rst:484 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:477 +#: ../../library/urllib.parse.rst:486 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 " @@ -689,14 +698,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:483 +#: ../../library/urllib.parse.rst:492 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:487 +#: ../../library/urllib.parse.rst:496 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -704,7 +713,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:492 +#: ../../library/urllib.parse.rst:501 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -717,14 +726,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:503 +#: ../../library/urllib.parse.rst:512 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:507 +#: ../../library/urllib.parse.rst:516 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 " @@ -732,15 +741,15 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:512 +#: ../../library/urllib.parse.rst:521 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:519 +#: ../../library/urllib.parse.rst:528 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:521 +#: ../../library/urllib.parse.rst:530 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -749,7 +758,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:529 +#: ../../library/urllib.parse.rst:538 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 " @@ -757,72 +766,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:534 +#: ../../library/urllib.parse.rst:543 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:538 +#: ../../library/urllib.parse.rst:547 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:551 +#: ../../library/urllib.parse.rst:560 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:556 +#: ../../library/urllib.parse.rst:565 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:564 +#: ../../library/urllib.parse.rst:573 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:570 +#: ../../library/urllib.parse.rst:579 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:575 +#: ../../library/urllib.parse.rst:584 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:580 +#: ../../library/urllib.parse.rst:589 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:588 +#: ../../library/urllib.parse.rst:597 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:596 +#: ../../library/urllib.parse.rst:605 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:604 +#: ../../library/urllib.parse.rst:613 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:606 +#: ../../library/urllib.parse.rst:615 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 " @@ -831,7 +840,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:614 +#: ../../library/urllib.parse.rst:623 msgid "" "Replace special characters in *string* using the :samp:`%{xx}` escape. " "Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " @@ -840,18 +849,18 @@ msgid "" "not be quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:620 ../../library/urllib.parse.rst:666 -#: ../../library/urllib.parse.rst:695 +#: ../../library/urllib.parse.rst:629 ../../library/urllib.parse.rst:675 +#: ../../library/urllib.parse.rst:704 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:622 +#: ../../library/urllib.parse.rst:631 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:626 +#: ../../library/urllib.parse.rst:635 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -861,17 +870,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:634 +#: ../../library/urllib.parse.rst:643 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:637 +#: ../../library/urllib.parse.rst:646 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:642 +#: ../../library/urllib.parse.rst:651 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. " @@ -879,21 +888,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:647 +#: ../../library/urllib.parse.rst:656 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:652 +#: ../../library/urllib.parse.rst:661 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:655 +#: ../../library/urllib.parse.rst:664 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:661 +#: ../../library/urllib.parse.rst:670 msgid "" "Replace :samp:`%{xx}` escapes with their single-character equivalent. The " "optional *encoding* and *errors* parameters specify how to decode percent-" @@ -901,52 +910,52 @@ msgid "" "decode` method." msgstr "" -#: ../../library/urllib.parse.rst:668 +#: ../../library/urllib.parse.rst:677 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:672 +#: ../../library/urllib.parse.rst:681 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:674 +#: ../../library/urllib.parse.rst:683 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:682 +#: ../../library/urllib.parse.rst:691 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:685 +#: ../../library/urllib.parse.rst:694 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:687 +#: ../../library/urllib.parse.rst:696 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:692 +#: ../../library/urllib.parse.rst:701 msgid "" "Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " "a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:697 +#: ../../library/urllib.parse.rst:706 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:700 +#: ../../library/urllib.parse.rst:709 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:706 +#: ../../library/urllib.parse.rst:715 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 " @@ -955,7 +964,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:713 +#: ../../library/urllib.parse.rst:722 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* " @@ -968,7 +977,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:723 +#: ../../library/urllib.parse.rst:732 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 " @@ -979,49 +988,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:731 +#: ../../library/urllib.parse.rst:740 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:735 +#: ../../library/urllib.parse.rst:744 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:738 +#: ../../library/urllib.parse.rst:747 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:742 +#: ../../library/urllib.parse.rst:751 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:745 +#: ../../library/urllib.parse.rst:754 msgid "Added the *quote_via* parameter." msgstr "新增 *quote_via* 參數。" -#: ../../library/urllib.parse.rst:751 +#: ../../library/urllib.parse.rst:760 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: ../../library/urllib.parse.rst:752 +#: ../../library/urllib.parse.rst:761 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:755 +#: ../../library/urllib.parse.rst:764 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: ../../library/urllib.parse.rst:756 +#: ../../library/urllib.parse.rst:765 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -1029,49 +1038,49 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:761 +#: ../../library/urllib.parse.rst:770 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:762 +#: ../../library/urllib.parse.rst:771 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:764 +#: ../../library/urllib.parse.rst:773 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: ../../library/urllib.parse.rst:765 +#: ../../library/urllib.parse.rst:774 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:768 +#: ../../library/urllib.parse.rst:777 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:769 +#: ../../library/urllib.parse.rst:778 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:771 +#: ../../library/urllib.parse.rst:780 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" ":rfc:`1808` - 相對的統一資源定位器 (Relative Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:772 +#: ../../library/urllib.parse.rst:781 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:776 +#: ../../library/urllib.parse.rst:785 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr ":rfc:`1738` - 統一資源定位器 (URL, Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:777 +#: ../../library/urllib.parse.rst:786 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" diff --git a/library/uu.po b/library/uu.po index 13affdd5a7..78aa420042 100644 --- a/library/uu.po +++ b/library/uu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-20 00:03+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -20,91 +20,41 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/uu.rst:2 -msgid ":mod:`uu` --- Encode and decode uuencode files" +#, fuzzy +msgid ":mod:`!uu` --- Encode and decode uuencode files" msgstr ":mod:`xdrlib` --- uuencode 檔案的編碼與解碼" #: ../../library/uu.rst:10 -msgid "**Source code:** :source:`Lib/uu.py`" -msgstr "**原始碼:**\\ :source:`Lib/uu.py`" - -#: ../../library/uu.rst:12 msgid "" -"The :mod:`uu` module is deprecated (see :pep:`PEP 594 <594#uu-and-the-uu-" -"encoding>` for details). :mod:`base64` is a modern alternative." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -":mod:`uu` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#uu-and-the-uu-" -"encoding>`\\ )。:mod:`base64` 是個現時常用的替代方案。" -#: ../../library/uu.rst:19 +#: ../../library/uu.rst:14 msgid "" -"This module encodes and decodes files in uuencode format, allowing arbitrary " -"binary data to be transferred over ASCII-only connections. Wherever a file " -"argument is expected, the methods accept a file-like object. For backwards " -"compatibility, a string containing a pathname is also accepted, and the " -"corresponding file will be opened for reading and writing; the pathname " -"``'-'`` is understood to mean the standard input or output. However, this " -"interface is deprecated; it's better for the caller to open the file itself, " -"and be sure that, when required, the mode is ``'rb'`` or ``'wb'`` on Windows." -msgstr "" - -#: ../../library/uu.rst:32 -msgid "" -"This code was contributed by Lance Ellinghouse, and modified by Jack Jansen." -msgstr "" - -#: ../../library/uu.rst:34 -msgid "The :mod:`uu` module defines the following functions:" +"The last version of Python that provided the :mod:`!uu` module was `Python " +"3.12 `_." msgstr "" -#: ../../library/uu.rst:39 -msgid "" -"Uuencode file *in_file* into file *out_file*. The uuencoded file will have " -"the header specifying *name* and *mode* as the defaults for the results of " -"decoding the file. The default defaults are taken from *in_file*, or ``'-'`` " -"and ``0o666`` respectively. If *backtick* is true, zeros are represented by " -"``'`'`` instead of spaces." -msgstr "" +#~ msgid "**Source code:** :source:`Lib/uu.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/uu.py`" -#: ../../library/uu.rst:45 -msgid "Added the *backtick* parameter." -msgstr "新增 *backtick* 參數。" +#~ msgid "" +#~ "The :mod:`uu` module is deprecated (see :pep:`PEP 594 <594#uu-and-the-uu-" +#~ "encoding>` for details). :mod:`base64` is a modern alternative." +#~ msgstr "" +#~ ":mod:`uu` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 <594#uu-and-the-uu-" +#~ "encoding>`\\ )。:mod:`base64` 是個現時常用的替代方案。" -#: ../../library/uu.rst:51 -msgid "" -"This call decodes uuencoded file *in_file* placing the result on file " -"*out_file*. If *out_file* is a pathname, *mode* is used to set the " -"permission bits if the file must be created. Defaults for *out_file* and " -"*mode* are taken from the uuencode header. However, if the file specified " -"in the header already exists, a :exc:`uu.Error` is raised." -msgstr "" +#~ msgid "Added the *backtick* parameter." +#~ msgstr "新增 *backtick* 參數。" -#: ../../library/uu.rst:57 -msgid "" -":func:`decode` may print a warning to standard error if the input was " -"produced by an incorrect uuencoder and Python could recover from that " -"error. Setting *quiet* to a true value silences this warning." -msgstr "" - -#: ../../library/uu.rst:64 -msgid "" -"Subclass of :exc:`Exception`, this can be raised by :func:`uu.decode` under " -"various situations, such as described above, but also including a badly " -"formatted header, or truncated input file." -msgstr "" - -#: ../../library/uu.rst:71 -msgid "Module :mod:`binascii`" -msgstr ":mod:`binascii` 模組" - -#: ../../library/uu.rst:72 -msgid "" -"Support module containing ASCII-to-binary and binary-to-ASCII conversions." -msgstr "" +#~ msgid "Module :mod:`binascii`" +#~ msgstr ":mod:`binascii` 模組" -#: ../../library/uu.rst:28 -msgid "Jansen, Jack" -msgstr "Jansen, Jack" +#~ msgid "Jansen, Jack" +#~ msgstr "Jansen, Jack" -#: ../../library/uu.rst:28 -msgid "Ellinghouse, Lance" -msgstr "Ellinghouse, Lance" +#~ msgid "Ellinghouse, Lance" +#~ msgstr "Ellinghouse, Lance" diff --git a/library/warnings.po b/library/warnings.po index 478f1f072c..5a685c0552 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -354,11 +354,39 @@ msgid "" "\"default\" action is applied (hence its name)." msgstr "" -#: ../../library/warnings.rst:184 +#: ../../library/warnings.rst:185 +msgid "Repeated Warning Suppression Criteria" +msgstr "" + +#: ../../library/warnings.rst:187 +msgid "" +"The filters that suppress repeated warnings apply the following criteria to " +"determine if a warning is considered a repeat:" +msgstr "" + +#: ../../library/warnings.rst:189 +msgid "" +"``\"default\"``: A warning is considered a repeat only if the (*message*, " +"*category*, *module*, *lineno*) are all the same." +msgstr "" + +#: ../../library/warnings.rst:190 +msgid "" +"``\"module\"``: A warning is considered a repeat if the (*message*, " +"*category*, *module*) are the same, ignoring the line number." +msgstr "" + +#: ../../library/warnings.rst:191 +msgid "" +"``\"once\"``: A warning is considered a repeat if the (*message*, " +"*category*) are the same, ignoring the module and line number." +msgstr "" + +#: ../../library/warnings.rst:197 msgid "Describing Warning Filters" msgstr "" -#: ../../library/warnings.rst:186 +#: ../../library/warnings.rst:199 msgid "" "The warnings filter is initialized by :option:`-W` options passed to the " "Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment " @@ -368,17 +396,17 @@ msgid "" "after printing a message to :data:`sys.stderr`)." msgstr "" -#: ../../library/warnings.rst:193 +#: ../../library/warnings.rst:206 msgid "" "Individual warnings filters are specified as a sequence of fields separated " "by colons::" msgstr "" -#: ../../library/warnings.rst:196 +#: ../../library/warnings.rst:209 msgid "action:message:category:module:line" msgstr "action:message:category:module:line" -#: ../../library/warnings.rst:198 +#: ../../library/warnings.rst:211 msgid "" "The meaning of each of these fields is as described in :ref:`warning-" "filter`. When listing multiple filters on a single line (as for :envvar:" @@ -388,14 +416,14 @@ msgid "" "precedence over earlier ones)." msgstr "" -#: ../../library/warnings.rst:205 +#: ../../library/warnings.rst:218 msgid "" "Commonly used warning filters apply to either all warnings, warnings in a " "particular category, or warnings raised by particular modules or packages. " "Some examples::" msgstr "" -#: ../../library/warnings.rst:209 +#: ../../library/warnings.rst:222 msgid "" "default # Show all warnings (even those ignored by " "default)\n" @@ -408,24 +436,24 @@ msgid "" "error:::mymodule # Convert warnings to errors in \"mymodule\"" msgstr "" -#: ../../library/warnings.rst:221 +#: ../../library/warnings.rst:234 msgid "Default Warning Filter" msgstr "" -#: ../../library/warnings.rst:223 +#: ../../library/warnings.rst:236 msgid "" "By default, Python installs several warning filters, which can be overridden " "by the :option:`-W` command-line option, the :envvar:`PYTHONWARNINGS` " "environment variable and calls to :func:`filterwarnings`." msgstr "" -#: ../../library/warnings.rst:227 +#: ../../library/warnings.rst:240 msgid "" "In regular release builds, the default warning filter has the following " "entries (in order of precedence)::" msgstr "" -#: ../../library/warnings.rst:230 +#: ../../library/warnings.rst:243 msgid "" "default::DeprecationWarning:__main__\n" "ignore::DeprecationWarning\n" @@ -439,36 +467,36 @@ msgstr "" "ignore::ImportWarning\n" "ignore::ResourceWarning" -#: ../../library/warnings.rst:236 +#: ../../library/warnings.rst:249 msgid "" "In a :ref:`debug build `, the list of default warning filters " "is empty." msgstr "" -#: ../../library/warnings.rst:238 +#: ../../library/warnings.rst:251 msgid "" ":exc:`DeprecationWarning` is now ignored by default in addition to :exc:" "`PendingDeprecationWarning`." msgstr "" -#: ../../library/warnings.rst:242 +#: ../../library/warnings.rst:255 msgid "" ":exc:`DeprecationWarning` is once again shown by default when triggered " "directly by code in ``__main__``." msgstr "" -#: ../../library/warnings.rst:246 +#: ../../library/warnings.rst:259 msgid "" ":exc:`BytesWarning` no longer appears in the default filter list and is " "instead configured via :data:`sys.warnoptions` when :option:`-b` is " "specified twice." msgstr "" -#: ../../library/warnings.rst:255 +#: ../../library/warnings.rst:268 msgid "Overriding the default filter" msgstr "" -#: ../../library/warnings.rst:257 +#: ../../library/warnings.rst:270 msgid "" "Developers of applications written in Python may wish to hide *all* Python " "level warnings from their users by default, and only display them when " @@ -478,7 +506,7 @@ msgid "" "disabled::" msgstr "" -#: ../../library/warnings.rst:263 +#: ../../library/warnings.rst:276 msgid "" "import sys\n" "\n" @@ -492,14 +520,14 @@ msgstr "" " import warnings\n" " warnings.simplefilter(\"ignore\")" -#: ../../library/warnings.rst:269 +#: ../../library/warnings.rst:282 msgid "" "Developers of test runners for Python code are advised to instead ensure " "that *all* warnings are displayed by default for the code under test, using " "code like::" msgstr "" -#: ../../library/warnings.rst:273 +#: ../../library/warnings.rst:286 msgid "" "import sys\n" "\n" @@ -509,7 +537,7 @@ msgid "" " os.environ[\"PYTHONWARNINGS\"] = \"default\" # Also affect subprocesses" msgstr "" -#: ../../library/warnings.rst:280 +#: ../../library/warnings.rst:293 msgid "" "Finally, developers of interactive shells that run user code in a namespace " "other than ``__main__`` are advised to ensure that :exc:`DeprecationWarning` " @@ -517,7 +545,7 @@ msgid "" "``user_ns`` is the module used to execute code entered interactively)::" msgstr "" -#: ../../library/warnings.rst:285 +#: ../../library/warnings.rst:298 msgid "" "import warnings\n" "warnings.filterwarnings(\"default\", category=DeprecationWarning,\n" @@ -527,11 +555,11 @@ msgstr "" "warnings.filterwarnings(\"default\", category=DeprecationWarning,\n" " module=user_ns.get(\"__name__\"))" -#: ../../library/warnings.rst:293 +#: ../../library/warnings.rst:306 msgid "Temporarily Suppressing Warnings" msgstr "" -#: ../../library/warnings.rst:295 +#: ../../library/warnings.rst:308 msgid "" "If you are using code that you know will raise a warning, such as a " "deprecated function, but do not want to see the warning (even when warnings " @@ -539,7 +567,7 @@ msgid "" "to suppress the warning using the :class:`catch_warnings` context manager::" msgstr "" -#: ../../library/warnings.rst:300 +#: ../../library/warnings.rst:313 msgid "" "import warnings\n" "\n" @@ -559,7 +587,7 @@ msgstr "" " warnings.simplefilter(\"ignore\")\n" " fxn()" -#: ../../library/warnings.rst:309 +#: ../../library/warnings.rst:322 msgid "" "While within the context manager all warnings will simply be ignored. This " "allows you to use known-deprecated code without having to see the warning " @@ -569,11 +597,11 @@ msgid "" "context manager at the same time, the behavior is undefined." msgstr "" -#: ../../library/warnings.rst:321 +#: ../../library/warnings.rst:334 msgid "Testing Warnings" msgstr "" -#: ../../library/warnings.rst:323 +#: ../../library/warnings.rst:336 msgid "" "To test warnings raised by code, use the :class:`catch_warnings` context " "manager. With it you can temporarily mutate the warnings filter to " @@ -581,7 +609,7 @@ msgid "" "raised warnings to check::" msgstr "" -#: ../../library/warnings.rst:328 +#: ../../library/warnings.rst:341 msgid "" "import warnings\n" "\n" @@ -599,7 +627,7 @@ msgid "" " assert \"deprecated\" in str(w[-1].message)" msgstr "" -#: ../../library/warnings.rst:343 +#: ../../library/warnings.rst:356 msgid "" "One can also cause all warnings to be exceptions by using ``error`` instead " "of ``always``. One thing to be aware of is that if a warning has already " @@ -608,7 +636,7 @@ msgid "" "registry related to the warning has been cleared." msgstr "" -#: ../../library/warnings.rst:349 +#: ../../library/warnings.rst:362 msgid "" "Once the context manager exits, the warnings filter is restored to its state " "when the context was entered. This prevents tests from changing the warnings " @@ -619,7 +647,7 @@ msgid "" "manager at the same time, the behavior is undefined." msgstr "" -#: ../../library/warnings.rst:357 +#: ../../library/warnings.rst:370 msgid "" "When testing multiple operations that raise the same kind of warning, it is " "important to test them in a manner that confirms each operation is raising a " @@ -629,18 +657,18 @@ msgid "" "entries from the warnings list before each new operation)." msgstr "" -#: ../../library/warnings.rst:368 +#: ../../library/warnings.rst:381 msgid "Updating Code For New Versions of Dependencies" msgstr "" -#: ../../library/warnings.rst:370 +#: ../../library/warnings.rst:383 msgid "" "Warning categories that are primarily of interest to Python developers " "(rather than end users of applications written in Python) are ignored by " "default." msgstr "" -#: ../../library/warnings.rst:373 +#: ../../library/warnings.rst:386 msgid "" "Notably, this \"ignored by default\" list includes :exc:`DeprecationWarning` " "(for every module except ``__main__``), which means developers should make " @@ -649,14 +677,14 @@ msgid "" "(whether in the standard library or third party packages)." msgstr "" -#: ../../library/warnings.rst:379 +#: ../../library/warnings.rst:392 msgid "" "In the ideal case, the code will have a suitable test suite, and the test " "runner will take care of implicitly enabling all warnings when running tests " "(the test runner provided by the :mod:`unittest` module does this)." msgstr "" -#: ../../library/warnings.rst:383 +#: ../../library/warnings.rst:396 msgid "" "In less ideal cases, applications can be checked for use of deprecated " "interfaces by passing :option:`-Wd <-W>` to the Python interpreter (this is " @@ -668,11 +696,11 @@ msgid "" "what is possible." msgstr "" -#: ../../library/warnings.rst:396 +#: ../../library/warnings.rst:409 msgid "Available Functions" msgstr "" -#: ../../library/warnings.rst:401 +#: ../../library/warnings.rst:414 msgid "" "Issue a warning, or maybe ignore it or raise an exception. The *category* " "argument, if given, must be a :ref:`warning category class `. The entry is inserted at the front by default; if " @@ -806,7 +834,7 @@ msgid "" "everything." msgstr "" -#: ../../library/warnings.rst:511 +#: ../../library/warnings.rst:524 msgid "" "Insert a simple entry into the list of :ref:`warnings filter specifications " "`. The meaning of the function parameters is as for :func:" @@ -815,18 +843,18 @@ msgid "" "and line number match." msgstr "" -#: ../../library/warnings.rst:520 +#: ../../library/warnings.rst:533 msgid "" "Reset the warnings filter. This discards the effect of all previous calls " "to :func:`filterwarnings`, including that of the :option:`-W` command line " "options and calls to :func:`simplefilter`." msgstr "" -#: ../../library/warnings.rst:527 +#: ../../library/warnings.rst:540 msgid "Decorator to indicate that a class, function or overload is deprecated." msgstr "" -#: ../../library/warnings.rst:529 +#: ../../library/warnings.rst:542 msgid "" "When this decorator is applied to an object, deprecation warnings may be " "emitted at runtime when the object is used. :term:`static type checkers " @@ -834,11 +862,11 @@ msgid "" "deprecated object." msgstr "" -#: ../../library/warnings.rst:534 +#: ../../library/warnings.rst:547 msgid "Usage::" msgstr "" -#: ../../library/warnings.rst:536 +#: ../../library/warnings.rst:549 msgid "" "from warnings import deprecated\n" "from typing import overload\n" @@ -858,7 +886,7 @@ msgid "" "def g(x: str) -> int: ..." msgstr "" -#: ../../library/warnings.rst:553 +#: ../../library/warnings.rst:566 msgid "" "The warning specified by *category* will be emitted at runtime on use of " "deprecated objects. For functions, that happens on calls; for classes, on " @@ -870,7 +898,7 @@ msgid "" "*category* and *stacklevel* arguments." msgstr "" -#: ../../library/warnings.rst:564 +#: ../../library/warnings.rst:577 msgid "" "The deprecation message passed to the decorator is saved in the " "``__deprecated__`` attribute on the decorated object. If applied to an " @@ -879,15 +907,15 @@ msgid "" "by :func:`typing.get_overloads`." msgstr "" -#: ../../library/warnings.rst:571 +#: ../../library/warnings.rst:584 msgid "See :pep:`702`." msgstr "" -#: ../../library/warnings.rst:576 +#: ../../library/warnings.rst:589 msgid "Available Context Managers" msgstr "" -#: ../../library/warnings.rst:580 +#: ../../library/warnings.rst:593 msgid "" "A context manager that copies and, upon exit, restores the warnings filter " "and the :func:`showwarning` function. If the *record* argument is :const:" @@ -898,27 +926,27 @@ msgid "" "has attributes with the same names as the arguments to :func:`showwarning`." msgstr "" -#: ../../library/warnings.rst:589 +#: ../../library/warnings.rst:602 msgid "" "The *module* argument takes a module that will be used instead of the module " "returned when you import :mod:`warnings` whose filter will be protected. " "This argument exists primarily for testing the :mod:`warnings` module itself." msgstr "" -#: ../../library/warnings.rst:594 +#: ../../library/warnings.rst:607 msgid "" "If the *action* argument is not ``None``, the remaining arguments are passed " "to :func:`simplefilter` as if it were called immediately on entering the " "context." msgstr "" -#: ../../library/warnings.rst:598 +#: ../../library/warnings.rst:611 msgid "" "See :ref:`warning-filter` for the meaning of the *category* and *lineno* " "parameters." msgstr "" -#: ../../library/warnings.rst:603 +#: ../../library/warnings.rst:616 msgid "" "The :class:`catch_warnings` manager works by replacing and then later " "restoring the module's :func:`showwarning` function and internal list of " @@ -926,7 +954,7 @@ msgid "" "state and therefore is not thread-safe." msgstr "" -#: ../../library/warnings.rst:611 +#: ../../library/warnings.rst:624 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." msgstr "新增 *action*、*category*、*lineno* 和 *append* 參數。" diff --git a/library/xdrlib.po b/library/xdrlib.po index ca29ccbfd4..6e631c0f6c 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -19,329 +19,62 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/xdrlib.rst:2 -msgid ":mod:`xdrlib` --- Encode and decode XDR data" +#, fuzzy +msgid ":mod:`!xdrlib` --- Encode and decode XDR data" msgstr ":mod:`xdrlib` --- XDR 資料的編碼與解碼" -#: ../../library/xdrlib.rst:8 -msgid "**Source code:** :source:`Lib/xdrlib.py`" -msgstr "**原始碼:**\\ :source:`Lib/xdrlib.py`" - -#: ../../library/xdrlib.rst:14 -msgid "" -"The :mod:`xdrlib` module is deprecated (see :pep:`PEP 594 <594#xdrlib>` for " -"details)." -msgstr "" -":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " -"<594#xdrlib>`\\ )。" - -#: ../../library/xdrlib.rst:20 -msgid "" -"The :mod:`xdrlib` module supports the External Data Representation Standard " -"as described in :rfc:`1014`, written by Sun Microsystems, Inc. June 1987. " -"It supports most of the data types described in the RFC." -msgstr "" - -#: ../../library/xdrlib.rst:24 -msgid "" -"The :mod:`xdrlib` module defines two classes, one for packing variables into " -"XDR representation, and another for unpacking from XDR representation. " -"There are also two exception classes." -msgstr "" - -#: ../../library/xdrlib.rst:31 -msgid "" -":class:`Packer` is the class for packing data into XDR representation. The :" -"class:`Packer` class is instantiated with no arguments." -msgstr "" - -#: ../../library/xdrlib.rst:37 -msgid "" -"``Unpacker`` is the complementary class which unpacks XDR data values from a " -"string buffer. The input buffer is given as *data*." -msgstr "" - -#: ../../library/xdrlib.rst:43 -msgid ":rfc:`1014` - XDR: External Data Representation Standard" -msgstr "" - -#: ../../library/xdrlib.rst:44 -msgid "" -"This RFC defined the encoding of data which was XDR at the time this module " -"was originally written. It has apparently been obsoleted by :rfc:`1832`." -msgstr "" - -#: ../../library/xdrlib.rst:47 -msgid ":rfc:`1832` - XDR: External Data Representation Standard" -msgstr "" - -#: ../../library/xdrlib.rst:48 -msgid "Newer RFC that provides a revised definition of XDR." -msgstr "" - -#: ../../library/xdrlib.rst:54 -msgid "Packer Objects" -msgstr "" - -#: ../../library/xdrlib.rst:56 -msgid ":class:`Packer` instances have the following methods:" -msgstr "" - -#: ../../library/xdrlib.rst:61 -msgid "Returns the current pack buffer as a string." -msgstr "" - -#: ../../library/xdrlib.rst:66 -msgid "Resets the pack buffer to the empty string." -msgstr "" - -#: ../../library/xdrlib.rst:68 -msgid "" -"In general, you can pack any of the most common XDR data types by calling " -"the appropriate ``pack_type()`` method. Each method takes a single " -"argument, the value to pack. The following simple data type packing methods " -"are supported: :meth:`pack_uint`, :meth:`pack_int`, :meth:`pack_enum`, :meth:" -"`pack_bool`, :meth:`pack_uhyper`, and :meth:`pack_hyper`." -msgstr "" - -#: ../../library/xdrlib.rst:77 -msgid "Packs the single-precision floating point number *value*." -msgstr "" - -#: ../../library/xdrlib.rst:82 -msgid "Packs the double-precision floating point number *value*." -msgstr "" - -#: ../../library/xdrlib.rst:84 -msgid "The following methods support packing strings, bytes, and opaque data:" -msgstr "" - -#: ../../library/xdrlib.rst:89 -msgid "" -"Packs a fixed length string, *s*. *n* is the length of the string but it is " -"*not* packed into the data buffer. The string is padded with null bytes if " -"necessary to guaranteed 4 byte alignment." -msgstr "" - -#: ../../library/xdrlib.rst:96 -msgid "" -"Packs a fixed length opaque data stream, similarly to :meth:`pack_fstring`." -msgstr "" - -#: ../../library/xdrlib.rst:101 -msgid "" -"Packs a variable length string, *s*. The length of the string is first " -"packed as an unsigned integer, then the string data is packed with :meth:" -"`pack_fstring`." -msgstr "" - -#: ../../library/xdrlib.rst:108 -msgid "" -"Packs a variable length opaque data string, similarly to :meth:`pack_string`." -msgstr "" - -#: ../../library/xdrlib.rst:113 -msgid "Packs a variable length byte stream, similarly to :meth:`pack_string`." -msgstr "" - -#: ../../library/xdrlib.rst:115 -msgid "The following methods support packing arrays and lists:" -msgstr "" - -#: ../../library/xdrlib.rst:120 -msgid "" -"Packs a *list* of homogeneous items. This method is useful for lists with " -"an indeterminate size; i.e. the size is not available until the entire list " -"has been walked. For each item in the list, an unsigned integer ``1`` is " -"packed first, followed by the data value from the list. *pack_item* is the " -"function that is called to pack the individual item. At the end of the " -"list, an unsigned integer ``0`` is packed." -msgstr "" - -#: ../../library/xdrlib.rst:127 -msgid "" -"For example, to pack a list of integers, the code might appear like this::" -msgstr "" - -#: ../../library/xdrlib.rst:129 -msgid "" -"import xdrlib\n" -"p = xdrlib.Packer()\n" -"p.pack_list([1, 2, 3], p.pack_int)" -msgstr "" -"import xdrlib\n" -"p = xdrlib.Packer()\n" -"p.pack_list([1, 2, 3], p.pack_int)" - -#: ../../library/xdrlib.rst:136 -msgid "" -"Packs a fixed length list (*array*) of homogeneous items. *n* is the length " -"of the list; it is *not* packed into the buffer, but a :exc:`ValueError` " -"exception is raised if ``len(array)`` is not equal to *n*. As above, " -"*pack_item* is the function used to pack each element." -msgstr "" - -#: ../../library/xdrlib.rst:144 -msgid "" -"Packs a variable length *list* of homogeneous items. First, the length of " -"the list is packed as an unsigned integer, then each element is packed as " -"in :meth:`pack_farray` above." -msgstr "" - -#: ../../library/xdrlib.rst:152 -msgid "Unpacker Objects" -msgstr "" - -#: ../../library/xdrlib.rst:154 -msgid "The :class:`Unpacker` class offers the following methods:" -msgstr "" - -#: ../../library/xdrlib.rst:159 -msgid "Resets the string buffer with the given *data*." -msgstr "" - -#: ../../library/xdrlib.rst:164 -msgid "Returns the current unpack position in the data buffer." -msgstr "" - -#: ../../library/xdrlib.rst:169 -msgid "" -"Sets the data buffer unpack position to *position*. You should be careful " -"about using :meth:`get_position` and :meth:`set_position`." -msgstr "" - -#: ../../library/xdrlib.rst:175 -msgid "Returns the current unpack data buffer as a string." -msgstr "" - -#: ../../library/xdrlib.rst:180 -msgid "" -"Indicates unpack completion. Raises an :exc:`Error` exception if all of the " -"data has not been unpacked." -msgstr "" - -#: ../../library/xdrlib.rst:183 -msgid "" -"In addition, every data type that can be packed with a :class:`Packer`, can " -"be unpacked with an :class:`Unpacker`. Unpacking methods are of the form " -"``unpack_type()``, and take no arguments. They return the unpacked object." -msgstr "" - -#: ../../library/xdrlib.rst:190 -msgid "Unpacks a single-precision floating point number." -msgstr "" - -#: ../../library/xdrlib.rst:195 -msgid "" -"Unpacks a double-precision floating point number, similarly to :meth:" -"`unpack_float`." -msgstr "" - -#: ../../library/xdrlib.rst:198 -msgid "" -"In addition, the following methods unpack strings, bytes, and opaque data:" -msgstr "" - -#: ../../library/xdrlib.rst:203 -msgid "" -"Unpacks and returns a fixed length string. *n* is the number of characters " -"expected. Padding with null bytes to guaranteed 4 byte alignment is assumed." -msgstr "" - -#: ../../library/xdrlib.rst:209 -msgid "" -"Unpacks and returns a fixed length opaque data stream, similarly to :meth:" -"`unpack_fstring`." -msgstr "" - -#: ../../library/xdrlib.rst:215 -msgid "" -"Unpacks and returns a variable length string. The length of the string is " -"first unpacked as an unsigned integer, then the string data is unpacked " -"with :meth:`unpack_fstring`." -msgstr "" - -#: ../../library/xdrlib.rst:222 -msgid "" -"Unpacks and returns a variable length opaque data string, similarly to :meth:" -"`unpack_string`." -msgstr "" - -#: ../../library/xdrlib.rst:228 -msgid "" -"Unpacks and returns a variable length byte stream, similarly to :meth:" -"`unpack_string`." -msgstr "" - -#: ../../library/xdrlib.rst:231 -msgid "The following methods support unpacking arrays and lists:" -msgstr "" - -#: ../../library/xdrlib.rst:236 -msgid "" -"Unpacks and returns a list of homogeneous items. The list is unpacked one " -"element at a time by first unpacking an unsigned integer flag. If the flag " -"is ``1``, then the item is unpacked and appended to the list. A flag of " -"``0`` indicates the end of the list. *unpack_item* is the function that is " -"called to unpack the items." -msgstr "" - -#: ../../library/xdrlib.rst:245 -msgid "" -"Unpacks and returns (as a list) a fixed length array of homogeneous items. " -"*n* is number of list elements to expect in the buffer. As above, " -"*unpack_item* is the function used to unpack each element." -msgstr "" - -#: ../../library/xdrlib.rst:252 -msgid "" -"Unpacks and returns a variable length *list* of homogeneous items. First, " -"the length of the list is unpacked as an unsigned integer, then each element " -"is unpacked as in :meth:`unpack_farray` above." -msgstr "" - -#: ../../library/xdrlib.rst:260 -msgid "Exceptions" -msgstr "例外" - -#: ../../library/xdrlib.rst:262 -msgid "Exceptions in this module are coded as class instances:" -msgstr "" - -#: ../../library/xdrlib.rst:267 -msgid "" -"The base exception class. :exc:`Error` has a single public attribute :attr:" -"`msg` containing the description of the error." -msgstr "" - -#: ../../library/xdrlib.rst:273 +#: ../../library/xdrlib.rst:10 msgid "" -"Class derived from :exc:`Error`. Contains no additional instance variables." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: ../../library/xdrlib.rst:275 -msgid "Here is an example of how you would catch one of these exceptions::" -msgstr "" - -#: ../../library/xdrlib.rst:277 +#: ../../library/xdrlib.rst:14 msgid "" -"import xdrlib\n" -"p = xdrlib.Packer()\n" -"try:\n" -" p.pack_double(8.01)\n" -"except xdrlib.ConversionError as instance:\n" -" print('packing the double failed:', instance.msg)" -msgstr "" -"import xdrlib\n" -"p = xdrlib.Packer()\n" -"try:\n" -" p.pack_double(8.01)\n" -"except xdrlib.ConversionError as instance:\n" -" print('packing the double failed:', instance.msg)" - -#: ../../library/xdrlib.rst:10 -msgid "XDR" -msgstr "XDR" - -#: ../../library/xdrlib.rst:10 -msgid "External Data Representation" -msgstr "External Data Representation (外部資料表示)" +"The last version of Python that provided the :mod:`!xdrlib` module was " +"`Python 3.12 `_." +msgstr "" + +#~ msgid "**Source code:** :source:`Lib/xdrlib.py`" +#~ msgstr "**原始碼:**\\ :source:`Lib/xdrlib.py`" + +#~ msgid "" +#~ "The :mod:`xdrlib` module is deprecated (see :pep:`PEP 594 <594#xdrlib>` " +#~ "for details)." +#~ msgstr "" +#~ ":mod:`xdrlib` 模組 (module) 即將被棄用(詳見 :pep:`PEP 594 " +#~ "<594#xdrlib>`\\ )。" + +#~ msgid "" +#~ "import xdrlib\n" +#~ "p = xdrlib.Packer()\n" +#~ "p.pack_list([1, 2, 3], p.pack_int)" +#~ msgstr "" +#~ "import xdrlib\n" +#~ "p = xdrlib.Packer()\n" +#~ "p.pack_list([1, 2, 3], p.pack_int)" + +#~ msgid "Exceptions" +#~ msgstr "例外" + +#~ msgid "" +#~ "import xdrlib\n" +#~ "p = xdrlib.Packer()\n" +#~ "try:\n" +#~ " p.pack_double(8.01)\n" +#~ "except xdrlib.ConversionError as instance:\n" +#~ " print('packing the double failed:', instance.msg)" +#~ msgstr "" +#~ "import xdrlib\n" +#~ "p = xdrlib.Packer()\n" +#~ "try:\n" +#~ " p.pack_double(8.01)\n" +#~ "except xdrlib.ConversionError as instance:\n" +#~ " print('packing the double failed:', instance.msg)" + +#~ msgid "XDR" +#~ msgstr "XDR" + +#~ msgid "External Data Representation" +#~ msgstr "External Data Representation (外部資料表示)" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 54d29a5210..0b0bdb43e2 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -610,8 +610,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1547 -#: ../../reference/compound_stmts.rst:1588 +#: ../../reference/compound_stmts.rst:1544 +#: ../../reference/compound_stmts.rst:1585 msgid "The following code::" msgstr "" @@ -624,29 +624,27 @@ msgstr "" " SUITE" #: ../../reference/compound_stmts.rst:531 -#: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:553 +#: ../../reference/compound_stmts.rst:1590 msgid "is semantically equivalent to::" msgstr "" #: ../../reference/compound_stmts.rst:533 +#, fuzzy msgid "" "manager = (EXPRESSION)\n" "enter = type(manager).__enter__\n" "exit = type(manager).__exit__\n" "value = enter(manager)\n" -"hit_except = False\n" "\n" "try:\n" " TARGET = value\n" " SUITE\n" "except:\n" -" hit_except = True\n" " if not exit(manager, *sys.exc_info()):\n" " raise\n" -"finally:\n" -" if not hit_except:\n" -" exit(manager, None, None, None)" +"else:\n" +" exit(manager, None, None, None)" msgstr "" "manager = (EXPRESSION)\n" "enter = type(manager).__enter__\n" @@ -665,13 +663,13 @@ msgstr "" " if not hit_except:\n" " exit(manager, None, None, None)" -#: ../../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:553 +#: ../../reference/compound_stmts.rst:550 msgid "" "with A() as a, B() as b:\n" " SUITE" @@ -679,7 +677,7 @@ msgstr "" "with A() as a, B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:558 +#: ../../reference/compound_stmts.rst:555 msgid "" "with A() as a:\n" " with B() as b:\n" @@ -689,13 +687,13 @@ msgstr "" " with B() as b:\n" " SUITE" -#: ../../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:565 +#: ../../reference/compound_stmts.rst:562 msgid "" "with (\n" " A() as a,\n" @@ -709,88 +707,88 @@ msgstr "" "):\n" " SUITE" -#: ../../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:579 +#: ../../reference/compound_stmts.rst:576 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:1182 +#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:1179 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:623 +#: ../../reference/compound_stmts.rst:1180 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 " @@ -800,7 +798,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 " @@ -809,38 +807,38 @@ 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:673 +#: ../../reference/compound_stmts.rst:670 msgid "" ">>> flag = False\n" ">>> match (100, 200):\n" @@ -856,56 +854,56 @@ msgid "" "Case 3, y: 200" 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 " @@ -914,17 +912,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 " @@ -932,47 +930,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 " @@ -982,70 +980,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 ``_``." 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 " @@ -1053,42 +1051,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 " @@ -1096,55 +1094,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 " @@ -1152,44 +1150,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 " @@ -1197,40 +1195,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 " @@ -1238,118 +1236,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 " @@ -1357,256 +1355,256 @@ msgid "" "`~object.__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:1147 +#: ../../reference/compound_stmts.rst:1144 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:1878 +#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1875 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:1881 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1878 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:1173 +#: ../../reference/compound_stmts.rst:1170 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1172 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1173 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1178 +#: ../../reference/compound_stmts.rst:1175 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1193 +#: ../../reference/compound_stmts.rst:1190 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1208 +#: ../../reference/compound_stmts.rst:1205 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1228 +#: ../../reference/compound_stmts.rst:1225 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 " @@ -1615,13 +1613,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1231 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1240 +#: ../../reference/compound_stmts.rst:1237 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1632,7 +1630,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 +#: ../../reference/compound_stmts.rst:1244 msgid "" "@f1(arg)\n" "@f2\n" @@ -1642,12 +1640,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1251 -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1248 +#: ../../reference/compound_stmts.rst:1443 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1250 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1655,20 +1653,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1253 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1258 +#: ../../reference/compound_stmts.rst:1255 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:1263 +#: ../../reference/compound_stmts.rst:1260 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1678,12 +1676,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1270 -#: ../../reference/compound_stmts.rst:1465 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1462 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1278 +#: ../../reference/compound_stmts.rst:1275 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1694,7 +1692,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1286 +#: ../../reference/compound_stmts.rst:1283 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1707,7 +1705,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1296 +#: ../../reference/compound_stmts.rst:1293 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1716,7 +1714,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1304 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1732,13 +1730,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1319 +#: ../../reference/compound_stmts.rst:1316 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1328 +#: ../../reference/compound_stmts.rst:1325 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1757,13 +1755,13 @@ msgid "" "in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1342 +#: ../../reference/compound_stmts.rst:1339 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1345 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1775,7 +1773,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1356 +#: ../../reference/compound_stmts.rst:1353 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1784,61 +1782,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1361 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1362 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1365 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1370 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1371 +#: ../../reference/compound_stmts.rst:1368 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1371 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1372 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:1378 +#: ../../reference/compound_stmts.rst:1375 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1376 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1385 +#: ../../reference/compound_stmts.rst:1382 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1397 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1407 +#: ../../reference/compound_stmts.rst:1404 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1847,7 +1845,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1413 +#: ../../reference/compound_stmts.rst:1410 msgid "" "class Foo:\n" " pass" @@ -1855,11 +1853,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1416 +#: ../../reference/compound_stmts.rst:1413 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1415 msgid "" "class Foo(object):\n" " pass" @@ -1867,7 +1865,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1421 +#: ../../reference/compound_stmts.rst:1418 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 " @@ -1879,7 +1877,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1427 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's :attr:`~type.__dict__`. Note that this is reliable only " @@ -1887,17 +1885,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1432 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1437 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1439 msgid "" "@f1(arg)\n" "@f2\n" @@ -1907,7 +1905,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1445 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1915,20 +1913,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1448 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:1454 +#: ../../reference/compound_stmts.rst:1451 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:1459 +#: ../../reference/compound_stmts.rst:1456 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1937,7 +1935,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1465 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1950,35 +1948,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1477 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1478 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:1485 +#: ../../reference/compound_stmts.rst:1482 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1483 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1493 +#: ../../reference/compound_stmts.rst:1490 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1498 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1508 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1986,23 +1984,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1512 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:1518 +#: ../../reference/compound_stmts.rst:1515 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1518 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1523 +#: ../../reference/compound_stmts.rst:1520 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2012,30 +2010,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1524 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:1535 +#: ../../reference/compound_stmts.rst:1532 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1537 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:1544 +#: ../../reference/compound_stmts.rst:1541 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1546 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2047,11 +2045,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1554 +#: ../../reference/compound_stmts.rst:1551 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1553 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2081,28 +2079,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1567 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1569 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1577 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1582 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:1590 +#: ../../reference/compound_stmts.rst:1587 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2110,7 +2108,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1592 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2146,44 +2144,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1609 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1611 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1616 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1617 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1623 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1627 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1643 +#: ../../reference/compound_stmts.rst:1640 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1647 +#: ../../reference/compound_stmts.rst:1644 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2215,7 +2213,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1662 +#: ../../reference/compound_stmts.rst:1659 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2223,7 +2221,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1664 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2235,36 +2233,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1673 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1679 +#: ../../reference/compound_stmts.rst:1676 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1681 +#: ../../reference/compound_stmts.rst:1678 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1683 +#: ../../reference/compound_stmts.rst:1680 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1686 +#: ../../reference/compound_stmts.rst:1683 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1689 +#: ../../reference/compound_stmts.rst:1686 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2276,7 +2274,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1698 +#: ../../reference/compound_stmts.rst:1695 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2286,13 +2284,13 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1704 +#: ../../reference/compound_stmts.rst:1701 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1707 +#: ../../reference/compound_stmts.rst:1704 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2305,13 +2303,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1714 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1719 +#: ../../reference/compound_stmts.rst:1716 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2343,24 +2341,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1737 +#: ../../reference/compound_stmts.rst:1734 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1739 +#: ../../reference/compound_stmts.rst:1736 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1738 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1743 -#: ../../reference/compound_stmts.rst:1803 +#: ../../reference/compound_stmts.rst:1740 +#: ../../reference/compound_stmts.rst:1800 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1742 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2376,7 +2374,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1752 +#: ../../reference/compound_stmts.rst:1749 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -2385,20 +2383,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1758 +#: ../../reference/compound_stmts.rst:1755 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1762 +#: ../../reference/compound_stmts.rst:1759 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1765 +#: ../../reference/compound_stmts.rst:1762 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2408,13 +2406,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1766 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1772 +#: ../../reference/compound_stmts.rst:1769 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2436,25 +2434,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1791 +#: ../../reference/compound_stmts.rst:1788 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1797 +#: ../../reference/compound_stmts.rst:1794 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1799 +#: ../../reference/compound_stmts.rst:1796 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1801 +#: ../../reference/compound_stmts.rst:1798 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1805 +#: ../../reference/compound_stmts.rst:1802 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2472,14 +2470,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1810 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1814 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2487,7 +2485,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1823 +#: ../../reference/compound_stmts.rst:1820 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2495,11 +2493,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1826 +#: ../../reference/compound_stmts.rst:1823 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1828 +#: ../../reference/compound_stmts.rst:1825 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2517,27 +2515,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1836 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1838 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1840 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1842 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1845 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2550,105 +2548,105 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1857 +#: ../../reference/compound_stmts.rst:1854 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1859 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1860 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:1867 +#: ../../reference/compound_stmts.rst:1864 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1866 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1870 +#: ../../reference/compound_stmts.rst:1867 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1868 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1872 -#: ../../reference/compound_stmts.rst:1891 +#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1888 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1871 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1876 +#: ../../reference/compound_stmts.rst:1873 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1874 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1879 +#: ../../reference/compound_stmts.rst:1876 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1877 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1880 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1886 +#: ../../reference/compound_stmts.rst:1883 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1888 +#: ../../reference/compound_stmts.rst:1885 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1889 +#: ../../reference/compound_stmts.rst:1886 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1887 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1893 +#: ../../reference/compound_stmts.rst:1890 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1896 +#: ../../reference/compound_stmts.rst:1893 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1900 +#: ../../reference/compound_stmts.rst:1897 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's :attr:`~type.__doc__` item and therefore " @@ -2668,12 +2666,12 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:437 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1497 -#: ../../reference/compound_stmts.rst:1531 -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1528 +#: ../../reference/compound_stmts.rst:1573 msgid "statement" msgstr "statement(陳述式)" @@ -2709,7 +2707,7 @@ msgstr "" msgid "else" msgstr "else" -#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:585 msgid "if" msgstr "if" @@ -2720,8 +2718,8 @@ msgstr "if" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1504 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2733,10 +2731,10 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1384 msgid ": (colon)" msgstr ": (冒號)" @@ -2744,9 +2742,9 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2791,8 +2789,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "object" msgstr "object(物件)" @@ -2824,7 +2822,7 @@ msgstr "finally" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:265 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "as" msgstr "as" @@ -2862,199 +2860,199 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "match" msgstr "match" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "case" msgstr "case" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "pattern matching" msgstr "pattern matching(模式匹配)" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "match statement" msgstr "match statement(匹配陳述式)" -#: ../../reference/compound_stmts.rst:692 +#: ../../reference/compound_stmts.rst:689 msgid "guard" msgstr "guard" -#: ../../reference/compound_stmts.rst:731 +#: ../../reference/compound_stmts.rst:728 msgid "irrefutable case block" msgstr "" -#: ../../reference/compound_stmts.rst:731 +#: ../../reference/compound_stmts.rst:728 msgid "case block" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:752 msgid "! patterns" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:752 msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1270 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1273 -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1299 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1320 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1434 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1343 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1343 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1434 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1494 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1504 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1504 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1528 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1573 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1630 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index aa4a8aca30..b7eb61c276 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -1146,7 +1146,7 @@ msgstr "" #: ../../reference/datamodel.rst:1016 msgid "" "Setting :attr:`!__loader__` on a module while failing to set :attr:`!" -"__spec__.loader` is deprecated. In Python 3.14, :attr:`!__loader__` will " +"__spec__.loader` is deprecated. In Python 3.16, :attr:`!__loader__` will " "cease to be set or taken into consideration by the import system or the " "standard library." msgstr "" @@ -1611,7 +1611,7 @@ msgstr "" #: ../../reference/datamodel.rst:1461 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " -"3.14." +"3.15." msgstr "" #: ../../reference/datamodel.rst:1466 @@ -2233,37 +2233,39 @@ msgstr "" #: ../../reference/datamodel.rst:1988 msgid "" "This is typically used for debugging, so it is important that the " -"representation is information-rich and unambiguous." +"representation is information-rich and unambiguous. A default implementation " +"is provided by the :class:`object` class itself." msgstr "" -#: ../../reference/datamodel.rst:1999 +#: ../../reference/datamodel.rst:2000 msgid "" -"Called by :func:`str(object) ` and the built-in functions :func:" -"`format` and :func:`print` to compute the \"informal\" or nicely printable " -"string representation of an object. The return value must be a :ref:`string " -"` object." +"Called by :func:`str(object) `, the default :meth:`__format__` " +"implementation, and the built-in function :func:`print`, to compute the " +"\"informal\" or nicely printable string representation of an object. The " +"return value must be a :ref:`str ` object." msgstr "" -#: ../../reference/datamodel.rst:2004 +#: ../../reference/datamodel.rst:2005 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:2008 +#: ../../reference/datamodel.rst:2009 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2019 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " -"of an object. This should return a :class:`bytes` object." +"of an object. This should return a :class:`bytes` object. The :class:" +"`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2031 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -2275,28 +2277,34 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:2039 +#: ../../reference/datamodel.rst:2041 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:2041 +#: ../../reference/datamodel.rst:2043 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:2043 +#: ../../reference/datamodel.rst:2045 +msgid "" +"The default implementation by the :class:`object` class should be given an " +"empty *format_spec* string. It delegates to :meth:`__str__`." +msgstr "" + +#: ../../reference/datamodel.rst:2048 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:2047 +#: ../../reference/datamodel.rst:2052 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2068 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:2155 +#: ../../reference/datamodel.rst:2166 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 " @@ -2430,7 +2448,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2175 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2438,7 +2456,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:2169 +#: ../../reference/datamodel.rst:2180 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 " @@ -2446,52 +2464,54 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2185 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:2178 +#: ../../reference/datamodel.rst:2189 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:2180 +#: ../../reference/datamodel.rst:2191 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:2188 +#: ../../reference/datamodel.rst:2199 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " "defined, :meth:`~object.__len__` is called, if it is defined, and the object " "is considered true if its result is nonzero. If a class defines neither :" -"meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." +"meth:`!__len__` nor :meth:`!__bool__` (which is true of the :class:`object` " +"class itself), all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2210 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:2201 +#: ../../reference/datamodel.rst:2212 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:2209 +#: ../../reference/datamodel.rst:2220 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " "*name* is not an instance attribute or an attribute in the class tree for " "``self``; or :meth:`__get__` of a *name* property raises :exc:" "`AttributeError`). This method should either return the (computed) " -"attribute value or raise an :exc:`AttributeError` exception." +"attribute value or raise an :exc:`AttributeError` exception. The :class:" +"`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:2216 +#: ../../reference/datamodel.rst:2228 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2504,7 +2524,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2241 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2516,64 +2536,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2252 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:2245 ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2257 ../../reference/datamodel.rst:2259 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2254 +#: ../../reference/datamodel.rst:2266 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:2258 +#: ../../reference/datamodel.rst:2270 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." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:2262 ../../reference/datamodel.rst:2264 +#: ../../reference/datamodel.rst:2274 ../../reference/datamodel.rst:2276 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2271 +#: ../../reference/datamodel.rst:2283 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:2274 ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2286 ../../reference/datamodel.rst:2288 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2295 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2288 +#: ../../reference/datamodel.rst:2300 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2307 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2585,21 +2605,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2304 +#: ../../reference/datamodel.rst:2316 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "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:2308 +#: ../../reference/datamodel.rst:2320 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:2312 +#: ../../reference/datamodel.rst:2324 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2627,7 +2647,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2326 +#: ../../reference/datamodel.rst:2338 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2635,37 +2655,38 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2343 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2346 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2339 +#: ../../reference/datamodel.rst:2351 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2340 +#: ../../reference/datamodel.rst:2352 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2358 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2348 +#: ../../reference/datamodel.rst:2360 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 " "descriptor must be in either the owner's class dictionary or in the class " "dictionary for one of its parents). In the examples below, \"the " "attribute\" refers to the attribute whose name is the key of the property in " -"the owner class' :attr:`~object.__dict__`." +"the owner class' :attr:`~object.__dict__`. The :class:`object` class itself " +"does not implement any of these protocols." msgstr "" -#: ../../reference/datamodel.rst:2358 +#: ../../reference/datamodel.rst:2370 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 " @@ -2674,13 +2695,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2376 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2367 +#: ../../reference/datamodel.rst:2379 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2690,31 +2711,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2376 +#: ../../reference/datamodel.rst:2388 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2379 +#: ../../reference/datamodel.rst:2391 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:2385 +#: ../../reference/datamodel.rst:2397 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2387 +#: ../../reference/datamodel.rst:2399 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2392 +#: ../../reference/datamodel.rst:2404 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2725,11 +2746,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2415 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2405 +#: ../../reference/datamodel.rst:2417 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2738,7 +2759,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2411 +#: ../../reference/datamodel.rst:2423 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 " @@ -2746,7 +2767,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2416 +#: ../../reference/datamodel.rst:2428 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 " @@ -2754,54 +2775,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2421 +#: ../../reference/datamodel.rst:2433 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2436 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2425 +#: ../../reference/datamodel.rst:2437 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2440 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2429 +#: ../../reference/datamodel.rst:2441 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:2432 +#: ../../reference/datamodel.rst:2444 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2445 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2448 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2437 +#: ../../reference/datamodel.rst:2449 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:2474 +#: ../../reference/datamodel.rst:2486 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2819,7 +2840,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2489 +#: ../../reference/datamodel.rst:2501 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2828,30 +2849,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2507 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2502 +#: ../../reference/datamodel.rst:2514 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2516 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:2508 +#: ../../reference/datamodel.rst:2520 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:2513 +#: ../../reference/datamodel.rst:2525 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2859,18 +2880,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2534 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2536 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:2528 +#: ../../reference/datamodel.rst:2540 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2879,7 +2900,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2547 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2887,7 +2908,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2541 +#: ../../reference/datamodel.rst:2553 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2895,7 +2916,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:2559 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. " @@ -2904,7 +2925,7 @@ msgid "" "only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2565 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 " @@ -2913,7 +2934,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2570 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2921,11 +2942,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2563 +#: ../../reference/datamodel.rst:2575 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2565 +#: ../../reference/datamodel.rst:2577 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 " @@ -2933,13 +2954,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2582 msgid "" ":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2585 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2947,18 +2968,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:2591 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:2587 +#: ../../reference/datamodel.rst:2599 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2601 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2968,14 +2989,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2610 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:2602 +#: ../../reference/datamodel.rst:2614 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2983,7 +3004,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2608 +#: ../../reference/datamodel.rst:2620 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -3001,13 +3022,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2616 +#: ../../reference/datamodel.rst:2628 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2621 +#: ../../reference/datamodel.rst:2633 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -3015,19 +3036,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2629 +#: ../../reference/datamodel.rst:2641 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:2634 +#: ../../reference/datamodel.rst:2646 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:2637 +#: ../../reference/datamodel.rst:2649 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -3035,14 +3056,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2640 +#: ../../reference/datamodel.rst:2652 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:2644 +#: ../../reference/datamodel.rst:2656 msgid "" "class A:\n" " pass\n" @@ -3052,22 +3073,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2651 +#: ../../reference/datamodel.rst:2663 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2659 +#: ../../reference/datamodel.rst:2671 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2678 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:2670 +#: ../../reference/datamodel.rst:2682 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -3075,7 +3096,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2675 +#: ../../reference/datamodel.rst:2687 msgid "" "class Meta(type):\n" " pass\n" @@ -3095,41 +3116,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2696 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:2687 +#: ../../reference/datamodel.rst:2699 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2689 +#: ../../reference/datamodel.rst:2701 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2690 +#: ../../reference/datamodel.rst:2702 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2691 +#: ../../reference/datamodel.rst:2703 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2692 +#: ../../reference/datamodel.rst:2704 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2693 +#: ../../reference/datamodel.rst:2705 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2709 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2701 +#: ../../reference/datamodel.rst:2713 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -3141,59 +3162,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2712 +#: ../../reference/datamodel.rst:2724 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2713 +#: ../../reference/datamodel.rst:2725 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2715 +#: ../../reference/datamodel.rst:2727 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2728 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2731 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2732 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2724 +#: ../../reference/datamodel.rst:2736 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2728 +#: ../../reference/datamodel.rst:2740 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2730 +#: ../../reference/datamodel.rst:2742 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2743 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:2733 +#: ../../reference/datamodel.rst:2745 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:2736 +#: ../../reference/datamodel.rst:2748 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -3202,11 +3223,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2746 +#: ../../reference/datamodel.rst:2758 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2751 +#: ../../reference/datamodel.rst:2763 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -3218,25 +3239,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2760 +#: ../../reference/datamodel.rst:2772 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2777 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2778 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2770 +#: ../../reference/datamodel.rst:2782 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2787 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -3245,7 +3266,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2781 +#: ../../reference/datamodel.rst:2793 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. " @@ -3254,11 +3275,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2790 +#: ../../reference/datamodel.rst:2802 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2797 +#: ../../reference/datamodel.rst:2809 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -3266,7 +3287,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2802 +#: ../../reference/datamodel.rst:2814 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 " @@ -3277,7 +3298,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:2824 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 " @@ -3286,39 +3307,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2818 +#: ../../reference/datamodel.rst:2830 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:2822 +#: ../../reference/datamodel.rst:2834 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:2824 +#: ../../reference/datamodel.rst:2836 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2826 +#: ../../reference/datamodel.rst:2838 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:2829 +#: ../../reference/datamodel.rst:2841 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:2833 +#: ../../reference/datamodel.rst:2845 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 " @@ -3326,19 +3347,19 @@ msgid "" "becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2840 +#: ../../reference/datamodel.rst:2852 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2841 +#: ../../reference/datamodel.rst:2853 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2845 +#: ../../reference/datamodel.rst:2857 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2859 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3346,17 +3367,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2866 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2856 +#: ../../reference/datamodel.rst:2868 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:2859 +#: ../../reference/datamodel.rst:2871 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3364,21 +3385,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2878 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:2873 +#: ../../reference/datamodel.rst:2885 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:2878 +#: ../../reference/datamodel.rst:2890 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 " @@ -3386,11 +3407,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2897 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2898 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" @@ -3399,11 +3420,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2906 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2896 +#: ../../reference/datamodel.rst:2908 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3411,65 +3432,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2903 +#: ../../reference/datamodel.rst:2915 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2916 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2918 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2907 +#: ../../reference/datamodel.rst:2919 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2909 +#: ../../reference/datamodel.rst:2921 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2910 +#: ../../reference/datamodel.rst:2922 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2925 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2918 +#: ../../reference/datamodel.rst:2930 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2921 +#: ../../reference/datamodel.rst:2933 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:2927 +#: ../../reference/datamodel.rst:2939 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2929 +#: ../../reference/datamodel.rst:2941 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:2933 +#: ../../reference/datamodel.rst:2945 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3478,7 +3499,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2939 +#: ../../reference/datamodel.rst:2951 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3486,11 +3507,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:2961 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2951 +#: ../../reference/datamodel.rst:2963 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3500,14 +3521,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2958 +#: ../../reference/datamodel.rst:2970 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:2963 +#: ../../reference/datamodel.rst:2975 msgid "" "from inspect import isclass\n" "\n" @@ -3533,7 +3554,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2998 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 " @@ -3543,7 +3564,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:3005 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3558,14 +3579,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3005 +#: ../../reference/datamodel.rst:3017 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:3009 +#: ../../reference/datamodel.rst:3021 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3585,43 +3606,44 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:3028 +#: ../../reference/datamodel.rst:3040 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:3029 +#: ../../reference/datamodel.rst:3041 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:3037 +#: ../../reference/datamodel.rst:3049 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3056 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, ...)``." +"arg1, ...)``. The :class:`object` class itself does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3051 +#: ../../reference/datamodel.rst:3064 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:3053 +#: ../../reference/datamodel.rst:3066 msgid "" -"The following methods can be defined to implement container objects. " -"Containers usually are :term:`sequences ` (such as :class:`lists " -"` or :class:`tuples `) or :term:`mappings ` (like :" -"class:`dictionaries `), but can represent other containers as well. " -"The first set of methods is used either to emulate a sequence or to emulate " -"a mapping; the difference is that for a sequence, the allowable keys should " -"be the integers *k* for which ``0 <= k < N`` where *N* is the length of the " -"sequence, or :class:`slice` objects, which define a range of items. It is " -"also recommended that mappings provide the methods :meth:`!keys`, :meth:`!" +"The following methods can be defined to implement container objects. None of " +"them are provided by the :class:`object` class itself. Containers usually " +"are :term:`sequences ` (such as :class:`lists ` or :class:" +"`tuples `) or :term:`mappings ` (like :term:`dictionaries " +"`), but can represent other containers as well. The first set " +"of methods is used either to emulate a sequence or to emulate a mapping; the " +"difference is that for a sequence, the allowable keys should be the integers " +"*k* for which ``0 <= k < N`` where *N* is the length of the sequence, or :" +"class:`slice` objects, which define a range of items. It is also " +"recommended that mappings provide the methods :meth:`!keys`, :meth:`!" "values`, :meth:`!items`, :meth:`!get`, :meth:`!clear`, :meth:`!setdefault`, :" "meth:`!pop`, :meth:`!popitem`, :meth:`!copy`, and :meth:`!update` behaving " "similar to those for Python's standard :class:`dictionary ` objects. " @@ -3647,7 +3669,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:3094 +#: ../../reference/datamodel.rst:3108 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 " @@ -3655,7 +3677,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:3101 +#: ../../reference/datamodel.rst:3115 msgid "" "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:" @@ -3664,7 +3686,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3124 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). " @@ -3674,28 +3696,28 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:3138 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:3126 +#: ../../reference/datamodel.rst:3140 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:3128 +#: ../../reference/datamodel.rst:3142 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:3130 +#: ../../reference/datamodel.rst:3144 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:3132 +#: ../../reference/datamodel.rst:3146 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:3137 +#: ../../reference/datamodel.rst:3151 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3707,20 +3729,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:3149 +#: ../../reference/datamodel.rst:3163 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:3154 +#: ../../reference/datamodel.rst:3168 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:3162 +#: ../../reference/datamodel.rst:3176 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3729,7 +3751,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3171 +#: ../../reference/datamodel.rst:3185 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3738,13 +3760,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3180 +#: ../../reference/datamodel.rst:3194 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:3186 +#: ../../reference/datamodel.rst:3200 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 " @@ -3752,14 +3774,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3194 +#: ../../reference/datamodel.rst:3208 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:3198 +#: ../../reference/datamodel.rst:3212 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 :" @@ -3768,7 +3790,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3219 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3776,14 +3798,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3226 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:3216 +#: ../../reference/datamodel.rst:3230 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3791,11 +3813,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3225 +#: ../../reference/datamodel.rst:3239 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3227 +#: ../../reference/datamodel.rst:3241 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3803,7 +3825,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3253 +#: ../../reference/datamodel.rst:3267 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3817,13 +3839,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3264 +#: ../../reference/datamodel.rst:3278 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3287 +#: ../../reference/datamodel.rst:3301 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3836,13 +3858,13 @@ msgid "" "`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3299 +#: ../../reference/datamodel.rst:3313 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3304 +#: ../../reference/datamodel.rst:3318 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 " @@ -3851,7 +3873,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3325 +#: ../../reference/datamodel.rst:3339 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3869,19 +3891,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3348 +#: ../../reference/datamodel.rst:3362 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3361 +#: ../../reference/datamodel.rst:3375 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:3368 +#: ../../reference/datamodel.rst:3382 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3890,14 +3912,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3374 +#: ../../reference/datamodel.rst:3388 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:3386 +#: ../../reference/datamodel.rst:3400 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3906,21 +3928,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3392 +#: ../../reference/datamodel.rst:3406 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:3395 +#: ../../reference/datamodel.rst:3409 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3402 +#: ../../reference/datamodel.rst:3416 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3404 +#: ../../reference/datamodel.rst:3418 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 " @@ -3930,32 +3952,34 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3429 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:3418 +#: ../../reference/datamodel.rst:3432 msgid "" -"For more information on context managers, see :ref:`typecontextmanager`." +"For more information on context managers, see :ref:`typecontextmanager`. " +"The :class:`object` class itself does not provide the context manager " +"methods." msgstr "" -#: ../../reference/datamodel.rst:3423 +#: ../../reference/datamodel.rst:3438 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:3430 +#: ../../reference/datamodel.rst:3445 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:3434 +#: ../../reference/datamodel.rst:3449 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. " @@ -3963,27 +3987,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3438 +#: ../../reference/datamodel.rst:3453 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3444 +#: ../../reference/datamodel.rst:3459 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3445 +#: ../../reference/datamodel.rst:3460 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3452 +#: ../../reference/datamodel.rst:3467 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3454 +#: ../../reference/datamodel.rst:3469 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 " @@ -3991,7 +4015,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3461 +#: ../../reference/datamodel.rst:3476 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 " @@ -4000,7 +4024,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3482 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -4010,19 +4034,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3477 +#: ../../reference/datamodel.rst:3492 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3493 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3484 +#: ../../reference/datamodel.rst:3499 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3486 +#: ../../reference/datamodel.rst:3501 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -4030,13 +4054,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3491 +#: ../../reference/datamodel.rst:3506 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3496 +#: ../../reference/datamodel.rst:3511 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -4046,7 +4070,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3505 +#: ../../reference/datamodel.rst:3520 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -4055,28 +4079,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3516 +#: ../../reference/datamodel.rst:3531 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3517 +#: ../../reference/datamodel.rst:3532 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3519 +#: ../../reference/datamodel.rst:3534 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3520 +#: ../../reference/datamodel.rst:3535 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3525 +#: ../../reference/datamodel.rst:3540 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3527 +#: ../../reference/datamodel.rst:3542 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 " @@ -4084,7 +4108,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3532 +#: ../../reference/datamodel.rst:3547 msgid "" ">>> class C:\n" "... pass\n" @@ -4106,7 +4130,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3542 +#: ../../reference/datamodel.rst:3557 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -4115,7 +4139,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3549 +#: ../../reference/datamodel.rst:3564 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -4131,14 +4155,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3556 +#: ../../reference/datamodel.rst:3571 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:3560 +#: ../../reference/datamodel.rst:3575 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -4150,14 +4174,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3565 +#: ../../reference/datamodel.rst:3580 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:3569 +#: ../../reference/datamodel.rst:3584 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -4182,7 +4206,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3591 +#: ../../reference/datamodel.rst:3606 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -4191,36 +4215,37 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3602 +#: ../../reference/datamodel.rst:3617 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3606 +#: ../../reference/datamodel.rst:3621 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3608 +#: ../../reference/datamodel.rst:3623 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:3614 +#: ../../reference/datamodel.rst:3629 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:3620 +#: ../../reference/datamodel.rst:3635 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." +"method to be compatible with the :keyword:`await` expression. The :class:" +"`object` class itself is not awaitable and does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3626 +#: ../../reference/datamodel.rst:3643 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 " @@ -4228,15 +4253,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3634 +#: ../../reference/datamodel.rst:3651 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3640 +#: ../../reference/datamodel.rst:3657 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3642 +#: ../../reference/datamodel.rst:3659 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -4247,18 +4272,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3650 +#: ../../reference/datamodel.rst:3667 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:3654 +#: ../../reference/datamodel.rst:3671 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3660 +#: ../../reference/datamodel.rst:3677 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -4269,7 +4294,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3671 +#: ../../reference/datamodel.rst:3688 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4280,13 +4305,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3682 +#: ../../reference/datamodel.rst:3699 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3687 +#: ../../reference/datamodel.rst:3704 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4296,42 +4321,46 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3695 +#: ../../reference/datamodel.rst:3712 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3701 +#: ../../reference/datamodel.rst:3718 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3703 +#: ../../reference/datamodel.rst:3720 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3706 +#: ../../reference/datamodel.rst:3723 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3710 +#: ../../reference/datamodel.rst:3725 ../../reference/datamodel.rst:3774 +msgid "The :class:`object` class itself does not provide these methods." +msgstr "" + +#: ../../reference/datamodel.rst:3730 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3714 +#: ../../reference/datamodel.rst:3734 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:3717 +#: ../../reference/datamodel.rst:3737 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3719 +#: ../../reference/datamodel.rst:3739 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4359,53 +4388,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3734 +#: ../../reference/datamodel.rst:3754 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:3739 +#: ../../reference/datamodel.rst:3759 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:3747 +#: ../../reference/datamodel.rst:3767 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3749 +#: ../../reference/datamodel.rst:3769 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:3752 +#: ../../reference/datamodel.rst:3772 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3756 +#: ../../reference/datamodel.rst:3778 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3761 +#: ../../reference/datamodel.rst:3783 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3764 +#: ../../reference/datamodel.rst:3786 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3766 +#: ../../reference/datamodel.rst:3788 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4421,18 +4450,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3777 +#: ../../reference/datamodel.rst:3799 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3778 +#: ../../reference/datamodel.rst:3800 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:3782 +#: ../../reference/datamodel.rst:3804 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4441,7 +4470,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3789 +#: ../../reference/datamodel.rst:3811 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4449,7 +4478,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3795 +#: ../../reference/datamodel.rst:3817 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 " @@ -4472,7 +4501,7 @@ msgstr "" #: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1292 #: ../../reference/datamodel.rst:1364 ../../reference/datamodel.rst:1472 #: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:1691 -#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:2116 ../../reference/datamodel.rst:3134 msgid "object" msgstr "object(物件)" @@ -4484,12 +4513,12 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:427 #: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:799 #: ../../reference/datamodel.rst:1321 ../../reference/datamodel.rst:1774 -#: ../../reference/datamodel.rst:2016 ../../reference/datamodel.rst:2021 -#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:2661 -#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3248 -#: ../../reference/datamodel.rst:3283 ../../reference/datamodel.rst:3297 -#: ../../reference/datamodel.rst:3346 ../../reference/datamodel.rst:3356 -#: ../../reference/datamodel.rst:3384 +#: ../../reference/datamodel.rst:2017 ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2116 ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:3104 ../../reference/datamodel.rst:3262 +#: ../../reference/datamodel.rst:3297 ../../reference/datamodel.rst:3311 +#: ../../reference/datamodel.rst:3360 ../../reference/datamodel.rst:3370 +#: ../../reference/datamodel.rst:3398 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4498,7 +4527,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:126 -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2673 msgid "type" msgstr "type(型別)" @@ -4622,12 +4651,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3370 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:3104 msgid "len" msgstr "len" @@ -4660,8 +4689,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1991 -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1992 +#: ../../reference/datamodel.rst:2023 msgid "string" msgstr "string(字串)" @@ -4697,7 +4726,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:2017 msgid "bytes" msgstr "bytes(位元組)" @@ -4720,7 +4749,7 @@ msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:859 #: ../../reference/datamodel.rst:1728 ../../reference/datamodel.rst:1910 -#: ../../reference/datamodel.rst:3411 +#: ../../reference/datamodel.rst:3425 msgid "statement" msgstr "statement(陳述式)" @@ -4757,7 +4786,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:1126 -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2116 msgid "dictionary" msgstr "dictionary(字典)" @@ -4780,7 +4809,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:1126 -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:3042 +#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:3054 msgid "call" msgstr "call(呼叫)" @@ -4888,7 +4917,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3598 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3613 msgid "coroutine" msgstr "coroutine(協程)" @@ -4959,7 +4988,7 @@ msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1144 #: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1893 -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2784 msgid "class" msgstr "class(類別)" @@ -4969,7 +4998,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1265 -#: ../../reference/datamodel.rst:3042 +#: ../../reference/datamodel.rst:3054 msgid "instance" msgstr "instance(實例)" @@ -5267,7 +5296,7 @@ msgstr "try" msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1774 ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:1774 ../../reference/datamodel.rst:3134 msgid "slice" msgstr "slice(切片)" @@ -5327,120 +5356,120 @@ msgstr "repr() (內建函式)" msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:1992 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:1992 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:1992 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2023 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2023 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2023 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:2060 +#: ../../reference/datamodel.rst:2065 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2116 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:2186 +#: ../../reference/datamodel.rst:2197 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2302 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2302 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2302 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2673 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2673 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2673 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2725 +#: ../../reference/datamodel.rst:2737 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2748 +#: ../../reference/datamodel.rst:2760 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2784 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2792 +#: ../../reference/datamodel.rst:2804 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2792 +#: ../../reference/datamodel.rst:2804 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3104 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 +#: ../../reference/datamodel.rst:3262 ../../reference/datamodel.rst:3297 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 -#: ../../reference/datamodel.rst:3297 +#: ../../reference/datamodel.rst:3262 ../../reference/datamodel.rst:3297 +#: ../../reference/datamodel.rst:3311 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3346 +#: ../../reference/datamodel.rst:3360 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3370 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3370 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3384 +#: ../../reference/datamodel.rst:3398 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3411 +#: ../../reference/datamodel.rst:3425 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3411 +#: ../../reference/datamodel.rst:3425 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/expressions.po b/reference/expressions.po index 5130e12383..2705f31c57 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -1280,76 +1280,78 @@ msgid "" "The first thing the code block will do is bind the formal parameters to the " "arguments; this is described in section :ref:`function`. When the code " "block executes a :keyword:`return` statement, this specifies the return " -"value of the function call." +"value of the function call. If execution reaches the end of the code block " +"without executing a :keyword:`return` statement, the return value is " +"``None``." msgstr "" -#: ../../reference/expressions.rst:1161 +#: ../../reference/expressions.rst:1162 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1173 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:1175 +#: ../../reference/expressions.rst:1176 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1180 +#: ../../reference/expressions.rst:1181 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1182 +#: ../../reference/expressions.rst:1183 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1188 +#: ../../reference/expressions.rst:1189 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:1192 +#: ../../reference/expressions.rst:1193 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1198 msgid "" "The class must define a :meth:`~object.__call__` method; the effect is then " "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:2007 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1207 +#: ../../reference/expressions.rst:1208 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:1219 +#: ../../reference/expressions.rst:1220 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1226 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:1231 +#: ../../reference/expressions.rst:1232 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:1235 +#: ../../reference/expressions.rst:1236 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 " @@ -1357,7 +1359,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1240 +#: ../../reference/expressions.rst:1241 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 " @@ -1365,41 +1367,41 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1245 +#: ../../reference/expressions.rst:1246 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:1249 +#: ../../reference/expressions.rst:1250 msgid "" "This operation can be customized using the special :meth:`~object.__pow__` " "and :meth:`~object.__rpow__` methods." msgstr "" -#: ../../reference/expressions.rst:1255 +#: ../../reference/expressions.rst:1256 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1261 +#: ../../reference/expressions.rst:1262 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1272 +#: ../../reference/expressions.rst:1273 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`~object.__neg__` " "special method." msgstr "" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1281 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1287 +#: ../../reference/expressions.rst:1288 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1407,17 +1409,17 @@ msgid "" "meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1304 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1307 +#: ../../reference/expressions.rst:1308 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1425,7 +1427,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1322 +#: ../../reference/expressions.rst:1323 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1435,25 +1437,25 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1328 +#: ../../reference/expressions.rst:1329 msgid "" "This operation can be customized using the special :meth:`~object.__mul__` " "and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1336 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1339 msgid "" "This operation can be customized using the special :meth:`~object." "__matmul__` and :meth:`~object.__rmatmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1349 +#: ../../reference/expressions.rst:1350 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1463,7 +1465,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1356 +#: ../../reference/expressions.rst:1357 msgid "" "The division operation can be customized using the special :meth:`~object." "__truediv__` and :meth:`~object.__rtruediv__` methods. The floor division " @@ -1471,7 +1473,7 @@ msgid "" "and :meth:`~object.__rfloordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1365 +#: ../../reference/expressions.rst:1366 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1483,7 +1485,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1374 +#: ../../reference/expressions.rst:1375 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 " @@ -1491,7 +1493,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1379 +#: ../../reference/expressions.rst:1380 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1500,20 +1502,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1384 +#: ../../reference/expressions.rst:1385 msgid "" "The *modulo* operation can be customized using the special :meth:`~object." "__mod__` and :meth:`~object.__rmod__` methods." msgstr "" -#: ../../reference/expressions.rst:1387 +#: ../../reference/expressions.rst:1388 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:1396 +#: ../../reference/expressions.rst:1397 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1521,40 +1523,40 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1401 +#: ../../reference/expressions.rst:1402 msgid "" "This operation can be customized using the special :meth:`~object.__add__` " "and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1409 +#: ../../reference/expressions.rst:1410 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1412 +#: ../../reference/expressions.rst:1413 msgid "" "This operation can be customized using the special :meth:`~object.__sub__` " "and :meth:`~object.__rsub__` methods." msgstr "" -#: ../../reference/expressions.rst:1419 +#: ../../reference/expressions.rst:1420 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1426 +#: ../../reference/expressions.rst:1427 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1431 +#: ../../reference/expressions.rst:1432 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:1434 +#: ../../reference/expressions.rst:1435 msgid "" "The left shift operation can be customized using the special :meth:`~object." "__lshift__` and :meth:`~object.__rlshift__` methods. The right shift " @@ -1562,46 +1564,46 @@ msgid "" "and :meth:`~object.__rrshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1441 +#: ../../reference/expressions.rst:1442 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:1448 +#: ../../reference/expressions.rst:1449 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1452 +#: ../../reference/expressions.rst:1453 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1464 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:`~object." "__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1473 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:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1482 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:" "`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1489 +#: ../../reference/expressions.rst:1490 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1501 +#: ../../reference/expressions.rst:1502 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 " @@ -1609,14 +1611,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1512 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:1517 +#: ../../reference/expressions.rst:1518 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 " @@ -1624,7 +1626,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1521 +#: ../../reference/expressions.rst:1522 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 " @@ -1632,24 +1634,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1526 +#: ../../reference/expressions.rst:1527 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:1533 +#: ../../reference/expressions.rst:1534 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1535 +#: ../../reference/expressions.rst:1536 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1539 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 " @@ -1661,7 +1663,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1547 +#: ../../reference/expressions.rst:1548 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1669,7 +1671,7 @@ msgid "" "methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1553 +#: ../../reference/expressions.rst:1554 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1679,14 +1681,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1560 +#: ../../reference/expressions.rst:1561 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:1564 +#: ../../reference/expressions.rst:1565 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1695,13 +1697,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1570 +#: ../../reference/expressions.rst:1571 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1573 +#: ../../reference/expressions.rst:1574 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1711,7 +1713,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1580 +#: ../../reference/expressions.rst:1581 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 " @@ -1721,32 +1723,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1587 +#: ../../reference/expressions.rst:1588 msgid "" "``None`` and :data:`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:1591 +#: ../../reference/expressions.rst:1592 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:1595 +#: ../../reference/expressions.rst:1596 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:1599 +#: ../../reference/expressions.rst:1600 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1602 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1755,7 +1757,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1607 +#: ../../reference/expressions.rst:1608 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1763,19 +1765,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1612 +#: ../../reference/expressions.rst:1613 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1614 +#: ../../reference/expressions.rst:1615 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:1619 +#: ../../reference/expressions.rst:1620 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 " @@ -1784,25 +1786,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1625 +#: ../../reference/expressions.rst:1626 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:1629 +#: ../../reference/expressions.rst:1630 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1631 +#: ../../reference/expressions.rst:1632 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1634 +#: ../../reference/expressions.rst:1635 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1813,110 +1815,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1642 +#: ../../reference/expressions.rst:1643 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1644 +#: ../../reference/expressions.rst:1645 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1647 +#: ../../reference/expressions.rst:1648 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1650 +#: ../../reference/expressions.rst:1651 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1653 +#: ../../reference/expressions.rst:1654 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1655 +#: ../../reference/expressions.rst:1656 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1658 +#: ../../reference/expressions.rst:1659 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1661 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1662 +#: ../../reference/expressions.rst:1663 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1664 +#: ../../reference/expressions.rst:1665 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1666 +#: ../../reference/expressions.rst:1667 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1670 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1672 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1673 +#: ../../reference/expressions.rst:1674 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1676 +#: ../../reference/expressions.rst:1677 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1678 +#: ../../reference/expressions.rst:1679 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1681 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1682 +#: ../../reference/expressions.rst:1683 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:1686 +#: ../../reference/expressions.rst:1687 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:1690 +#: ../../reference/expressions.rst:1691 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:1699 +#: ../../reference/expressions.rst:1700 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1701 +#: ../../reference/expressions.rst:1702 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`` " @@ -1927,7 +1929,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1709 +#: ../../reference/expressions.rst:1710 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 " @@ -1935,14 +1937,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1714 +#: ../../reference/expressions.rst:1715 msgid "" "For user-defined classes which define the :meth:`~object.__contains__` " "method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " "value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1718 +#: ../../reference/expressions.rst:1719 msgid "" "For user-defined classes which do not define :meth:`~object.__contains__` " "but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " @@ -1951,7 +1953,7 @@ msgid "" "it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1724 +#: ../../reference/expressions.rst:1725 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1960,17 +1962,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1737 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1749 +#: ../../reference/expressions.rst:1750 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1751 +#: ../../reference/expressions.rst:1752 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 " @@ -1978,11 +1980,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1763 +#: ../../reference/expressions.rst:1764 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1774 +#: ../../reference/expressions.rst:1775 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1993,25 +1995,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1784 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1788 +#: ../../reference/expressions.rst:1789 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:1793 +#: ../../reference/expressions.rst:1794 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:1796 +#: ../../reference/expressions.rst:1797 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 " @@ -2022,11 +2024,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1815 +#: ../../reference/expressions.rst:1816 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1820 +#: ../../reference/expressions.rst:1821 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2034,11 +2036,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1826 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1827 +#: ../../reference/expressions.rst:1828 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2046,11 +2048,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1832 +#: ../../reference/expressions.rst:1833 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1834 +#: ../../reference/expressions.rst:1835 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2058,7 +2060,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1839 +#: ../../reference/expressions.rst:1840 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2068,36 +2070,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:1848 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1855 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1867 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1869 +#: ../../reference/expressions.rst:1870 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:1873 +#: ../../reference/expressions.rst:1874 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1881 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1891 +#: ../../reference/expressions.rst:1892 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2105,7 +2107,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1896 msgid "" "def (parameters):\n" " return expression" @@ -2113,25 +2115,25 @@ msgstr "" "def (parameters):\n" " return expression" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1901 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:1908 +#: ../../reference/expressions.rst:1909 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1925 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:1933 +#: ../../reference/expressions.rst:1934 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2139,16 +2141,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1939 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1942 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2157,24 +2159,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1958 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1962 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:1964 +#: ../../reference/expressions.rst:1965 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1968 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2190,11 +2192,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1979 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1983 +#: ../../reference/expressions.rst:1984 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2204,176 +2206,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1989 +#: ../../reference/expressions.rst:1990 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:1995 +#: ../../reference/expressions.rst:1996 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1996 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1998 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1999 +#: ../../reference/expressions.rst:2000 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1998 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2003 +#: ../../reference/expressions.rst:2004 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2003 +#: ../../reference/expressions.rst:2004 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2007 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2009 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2009 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2011 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2011 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2013 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2013 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2017 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2017 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2019 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2019 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2021 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2021 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2023 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2023 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2025 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2025 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2027 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2027 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2031 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2031 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2033 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2033 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2035 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2035 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2037 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2037 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2039 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2039 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2040 +#: ../../reference/expressions.rst:2041 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2040 +#: ../../reference/expressions.rst:2041 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2045 +#: ../../reference/expressions.rst:2046 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2046 +#: ../../reference/expressions.rst:2047 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 " @@ -2385,7 +2387,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2055 +#: ../../reference/expressions.rst:2056 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, " @@ -2393,7 +2395,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2060 +#: ../../reference/expressions.rst:2061 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 " @@ -2407,7 +2409,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2071 +#: ../../reference/expressions.rst:2072 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2415,13 +2417,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2076 +#: ../../reference/expressions.rst:2077 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:2079 +#: ../../reference/expressions.rst:2080 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2429,22 +2431,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2084 +#: ../../reference/expressions.rst:2085 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:2087 +#: ../../reference/expressions.rst:2088 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1765 -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1856 -#: ../../reference/expressions.rst:1882 ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1806 ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1883 ../../reference/expressions.rst:1911 msgid "expression" msgstr "" @@ -2452,8 +2454,8 @@ msgstr "" msgid "BNF" msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1257 -#: ../../reference/expressions.rst:1305 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1306 msgid "arithmetic" msgstr "" @@ -2476,8 +2478,8 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:569 #: ../../reference/expressions.rst:624 ../../reference/expressions.rst:753 #: ../../reference/expressions.rst:805 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:1294 ../../reference/expressions.rst:1343 -#: ../../reference/expressions.rst:1439 +#: ../../reference/expressions.rst:1295 ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1440 msgid "exception" msgstr "" @@ -2519,9 +2521,9 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:557 ../../reference/expressions.rst:743 #: ../../reference/expressions.rst:851 ../../reference/expressions.rst:880 #: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1162 -#: ../../reference/expressions.rst:1176 ../../reference/expressions.rst:1183 -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1177 ../../reference/expressions.rst:1184 +#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1923 msgid "object" msgstr "object(物件)" @@ -2543,18 +2545,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1923 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1945 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 #: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid ", (comma)" msgstr ", (逗號)" @@ -2571,7 +2573,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1857 msgid "if" msgstr "if" @@ -2579,13 +2581,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1201 +#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1202 msgid "await" msgstr "await" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid "list" msgstr "list(串列)" @@ -2603,7 +2605,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2641,7 +2643,7 @@ msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" #: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid ": (colon)" msgstr ": (冒號)" @@ -2654,12 +2656,12 @@ msgid "in dictionary displays" msgstr "於字典顯示" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "unpacking" msgstr "unpacking(解包)" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1114 -#: ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1222 msgid "**" msgstr "**" @@ -2676,7 +2678,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1201 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1202 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2689,7 +2691,7 @@ msgid "from" msgstr "from" #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1883 msgid "function" msgstr "function (函式)" @@ -2754,7 +2756,7 @@ msgid "subscription" msgstr "subscription(下標)" #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "sequence" msgstr "sequence(序列)" @@ -2800,8 +2802,8 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1176 -#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1177 +#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 msgid "call" msgstr "call(呼叫)" @@ -2830,8 +2832,8 @@ msgstr "於函式呼叫中" msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1318 -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1319 +#: ../../reference/expressions.rst:1930 msgid "* (asterisk)" msgstr "* (星號)" @@ -2843,367 +2845,367 @@ msgstr "user-defined(使用者定義)" msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1177 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1177 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1183 +#: ../../reference/expressions.rst:1184 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1194 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1222 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1257 -#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1421 -#: ../../reference/expressions.rst:1450 ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1451 ../../reference/expressions.rst:1766 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1266 -#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1283 -#: ../../reference/expressions.rst:1318 ../../reference/expressions.rst:1331 -#: ../../reference/expressions.rst:1343 ../../reference/expressions.rst:1361 -#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 -#: ../../reference/expressions.rst:1421 ../../reference/expressions.rst:1459 -#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 -#: ../../reference/expressions.rst:1491 ../../reference/expressions.rst:1730 -#: ../../reference/expressions.rst:1739 ../../reference/expressions.rst:1781 -#: ../../reference/expressions.rst:1786 ../../reference/expressions.rst:1791 -#: ../../reference/expressions.rst:1856 ../../reference/expressions.rst:1980 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1267 +#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1319 ../../reference/expressions.rst:1332 +#: ../../reference/expressions.rst:1344 ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1422 ../../reference/expressions.rst:1460 +#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1492 ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1740 ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1787 ../../reference/expressions.rst:1792 +#: ../../reference/expressions.rst:1857 ../../reference/expressions.rst:1981 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1258 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1257 ../../reference/expressions.rst:1450 -#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1467 -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1258 ../../reference/expressions.rst:1451 +#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1477 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1266 +#: ../../reference/expressions.rst:1267 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1266 +#: ../../reference/expressions.rst:1267 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1405 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1276 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1276 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1392 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1284 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1284 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1294 +#: ../../reference/expressions.rst:1295 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1450 +#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1451 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1319 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1332 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1332 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1362 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1362 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1392 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1405 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1439 +#: ../../reference/expressions.rst:1440 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1786 +#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1787 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1459 +#: ../../reference/expressions.rst:1460 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 -#: ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1792 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1477 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1477 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1515 +#: ../../reference/expressions.rst:1516 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1515 +#: ../../reference/expressions.rst:1516 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1740 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1766 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1766 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1781 +#: ../../reference/expressions.rst:1782 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 #, fuzzy msgid "assignment" msgstr "argument(引數)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1945 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1960 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1960 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1980 +#: ../../reference/expressions.rst:1981 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 8ca2ad4ed0..95c62e53b3 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -364,12 +364,12 @@ msgstr "" "Found an even number 8\n" "Found an odd number 9" -#: ../../tutorial/controlflow.rst:201 +#: ../../tutorial/controlflow.rst:202 #, fuzzy msgid ":keyword:`!else` Clauses on Loops" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:203 +#: ../../tutorial/controlflow.rst:204 msgid "" "In a :keyword:`!for` or :keyword:`!while` loop the :keyword:`!break` " "statement may be paired with an :keyword:`!else` clause. If the loop " @@ -377,7 +377,7 @@ msgid "" "clause executes." msgstr "" -#: ../../tutorial/controlflow.rst:207 +#: ../../tutorial/controlflow.rst:208 #, fuzzy msgid "" "In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " @@ -385,13 +385,13 @@ msgid "" msgstr "" "在 :keyword:`for` 迴圈中,:keyword:`!else` 子句會在迴圈到達最終的疊代後執行。" -#: ../../tutorial/controlflow.rst:210 +#: ../../tutorial/controlflow.rst:211 msgid "" "In a :keyword:`while` loop, it's executed after the loop's condition becomes " "false." msgstr "在 :keyword:`while` 迴圈中,它會在迴圈條件變為 false 後執行。" -#: ../../tutorial/controlflow.rst:212 +#: ../../tutorial/controlflow.rst:213 #, fuzzy msgid "" "In either kind of loop, the :keyword:`!else` clause is **not** executed if " @@ -402,13 +402,13 @@ msgstr "" "在任何一種迴圈中,如果迴圈由 :keyword:`break` 終止,則不會執行 :keyword:`!" "else` 子句。" -#: ../../tutorial/controlflow.rst:217 +#: ../../tutorial/controlflow.rst:218 msgid "" "This is exemplified in the following :keyword:`!for` loop, which searches " "for prime numbers::" msgstr "下面的 :keyword:`!for` 迴圈對此進行了舉例說明,該迴圈用以搜索質數: ::" -#: ../../tutorial/controlflow.rst:220 +#: ../../tutorial/controlflow.rst:221 msgid "" ">>> for n in range(2, 10):\n" "... for x in range(2, n):\n" @@ -429,7 +429,7 @@ msgid "" "9 equals 3 * 3" msgstr "" -#: ../../tutorial/controlflow.rst:238 +#: ../../tutorial/controlflow.rst:239 #, fuzzy msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " @@ -438,7 +438,7 @@ msgstr "" "(沒錯,這是正確的程式碼。請看仔細:``else`` 子句屬於 :keyword:`for` 迴圈,**" "並非** :keyword:`if` 陳述式。)" -#: ../../tutorial/controlflow.rst:241 +#: ../../tutorial/controlflow.rst:242 msgid "" "One way to think of the else clause is to imagine it paired with the ``if`` " "inside the loop. As the loop executes, it will run a sequence like if/if/if/" @@ -447,7 +447,7 @@ msgid "" "true, the ``else`` clause outside the loop will execute." msgstr "" -#: ../../tutorial/controlflow.rst:247 +#: ../../tutorial/controlflow.rst:248 #, fuzzy msgid "" "When used with a loop, the ``else`` clause has more in common with the " @@ -463,11 +463,11 @@ msgstr "" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" "\\ :ref:`tut-handling`。" -#: ../../tutorial/controlflow.rst:256 +#: ../../tutorial/controlflow.rst:257 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:258 +#: ../../tutorial/controlflow.rst:259 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::" @@ -475,18 +475,18 @@ msgstr "" ":keyword:`pass` 陳述式不執行任何動作。它可用在語法上需要一個陳述式但程式不需" "要執行任何動作的時候。例如: ::" -#: ../../tutorial/controlflow.rst:261 +#: ../../tutorial/controlflow.rst:262 msgid "" ">>> while True:\n" "... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n" "..." msgstr "" -#: ../../tutorial/controlflow.rst:265 +#: ../../tutorial/controlflow.rst:266 msgid "This is commonly used for creating minimal classes::" msgstr "這經常用於建立簡單的 class(類別): ::" -#: ../../tutorial/controlflow.rst:267 +#: ../../tutorial/controlflow.rst:268 msgid "" ">>> class MyEmptyClass:\n" "... pass\n" @@ -496,7 +496,7 @@ msgstr "" "... pass\n" "..." -#: ../../tutorial/controlflow.rst:271 +#: ../../tutorial/controlflow.rst:272 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 " @@ -506,18 +506,18 @@ msgstr "" ":keyword:`pass` 亦可作為一個函式或條件判斷主體的預留位置,在你撰寫新的程式碼" "時讓你保持在更抽象的思維層次。:keyword:`!pass` 會直接被忽略: ::" -#: ../../tutorial/controlflow.rst:275 +#: ../../tutorial/controlflow.rst:276 msgid "" ">>> def initlog(*args):\n" "... pass # Remember to implement this!\n" "..." msgstr "" -#: ../../tutorial/controlflow.rst:283 +#: ../../tutorial/controlflow.rst:284 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 陳述式" -#: ../../tutorial/controlflow.rst:285 +#: ../../tutorial/controlflow.rst:286 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 " @@ -533,14 +533,14 @@ msgstr "" "言中的模式匹配 (pattern matching) 更為相近。只有第一個匹配成功的模式會被執" "行,而它也可以將成分(序列元素或物件屬性)從值中提取到變數中。" -#: ../../tutorial/controlflow.rst:293 +#: ../../tutorial/controlflow.rst:294 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" "最簡單的形式,是將一個主題值 (subject value) 與一個或多個字面值 (literal) 進" "行比較: ::" -#: ../../tutorial/controlflow.rst:295 +#: ../../tutorial/controlflow.rst:296 msgid "" "def http_error(status):\n" " match status:\n" @@ -564,7 +564,7 @@ msgstr "" " case _:\n" " return \"Something's wrong with the internet\"" -#: ../../tutorial/controlflow.rst:306 +#: ../../tutorial/controlflow.rst:307 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." @@ -572,12 +572,12 @@ msgstr "" "請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角" "色,且永遠不會匹配失敗。如果沒有 case 匹配成功,則不會執行任何的分支。" -#: ../../tutorial/controlflow.rst:309 +#: ../../tutorial/controlflow.rst:310 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|``\\ (「或」)來將多個字面值組合在單一模式中: ::" -#: ../../tutorial/controlflow.rst:311 +#: ../../tutorial/controlflow.rst:312 msgid "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" @@ -585,14 +585,14 @@ msgstr "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" -#: ../../tutorial/controlflow.rst:314 +#: ../../tutorial/controlflow.rst:315 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" msgstr "" "模式可以看起來像是拆解賦值 (unpacking assignment),且可以用來連結變數: ::" -#: ../../tutorial/controlflow.rst:317 +#: ../../tutorial/controlflow.rst:318 msgid "" "# point is an (x, y) tuple\n" "match point:\n" @@ -608,7 +608,7 @@ msgid "" " raise ValueError(\"Not a point\")" msgstr "" -#: ../../tutorial/controlflow.rst:330 +#: ../../tutorial/controlflow.rst:331 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 " @@ -622,7 +622,7 @@ msgstr "" "(bind)* 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在概" "念上類似於拆解賦值 ``(x, y) = point``。" -#: ../../tutorial/controlflow.rst:337 +#: ../../tutorial/controlflow.rst:338 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 " @@ -631,7 +631,7 @@ msgstr "" "如果你要用 class 來結構化你的資料,你可以使用該 class 的名稱加上一個引數列" "表,類似一個建構式 (constructor),但它能夠將屬性擷取到變數中: ::" -#: ../../tutorial/controlflow.rst:341 +#: ../../tutorial/controlflow.rst:342 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -669,7 +669,7 @@ msgstr "" " case _:\n" " print(\"Not a point\")" -#: ../../tutorial/controlflow.rst:359 +#: ../../tutorial/controlflow.rst:360 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 " @@ -683,7 +683,7 @@ msgstr "" "``__match_args__``,來定義模式中屬性們的特定位置。如果它被設定為 (\"x\", " "\"y\"),則以下的模式都是等價的(且都會將屬性 ``y`` 連結到變數 ``var``): ::" -#: ../../tutorial/controlflow.rst:365 +#: ../../tutorial/controlflow.rst:366 msgid "" "Point(1, var)\n" "Point(1, y=var)\n" @@ -695,7 +695,7 @@ msgstr "" "Point(x=1, y=var)\n" "Point(y=var, x=1)" -#: ../../tutorial/controlflow.rst:370 +#: ../../tutorial/controlflow.rst:371 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 " @@ -711,7 +711,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:377 +#: ../../tutorial/controlflow.rst:378 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" @@ -719,7 +719,7 @@ msgstr "" "模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 " "list,我們就可以像這樣加入 ``__match_args__`` 來對它進行匹配: ::" -#: ../../tutorial/controlflow.rst:380 +#: ../../tutorial/controlflow.rst:381 msgid "" "class Point:\n" " __match_args__ = ('x', 'y')\n" @@ -757,7 +757,7 @@ msgstr "" " case _:\n" " print(\"Something else\")" -#: ../../tutorial/controlflow.rst:398 +#: ../../tutorial/controlflow.rst:399 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 " @@ -767,7 +767,7 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的擷取會發生在防護的評估之" "前: ::" -#: ../../tutorial/controlflow.rst:402 +#: ../../tutorial/controlflow.rst:403 msgid "" "match point:\n" " case Point(x, y) if x == y:\n" @@ -781,11 +781,11 @@ msgstr "" " case Point(x, y):\n" " print(f\"Not on the diagonal\")" -#: ../../tutorial/controlflow.rst:408 +#: ../../tutorial/controlflow.rst:409 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:410 +#: ../../tutorial/controlflow.rst:411 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -794,7 +794,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:414 +#: ../../tutorial/controlflow.rst:415 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -806,7 +806,7 @@ msgstr "" "``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外的其" "餘項。" -#: ../../tutorial/controlflow.rst:419 +#: ../../tutorial/controlflow.rst:420 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -818,15 +818,15 @@ msgstr "" "式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支援" "的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:424 +#: ../../tutorial/controlflow.rst:425 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "使用關鍵字 ``as`` 可以擷取子模式 (subpattern): ::" -#: ../../tutorial/controlflow.rst:426 +#: ../../tutorial/controlflow.rst:427 msgid "case (Point(x1, y1), Point(x2, y2) as p2): ..." msgstr "case (Point(x1, y1), Point(x2, y2) as p2): ..." -#: ../../tutorial/controlflow.rst:428 +#: ../../tutorial/controlflow.rst:429 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -834,7 +834,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:431 +#: ../../tutorial/controlflow.rst:432 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -842,7 +842,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``、``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:434 +#: ../../tutorial/controlflow.rst:435 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -850,7 +850,7 @@ msgstr "" "模式可以使用附名常數 (named constant)。這些模式必須是點分隔名稱,以免它們被解" "釋為擷取變數: ::" -#: ../../tutorial/controlflow.rst:437 +#: ../../tutorial/controlflow.rst:438 msgid "" "from enum import Enum\n" "class Color(Enum):\n" @@ -884,24 +884,24 @@ msgstr "" " case Color.BLUE:\n" " print(\"I'm feeling the blues :(\")" -#: ../../tutorial/controlflow.rst:453 +#: ../../tutorial/controlflow.rst:454 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:459 +#: ../../tutorial/controlflow.rst:460 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:462 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" msgstr "我們可以建立一個函式來產生費式數列到任何一個上界: ::" -#: ../../tutorial/controlflow.rst:464 +#: ../../tutorial/controlflow.rst:465 msgid "" ">>> def fib(n): # write Fibonacci series less than n\n" "... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" @@ -916,7 +916,7 @@ msgid "" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" msgstr "" -#: ../../tutorial/controlflow.rst:481 +#: ../../tutorial/controlflow.rst:482 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -926,7 +926,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*。它之後必須連著該函式的名稱和置" "於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:486 +#: ../../tutorial/controlflow.rst:487 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:" @@ -942,7 +942,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:493 +#: ../../tutorial/controlflow.rst:494 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -963,7 +963,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:504 +#: ../../tutorial/controlflow.rst:505 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 " @@ -977,7 +977,7 @@ msgstr "" "永遠是一個物件的\\ *參照 (reference)*,而不是該物件的值)。 [#]_ 當一個函式呼" "叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號表。" -#: ../../tutorial/controlflow.rst:511 +#: ../../tutorial/controlflow.rst:512 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -988,7 +988,7 @@ msgstr "" "直譯器辨識為使用者自定函式 (user-defined function)。該值可以被指定給別的變數" "名,使該變數名也可以被當作函式使用。這是常見的重新命名方式: ::" -#: ../../tutorial/controlflow.rst:516 +#: ../../tutorial/controlflow.rst:517 msgid "" ">>> fib\n" "\n" @@ -1002,7 +1002,7 @@ msgstr "" ">>> f(100)\n" "0 1 1 2 3 5 8 13 21 34 55 89" -#: ../../tutorial/controlflow.rst:522 +#: ../../tutorial/controlflow.rst:523 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 " @@ -1017,7 +1017,7 @@ msgstr "" "亦有一個固定的回傳值。這個值稱為 ``None``\\ (它是一個內建名稱)。在直譯器中" "單獨使用 ``None`` 時,通常不會被顯示。你可以使用 :func:`print` 來看到它: ::" -#: ../../tutorial/controlflow.rst:529 +#: ../../tutorial/controlflow.rst:530 msgid "" ">>> fib(0)\n" ">>> print(fib(0))\n" @@ -1027,13 +1027,13 @@ msgstr "" ">>> print(fib(0))\n" "None" -#: ../../tutorial/controlflow.rst:533 +#: ../../tutorial/controlflow.rst:534 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" msgstr "如果要寫一個函式回傳費式數列的 list 而不是直接印出它,這也很容易: ::" -#: ../../tutorial/controlflow.rst:536 +#: ../../tutorial/controlflow.rst:537 msgid "" ">>> def fib2(n): # return Fibonacci series up to n\n" "... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" @@ -1049,11 +1049,11 @@ msgid "" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" msgstr "" -#: ../../tutorial/controlflow.rst:549 +#: ../../tutorial/controlflow.rst:550 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:551 +#: ../../tutorial/controlflow.rst:552 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -1063,7 +1063,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``。一個函式執行到結束也會回傳 " "``None``。" -#: ../../tutorial/controlflow.rst:555 +#: ../../tutorial/controlflow.rst:556 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 " @@ -1086,22 +1086,22 @@ msgstr "" "義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同於 " "``result = result + [a]``,但更有效率。" -#: ../../tutorial/controlflow.rst:570 +#: ../../tutorial/controlflow.rst:571 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:572 +#: ../../tutorial/controlflow.rst:573 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:579 +#: ../../tutorial/controlflow.rst:580 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:582 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 " @@ -1110,7 +1110,7 @@ msgstr "" "為一個或多個引數指定預設值是很有用的方式。函式建立後,可以用比定義時更少的引" "數呼叫該函式。例如: ::" -#: ../../tutorial/controlflow.rst:585 +#: ../../tutorial/controlflow.rst:586 msgid "" "def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" " while True:\n" @@ -1136,22 +1136,22 @@ msgstr "" " raise ValueError('invalid user response')\n" " print(reminder)" -#: ../../tutorial/controlflow.rst:597 +#: ../../tutorial/controlflow.rst:598 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:599 +#: ../../tutorial/controlflow.rst:600 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:601 +#: ../../tutorial/controlflow.rst:602 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:603 +#: ../../tutorial/controlflow.rst:604 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -1159,19 +1159,19 @@ msgstr "" "給予所有引數:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or " "no!')``" -#: ../../tutorial/controlflow.rst:606 +#: ../../tutorial/controlflow.rst:607 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:609 +#: ../../tutorial/controlflow.rst:610 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" msgstr "預設值是在函式定義當下,於\\ *定義時*\\ 的作用域中求值,所以: ::" -#: ../../tutorial/controlflow.rst:612 +#: ../../tutorial/controlflow.rst:613 msgid "" "i = 5\n" "\n" @@ -1189,11 +1189,11 @@ msgstr "" "i = 6\n" "f()" -#: ../../tutorial/controlflow.rst:620 +#: ../../tutorial/controlflow.rst:621 msgid "will print ``5``." msgstr "將會輸出 ``5``。" -#: ../../tutorial/controlflow.rst:622 +#: ../../tutorial/controlflow.rst:623 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, " @@ -1204,7 +1204,7 @@ msgstr "" "(字典)或許多類別實例時,會產生不同的結果。例如,以下函式於後續呼叫時會累積" "曾經傳遞的引數: ::" -#: ../../tutorial/controlflow.rst:627 +#: ../../tutorial/controlflow.rst:628 msgid "" "def f(a, L=[]):\n" " L.append(a)\n" @@ -1222,11 +1222,11 @@ msgstr "" "print(f(2))\n" "print(f(3))" -#: ../../tutorial/controlflow.rst:635 +#: ../../tutorial/controlflow.rst:636 msgid "This will print ::" msgstr "將會輸出: ::" -#: ../../tutorial/controlflow.rst:637 +#: ../../tutorial/controlflow.rst:638 msgid "" "[1]\n" "[1, 2]\n" @@ -1236,13 +1236,13 @@ msgstr "" "[1, 2]\n" "[1, 2, 3]" -#: ../../tutorial/controlflow.rst:641 +#: ../../tutorial/controlflow.rst:642 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:644 +#: ../../tutorial/controlflow.rst:645 msgid "" "def f(a, L=None):\n" " if L is None:\n" @@ -1256,11 +1256,11 @@ msgstr "" " L.append(a)\n" " return L" -#: ../../tutorial/controlflow.rst:654 +#: ../../tutorial/controlflow.rst:655 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:656 +#: ../../tutorial/controlflow.rst:657 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -1269,7 +1269,7 @@ msgstr "" "函式也可以使用\\ :term:`關鍵字引數 `,以 ``kwarg=value`` 的" "形式呼叫。舉例來說,以下函式: ::" -#: ../../tutorial/controlflow.rst:659 +#: ../../tutorial/controlflow.rst:660 msgid "" "def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" " print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -1283,7 +1283,7 @@ msgstr "" " print(\"-- Lovely plumage, the\", type)\n" " print(\"-- It's\", state, \"!\")" -#: ../../tutorial/controlflow.rst:665 +#: ../../tutorial/controlflow.rst:666 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -1292,7 +1292,7 @@ msgstr "" "接受一個必要引數 (``voltage``) 和三個選擇性引數 (``state``,``action``,和 " "``type``)。該函式可用下列任一方式呼叫: ::" -#: ../../tutorial/controlflow.rst:669 +#: ../../tutorial/controlflow.rst:670 msgid "" "parrot(1000) # 1 positional " "argument\n" @@ -1305,11 +1305,11 @@ msgid "" "keyword" msgstr "" -#: ../../tutorial/controlflow.rst:676 +#: ../../tutorial/controlflow.rst:677 msgid "but all the following calls would be invalid::" msgstr "但以下呼叫方式都無效: ::" -#: ../../tutorial/controlflow.rst:678 +#: ../../tutorial/controlflow.rst:679 msgid "" "parrot() # required argument missing\n" "parrot(voltage=5.0, 'dead') # non-keyword argument after a keyword " @@ -1318,7 +1318,7 @@ msgid "" "parrot(actor='John Cleese') # unknown keyword argument" msgstr "" -#: ../../tutorial/controlflow.rst:683 +#: ../../tutorial/controlflow.rst:684 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 " @@ -1334,7 +1334,7 @@ msgstr "" "則也包括必要引數,(\\ ``parrot(voltage=1000)`` 也有效)。一個引數不可多次被" "賦值,下面就是一個因此限制而無效的例子: ::" -#: ../../tutorial/controlflow.rst:691 +#: ../../tutorial/controlflow.rst:692 msgid "" ">>> def function(a):\n" "... pass\n" @@ -1352,7 +1352,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: function() got multiple values for argument 'a'" -#: ../../tutorial/controlflow.rst:699 +#: ../../tutorial/controlflow.rst:700 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -1368,7 +1368,7 @@ msgstr "" "個 :ref:`tuple `,該 tuple 包含一般參數以外的位置引數(\\ " "``*name`` 必須出現在 ``**name`` 前面)。例如,若我們定義這樣的函式: ::" -#: ../../tutorial/controlflow.rst:707 +#: ../../tutorial/controlflow.rst:708 msgid "" "def cheeseshop(kind, *arguments, **keywords):\n" " print(\"-- Do you have any\", kind, \"?\")\n" @@ -1388,11 +1388,11 @@ msgstr "" " for kw in keywords:\n" " print(kw, \":\", keywords[kw])" -#: ../../tutorial/controlflow.rst:716 +#: ../../tutorial/controlflow.rst:717 msgid "It could be called like this::" msgstr "它可以被如此呼叫: ::" -#: ../../tutorial/controlflow.rst:718 +#: ../../tutorial/controlflow.rst:719 msgid "" "cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" " \"It's really very, VERY runny, sir.\",\n" @@ -1406,11 +1406,11 @@ msgstr "" " client=\"John Cleese\",\n" " sketch=\"Cheese Shop Sketch\")" -#: ../../tutorial/controlflow.rst:724 +#: ../../tutorial/controlflow.rst:725 msgid "and of course it would print:" msgstr "輸出結果如下: ::" -#: ../../tutorial/controlflow.rst:726 +#: ../../tutorial/controlflow.rst:727 msgid "" "-- Do you have any Limburger ?\n" "-- I'm sorry, we're all out of Limburger\n" @@ -1430,17 +1430,17 @@ msgstr "" "client : John Cleese\n" "sketch : Cheese Shop Sketch" -#: ../../tutorial/controlflow.rst:737 +#: ../../tutorial/controlflow.rst:738 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:741 +#: ../../tutorial/controlflow.rst:742 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:743 +#: ../../tutorial/controlflow.rst:744 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 " @@ -1452,11 +1452,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:749 +#: ../../tutorial/controlflow.rst:750 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:751 +#: ../../tutorial/controlflow.rst:752 msgid "" "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" " ----------- ---------- ----------\n" @@ -1472,7 +1472,7 @@ msgstr "" " | - Keyword only\n" " -- Positional only" -#: ../../tutorial/controlflow.rst:760 +#: ../../tutorial/controlflow.rst:761 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-" @@ -1483,22 +1483,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:767 +#: ../../tutorial/controlflow.rst:768 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:769 +#: ../../tutorial/controlflow.rst:770 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:774 +#: ../../tutorial/controlflow.rst:775 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:776 +#: ../../tutorial/controlflow.rst:777 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 " @@ -1513,17 +1513,17 @@ msgstr "" "``\\ (斜線)之前。``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函式定義" "中沒有 ``/``,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:784 +#: ../../tutorial/controlflow.rst:785 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:788 +#: ../../tutorial/controlflow.rst:789 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:790 +#: ../../tutorial/controlflow.rst:791 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -1532,17 +1532,17 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*,表明參數必須以關鍵字引數傳遞,必須在引數列表中" "第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``。" -#: ../../tutorial/controlflow.rst:796 +#: ../../tutorial/controlflow.rst:797 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:798 +#: ../../tutorial/controlflow.rst:799 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" msgstr "請看以下的函式定義範例,注意 ``/`` 和 ``*`` 記號: ::" -#: ../../tutorial/controlflow.rst:801 +#: ../../tutorial/controlflow.rst:802 msgid "" ">>> def standard_arg(arg):\n" "... print(arg)\n" @@ -1568,7 +1568,7 @@ msgstr "" ">>> def combined_example(pos_only, /, standard, *, kwd_only):\n" "... print(pos_only, standard, kwd_only)" -#: ../../tutorial/controlflow.rst:814 +#: ../../tutorial/controlflow.rst:815 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -1577,7 +1577,7 @@ msgstr "" "第一個函式定義 ``standard_arg`` 是我們最熟悉的形式,對呼叫方式沒有任何限制," "可以按位置或關鍵字傳遞引數: ::" -#: ../../tutorial/controlflow.rst:818 +#: ../../tutorial/controlflow.rst:819 msgid "" ">>> standard_arg(2)\n" "2\n" @@ -1591,14 +1591,14 @@ msgstr "" ">>> standard_arg(arg=2)\n" "2" -#: ../../tutorial/controlflow.rst:824 +#: ../../tutorial/controlflow.rst:825 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" "第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``,因此僅限使用位置參數: ::" -#: ../../tutorial/controlflow.rst:827 +#: ../../tutorial/controlflow.rst:828 msgid "" ">>> pos_only_arg(1)\n" "1\n" @@ -1618,7 +1618,7 @@ msgstr "" "TypeError: pos_only_arg() got some positional-only arguments passed as " "keyword arguments: 'arg'" -#: ../../tutorial/controlflow.rst:835 +#: ../../tutorial/controlflow.rst:836 #, fuzzy msgid "" "The third function ``kwd_only_arg`` only allows keyword arguments as " @@ -1626,7 +1626,7 @@ msgid "" msgstr "" "第三個函式 ``kwd_only_args`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:838 +#: ../../tutorial/controlflow.rst:839 msgid "" ">>> kwd_only_arg(3)\n" "Traceback (most recent call last):\n" @@ -1644,13 +1644,13 @@ msgstr "" ">>> kwd_only_arg(arg=3)\n" "3" -#: ../../tutorial/controlflow.rst:846 +#: ../../tutorial/controlflow.rst:847 msgid "" "And the last uses all three calling conventions in the same function " "definition::" msgstr "最後一個函式在同一個函式定義中,使用了全部三種呼叫方式: ::" -#: ../../tutorial/controlflow.rst:849 +#: ../../tutorial/controlflow.rst:850 msgid "" ">>> combined_example(1, 2, 3)\n" "Traceback (most recent call last):\n" @@ -1686,7 +1686,7 @@ msgstr "" "TypeError: combined_example() got some positional-only arguments passed as " "keyword arguments: 'pos_only'" -#: ../../tutorial/controlflow.rst:866 +#: ../../tutorial/controlflow.rst:867 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -1695,7 +1695,7 @@ msgstr "" "最後,請看這個函式定義,如果 ``**kwds`` 內有 ``name`` 這個鍵,可能與位置引數 " "``name`` 產生潛在衝突: ::" -#: ../../tutorial/controlflow.rst:868 +#: ../../tutorial/controlflow.rst:869 msgid "" "def foo(name, **kwds):\n" " return 'name' in kwds" @@ -1703,7 +1703,7 @@ msgstr "" "def foo(name, **kwds):\n" " return 'name' in kwds" -#: ../../tutorial/controlflow.rst:871 +#: ../../tutorial/controlflow.rst:872 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::" @@ -1711,7 +1711,7 @@ msgstr "" "呼叫該函式不可能回傳 ``True``,因為關鍵字 ``'name'`` 永遠是連結在第一個參數。" "例如: ::" -#: ../../tutorial/controlflow.rst:874 +#: ../../tutorial/controlflow.rst:875 msgid "" ">>> foo(1, **{'name': 2})\n" "Traceback (most recent call last):\n" @@ -1725,7 +1725,7 @@ msgstr "" "TypeError: foo() got multiple values for argument 'name'\n" ">>>" -#: ../../tutorial/controlflow.rst:880 +#: ../../tutorial/controlflow.rst:881 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 " @@ -1734,7 +1734,7 @@ msgstr "" "使用 ``/``\\ (僅限位置引數)後,就可以了。函式定義會允許 ``name`` 當作位置引" "數,而 ``'name'`` 也可以當作關鍵字引數中的鍵: ::" -#: ../../tutorial/controlflow.rst:882 +#: ../../tutorial/controlflow.rst:883 msgid "" ">>> def foo(name, /, **kwds):\n" "... return 'name' in kwds\n" @@ -1748,31 +1748,31 @@ msgstr "" ">>> foo(1, **{'name': 2})\n" "True" -#: ../../tutorial/controlflow.rst:888 +#: ../../tutorial/controlflow.rst:889 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:893 +#: ../../tutorial/controlflow.rst:894 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:895 +#: ../../tutorial/controlflow.rst:896 msgid "" "The use case will determine which parameters to use in the function " "definition::" msgstr "此用例決定哪些參數可以用於函式定義: ::" -#: ../../tutorial/controlflow.rst:897 +#: ../../tutorial/controlflow.rst:898 msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" msgstr "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" -#: ../../tutorial/controlflow.rst:899 +#: ../../tutorial/controlflow.rst:900 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:901 +#: ../../tutorial/controlflow.rst:902 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 " @@ -1784,7 +1784,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:906 +#: ../../tutorial/controlflow.rst:907 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 " @@ -1793,7 +1793,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:909 +#: ../../tutorial/controlflow.rst:910 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1801,11 +1801,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:915 +#: ../../tutorial/controlflow.rst:916 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:920 +#: ../../tutorial/controlflow.rst:921 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 " @@ -1816,7 +1816,7 @@ msgstr "" "數會被包裝進一個 tuple 中(詳見 :ref:`tut-tuples`\\ )。在可變數量的引數之" "前,可能有零個或多個普通引數: ::" -#: ../../tutorial/controlflow.rst:925 +#: ../../tutorial/controlflow.rst:926 msgid "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" @@ -1824,7 +1824,7 @@ msgstr "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" -#: ../../tutorial/controlflow.rst:929 +#: ../../tutorial/controlflow.rst:930 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1838,7 +1838,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:935 +#: ../../tutorial/controlflow.rst:936 msgid "" ">>> def concat(*args, sep=\"/\"):\n" "... return sep.join(args)\n" @@ -1856,11 +1856,11 @@ msgstr "" ">>> concat(\"earth\", \"mars\", \"venus\", sep=\".\")\n" "'earth.mars.venus'" -#: ../../tutorial/controlflow.rst:946 +#: ../../tutorial/controlflow.rst:947 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:948 +#: ../../tutorial/controlflow.rst:949 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 " @@ -1874,7 +1874,7 @@ msgstr "" "的 *start* 和 *stop* 引數。如果這些引數不是分開的,則要在呼叫函式時,用 " "``*`` 運算子把引數們從 list 或 tuple 中拆解出來: ::" -#: ../../tutorial/controlflow.rst:955 +#: ../../tutorial/controlflow.rst:956 msgid "" ">>> list(range(3, 6)) # normal call with separate arguments\n" "[3, 4, 5]\n" @@ -1884,13 +1884,13 @@ msgid "" "[3, 4, 5]" msgstr "" -#: ../../tutorial/controlflow.rst:964 +#: ../../tutorial/controlflow.rst:965 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" msgstr "同樣地,dictionary(字典)可以用 ``**`` 運算子傳遞關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:967 +#: ../../tutorial/controlflow.rst:968 msgid "" ">>> def parrot(voltage, state='a stiff', action='voom'):\n" "... print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -1914,11 +1914,11 @@ msgstr "" "-- This parrot wouldn't VOOM if you put four million volts through it. E's " "bleedin' demised !" -#: ../../tutorial/controlflow.rst:980 +#: ../../tutorial/controlflow.rst:981 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:982 +#: ../../tutorial/controlflow.rst:983 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``. " @@ -1933,7 +1933,7 @@ msgstr "" "能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic sugar)。" "與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數: ::" -#: ../../tutorial/controlflow.rst:990 +#: ../../tutorial/controlflow.rst:991 msgid "" ">>> def make_incrementor(n):\n" "... return lambda x: x + n\n" @@ -1953,7 +1953,7 @@ msgstr "" ">>> f(1)\n" "43" -#: ../../tutorial/controlflow.rst:999 +#: ../../tutorial/controlflow.rst:1000 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1961,7 +1961,7 @@ msgstr "" "上面的例子用 lambda 運算式回傳了一個函式。另外的用法是傳遞一個小函式當作引" "數: ::" -#: ../../tutorial/controlflow.rst:1002 +#: ../../tutorial/controlflow.rst:1003 msgid "" ">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" ">>> pairs.sort(key=lambda pair: pair[1])\n" @@ -1973,17 +1973,17 @@ msgstr "" ">>> pairs\n" "[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]" -#: ../../tutorial/controlflow.rst:1011 +#: ../../tutorial/controlflow.rst:1012 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:1018 +#: ../../tutorial/controlflow.rst:1019 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:1021 +#: ../../tutorial/controlflow.rst:1022 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 " @@ -1995,7 +1995,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:1027 +#: ../../tutorial/controlflow.rst:1028 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. " @@ -2005,7 +2005,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:1032 +#: ../../tutorial/controlflow.rst:1033 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 " @@ -2027,11 +2027,11 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1044 +#: ../../tutorial/controlflow.rst:1045 msgid "Here is an example of a multi-line docstring::" msgstr "下面是多行說明字串的一個範例: ::" -#: ../../tutorial/controlflow.rst:1046 +#: ../../tutorial/controlflow.rst:1047 msgid "" ">>> def my_function():\n" "... \"\"\"Do nothing, but document it.\n" @@ -2046,11 +2046,11 @@ msgid "" " No, really, it doesn't do anything." msgstr "" -#: ../../tutorial/controlflow.rst:1062 +#: ../../tutorial/controlflow.rst:1063 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1070 +#: ../../tutorial/controlflow.rst:1071 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -2059,7 +2059,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1074 +#: ../../tutorial/controlflow.rst:1075 msgid "" ":term:`Annotations ` are stored in the :attr:`!" "__annotations__` attribute of the function as a dictionary and have no " @@ -2077,7 +2077,7 @@ msgstr "" ">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" "值: ::" -#: ../../tutorial/controlflow.rst:1083 +#: ../../tutorial/controlflow.rst:1084 msgid "" ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "... print(\"Annotations:\", f.__annotations__)\n" @@ -2101,11 +2101,11 @@ msgstr "" "Arguments: spam eggs\n" "'spam and eggs'" -#: ../../tutorial/controlflow.rst:1096 +#: ../../tutorial/controlflow.rst:1097 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1101 +#: ../../tutorial/controlflow.rst:1102 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 " @@ -2118,7 +2118,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1107 +#: ../../tutorial/controlflow.rst:1108 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 " @@ -2128,11 +2128,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1112 +#: ../../tutorial/controlflow.rst:1113 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1114 +#: ../../tutorial/controlflow.rst:1115 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -2141,11 +2141,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1118 +#: ../../tutorial/controlflow.rst:1119 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1120 +#: ../../tutorial/controlflow.rst:1121 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -2153,21 +2153,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1123 +#: ../../tutorial/controlflow.rst:1124 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1126 +#: ../../tutorial/controlflow.rst:1127 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1128 +#: ../../tutorial/controlflow.rst:1129 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1130 +#: ../../tutorial/controlflow.rst:1131 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -2175,7 +2175,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:``a = f(1, 2) + g(3, " "4)``。" -#: ../../tutorial/controlflow.rst:1133 +#: ../../tutorial/controlflow.rst:1134 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -2187,7 +2187,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1138 +#: ../../tutorial/controlflow.rst:1139 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 " @@ -2196,7 +2196,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1142 +#: ../../tutorial/controlflow.rst:1143 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 " @@ -2205,11 +2205,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1148 +#: ../../tutorial/controlflow.rst:1149 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1149 +#: ../../tutorial/controlflow.rst:1150 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 " @@ -2227,55 +2227,55 @@ msgstr "statement(陳述式)" msgid "for" msgstr "for" -#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 +#: ../../tutorial/controlflow.rst:477 ../../tutorial/controlflow.rst:1014 msgid "documentation strings" msgstr "ddocumentation strings(說明字串)" -#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 +#: ../../tutorial/controlflow.rst:477 ../../tutorial/controlflow.rst:1014 msgid "docstrings" msgstr "docstrings(說明字串)" -#: ../../tutorial/controlflow.rst:476 ../../tutorial/controlflow.rst:1013 +#: ../../tutorial/controlflow.rst:477 ../../tutorial/controlflow.rst:1014 msgid "strings, documentation" msgstr "strings(字串), documentation(說明文件)" -#: ../../tutorial/controlflow.rst:917 +#: ../../tutorial/controlflow.rst:918 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../tutorial/controlflow.rst:917 ../../tutorial/controlflow.rst:961 +#: ../../tutorial/controlflow.rst:918 ../../tutorial/controlflow.rst:962 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../tutorial/controlflow.rst:961 +#: ../../tutorial/controlflow.rst:962 msgid "**" msgstr "**" -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1066 msgid "function" msgstr "function(函式)" -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1066 msgid "annotations" msgstr "annotations(註釋)" -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1066 msgid "->" msgstr "->" -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1066 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1066 msgid ": (colon)" msgstr ": (冒號)" -#: ../../tutorial/controlflow.rst:1099 +#: ../../tutorial/controlflow.rst:1100 msgid "coding" msgstr "coding(程式編寫)" -#: ../../tutorial/controlflow.rst:1099 +#: ../../tutorial/controlflow.rst:1100 msgid "style" msgstr "style(風格)" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 27fcb13025..23fac8f41f 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: 2024-01-22 21:43+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,13 +49,14 @@ msgstr "" "method:" #: ../../tutorial/datastructures.rst:22 -msgid "" -"Add an item to the end of the list. Equivalent to ``a[len(a):] = [x]``." +#, fuzzy +msgid "Add an item to the end of the list. Similar to ``a[len(a):] = [x]``." msgstr "將一個新的項目加到 list 的尾端。等同於 ``a[len(a):] = [x]``。" #: ../../tutorial/datastructures.rst:28 +#, fuzzy msgid "" -"Extend the list by appending all the items from the iterable. Equivalent to " +"Extend the list by appending all the items from the iterable. Similar to " "``a[len(a):] = iterable``." msgstr "" "將 iterable(可疊代物件)接到 list 的尾端。等同於 ``a[len(a):] = iterable``。" @@ -90,7 +91,8 @@ msgstr "" "exc:`IndexError` 例外。" #: ../../tutorial/datastructures.rst:59 -msgid "Remove all items from the list. Equivalent to ``del a[:]``." +#, fuzzy +msgid "Remove all items from the list. Similar to ``del a[:]``." msgstr "刪除 list 中所有項目。這等同於 ``del a[:]``。" #: ../../tutorial/datastructures.rst:65 @@ -129,7 +131,8 @@ msgid "Reverse the elements of the list in place." msgstr "將 list 中的項目前後順序反過來。" #: ../../tutorial/datastructures.rst:96 -msgid "Return a shallow copy of the list. Equivalent to ``a[:]``." +#, fuzzy +msgid "Return a shallow copy of the list. Similar to ``a[:]``." msgstr "回傳一個淺複製 (shallow copy) 的 list。等同於 ``a[:]``。" #: ../../tutorial/datastructures.rst:99 diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 3fbc7a6674..2ab5ca71f4 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -197,11 +197,11 @@ msgstr "" "值替代為字串的另一種方法。該方法使用 ``$x`` 佔位符號,並以 dictionary 的值進" "行取代,但對格式的控制明顯較少。" -#: ../../tutorial/inputoutput.rst:107 +#: ../../tutorial/inputoutput.rst:114 msgid "Formatted String Literals" msgstr "格式化的字串文本 (Formatted String Literals)" -#: ../../tutorial/inputoutput.rst:109 +#: ../../tutorial/inputoutput.rst:116 msgid "" ":ref:`Formatted string literals ` (also called f-strings for " "short) let you include the value of Python expressions inside a string by " @@ -212,7 +212,7 @@ msgstr "" "``f`` 或 ``F``,並將運算式編寫為 ``{expression}``,讓你可以在字串內加入 " "Python 運算式的值。" -#: ../../tutorial/inputoutput.rst:114 +#: ../../tutorial/inputoutput.rst:121 msgid "" "An optional format specifier can follow the expression. This allows greater " "control over how the value is formatted. The following example rounds pi to " @@ -221,7 +221,7 @@ msgstr "" "格式說明符 (format specifier) 是選擇性的,寫在運算式後面,可以更好地控制值的" "格式化方式。以下範例將 pi 捨入到小數點後三位: ::" -#: ../../tutorial/inputoutput.rst:118 +#: ../../tutorial/inputoutput.rst:125 msgid "" ">>> import math\n" ">>> print(f'The value of pi is approximately {math.pi:.3f}.')\n" @@ -231,7 +231,7 @@ msgstr "" ">>> print(f'The value of pi is approximately {math.pi:.3f}.')\n" "The value of pi is approximately 3.142." -#: ../../tutorial/inputoutput.rst:122 +#: ../../tutorial/inputoutput.rst:129 msgid "" "Passing an integer after the ``':'`` will cause that field to be a minimum " "number of characters wide. This is useful for making columns line up. ::" @@ -239,7 +239,7 @@ msgstr "" "在 ``':'`` 後傳遞一個整數,可以設定該欄位至少為幾個字元寬,常用於將每一欄對" "齊。 ::" -#: ../../tutorial/inputoutput.rst:125 +#: ../../tutorial/inputoutput.rst:132 msgid "" ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678}\n" ">>> for name, phone in table.items():\n" @@ -257,7 +257,7 @@ msgstr "" "Jack ==> 4098\n" "Dcab ==> 7678" -#: ../../tutorial/inputoutput.rst:133 +#: ../../tutorial/inputoutput.rst:140 msgid "" "Other modifiers can be used to convert the value before it is formatted. ``'!" "a'`` applies :func:`ascii`, ``'!s'`` applies :func:`str`, and ``'!r'`` " @@ -266,7 +266,7 @@ msgstr "" "還有一些修飾符號可以在格式化前先將值轉換過。``'!a'`` 會套用 :func:`ascii`," "``'!s'`` 會套用 :func:`str`,``'!r'`` 會套用 :func:`repr`: ::" -#: ../../tutorial/inputoutput.rst:137 +#: ../../tutorial/inputoutput.rst:144 msgid "" ">>> animals = 'eels'\n" ">>> print(f'My hovercraft is full of {animals}.')\n" @@ -280,7 +280,7 @@ msgstr "" ">>> print(f'My hovercraft is full of {animals!r}.')\n" "My hovercraft is full of 'eels'." -#: ../../tutorial/inputoutput.rst:143 +#: ../../tutorial/inputoutput.rst:150 msgid "" "The ``=`` specifier can be used to expand an expression to the text of the " "expression, an equal sign, then the representation of the evaluated " @@ -289,7 +289,7 @@ msgstr "" "``=`` 說明符可用於將一個運算式擴充為該運算式的文字、一個等號、以及對該運算式" "求值 (evaluate) 後的表示法:" -#: ../../tutorial/inputoutput.rst:152 +#: ../../tutorial/inputoutput.rst:159 msgid "" "See :ref:`self-documenting expressions ` for more " "information on the ``=`` specifier. For a reference on these format " @@ -299,15 +299,15 @@ msgstr "" "expressions) `。若要參考這些格式化字串的規格,詳見 :ref:" "`formatspec` 參考指南。" -#: ../../tutorial/inputoutput.rst:159 +#: ../../tutorial/inputoutput.rst:166 msgid "The String format() Method" msgstr "字串的 format() method" -#: ../../tutorial/inputoutput.rst:161 +#: ../../tutorial/inputoutput.rst:168 msgid "Basic usage of the :meth:`str.format` method looks like this::" msgstr ":meth:`str.format` method 的基本用法如下: ::" -#: ../../tutorial/inputoutput.rst:163 +#: ../../tutorial/inputoutput.rst:170 msgid "" ">>> print('We are the {} who say \"{}!\"'.format('knights', 'Ni'))\n" "We are the knights who say \"Ni!\"" @@ -315,7 +315,7 @@ msgstr "" ">>> print('We are the {} who say \"{}!\"'.format('knights', 'Ni'))\n" "We are the knights who say \"Ni!\"" -#: ../../tutorial/inputoutput.rst:166 +#: ../../tutorial/inputoutput.rst:173 msgid "" "The brackets and characters within them (called format fields) are replaced " "with the objects passed into the :meth:`str.format` method. A number in the " @@ -326,7 +326,7 @@ msgstr "" "的物件。大括號中的數字表示該物件在傳遞給 :meth:`str.format` method 時所在的位" "置。 ::" -#: ../../tutorial/inputoutput.rst:171 +#: ../../tutorial/inputoutput.rst:178 msgid "" ">>> print('{0} and {1}'.format('spam', 'eggs'))\n" "spam and eggs\n" @@ -338,7 +338,7 @@ msgstr "" ">>> print('{1} and {0}'.format('spam', 'eggs'))\n" "eggs and spam" -#: ../../tutorial/inputoutput.rst:176 +#: ../../tutorial/inputoutput.rst:183 msgid "" "If keyword arguments are used in the :meth:`str.format` method, their values " "are referred to by using the name of the argument. ::" @@ -346,7 +346,7 @@ msgstr "" "如果在 :meth:`str.format` method 中使用關鍵字引數,可以使用引數名稱去引用它們" "的值。 ::" -#: ../../tutorial/inputoutput.rst:179 +#: ../../tutorial/inputoutput.rst:186 msgid "" ">>> print('This {food} is {adjective}.'.format(\n" "... food='spam', adjective='absolutely horrible'))\n" @@ -356,11 +356,11 @@ msgstr "" "... food='spam', adjective='absolutely horrible'))\n" "This spam is absolutely horrible." -#: ../../tutorial/inputoutput.rst:183 +#: ../../tutorial/inputoutput.rst:190 msgid "Positional and keyword arguments can be arbitrarily combined::" msgstr "位置引數和關鍵字引數可以任意組合: ::" -#: ../../tutorial/inputoutput.rst:185 +#: ../../tutorial/inputoutput.rst:192 msgid "" ">>> print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',\n" "... other='Georg'))\n" @@ -370,7 +370,7 @@ msgstr "" "... other='Georg'))\n" "The story of Bill, Manfred, and Georg." -#: ../../tutorial/inputoutput.rst:189 +#: ../../tutorial/inputoutput.rst:196 msgid "" "If you have a really long format string that you don't want to split up, it " "would be nice if you could reference the variables to be formatted by name " @@ -381,7 +381,7 @@ msgstr "" "數。這項操作可以透過傳遞字典 (dict),並用方括號 ``'[]'`` 使用鍵 (key) 來輕鬆" "完成。 ::" -#: ../../tutorial/inputoutput.rst:194 +#: ../../tutorial/inputoutput.rst:201 msgid "" ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" ">>> print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '\n" @@ -393,14 +393,14 @@ msgstr "" "... 'Dcab: {0[Dcab]:d}'.format(table))\n" "Jack: 4098; Sjoerd: 4127; Dcab: 8637678" -#: ../../tutorial/inputoutput.rst:199 +#: ../../tutorial/inputoutput.rst:206 msgid "" "This could also be done by passing the ``table`` dictionary as keyword " "arguments with the ``**`` notation. ::" msgstr "" "用 '**' 符號,把 ``table`` 字典當作關鍵字引數來傳遞,也有一樣的結果。 ::" -#: ../../tutorial/inputoutput.rst:202 +#: ../../tutorial/inputoutput.rst:209 msgid "" ">>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}\n" ">>> print('Jack: {Jack:d}; Sjoerd: {Sjoerd:d}; Dcab: {Dcab:d}'." @@ -412,7 +412,7 @@ msgstr "" "format(**table))\n" "Jack: 4098; Sjoerd: 4127; Dcab: 8637678" -#: ../../tutorial/inputoutput.rst:206 +#: ../../tutorial/inputoutput.rst:213 msgid "" "This is particularly useful in combination with the built-in function :func:" "`vars`, which returns a dictionary containing all local variables::" @@ -420,7 +420,7 @@ msgstr "" "與內建函式 :func:`vars` 組合使用時,這種方式特別實用。該函式可以回傳一個包含" "所有區域變數的 dictionary: ::" -#: ../../tutorial/inputoutput.rst:209 +#: ../../tutorial/inputoutput.rst:216 msgid "" ">>> table = {k: str(v) for k, v in vars().items()}\n" ">>> message = \" \".join([f'{k}: ' + '{' + k +'};' for k in table.keys()])\n" @@ -432,13 +432,13 @@ msgstr "" ">>> print(message.format(**table))\n" "__name__: __main__; __doc__: None; __package__: None; __loader__: ..." -#: ../../tutorial/inputoutput.rst:214 +#: ../../tutorial/inputoutput.rst:221 msgid "" "As an example, the following lines produce a tidily aligned set of columns " "giving integers and their squares and cubes::" msgstr "例如,下面的程式碼產生一組排列整齊的欄,列出整數及其平方與立方: ::" -#: ../../tutorial/inputoutput.rst:217 +#: ../../tutorial/inputoutput.rst:224 msgid "" ">>> for x in range(1, 11):\n" "... print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x))\n" @@ -468,7 +468,7 @@ msgstr "" " 9 81 729\n" "10 100 1000" -#: ../../tutorial/inputoutput.rst:231 +#: ../../tutorial/inputoutput.rst:238 msgid "" "For a complete overview of string formatting with :meth:`str.format`, see :" "ref:`formatstrings`." @@ -476,15 +476,15 @@ msgstr "" "關於使用 :meth:`str.format` 進行字串格式化的完整概述,請見\\ :ref:" "`formatstrings`。" -#: ../../tutorial/inputoutput.rst:236 +#: ../../tutorial/inputoutput.rst:243 msgid "Manual String Formatting" msgstr "手動格式化字串" -#: ../../tutorial/inputoutput.rst:238 +#: ../../tutorial/inputoutput.rst:245 msgid "Here's the same table of squares and cubes, formatted manually::" msgstr "下面是以手動格式化完成的同一個平方及立方的表: ::" -#: ../../tutorial/inputoutput.rst:240 +#: ../../tutorial/inputoutput.rst:247 msgid "" ">>> for x in range(1, 11):\n" "... print(repr(x).rjust(2), repr(x*x).rjust(3), end=' ')\n" @@ -518,7 +518,7 @@ msgstr "" " 9 81 729\n" "10 100 1000" -#: ../../tutorial/inputoutput.rst:256 +#: ../../tutorial/inputoutput.rst:263 msgid "" "(Note that the one space between each column was added by the way :func:" "`print` works: it always adds spaces between its arguments.)" @@ -526,7 +526,7 @@ msgstr "" "(請注意,使用 :func:`print` 讓每欄之間加入一個空格的方法:這種方法總是在其引" "數間加入空格。)" -#: ../../tutorial/inputoutput.rst:259 +#: ../../tutorial/inputoutput.rst:266 msgid "" "The :meth:`str.rjust` method of string objects right-justifies a string in a " "field of a given width by padding it with spaces on the left. There are " @@ -544,7 +544,7 @@ msgstr "" "好,那種情況會讓值變得不正確。(如果你真的想截斷字串,可以加入像 ``x.ljust(n)" "[:n]`` 這樣的切片運算。)" -#: ../../tutorial/inputoutput.rst:268 +#: ../../tutorial/inputoutput.rst:275 msgid "" "There is another method, :meth:`str.zfill`, which pads a numeric string on " "the left with zeros. It understands about plus and minus signs::" @@ -552,7 +552,7 @@ msgstr "" "另一種 method 是 :meth:`str.zfill`,可在數值字串的左邊填補零,且能識別正負" "號: ::" -#: ../../tutorial/inputoutput.rst:271 +#: ../../tutorial/inputoutput.rst:278 msgid "" ">>> '12'.zfill(5)\n" "'00012'\n" @@ -568,11 +568,11 @@ msgstr "" ">>> '3.14159265359'.zfill(5)\n" "'3.14159265359'" -#: ../../tutorial/inputoutput.rst:280 +#: ../../tutorial/inputoutput.rst:287 msgid "Old string formatting" msgstr "格式化字串的舊方法" -#: ../../tutorial/inputoutput.rst:282 +#: ../../tutorial/inputoutput.rst:289 msgid "" "The % operator (modulo) can also be used for string formatting. Given " "``format % values`` (where *format* is a string), ``%`` conversion " @@ -584,7 +584,7 @@ msgstr "" "*format* 是個字串),*format* 內的 ``%`` 轉換規格會被 *values* 的零個或多個元" "素所取代。此運算常被稱為字串插值 (string interpolation)。例如: ::" -#: ../../tutorial/inputoutput.rst:289 +#: ../../tutorial/inputoutput.rst:296 msgid "" ">>> import math\n" ">>> print('The value of pi is approximately %5.3f.' % math.pi)\n" @@ -594,16 +594,16 @@ msgstr "" ">>> print('The value of pi is approximately %5.3f.' % math.pi)\n" "The value of pi is approximately 3.142." -#: ../../tutorial/inputoutput.rst:293 +#: ../../tutorial/inputoutput.rst:300 msgid "" "More information can be found in the :ref:`old-string-formatting` section." msgstr "更多資訊請見 :ref:`old-string-formatting`\\ 小節。" -#: ../../tutorial/inputoutput.rst:299 +#: ../../tutorial/inputoutput.rst:306 msgid "Reading and Writing Files" msgstr "讀寫檔案" -#: ../../tutorial/inputoutput.rst:305 +#: ../../tutorial/inputoutput.rst:312 msgid "" ":func:`open` returns a :term:`file object`, and is most commonly used with " "two positional arguments and one keyword argument: ``open(filename, mode, " @@ -612,11 +612,11 @@ msgstr "" ":func:`open` 回傳一個 :term:`file object`,而它最常使用的兩個位置引數和一個關" "鍵字引數是:``open(filename, mode, encoding=None)``" -#: ../../tutorial/inputoutput.rst:311 +#: ../../tutorial/inputoutput.rst:318 msgid ">>> f = open('workfile', 'w', encoding=\"utf-8\")" msgstr ">>> f = open('workfile', 'w', encoding=\"utf-8\")" -#: ../../tutorial/inputoutput.rst:318 +#: ../../tutorial/inputoutput.rst:325 msgid "" "The first argument is a string containing the filename. The second argument " "is another string containing a few characters describing the way in which " @@ -633,7 +633,7 @@ msgstr "" "內容為目的開啟檔案,任何寫入檔案的資料會自動被加入到檔案的結尾。``'r+'`` 可以" "開啟檔案並進行讀取和寫入。*mode* 引數是選擇性的,若省略時會預設為 ``'r'``。" -#: ../../tutorial/inputoutput.rst:327 +#: ../../tutorial/inputoutput.rst:334 msgid "" "Normally, files are opened in :dfn:`text mode`, that means, you read and " "write strings from and to the file, which are encoded in a specific " @@ -651,7 +651,7 @@ msgstr "" "mode`\\ (二進制模式)開啟檔案,二進制模式資料以 :class:`bytes` 物件的形式被" "讀寫。以二進制模式開啟檔案時不可以指定 *encoding*。" -#: ../../tutorial/inputoutput.rst:337 +#: ../../tutorial/inputoutput.rst:344 msgid "" "In text mode, the default when reading is to convert platform-specific line " "endings (``\\n`` on Unix, ``\\r\\n`` on Windows) to just ``\\n``. When " @@ -667,7 +667,7 @@ msgstr "" "文字檔案來說沒有問題,但會毀壞像是 :file:`JPEG` 或 :file:`EXE` 檔案中的二進制" "資料。在讀寫此類檔案時,注意一定要使用二進制模式。" -#: ../../tutorial/inputoutput.rst:345 +#: ../../tutorial/inputoutput.rst:352 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 " @@ -679,7 +679,7 @@ msgstr "" "束後,即使在某個時刻引發了例外,檔案仍會正確地被關閉。使用 :keyword:`!with` " "也比寫等效的 :keyword:`try`\\ -\\ :keyword:`finally` 區塊,來得簡短許多: ::" -#: ../../tutorial/inputoutput.rst:351 +#: ../../tutorial/inputoutput.rst:358 msgid "" ">>> with open('workfile', encoding=\"utf-8\") as f:\n" "... read_data = f.read()\n" @@ -695,7 +695,7 @@ msgstr "" ">>> f.closed\n" "True" -#: ../../tutorial/inputoutput.rst:358 +#: ../../tutorial/inputoutput.rst:365 msgid "" "If you're not using the :keyword:`with` keyword, then you should call ``f." "close()`` to close the file and immediately free up any system resources " @@ -704,7 +704,7 @@ msgstr "" "如果你沒有使用 :keyword:`with` 關鍵字,則應呼叫 ``f.close()`` 關閉檔案,可以" "立即釋放被它所使用的系統資源。" -#: ../../tutorial/inputoutput.rst:363 +#: ../../tutorial/inputoutput.rst:370 msgid "" "Calling ``f.write()`` without using the :keyword:`!with` keyword or calling " "``f.close()`` **might** result in the arguments of ``f.write()`` not being " @@ -714,7 +714,7 @@ msgstr "" "即使程式成功退出,也\\ **可能**\\ 導致 ``f.write()`` 的引數沒有被完全寫入硬" "碟。" -#: ../../tutorial/inputoutput.rst:371 +#: ../../tutorial/inputoutput.rst:378 msgid "" "After a file object is closed, either by a :keyword:`with` statement or by " "calling ``f.close()``, attempts to use the file object will automatically " @@ -723,7 +723,7 @@ msgstr "" "不論是透過 :keyword:`with` 陳述式,或呼叫 ``f.close()`` 關閉一個檔案物件之" "後,嘗試使用該檔案物件將會自動失效。 ::" -#: ../../tutorial/inputoutput.rst:375 +#: ../../tutorial/inputoutput.rst:382 msgid "" ">>> f.close()\n" ">>> f.read()\n" @@ -737,17 +737,17 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: I/O operation on closed file." -#: ../../tutorial/inputoutput.rst:385 +#: ../../tutorial/inputoutput.rst:392 msgid "Methods of File Objects" msgstr "檔案物件的 method" -#: ../../tutorial/inputoutput.rst:387 +#: ../../tutorial/inputoutput.rst:394 msgid "" "The rest of the examples in this section will assume that a file object " "called ``f`` has already been created." msgstr "本節其餘的範例皆假設一個名為 ``f`` 的檔案物件已被建立。" -#: ../../tutorial/inputoutput.rst:390 +#: ../../tutorial/inputoutput.rst:397 msgid "" "To read a file's contents, call ``f.read(size)``, which reads some quantity " "of data and returns it as a string (in text mode) or bytes object (in binary " @@ -765,7 +765,7 @@ msgstr "" "字模式)或 *size* 數量的位元組串(二進制模式)會被讀取及回傳。如果之前已經到" "達檔案的末端,``f.read()`` 會回傳空字串(``''``)。 ::" -#: ../../tutorial/inputoutput.rst:399 +#: ../../tutorial/inputoutput.rst:406 msgid "" ">>> f.read()\n" "'This is the entire file.\\n'\n" @@ -777,7 +777,7 @@ msgstr "" ">>> f.read()\n" "''" -#: ../../tutorial/inputoutput.rst:404 +#: ../../tutorial/inputoutput.rst:411 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 " @@ -791,7 +791,7 @@ msgstr "" "傳值清晰明確;只要 ``f.readline()`` 回傳一個空字串,就表示已經到達了檔案末" "端,而空白行的表示法是 ``'\\n'``,也就是只含一個換行字元的字串。 ::" -#: ../../tutorial/inputoutput.rst:411 +#: ../../tutorial/inputoutput.rst:418 msgid "" ">>> f.readline()\n" "'This is the first line of the file.\\n'\n" @@ -807,7 +807,7 @@ msgstr "" ">>> f.readline()\n" "''" -#: ../../tutorial/inputoutput.rst:418 +#: ../../tutorial/inputoutput.rst:425 msgid "" "For reading lines from a file, you can loop over the file object. This is " "memory efficient, fast, and leads to simple code::" @@ -815,7 +815,7 @@ msgstr "" "想從檔案中讀取多行時,可以對檔案物件進行迴圈。這種方法能有效地使用記憶體、快" "速,且程式碼簡潔: ::" -#: ../../tutorial/inputoutput.rst:421 +#: ../../tutorial/inputoutput.rst:428 msgid "" ">>> for line in f:\n" "... print(line, end='')\n" @@ -829,7 +829,7 @@ msgstr "" "This is the first line of the file.\n" "Second line of the file" -#: ../../tutorial/inputoutput.rst:427 +#: ../../tutorial/inputoutput.rst:434 msgid "" "If you want to read all the lines of a file in a list you can also use " "``list(f)`` or ``f.readlines()``." @@ -837,14 +837,14 @@ msgstr "" "如果你想把一個檔案的所有行讀進一個 list 裡,可以用 ``list(f)`` 或 ``f." "readlines()``。" -#: ../../tutorial/inputoutput.rst:430 +#: ../../tutorial/inputoutput.rst:437 msgid "" "``f.write(string)`` writes the contents of *string* to the file, returning " "the number of characters written. ::" msgstr "" "``f.write(string)`` 把 *string* 的內容寫入檔案,並回傳寫入的字元數。 ::" -#: ../../tutorial/inputoutput.rst:433 +#: ../../tutorial/inputoutput.rst:440 msgid "" ">>> f.write('This is a test\\n')\n" "15" @@ -852,7 +852,7 @@ msgstr "" ">>> f.write('This is a test\\n')\n" "15" -#: ../../tutorial/inputoutput.rst:436 +#: ../../tutorial/inputoutput.rst:443 msgid "" "Other types of objects need to be converted -- either to a string (in text " "mode) or a bytes object (in binary mode) -- before writing them::" @@ -860,7 +860,7 @@ msgstr "" "寫入其他類型的物件之前,要先把它們轉換為字串(文字模式)或位元組串物件(二進" "制模式): ::" -#: ../../tutorial/inputoutput.rst:439 +#: ../../tutorial/inputoutput.rst:446 msgid "" ">>> value = ('the answer', 42)\n" ">>> s = str(value) # convert the tuple to string\n" @@ -872,7 +872,7 @@ msgstr "" ">>> f.write(s)\n" "18" -#: ../../tutorial/inputoutput.rst:444 +#: ../../tutorial/inputoutput.rst:451 msgid "" "``f.tell()`` returns an integer giving the file object's current position in " "the file represented as number of bytes from the beginning of the file when " @@ -881,7 +881,7 @@ msgstr "" "``f.tell()`` 回傳一個整數,它給出檔案物件在檔案中的當前位置,在二進制模式下表" "示為檔案開始至今的位元組數,在文字模式下表示為一個意義不明的數字。" -#: ../../tutorial/inputoutput.rst:448 +#: ../../tutorial/inputoutput.rst:455 msgid "" "To change the file object's position, use ``f.seek(offset, whence)``. The " "position is computed from adding *offset* to a reference point; the " @@ -896,7 +896,7 @@ msgstr "" "為 0 時,表示使用檔案開頭,1 表示使用當前的檔案位置,2 表示使用檔案末端作為參" "考點。*whence* 可省略,其預設值為 0,即以檔案開頭作為參考點。 ::" -#: ../../tutorial/inputoutput.rst:455 +#: ../../tutorial/inputoutput.rst:462 msgid "" ">>> f = open('workfile', 'rb+')\n" ">>> f.write(b'0123456789abcdef')\n" @@ -922,7 +922,7 @@ msgstr "" ">>> f.read(1)\n" "b'd'" -#: ../../tutorial/inputoutput.rst:467 +#: ../../tutorial/inputoutput.rst:474 msgid "" "In text files (those opened without a ``b`` in the mode string), only seeks " "relative to the beginning of the file are allowed (the exception being " @@ -935,7 +935,7 @@ msgstr "" "的值,或是 0,才是有效的 *offset* 值。其他任何 *offset* 值都會產生未定義的行" "為。" -#: ../../tutorial/inputoutput.rst:473 +#: ../../tutorial/inputoutput.rst:480 msgid "" "File objects have some additional methods, such as :meth:`~io.IOBase.isatty` " "and :meth:`~io.IOBase.truncate` which are less frequently used; consult the " @@ -944,11 +944,11 @@ msgstr "" "檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~io.IOBase.isatty` " "和 :meth:`~io.IOBase.truncate`;檔案物件的完整指南詳見程式庫參考手冊。" -#: ../../tutorial/inputoutput.rst:481 +#: ../../tutorial/inputoutput.rst:488 msgid "Saving structured data with :mod:`json`" msgstr "使用 :mod:`json` 儲存結構化資料" -#: ../../tutorial/inputoutput.rst:485 +#: ../../tutorial/inputoutput.rst:492 msgid "" "Strings can easily be written to and read from a file. Numbers take a bit " "more effort, since the :meth:`~io.TextIOBase.read` method only returns " @@ -963,7 +963,7 @@ msgstr "" "dictionary(字典)等複雜的資料類型時,手動剖析 (parsing) 和序列化 " "(serializing) 就變得複雜。" -#: ../../tutorial/inputoutput.rst:492 +#: ../../tutorial/inputoutput.rst:499 msgid "" "Rather than having users constantly writing and debugging code to save " "complicated data types to files, Python allows you to use the popular data " @@ -982,7 +982,7 @@ msgstr "" "則稱為 :dfn:`deserializing`\\ (反序列化)。在序列化和反序列化之間,表示物件" "的字串可以被儲存在檔案或資料中,或通過網路連接發送到遠端的機器。" -#: ../../tutorial/inputoutput.rst:503 +#: ../../tutorial/inputoutput.rst:510 msgid "" "The JSON format is commonly used by modern applications to allow for data " "exchange. Many programmers are already familiar with it, which makes it a " @@ -991,14 +991,14 @@ msgstr "" "JSON 格式經常地使用於現代應用程式的資料交換。許多程序設計師早已對它耳熟能詳," "使它成為提升互操作性 (interoperability) 的好選擇。" -#: ../../tutorial/inputoutput.rst:507 +#: ../../tutorial/inputoutput.rst:514 msgid "" "If you have an object ``x``, you can view its JSON string representation " "with a simple line of code::" msgstr "" "如果你有一個物件 ``x``,只需一行簡單的程式碼即可檢視它的 JSON 字串表示法: ::" -#: ../../tutorial/inputoutput.rst:510 +#: ../../tutorial/inputoutput.rst:517 msgid "" ">>> import json\n" ">>> x = [1, 'simple', 'list']\n" @@ -1010,7 +1010,7 @@ msgstr "" ">>> json.dumps(x)\n" "'[1, \"simple\", \"list\"]'" -#: ../../tutorial/inputoutput.rst:515 +#: ../../tutorial/inputoutput.rst:522 msgid "" "Another variant of the :func:`~json.dumps` function, called :func:`~json." "dump`, simply serializes the object to a :term:`text file`. So if ``f`` is " @@ -1020,11 +1020,11 @@ msgstr "" "列化為 :term:`text file`。因此,如果 ``f`` 是一個為了寫入而開啟的 :term:" "`text file` 物件,我們可以這樣做: ::" -#: ../../tutorial/inputoutput.rst:519 +#: ../../tutorial/inputoutput.rst:526 msgid "json.dump(x, f)" msgstr "json.dump(x, f)" -#: ../../tutorial/inputoutput.rst:521 +#: ../../tutorial/inputoutput.rst:528 msgid "" "To decode the object again, if ``f`` is a :term:`binary file` or :term:`text " "file` object which has been opened for reading::" @@ -1032,11 +1032,11 @@ msgstr "" "若 ``f`` 是一個已開啟、可讀取的 :term:`binary file` 或 :term:`text file` 物" "件,要再次解碼物件的話: ::" -#: ../../tutorial/inputoutput.rst:524 +#: ../../tutorial/inputoutput.rst:531 msgid "x = json.load(f)" msgstr "x = json.load(f)" -#: ../../tutorial/inputoutput.rst:527 +#: ../../tutorial/inputoutput.rst:534 msgid "" "JSON files must be encoded in UTF-8. Use ``encoding=\"utf-8\"`` when opening " "JSON file as a :term:`text file` for both of reading and writing." @@ -1044,7 +1044,7 @@ msgstr "" "JSON 檔案必須以 UTF-8 格式編碼。在開啟 JSON 檔案以作為一個可讀取與寫入的 :" "term:`text file` 時,要用 ``encoding=\"utf-8\"``。" -#: ../../tutorial/inputoutput.rst:530 +#: ../../tutorial/inputoutput.rst:537 msgid "" "This simple serialization technique can handle lists and dictionaries, but " "serializing arbitrary class instances in JSON requires a bit of extra " @@ -1055,11 +1055,11 @@ msgstr "" "class(類別)實例,則需要一些額外的工作。:mod:`json` 模組的參考資料包含對此的" "說明。" -#: ../../tutorial/inputoutput.rst:536 +#: ../../tutorial/inputoutput.rst:543 msgid ":mod:`pickle` - the pickle module" msgstr ":mod:`pickle` - pickle 模組" -#: ../../tutorial/inputoutput.rst:538 +#: ../../tutorial/inputoutput.rst:545 msgid "" "Contrary to :ref:`JSON `, *pickle* is a protocol which allows the " "serialization of arbitrarily complex Python objects. As such, it is " @@ -1073,26 +1073,57 @@ msgstr "" "通。在預設情況,它也是不安全的:如果資料是由手段高明的攻擊者精心設計,將這段" "來自於不受信任來源的 pickle 資料反序列化,可以執行任意的程式碼。" -#: ../../tutorial/inputoutput.rst:301 +#: ../../tutorial/inputoutput.rst:103 +#, fuzzy +msgid "formatted string literal" +msgstr "格式化的字串文本 (Formatted String Literals)" + +#: ../../tutorial/inputoutput.rst:103 +#, fuzzy +msgid "interpolated string literal" +msgstr "格式化的字串文本 (Formatted String Literals)" + +#: ../../tutorial/inputoutput.rst:103 +msgid "string" +msgstr "" + +#: ../../tutorial/inputoutput.rst:103 +#, fuzzy +msgid "formatted literal" +msgstr "格式化的字串文本 (Formatted String Literals)" + +#: ../../tutorial/inputoutput.rst:103 +msgid "interpolated literal" +msgstr "" + +#: ../../tutorial/inputoutput.rst:103 +msgid "f-string" +msgstr "" + +#: ../../tutorial/inputoutput.rst:103 +msgid "fstring" +msgstr "" + +#: ../../tutorial/inputoutput.rst:308 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../tutorial/inputoutput.rst:301 +#: ../../tutorial/inputoutput.rst:308 msgid "open" msgstr "open" -#: ../../tutorial/inputoutput.rst:301 +#: ../../tutorial/inputoutput.rst:308 msgid "object" msgstr "object(物件)" -#: ../../tutorial/inputoutput.rst:301 +#: ../../tutorial/inputoutput.rst:308 msgid "file" msgstr "file(檔案)" -#: ../../tutorial/inputoutput.rst:483 +#: ../../tutorial/inputoutput.rst:490 msgid "module" msgstr "module(模組)" -#: ../../tutorial/inputoutput.rst:483 +#: ../../tutorial/inputoutput.rst:490 msgid "json" msgstr "json" diff --git a/using/configure.po b/using/configure.po index 65174a6000..4eec4e6b28 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -379,7 +379,7 @@ msgid "" "cleared." msgstr "" -#: ../../using/configure.rst:236 ../../using/configure.rst:708 +#: ../../using/configure.rst:236 ../../using/configure.rst:721 msgid "Effects:" msgstr "效果:" @@ -555,217 +555,247 @@ msgid "See :ref:`whatsnew313-free-threaded-cpython` for more detail." msgstr "" #: ../../using/configure.rst:308 -msgid "Path to ``pkg-config`` utility." +msgid "" +"Indicate how to integrate the :ref:`JIT compiler `." +msgstr "" + +#: ../../using/configure.rst:310 +msgid "``no`` - build the interpreter without the JIT." +msgstr "" + +#: ../../using/configure.rst:311 +msgid "``yes`` - build the interpreter with the JIT." +msgstr "" + +#: ../../using/configure.rst:312 +msgid "" +"``yes-off`` - build the interpreter with the JIT but disable it by default." msgstr "" #: ../../using/configure.rst:313 +msgid "" +"``interpreter`` - build the interpreter without the JIT, but with the tier 2 " +"enabled interpreter." +msgstr "" + +#: ../../using/configure.rst:315 +msgid "" +"By convention, ``--enable-experimental-jit`` is a shorthand for ``--enable-" +"experimental-jit=yes``." +msgstr "" + +#: ../../using/configure.rst:321 +msgid "Path to ``pkg-config`` utility." +msgstr "" + +#: ../../using/configure.rst:326 #, fuzzy msgid "``pkg-config`` options." msgstr "設定選項" -#: ../../using/configure.rst:317 +#: ../../using/configure.rst:330 #, fuzzy msgid "C compiler options" msgstr "C 編譯器指令。" -#: ../../using/configure.rst:321 ../../using/configure.rst:1228 +#: ../../using/configure.rst:334 ../../using/configure.rst:1241 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:325 ../../using/configure.rst:1240 +#: ../../using/configure.rst:338 ../../using/configure.rst:1253 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:342 #, fuzzy msgid "C preprocessor command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:333 +#: ../../using/configure.rst:346 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." msgstr "" -#: ../../using/configure.rst:337 ../../using/configure.rst:779 +#: ../../using/configure.rst:350 ../../using/configure.rst:792 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:354 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:345 +#: ../../using/configure.rst:358 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:349 +#: ../../using/configure.rst:362 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:353 +#: ../../using/configure.rst:366 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:360 +#: ../../using/configure.rst:373 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:379 msgid "" "C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" "mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:385 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:390 msgid "" "C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 `), " "used by :mod:`hashlib` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:383 +#: ../../using/configure.rst:396 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:389 +#: ../../using/configure.rst:402 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:395 +#: ../../using/configure.rst:408 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:400 +#: ../../using/configure.rst:413 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:406 +#: ../../using/configure.rst:419 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:412 +#: ../../using/configure.rst:425 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:431 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:437 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:430 +#: ../../using/configure.rst:443 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:432 +#: ../../using/configure.rst:445 msgid "" "C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" "`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:438 +#: ../../using/configure.rst:451 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:456 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:461 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:452 +#: ../../using/configure.rst:465 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:454 +#: ../../using/configure.rst:467 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:455 +#: ../../using/configure.rst:468 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:461 +#: ../../using/configure.rst:474 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:476 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:470 +#: ../../using/configure.rst:483 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:489 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:493 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:496 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:485 +#: ../../using/configure.rst:498 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:490 +#: ../../using/configure.rst:503 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:492 +#: ../../using/configure.rst:505 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:509 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:503 +#: ../../using/configure.rst:516 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:505 +#: ../../using/configure.rst:518 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -773,45 +803,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:507 +#: ../../using/configure.rst:520 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:508 +#: ../../using/configure.rst:521 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:514 +#: ../../using/configure.rst:527 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:516 +#: ../../using/configure.rst:529 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:522 +#: ../../using/configure.rst:535 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:525 +#: ../../using/configure.rst:538 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:528 +#: ../../using/configure.rst:541 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:534 +#: ../../using/configure.rst:547 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -820,58 +850,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:556 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:548 +#: ../../using/configure.rst:561 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:564 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:555 +#: ../../using/configure.rst:568 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:573 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:562 +#: ../../using/configure.rst:575 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:567 +#: ../../using/configure.rst:580 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:570 +#: ../../using/configure.rst:583 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:588 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:579 +#: ../../using/configure.rst:592 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:596 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -882,7 +912,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:591 +#: ../../using/configure.rst:604 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -890,116 +920,116 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:600 +#: ../../using/configure.rst:613 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary `_." msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:620 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:626 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:618 +#: ../../using/configure.rst:631 msgid "" "Disable the fast :ref:`mimalloc ` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:621 ../../using/configure.rst:628 +#: ../../using/configure.rst:634 ../../using/configure.rst:641 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:638 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:645 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:635 +#: ../../using/configure.rst:648 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:650 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:641 +#: ../../using/configure.rst:654 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:645 +#: ../../using/configure.rst:658 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:652 +#: ../../using/configure.rst:665 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:667 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:657 +#: ../../using/configure.rst:670 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:659 +#: ../../using/configure.rst:672 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:661 +#: ../../using/configure.rst:674 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:675 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:663 +#: ../../using/configure.rst:676 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:664 +#: ../../using/configure.rst:677 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:666 +#: ../../using/configure.rst:679 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:668 +#: ../../using/configure.rst:681 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:683 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:671 +#: ../../using/configure.rst:684 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1007,387 +1037,388 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:689 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:677 +#: ../../using/configure.rst:690 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:692 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:681 +#: ../../using/configure.rst:694 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:695 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:697 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:687 +#: ../../using/configure.rst:700 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:690 +#: ../../using/configure.rst:703 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 :" "option:`--with-trace-refs` option)." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:710 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:701 +#: ../../using/configure.rst:714 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:706 +#: ../../using/configure.rst:719 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:723 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:711 -msgid "Add :func:`!sys.getobjects` function." +#: ../../using/configure.rst:724 +#, fuzzy +msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`!sys.getobjects` 函式。" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:725 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:727 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:730 msgid ":ref:`Statically allocated objects ` are not traced." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:734 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "`." msgstr "" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:740 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:743 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:733 +#: ../../using/configure.rst:746 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:753 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:744 +#: ../../using/configure.rst:757 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:759 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:766 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:772 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:765 +#: ../../using/configure.rst:778 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:785 #, fuzzy msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:796 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:787 +#: ../../using/configure.rst:800 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:794 +#: ../../using/configure.rst:807 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:811 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:815 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:820 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" -#: ../../using/configure.rst:812 +#: ../../using/configure.rst:825 msgid "Default to using the installed ``mpdecimal`` library." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:828 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.15." msgstr "" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:832 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." msgstr "" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:836 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:825 +#: ../../using/configure.rst:838 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:826 +#: ../../using/configure.rst:839 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:845 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:834 +#: ../../using/configure.rst:847 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:840 +#: ../../using/configure.rst:853 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:857 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:861 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:867 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:856 +#: ../../using/configure.rst:869 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:857 +#: ../../using/configure.rst:870 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:859 +#: ../../using/configure.rst:872 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:865 +#: ../../using/configure.rst:878 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:869 +#: ../../using/configure.rst:882 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:871 +#: ../../using/configure.rst:884 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:872 +#: ../../using/configure.rst:885 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:873 +#: ../../using/configure.rst:886 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:877 +#: ../../using/configure.rst:890 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:895 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:897 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:898 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:899 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:887 +#: ../../using/configure.rst:900 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:888 +#: ../../using/configure.rst:901 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:902 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:895 +#: ../../using/configure.rst:908 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:897 +#: ../../using/configure.rst:910 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:911 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:912 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:914 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:920 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:911 +#: ../../using/configure.rst:924 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:926 #, fuzzy msgid "See :source:`Mac/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:931 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:924 +#: ../../using/configure.rst:937 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:942 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:932 +#: ../../using/configure.rst:945 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:947 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:935 +#: ../../using/configure.rst:948 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:936 +#: ../../using/configure.rst:949 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:950 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:951 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:952 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:953 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:941 +#: ../../using/configure.rst:954 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:958 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:964 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1396,31 +1427,31 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:960 +#: ../../using/configure.rst:973 #, fuzzy msgid "iOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:962 +#: ../../using/configure.rst:975 #, fuzzy msgid "See :source:`iOS/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:979 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:971 +#: ../../using/configure.rst:984 msgid "Specify the name for the framework (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:975 +#: ../../using/configure.rst:988 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:990 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 " @@ -1428,28 +1459,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:997 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:1001 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:1005 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:998 +#: ../../using/configure.rst:1011 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1013 msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:1002 +#: ../../using/configure.rst:1015 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1461,15 +1492,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1024 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1016 +#: ../../using/configure.rst:1029 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1018 +#: ../../using/configure.rst:1031 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1481,64 +1512,64 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1025 +#: ../../using/configure.rst:1038 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:1028 +#: ../../using/configure.rst:1041 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:1030 +#: ../../using/configure.rst:1043 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:1031 +#: ../../using/configure.rst:1044 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:1032 +#: ../../using/configure.rst:1045 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:1033 +#: ../../using/configure.rst:1046 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1037 +#: ../../using/configure.rst:1050 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1039 +#: ../../using/configure.rst:1052 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:1040 +#: ../../using/configure.rst:1053 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1041 +#: ../../using/configure.rst:1054 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1043 +#: ../../using/configure.rst:1056 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1046 +#: ../../using/configure.rst:1059 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1049 +#: ../../using/configure.rst:1062 msgid "make" msgstr "" -#: ../../using/configure.rst:1051 +#: ../../using/configure.rst:1064 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1549,20 +1580,20 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1060 +#: ../../using/configure.rst:1073 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "" -#: ../../using/configure.rst:1061 +#: ../../using/configure.rst:1074 msgid "``build_wasm`` (configured with ``--with-emscripten-target``)" msgstr "" -#: ../../using/configure.rst:1062 +#: ../../using/configure.rst:1075 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "" -#: ../../using/configure.rst:1064 +#: ../../using/configure.rst:1077 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1575,11 +1606,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1077 +#: ../../using/configure.rst:1090 msgid "make platform" msgstr "" -#: ../../using/configure.rst:1079 +#: ../../using/configure.rst:1092 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1587,82 +1618,82 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1086 +#: ../../using/configure.rst:1099 msgid "make profile-opt" msgstr "" -#: ../../using/configure.rst:1088 +#: ../../using/configure.rst:1101 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1096 +#: ../../using/configure.rst:1109 msgid "make clean" msgstr "" -#: ../../using/configure.rst:1098 +#: ../../using/configure.rst:1111 msgid "Remove built files." msgstr "" -#: ../../using/configure.rst:1102 +#: ../../using/configure.rst:1115 msgid "make distclean" msgstr "" -#: ../../using/configure.rst:1104 +#: ../../using/configure.rst:1117 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1110 +#: ../../using/configure.rst:1123 msgid "make install" msgstr "" -#: ../../using/configure.rst:1112 +#: ../../using/configure.rst:1125 msgid "Build the ``all`` target and install Python." msgstr "" -#: ../../using/configure.rst:1116 +#: ../../using/configure.rst:1129 msgid "make test" msgstr "" -#: ../../using/configure.rst:1118 +#: ../../using/configure.rst:1131 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option. Variables:" msgstr "" -#: ../../using/configure.rst:1121 +#: ../../using/configure.rst:1134 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "" -#: ../../using/configure.rst:1122 +#: ../../using/configure.rst:1135 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "" -#: ../../using/configure.rst:1123 +#: ../../using/configure.rst:1136 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "" -#: ../../using/configure.rst:1127 +#: ../../using/configure.rst:1140 #, fuzzy msgid "make buildbottest" msgstr "主要建置步驟" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1142 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1134 +#: ../../using/configure.rst:1147 msgid "make regen-all" msgstr "" -#: ../../using/configure.rst:1136 +#: ../../using/configure.rst:1149 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1670,18 +1701,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1143 +#: ../../using/configure.rst:1156 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1145 +#: ../../using/configure.rst:1158 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:1149 +#: ../../using/configure.rst:1162 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1692,14 +1723,14 @@ msgid "" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" -#: ../../using/configure.rst:1159 +#: ../../using/configure.rst:1172 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:1163 +#: ../../using/configure.rst:1176 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -1715,7 +1746,7 @@ msgstr "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1171 +#: ../../using/configure.rst:1184 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-" @@ -1723,304 +1754,304 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1175 +#: ../../using/configure.rst:1188 msgid "" "The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:1179 +#: ../../using/configure.rst:1192 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1180 +#: ../../using/configure.rst:1193 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1182 +#: ../../using/configure.rst:1195 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1188 +#: ../../using/configure.rst:1201 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1190 +#: ../../using/configure.rst:1203 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1194 +#: ../../using/configure.rst:1207 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:1198 +#: ../../using/configure.rst:1211 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1204 +#: ../../using/configure.rst:1217 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1207 ../../using/configure.rst:1397 +#: ../../using/configure.rst:1220 ../../using/configure.rst:1410 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:1217 +#: ../../using/configure.rst:1230 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1219 +#: ../../using/configure.rst:1232 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1224 +#: ../../using/configure.rst:1237 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1243 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:1234 +#: ../../using/configure.rst:1247 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1236 +#: ../../using/configure.rst:1249 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1244 +#: ../../using/configure.rst:1257 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 :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1248 +#: ../../using/configure.rst:1261 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1250 +#: ../../using/configure.rst:1263 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:1255 +#: ../../using/configure.rst:1268 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1263 +#: ../../using/configure.rst:1276 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1270 +#: ../../using/configure.rst:1283 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1274 +#: ../../using/configure.rst:1287 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1281 +#: ../../using/configure.rst:1294 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1288 +#: ../../using/configure.rst:1301 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1292 +#: ../../using/configure.rst:1305 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1296 +#: ../../using/configure.rst:1309 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1302 +#: ../../using/configure.rst:1315 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:1304 +#: ../../using/configure.rst:1317 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1308 +#: ../../using/configure.rst:1321 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1310 +#: ../../using/configure.rst:1323 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:1315 +#: ../../using/configure.rst:1328 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:1319 +#: ../../using/configure.rst:1332 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:1325 +#: ../../using/configure.rst:1338 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1327 +#: ../../using/configure.rst:1340 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:1333 +#: ../../using/configure.rst:1346 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:1339 +#: ../../using/configure.rst:1352 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1342 +#: ../../using/configure.rst:1355 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:1348 +#: ../../using/configure.rst:1361 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1350 +#: ../../using/configure.rst:1363 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:1354 +#: ../../using/configure.rst:1367 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1358 +#: ../../using/configure.rst:1371 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1360 +#: ../../using/configure.rst:1373 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:1364 +#: ../../using/configure.rst:1377 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1366 +#: ../../using/configure.rst:1379 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:1374 +#: ../../using/configure.rst:1387 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 :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1378 +#: ../../using/configure.rst:1391 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1380 +#: ../../using/configure.rst:1393 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:1387 +#: ../../using/configure.rst:1400 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1394 +#: ../../using/configure.rst:1407 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1403 +#: ../../using/configure.rst:1416 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1406 +#: ../../using/configure.rst:1419 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1410 +#: ../../using/configure.rst:1423 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1412 +#: ../../using/configure.rst:1425 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1416 +#: ../../using/configure.rst:1429 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1418 +#: ../../using/configure.rst:1431 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1422 +#: ../../using/configure.rst:1435 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1426 +#: ../../using/configure.rst:1439 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1432 +#: ../../using/configure.rst:1445 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1438 +#: ../../using/configure.rst:1451 msgid "Footnotes" msgstr "" -#: ../../using/configure.rst:1439 +#: ../../using/configure.rst:1452 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " diff --git a/using/windows.po b/using/windows.po index aa86476b0e..9dcb3913a0 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -895,7 +895,7 @@ msgid "" "For more detail on the technical basis for these limitations, please consult " "Microsoft's documentation on packaged full-trust apps, currently available " "at `docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-" -"scenes `_" msgstr "" @@ -1027,7 +1027,7 @@ msgstr "" #: ../../using/windows.rst:537 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_ and it is the responsibility of the " "application installer to provide this. The runtime may have already been " "installed on a user's system previously or automatically via Windows Update, " @@ -1257,9 +1257,9 @@ msgid "" msgstr "" #: ../../using/windows.rst:681 +#, fuzzy msgid "" -"https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" -"variables" +"https://learn.microsoft.com/windows/win32/procthread/environment-variables" msgstr "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" @@ -1269,9 +1269,10 @@ msgid "Overview of environment variables on Windows" msgstr "Windows 上的環境變數概要" #: ../../using/windows.rst:684 +#, fuzzy msgid "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/set_1" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"set_1" msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" @@ -1281,9 +1282,10 @@ msgid "The ``set`` command, for temporarily modifying environment variables" msgstr "" #: ../../using/windows.rst:687 +#, fuzzy msgid "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/setx" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"setx" msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" @@ -2271,7 +2273,7 @@ msgstr "" #: ../../using/windows.rst:1292 msgid "" -"`Component Object Model `_ (COM)" msgstr "" @@ -2289,7 +2291,7 @@ msgstr "事件日誌(Event log)" #: ../../using/windows.rst:1298 msgid "" -"`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index c611afa660..8e5ee538ea 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -265,7 +265,7 @@ msgstr "" "`unittest.TestCase` 的\\ `方法別名 `_\\ " "已被刪除。" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1826 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1832 msgid "New Features" msgstr "新增特性" @@ -1251,7 +1251,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1536 msgid "sqlite3" msgstr "sqlite3" @@ -1326,7 +1326,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1731 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " @@ -1498,7 +1498,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1576 msgid "unittest" msgstr "unittest" @@ -1706,12 +1706,12 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2128 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2134 msgid "Deprecated" msgstr "已棄用" #: ../../whatsnew/3.12.rst:1145 -#: ../../deprecations/pending-removal-in-3.14.rst:11 +#: ../../deprecations/pending-removal-in-3.14.rst:4 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -1730,32 +1730,32 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1154 -#: ../../deprecations/pending-removal-in-3.14.rst:20 +#: ../../deprecations/pending-removal-in-3.14.rst:13 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" #: ../../whatsnew/3.12.rst:1155 -#: ../../deprecations/pending-removal-in-3.14.rst:21 +#: ../../deprecations/pending-removal-in-3.14.rst:14 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" #: ../../whatsnew/3.12.rst:1156 -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:15 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" #: ../../whatsnew/3.12.rst:1157 -#: ../../deprecations/pending-removal-in-3.14.rst:23 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" #: ../../whatsnew/3.12.rst:1158 -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:17 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1160 -#: ../../deprecations/pending-removal-in-3.14.rst:26 +#: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" @@ -1763,7 +1763,8 @@ msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" #: ../../whatsnew/3.12.rst:1163 -#: ../../deprecations/pending-removal-in-3.14.rst:29 +#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" @@ -1776,7 +1777,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1171 -#: ../../deprecations/pending-removal-in-3.14.rst:37 +#: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1789,7 +1790,7 @@ msgstr "" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1177 -#: ../../deprecations/pending-removal-in-3.14.rst:43 +#: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1844,37 +1845,37 @@ msgid "" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" #: ../../whatsnew/3.12.rst:1205 -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1206 -#: ../../deprecations/pending-removal-in-3.14.rst:60 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1207 -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1209 -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" #: ../../whatsnew/3.12.rst:1211 -#: ../../deprecations/pending-removal-in-3.14.rst:65 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1212 -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1214 -#: ../../deprecations/pending-removal-in-3.14.rst:68 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" @@ -1958,7 +1959,7 @@ msgstr "" "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1267 -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" @@ -1994,7 +1995,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2058,12 +2059,17 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1328 +#, fuzzy msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " "Python 3.10 via :pep:`626`, but it only got a proper :exc:" -"`DeprecationWarning` in 3.12, therefore it will be removed in 3.14. " -"(Contributed by Nikita Sobolev in :gh:`101866`.)" +"`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita " +"Sobolev in :gh:`101866`.)" msgstr "" +":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.13.rst:2 msgid "Pending Removal in Python 3.13" @@ -2244,20 +2250,7 @@ msgstr "" msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.14.rst:4 -#: ../../deprecations/pending-removal-in-3.15.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:9 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -2266,7 +2259,7 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:31 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2278,7 +2271,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:48 +#: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2290,7 +2283,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -2298,11 +2291,11 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:70 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2313,7 +2306,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:76 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2330,7 +2323,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -2338,7 +2331,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -2348,23 +2341,23 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:100 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -2374,27 +2367,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:106 -msgid "" -"date and datetime adapter, date and timestamp converter: see the :mod:" -"`sqlite3` documentation for suggested replacement recipes." -msgstr "" -"date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" -"參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" - -#: ../../deprecations/pending-removal-in-3.14.rst:109 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" -":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:116 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -2402,7 +2375,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:119 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -2416,6 +2389,11 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" +#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid "The import system:" +msgstr "" + #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" "Setting :attr:`~module.__cached__` on a module while failing to set :attr:" @@ -2523,9 +2501,27 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" +#: ../../deprecations/pending-removal-in-3.15.rst:62 +#, fuzzy +msgid ":mod:`types`:" +msgstr ":mod:`pty`:" + #: ../../deprecations/pending-removal-in-3.15.rst:64 #, fuzzy msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" +":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.15.rst:73 +#, fuzzy +msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " "has been deprecated since Python 3.13. Use the class-based syntax or the " @@ -2535,19 +2531,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:70 +#: ../../deprecations/pending-removal-in-3.15.rst:79 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:84 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:86 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -2559,29 +2555,27 @@ msgstr "" "3.15 中被移除。 (由 Victor Stinner 於 :gh:`105096` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +#, fuzzy +msgid "Pending removal in Python 3.16" msgstr "Python 3.16 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.16.rst:4 -#: ../../deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr ":mod:`builtins`:" - #: ../../deprecations/pending-removal-in-3.16.rst:6 +#, fuzzy msgid "" -"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " -"deprecated since Python 3.12, as it produces surprising and unintuitive " -"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " -"of a Boolean. In the rare case that you need the bitwise inversion of the " -"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" +":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " +"系統考慮。 (:gh:`97879`)" -#: ../../deprecations/pending-removal-in-3.16.rst:13 +#: ../../deprecations/pending-removal-in-3.16.rst:11 #, fuzzy msgid ":mod:`array`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.16.rst:15 +#: ../../deprecations/pending-removal-in-3.16.rst:13 msgid "" "The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " "documentation since Python 3.3 and at runtime since Python 3.13. Use the " @@ -2589,46 +2583,67 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:26 +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-3.16.rst:28 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:35 #, fuzzy msgid ":mod:`shutil`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.16.rst:23 +#: ../../deprecations/pending-removal-in-3.16.rst:37 msgid "" "The :class:`!ExecError` exception has been deprecated since Python 3.14. It " "has not been used by any function in :mod:`!shutil` since Python 3.4, and is " "now an alias of :exc:`RuntimeError`." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:28 +#: ../../deprecations/pending-removal-in-3.16.rst:42 #, fuzzy msgid ":mod:`symtable`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.16.rst:30 +#: ../../deprecations/pending-removal-in-3.16.rst:44 msgid "" "The :meth:`Class.get_methods ` method has been " "deprecated since Python 3.14." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:33 +#: ../../deprecations/pending-removal-in-3.16.rst:47 #, fuzzy msgid ":mod:`sys`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.16.rst:35 +#: ../../deprecations/pending-removal-in-3.16.rst:49 msgid "" "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " "since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:39 +#: ../../deprecations/pending-removal-in-3.16.rst:53 #, fuzzy msgid ":mod:`tarfile`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.16.rst:41 +#: ../../deprecations/pending-removal-in-3.16.rst:55 msgid "" "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " "deprecated since Python 3.13." @@ -3039,32 +3054,32 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.12.rst:1345 ../../whatsnew/3.12.rst:2223 +#: ../../whatsnew/3.12.rst:1347 ../../whatsnew/3.12.rst:2229 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1350 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1352 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1359 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1361 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1364 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." @@ -3072,23 +3087,23 @@ msgstr "" ":class:`configparser.ParsingError` 不再具有 ``filename`` 屬性或引數。請改用 " "``source`` 屬性和引數。" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1366 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1368 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1374 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1372 +#: ../../whatsnew/3.12.rst:1376 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -3097,17 +3112,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1383 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1385 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1388 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -3115,7 +3130,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1394 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3125,25 +3140,25 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1401 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1404 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1406 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1411 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1413 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" @@ -3151,11 +3166,11 @@ msgstr "" "移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" "數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1418 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1420 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -3164,11 +3179,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1427 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1429 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -3177,17 +3192,17 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1465 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1438 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "現已完成清理 :mod:`importlib` 中許多過去已經棄用的東西:" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1441 msgid "" "References to, and support for :meth:`!module_repr` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" @@ -3195,134 +3210,134 @@ msgstr "" "對 :meth:`!module_repr` 的參照和支援已刪除。(由 Barry Warsaw 在 :gh:`97850` " "中貢獻。)" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1444 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1448 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1451 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1451 ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1457 ../../whatsnew/3.12.rst:1465 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1459 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1462 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1467 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1467 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1468 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1468 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1469 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1469 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1470 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1470 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1471 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1471 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1472 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1472 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1473 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1473 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1474 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1474 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1475 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1475 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1476 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1476 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1477 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1477 msgid "*See below*" msgstr "*見下文*" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1480 msgid "Replace ``imp.load_source()`` with::" msgstr "用以下取代 ``imp.load_source()``: ::" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1482 msgid "" "import importlib.util\n" "import importlib.machinery\n" @@ -3339,37 +3354,37 @@ msgid "" " return module" msgstr "" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1495 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "移除 :mod:`!imp` 函式和屬性、沒有替代方案:" -#: ../../whatsnew/3.12.rst:1491 +#: ../../whatsnew/3.12.rst:1497 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1493 +#: ../../whatsnew/3.12.rst:1499 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1500 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1501 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1496 +#: ../../whatsnew/3.12.rst:1502 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1504 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1500 +#: ../../whatsnew/3.12.rst:1506 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " @@ -3379,11 +3394,11 @@ msgstr "" "``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" "``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1511 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1513 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -3392,22 +3407,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1520 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1522 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1527 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1529 msgid "" "The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:" @@ -3415,27 +3430,27 @@ msgid "" "(Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1538 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1535 +#: ../../whatsnew/3.12.rst:1541 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1542 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1544 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1541 +#: ../../whatsnew/3.12.rst:1547 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -3443,22 +3458,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1552 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1549 +#: ../../whatsnew/3.12.rst:1555 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1557 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1555 +#: ../../whatsnew/3.12.rst:1561 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -3466,7 +3481,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1567 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -3477,189 +3492,189 @@ msgid "" "`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1578 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1582 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "許多 :class:`~unittest.TestCase` 方法別名:" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Deprecated in" msgstr "已棄用於" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1587 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1594 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1582 -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1584 -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1586 -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1588 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1588 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1589 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1595 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1590 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1596 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1591 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1597 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1592 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1598 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1593 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1593 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1594 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1588 ../../whatsnew/3.12.rst:1589 -#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1591 -#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1593 -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1594 ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1596 ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1598 ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1600 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1595 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1596 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1597 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1598 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1599 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1599 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1600 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1600 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1604 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1607 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1610 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.5)." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1614 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1617 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1620 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1622 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1627 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1623 +#: ../../whatsnew/3.12.rst:1629 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -3668,22 +3683,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1636 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1638 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1644 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1640 +#: ../../whatsnew/3.12.rst:1646 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -3983,15 +3998,15 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1842 msgid "Code object constructors:" msgstr "程式碼物件建構函式:" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:1844 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 重新命名)" -#: ../../whatsnew/3.12.rst:1839 +#: ../../whatsnew/3.12.rst:1845 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" @@ -3999,11 +4014,11 @@ msgstr "" "``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " "``PyCode_NewWithPosOnlyArgs`` 重新命名)" -#: ../../whatsnew/3.12.rst:1841 +#: ../../whatsnew/3.12.rst:1847 msgid "Extra storage for code objects (:pep:`523`):" msgstr "程式碼物件的額外儲存 (:pep:`523`):" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1849 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" @@ -4011,31 +4026,31 @@ msgstr "" "``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " "``_PyEval_RequestCodeExtraIndex`` 重新命名)" -#: ../../whatsnew/3.12.rst:1844 +#: ../../whatsnew/3.12.rst:1850 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1845 +#: ../../whatsnew/3.12.rst:1851 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:1853 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "原始名稱將可繼續使用,直到相應的 API 發生變更。" -#: ../../whatsnew/3.12.rst:1850 +#: ../../whatsnew/3.12.rst:1856 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1858 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:1861 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." @@ -4043,30 +4058,30 @@ msgstr "" ":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" "小。" -#: ../../whatsnew/3.12.rst:1857 +#: ../../whatsnew/3.12.rst:1863 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:1865 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1862 +#: ../../whatsnew/3.12.rst:1868 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1865 +#: ../../whatsnew/3.12.rst:1871 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1867 +#: ../../whatsnew/3.12.rst:1873 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -4074,29 +4089,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:1878 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1882 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1883 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1884 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1885 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1887 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -4107,7 +4122,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1895 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -4115,32 +4130,32 @@ msgid "" "bookkeeping, using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1900 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1904 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1905 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1906 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1902 +#: ../../whatsnew/3.12.rst:1908 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1906 +#: ../../whatsnew/3.12.rst:1912 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -4148,14 +4163,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1912 +#: ../../whatsnew/3.12.rst:1918 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1922 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -4164,28 +4179,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1922 +#: ../../whatsnew/3.12.rst:1928 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1926 +#: ../../whatsnew/3.12.rst:1932 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1931 +#: ../../whatsnew/3.12.rst:1937 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:1941 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -4195,14 +4210,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1949 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1947 +#: ../../whatsnew/3.12.rst:1953 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -4210,71 +4225,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1958 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1967 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1968 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1969 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1970 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "``PyObject_HEAD_INIT`` 這現在將初始化參照計數" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1971 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1972 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1973 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1974 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1975 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1976 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1977 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:1980 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1982 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -4282,27 +4297,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1988 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:1996 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:1999 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2003 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -4311,7 +4326,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2010 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -4319,13 +4334,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2009 +#: ../../whatsnew/3.12.rst:2015 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2019 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -4334,7 +4349,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2019 +#: ../../whatsnew/3.12.rst:2025 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -4343,13 +4358,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2031 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2029 +#: ../../whatsnew/3.12.rst:2035 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " "reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -4363,7 +4378,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2041 +#: ../../whatsnew/3.12.rst:2047 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -4371,7 +4386,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2052 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -4379,7 +4394,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2057 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -4387,7 +4402,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2062 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -4395,25 +4410,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2067 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2070 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2071 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2066 +#: ../../whatsnew/3.12.rst:2072 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2068 +#: ../../whatsnew/3.12.rst:2074 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -4421,14 +4436,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2079 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2077 +#: ../../whatsnew/3.12.rst:2083 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -4437,17 +4452,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2090 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2086 +#: ../../whatsnew/3.12.rst:2092 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2094 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -4455,20 +4470,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2093 +#: ../../whatsnew/3.12.rst:2099 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2097 +#: ../../whatsnew/3.12.rst:2103 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2106 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -4476,14 +4491,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2105 +#: ../../whatsnew/3.12.rst:2111 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2109 +#: ../../whatsnew/3.12.rst:2115 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4494,15 +4509,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2117 +#: ../../whatsnew/3.12.rst:2123 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2118 +#: ../../whatsnew/3.12.rst:2124 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2126 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -4511,7 +4526,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2136 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -4520,76 +4535,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2141 msgid "Deprecate global configuration variable:" msgstr "棄用全域配置變數:" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2143 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2138 +#: ../../whatsnew/3.12.rst:2144 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2145 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2140 +#: ../../whatsnew/3.12.rst:2146 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2141 +#: ../../whatsnew/3.12.rst:2147 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2148 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2143 +#: ../../whatsnew/3.12.rst:2149 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2144 +#: ../../whatsnew/3.12.rst:2150 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2151 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2146 +#: ../../whatsnew/3.12.rst:2152 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2147 +#: ../../whatsnew/3.12.rst:2153 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2148 +#: ../../whatsnew/3.12.rst:2154 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2149 +#: ../../whatsnew/3.12.rst:2155 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2150 +#: ../../whatsnew/3.12.rst:2156 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -4597,11 +4612,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2158 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2153 +#: ../../whatsnew/3.12.rst:2159 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -4609,7 +4624,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2154 +#: ../../whatsnew/3.12.rst:2160 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -4617,7 +4632,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2161 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4625,7 +4640,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2162 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4633,7 +4648,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2163 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -4641,7 +4656,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2158 +#: ../../whatsnew/3.12.rst:2164 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -4649,7 +4664,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2160 +#: ../../whatsnew/3.12.rst:2166 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -4657,25 +4672,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2170 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2167 +#: ../../whatsnew/3.12.rst:2173 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2170 +#: ../../whatsnew/3.12.rst:2176 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2173 +#: ../../whatsnew/3.12.rst:2179 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -4683,13 +4698,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2175 +#: ../../whatsnew/3.12.rst:2181 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2183 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -4697,23 +4712,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2180 +#: ../../whatsnew/3.12.rst:2186 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2188 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2183 +#: ../../whatsnew/3.12.rst:2189 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2190 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2185 +#: ../../whatsnew/3.12.rst:2191 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -4721,33 +4736,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2187 +#: ../../whatsnew/3.12.rst:2193 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2190 +#: ../../whatsnew/3.12.rst:2196 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2195 +#: ../../whatsnew/3.12.rst:2201 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2198 +#: ../../whatsnew/3.12.rst:2204 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2203 +#: ../../whatsnew/3.12.rst:2209 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -4755,7 +4770,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2206 +#: ../../whatsnew/3.12.rst:2212 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -4763,7 +4778,7 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2215 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" @@ -5211,54 +5226,54 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.12.rst:2225 +#: ../../whatsnew/3.12.rst:2231 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2230 +#: ../../whatsnew/3.12.rst:2236 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2232 +#: ../../whatsnew/3.12.rst:2238 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:2239 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2234 +#: ../../whatsnew/3.12.rst:2240 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2241 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2236 +#: ../../whatsnew/3.12.rst:2242 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2237 +#: ../../whatsnew/3.12.rst:2243 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2238 +#: ../../whatsnew/3.12.rst:2244 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2239 +#: ../../whatsnew/3.12.rst:2245 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2240 +#: ../../whatsnew/3.12.rst:2246 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2242 +#: ../../whatsnew/3.12.rst:2248 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" @@ -5266,6 +5281,13 @@ msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" "`85858` 中貢獻。)" +#~ msgid "" +#~ "date and datetime adapter, date and timestamp converter: see the :mod:" +#~ "`sqlite3` documentation for suggested replacement recipes." +#~ msgstr "" +#~ "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 " +#~ "(converter):請參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" + #~ msgid "" #~ ":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " #~ "removed in 3.15. It was largely untested, had a confusing API, and was " diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index cbbe75429d..4f21d99532 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -339,7 +339,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1968 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1970 msgid "New Features" msgstr "" @@ -1137,7 +1137,7 @@ msgstr "" msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1612 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1614 msgid "configparser" msgstr "" @@ -1596,7 +1596,7 @@ msgid "" "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1652 +#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1654 msgid "pathlib" msgstr "" @@ -1710,7 +1710,7 @@ msgid "" "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1660 +#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1662 msgid "re" msgstr "" @@ -1837,7 +1837,7 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1264 +#: ../../whatsnew/3.13.rst:1264 ../../whatsnew/3.13.rst:2717 msgid "sys" msgstr "" @@ -1987,7 +1987,7 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1685 +#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1687 msgid "typing" msgstr "" @@ -2285,60 +2285,62 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1569 -msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." +msgid "" +":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." +"quote` to replace the undocumented ``pipes.quote`` function." msgstr "" -#: ../../whatsnew/3.13.rst:1571 +#: ../../whatsnew/3.13.rst:1573 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1574 +#: ../../whatsnew/3.13.rst:1576 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1578 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1577 +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1581 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1581 +#: ../../whatsnew/3.13.rst:1583 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1585 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1587 +#: ../../whatsnew/3.13.rst:1589 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1589 +#: ../../whatsnew/3.13.rst:1591 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1595 +#: ../../whatsnew/3.13.rst:1597 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1597 +#: ../../whatsnew/3.13.rst:1599 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2348,47 +2350,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1606 +#: ../../whatsnew/3.13.rst:1608 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1614 +#: ../../whatsnew/3.13.rst:1616 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1621 +#: ../../whatsnew/3.13.rst:1623 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1623 +#: ../../whatsnew/3.13.rst:1625 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1629 +#: ../../whatsnew/3.13.rst:1631 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1631 +#: ../../whatsnew/3.13.rst:1633 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1637 +#: ../../whatsnew/3.13.rst:1639 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1639 +#: ../../whatsnew/3.13.rst:1641 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2396,7 +2398,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1644 +#: ../../whatsnew/3.13.rst:1646 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2404,43 +2406,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1654 +#: ../../whatsnew/3.13.rst:1656 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1662 +#: ../../whatsnew/3.13.rst:1664 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1668 +#: ../../whatsnew/3.13.rst:1670 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1670 +#: ../../whatsnew/3.13.rst:1672 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1676 +#: ../../whatsnew/3.13.rst:1678 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1678 +#: ../../whatsnew/3.13.rst:1680 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1687 +#: ../../whatsnew/3.13.rst:1689 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2448,66 +2450,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1693 +#: ../../whatsnew/3.13.rst:1695 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1699 +#: ../../whatsnew/3.13.rst:1701 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1703 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1705 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1704 +#: ../../whatsnew/3.13.rst:1706 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1707 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1709 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1709 +#: ../../whatsnew/3.13.rst:1711 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1710 +#: ../../whatsnew/3.13.rst:1712 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1711 +#: ../../whatsnew/3.13.rst:1713 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1713 +#: ../../whatsnew/3.13.rst:1715 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1715 +#: ../../whatsnew/3.13.rst:1717 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1721 +#: ../../whatsnew/3.13.rst:1723 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1723 +#: ../../whatsnew/3.13.rst:1725 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2518,33 +2520,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1734 +#: ../../whatsnew/3.13.rst:1736 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1738 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1741 +#: ../../whatsnew/3.13.rst:1743 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1750 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1750 +#: ../../whatsnew/3.13.rst:1752 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1752 +#: ../../whatsnew/3.13.rst:1754 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2552,12 +2554,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1758 -#: ../../deprecations/pending-removal-in-3.16.rst:13 +#: ../../whatsnew/3.13.rst:1760 +#: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1760 +#: ../../whatsnew/3.13.rst:1762 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2566,50 +2568,50 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1767 +#: ../../whatsnew/3.13.rst:1769 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1771 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1775 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1777 +#: ../../whatsnew/3.13.rst:1779 msgid ":mod:`decimal`:" msgstr "" -#: ../../whatsnew/3.13.rst:1779 +#: ../../whatsnew/3.13.rst:1781 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1784 +#: ../../whatsnew/3.13.rst:1786 msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1786 +#: ../../whatsnew/3.13.rst:1788 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1790 +#: ../../whatsnew/3.13.rst:1792 msgid ":mod:`getopt` and :mod:`optparse`:" msgstr "" -#: ../../whatsnew/3.13.rst:1792 +#: ../../whatsnew/3.13.rst:1794 msgid "" "Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " "for new projects. This is a new soft-deprecation for the :mod:`!getopt` " @@ -2617,22 +2619,22 @@ msgid "" "deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1798 +#: ../../whatsnew/3.13.rst:1800 msgid ":mod:`gettext`:" msgstr "" -#: ../../whatsnew/3.13.rst:1800 +#: ../../whatsnew/3.13.rst:1802 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1805 +#: ../../whatsnew/3.13.rst:1807 msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1807 +#: ../../whatsnew/3.13.rst:1809 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2640,12 +2642,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1812 +#: ../../whatsnew/3.13.rst:1814 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1814 +#: ../../whatsnew/3.13.rst:1816 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2654,29 +2656,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1821 +#: ../../whatsnew/3.13.rst:1823 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1826 +#: ../../whatsnew/3.13.rst:1828 msgid ":mod:`mimetypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1828 +#: ../../whatsnew/3.13.rst:1830 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1833 +#: ../../whatsnew/3.13.rst:1835 msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1835 +#: ../../whatsnew/3.13.rst:1837 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2685,46 +2687,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1842 +#: ../../whatsnew/3.13.rst:1844 #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1844 +#: ../../whatsnew/3.13.rst:1846 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1849 +#: ../../whatsnew/3.13.rst:1851 #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1851 +#: ../../whatsnew/3.13.rst:1853 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1857 +#: ../../whatsnew/3.13.rst:1859 msgid ":mod:`pydoc`:" msgstr "" -#: ../../whatsnew/3.13.rst:1859 +#: ../../whatsnew/3.13.rst:1861 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1862 -#: ../../deprecations/pending-removal-in-3.14.rst:98 +#: ../../whatsnew/3.13.rst:1864 +#: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1864 +#: ../../whatsnew/3.13.rst:1866 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2732,7 +2734,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1870 +#: ../../whatsnew/3.13.rst:1872 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2740,7 +2742,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1876 +#: ../../whatsnew/3.13.rst:1878 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2750,46 +2752,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1884 -#: ../../deprecations/pending-removal-in-3.16.rst:33 +#: ../../whatsnew/3.13.rst:1886 +#: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1886 +#: ../../whatsnew/3.13.rst:1888 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1891 -#: ../../deprecations/pending-removal-in-3.16.rst:39 +#: ../../whatsnew/3.13.rst:1893 +#: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1895 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1897 +#: ../../whatsnew/3.13.rst:1899 msgid ":mod:`traceback`:" msgstr "" -#: ../../whatsnew/3.13.rst:1899 +#: ../../whatsnew/3.13.rst:1901 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1903 -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../whatsnew/3.13.rst:1905 +#: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1905 +#: ../../whatsnew/3.13.rst:1907 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2797,7 +2799,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1912 +#: ../../whatsnew/3.13.rst:1914 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2809,7 +2811,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1922 +#: ../../whatsnew/3.13.rst:1924 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2817,7 +2819,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1928 +#: ../../whatsnew/3.13.rst:1930 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2826,12 +2828,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1936 -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../whatsnew/3.13.rst:1938 +#: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1938 +#: ../../whatsnew/3.13.rst:1940 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -2845,63 +2847,51 @@ msgid "Pending Removal in Python 3.14" msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:4 -#: ../../deprecations/pending-removal-in-3.15.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:9 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " "runtime when they are accessed or used, and will be removed in Python 3.14:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:20 +#: ../../deprecations/pending-removal-in-3.14.rst:13 msgid ":class:`!ast.Num`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:21 +#: ../../deprecations/pending-removal-in-3.14.rst:14 msgid ":class:`!ast.Str`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:15 msgid ":class:`!ast.Bytes`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:23 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid ":class:`!ast.NameConstant`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:17 msgid ":class:`!ast.Ellipsis`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:26 +#: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:29 +#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:31 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2909,7 +2899,7 @@ msgid "" "Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:37 +#: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -2917,7 +2907,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:43 +#: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -2925,7 +2915,7 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:48 +#: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2933,45 +2923,45 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:57 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid ":mod:`importlib.abc` deprecated classes:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:60 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:65 +#: ../../deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:66 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:68 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:70 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2979,7 +2969,7 @@ msgid "" "burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:76 +#: ../../deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2990,63 +2980,49 @@ msgid "" "``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:84 +#: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:96 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:100 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " "a sequence instead of a :class:`dict`." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:106 -msgid "" -"date and datetime adapter, date and timestamp converter: see the :mod:" -"`sqlite3` documentation for suggested replacement recipes." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:109 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:116 +#: ../../deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../deprecations/pending-removal-in-3.14.rst:119 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -3058,6 +3034,11 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "" +#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid "The import system:" +msgstr "" + #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" "Setting :attr:`~module.__cached__` on a module while failing to set :attr:" @@ -3131,22 +3112,34 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" +#: ../../deprecations/pending-removal-in-3.15.rst:62 +msgid ":mod:`types`:" +msgstr "" + #: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:73 +msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " "has been deprecated since Python 3.13. Use the class-based syntax or the " "functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:70 +#: ../../deprecations/pending-removal-in-3.15.rst:79 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:86 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3154,15 +3147,37 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +msgid "Pending removal in Python 3.16" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:4 +#: ../../deprecations/pending-removal-in-3.16.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:13 +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.16.rst:26 #: ../../deprecations/pending-removal-in-future.rst:12 msgid ":mod:`builtins`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:6 +#: ../../deprecations/pending-removal-in-3.16.rst:28 msgid "" "Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " "deprecated since Python 3.12, as it produces surprising and unintuitive " @@ -3171,42 +3186,35 @@ msgid "" "underlying integer, convert to ``int`` explicitly (``~int(x)``)." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:15 -msgid "" -"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " -"documentation since Python 3.3 and at runtime since Python 3.13. Use the " -"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:21 +#: ../../deprecations/pending-removal-in-3.16.rst:35 msgid ":mod:`shutil`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:23 +#: ../../deprecations/pending-removal-in-3.16.rst:37 msgid "" "The :class:`!ExecError` exception has been deprecated since Python 3.14. It " "has not been used by any function in :mod:`!shutil` since Python 3.4, and is " "now an alias of :exc:`RuntimeError`." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:28 +#: ../../deprecations/pending-removal-in-3.16.rst:42 msgid ":mod:`symtable`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:30 +#: ../../deprecations/pending-removal-in-3.16.rst:44 msgid "" "The :meth:`Class.get_methods ` method has been " "deprecated since Python 3.14." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:35 +#: ../../deprecations/pending-removal-in-3.16.rst:49 msgid "" "The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " "since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.16.rst:41 +#: ../../deprecations/pending-removal-in-3.16.rst:55 msgid "" "The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " "deprecated since Python 3.13." @@ -3572,11 +3580,11 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1955 +#: ../../whatsnew/3.13.rst:1957 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1957 +#: ../../whatsnew/3.13.rst:1959 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3585,97 +3593,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1965 +#: ../../whatsnew/3.13.rst:1967 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1970 +#: ../../whatsnew/3.13.rst:1972 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1975 msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:1976 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1977 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1976 +#: ../../whatsnew/3.13.rst:1978 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1979 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1978 +#: ../../whatsnew/3.13.rst:1980 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1981 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1980 +#: ../../whatsnew/3.13.rst:1982 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1983 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:1984 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1983 +#: ../../whatsnew/3.13.rst:1985 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1984 +#: ../../whatsnew/3.13.rst:1986 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:1987 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:1988 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:1989 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1988 +#: ../../whatsnew/3.13.rst:1990 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1989 +#: ../../whatsnew/3.13.rst:1991 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1990 +#: ../../whatsnew/3.13.rst:1992 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:1993 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1993 +#: ../../whatsnew/3.13.rst:1995 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:1995 +#: ../../whatsnew/3.13.rst:1997 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3683,52 +3691,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2003 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2008 msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2009 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2008 +#: ../../whatsnew/3.13.rst:2010 msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2009 +#: ../../whatsnew/3.13.rst:2011 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2012 msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:2013 msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2013 +#: ../../whatsnew/3.13.rst:2015 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2015 +#: ../../whatsnew/3.13.rst:2017 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3736,7 +3744,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2021 +#: ../../whatsnew/3.13.rst:2023 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3746,7 +3754,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2029 +#: ../../whatsnew/3.13.rst:2031 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3755,7 +3763,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2037 +#: ../../whatsnew/3.13.rst:2039 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3764,7 +3772,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2044 +#: ../../whatsnew/3.13.rst:2046 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3775,7 +3783,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2056 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3786,37 +3794,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2064 +#: ../../whatsnew/3.13.rst:2066 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2069 +#: ../../whatsnew/3.13.rst:2071 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2073 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2074 +#: ../../whatsnew/3.13.rst:2076 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2075 +#: ../../whatsnew/3.13.rst:2077 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2077 +#: ../../whatsnew/3.13.rst:2079 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2079 +#: ../../whatsnew/3.13.rst:2081 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -3825,7 +3833,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2088 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3833,35 +3841,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2093 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2096 +#: ../../whatsnew/3.13.rst:2098 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2101 +#: ../../whatsnew/3.13.rst:2103 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2105 +#: ../../whatsnew/3.13.rst:2107 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2110 +#: ../../whatsnew/3.13.rst:2112 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -3869,27 +3877,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2116 +#: ../../whatsnew/3.13.rst:2118 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2121 +#: ../../whatsnew/3.13.rst:2123 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2125 +#: ../../whatsnew/3.13.rst:2127 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2128 +#: ../../whatsnew/3.13.rst:2130 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -3898,7 +3906,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2136 +#: ../../whatsnew/3.13.rst:2138 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -3906,14 +3914,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2144 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2147 +#: ../../whatsnew/3.13.rst:2149 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -3921,7 +3929,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2155 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -3929,14 +3937,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2159 +#: ../../whatsnew/3.13.rst:2161 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2164 +#: ../../whatsnew/3.13.rst:2166 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -3945,7 +3953,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2171 +#: ../../whatsnew/3.13.rst:2173 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -3953,47 +3961,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2177 +#: ../../whatsnew/3.13.rst:2179 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2181 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2180 +#: ../../whatsnew/3.13.rst:2182 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2182 +#: ../../whatsnew/3.13.rst:2184 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2183 +#: ../../whatsnew/3.13.rst:2185 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2186 +#: ../../whatsnew/3.13.rst:2188 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2189 +#: ../../whatsnew/3.13.rst:2191 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2193 +#: ../../whatsnew/3.13.rst:2195 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2195 +#: ../../whatsnew/3.13.rst:2197 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4006,20 +4014,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2207 +#: ../../whatsnew/3.13.rst:2209 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2211 +#: ../../whatsnew/3.13.rst:2213 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2215 +#: ../../whatsnew/3.13.rst:2217 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4030,35 +4038,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2226 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2227 +#: ../../whatsnew/3.13.rst:2229 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2230 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2229 +#: ../../whatsnew/3.13.rst:2231 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2230 +#: ../../whatsnew/3.13.rst:2232 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2234 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2235 +#: ../../whatsnew/3.13.rst:2237 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4067,7 +4075,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2241 +#: ../../whatsnew/3.13.rst:2243 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4075,60 +4083,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2251 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2251 +#: ../../whatsnew/3.13.rst:2253 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2255 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2254 +#: ../../whatsnew/3.13.rst:2256 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2257 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2256 +#: ../../whatsnew/3.13.rst:2258 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2259 msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2260 msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2261 msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2261 +#: ../../whatsnew/3.13.rst:2263 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2263 +#: ../../whatsnew/3.13.rst:2265 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2269 +#: ../../whatsnew/3.13.rst:2271 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2273 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4138,13 +4146,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2279 +#: ../../whatsnew/3.13.rst:2281 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2282 +#: ../../whatsnew/3.13.rst:2284 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4153,13 +4161,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2290 +#: ../../whatsnew/3.13.rst:2292 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2293 +#: ../../whatsnew/3.13.rst:2295 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4170,13 +4178,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2303 +#: ../../whatsnew/3.13.rst:2305 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2306 +#: ../../whatsnew/3.13.rst:2308 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4186,21 +4194,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2315 +#: ../../whatsnew/3.13.rst:2317 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2317 +#: ../../whatsnew/3.13.rst:2319 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2319 +#: ../../whatsnew/3.13.rst:2321 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2324 +#: ../../whatsnew/3.13.rst:2326 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4211,106 +4219,106 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2336 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2338 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2338 +#: ../../whatsnew/3.13.rst:2340 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2341 +#: ../../whatsnew/3.13.rst:2343 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2343 +#: ../../whatsnew/3.13.rst:2345 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2346 +#: ../../whatsnew/3.13.rst:2348 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2348 +#: ../../whatsnew/3.13.rst:2350 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2350 +#: ../../whatsnew/3.13.rst:2352 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2354 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2356 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2356 +#: ../../whatsnew/3.13.rst:2358 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2358 +#: ../../whatsnew/3.13.rst:2360 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2361 +#: ../../whatsnew/3.13.rst:2363 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2364 +#: ../../whatsnew/3.13.rst:2366 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2368 +#: ../../whatsnew/3.13.rst:2370 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2375 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2374 +#: ../../whatsnew/3.13.rst:2376 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2377 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2377 +#: ../../whatsnew/3.13.rst:2379 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2379 +#: ../../whatsnew/3.13.rst:2381 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4319,7 +4327,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2386 +#: ../../whatsnew/3.13.rst:2388 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4328,26 +4336,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2393 +#: ../../whatsnew/3.13.rst:2395 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2398 +#: ../../whatsnew/3.13.rst:2400 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2402 +#: ../../whatsnew/3.13.rst:2404 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2405 +#: ../../whatsnew/3.13.rst:2407 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4355,77 +4363,77 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2414 msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2416 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2418 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2418 +#: ../../whatsnew/3.13.rst:2420 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2420 +#: ../../whatsnew/3.13.rst:2422 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2424 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2426 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2426 +#: ../../whatsnew/3.13.rst:2428 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2430 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2432 +#: ../../whatsnew/3.13.rst:2434 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2434 +#: ../../whatsnew/3.13.rst:2436 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2442 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2444 +#: ../../whatsnew/3.13.rst:2446 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2450 +#: ../../whatsnew/3.13.rst:2452 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4434,7 +4442,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2459 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4757,56 +4765,56 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2477 +#: ../../whatsnew/3.13.rst:2479 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2479 +#: ../../whatsnew/3.13.rst:2481 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2484 +#: ../../whatsnew/3.13.rst:2486 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2489 +#: ../../whatsnew/3.13.rst:2491 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2492 +#: ../../whatsnew/3.13.rst:2494 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2495 +#: ../../whatsnew/3.13.rst:2497 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2498 +#: ../../whatsnew/3.13.rst:2500 msgid "" "Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " "Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2502 +#: ../../whatsnew/3.13.rst:2504 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2506 +#: ../../whatsnew/3.13.rst:2508 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -4814,28 +4822,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2514 +#: ../../whatsnew/3.13.rst:2516 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2518 +#: ../../whatsnew/3.13.rst:2520 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2525 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2527 +#: ../../whatsnew/3.13.rst:2529 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -4845,27 +4853,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2536 +#: ../../whatsnew/3.13.rst:2538 msgid "Porting to Python 3.13" msgstr "" -#: ../../whatsnew/3.13.rst:2538 +#: ../../whatsnew/3.13.rst:2540 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2542 +#: ../../whatsnew/3.13.rst:2544 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.13.rst:2546 +#: ../../whatsnew/3.13.rst:2548 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2549 +#: ../../whatsnew/3.13.rst:2551 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -4877,7 +4885,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2558 +#: ../../whatsnew/3.13.rst:2560 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -4887,7 +4895,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2565 +#: ../../whatsnew/3.13.rst:2567 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -4896,7 +4904,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2571 +#: ../../whatsnew/3.13.rst:2573 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -4904,14 +4912,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2577 +#: ../../whatsnew/3.13.rst:2579 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2582 +#: ../../whatsnew/3.13.rst:2584 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -4920,13 +4928,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2588 +#: ../../whatsnew/3.13.rst:2590 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2591 +#: ../../whatsnew/3.13.rst:2593 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -4934,25 +4942,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2596 +#: ../../whatsnew/3.13.rst:2598 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2601 +#: ../../whatsnew/3.13.rst:2603 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2608 +#: ../../whatsnew/3.13.rst:2610 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.13.rst:2610 +#: ../../whatsnew/3.13.rst:2612 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -4961,7 +4969,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2616 +#: ../../whatsnew/3.13.rst:2618 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -4972,7 +4980,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2624 +#: ../../whatsnew/3.13.rst:2626 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -4982,7 +4990,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2631 +#: ../../whatsnew/3.13.rst:2633 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -4990,18 +4998,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2636 +#: ../../whatsnew/3.13.rst:2638 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2640 +#: ../../whatsnew/3.13.rst:2642 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2642 +#: ../../whatsnew/3.13.rst:2644 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5013,11 +5021,11 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2651 +#: ../../whatsnew/3.13.rst:2653 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2655 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5029,7 +5037,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2662 +#: ../../whatsnew/3.13.rst:2664 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5037,13 +5045,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2669 +#: ../../whatsnew/3.13.rst:2671 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2672 +#: ../../whatsnew/3.13.rst:2674 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5057,7 +5065,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2685 +#: ../../whatsnew/3.13.rst:2687 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5066,25 +5074,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2692 +#: ../../whatsnew/3.13.rst:2694 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2697 +#: ../../whatsnew/3.13.rst:2699 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2702 +#: ../../whatsnew/3.13.rst:2704 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2704 +#: ../../whatsnew/3.13.rst:2706 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " @@ -5092,3 +5100,14 @@ msgid "" "interpreter, before ``site.py`` is executed. (Contributed by Łukasz Langa " "in :gh:`110769`.)" msgstr "" + +#: ../../whatsnew/3.13.rst:2714 +msgid "Notable changes in 3.13.1" +msgstr "" + +#: ../../whatsnew/3.13.rst:2719 +msgid "" +"The previously undocumented special function :func:`sys.getobjects`, which " +"only exists in specialized builds of Python, may now return objects from " +"other interpreters than the one it's called in." +msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 5603747792..856321dfb5 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-11-20 09:21+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-" @@ -1526,7 +1526,7 @@ msgstr "logging" #: ../../whatsnew/3.8.rst:939 msgid "" -"Added a *force* keyword argument to :func:`logging.basicConfig` When set to " +"Added a *force* keyword argument to :func:`logging.basicConfig`. When set to " "true, any existing handlers attached to the root logger are removed and " "closed before carrying out the configuration specified by the other " "arguments." From b342f2d297ffe5414cd64f9055e56cd3e1232195 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 1 Dec 2024 15:05:35 +0000 Subject: [PATCH 09/14] sync with cpython 3b31f8c7 --- c-api/init.po | 305 +++++++------- c-api/type.po | 10 +- howto/descriptor.po | 167 ++++---- howto/enum.po | 764 +++++++++++++++++----------------- library/argparse.po | 504 ++++++++++++---------- library/asyncio-stream.po | 189 +++++---- library/asyncio-sync.po | 16 +- library/ctypes.po | 561 +++++++++++++------------ library/importlib.metadata.po | 8 +- library/locale.po | 137 +++--- library/multiprocessing.po | 10 +- library/shutil.po | 185 ++++---- library/socket.po | 4 +- library/token.po | 18 +- library/urllib.request.po | 582 ++++++++++++++------------ tutorial/errors.po | 14 +- whatsnew/3.4.po | 4 +- whatsnew/3.6.po | 16 +- whatsnew/3.7.po | 8 +- whatsnew/3.8.po | 12 +- 20 files changed, 1811 insertions(+), 1703 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index 5c3e37a1fe..4f36329902 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2028,6 +2028,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1682 +#, fuzzy msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2038,7 +2039,11 @@ msgid "" " .check_multi_interp_extensions = 1,\n" " .gil = PyInterpreterConfig_OWN_GIL,\n" "};\n" -"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" +"PyThreadState *tstate = NULL;\n" +"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}" msgstr "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2051,7 +2056,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1693 +#: ../../c-api/init.rst:1697 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2059,11 +2064,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1706 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1704 +#: ../../c-api/init.rst:1708 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2071,7 +2076,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1710 +#: ../../c-api/init.rst:1714 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2083,7 +2088,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1721 +#: ../../c-api/init.rst:1725 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2093,7 +2098,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1741 +#: ../../c-api/init.rst:1745 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2102,7 +2107,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1753 +#: ../../c-api/init.rst:1757 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2112,17 +2117,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1761 +#: ../../c-api/init.rst:1765 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1770 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1768 +#: ../../c-api/init.rst:1772 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2134,7 +2139,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1778 +#: ../../c-api/init.rst:1782 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2148,7 +2153,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1789 +#: ../../c-api/init.rst:1793 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2156,7 +2161,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1798 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2166,11 +2171,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1809 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1811 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2183,7 +2188,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1817 +#: ../../c-api/init.rst:1821 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2192,7 +2197,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1823 +#: ../../c-api/init.rst:1827 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2204,25 +2209,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1834 +#: ../../c-api/init.rst:1838 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1836 +#: ../../c-api/init.rst:1840 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1843 +#: ../../c-api/init.rst:1847 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1851 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2230,17 +2235,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1852 +#: ../../c-api/init.rst:1856 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1853 +#: ../../c-api/init.rst:1857 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1860 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2248,20 +2253,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1861 +#: ../../c-api/init.rst:1865 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1864 +#: ../../c-api/init.rst:1868 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:1873 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2271,7 +2276,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1882 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2279,18 +2284,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1887 +#: ../../c-api/init.rst:1891 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1892 +#: ../../c-api/init.rst:1896 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:1900 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2300,7 +2305,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1906 +#: ../../c-api/init.rst:1910 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 " @@ -2312,66 +2317,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:1919 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:1919 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1917 +#: ../../c-api/init.rst:1921 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1917 ../../c-api/init.rst:1922 -#: ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1937 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1923 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1923 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1922 +#: ../../c-api/init.rst:1926 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1924 +#: ../../c-api/init.rst:1928 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1924 +#: ../../c-api/init.rst:1928 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1927 +#: ../../c-api/init.rst:1931 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1927 ../../c-api/init.rst:1929 -#: ../../c-api/init.rst:1931 +#: ../../c-api/init.rst:1931 ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1935 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1929 +#: ../../c-api/init.rst:1933 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1931 +#: ../../c-api/init.rst:1935 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1937 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1938 +#: ../../c-api/init.rst:1942 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2380,7 +2385,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1947 +#: ../../c-api/init.rst:1951 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2392,7 +2397,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1958 +#: ../../c-api/init.rst:1962 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2400,31 +2405,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1970 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1972 +#: ../../c-api/init.rst:1976 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1978 +#: ../../c-api/init.rst:1982 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1984 +#: ../../c-api/init.rst:1988 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:1994 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2432,7 +2437,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1998 +#: ../../c-api/init.rst:2002 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2442,29 +2447,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2005 +#: ../../c-api/init.rst:2009 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2007 ../../c-api/init.rst:2014 -#: ../../c-api/init.rst:2033 ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2011 ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2044 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2015 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2016 +#: ../../c-api/init.rst:2020 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2024 +#: ../../c-api/init.rst:2028 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2475,28 +2480,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2031 +#: ../../c-api/init.rst:2035 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2041 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2046 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2052 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2054 +#: ../../c-api/init.rst:2058 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2506,19 +2511,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2064 +#: ../../c-api/init.rst:2068 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2069 +#: ../../c-api/init.rst:2073 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2074 +#: ../../c-api/init.rst:2078 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2527,7 +2532,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2080 +#: ../../c-api/init.rst:2084 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2535,11 +2540,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2085 ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2089 ../../c-api/init.rst:2100 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2091 +#: ../../c-api/init.rst:2095 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2547,48 +2552,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2103 +#: ../../c-api/init.rst:2107 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2108 +#: ../../c-api/init.rst:2112 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2113 +#: ../../c-api/init.rst:2117 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2118 +#: ../../c-api/init.rst:2122 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2127 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2129 +#: ../../c-api/init.rst:2133 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2135 +#: ../../c-api/init.rst:2139 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2142 +#: ../../c-api/init.rst:2146 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2146 +#: ../../c-api/init.rst:2150 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2598,19 +2603,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2153 +#: ../../c-api/init.rst:2157 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2156 +#: ../../c-api/init.rst:2160 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2160 +#: ../../c-api/init.rst:2164 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2618,22 +2623,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2168 +#: ../../c-api/init.rst:2172 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2174 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2176 +#: ../../c-api/init.rst:2180 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2181 +#: ../../c-api/init.rst:2185 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2641,52 +2646,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2186 +#: ../../c-api/init.rst:2190 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2192 +#: ../../c-api/init.rst:2196 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2197 +#: ../../c-api/init.rst:2201 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2199 +#: ../../c-api/init.rst:2203 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2206 +#: ../../c-api/init.rst:2210 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2213 +#: ../../c-api/init.rst:2217 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2219 +#: ../../c-api/init.rst:2223 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2224 +#: ../../c-api/init.rst:2228 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2226 +#: ../../c-api/init.rst:2230 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2694,13 +2699,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2234 +#: ../../c-api/init.rst:2238 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2240 +#: ../../c-api/init.rst:2244 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2709,7 +2714,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2249 +#: ../../c-api/init.rst:2253 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2718,31 +2723,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2258 +#: ../../c-api/init.rst:2262 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2265 +#: ../../c-api/init.rst:2269 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2273 +#: ../../c-api/init.rst:2277 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2275 +#: ../../c-api/init.rst:2279 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2280 +#: ../../c-api/init.rst:2284 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2751,62 +2756,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2285 +#: ../../c-api/init.rst:2289 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:2296 +#: ../../c-api/init.rst:2300 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2298 +#: ../../c-api/init.rst:2302 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2302 +#: ../../c-api/init.rst:2306 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2305 +#: ../../c-api/init.rst:2309 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2307 +#: ../../c-api/init.rst:2311 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2313 +#: ../../c-api/init.rst:2317 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2321 +#: ../../c-api/init.rst:2325 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2329 +#: ../../c-api/init.rst:2333 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2337 +#: ../../c-api/init.rst:2341 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2339 +#: ../../c-api/init.rst:2343 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2814,7 +2819,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2344 +#: ../../c-api/init.rst:2348 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2824,7 +2829,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2351 +#: ../../c-api/init.rst:2355 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2832,7 +2837,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2358 +#: ../../c-api/init.rst:2362 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2841,11 +2846,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2364 +#: ../../c-api/init.rst:2368 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2366 +#: ../../c-api/init.rst:2370 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2857,7 +2862,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2375 +#: ../../c-api/init.rst:2379 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2867,63 +2872,63 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2383 +#: ../../c-api/init.rst:2387 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2386 ../../c-api/init.rst:2400 -#: ../../c-api/init.rst:2415 ../../c-api/init.rst:2429 +#: ../../c-api/init.rst:2390 ../../c-api/init.rst:2404 +#: ../../c-api/init.rst:2419 ../../c-api/init.rst:2433 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2388 +#: ../../c-api/init.rst:2392 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2392 ../../c-api/init.rst:2421 +#: ../../c-api/init.rst:2396 ../../c-api/init.rst:2425 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2398 +#: ../../c-api/init.rst:2402 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2402 +#: ../../c-api/init.rst:2406 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2405 ../../c-api/init.rst:2434 +#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2438 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2411 +#: ../../c-api/init.rst:2415 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2417 +#: ../../c-api/init.rst:2421 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" -" PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" +" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2427 +#: ../../c-api/init.rst:2431 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2435 msgid "" -" PyCriticalSection_End2(&_py_cs2);\n" +" PyCriticalSection2_End(&_py_cs2);\n" "}" msgstr "" @@ -2940,19 +2945,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136 -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "sys" msgstr "sys" @@ -2964,7 +2969,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1698 ../../c-api/init.rst:1751 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1702 ../../c-api/init.rst:1755 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3060,23 +3065,23 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1698 +#: ../../c-api/init.rst:1702 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1732 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/type.po b/c-api/type.po index d812aec5bf..7edae0f016 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -602,24 +602,24 @@ msgid "" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:517 +#: ../../c-api/type.rst:515 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:519 +#: ../../c-api/type.rst:518 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:526 +#: ../../c-api/type.rst:525 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:529 +#: ../../c-api/type.rst:528 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/howto/descriptor.po b/howto/descriptor.po index 23a5569cfa..dc1c96059f 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -95,8 +95,8 @@ msgstr "" #: ../../howto/descriptor.rst:45 msgid "" -"The :class:`Ten` class is a descriptor whose :meth:`__get__` method always " -"returns the constant ``10``:" +"The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method " +"always returns the constant ``10``:" msgstr "" #: ../../howto/descriptor.rst:48 @@ -214,11 +214,11 @@ msgstr "" #: ../../howto/descriptor.rst:122 msgid "" "Besides showing how descriptors can run computations, this example also " -"reveals the purpose of the parameters to :meth:`__get__`. The *self* " -"parameter is *size*, an instance of *DirectorySize*. The *obj* parameter is " -"either *g* or *s*, an instance of *Directory*. It is the *obj* parameter " -"that lets the :meth:`__get__` method learn the target directory. The " -"*objtype* parameter is the class *Directory*." +"reveals the purpose of the parameters to :meth:`~object.__get__`. The " +"*self* parameter is *size*, an instance of *DirectorySize*. The *obj* " +"parameter is either *g* or *s*, an instance of *Directory*. It is the *obj* " +"parameter that lets the :meth:`~object.__get__` method learn the target " +"directory. The *objtype* parameter is the class *Directory*." msgstr "" #: ../../howto/descriptor.rst:131 @@ -230,8 +230,8 @@ msgid "" "A popular use for descriptors is managing access to instance data. The " "descriptor is assigned to a public attribute in the class dictionary while " "the actual data is stored as a private attribute in the instance " -"dictionary. The descriptor's :meth:`__get__` and :meth:`__set__` methods " -"are triggered when the public attribute is accessed." +"dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object." +"__set__` methods are triggered when the public attribute is accessed." msgstr "" #: ../../howto/descriptor.rst:139 @@ -326,10 +326,10 @@ msgstr "" #: ../../howto/descriptor.rst:218 msgid "" -"In this example, the :class:`Person` class has two descriptor instances, " -"*name* and *age*. When the :class:`Person` class is defined, it makes a " -"callback to :meth:`__set_name__` in *LoggedAccess* so that the field names " -"can be recorded, giving each descriptor its own *public_name* and " +"In this example, the :class:`!Person` class has two descriptor instances, " +"*name* and *age*. When the :class:`!Person` class is defined, it makes a " +"callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field " +"names can be recorded, giving each descriptor its own *public_name* and " "*private_name*:" msgstr "" @@ -369,9 +369,9 @@ msgstr "" #: ../../howto/descriptor.rst:256 msgid "" -"An interactive session shows that the :class:`Person` class has called :meth:" -"`__set_name__` so that the field names would be recorded. Here we call :" -"func:`vars` to look up the descriptor without triggering it:" +"An interactive session shows that the :class:`!Person` class has called :" +"meth:`~object.__set_name__` so that the field names would be recorded. Here " +"we call :func:`vars` to look up the descriptor without triggering it:" msgstr "" #: ../../howto/descriptor.rst:260 @@ -428,16 +428,16 @@ msgstr "" #: ../../howto/descriptor.rst:297 msgid "" -"A :term:`descriptor` is what we call any object that defines :meth:" -"`__get__`, :meth:`__set__`, or :meth:`__delete__`." +"A :term:`descriptor` is what we call any object that defines :meth:`~object." +"__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." msgstr "" #: ../../howto/descriptor.rst:300 msgid "" -"Optionally, descriptors can have a :meth:`__set_name__` method. This is " -"only used in cases where a descriptor needs to know either the class where " -"it was created or the name of class variable it was assigned to. (This " -"method, if present, is called even if the class is not a descriptor.)" +"Optionally, descriptors can have a :meth:`~object.__set_name__` method. " +"This is only used in cases where a descriptor needs to know either the class " +"where it was created or the name of class variable it was assigned to. " +"(This method, if present, is called even if the class is not a descriptor.)" msgstr "" #: ../../howto/descriptor.rst:305 @@ -498,7 +498,7 @@ msgstr "" #: ../../howto/descriptor.rst:340 msgid "" -"This :class:`Validator` class is both an :term:`abstract base class` and a " +"This :class:`!Validator` class is both an :term:`abstract base class` and a " "managed attribute descriptor:" msgstr "" @@ -542,8 +542,8 @@ msgstr "" #: ../../howto/descriptor.rst:363 msgid "" -"Custom validators need to inherit from :class:`Validator` and must supply a :" -"meth:`validate` method to test various restrictions as needed." +"Custom validators need to inherit from :class:`!Validator` and must supply " +"a :meth:`!validate` method to test various restrictions as needed." msgstr "" #: ../../howto/descriptor.rst:368 @@ -556,19 +556,19 @@ msgstr "" #: ../../howto/descriptor.rst:372 msgid "" -":class:`OneOf` verifies that a value is one of a restricted set of options." +":class:`!OneOf` verifies that a value is one of a restricted set of options." msgstr "" #: ../../howto/descriptor.rst:374 msgid "" -":class:`Number` verifies that a value is either an :class:`int` or :class:" +":class:`!Number` verifies that a value is either an :class:`int` or :class:" "`float`. Optionally, it verifies that a value is between a given minimum or " "maximum." msgstr "" #: ../../howto/descriptor.rst:378 msgid "" -":class:`String` verifies that a value is a :class:`str`. Optionally, it " +":class:`!String` verifies that a value is a :class:`str`. Optionally, it " "validates a given minimum or maximum length. It can validate a user-defined " "`predicate `_ " "as well." @@ -716,9 +716,9 @@ msgstr "" #: ../../howto/descriptor.rst:503 msgid "" "In general, a descriptor is an attribute value that has one of the methods " -"in the descriptor protocol. Those methods are :meth:`__get__`, :meth:" -"`__set__`, and :meth:`__delete__`. If any of those methods are defined for " -"an attribute, it is said to be a :term:`descriptor`." +"in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" +"meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " +"methods are defined for an attribute, it is said to be a :term:`descriptor`." msgstr "" #: ../../howto/descriptor.rst:508 @@ -767,10 +767,10 @@ msgstr "" #: ../../howto/descriptor.rst:537 msgid "" -"If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered " -"a data descriptor. Descriptors that only define :meth:`__get__` are called " -"non-data descriptors (they are often used for methods but other uses are " -"possible)." +"If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " +"it is considered a data descriptor. Descriptors that only define :meth:" +"`~object.__get__` are called non-data descriptors (they are often used for " +"methods but other uses are possible)." msgstr "" #: ../../howto/descriptor.rst:542 @@ -784,10 +784,10 @@ msgstr "" #: ../../howto/descriptor.rst:548 msgid "" -"To make a read-only data descriptor, define both :meth:`__get__` and :meth:" -"`__set__` with the :meth:`__set__` raising an :exc:`AttributeError` when " -"called. Defining the :meth:`__set__` method with an exception raising " -"placeholder is enough to make it a data descriptor." +"To make a read-only data descriptor, define both :meth:`~object.__get__` " +"and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" +"`AttributeError` when called. Defining the :meth:`~object.__set__` method " +"with an exception raising placeholder is enough to make it a data descriptor." msgstr "" #: ../../howto/descriptor.rst:555 @@ -828,8 +828,8 @@ msgstr "" msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " -"descriptors, then class variables, and lastly :meth:`__getattr__` if it is " -"provided." +"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if " +"it is provided." msgstr "" #: ../../howto/descriptor.rst:580 @@ -875,16 +875,17 @@ msgstr "" #: ../../howto/descriptor.rst:722 msgid "" -"Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " -"code. That is why calling :meth:`__getattribute__` directly or with " -"``super().__getattribute__`` will bypass :meth:`__getattr__` entirely." +"Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." +"__getattribute__` code. That is why calling :meth:`~object." +"__getattribute__` directly or with ``super().__getattribute__`` will bypass :" +"meth:`~object.__getattr__` entirely." msgstr "" #: ../../howto/descriptor.rst:726 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " -"responsible for invoking :meth:`__getattr__` whenever :meth:" -"`__getattribute__` raises an :exc:`AttributeError`. Their logic is " +"responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." +"__getattribute__` raises an :exc:`AttributeError`. Their logic is " "encapsulated in a helper function:" msgstr "" @@ -914,8 +915,8 @@ msgstr "" #: ../../howto/descriptor.rst:778 msgid "" -"The logic for a dotted lookup such as ``A.x`` is in :meth:`type." -"__getattribute__`. The steps are similar to those for :meth:`object." +"The logic for a dotted lookup such as ``A.x`` is in :meth:`!type." +"__getattribute__`. The steps are similar to those for :meth:`!object." "__getattribute__` but the instance dictionary lookup is replaced by a search " "through the class's :term:`method resolution order`." msgstr "" @@ -936,8 +937,8 @@ msgstr "" #: ../../howto/descriptor.rst:792 msgid "" -"The logic for super's dotted lookup is in the :meth:`__getattribute__` " -"method for object returned by :func:`super`." +"The logic for super's dotted lookup is in the :meth:`~object." +"__getattribute__` method for object returned by :func:`super`." msgstr "" #: ../../howto/descriptor.rst:795 @@ -962,8 +963,9 @@ msgstr "" #: ../../howto/descriptor.rst:809 msgid "" -"The mechanism for descriptors is embedded in the :meth:`__getattribute__` " -"methods for :class:`object`, :class:`type`, and :func:`super`." +"The mechanism for descriptors is embedded in the :meth:`~object." +"__getattribute__` methods for :class:`object`, :class:`type`, and :func:" +"`super`." msgstr "" #: ../../howto/descriptor.rst:812 @@ -971,7 +973,7 @@ msgid "The important points to remember are:" msgstr "要記住的重點是:" #: ../../howto/descriptor.rst:814 -msgid "Descriptors are invoked by the :meth:`__getattribute__` method." +msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." msgstr "" #: ../../howto/descriptor.rst:816 @@ -982,16 +984,16 @@ msgstr "" #: ../../howto/descriptor.rst:819 msgid "" -"Overriding :meth:`__getattribute__` prevents automatic descriptor calls " -"because all the descriptor logic is in that method." +"Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " +"calls because all the descriptor logic is in that method." msgstr "" #: ../../howto/descriptor.rst:822 msgid "" -":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " -"different calls to :meth:`__get__`. The first includes the instance and may " -"include the class. The second puts in ``None`` for the instance and always " -"includes the class." +":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " +"different calls to :meth:`~object.__get__`. The first includes the instance " +"and may include the class. The second puts in ``None`` for the instance and " +"always includes the class." msgstr "" #: ../../howto/descriptor.rst:827 @@ -1011,9 +1013,9 @@ msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " "metaclass scans the dictionary of the new class. If any of the entries are " -"descriptors and if they define :meth:`__set_name__`, that method is called " -"with two arguments. The *owner* is the class where the descriptor is used, " -"and the *name* is the class variable the descriptor was assigned to." +"descriptors and if they define :meth:`~object.__set_name__`, that method is " +"called with two arguments. The *owner* is the class where the descriptor is " +"used, and the *name* is the class variable the descriptor was assigned to." msgstr "" #: ../../howto/descriptor.rst:842 @@ -1024,9 +1026,9 @@ msgstr "" #: ../../howto/descriptor.rst:845 msgid "" -"Since the update logic is in :meth:`type.__new__`, notifications only take " +"Since the update logic is in :meth:`!type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " -"afterwards, :meth:`__set_name__` will need to be called manually." +"afterwards, :meth:`~object.__set_name__` will need to be called manually." msgstr "" #: ../../howto/descriptor.rst:851 @@ -1081,7 +1083,7 @@ msgstr "" #: ../../howto/descriptor.rst:876 msgid "" -"We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" @@ -1281,7 +1283,7 @@ msgstr "" #: ../../howto/descriptor.rst:1143 msgid "" -"Either the built-in :func:`property` or our :func:`Property` equivalent " +"Either the built-in :func:`property` or our :func:`!Property` equivalent " "would work in this example." msgstr "" @@ -1341,9 +1343,9 @@ msgstr "" #: ../../howto/descriptor.rst:1189 msgid "" "To support automatic creation of methods, functions include the :meth:" -"`__get__` method for binding methods during attribute access. This means " -"that functions are non-data descriptors that return bound methods during " -"dotted lookup from an instance. Here's how it works:" +"`~object.__get__` method for binding methods during attribute access. This " +"means that functions are non-data descriptors that return bound methods " +"during dotted lookup from an instance. Here's how it works:" msgstr "" #: ../../howto/descriptor.rst:1194 @@ -1394,7 +1396,7 @@ msgstr "" #: ../../howto/descriptor.rst:1233 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" -"`__get__`. Instead, it just returns the underlying function object::" +"`~object.__get__`. Instead, it just returns the underlying function object::" msgstr "" #: ../../howto/descriptor.rst:1236 @@ -1407,8 +1409,8 @@ msgstr "" #: ../../howto/descriptor.rst:1239 msgid "" -"Dotted access from a class calls :meth:`__get__` which just returns the " -"underlying function unchanged::" +"Dotted access from a class calls :meth:`~object.__get__` which just returns " +"the underlying function unchanged::" msgstr "" #: ../../howto/descriptor.rst:1242 @@ -1422,7 +1424,8 @@ msgstr "" #: ../../howto/descriptor.rst:1245 msgid "" "The interesting behavior occurs during dotted access from an instance. The " -"dotted lookup calls :meth:`__get__` which returns a bound method object::" +"dotted lookup calls :meth:`~object.__get__` which returns a bound method " +"object::" msgstr "" #: ../../howto/descriptor.rst:1248 @@ -1473,10 +1476,10 @@ msgstr "" #: ../../howto/descriptor.rst:1271 msgid "" -"To recap, functions have a :meth:`__get__` method so that they can be " -"converted to a method when accessed as attributes. The non-data descriptor " -"transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``cls." -"f(*args)`` becomes ``f(*args)``." +"To recap, functions have a :meth:`~object.__get__` method so that they can " +"be converted to a method when accessed as attributes. The non-data " +"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " +"Calling ``cls.f(*args)`` becomes ``f(*args)``." msgstr "" #: ../../howto/descriptor.rst:1276 @@ -1911,8 +1914,8 @@ msgstr "" #: ../../howto/descriptor.rst:1670 msgid "" -"The :meth:`type.__new__` method takes care of adding member objects to class " -"variables:" +"The :meth:`!type.__new__` method takes care of adding member objects to " +"class variables:" msgstr "" #: ../../howto/descriptor.rst:1673 @@ -1970,8 +1973,8 @@ msgstr "" #: ../../howto/descriptor.rst:1721 msgid "" -"To use the simulation in a real class, just inherit from :class:`Object` and " -"set the :term:`metaclass` to :class:`Type`:" +"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:1724 diff --git a/howto/enum.po b/howto/enum.po index ae361cc86a..3393ef9576 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -121,7 +121,7 @@ msgid "" msgstr "" #: ../../howto/enum.rst:67 -msgid "Enum members have an attribute that contains just their :attr:`name`::" +msgid "Enum members have an attribute that contains just their :attr:`!name`::" msgstr "" #: ../../howto/enum.rst:69 @@ -133,7 +133,7 @@ msgstr "" "TUESDAY" #: ../../howto/enum.rst:72 -msgid "Likewise, they have an attribute for their :attr:`value`::" +msgid "Likewise, they have an attribute for their :attr:`!value`::" msgstr "" #: ../../howto/enum.rst:75 @@ -148,25 +148,26 @@ msgstr "" msgid "" "Unlike many languages that treat enumerations solely as name/value pairs, " "Python Enums can have behavior added. For example, :class:`datetime.date` " -"has two methods for returning the weekday: :meth:`weekday` and :meth:" -"`isoweekday`. The difference is that one of them counts from 0-6 and the " -"other from 1-7. Rather than keep track of that ourselves we can add a method " -"to the :class:`Weekday` enum to extract the day from the :class:`date` " -"instance and return the matching enum member::" +"has two methods for returning the weekday: :meth:`~datetime.date.weekday` " +"and :meth:`~datetime.date.isoweekday`. The difference is that one of them " +"counts from 0-6 and the other from 1-7. Rather than keep track of that " +"ourselves we can add a method to the :class:`!Weekday` enum to extract the " +"day from the :class:`~datetime.date` instance and return the matching enum " +"member::" msgstr "" -#: ../../howto/enum.rst:86 +#: ../../howto/enum.rst:87 msgid "" "@classmethod\n" "def from_date(cls, date):\n" " return cls(date.isoweekday())" msgstr "" -#: ../../howto/enum.rst:90 -msgid "The complete :class:`Weekday` enum now looks like this::" +#: ../../howto/enum.rst:91 +msgid "The complete :class:`!Weekday` enum now looks like this::" msgstr "" -#: ../../howto/enum.rst:92 +#: ../../howto/enum.rst:93 msgid "" ">>> class Weekday(Enum):\n" "... MONDAY = 1\n" @@ -194,32 +195,32 @@ msgstr "" "... def from_date(cls, date):\n" "... return cls(date.isoweekday())" -#: ../../howto/enum.rst:105 +#: ../../howto/enum.rst:106 msgid "Now we can find out what today is! Observe::" msgstr "" -#: ../../howto/enum.rst:107 +#: ../../howto/enum.rst:108 msgid "" ">>> from datetime import date\n" ">>> Weekday.from_date(date.today()) \n" "" msgstr "" -#: ../../howto/enum.rst:111 +#: ../../howto/enum.rst:112 msgid "" "Of course, if you're reading this on some other day, you'll see that day " "instead." msgstr "" -#: ../../howto/enum.rst:113 +#: ../../howto/enum.rst:114 msgid "" -"This :class:`Weekday` enum is great if our variable only needs one day, but " +"This :class:`!Weekday` enum is great if our variable only needs one day, but " "what if we need several? Maybe we're writing a function to plot chores " "during a week, and don't want to use a :class:`list` -- we could use a " "different type of :class:`Enum`::" msgstr "" -#: ../../howto/enum.rst:118 +#: ../../howto/enum.rst:119 msgid "" ">>> from enum import Flag\n" ">>> class Weekday(Flag):\n" @@ -241,19 +242,19 @@ msgstr "" "... SATURDAY = 32\n" "... SUNDAY = 64" -#: ../../howto/enum.rst:128 +#: ../../howto/enum.rst:129 msgid "" "We've changed two things: we're inherited from :class:`Flag`, and the values " "are all powers of 2." msgstr "" -#: ../../howto/enum.rst:131 +#: ../../howto/enum.rst:132 msgid "" -"Just like the original :class:`Weekday` enum above, we can have a single " +"Just like the original :class:`!Weekday` enum above, we can have a single " "selection::" msgstr "" -#: ../../howto/enum.rst:133 +#: ../../howto/enum.rst:134 msgid "" ">>> first_week_day = Weekday.MONDAY\n" ">>> first_week_day\n" @@ -263,13 +264,13 @@ msgstr "" ">>> first_week_day\n" "" -#: ../../howto/enum.rst:137 +#: ../../howto/enum.rst:138 msgid "" "But :class:`Flag` also allows us to combine several members into a single " "variable::" msgstr "" -#: ../../howto/enum.rst:140 +#: ../../howto/enum.rst:141 msgid "" ">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" ">>> weekend\n" @@ -279,11 +280,11 @@ msgstr "" ">>> weekend\n" "" -#: ../../howto/enum.rst:144 +#: ../../howto/enum.rst:145 msgid "You can even iterate over a :class:`Flag` variable::" msgstr "" -#: ../../howto/enum.rst:146 +#: ../../howto/enum.rst:147 msgid "" ">>> for day in weekend:\n" "... print(day)\n" @@ -295,11 +296,11 @@ msgstr "" "Weekday.SATURDAY\n" "Weekday.SUNDAY" -#: ../../howto/enum.rst:151 +#: ../../howto/enum.rst:152 msgid "Okay, let's get some chores set up::" msgstr "" -#: ../../howto/enum.rst:153 +#: ../../howto/enum.rst:154 msgid "" ">>> chores_for_ethan = {\n" "... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." @@ -315,11 +316,11 @@ msgstr "" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" -#: ../../howto/enum.rst:159 +#: ../../howto/enum.rst:160 msgid "And a function to display the chores for a given day::" msgstr "" -#: ../../howto/enum.rst:161 +#: ../../howto/enum.rst:162 msgid "" ">>> def show_chores(chores, day):\n" "... for chore, days in chores.items():\n" @@ -337,13 +338,13 @@ msgstr "" ">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" "answer SO questions" -#: ../../howto/enum.rst:169 +#: ../../howto/enum.rst:170 msgid "" "In cases where the actual values of the members do not matter, you can save " "yourself some work and use :func:`auto` for the values::" msgstr "" -#: ../../howto/enum.rst:172 +#: ../../howto/enum.rst:173 msgid "" ">>> from enum import auto\n" ">>> class Weekday(Flag):\n" @@ -367,18 +368,18 @@ msgstr "" "... SUNDAY = auto()\n" "... WEEKEND = SATURDAY | SUNDAY" -#: ../../howto/enum.rst:188 +#: ../../howto/enum.rst:189 msgid "Programmatic access to enumeration members and their attributes" msgstr "" -#: ../../howto/enum.rst:190 +#: ../../howto/enum.rst:191 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -#: ../../howto/enum.rst:194 +#: ../../howto/enum.rst:195 msgid "" ">>> Color(1)\n" "\n" @@ -390,11 +391,11 @@ msgstr "" ">>> Color(3)\n" "" -#: ../../howto/enum.rst:199 +#: ../../howto/enum.rst:200 msgid "If you want to access enum members by *name*, use item access::" msgstr "" -#: ../../howto/enum.rst:201 +#: ../../howto/enum.rst:202 msgid "" ">>> Color['RED']\n" "\n" @@ -406,11 +407,12 @@ msgstr "" ">>> Color['GREEN']\n" "" -#: ../../howto/enum.rst:206 -msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" +#: ../../howto/enum.rst:207 +msgid "" +"If you have an enum member and need its :attr:`!name` or :attr:`!value`::" msgstr "" -#: ../../howto/enum.rst:208 +#: ../../howto/enum.rst:209 msgid "" ">>> member = Color.RED\n" ">>> member.name\n" @@ -424,15 +426,15 @@ msgstr "" ">>> member.value\n" "1" -#: ../../howto/enum.rst:216 +#: ../../howto/enum.rst:217 msgid "Duplicating enum members and values" msgstr "" -#: ../../howto/enum.rst:218 +#: ../../howto/enum.rst:219 msgid "Having two enum members with the same name is invalid::" msgstr "" -#: ../../howto/enum.rst:220 +#: ../../howto/enum.rst:221 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -450,7 +452,7 @@ msgstr "" "...\n" "TypeError: 'SQUARE' already defined as 2" -#: ../../howto/enum.rst:228 +#: ../../howto/enum.rst:229 msgid "" "However, an enum member can have other names associated with it. Given two " "entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " @@ -459,7 +461,7 @@ msgid "" "member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" -#: ../../howto/enum.rst:234 +#: ../../howto/enum.rst:235 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -487,24 +489,24 @@ msgstr "" ">>> Shape(2)\n" "" -#: ../../howto/enum.rst:249 +#: ../../howto/enum.rst:250 msgid "" "Attempting to create a member with the same name as an already defined " "attribute (another member, a method, etc.) or attempting to create an " "attribute with the same name as a member is not allowed." msgstr "" -#: ../../howto/enum.rst:255 +#: ../../howto/enum.rst:256 msgid "Ensuring unique enumeration values" msgstr "" -#: ../../howto/enum.rst:257 +#: ../../howto/enum.rst:258 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, you can use the :func:`unique` decorator::" msgstr "" -#: ../../howto/enum.rst:260 +#: ../../howto/enum.rst:261 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -530,15 +532,15 @@ msgstr "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" -#: ../../howto/enum.rst:274 +#: ../../howto/enum.rst:275 msgid "Using automatic values" msgstr "" -#: ../../howto/enum.rst:276 +#: ../../howto/enum.rst:277 msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "" -#: ../../howto/enum.rst:278 +#: ../../howto/enum.rst:279 msgid "" ">>> from enum import Enum, auto\n" ">>> class Color(Enum):\n" @@ -558,13 +560,13 @@ msgstr "" ">>> [member.value for member in Color]\n" "[1, 2, 3]" -#: ../../howto/enum.rst:287 +#: ../../howto/enum.rst:288 msgid "" -"The values are chosen by :func:`_generate_next_value_`, which can be " +"The values are chosen by :func:`~Enum._generate_next_value_`, which can be " "overridden::" msgstr "" -#: ../../howto/enum.rst:290 +#: ../../howto/enum.rst:291 msgid "" ">>> class AutoName(Enum):\n" "... @staticmethod\n" @@ -594,20 +596,21 @@ msgstr "" ">>> [member.value for member in Ordinal]\n" "['NORTH', 'SOUTH', 'EAST', 'WEST']" -#: ../../howto/enum.rst:306 +#: ../../howto/enum.rst:307 msgid "" -"The :meth:`_generate_next_value_` method must be defined before any members." +"The :meth:`~Enum._generate_next_value_` method must be defined before any " +"members." msgstr "" -#: ../../howto/enum.rst:309 +#: ../../howto/enum.rst:310 msgid "Iteration" msgstr "" -#: ../../howto/enum.rst:311 +#: ../../howto/enum.rst:312 msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "" -#: ../../howto/enum.rst:313 +#: ../../howto/enum.rst:314 msgid "" ">>> list(Shape)\n" "[, , ]\n" @@ -623,20 +626,20 @@ msgstr "" "THURSDAY: 8>, , , ]" -#: ../../howto/enum.rst:318 +#: ../../howto/enum.rst:319 msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " "aren't shown." msgstr "" -#: ../../howto/enum.rst:320 +#: ../../howto/enum.rst:321 msgid "" "The special attribute ``__members__`` is a read-only ordered mapping of " "names to members. It includes all names defined in the enumeration, " "including the aliases::" msgstr "" -#: ../../howto/enum.rst:324 +#: ../../howto/enum.rst:325 msgid "" ">>> for name, member in Shape.__members__.items():\n" "... name, member\n" @@ -654,13 +657,13 @@ msgstr "" "('CIRCLE', )\n" "('ALIAS_FOR_SQUARE', )" -#: ../../howto/enum.rst:332 +#: ../../howto/enum.rst:333 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " "to the enumeration members. For example, finding all the aliases::" msgstr "" -#: ../../howto/enum.rst:335 +#: ../../howto/enum.rst:336 msgid "" ">>> [name for name, member in Shape.__members__.items() if member.name != " "name]\n" @@ -670,21 +673,21 @@ msgstr "" "name]\n" "['ALIAS_FOR_SQUARE']" -#: ../../howto/enum.rst:340 +#: ../../howto/enum.rst:341 msgid "" "Aliases for flags include values with multiple flags set, such as ``3``, and " "no flags set, i.e. ``0``." msgstr "" -#: ../../howto/enum.rst:345 +#: ../../howto/enum.rst:346 msgid "Comparisons" msgstr "比較" -#: ../../howto/enum.rst:347 +#: ../../howto/enum.rst:348 msgid "Enumeration members are compared by identity::" msgstr "" -#: ../../howto/enum.rst:349 +#: ../../howto/enum.rst:350 msgid "" ">>> Color.RED is Color.RED\n" "True\n" @@ -700,13 +703,13 @@ msgstr "" ">>> Color.RED is not Color.BLUE\n" "True" -#: ../../howto/enum.rst:356 +#: ../../howto/enum.rst:357 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" -#: ../../howto/enum.rst:359 +#: ../../howto/enum.rst:360 msgid "" ">>> Color.RED < Color.BLUE\n" "Traceback (most recent call last):\n" @@ -718,11 +721,11 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: '<' not supported between instances of 'Color' and 'Color'" -#: ../../howto/enum.rst:364 +#: ../../howto/enum.rst:365 msgid "Equality comparisons are defined though::" msgstr "" -#: ../../howto/enum.rst:366 +#: ../../howto/enum.rst:367 msgid "" ">>> Color.BLUE == Color.RED\n" "False\n" @@ -738,14 +741,14 @@ msgstr "" ">>> Color.BLUE == Color.BLUE\n" "True" -#: ../../howto/enum.rst:373 +#: ../../howto/enum.rst:374 msgid "" "Comparisons against non-enumeration values will always compare not equal " "(again, :class:`IntEnum` was explicitly designed to behave differently, see " "below)::" msgstr "" -#: ../../howto/enum.rst:377 +#: ../../howto/enum.rst:378 msgid "" ">>> Color.BLUE == 2\n" "False" @@ -753,18 +756,18 @@ msgstr "" ">>> Color.BLUE == 2\n" "False" -#: ../../howto/enum.rst:382 +#: ../../howto/enum.rst:383 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:387 +#: ../../howto/enum.rst:388 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:389 +#: ../../howto/enum.rst:390 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -773,13 +776,13 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:395 +#: ../../howto/enum.rst:396 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:398 +#: ../../howto/enum.rst:399 msgid "" ">>> class Mood(Enum):\n" "... FUNKY = 1\n" @@ -799,11 +802,11 @@ msgid "" "..." msgstr "" -#: ../../howto/enum.rst:415 +#: ../../howto/enum.rst:416 msgid "Then::" msgstr "" -#: ../../howto/enum.rst:417 +#: ../../howto/enum.rst:418 msgid "" ">>> Mood.favorite_mood()\n" "\n" @@ -819,43 +822,43 @@ msgstr "" ">>> str(Mood.FUNKY)\n" "'my custom str! 1'" -#: ../../howto/enum.rst:424 +#: ../../howto/enum.rst:425 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 " "attributes defined within an enumeration will become members of this " -"enumeration, with the exception of special methods (:meth:`__str__`, :meth:" -"`__add__`, etc.), descriptors (methods are also descriptors), and variable " -"names listed in :attr:`_ignore_`." +"enumeration, with the exception of special methods (:meth:`~object." +"__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " +"descriptors), and variable names listed in :attr:`~Enum._ignore_`." msgstr "" -#: ../../howto/enum.rst:431 +#: ../../howto/enum.rst:432 msgid "" -"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__`, " -"any value(s) given to the enum member will be passed into those methods. See " -"`Planet`_ for an example." +"Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" +"`~object.__init__`, any value(s) given to the enum member will be passed " +"into those methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:437 +#: ../../howto/enum.rst:438 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. See :ref:`new-vs-init` for " -"more details." +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members. See :ref:" +"`new-vs-init` for more details." msgstr "" -#: ../../howto/enum.rst:444 +#: ../../howto/enum.rst:445 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:446 +#: ../../howto/enum.rst:447 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:450 +#: ../../howto/enum.rst:451 msgid "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" @@ -863,13 +866,13 @@ msgstr "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" -#: ../../howto/enum.rst:453 +#: ../../howto/enum.rst:454 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:456 +#: ../../howto/enum.rst:457 msgid "" ">>> class MoreColor(Color):\n" "... PINK = 17\n" @@ -885,11 +888,11 @@ msgstr "" "...\n" "TypeError: cannot extend " -#: ../../howto/enum.rst:463 +#: ../../howto/enum.rst:464 msgid "But this is allowed::" msgstr "但這是允許的:" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:466 msgid "" ">>> class Foo(Enum):\n" "... def some_behavior(self):\n" @@ -909,7 +912,7 @@ msgstr "" "... SAD = 2\n" "..." -#: ../../howto/enum.rst:474 +#: ../../howto/enum.rst:475 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 " @@ -917,17 +920,17 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:483 +#: ../../howto/enum.rst:484 msgid "Dataclass support" msgstr "" -#: ../../howto/enum.rst:485 +#: ../../howto/enum.rst:486 msgid "" "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:488 +#: ../../howto/enum.rst:489 msgid "" ">>> from dataclasses import dataclass, field\n" ">>> @dataclass\n" @@ -957,19 +960,19 @@ msgstr "" ">>> Creature.DOG\n" "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:503 msgid "" "Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " "standard :func:`repr`." msgstr "" -#: ../../howto/enum.rst:505 +#: ../../howto/enum.rst:506 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:511 +#: ../../howto/enum.rst:512 msgid "" "Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum` and its " "subclasses is not supported. It will not raise any errors, but it will " @@ -977,7 +980,7 @@ msgid "" "other::" msgstr "" -#: ../../howto/enum.rst:516 +#: ../../howto/enum.rst:517 msgid "" ">>> @dataclass # don't do this: it does not make any sense\n" "... class Color(Enum):\n" @@ -990,15 +993,15 @@ msgid "" "True" msgstr "" -#: ../../howto/enum.rst:528 +#: ../../howto/enum.rst:529 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:530 +#: ../../howto/enum.rst:531 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:532 +#: ../../howto/enum.rst:533 msgid "" ">>> from test.test_enum import Fruit\n" ">>> from pickle import dumps, loads\n" @@ -1010,27 +1013,27 @@ msgstr "" ">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" "True" -#: ../../howto/enum.rst:537 +#: ../../howto/enum.rst:538 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:543 +#: ../../howto/enum.rst:544 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:546 +#: ../../howto/enum.rst:547 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" -"meth:`__reduce_ex__` in the enumeration class. The default method is by-" -"value, but enums with complicated values may want to use by-name::" +"meth:`~object.__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:550 +#: ../../howto/enum.rst:551 msgid "" ">>> import enum\n" ">>> class MyEnum(enum.Enum):\n" @@ -1040,22 +1043,22 @@ msgstr "" ">>> class MyEnum(enum.Enum):\n" "... __reduce_ex__ = enum.pickle_by_enum_name" -#: ../../howto/enum.rst:556 +#: ../../howto/enum.rst:557 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:561 +#: ../../howto/enum.rst:562 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:563 +#: ../../howto/enum.rst:564 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:565 +#: ../../howto/enum.rst:566 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" ">>> Animal\n" @@ -1073,13 +1076,13 @@ msgstr "" ">>> list(Animal)\n" "[, , , ]" -#: ../../howto/enum.rst:573 +#: ../../howto/enum.rst:574 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:576 +#: ../../howto/enum.rst:577 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-" @@ -1088,10 +1091,10 @@ msgid "" "enumerations; the others auto-assign increasing integers starting with 1 " "(use the ``start`` parameter to specify a different starting value). A new " "class derived from :class:`Enum` is returned. In other words, the above " -"assignment to :class:`Animal` is equivalent to::" +"assignment to :class:`!Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:585 +#: ../../howto/enum.rst:586 msgid "" ">>> class Animal(Enum):\n" "... ANT = 1\n" @@ -1107,14 +1110,14 @@ msgstr "" "... DOG = 4\n" "..." -#: ../../howto/enum.rst:592 +#: ../../howto/enum.rst:593 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:596 +#: ../../howto/enum.rst:597 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 " @@ -1123,18 +1126,18 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:602 +#: ../../howto/enum.rst:603 msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" msgstr ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -#: ../../howto/enum.rst:606 +#: ../../howto/enum.rst:607 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:610 +#: ../../howto/enum.rst:611 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~type.__qualname__` being set to the location where pickle will be able to " @@ -1142,17 +1145,17 @@ msgid "" "SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:615 +#: ../../howto/enum.rst:616 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgstr "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" -#: ../../howto/enum.rst:617 +#: ../../howto/enum.rst:618 msgid "The complete signature is::" msgstr "" -#: ../../howto/enum.rst:619 +#: ../../howto/enum.rst:620 msgid "" "Enum(\n" " value='NewEnumName',\n" @@ -1174,73 +1177,73 @@ msgstr "" " start=1,\n" " )" -#: ../../howto/enum.rst:629 +#: ../../howto/enum.rst:630 msgid "*value*: What the new enum class will record as its name." msgstr "" -#: ../../howto/enum.rst:631 +#: ../../howto/enum.rst:632 msgid "" "*names*: The enum members. This can be a whitespace- or comma-separated " "string (values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:634 +#: ../../howto/enum.rst:635 msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" msgstr "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:637 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:639 msgid "['RED', 'GREEN', 'BLUE']" msgstr "['RED', 'GREEN', 'BLUE']" -#: ../../howto/enum.rst:640 +#: ../../howto/enum.rst:641 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:642 +#: ../../howto/enum.rst:643 msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" msgstr "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" -#: ../../howto/enum.rst:644 +#: ../../howto/enum.rst:645 msgid "or a mapping::" msgstr "" -#: ../../howto/enum.rst:646 +#: ../../howto/enum.rst:647 msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" msgstr "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" -#: ../../howto/enum.rst:648 +#: ../../howto/enum.rst:649 msgid "*module*: name of module where new enum class can be found." msgstr "" -#: ../../howto/enum.rst:650 +#: ../../howto/enum.rst:651 msgid "*qualname*: where in module new enum class can be found." msgstr "" -#: ../../howto/enum.rst:652 +#: ../../howto/enum.rst:653 msgid "*type*: type to mix in to new enum class." msgstr "" -#: ../../howto/enum.rst:654 +#: ../../howto/enum.rst:655 msgid "*start*: number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:656 +#: ../../howto/enum.rst:657 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:661 +#: ../../howto/enum.rst:662 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:664 +#: ../../howto/enum.rst:665 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:666 +#: ../../howto/enum.rst:667 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 " @@ -1248,7 +1251,7 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:671 +#: ../../howto/enum.rst:672 msgid "" ">>> from enum import IntEnum\n" ">>> class Shape(IntEnum):\n" @@ -1282,13 +1285,13 @@ msgstr "" ">>> Shape.CIRCLE == Request.POST\n" "True" -#: ../../howto/enum.rst:687 +#: ../../howto/enum.rst:688 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:689 +#: ../../howto/enum.rst:690 msgid "" ">>> class Shape(IntEnum):\n" "... CIRCLE = 1\n" @@ -1312,12 +1315,12 @@ msgstr "" ">>> Shape.CIRCLE == Color.RED\n" "False" -#: ../../howto/enum.rst:700 +#: ../../howto/enum.rst:701 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:702 +#: ../../howto/enum.rst:703 msgid "" ">>> int(Shape.CIRCLE)\n" "1\n" @@ -1333,11 +1336,11 @@ msgstr "" ">>> [i for i in range(Shape.SQUARE)]\n" "[0, 1]" -#: ../../howto/enum.rst:711 +#: ../../howto/enum.rst:712 msgid "StrEnum" msgstr "StrEnum" -#: ../../howto/enum.rst:713 +#: ../../howto/enum.rst:714 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; " @@ -1345,11 +1348,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:722 +#: ../../howto/enum.rst:723 msgid "IntFlag" msgstr "IntFlag" -#: ../../howto/enum.rst:724 +#: ../../howto/enum.rst:725 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -1359,23 +1362,23 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:732 +#: ../../howto/enum.rst:733 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:735 +#: ../../howto/enum.rst:736 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:742 +#: ../../howto/enum.rst:743 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:744 +#: ../../howto/enum.rst:745 msgid "" ">>> from enum import IntFlag\n" ">>> class Perm(IntFlag):\n" @@ -1405,11 +1408,11 @@ msgstr "" ">>> Perm.R in RW\n" "True" -#: ../../howto/enum.rst:758 +#: ../../howto/enum.rst:759 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:760 +#: ../../howto/enum.rst:761 msgid "" ">>> class Perm(IntFlag):\n" "... R = 4\n" @@ -1437,20 +1440,20 @@ msgstr "" ">>> Perm(7)\n" "" -#: ../../howto/enum.rst:775 +#: ../../howto/enum.rst:776 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:780 +#: ../../howto/enum.rst:781 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:783 +#: ../../howto/enum.rst:784 msgid "" ">>> Perm.R & Perm.X\n" "\n" @@ -1462,13 +1465,13 @@ msgstr "" ">>> bool(Perm.R & Perm.X)\n" "False" -#: ../../howto/enum.rst:788 +#: ../../howto/enum.rst:789 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:791 +#: ../../howto/enum.rst:792 msgid "" ">>> Perm.X | 4\n" "\n" @@ -1482,13 +1485,13 @@ msgstr "" ">>> Perm.X + 8\n" "9" -#: ../../howto/enum.rst:799 +#: ../../howto/enum.rst:800 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:802 +#: ../../howto/enum.rst:803 msgid "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" @@ -1496,11 +1499,11 @@ msgstr "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" -#: ../../howto/enum.rst:805 +#: ../../howto/enum.rst:806 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:807 +#: ../../howto/enum.rst:808 msgid "" ">>> list(RW)\n" "[, ]" @@ -1508,11 +1511,11 @@ msgstr "" ">>> list(RW)\n" "[, ]" -#: ../../howto/enum.rst:814 +#: ../../howto/enum.rst:815 msgid "Flag" msgstr "Flag" -#: ../../howto/enum.rst:816 +#: ../../howto/enum.rst:817 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -1522,13 +1525,13 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:826 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:828 +#: ../../howto/enum.rst:829 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1552,13 +1555,13 @@ msgstr "" ">>> bool(Color.RED & Color.GREEN)\n" "False" -#: ../../howto/enum.rst:839 +#: ../../howto/enum.rst:840 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:842 +#: ../../howto/enum.rst:843 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1578,13 +1581,13 @@ msgstr "" ">>> Color.WHITE\n" "" -#: ../../howto/enum.rst:851 +#: ../../howto/enum.rst:852 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:855 msgid "" ">>> class Color(Flag):\n" "... BLACK = 0\n" @@ -1608,11 +1611,11 @@ msgstr "" ">>> bool(Color.BLACK)\n" "False" -#: ../../howto/enum.rst:865 +#: ../../howto/enum.rst:866 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:867 +#: ../../howto/enum.rst:868 msgid "" ">>> purple = Color.RED | Color.BLUE\n" ">>> list(purple)\n" @@ -1622,7 +1625,7 @@ msgstr "" ">>> list(purple)\n" "[, ]" -#: ../../howto/enum.rst:875 +#: ../../howto/enum.rst:876 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -1633,17 +1636,17 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:886 msgid "Others" msgstr "其他" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:888 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:891 #, fuzzy msgid "" "class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" @@ -1652,32 +1655,32 @@ msgstr "" "class IntEnum(int, Enum):\n" " pass" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:894 msgid "" "This demonstrates how similar derived enumerations can be defined; for " -"example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" +"example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:897 msgid "Some rules:" msgstr "一些規則:" -#: ../../howto/enum.rst:898 +#: ../../howto/enum.rst:899 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before the :class:" "`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " "example above." msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:902 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:904 +#: ../../howto/enum.rst:905 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:" @@ -1685,57 +1688,60 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:909 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." +"When another data type is mixed in, the :attr:`~Enum.value` attribute is " +"*not the same* as the enum member itself, although it is equivalent and will " +"compare equal." msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:912 msgid "" -"A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" +"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:914 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." +"`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " +"(such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in " +"type." msgstr "" -#: ../../howto/enum.rst:916 +#: ../../howto/enum.rst:917 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" -"`format` will use the enum's :meth:`__str__` method." +"`format` will use the enum's :meth:`~object.__str__` method." msgstr "" -#: ../../howto/enum.rst:921 +#: ../../howto/enum.rst:922 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." +"`~object.__str__` method has been reset to their data types' :meth:`~object." +"__str__` method." msgstr "" -#: ../../howto/enum.rst:929 -msgid "When to use :meth:`__new__` vs. :meth:`__init__`" +#: ../../howto/enum.rst:930 +msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" msgstr "" -#: ../../howto/enum.rst:931 +#: ../../howto/enum.rst:932 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." +":meth:`~object.__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:`~object.__new__` or :meth:`~object.__init__`, with :meth:" +"`~object.__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:936 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:938 +#: ../../howto/enum.rst:939 msgid "" ">>> class Coordinate(bytes, Enum):\n" "... \"\"\"\n" @@ -1760,114 +1766,115 @@ msgid "" "Coordinate.VY" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:963 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:968 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:971 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:973 msgid "" -":attr:`__members__` is a read-only ordered mapping of ``member_name``:" -"``member`` items. It is only available on the class." +":attr:`~enum.EnumType.__members__` is a read-only ordered mapping of " +"``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:975 +#: ../../howto/enum.rst:976 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:`~Enum." +"_value_` appropriately. Once all the members are created it is no longer " +"used." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:982 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:983 +#: ../../howto/enum.rst:984 #, fuzzy msgid ":attr:`~Enum._name_` -- name of the member" msgstr "``_name_`` -- 成員的名稱" -#: ../../howto/enum.rst:984 +#: ../../howto/enum.rst:985 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:986 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:988 msgid "" ":attr:`~Enum._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:990 +#: ../../howto/enum.rst:991 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:992 +#: ../../howto/enum.rst:993 msgid "" -":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr "" -#: ../../howto/enum.rst:994 +#: ../../howto/enum.rst:995 msgid "" -":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " "existing member. See `MultiValueEnum`_ for an example." msgstr "" -#: ../../howto/enum.rst:999 +#: ../../howto/enum.rst:1000 msgid "" "For standard :class:`Enum` classes the next value chosen is the highest " "value seen incremented by one." msgstr "" -#: ../../howto/enum.rst:1002 +#: ../../howto/enum.rst:1003 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two." msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1006 msgid "" "Prior versions would use the last seen value instead of the highest value." msgstr "" -#: ../../howto/enum.rst:1008 +#: ../../howto/enum.rst:1009 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``、``_order_``、``_generate_next_value_``" -#: ../../howto/enum.rst:1009 +#: ../../howto/enum.rst:1010 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1011 msgid "``_add_alias_``, ``_add_value_alias_``" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1013 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::" +"To help keep Python 2 / Python 3 code in sync an :attr:`~Enum._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:1016 +#: ../../howto/enum.rst:1017 msgid "" ">>> class Color(Enum):\n" "... _order_ = 'RED GREEN BLUE'\n" @@ -1893,27 +1900,27 @@ msgstr "" " ['RED', 'BLUE', 'GREEN']\n" " ['RED', 'GREEN', 'BLUE']" -#: ../../howto/enum.rst:1030 +#: ../../howto/enum.rst:1031 msgid "" -"In Python 2 code the :attr:`_order_` attribute is necessary as definition " -"order is lost before it can be recorded." +"In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " +"definition order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:1035 +#: ../../howto/enum.rst:1036 msgid "_Private__names" msgstr "_Private__names" -#: ../../howto/enum.rst:1037 +#: ../../howto/enum.rst:1038 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1044 +#: ../../howto/enum.rst:1045 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1047 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -1923,18 +1930,18 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1058 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1059 +#: ../../howto/enum.rst:1060 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:1063 +#: ../../howto/enum.rst:1064 msgid "" ">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" "... example = '11', 16 # so x='11' and base=16\n" @@ -1943,11 +1950,11 @@ msgid "" "17" msgstr "" -#: ../../howto/enum.rst:1071 +#: ../../howto/enum.rst:1072 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1073 +#: ../../howto/enum.rst:1074 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 " @@ -1956,7 +1963,7 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1079 +#: ../../howto/enum.rst:1080 msgid "" "def __bool__(self):\n" " return bool(self.value)" @@ -1964,22 +1971,22 @@ msgstr "" "def __bool__(self):\n" " return bool(self.value)" -#: ../../howto/enum.rst:1082 +#: ../../howto/enum.rst:1083 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1086 +#: ../../howto/enum.rst:1087 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1088 +#: ../../howto/enum.rst:1089 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:1092 +#: ../../howto/enum.rst:1093 msgid "" ">>> dir(Planet) \n" "['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " @@ -1995,17 +2002,17 @@ msgstr "" "['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " "'surface_gravity', 'value']" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1100 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1101 +#: ../../howto/enum.rst:1102 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:1104 +#: ../../howto/enum.rst:1105 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -2021,15 +2028,15 @@ msgid "" "" msgstr "" -#: ../../howto/enum.rst:1119 +#: ../../howto/enum.rst:1120 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1122 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1124 msgid "" ">>> class Color(IntFlag):\n" "... BLACK = 0\n" @@ -2049,23 +2056,23 @@ msgstr "" "... WHITE = RED | GREEN | BLUE\n" "..." -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1133 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1134 +#: ../../howto/enum.rst:1135 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1135 +#: ../../howto/enum.rst:1136 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1136 +#: ../../howto/enum.rst:1137 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1138 +#: ../../howto/enum.rst:1139 msgid "" ">>> list(Color.WHITE)\n" "[, , ]" @@ -2073,13 +2080,13 @@ msgstr "" ">>> list(Color.WHITE)\n" "[, , ]" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1142 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1144 +#: ../../howto/enum.rst:1145 msgid "" ">>> Color.BLUE\n" "\n" @@ -2093,11 +2100,11 @@ msgstr "" ">>> ~Color.BLUE\n" "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1151 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1152 +#: ../../howto/enum.rst:1153 msgid "" ">>> (Color.RED | Color.GREEN).name\n" "'RED|GREEN'\n" @@ -2111,11 +2118,11 @@ msgid "" "True" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1164 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1166 msgid "" ">>> Color.RED | Color.BLUE\n" "\n" @@ -2135,13 +2142,13 @@ msgstr "" ">>> Color(0)\n" "" -#: ../../howto/enum.rst:1174 +#: ../../howto/enum.rst:1175 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" ">>> Color.BLACK in Color.WHITE\n" "True" @@ -2149,13 +2156,13 @@ msgstr "" ">>> Color.BLACK in Color.WHITE\n" "True" -#: ../../howto/enum.rst:1180 +#: ../../howto/enum.rst:1181 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1183 +#: ../../howto/enum.rst:1184 msgid "" ">>> Color.PURPLE in Color.WHITE\n" "True\n" @@ -2169,77 +2176,78 @@ msgstr "" ">>> Color.GREEN in Color.PURPLE\n" "False" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1190 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:1192 +#: ../../howto/enum.rst:1193 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1194 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1195 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1198 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1199 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1199 +#: ../../howto/enum.rst:1200 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 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:1209 +#: ../../howto/enum.rst:1210 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1212 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1216 +#: ../../howto/enum.rst:1217 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1218 +#: ../../howto/enum.rst:1219 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" -"`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " -"allow one to do things with an :class:`Enum` class that fail on a typical " -"class, such as ``list(Color)`` or ``some_enum_var in Color``. :class:" -"`EnumType` is responsible for ensuring that various other methods on the " -"final :class:`Enum` class are correct (such as :meth:`__new__`, :meth:" -"`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." +"`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " +"and other methods that allow one to do things with an :class:`Enum` class " +"that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in " +"Color``. :class:`EnumType` is responsible for ensuring that various other " +"methods on the final :class:`Enum` class are correct (such as :meth:`~object." +"__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" +"`~object.__repr__`)." msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1228 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1229 +#: ../../howto/enum.rst:1230 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 " @@ -2248,30 +2256,30 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1235 +#: ../../howto/enum.rst:1236 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1238 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 " -"itself, and then puts a custom :meth:`__new__` in place to ensure that no " -"new ones are ever instantiated by returning only the existing member " +"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " +"that no new ones are ever instantiated by returning only the existing member " "instances." msgstr "" -#: ../../howto/enum.rst:1243 +#: ../../howto/enum.rst:1244 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 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:1248 +#: ../../howto/enum.rst:1249 msgid "" ">>> list(Color)\n" "[, , ]" @@ -2279,17 +2287,17 @@ msgstr "" ">>> list(Color)\n" "[, , ]" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1252 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1254 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1256 +#: ../../howto/enum.rst:1257 msgid "" ">>> ~Color.RED\n" "" @@ -2297,13 +2305,13 @@ msgstr "" ">>> ~Color.RED\n" "" -#: ../../howto/enum.rst:1259 +#: ../../howto/enum.rst:1260 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1263 msgid "" ">>> len(Color.PURPLE)\n" "2" @@ -2311,11 +2319,11 @@ msgstr "" ">>> len(Color.PURPLE)\n" "2" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1270 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1272 +#: ../../howto/enum.rst:1273 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -2323,50 +2331,50 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1280 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1281 +#: ../../howto/enum.rst:1282 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:1284 +#: ../../howto/enum.rst:1285 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1285 +#: ../../howto/enum.rst:1286 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1286 +#: ../../howto/enum.rst:1287 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1287 +#: ../../howto/enum.rst:1288 msgid "" -"use a tuple as the value and a custom :meth:`__new__` to replace the tuple " -"with an :class:`int` value" +"use a tuple as the value and a custom :meth:`~object.__new__` to replace the " +"tuple with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1290 +#: ../../howto/enum.rst:1291 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:1296 +#: ../../howto/enum.rst:1297 msgid "Using :class:`auto`" msgstr "使用 :class:`auto`" -#: ../../howto/enum.rst:1298 +#: ../../howto/enum.rst:1299 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1300 +#: ../../howto/enum.rst:1301 msgid "" ">>> class Color(Enum):\n" "... RED = auto()\n" @@ -2384,15 +2392,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1310 +#: ../../howto/enum.rst:1311 msgid "Using :class:`object`" msgstr "使用 :class:`object`" -#: ../../howto/enum.rst:1312 +#: ../../howto/enum.rst:1313 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1314 +#: ../../howto/enum.rst:1315 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2410,13 +2418,13 @@ msgstr "" ">>> Color.GREEN \n" ">" -#: ../../howto/enum.rst:1322 +#: ../../howto/enum.rst:1323 msgid "" "This is also a good example of why you might want to write your own :meth:" -"`__repr__`::" +"`~object.__repr__`::" msgstr "" -#: ../../howto/enum.rst:1325 +#: ../../howto/enum.rst:1326 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2438,15 +2446,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1339 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1340 +#: ../../howto/enum.rst:1341 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1342 +#: ../../howto/enum.rst:1343 msgid "" ">>> class Color(Enum):\n" "... RED = 'stop'\n" @@ -2464,15 +2472,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1352 -msgid "Using a custom :meth:`__new__`" +#: ../../howto/enum.rst:1353 +msgid "Using a custom :meth:`~object.__new__`" msgstr "" -#: ../../howto/enum.rst:1354 -msgid "Using an auto-numbering :meth:`__new__` would look like::" +#: ../../howto/enum.rst:1355 +msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1356 +#: ../../howto/enum.rst:1357 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls):\n" @@ -2504,13 +2512,13 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1371 +#: ../../howto/enum.rst:1372 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1373 +#: ../../howto/enum.rst:1374 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls, *args): # this is the only change from above\n" @@ -2521,13 +2529,13 @@ msgid "" "..." msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1382 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1384 +#: ../../howto/enum.rst:1385 msgid "" ">>> class Swatch(AutoNumber):\n" "... def __init__(self, pantone='unknown'):\n" @@ -2544,35 +2552,35 @@ msgid "" "'unknown'" msgstr "" -#: ../../howto/enum.rst:1400 +#: ../../howto/enum.rst:1401 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." +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1406 +#: ../../howto/enum.rst:1407 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1409 +#: ../../howto/enum.rst:1410 msgid "obj = int.__new__(cls, value)" msgstr "obj = int.__new__(cls, value)" -#: ../../howto/enum.rst:1413 +#: ../../howto/enum.rst:1414 msgid "OrderedEnum" msgstr "OrderedEnum" -#: ../../howto/enum.rst:1415 +#: ../../howto/enum.rst:1416 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:1419 +#: ../../howto/enum.rst:1420 msgid "" ">>> class OrderedEnum(Enum):\n" "... def __ge__(self, other):\n" @@ -2630,17 +2638,17 @@ msgstr "" ">>> Grade.C < Grade.A\n" "True" -#: ../../howto/enum.rst:1449 +#: ../../howto/enum.rst:1450 msgid "DuplicateFreeEnum" msgstr "DuplicateFreeEnum" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1452 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1454 +#: ../../howto/enum.rst:1455 msgid "" ">>> class DuplicateFreeEnum(Enum):\n" "... def __init__(self, *args):\n" @@ -2664,22 +2672,22 @@ msgid "" "ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" msgstr "" -#: ../../howto/enum.rst:1476 +#: ../../howto/enum.rst:1477 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:1482 +#: ../../howto/enum.rst:1483 msgid "MultiValueEnum" msgstr "" -#: ../../howto/enum.rst:1484 +#: ../../howto/enum.rst:1485 msgid "Supports having more than one value per member::" msgstr "" -#: ../../howto/enum.rst:1486 +#: ../../howto/enum.rst:1487 msgid "" ">>> class MultiValueEnum(Enum):\n" "... def __new__(cls, value, *values):\n" @@ -2699,17 +2707,17 @@ msgid "" "" msgstr "" -#: ../../howto/enum.rst:1505 +#: ../../howto/enum.rst:1506 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1507 +#: ../../howto/enum.rst:1508 msgid "" -"If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " -"member will be passed to those methods::" +"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " +"of the enum member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1510 +#: ../../howto/enum.rst:1511 msgid "" ">>> class Planet(Enum):\n" "... MERCURY = (3.303e+23, 2.4397e6)\n" @@ -2735,15 +2743,15 @@ msgid "" "9.802652743337129" msgstr "" -#: ../../howto/enum.rst:1536 +#: ../../howto/enum.rst:1537 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1538 -msgid "An example to show the :attr:`_ignore_` attribute in use::" +#: ../../howto/enum.rst:1539 +msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1540 +#: ../../howto/enum.rst:1541 msgid "" ">>> from datetime import timedelta\n" ">>> class Period(timedelta, Enum):\n" @@ -2761,11 +2769,11 @@ msgid "" "timedelta(days=366)>]" msgstr "" -#: ../../howto/enum.rst:1557 +#: ../../howto/enum.rst:1558 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1559 +#: ../../howto/enum.rst:1560 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/argparse.po b/library/argparse.po index 2d5ad6cd0f..95b39fd4f1 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -1289,14 +1289,16 @@ msgstr "" msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " -"and :meth:`!format_usage` methods." +"and :meth:`!format_usage` methods. You can also register custom actions " +"using the :meth:`~ArgumentParser.register` method and reference them by " +"their registered name." msgstr "" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:758 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:759 +#: ../../library/argparse.rst:760 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1317,15 +1319,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:778 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:783 +#: ../../library/argparse.rst:784 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:785 +#: ../../library/argparse.rst:786 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1334,13 +1336,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:791 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:793 +#: ../../library/argparse.rst:794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1354,13 +1356,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:799 +#: ../../library/argparse.rst:800 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:804 +#: ../../library/argparse.rst:805 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1370,7 +1372,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:811 +#: ../../library/argparse.rst:812 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1392,13 +1394,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:821 +#: ../../library/argparse.rst:822 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:825 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1424,7 +1426,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:838 +#: ../../library/argparse.rst:839 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1432,7 +1434,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:843 +#: ../../library/argparse.rst:844 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1448,14 +1450,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:852 +#: ../../library/argparse.rst:853 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:856 +#: ../../library/argparse.rst:857 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1473,7 +1475,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:864 +#: ../../library/argparse.rst:865 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1482,11 +1484,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:874 +#: ../../library/argparse.rst:875 msgid "const" msgstr "" -#: ../../library/argparse.rst:876 +#: ../../library/argparse.rst:877 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1494,7 +1496,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:880 +#: ../../library/argparse.rst:881 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1504,7 +1506,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:888 +#: ../../library/argparse.rst:889 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1514,17 +1516,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:895 +#: ../../library/argparse.rst:896 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:902 +#: ../../library/argparse.rst:903 msgid "default" msgstr "" -#: ../../library/argparse.rst:904 +#: ../../library/argparse.rst:905 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1534,7 +1536,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:911 +#: ../../library/argparse.rst:912 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1550,13 +1552,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:918 +#: ../../library/argparse.rst:919 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:921 +#: ../../library/argparse.rst:922 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1568,7 +1570,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:926 +#: ../../library/argparse.rst:927 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1576,7 +1578,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:931 +#: ../../library/argparse.rst:932 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1590,13 +1592,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:937 +#: ../../library/argparse.rst:938 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:941 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1612,20 +1614,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:947 +#: ../../library/argparse.rst:948 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:951 +#: ../../library/argparse.rst:952 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:954 +#: ../../library/argparse.rst:955 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1641,11 +1643,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:965 +#: ../../library/argparse.rst:966 msgid "type" msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:968 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1654,25 +1656,26 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:973 +#: ../../library/argparse.rst:974 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:976 +#: ../../library/argparse.rst:977 msgid "" -"The argument to ``type`` can be any callable that accepts a single string. " -"If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" +"The argument to ``type`` can be a callable that accepts a single string or " +"the name of a registered type (see :meth:`~ArgumentParser.register`) If the " +"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" "`ValueError`, the exception is caught and a nicely formatted error message " -"is displayed. No other exception types are handled." +"is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:981 +#: ../../library/argparse.rst:983 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:985 #, fuzzy msgid "" "import argparse\n" @@ -1700,11 +1703,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:996 +#: ../../library/argparse.rst:998 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:998 +#: ../../library/argparse.rst:1000 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1722,14 +1725,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1008 +#: ../../library/argparse.rst:1010 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1012 +#: ../../library/argparse.rst:1014 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1737,7 +1740,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1017 +#: ../../library/argparse.rst:1019 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1745,7 +1748,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1022 +#: ../../library/argparse.rst:1024 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1755,17 +1758,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1029 +#: ../../library/argparse.rst:1031 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1038 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1038 +#: ../../library/argparse.rst:1040 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1774,7 +1777,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1044 +#: ../../library/argparse.rst:1046 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1794,26 +1797,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1053 +#: ../../library/argparse.rst:1055 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1057 +#: ../../library/argparse.rst:1059 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1060 +#: ../../library/argparse.rst:1062 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1063 +#: ../../library/argparse.rst:1065 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1821,11 +1824,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1072 +#: ../../library/argparse.rst:1074 msgid "required" msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1076 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1833,7 +1836,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1079 +#: ../../library/argparse.rst:1081 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1851,24 +1854,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1087 +#: ../../library/argparse.rst:1089 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1093 +#: ../../library/argparse.rst:1095 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:1102 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1102 +#: ../../library/argparse.rst:1104 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1876,7 +1879,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1107 +#: ../../library/argparse.rst:1109 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1885,7 +1888,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1112 +#: ../../library/argparse.rst:1114 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1911,19 +1914,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1124 +#: ../../library/argparse.rst:1126 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1127 +#: ../../library/argparse.rst:1129 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:1132 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1941,11 +1944,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1142 +#: ../../library/argparse.rst:1144 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1146 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -1957,7 +1960,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1153 +#: ../../library/argparse.rst:1155 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1989,11 +1992,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1168 +#: ../../library/argparse.rst:1170 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1170 +#: ../../library/argparse.rst:1172 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2025,21 +2028,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1185 +#: ../../library/argparse.rst:1187 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1189 +#: ../../library/argparse.rst:1191 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1193 +#: ../../library/argparse.rst:1195 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2063,11 +2066,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1210 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1210 +#: ../../library/argparse.rst:1212 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2077,7 +2080,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1217 +#: ../../library/argparse.rst:1219 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2089,7 +2092,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1222 +#: ../../library/argparse.rst:1224 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2101,7 +2104,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1231 +#: ../../library/argparse.rst:1233 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2119,11 +2122,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1239 +#: ../../library/argparse.rst:1241 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1241 +#: ../../library/argparse.rst:1243 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2135,11 +2138,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1252 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1252 +#: ../../library/argparse.rst:1254 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2150,7 +2153,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1262 +#: ../../library/argparse.rst:1264 #, fuzzy msgid "" ">>> import argparse\n" @@ -2169,11 +2172,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1275 +#: ../../library/argparse.rst:1277 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1277 +#: ../../library/argparse.rst:1279 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2181,7 +2184,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1286 +#: ../../library/argparse.rst:1288 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2190,7 +2193,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1292 +#: ../../library/argparse.rst:1294 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2199,46 +2202,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1302 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1303 +#: ../../library/argparse.rst:1305 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1307 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1311 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1313 +#: ../../library/argparse.rst:1315 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1317 +#: ../../library/argparse.rst:1319 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1322 +#: ../../library/argparse.rst:1324 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2246,47 +2249,47 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1330 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1332 +#: ../../library/argparse.rst:1334 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1335 +#: ../../library/argparse.rst:1337 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1339 +#: ../../library/argparse.rst:1341 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1344 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1347 +#: ../../library/argparse.rst:1349 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1351 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1353 +#: ../../library/argparse.rst:1355 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2304,14 +2307,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1361 +#: ../../library/argparse.rst:1363 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1365 +#: ../../library/argparse.rst:1367 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2319,13 +2322,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1368 +#: ../../library/argparse.rst:1370 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1371 +#: ../../library/argparse.rst:1373 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2333,13 +2336,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1374 +#: ../../library/argparse.rst:1376 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1377 +#: ../../library/argparse.rst:1379 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2355,11 +2358,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1386 +#: ../../library/argparse.rst:1388 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1388 +#: ../../library/argparse.rst:1390 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2367,7 +2370,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1393 +#: ../../library/argparse.rst:1395 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2389,11 +2392,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1414 +#: ../../library/argparse.rst:1416 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1416 +#: ../../library/argparse.rst:1418 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2405,7 +2408,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1424 +#: ../../library/argparse.rst:1426 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2438,7 +2441,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1456 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2446,7 +2449,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1459 +#: ../../library/argparse.rst:1461 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2454,24 +2457,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1462 +#: ../../library/argparse.rst:1464 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1470 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1470 +#: ../../library/argparse.rst:1472 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1474 +#: ../../library/argparse.rst:1476 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2495,17 +2498,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1485 +#: ../../library/argparse.rst:1487 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1491 +#: ../../library/argparse.rst:1493 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1493 +#: ../../library/argparse.rst:1495 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2513,7 +2516,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1498 +#: ../../library/argparse.rst:1500 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2539,24 +2542,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1513 +#: ../../library/argparse.rst:1515 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1517 +#: ../../library/argparse.rst:1519 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1522 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1524 +#: ../../library/argparse.rst:1526 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2570,14 +2573,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1530 +#: ../../library/argparse.rst:1532 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1536 msgid "" ">>> class C:\n" "... pass\n" @@ -2599,15 +2602,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1546 +#: ../../library/argparse.rst:1548 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1551 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1556 +#: ../../library/argparse.rst:1558 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2622,69 +2625,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1568 +#: ../../library/argparse.rst:1570 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1572 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1574 +#: ../../library/argparse.rst:1576 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1577 +#: ../../library/argparse.rst:1579 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1581 +#: ../../library/argparse.rst:1583 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1586 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1587 +#: ../../library/argparse.rst:1589 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1590 +#: ../../library/argparse.rst:1592 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1593 +#: ../../library/argparse.rst:1595 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1595 +#: ../../library/argparse.rst:1597 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1598 +#: ../../library/argparse.rst:1600 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1600 +#: ../../library/argparse.rst:1602 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2707,7 +2710,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1619 +#: ../../library/argparse.rst:1621 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2717,7 +2720,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1626 +#: ../../library/argparse.rst:1628 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2726,7 +2729,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1634 +#: ../../library/argparse.rst:1636 #, fuzzy msgid "" ">>> parser.parse_args(['--help'])\n" @@ -2785,14 +2788,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1664 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1668 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2828,7 +2831,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1683 +#: ../../library/argparse.rst:1685 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2836,7 +2839,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1688 +#: ../../library/argparse.rst:1690 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2852,13 +2855,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1695 +#: ../../library/argparse.rst:1697 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1711 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2866,7 +2869,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1714 +#: ../../library/argparse.rst:1716 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2901,7 +2904,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1746 +#: ../../library/argparse.rst:1748 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2911,7 +2914,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1753 +#: ../../library/argparse.rst:1755 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2931,15 +2934,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1762 +#: ../../library/argparse.rst:1764 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1767 +#: ../../library/argparse.rst:1769 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1771 +#: ../../library/argparse.rst:1773 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2948,7 +2951,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1777 +#: ../../library/argparse.rst:1779 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2966,14 +2969,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1783 +#: ../../library/argparse.rst:1785 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1787 +#: ../../library/argparse.rst:1789 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2985,15 +2988,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1792 +#: ../../library/argparse.rst:1794 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1797 +#: ../../library/argparse.rst:1799 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1802 +#: ../../library/argparse.rst:1804 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3002,7 +3005,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1808 +#: ../../library/argparse.rst:1810 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3026,7 +3029,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1819 +#: ../../library/argparse.rst:1821 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3037,7 +3040,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1827 +#: ../../library/argparse.rst:1829 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3075,7 +3078,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1845 +#: ../../library/argparse.rst:1847 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3084,13 +3087,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1850 +#: ../../library/argparse.rst:1852 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1853 +#: ../../library/argparse.rst:1855 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3098,18 +3101,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1861 +#: ../../library/argparse.rst:1863 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1865 +#: ../../library/argparse.rst:1867 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1869 +#: ../../library/argparse.rst:1871 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3135,14 +3138,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1881 +#: ../../library/argparse.rst:1883 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1885 +#: ../../library/argparse.rst:1887 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3160,7 +3163,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1893 +#: ../../library/argparse.rst:1895 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3168,7 +3171,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1901 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3204,7 +3207,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1916 +#: ../../library/argparse.rst:1918 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3212,11 +3215,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1924 +#: ../../library/argparse.rst:1926 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1928 +#: ../../library/argparse.rst:1930 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3225,7 +3228,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1934 +#: ../../library/argparse.rst:1936 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3239,12 +3242,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1940 +#: ../../library/argparse.rst:1942 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1944 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3258,20 +3261,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1950 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1956 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1958 +#: ../../library/argparse.rst:1960 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3283,54 +3286,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1965 +#: ../../library/argparse.rst:1967 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1967 +#: ../../library/argparse.rst:1969 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1973 +#: ../../library/argparse.rst:1975 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1981 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1983 +#: ../../library/argparse.rst:1985 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1988 +#: ../../library/argparse.rst:1990 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1995 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:1998 +#: ../../library/argparse.rst:2000 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2002 +#: ../../library/argparse.rst:2004 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3341,7 +3344,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2011 +#: ../../library/argparse.rst:2013 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3355,7 +3358,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2018 +#: ../../library/argparse.rst:2020 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3363,11 +3366,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2025 +#: ../../library/argparse.rst:2027 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2029 +#: ../../library/argparse.rst:2031 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3375,20 +3378,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2034 +#: ../../library/argparse.rst:2036 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2038 +#: ../../library/argparse.rst:2040 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2041 +#: ../../library/argparse.rst:2043 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3398,18 +3401,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2047 +#: ../../library/argparse.rst:2049 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2053 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:2057 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3423,17 +3426,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:2065 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2068 +#: ../../library/argparse.rst:2070 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2073 +#: ../../library/argparse.rst:2075 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3441,7 +3444,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2078 +#: ../../library/argparse.rst:2080 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3449,7 +3452,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2083 +#: ../../library/argparse.rst:2085 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3457,7 +3460,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2089 +#: ../../library/argparse.rst:2091 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3477,7 +3480,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2098 +#: ../../library/argparse.rst:2100 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3485,43 +3488,84 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2107 +#: ../../library/argparse.rst:2109 +msgid "Registering custom types or actions" +msgstr "" + +#: ../../library/argparse.rst:2113 +msgid "" +"Sometimes it's desirable to use a custom string in error messages to provide " +"more user-friendly output. In these cases, :meth:`!register` can be used to " +"register custom actions or types with a parser and allow you to reference " +"the type by their registered name instead of their callable name." +msgstr "" + +#: ../../library/argparse.rst:2118 +msgid "" +"The :meth:`!register` method accepts three arguments - a *registry_name*, " +"specifying the internal registry where the object will be stored (e.g., " +"``action``, ``type``), *value*, which is the key under which the object will " +"be registered, and object, the callable to be registered." +msgstr "" + +#: ../../library/argparse.rst:2123 +msgid "" +"The following example shows how to register a custom type with a parser::" +msgstr "" + +#: ../../library/argparse.rst:2125 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" +">>> parser.add_argument('--foo', type='hexadecimal integer')\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, " +"default=None, type='hexadecimal integer', choices=None, required=False, " +"help=None, metavar=None, deprecated=False)\n" +">>> parser.parse_args(['--foo', '0xFA'])\n" +"Namespace(foo=250)\n" +">>> parser.parse_args(['--foo', '1.2'])\n" +"usage: PROG [-h] [--foo FOO]\n" +"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" +msgstr "" + +#: ../../library/argparse.rst:2137 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2141 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2113 +#: ../../library/argparse.rst:2143 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2118 +#: ../../library/argparse.rst:2148 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2122 +#: ../../library/argparse.rst:2152 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:802 +#: ../../library/argparse.rst:803 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:802 ../../library/argparse.rst:836 -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:803 ../../library/argparse.rst:837 +#: ../../library/argparse.rst:851 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:836 +#: ../../library/argparse.rst:837 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:851 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 915398e208..b29a0e1e71 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -42,7 +42,7 @@ msgstr "" msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "這是一個使用 asyncio 串流編寫的 TCP echo 客戶端範例: ::" -#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:415 +#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:419 msgid "" "import asyncio\n" "\n" @@ -110,7 +110,7 @@ msgstr "" "回傳的 *reader* 和 *writer* 物件是 :class:`StreamReader` 和 :class:" "`StreamWriter` 類別的實例。" -#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:109 +#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:110 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -124,7 +124,7 @@ msgid "" "create_connection`." msgstr "其餘的引數會直接傳遞到 :meth:`loop.create_connection`。" -#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:147 +#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:151 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." @@ -139,22 +139,22 @@ msgstr "新增 *ssl_handshake_timeout* 參數。" msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 -#: ../../library/asyncio-stream.rst:157 ../../library/asyncio-stream.rst:187 +#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:126 +#: ../../library/asyncio-stream.rst:161 ../../library/asyncio-stream.rst:191 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 -#: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 -#: ../../library/asyncio-stream.rst:383 +#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:129 +#: ../../library/asyncio-stream.rst:164 ../../library/asyncio-stream.rst:194 +#: ../../library/asyncio-stream.rst:387 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-stream.rst:98 +#: ../../library/asyncio-stream.rst:99 msgid "Start a socket server." msgstr "啟動 socket 伺服器。" -#: ../../library/asyncio-stream.rst:100 +#: ../../library/asyncio-stream.rst:101 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -165,7 +165,7 @@ msgstr "" "式會接收到一對引數 ``(reader, writer)``,分別為 :class:`StreamReader` 和 :" "class:`StreamWriter` 的實例。" -#: ../../library/asyncio-stream.rst:105 +#: ../../library/asyncio-stream.rst:106 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " @@ -175,43 +175,48 @@ msgstr "" "ref:`協程函式 `;如果它是一個協程函式,它將自動作為 :class:`Task` " "來被排程。" -#: ../../library/asyncio-stream.rst:113 +#: ../../library/asyncio-stream.rst:114 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "剩下的引數將會直接傳遞給 :meth:`loop.create_server`。" -#: ../../library/asyncio-stream.rst:118 ../../library/asyncio-stream.rst:177 +#: ../../library/asyncio-stream.rst:119 ../../library/asyncio-stream.rst:181 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-stream.rst:122 +#: ../../library/asyncio-stream.rst:123 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。" -#: ../../library/asyncio-stream.rst:133 +#: ../../library/asyncio-stream.rst:132 +#, fuzzy +msgid "Added the *keep_alive* parameter." +msgstr "新增 *ssl_handshake_timeout* 參數。" + +#: ../../library/asyncio-stream.rst:137 msgid "Unix Sockets" msgstr "Unix Sockets" -#: ../../library/asyncio-stream.rst:138 +#: ../../library/asyncio-stream.rst:142 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "建立一個 Unix socket 連線並回傳一對 ``(reader, writer)``。" -#: ../../library/asyncio-stream.rst:141 +#: ../../library/asyncio-stream.rst:145 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:143 +#: ../../library/asyncio-stream.rst:147 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 +#: ../../library/asyncio-stream.rst:155 ../../library/asyncio-stream.rst:185 msgid "Availability" msgstr "" -#: ../../library/asyncio-stream.rst:153 +#: ../../library/asyncio-stream.rst:157 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" @@ -219,19 +224,19 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是個 :term:`path-like " "object`" -#: ../../library/asyncio-stream.rst:169 +#: ../../library/asyncio-stream.rst:173 msgid "Start a Unix socket server." msgstr "啟動一個 Unix socket 伺服器。" -#: ../../library/asyncio-stream.rst:171 +#: ../../library/asyncio-stream.rst:175 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:173 +#: ../../library/asyncio-stream.rst:177 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:183 +#: ../../library/asyncio-stream.rst:187 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." @@ -239,11 +244,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可以是" "個 :term:`path-like object`。" -#: ../../library/asyncio-stream.rst:195 +#: ../../library/asyncio-stream.rst:199 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:199 +#: ../../library/asyncio-stream.rst:203 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" @@ -252,7 +257,7 @@ msgstr "" "表示一個有提供 API 來從 IO 串流中讀取資料的 reader 物件。作為一個 :term:" "`asynchronous iterable`,此物件支援 :keyword:`async for` 陳述式。" -#: ../../library/asyncio-stream.rst:203 +#: ../../library/asyncio-stream.rst:207 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -260,15 +265,15 @@ msgstr "" "不建議直接實例化 *StreamReader* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:209 +#: ../../library/asyncio-stream.rst:213 msgid "Acknowledge the EOF." msgstr "" -#: ../../library/asyncio-stream.rst:213 +#: ../../library/asyncio-stream.rst:217 msgid "Read up to *n* bytes from the stream." msgstr "從串流中讀取至多 *n* 個位元組的資料。" -#: ../../library/asyncio-stream.rst:215 +#: ../../library/asyncio-stream.rst:219 msgid "" "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, " @@ -278,39 +283,39 @@ msgstr "" "的 :class:`bytes`。讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物" "件。" -#: ../../library/asyncio-stream.rst:220 +#: ../../library/asyncio-stream.rst:224 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." msgstr "如果 *n* 為 ``0``,則立即回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:222 +#: ../../library/asyncio-stream.rst:226 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:229 +#: ../../library/asyncio-stream.rst:233 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:232 +#: ../../library/asyncio-stream.rst:236 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:235 +#: ../../library/asyncio-stream.rst:239 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:240 +#: ../../library/asyncio-stream.rst:244 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:242 +#: ../../library/asyncio-stream.rst:246 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -320,11 +325,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:248 +#: ../../library/asyncio-stream.rst:252 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:250 +#: ../../library/asyncio-stream.rst:254 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -332,7 +337,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:254 +#: ../../library/asyncio-stream.rst:258 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 " @@ -341,7 +346,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:258 +#: ../../library/asyncio-stream.rst:262 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -352,7 +357,7 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:263 +#: ../../library/asyncio-stream.rst:267 msgid "" "The *separator* may also be a tuple of separators. In this case the return " "value will be the shortest possible that has any separator as the suffix. " @@ -360,24 +365,24 @@ msgid "" "separator is considered to be the one that matched." msgstr "" -#: ../../library/asyncio-stream.rst:273 +#: ../../library/asyncio-stream.rst:277 msgid "The *separator* parameter may now be a :class:`tuple` of separators." msgstr "" -#: ../../library/asyncio-stream.rst:278 +#: ../../library/asyncio-stream.rst:282 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:283 +#: ../../library/asyncio-stream.rst:287 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:287 +#: ../../library/asyncio-stream.rst:291 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:290 +#: ../../library/asyncio-stream.rst:294 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -385,7 +390,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:296 +#: ../../library/asyncio-stream.rst:300 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 " @@ -394,11 +399,11 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:300 ../../library/asyncio-stream.rst:312 +#: ../../library/asyncio-stream.rst:304 ../../library/asyncio-stream.rst:316 msgid "The method should be used along with the ``drain()`` method::" msgstr "此方法應當與 ``drain()`` 方法一起使用: ::" -#: ../../library/asyncio-stream.rst:302 +#: ../../library/asyncio-stream.rst:306 msgid "" "stream.write(data)\n" "await stream.drain()" @@ -406,7 +411,7 @@ msgstr "" "stream.write(data)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:307 +#: ../../library/asyncio-stream.rst:311 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 " @@ -415,7 +420,7 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:314 +#: ../../library/asyncio-stream.rst:318 msgid "" "stream.writelines(lines)\n" "await stream.drain()" @@ -423,17 +428,17 @@ msgstr "" "stream.writelines(lines)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:319 +#: ../../library/asyncio-stream.rst:323 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:321 +#: ../../library/asyncio-stream.rst:325 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "此方法應與 ``wait_closed()`` 方法一起使用,但並非強制: ::" -#: ../../library/asyncio-stream.rst:324 +#: ../../library/asyncio-stream.rst:328 msgid "" "stream.close()\n" "await stream.wait_closed()" @@ -441,7 +446,7 @@ msgstr "" "stream.close()\n" "await stream.wait_closed()" -#: ../../library/asyncio-stream.rst:329 +#: ../../library/asyncio-stream.rst:333 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -449,26 +454,26 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:334 +#: ../../library/asyncio-stream.rst:338 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:339 +#: ../../library/asyncio-stream.rst:343 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:347 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:348 +#: ../../library/asyncio-stream.rst:352 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "等待直到可以繼續寫入到串流。範例: ::" -#: ../../library/asyncio-stream.rst:351 +#: ../../library/asyncio-stream.rst:355 msgid "" "writer.write(data)\n" "await writer.drain()" @@ -476,7 +481,7 @@ msgstr "" "writer.write(data)\n" "await writer.drain()" -#: ../../library/asyncio-stream.rst:354 +#: ../../library/asyncio-stream.rst:358 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()* " @@ -488,48 +493,48 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:364 +#: ../../library/asyncio-stream.rst:368 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:366 +#: ../../library/asyncio-stream.rst:370 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-stream.rst:368 +#: ../../library/asyncio-stream.rst:372 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:370 +#: ../../library/asyncio-stream.rst:374 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:373 +#: ../../library/asyncio-stream.rst:377 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:377 +#: ../../library/asyncio-stream.rst:381 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-stream.rst:389 +#: ../../library/asyncio-stream.rst:393 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:396 +#: ../../library/asyncio-stream.rst:400 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:398 +#: ../../library/asyncio-stream.rst:402 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -538,19 +543,19 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:406 +#: ../../library/asyncio-stream.rst:410 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:411 +#: ../../library/asyncio-stream.rst:415 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:413 +#: ../../library/asyncio-stream.rst:417 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端: ::" -#: ../../library/asyncio-stream.rst:437 +#: ../../library/asyncio-stream.rst:441 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -559,15 +564,15 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:444 +#: ../../library/asyncio-stream.rst:448 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:446 +#: ../../library/asyncio-stream.rst:450 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式: ::" -#: ../../library/asyncio-stream.rst:448 +#: ../../library/asyncio-stream.rst:452 msgid "" "import asyncio\n" "\n" @@ -627,7 +632,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../library/asyncio-stream.rst:480 +#: ../../library/asyncio-stream.rst:484 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -636,16 +641,16 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:485 +#: ../../library/asyncio-stream.rst:489 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:487 +#: ../../library/asyncio-stream.rst:491 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例: ::" -#: ../../library/asyncio-stream.rst:489 +#: ../../library/asyncio-stream.rst:493 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -684,34 +689,34 @@ msgid "" "asyncio.run(print_http_headers(url))" msgstr "" -#: ../../library/asyncio-stream.rst:526 +#: ../../library/asyncio-stream.rst:530 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-stream.rst:528 +#: ../../library/asyncio-stream.rst:532 msgid "python example.py http://example.com/path/page.html" msgstr "python example.py http://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:530 +#: ../../library/asyncio-stream.rst:534 msgid "or with HTTPS::" msgstr "或使用 HTTPS: ::" -#: ../../library/asyncio-stream.rst:532 +#: ../../library/asyncio-stream.rst:536 msgid "python example.py https://example.com/path/page.html" msgstr "python example.py https://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:538 +#: ../../library/asyncio-stream.rst:542 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:540 +#: ../../library/asyncio-stream.rst:544 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" "等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程: ::" -#: ../../library/asyncio-stream.rst:543 +#: ../../library/asyncio-stream.rst:547 msgid "" "import asyncio\n" "import socket\n" @@ -744,7 +749,7 @@ msgid "" "asyncio.run(wait_for_data())" msgstr "" -#: ../../library/asyncio-stream.rst:575 +#: ../../library/asyncio-stream.rst:579 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -754,7 +759,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:579 +#: ../../library/asyncio-stream.rst:583 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index ffee4a801a..cba20e1ee9 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: 2022-02-09 19:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -402,8 +402,9 @@ msgstr "" #: ../../library/asyncio-sync.rst:260 msgid "" "Note that a task *may* return from this call spuriously, which is why the " -"caller should always re-check the state and be prepared to :meth:`wait` " -"again. For this reason, you may prefer to use :meth:`wait_for` instead." +"caller should always re-check the state and be prepared to :meth:`~Condition." +"wait` again. For this reason, you may prefer to use :meth:`~Condition." +"wait_for` instead." msgstr "" #: ../../library/asyncio-sync.rst:267 @@ -414,8 +415,8 @@ msgstr "持續等待直到謂語 (predicate) 成為 *true*。" #, fuzzy msgid "" "The predicate must be a callable which result will be interpreted as a " -"boolean value. The method will repeatedly :meth:`wait` until the predicate " -"evaluates to *true*. The final value is the return value." +"boolean value. The method will repeatedly :meth:`~Condition.wait` until the " +"predicate evaluates to *true*. The final value is the return value." msgstr "" "謂語必須是一個結果可被直譯為一個 boolean 值的可呼叫物件 (callable)。最終值為" "回傳值。" @@ -643,8 +644,9 @@ msgstr "" #: ../../library/asyncio-sync.rst:436 msgid "" "Put the barrier into a broken state. This causes any active or future calls " -"to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " -"example if one of the tasks needs to abort, to avoid infinite waiting tasks." +"to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " +"this for example if one of the tasks needs to abort, to avoid infinite " +"waiting tasks." msgstr "" #: ../../library/asyncio-sync.rst:443 diff --git a/library/ctypes.po b/library/ctypes.po index dbadfd09fa..36f2184eaf 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -376,7 +376,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2242 msgid "Fundamental data types" msgstr "" @@ -2497,7 +2497,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:1987 +#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:2002 msgid "The exact functionality is system dependent." msgstr "" @@ -2615,8 +2615,8 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 -#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1413 +#: ../../library/ctypes.rst:1426 ../../library/ctypes.rst:1444 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" @@ -2628,34 +2628,44 @@ msgstr "" #: ../../library/ctypes.rst:1398 msgid "" -"Windows only: Instances of this class represent loaded shared libraries, " -"functions in these libraries use the ``stdcall`` calling convention, and are " -"assumed to return the windows specific :class:`HRESULT` code. :class:" -"`HRESULT` values contain information specifying whether the function call " -"failed or succeeded, together with additional error code. If the return " -"value signals a failure, an :class:`OSError` is automatically raised." +"Instances of this class represent loaded shared libraries, functions in " +"these libraries use the ``stdcall`` calling convention, and are assumed to " +"return the windows specific :class:`HRESULT` code. :class:`HRESULT` values " +"contain information specifying whether the function call failed or " +"succeeded, together with additional error code. If the return value signals " +"a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1405 +#: ../../library/ctypes.rst:1405 ../../library/ctypes.rst:1422 +#: ../../library/ctypes.rst:1566 ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1751 ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1991 ../../library/ctypes.rst:2016 +#: ../../library/ctypes.rst:2025 ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:2049 ../../library/ctypes.rst:2106 +#: ../../library/ctypes.rst:2134 ../../library/ctypes.rst:2478 +msgid "Availability" +msgstr "" + +#: ../../library/ctypes.rst:1407 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/ctypes.rst:1416 +#: ../../library/ctypes.rst:1418 msgid "" -"Windows only: Instances of this class represent loaded shared libraries, " -"functions in these libraries use the ``stdcall`` calling convention, and are " -"assumed to return :c:expr:`int` by default." +"Instances of this class represent loaded shared libraries, functions in " +"these libraries use the ``stdcall`` calling convention, and are assumed to " +"return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1424 +#: ../../library/ctypes.rst:1429 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1430 +#: ../../library/ctypes.rst:1435 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -2663,11 +2673,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1440 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1446 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -2677,7 +2687,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1448 +#: ../../library/ctypes.rst:1453 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -2685,7 +2695,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1458 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -2695,14 +2705,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1460 +#: ../../library/ctypes.rst:1465 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1464 +#: ../../library/ctypes.rst:1469 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -2711,7 +2721,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1470 +#: ../../library/ctypes.rst:1475 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -2721,29 +2731,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1477 +#: ../../library/ctypes.rst:1482 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1489 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1491 +#: ../../library/ctypes.rst:1496 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1498 +#: ../../library/ctypes.rst:1503 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1501 +#: ../../library/ctypes.rst:1506 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -2752,7 +2762,7 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1507 +#: ../../library/ctypes.rst:1512 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -2768,21 +2778,21 @@ msgstr "" ">>> libc['time'] == libc['time']\n" "False" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1519 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1520 +#: ../../library/ctypes.rst:1525 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1525 +#: ../../library/ctypes.rst:1530 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1527 +#: ../../library/ctypes.rst:1532 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -2790,13 +2800,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1540 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1538 +#: ../../library/ctypes.rst:1543 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -2804,39 +2814,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1544 +#: ../../library/ctypes.rst:1549 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1548 +#: ../../library/ctypes.rst:1553 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1553 +#: ../../library/ctypes.rst:1558 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1559 -msgid "Windows only: Creates :class:`WinDLL` instances." +#: ../../library/ctypes.rst:1564 +msgid "Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1565 -msgid "Windows only: Creates :class:`OleDLL` instances." +#: ../../library/ctypes.rst:1572 +msgid "Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1571 +#: ../../library/ctypes.rst:1580 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1583 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1580 +#: ../../library/ctypes.rst:1589 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -2844,32 +2854,32 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1585 ../../library/ctypes.rst:1587 +#: ../../library/ctypes.rst:1594 ../../library/ctypes.rst:1596 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1591 ../../library/ctypes.rst:1593 +#: ../../library/ctypes.rst:1600 ../../library/ctypes.rst:1602 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1597 ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1606 ../../library/ctypes.rst:1608 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1606 +#: ../../library/ctypes.rst:1615 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1608 +#: ../../library/ctypes.rst:1617 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -2878,13 +2888,13 @@ msgid "" "library loader." msgstr "" -#: ../../library/ctypes.rst:1613 +#: ../../library/ctypes.rst:1622 msgid "" "They are instances of a private local class :class:`!_FuncPtr` (not exposed " "in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" msgstr "" -#: ../../library/ctypes.rst:1616 +#: ../../library/ctypes.rst:1625 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -2894,29 +2904,29 @@ msgid "" "False" msgstr "" -#: ../../library/ctypes.rst:1627 +#: ../../library/ctypes.rst:1636 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1638 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1632 +#: ../../library/ctypes.rst:1641 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1637 +#: ../../library/ctypes.rst:1646 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1640 +#: ../../library/ctypes.rst:1649 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -2926,7 +2936,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1649 +#: ../../library/ctypes.rst:1658 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -2935,7 +2945,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1655 +#: ../../library/ctypes.rst:1664 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -2945,7 +2955,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1662 +#: ../../library/ctypes.rst:1671 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -2953,44 +2963,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1678 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1685 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1679 +#: ../../library/ctypes.rst:1688 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1683 +#: ../../library/ctypes.rst:1692 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1687 +#: ../../library/ctypes.rst:1696 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1703 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1698 ../../library/ctypes.rst:1700 +#: ../../library/ctypes.rst:1707 ../../library/ctypes.rst:1709 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -2999,18 +3009,18 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1706 ../../library/ctypes.rst:1708 +#: ../../library/ctypes.rst:1715 ../../library/ctypes.rst:1717 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1714 +#: ../../library/ctypes.rst:1723 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1725 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -3021,7 +3031,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1736 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -3030,37 +3040,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1737 +#: ../../library/ctypes.rst:1746 msgid "" -"Windows only: The returned function prototype creates functions that use the " -"``stdcall`` calling convention. The function will release the GIL during " -"the call. *use_errno* and *use_last_error* have the same meaning as above." +"The returned function prototype creates functions that use the ``stdcall`` " +"calling convention. The function will release the GIL during the call. " +"*use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1745 +#: ../../library/ctypes.rst:1756 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1748 +#: ../../library/ctypes.rst:1759 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1755 +#: ../../library/ctypes.rst:1766 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1762 +#: ../../library/ctypes.rst:1773 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1769 +#: ../../library/ctypes.rst:1780 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -3068,7 +3078,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1779 +#: ../../library/ctypes.rst:1790 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -3076,79 +3086,79 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1784 +#: ../../library/ctypes.rst:1795 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1788 +#: ../../library/ctypes.rst:1799 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1791 +#: ../../library/ctypes.rst:1802 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1804 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1796 +#: ../../library/ctypes.rst:1807 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1799 +#: ../../library/ctypes.rst:1810 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1800 +#: ../../library/ctypes.rst:1811 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1802 +#: ../../library/ctypes.rst:1813 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1803 +#: ../../library/ctypes.rst:1814 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1805 +#: ../../library/ctypes.rst:1816 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1806 +#: ../../library/ctypes.rst:1817 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1808 +#: ../../library/ctypes.rst:1819 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1811 +#: ../../library/ctypes.rst:1822 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1814 +#: ../../library/ctypes.rst:1825 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1818 +#: ../../library/ctypes.rst:1829 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3164,11 +3174,11 @@ msgstr "" " LPCWSTR lpCaption,\n" " UINT uType);" -#: ../../library/ctypes.rst:1825 ../../library/ctypes.rst:1848 +#: ../../library/ctypes.rst:1836 ../../library/ctypes.rst:1859 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1827 +#: ../../library/ctypes.rst:1838 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3184,11 +3194,11 @@ msgstr "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -#: ../../library/ctypes.rst:1833 +#: ../../library/ctypes.rst:1844 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1835 +#: ../../library/ctypes.rst:1846 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" @@ -3198,7 +3208,7 @@ msgstr "" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" -#: ../../library/ctypes.rst:1839 +#: ../../library/ctypes.rst:1850 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3206,7 +3216,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1854 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -3218,7 +3228,7 @@ msgstr "" " HWND hWnd,\n" " LPRECT lpRect);" -#: ../../library/ctypes.rst:1850 +#: ../../library/ctypes.rst:1861 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3236,7 +3246,7 @@ msgstr "" "paramflags)\n" ">>>" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1868 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3244,7 +3254,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1862 +#: ../../library/ctypes.rst:1873 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -3253,7 +3263,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1867 +#: ../../library/ctypes.rst:1878 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3271,7 +3281,7 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1875 +#: ../../library/ctypes.rst:1886 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -3280,7 +3290,7 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1881 +#: ../../library/ctypes.rst:1892 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3300,17 +3310,17 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1894 +#: ../../library/ctypes.rst:1905 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1909 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1912 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -3318,34 +3328,34 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1917 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1912 +#: ../../library/ctypes.rst:1923 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1916 +#: ../../library/ctypes.rst:1927 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1918 +#: ../../library/ctypes.rst:1929 msgid "(((char *)&obj) + offset)" msgstr "(((char *)&obj) + offset)" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1931 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1926 +#: ../../library/ctypes.rst:1937 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -3353,19 +3363,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1945 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1937 +#: ../../library/ctypes.rst:1948 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1940 +#: ../../library/ctypes.rst:1951 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -3374,7 +3384,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1956 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3382,19 +3392,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1950 +#: ../../library/ctypes.rst:1961 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1953 +#: ../../library/ctypes.rst:1964 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1967 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -3403,7 +3413,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1962 +#: ../../library/ctypes.rst:1973 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3411,21 +3421,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1967 +#: ../../library/ctypes.rst:1978 msgid "" -"Windows only: This function is a hook which allows implementing in-process " -"COM servers with ctypes. It is called from the DllCanUnloadNow function " -"that the _ctypes extension dll exports." +"This function is a hook which allows implementing in-process COM servers " +"with ctypes. It is called from the DllCanUnloadNow function that the " +"_ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1974 +#: ../../library/ctypes.rst:1987 msgid "" -"Windows only: This function is a hook which allows implementing in-process " -"COM servers with ctypes. It is called from the DllGetClassObject function " -"that the ``_ctypes`` extension dll exports." +"This function is a hook which allows implementing in-process COM servers " +"with ctypes. It is called from the DllGetClassObject function that the " +"``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1997 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -3433,94 +3443,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1993 +#: ../../library/ctypes.rst:2008 msgid "" -"Windows only: return the filename of the VC runtime library used by Python, " -"and by the extension modules. If the name of the library cannot be " -"determined, ``None`` is returned." +"Returns the filename of the VC runtime library used by Python, and by the " +"extension modules. If the name of the library cannot be determined, " +"``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1997 +#: ../../library/ctypes.rst:2012 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:2004 +#: ../../library/ctypes.rst:2021 msgid "" -"Windows only: Returns a textual description of the error code *code*. If no " -"error code is specified, the last error code is used by calling the Windows " -"api function GetLastError." +"Returns a textual description of the error code *code*. If no error code is " +"specified, the last error code is used by calling the Windows api function " +"GetLastError." msgstr "" -#: ../../library/ctypes.rst:2011 +#: ../../library/ctypes.rst:2030 msgid "" -"Windows only: Returns the last error code set by Windows in the calling " -"thread. This function calls the Windows ``GetLastError()`` function " -"directly, it does not return the ctypes-private copy of the error code." +"Returns the last error code set by Windows in the calling thread. This " +"function calls the Windows ``GetLastError()`` function directly, it does not " +"return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2039 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2042 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2024 +#: ../../library/ctypes.rst:2046 msgid "" -"Windows only: returns the current value of the ctypes-private copy of the " -"system :data:`!LastError` variable in the calling thread." +"Returns the current value of the ctypes-private copy of the system :data:`!" +"LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2027 +#: ../../library/ctypes.rst:2051 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2031 +#: ../../library/ctypes.rst:2056 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2038 +#: ../../library/ctypes.rst:2063 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2045 +#: ../../library/ctypes.rst:2070 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2052 +#: ../../library/ctypes.rst:2077 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2080 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2061 +#: ../../library/ctypes.rst:2086 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -3528,13 +3538,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2069 +#: ../../library/ctypes.rst:2094 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2097 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -3542,14 +3552,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2077 +#: ../../library/ctypes.rst:2102 msgid "" -"Windows only: set the current value of the ctypes-private copy of the " -"system :data:`!LastError` variable in the calling thread to *value* and " -"return the previous value." +"Sets the current value of the ctypes-private copy of the system :data:`!" +"LastError` variable in the calling thread to *value* and return the previous " +"value." msgstr "" -#: ../../library/ctypes.rst:2081 +#: ../../library/ctypes.rst:2108 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -3557,19 +3567,19 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_last_error``。" -#: ../../library/ctypes.rst:2086 +#: ../../library/ctypes.rst:2113 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2092 +#: ../../library/ctypes.rst:2119 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2096 +#: ../../library/ctypes.rst:2123 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." @@ -3577,29 +3587,28 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "string_at``。" -#: ../../library/ctypes.rst:2101 +#: ../../library/ctypes.rst:2128 msgid "" -"Windows only: this function is probably the worst-named thing in ctypes. It " -"creates an instance of :exc:`OSError`. If *code* is not specified, " -"``GetLastError`` is called to determine the error code. If *descr* is not " -"specified, :func:`FormatError` is called to get a textual description of the " -"error." +"This function is probably the worst-named thing in ctypes. It creates an " +"instance of :exc:`OSError`. If *code* is not specified, ``GetLastError`` is " +"called to determine the error code. If *descr* is not specified, :func:" +"`FormatError` is called to get a textual description of the error." msgstr "" -#: ../../library/ctypes.rst:2107 +#: ../../library/ctypes.rst:2136 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2114 +#: ../../library/ctypes.rst:2143 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2119 +#: ../../library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." @@ -3607,11 +3616,11 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "wstring_at``。" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:2154 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2130 +#: ../../library/ctypes.rst:2159 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -3621,13 +3630,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2137 +#: ../../library/ctypes.rst:2166 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2142 +#: ../../library/ctypes.rst:2171 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3636,7 +3645,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2148 ../../library/ctypes.rst:2158 +#: ../../library/ctypes.rst:2177 ../../library/ctypes.rst:2187 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3644,7 +3653,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2181 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3652,19 +3661,19 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2162 +#: ../../library/ctypes.rst:2191 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2165 ../../library/ctypes.rst:2167 +#: ../../library/ctypes.rst:2194 ../../library/ctypes.rst:2196 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:2202 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -3672,25 +3681,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2178 +#: ../../library/ctypes.rst:2207 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2184 +#: ../../library/ctypes.rst:2213 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2188 +#: ../../library/ctypes.rst:2217 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2221 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -3698,13 +3707,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2199 +#: ../../library/ctypes.rst:2228 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2204 +#: ../../library/ctypes.rst:2233 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -3712,7 +3721,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2246 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -3721,11 +3730,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2252 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2227 +#: ../../library/ctypes.rst:2256 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -3733,7 +3742,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2232 +#: ../../library/ctypes.rst:2261 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -3741,7 +3750,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2238 +#: ../../library/ctypes.rst:2267 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -3751,7 +3760,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2246 +#: ../../library/ctypes.rst:2275 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -3759,25 +3768,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2251 +#: ../../library/ctypes.rst:2280 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2255 +#: ../../library/ctypes.rst:2284 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2262 +#: ../../library/ctypes.rst:2291 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2269 +#: ../../library/ctypes.rst:2298 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -3785,182 +3794,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2277 +#: ../../library/ctypes.rst:2306 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2312 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2289 +#: ../../library/ctypes.rst:2318 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2295 +#: ../../library/ctypes.rst:2324 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2302 +#: ../../library/ctypes.rst:2331 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2337 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2343 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2349 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2355 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2361 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2338 +#: ../../library/ctypes.rst:2367 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2373 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2349 +#: ../../library/ctypes.rst:2378 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2356 +#: ../../library/ctypes.rst:2385 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2363 +#: ../../library/ctypes.rst:2392 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2370 +#: ../../library/ctypes.rst:2399 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2377 +#: ../../library/ctypes.rst:2406 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2412 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2418 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2424 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2430 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2407 +#: ../../library/ctypes.rst:2436 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2413 +#: ../../library/ctypes.rst:2442 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2419 +#: ../../library/ctypes.rst:2448 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2425 +#: ../../library/ctypes.rst:2454 msgid "" "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 "" -#: ../../library/ctypes.rst:2432 +#: ../../library/ctypes.rst:2461 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2439 +#: ../../library/ctypes.rst:2468 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2446 +#: ../../library/ctypes.rst:2475 msgid "" -"Windows only: Represents a :c:type:`!HRESULT` value, which contains success " -"or error information for a function or method call." +"Represents a :c:type:`!HRESULT` value, which contains success or error " +"information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2452 +#: ../../library/ctypes.rst:2483 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2455 +#: ../../library/ctypes.rst:2486 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -3968,41 +3977,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2494 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2499 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2504 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2479 +#: ../../library/ctypes.rst:2510 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2485 +#: ../../library/ctypes.rst:2516 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2521 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2492 +#: ../../library/ctypes.rst:2523 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2498 +#: ../../library/ctypes.rst:2529 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2500 +#: ../../library/ctypes.rst:2531 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -4010,34 +4019,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2508 +#: ../../library/ctypes.rst:2539 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2512 +#: ../../library/ctypes.rst:2543 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2516 +#: ../../library/ctypes.rst:2547 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2550 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2523 +#: ../../library/ctypes.rst:2554 msgid "" "class List(Structure):\n" " pass\n" @@ -4051,7 +4060,7 @@ msgstr "" " ...\n" " ]" -#: ../../library/ctypes.rst:2529 +#: ../../library/ctypes.rst:2560 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -4059,14 +4068,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2534 +#: ../../library/ctypes.rst:2565 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2572 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -4074,21 +4083,21 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2549 +#: ../../library/ctypes.rst:2580 msgid "" "An optional small integer that allows overriding the alignment of the " "structure when being packed or unpacked to/from memory. Setting this " "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2588 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2592 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4096,11 +4105,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2566 +#: ../../library/ctypes.rst:2597 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2568 +#: ../../library/ctypes.rst:2599 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4122,7 +4131,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2579 +#: ../../library/ctypes.rst:2610 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4132,7 +4141,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2586 +#: ../../library/ctypes.rst:2617 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4144,7 +4153,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2591 +#: ../../library/ctypes.rst:2622 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4152,7 +4161,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2596 +#: ../../library/ctypes.rst:2627 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4162,15 +4171,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2607 +#: ../../library/ctypes.rst:2638 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2611 +#: ../../library/ctypes.rst:2642 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2644 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4180,46 +4189,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2623 +#: ../../library/ctypes.rst:2654 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2630 +#: ../../library/ctypes.rst:2661 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2633 +#: ../../library/ctypes.rst:2664 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2669 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:2642 +#: ../../library/ctypes.rst:2673 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:2648 +#: ../../library/ctypes.rst:2679 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2650 +#: ../../library/ctypes.rst:2681 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2654 +#: ../../library/ctypes.rst:2685 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4228,11 +4237,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2664 +#: ../../library/ctypes.rst:2695 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2668 +#: ../../library/ctypes.rst:2699 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 34903fb7ff..cf0519c105 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -202,9 +202,9 @@ msgstr "" #: ../../library/importlib.metadata.rst:136 msgid "" -"Also provides a ``.groups`` attribute that reports all identifed entry point " -"groups, and a ``.names`` attribute that reports all identified entry point " -"names." +"Also provides a ``.groups`` attribute that reports all identified entry " +"point groups, and a ``.names`` attribute that reports all identified entry " +"point names." msgstr "" #: ../../library/importlib.metadata.rst:142 diff --git a/library/locale.po b/library/locale.po index 4e71503ed8..c5299f058c 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -431,10 +431,12 @@ msgid "" msgstr "" #: ../../library/locale.rst:284 -msgid "Get a string that represents the era used in the current locale." +msgid "" +"Get a string which describes how years are counted and displayed for each " +"era in a locale." msgstr "" -#: ../../library/locale.rst:286 +#: ../../library/locale.rst:287 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -442,47 +444,48 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:291 +#: ../../library/locale.rst:292 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " -"function to use this information. The format of the returned string is not " -"specified, and therefore you should not assume knowledge of it on different " -"systems." +"function to use this information. The format of the returned string is " +"specified in *The Open Group Base Specifications Issue 8*, paragraph " +"`7.3.5.2 LC_TIME C-Language Access `_." msgstr "" -#: ../../library/locale.rst:299 +#: ../../library/locale.rst:301 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:304 +#: ../../library/locale.rst:306 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:309 +#: ../../library/locale.rst:311 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:314 +#: ../../library/locale.rst:316 msgid "" "Get a string consisting of up to 100 semicolon-separated symbols used to " "represent the values 0 to 99 in a locale-specific way. In most locales this " "is an empty string." msgstr "" -#: ../../library/locale.rst:321 +#: ../../library/locale.rst:323 msgid "" "Tries to determine the default locale settings and returns them as a tuple " "of the form ``(language code, encoding)``." msgstr "" -#: ../../library/locale.rst:324 +#: ../../library/locale.rst:326 msgid "" "According to POSIX, a program which has not called ``setlocale(LC_ALL, '')`` " "runs using the portable ``'C'`` locale. Calling ``setlocale(LC_ALL, '')`` " @@ -491,7 +494,7 @@ msgid "" "emulate the behavior in the way described above." msgstr "" -#: ../../library/locale.rst:330 +#: ../../library/locale.rst:332 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -501,21 +504,21 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:337 ../../library/locale.rst:350 +#: ../../library/locale.rst:339 ../../library/locale.rst:352 msgid "" "Except for the code ``'C'``, the language code corresponds to :rfc:`1766`. " "*language code* and *encoding* may be ``None`` if their values cannot be " "determined." msgstr "" -#: ../../library/locale.rst:346 +#: ../../library/locale.rst:348 msgid "" "Returns the current setting for the given locale category as sequence " "containing *language code*, *encoding*. *category* may be one of the :const:" "`!LC_\\*` values except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:357 +#: ../../library/locale.rst:359 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -523,72 +526,72 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:362 +#: ../../library/locale.rst:364 msgid "" "On some systems, it is necessary to invoke :func:`setlocale` to obtain the " "user preferences, so this function is not thread-safe. If invoking setlocale " "is not necessary or desired, *do_setlocale* should be set to ``False``." msgstr "" -#: ../../library/locale.rst:366 +#: ../../library/locale.rst:368 msgid "" "On Android or if the :ref:`Python UTF-8 Mode ` is enabled, always " "return ``'utf-8'``, the :term:`locale encoding` and the *do_setlocale* " "argument are ignored." msgstr "" -#: ../../library/locale.rst:370 ../../library/locale.rst:388 +#: ../../library/locale.rst:372 ../../library/locale.rst:390 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:373 +#: ../../library/locale.rst:375 msgid "" "The function now always returns ``\"utf-8\"`` on Android or if the :ref:" "`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:380 +#: ../../library/locale.rst:382 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:382 +#: ../../library/locale.rst:384 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:383 +#: ../../library/locale.rst:385 msgid "" "On Unix, return the encoding of the current :data:`LC_CTYPE` locale. Return " "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string: for " "example, if the current LC_CTYPE locale is not supported." msgstr "" -#: ../../library/locale.rst:386 +#: ../../library/locale.rst:388 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:391 +#: ../../library/locale.rst:393 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:400 +#: ../../library/locale.rst:402 msgid "" "Returns a normalized locale code for the given locale name. The returned " "locale code is formatted for use with :func:`setlocale`. If normalization " "fails, the original name is returned unchanged." msgstr "" -#: ../../library/locale.rst:404 +#: ../../library/locale.rst:406 msgid "" "If the given encoding is not known, the function defaults to the default " "encoding for the locale code just like :func:`setlocale`." msgstr "" -#: ../../library/locale.rst:410 +#: ../../library/locale.rst:412 msgid "" "Compares two strings according to the current :const:`LC_COLLATE` setting. " "As any other compare function, returns a negative, or a positive value, or " @@ -596,7 +599,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:418 +#: ../../library/locale.rst:420 msgid "" "Transforms a string to one that can be used in locale-aware comparisons. " "For example, ``strxfrm(s1) < strxfrm(s2)`` is equivalent to ``strcoll(s1, " @@ -604,7 +607,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:427 +#: ../../library/locale.rst:429 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -612,29 +615,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:432 +#: ../../library/locale.rst:434 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:435 +#: ../../library/locale.rst:437 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:438 +#: ../../library/locale.rst:440 msgid "The *monetary* keyword parameter was added." msgstr "" -#: ../../library/locale.rst:444 +#: ../../library/locale.rst:446 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:446 +#: ../../library/locale.rst:448 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -642,43 +645,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:453 +#: ../../library/locale.rst:455 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: ../../library/locale.rst:459 +#: ../../library/locale.rst:461 msgid "" "Formats a floating-point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: ../../library/locale.rst:465 +#: ../../library/locale.rst:467 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:473 +#: ../../library/locale.rst:475 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:481 +#: ../../library/locale.rst:483 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: ../../library/locale.rst:487 +#: ../../library/locale.rst:489 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:492 +#: ../../library/locale.rst:494 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -688,32 +691,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:501 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:506 +#: ../../library/locale.rst:508 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:512 +#: ../../library/locale.rst:514 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:518 +#: ../../library/locale.rst:520 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:524 +#: ../../library/locale.rst:526 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -721,13 +724,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:529 +#: ../../library/locale.rst:531 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:535 +#: ../../library/locale.rst:537 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -735,7 +738,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:543 +#: ../../library/locale.rst:545 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -745,17 +748,17 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:552 +#: ../../library/locale.rst:554 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:556 +#: ../../library/locale.rst:558 msgid "Example::" msgstr "範例: ::" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:560 msgid "" ">>> import locale\n" ">>> loc = locale.getlocale() # get current locale\n" @@ -768,11 +771,11 @@ msgid "" ">>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale" msgstr "" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:571 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:571 +#: ../../library/locale.rst:573 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -780,7 +783,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:576 +#: ../../library/locale.rst:578 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -790,7 +793,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:583 +#: ../../library/locale.rst:585 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -798,7 +801,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:588 +#: ../../library/locale.rst:590 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -809,14 +812,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:595 +#: ../../library/locale.rst:597 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:599 +#: ../../library/locale.rst:601 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -827,11 +830,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:610 +#: ../../library/locale.rst:612 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:612 +#: ../../library/locale.rst:614 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -839,7 +842,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:617 +#: ../../library/locale.rst:619 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -849,11 +852,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:628 +#: ../../library/locale.rst:630 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:637 +#: ../../library/locale.rst:639 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`gettext`, :func:" @@ -864,7 +867,7 @@ msgid "" "locating message catalogs." msgstr "" -#: ../../library/locale.rst:644 +#: ../../library/locale.rst:646 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 831578b13f..3dc4b03b6c 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -494,7 +494,7 @@ msgstr "" #: ../../library/multiprocessing.rst:285 msgid "" -"The :meth:`~Connection.send` method serializes the the object and :meth:" +"The :meth:`~Connection.send` method serializes the object and :meth:" "`~Connection.recv` re-creates the object." msgstr "" @@ -1323,9 +1323,9 @@ msgstr "" #: ../../library/multiprocessing.rst:822 msgid "" -"The :meth:`~multiprocessing.Connection.send` method serializes the the " -"object using :mod:`pickle` and the :meth:`~multiprocessing.Connection.recv` " -"re-creates the object." +"The :meth:`~multiprocessing.Connection.send` method serializes the object " +"using :mod:`pickle` and the :meth:`~multiprocessing.Connection.recv` re-" +"creates the object." msgstr "" #: ../../library/multiprocessing.rst:827 diff --git a/library/shutil.po b/library/shutil.po index e87a69458b..5520357e0c 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -648,25 +648,18 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:494 -msgid "" -"On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " -"``PATHEXT`` will be preferred over executables without a matching extension. " -"This brings behavior closer to that of Python 3.11." -msgstr "" - -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:496 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:509 +#: ../../library/shutil.rst:503 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:511 +#: ../../library/shutil.rst:505 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -676,37 +669,37 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:519 +#: ../../library/shutil.rst:513 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:521 +#: ../../library/shutil.rst:515 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:523 +#: ../../library/shutil.rst:517 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:527 +#: ../../library/shutil.rst:521 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:536 +#: ../../library/shutil.rst:530 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:538 +#: ../../library/shutil.rst:532 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:540 +#: ../../library/shutil.rst:534 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" @@ -716,17 +709,17 @@ msgstr "" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -#: ../../library/shutil.rst:544 +#: ../../library/shutil.rst:538 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:547 +#: ../../library/shutil.rst:541 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:549 +#: ../../library/shutil.rst:543 msgid "" "from shutil import copytree\n" "import logging\n" @@ -738,11 +731,11 @@ msgid "" "copytree(source, destination, ignore=_logpath)" msgstr "" -#: ../../library/shutil.rst:562 +#: ../../library/shutil.rst:556 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:564 +#: ../../library/shutil.rst:558 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 onexc callback to clear " @@ -750,7 +743,7 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:563 msgid "" "import os, stat\n" "import shutil\n" @@ -763,31 +756,31 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:576 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:580 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:590 +#: ../../library/shutil.rst:584 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:595 +#: ../../library/shutil.rst:589 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:591 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: ../../library/shutil.rst:600 +#: ../../library/shutil.rst:594 msgid "" "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is " "available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " @@ -795,14 +788,14 @@ msgid "" "`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:605 +#: ../../library/shutil.rst:599 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:609 +#: ../../library/shutil.rst:603 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. " @@ -810,33 +803,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:609 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:617 +#: ../../library/shutil.rst:611 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:620 +#: ../../library/shutil.rst:614 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:623 +#: ../../library/shutil.rst:617 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:620 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:628 +#: ../../library/shutil.rst:622 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -844,7 +837,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:632 +#: ../../library/shutil.rst:626 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -852,60 +845,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:638 +#: ../../library/shutil.rst:632 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:642 +#: ../../library/shutil.rst:636 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:648 +#: ../../library/shutil.rst:642 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:651 ../../library/shutil.rst:762 +#: ../../library/shutil.rst:645 ../../library/shutil.rst:756 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:653 +#: ../../library/shutil.rst:647 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:654 +#: ../../library/shutil.rst:648 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:655 ../../library/shutil.rst:767 +#: ../../library/shutil.rst:649 ../../library/shutil.rst:761 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:656 ../../library/shutil.rst:768 +#: ../../library/shutil.rst:650 ../../library/shutil.rst:762 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:657 ../../library/shutil.rst:769 +#: ../../library/shutil.rst:651 ../../library/shutil.rst:763 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:659 +#: ../../library/shutil.rst:653 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:665 +#: ../../library/shutil.rst:659 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:667 +#: ../../library/shutil.rst:661 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 " @@ -914,7 +907,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:667 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -923,37 +916,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:673 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:682 +#: ../../library/shutil.rst:676 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:679 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:691 +#: ../../library/shutil.rst:685 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:696 +#: ../../library/shutil.rst:690 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:698 +#: ../../library/shutil.rst:692 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:701 +#: ../../library/shutil.rst:695 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -962,7 +955,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:708 +#: ../../library/shutil.rst:702 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -972,7 +965,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:716 +#: ../../library/shutil.rst:710 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -980,7 +973,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:720 +#: ../../library/shutil.rst:714 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -988,91 +981,91 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:725 +#: ../../library/shutil.rst:719 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:728 +#: ../../library/shutil.rst:722 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:733 +#: ../../library/shutil.rst:727 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:737 +#: ../../library/shutil.rst:731 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:740 +#: ../../library/shutil.rst:734 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:735 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:742 +#: ../../library/shutil.rst:736 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:744 +#: ../../library/shutil.rst:738 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:747 +#: ../../library/shutil.rst:741 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:753 +#: ../../library/shutil.rst:747 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:758 +#: ../../library/shutil.rst:752 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:764 +#: ../../library/shutil.rst:758 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:766 +#: ../../library/shutil.rst:760 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:771 +#: ../../library/shutil.rst:765 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:778 +#: ../../library/shutil.rst:772 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:780 +#: ../../library/shutil.rst:774 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:783 +#: ../../library/shutil.rst:777 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1082,11 +1075,11 @@ msgid "" "'/Users/tarek/myarchive.tar.gz'" msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:784 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:792 +#: ../../library/shutil.rst:786 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1108,18 +1101,18 @@ msgstr "" "-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" -#: ../../library/shutil.rst:808 +#: ../../library/shutil.rst:802 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:810 +#: ../../library/shutil.rst:804 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:814 +#: ../../library/shutil.rst:808 msgid "" "$ tree tmp\n" "tmp\n" @@ -1137,13 +1130,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:824 +#: ../../library/shutil.rst:818 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:827 +#: ../../library/shutil.rst:821 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1167,11 +1160,11 @@ msgstr "" "... )\n" "'/Users/tarek/my_archive.tar'" -#: ../../library/shutil.rst:838 +#: ../../library/shutil.rst:832 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:840 +#: ../../library/shutil.rst:834 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" @@ -1181,29 +1174,29 @@ msgstr "" "structure/content/\n" "structure/content/please_add.txt" -#: ../../library/shutil.rst:848 +#: ../../library/shutil.rst:842 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:846 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:854 +#: ../../library/shutil.rst:848 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:858 +#: ../../library/shutil.rst:852 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:862 +#: ../../library/shutil.rst:856 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 " @@ -1212,17 +1205,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:868 +#: ../../library/shutil.rst:862 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:870 +#: ../../library/shutil.rst:864 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:875 +#: ../../library/shutil.rst:869 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/socket.po b/library/socket.po index 3d7a96d3d0..cf87851d07 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -1149,7 +1149,7 @@ msgid "" "list of all matching addresses. These addresses should generally be tried in " "order until a connection succeeds (possibly tried in parallel, for example, " "using a `Happy Eyeballs`_ algorithm). In these cases, limiting the *type* " -"and/or *proto* can help eliminate unsuccessful or unusable connecton " +"and/or *proto* can help eliminate unsuccessful or unusable connection " "attempts." msgstr "" diff --git a/library/token.po b/library/token.po index bd30000c13..8d1e423657 100644 --- a/library/token.po +++ b/library/token.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -287,21 +287,27 @@ msgid "" "only produced when :func:`ast.parse` is invoked with ``type_comments=True``." msgstr "" -#: ../../library/token.rst:82 +#: ../../library/token.rst:84 +msgid "" +"A dictionary mapping the string representation of a token to its numeric " +"code." +msgstr "" + +#: ../../library/token.rst:89 msgid "Added :data:`!AWAIT` and :data:`!ASYNC` tokens." msgstr "" -#: ../../library/token.rst:85 +#: ../../library/token.rst:92 msgid "Added :data:`COMMENT`, :data:`NL` and :data:`ENCODING` tokens." msgstr "" -#: ../../library/token.rst:88 +#: ../../library/token.rst:95 msgid "" "Removed :data:`!AWAIT` and :data:`!ASYNC` tokens. \"async\" and \"await\" " "are now tokenized as :data:`NAME` tokens." msgstr "" -#: ../../library/token.rst:92 +#: ../../library/token.rst:99 msgid "" "Added :data:`TYPE_COMMENT`, :data:`TYPE_IGNORE`, :data:`COLONEQUAL`. Added :" "data:`!AWAIT` and :data:`!ASYNC` tokens back (they're needed to support " @@ -309,6 +315,6 @@ msgid "" "set to 6 or lower)." msgstr "" -#: ../../library/token.rst:98 +#: ../../library/token.rst:105 msgid "Removed :data:`!AWAIT` and :data:`!ASYNC` tokens again." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index bfe35b0016..d521d011ce 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -291,27 +291,38 @@ msgstr "" #: ../../library/urllib.request.rst:152 msgid "" -"Convert the pathname *path* from the local syntax for a path to the form " -"used in the path component of a URL. This does not produce a complete URL. " -"The return value will already be quoted using the :func:`~urllib.parse." -"quote` function." +"Convert the given local path to a ``file:`` URL. This function uses :func:" +"`~urllib.parse.quote` function to encode the path. For historical reasons, " +"the return value omits the ``file:`` scheme prefix. This example shows the " +"function being used on Windows::" msgstr "" -"將路徑名 *path* 從路徑的本地語法 (local syntax) 轉換為 URL 中的 path " -"component(路徑元件)格式。本函式並不會產生完整的 URL。回傳值將使用 :func:" -"`~urllib.parse.quote` 函式先進行編碼過。" -#: ../../library/urllib.request.rst:159 +#: ../../library/urllib.request.rst:157 msgid "" -"Convert the path component *path* from a percent-encoded URL to the local " -"syntax for a path. This does not accept a complete URL. This function " -"uses :func:`~urllib.parse.unquote` to decode *path*." +">>> from urllib.request import pathname2url\n" +">>> path = 'C:\\\\Program Files'\n" +">>> 'file:' + pathname2url(path)\n" +"'file:///C:/Program%20Files'" msgstr "" -"將一個用 \"%\" 編碼過的 URL path component *path* 轉換為路徑的本地語法 " -"(local syntax)。本函式並不接受完整的 URL。本函式使用 :func:`~urllib.parse." -"unquote` 來將 *path* 解碼。" #: ../../library/urllib.request.rst:165 msgid "" +"Convert the given ``file:`` URL to a local path. This function uses :func:" +"`~urllib.parse.unquote` to decode the URL. For historical reasons, the given " +"value *must* omit the ``file:`` scheme prefix. This example shows the " +"function being used on Windows::" +msgstr "" + +#: ../../library/urllib.request.rst:170 +msgid "" +">>> from urllib.request import url2pathname\n" +">>> url = 'file:///C:/Program%20Files'\n" +">>> url2pathname(url.removeprefix('file:'))\n" +"'C:\\\\Program Files'" +msgstr "" + +#: ../../library/urllib.request.rst:177 +msgid "" "This helper function returns a dictionary of scheme to proxy server URL " "mappings. It scans the environment for variables named ``_proxy``, " "in a case insensitive approach, for all operating systems first, and when it " @@ -325,7 +336,7 @@ msgstr "" "Configuration) 或是 Windows 系統中的 Windows Systems Registry 尋找代理服務設" "定。如果大小寫的環境變數同時存在且值有不同,小寫的環境變數會被選用。" -#: ../../library/urllib.request.rst:175 +#: ../../library/urllib.request.rst:187 msgid "" "If the environment variable ``REQUEST_METHOD`` is set, which usually " "indicates your script is running in a CGI environment, the environment " @@ -342,19 +353,19 @@ msgstr "" "``ProxyHandler``,亦或是確認變數名稱是小寫的(或至少 ``_proxy`` 後綴是小寫" "的)。" -#: ../../library/urllib.request.rst:184 +#: ../../library/urllib.request.rst:196 msgid "The following classes are provided:" msgstr "提供了以下的 classes:" -#: ../../library/urllib.request.rst:188 +#: ../../library/urllib.request.rst:200 msgid "This class is an abstraction of a URL request." msgstr "這個 class 是一個 URL 請求的抽象 class。" -#: ../../library/urllib.request.rst:190 +#: ../../library/urllib.request.rst:202 msgid "*url* should be a string containing a valid, properly encoded URL." msgstr "*url* 是一個包含有效且適當編碼的 URL 字串。" -#: ../../library/urllib.request.rst:192 +#: ../../library/urllib.request.rst:204 msgid "" "*data* must be an object specifying additional data to send to the server, " "or ``None`` if no such data is needed. Currently HTTP requests are the only " @@ -375,7 +386,7 @@ msgstr "" "``Transfer-Encoding: chunked`` 則會被用來傳送檔案或是其它可疊代物件 " "(iterables)。" -#: ../../library/urllib.request.rst:202 +#: ../../library/urllib.request.rst:214 msgid "" "For an HTTP POST request method, *data* should be a buffer in the standard :" "mimetype:`application/x-www-form-urlencoded` format. The :func:`urllib." @@ -388,7 +399,7 @@ msgstr "" "個 mapping 或是 sequence(序列)的 2-tuples,並回傳一個對應格式的 ASCII 字" "串。在被作為 *data* 參數前它應該被編碼成位元組串。" -#: ../../library/urllib.request.rst:208 +#: ../../library/urllib.request.rst:220 msgid "" "*headers* should be a dictionary, and will be treated as if :meth:" "`add_header` was called with each key and value as arguments. This is often " @@ -409,7 +420,7 @@ msgstr "" "(在 Python 2.6 上)。所有 header 的鍵都會以 camel case(駝峰式大小寫)來傳" "送。" -#: ../../library/urllib.request.rst:219 +#: ../../library/urllib.request.rst:231 msgid "" "An appropriate ``Content-Type`` header should be included if the *data* " "argument is present. If this header has not been provided and *data* is not " @@ -420,14 +431,14 @@ msgstr "" "個 header 沒有被提供且 *data* 也不為 ``None`` 時,預設值 ``Content-Type: " "application/x-www-form-urlencoded`` 會被新增至請求中。" -#: ../../library/urllib.request.rst:224 +#: ../../library/urllib.request.rst:236 msgid "" "The next two arguments are only of interest for correct handling of third-" "party HTTP cookies:" msgstr "" "接下來的兩個引數的介紹提供給那些有興趣正確處理第三方 HTTP cookies 的使用者:" -#: ../../library/urllib.request.rst:227 +#: ../../library/urllib.request.rst:239 msgid "" "*origin_req_host* should be the request-host of the origin transaction, as " "defined by :rfc:`2965`. It defaults to ``http.cookiejar." @@ -441,7 +452,7 @@ msgstr "" "起的原始請求的主機名稱或是 IP 位址。例如當請求是要求一個 HTML 文件中的一個影" "像,則這個屬性應為請求包含影像頁面的請求主機。" -#: ../../library/urllib.request.rst:235 +#: ../../library/urllib.request.rst:247 msgid "" "*unverifiable* should indicate whether the request is unverifiable, as " "defined by :rfc:`2965`. It defaults to ``False``. An unverifiable request " @@ -454,7 +465,7 @@ msgstr "" "URL,例如一個對於 HTML 文件中的影像所做的請求,而使用者沒有機會去批准是否能自" "動擷取影像,則這個值應該為 true。" -#: ../../library/urllib.request.rst:242 +#: ../../library/urllib.request.rst:254 msgid "" "*method* should be a string that indicates the HTTP request method that will " "be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:" @@ -469,7 +480,7 @@ msgstr "" "Subclasses 可以透過設置其 :attr:`~Request.method` 屬性來設定不一樣的預設請求" "方法。" -#: ../../library/urllib.request.rst:250 +#: ../../library/urllib.request.rst:262 msgid "" "The request will not work as expected if the data object is unable to " "deliver its content more than once (e.g. a file or an iterable that can " @@ -483,15 +494,15 @@ msgstr "" "新嘗試傳送,則該請求不會正常運作。*data* 會接在 headers 之後被送至 HTTP 伺服" "器。此函式庫沒有支援 100-continue expectation。" -#: ../../library/urllib.request.rst:257 +#: ../../library/urllib.request.rst:269 msgid ":attr:`Request.method` argument is added to the Request class." msgstr "新增 :attr:`Request.method` 引數到 Request class。" -#: ../../library/urllib.request.rst:260 +#: ../../library/urllib.request.rst:272 msgid "Default :attr:`Request.method` may be indicated at the class level." msgstr "能夠在 class 中設置預設的 :attr:`Request.method`。" -#: ../../library/urllib.request.rst:263 +#: ../../library/urllib.request.rst:275 msgid "" "Do not raise an error if the ``Content-Length`` has not been provided and " "*data* is neither ``None`` nor a bytes object. Fall back to use chunked " @@ -501,34 +512,34 @@ msgstr "" "串物件,則不會觸發錯誤,並 fall back(後備)使用分塊傳輸編碼 (chunked " "transfer encoding)。" -#: ../../library/urllib.request.rst:270 +#: ../../library/urllib.request.rst:282 msgid "" "The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\\ s " "chained together. It manages the chaining of handlers, and recovery from " "errors." msgstr "" -#: ../../library/urllib.request.rst:276 +#: ../../library/urllib.request.rst:288 msgid "" "This is the base class for all registered handlers --- and handles only the " "simple mechanics of registration." msgstr "" -#: ../../library/urllib.request.rst:282 +#: ../../library/urllib.request.rst:294 msgid "" "A class which defines a default handler for HTTP error responses; all " "responses are turned into :exc:`~urllib.error.HTTPError` exceptions." msgstr "" -#: ../../library/urllib.request.rst:288 +#: ../../library/urllib.request.rst:300 msgid "A class to handle redirections." msgstr "" -#: ../../library/urllib.request.rst:293 +#: ../../library/urllib.request.rst:305 msgid "A class to handle HTTP Cookies." msgstr "" -#: ../../library/urllib.request.rst:298 +#: ../../library/urllib.request.rst:310 msgid "" "Cause requests to go through a proxy. If *proxies* is given, it must be a " "dictionary mapping protocol names to URLs of proxies. The default is to read " @@ -539,11 +550,11 @@ msgid "" "Configuration Framework." msgstr "" -#: ../../library/urllib.request.rst:306 +#: ../../library/urllib.request.rst:318 msgid "To disable autodetected proxy pass an empty dictionary." msgstr "" -#: ../../library/urllib.request.rst:308 +#: ../../library/urllib.request.rst:320 msgid "" "The :envvar:`no_proxy` environment variable can be used to specify hosts " "which shouldn't be reached via proxy; if set, it should be a comma-separated " @@ -551,24 +562,24 @@ msgid "" "``cern.ch,ncsa.uiuc.edu,some.host:8080``." msgstr "" -#: ../../library/urllib.request.rst:315 +#: ../../library/urllib.request.rst:327 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." msgstr "" -#: ../../library/urllib.request.rst:321 +#: ../../library/urllib.request.rst:333 msgid "Keep a database of ``(realm, uri) -> (user, password)`` mappings." msgstr "" -#: ../../library/urllib.request.rst:326 +#: ../../library/urllib.request.rst:338 msgid "" "Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm " "of ``None`` is considered a catch-all realm, which is searched if no other " "realm fits." msgstr "" -#: ../../library/urllib.request.rst:333 +#: ../../library/urllib.request.rst:345 msgid "" "A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a " "database of ``uri -> is_authenticated`` mappings. Can be used by a " @@ -576,7 +587,7 @@ msgid "" "immediately instead of waiting for a ``401`` response first." msgstr "" -#: ../../library/urllib.request.rst:343 +#: ../../library/urllib.request.rst:355 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -595,11 +606,11 @@ msgid "" "will automatically include the authentication credentials." msgstr "" -#: ../../library/urllib.request.rst:360 +#: ../../library/urllib.request.rst:372 msgid "Added ``is_authenticated`` support." msgstr "新增 ``is_authenticated`` 的支援。" -#: ../../library/urllib.request.rst:366 +#: ../../library/urllib.request.rst:378 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -608,7 +619,7 @@ msgid "" "presented with a wrong Authentication scheme." msgstr "" -#: ../../library/urllib.request.rst:375 ../../library/urllib.request.rst:409 +#: ../../library/urllib.request.rst:387 ../../library/urllib.request.rst:421 msgid "" "Handle authentication with the proxy. *password_mgr*, if given, should be " "something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -616,7 +627,7 @@ msgid "" "be supported." msgstr "" -#: ../../library/urllib.request.rst:383 +#: ../../library/urllib.request.rst:395 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -624,7 +635,7 @@ msgid "" "`http-password-mgr` for information on the interface that must be supported." msgstr "" -#: ../../library/urllib.request.rst:392 +#: ../../library/urllib.request.rst:404 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -637,108 +648,108 @@ msgid "" "Digest or Basic." msgstr "" -#: ../../library/urllib.request.rst:402 +#: ../../library/urllib.request.rst:414 msgid "Raise :exc:`ValueError` on unsupported Authentication Scheme." msgstr "" -#: ../../library/urllib.request.rst:417 +#: ../../library/urllib.request.rst:429 msgid "A class to handle opening of HTTP URLs." msgstr "" -#: ../../library/urllib.request.rst:422 +#: ../../library/urllib.request.rst:434 msgid "" "A class to handle opening of HTTPS URLs. *context* and *check_hostname* " "have the same meaning as in :class:`http.client.HTTPSConnection`." msgstr "" -#: ../../library/urllib.request.rst:425 +#: ../../library/urllib.request.rst:437 msgid "*context* and *check_hostname* were added." msgstr "新增 *context* 與 *check_hostname*。" -#: ../../library/urllib.request.rst:431 +#: ../../library/urllib.request.rst:443 msgid "Open local files." msgstr "" -#: ../../library/urllib.request.rst:435 +#: ../../library/urllib.request.rst:447 msgid "Open data URLs." msgstr "" -#: ../../library/urllib.request.rst:441 +#: ../../library/urllib.request.rst:453 msgid "Open FTP URLs." msgstr "" -#: ../../library/urllib.request.rst:446 +#: ../../library/urllib.request.rst:458 msgid "" "Open FTP URLs, keeping a cache of open FTP connections to minimize delays." msgstr "" -#: ../../library/urllib.request.rst:451 +#: ../../library/urllib.request.rst:463 msgid "A catch-all class to handle unknown URLs." msgstr "" -#: ../../library/urllib.request.rst:456 ../../library/urllib.request.rst:1162 +#: ../../library/urllib.request.rst:468 ../../library/urllib.request.rst:1174 msgid "Process HTTP error responses." msgstr "" -#: ../../library/urllib.request.rst:462 +#: ../../library/urllib.request.rst:474 msgid "Request Objects" msgstr "" -#: ../../library/urllib.request.rst:464 +#: ../../library/urllib.request.rst:476 msgid "" "The following methods describe :class:`Request`'s public interface, and so " "all may be overridden in subclasses. It also defines several public " "attributes that can be used by clients to inspect the parsed request." msgstr "" -#: ../../library/urllib.request.rst:471 +#: ../../library/urllib.request.rst:483 msgid "The original URL passed to the constructor." msgstr "" -#: ../../library/urllib.request.rst:475 +#: ../../library/urllib.request.rst:487 msgid "" "Request.full_url is a property with setter, getter and a deleter. Getting :" "attr:`~Request.full_url` returns the original request URL with the fragment, " "if it was present." msgstr "" -#: ../../library/urllib.request.rst:481 +#: ../../library/urllib.request.rst:493 msgid "The URI scheme." msgstr "" -#: ../../library/urllib.request.rst:485 +#: ../../library/urllib.request.rst:497 msgid "" "The URI authority, typically a host, but may also contain a port separated " "by a colon." msgstr "" -#: ../../library/urllib.request.rst:490 +#: ../../library/urllib.request.rst:502 msgid "The original host for the request, without port." msgstr "" -#: ../../library/urllib.request.rst:494 +#: ../../library/urllib.request.rst:506 msgid "" "The URI path. If the :class:`Request` uses a proxy, then selector will be " "the full URL that is passed to the proxy." msgstr "" -#: ../../library/urllib.request.rst:499 +#: ../../library/urllib.request.rst:511 msgid "The entity body for the request, or ``None`` if not specified." msgstr "" -#: ../../library/urllib.request.rst:501 +#: ../../library/urllib.request.rst:513 msgid "" "Changing value of :attr:`Request.data` now deletes \"Content-Length\" header " "if it was previously set or calculated." msgstr "" -#: ../../library/urllib.request.rst:507 +#: ../../library/urllib.request.rst:519 msgid "" "boolean, indicates whether the request is unverifiable as defined by :rfc:" "`2965`." msgstr "" -#: ../../library/urllib.request.rst:512 +#: ../../library/urllib.request.rst:524 msgid "" "The HTTP request method to use. By default its value is :const:`None`, " "which means that :meth:`~Request.get_method` will do its normal computation " @@ -749,13 +760,13 @@ msgid "" "argument." msgstr "" -#: ../../library/urllib.request.rst:522 +#: ../../library/urllib.request.rst:534 msgid "" "A default value can now be set in subclasses; previously it could only be " "set via the constructor argument." msgstr "" -#: ../../library/urllib.request.rst:529 +#: ../../library/urllib.request.rst:541 msgid "" "Return a string indicating the HTTP request method. If :attr:`Request." "method` is not ``None``, return its value, otherwise return ``'GET'`` if :" @@ -763,11 +774,11 @@ msgid "" "meaningful for HTTP requests." msgstr "" -#: ../../library/urllib.request.rst:534 +#: ../../library/urllib.request.rst:546 msgid "get_method now looks at the value of :attr:`Request.method`." msgstr "" -#: ../../library/urllib.request.rst:540 +#: ../../library/urllib.request.rst:552 msgid "" "Add another header to the request. Headers are currently ignored by all " "handlers except HTTP handlers, where they are added to the list of headers " @@ -779,64 +790,64 @@ msgid "" "headers added using this method are also added to redirected requests." msgstr "" -#: ../../library/urllib.request.rst:552 +#: ../../library/urllib.request.rst:564 msgid "Add a header that will not be added to a redirected request." msgstr "" -#: ../../library/urllib.request.rst:557 +#: ../../library/urllib.request.rst:569 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -#: ../../library/urllib.request.rst:563 +#: ../../library/urllib.request.rst:575 msgid "" "Remove named header from the request instance (both from regular and " "unredirected headers)." msgstr "" -#: ../../library/urllib.request.rst:571 +#: ../../library/urllib.request.rst:583 msgid "Return the URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:575 +#: ../../library/urllib.request.rst:587 msgid "Returns :attr:`Request.full_url`" msgstr "" -#: ../../library/urllib.request.rst:580 +#: ../../library/urllib.request.rst:592 msgid "" "Prepare the request by connecting to a proxy server. The *host* and *type* " "will replace those of the instance, and the instance's selector will be the " "original URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:587 +#: ../../library/urllib.request.rst:599 msgid "" "Return the value of the given header. If the header is not present, return " "the default value." msgstr "" -#: ../../library/urllib.request.rst:593 +#: ../../library/urllib.request.rst:605 msgid "" "Return a list of tuples (header_name, header_value) of the Request headers." msgstr "" -#: ../../library/urllib.request.rst:595 +#: ../../library/urllib.request.rst:607 msgid "" "The request methods add_data, has_data, get_data, get_type, get_host, " "get_selector, get_origin_req_host and is_unverifiable that were deprecated " "since 3.3 have been removed." msgstr "" -#: ../../library/urllib.request.rst:604 +#: ../../library/urllib.request.rst:616 msgid "OpenerDirector Objects" msgstr "OpenerDirector 物件" -#: ../../library/urllib.request.rst:606 +#: ../../library/urllib.request.rst:618 msgid ":class:`OpenerDirector` instances have the following methods:" msgstr "" -#: ../../library/urllib.request.rst:611 +#: ../../library/urllib.request.rst:623 msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " @@ -847,53 +858,53 @@ msgid "" "`http_error_404` would handle HTTP 404 errors." msgstr "" -#: ../../library/urllib.request.rst:619 +#: ../../library/urllib.request.rst:631 msgid "" ":meth:`!_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" -#: ../../library/urllib.request.rst:622 +#: ../../library/urllib.request.rst:634 msgid "See |protocol_open|_ for more information." msgstr "更多資訊請見 |protocol_open|_。" -#: ../../library/urllib.request.rst:624 +#: ../../library/urllib.request.rst:636 msgid "" ":meth:`!http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" -#: ../../library/urllib.request.rst:627 +#: ../../library/urllib.request.rst:639 msgid "See |http_error_nnn|_ for more information." msgstr "更多資訊請見 |http_error_nnn|_。" -#: ../../library/urllib.request.rst:629 +#: ../../library/urllib.request.rst:641 msgid "" ":meth:`!_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" -#: ../../library/urllib.request.rst:632 +#: ../../library/urllib.request.rst:644 msgid "" ":meth:`!_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" -#: ../../library/urllib.request.rst:635 +#: ../../library/urllib.request.rst:647 msgid "See |protocol_request|_ for more information." msgstr "更多資訊請見 |protocol_request|_。" -#: ../../library/urllib.request.rst:637 +#: ../../library/urllib.request.rst:649 msgid "" ":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -#: ../../library/urllib.request.rst:640 +#: ../../library/urllib.request.rst:652 msgid "See |protocol_response|_ for more information." msgstr "更多資訊請見 |protocol_response|_。" -#: ../../library/urllib.request.rst:649 +#: ../../library/urllib.request.rst:661 msgid "" "Open the given *url* (which can be a request object or a string), optionally " "passing the given *data*. Arguments, return values and exceptions raised are " @@ -905,7 +916,7 @@ msgid "" "HTTP, HTTPS and FTP connections." msgstr "" -#: ../../library/urllib.request.rst:661 +#: ../../library/urllib.request.rst:673 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 " @@ -914,28 +925,28 @@ msgid "" "http_error_\\` methods of the handler classes." msgstr "" -#: ../../library/urllib.request.rst:667 +#: ../../library/urllib.request.rst:679 msgid "" "Return values and exceptions raised are the same as those of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:669 +#: ../../library/urllib.request.rst:681 msgid "OpenerDirector objects open URLs in three stages:" msgstr "" -#: ../../library/urllib.request.rst:671 +#: ../../library/urllib.request.rst:683 msgid "" "The order in which these methods are called within each stage is determined " "by sorting the handler instances." msgstr "" -#: ../../library/urllib.request.rst:674 +#: ../../library/urllib.request.rst:686 msgid "" "Every handler with a method named like :meth:`!_request` has that " "method called to pre-process the request." msgstr "" -#: ../../library/urllib.request.rst:677 +#: ../../library/urllib.request.rst:689 msgid "" "Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" @@ -943,7 +954,7 @@ msgid "" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -#: ../../library/urllib.request.rst:682 +#: ../../library/urllib.request.rst:694 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" "`~BaseHandler.default_open`. If all such methods return :const:`None`, the " @@ -952,64 +963,64 @@ msgid "" "named :meth:`~BaseHandler.unknown_open`." msgstr "" -#: ../../library/urllib.request.rst:688 +#: ../../library/urllib.request.rst:700 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" -#: ../../library/urllib.request.rst:692 +#: ../../library/urllib.request.rst:704 msgid "" "Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" -#: ../../library/urllib.request.rst:699 +#: ../../library/urllib.request.rst:711 msgid "BaseHandler Objects" msgstr "BaseHandler 物件" -#: ../../library/urllib.request.rst:701 +#: ../../library/urllib.request.rst:713 msgid "" ":class:`BaseHandler` objects provide a couple of methods that are directly " "useful, and others that are meant to be used by derived classes. These are " "intended for direct use:" msgstr "" -#: ../../library/urllib.request.rst:708 +#: ../../library/urllib.request.rst:720 msgid "Add a director as parent." msgstr "" -#: ../../library/urllib.request.rst:713 +#: ../../library/urllib.request.rst:725 msgid "Remove any parents." msgstr "" -#: ../../library/urllib.request.rst:715 +#: ../../library/urllib.request.rst:727 msgid "" "The following attribute and methods should only be used by classes derived " "from :class:`BaseHandler`." msgstr "" -#: ../../library/urllib.request.rst:720 +#: ../../library/urllib.request.rst:732 msgid "" "The convention has been adopted that subclasses defining :meth:`!" "_request` or :meth:`!_response` methods are named :class:" "`!\\*Processor`; all others are named :class:`!\\*Handler`." msgstr "" -#: ../../library/urllib.request.rst:727 +#: ../../library/urllib.request.rst:739 msgid "" "A valid :class:`OpenerDirector`, which can be used to open using a different " "protocol, or handle errors." msgstr "" -#: ../../library/urllib.request.rst:733 +#: ../../library/urllib.request.rst:745 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs." msgstr "" -#: ../../library/urllib.request.rst:736 +#: ../../library/urllib.request.rst:748 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " @@ -1019,38 +1030,38 @@ msgid "" "`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" -#: ../../library/urllib.request.rst:743 +#: ../../library/urllib.request.rst:755 msgid "This method will be called before any protocol-specific open method." msgstr "" -#: ../../library/urllib.request.rst:750 +#: ../../library/urllib.request.rst:762 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to handle URLs with the given protocol." msgstr "" -#: ../../library/urllib.request.rst:753 +#: ../../library/urllib.request.rst:765 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`~BaseHandler.default_open`." msgstr "" -#: ../../library/urllib.request.rst:759 +#: ../../library/urllib.request.rst:771 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs with no specific registered handler " "to open it." msgstr "" -#: ../../library/urllib.request.rst:763 +#: ../../library/urllib.request.rst:775 msgid "" "This method, if implemented, will be called by the :attr:`parent` :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: ../../library/urllib.request.rst:770 +#: ../../library/urllib.request.rst:782 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " @@ -1059,7 +1070,7 @@ msgid "" "other circumstances." msgstr "" -#: ../../library/urllib.request.rst:775 +#: ../../library/urllib.request.rst:787 msgid "" "*req* will be a :class:`Request` object, *fp* will be a file-like object " "with the HTTP error body, *code* will be the three-digit code of the error, " @@ -1067,49 +1078,49 @@ msgid "" "mapping object with the headers of the error." msgstr "" -#: ../../library/urllib.request.rst:780 +#: ../../library/urllib.request.rst:792 msgid "" "Return values and exceptions raised should be the same as those of :func:" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:787 +#: ../../library/urllib.request.rst:799 msgid "" "*nnn* should be a three-digit HTTP error code. This method is also not " "defined in :class:`BaseHandler`, but will be called, if it exists, on an " "instance of a subclass, when an HTTP error with code *nnn* occurs." msgstr "" -#: ../../library/urllib.request.rst:791 +#: ../../library/urllib.request.rst:803 msgid "Subclasses should override this method to handle specific HTTP errors." msgstr "" -#: ../../library/urllib.request.rst:793 +#: ../../library/urllib.request.rst:805 msgid "" "Arguments, return values and exceptions raised should be the same as for :" "meth:`~BaseHandler.http_error_default`." msgstr "" -#: ../../library/urllib.request.rst:801 +#: ../../library/urllib.request.rst:813 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to pre-process requests of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:804 +#: ../../library/urllib.request.rst:816 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. The return value " "should be a :class:`Request` object." msgstr "" -#: ../../library/urllib.request.rst:813 +#: ../../library/urllib.request.rst:825 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:816 +#: ../../library/urllib.request.rst:828 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " @@ -1118,25 +1129,25 @@ msgid "" "return value of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:826 +#: ../../library/urllib.request.rst:838 msgid "HTTPRedirectHandler Objects" msgstr "HTTPRedirectHandler 物件" -#: ../../library/urllib.request.rst:830 +#: ../../library/urllib.request.rst:842 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -#: ../../library/urllib.request.rst:834 +#: ../../library/urllib.request.rst:846 msgid "" "An :exc:`~urllib.error.HTTPError` exception raised as a security " "consideration if the HTTPRedirectHandler is presented with a redirected URL " "which is not an HTTP, HTTPS or FTP URL." msgstr "" -#: ../../library/urllib.request.rst:841 +#: ../../library/urllib.request.rst:853 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`!http_error_30\\*` " @@ -1147,7 +1158,7 @@ msgid "" "URL, or return ``None`` if you can't but another handler might." msgstr "" -#: ../../library/urllib.request.rst:851 +#: ../../library/urllib.request.rst:863 msgid "" "The default implementation of this method does not strictly follow :rfc:" "`2616`, which says that 301 and 302 responses to ``POST`` requests must not " @@ -1156,54 +1167,54 @@ msgid "" "POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" -#: ../../library/urllib.request.rst:860 +#: ../../library/urllib.request.rst:872 msgid "" "Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the " "parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' " "response." msgstr "" -#: ../../library/urllib.request.rst:866 +#: ../../library/urllib.request.rst:878 msgid "" "The same as :meth:`http_error_301`, but called for the 'found' response." msgstr "" -#: ../../library/urllib.request.rst:871 +#: ../../library/urllib.request.rst:883 msgid "" "The same as :meth:`http_error_301`, but called for the 'see other' response." msgstr "" -#: ../../library/urllib.request.rst:876 +#: ../../library/urllib.request.rst:888 msgid "" "The same as :meth:`http_error_301`, but called for the 'temporary redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:883 +#: ../../library/urllib.request.rst:895 msgid "" "The same as :meth:`http_error_301`, but called for the 'permanent redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:893 +#: ../../library/urllib.request.rst:905 msgid "HTTPCookieProcessor Objects" msgstr "HTTPCookieProcessor 物件" -#: ../../library/urllib.request.rst:895 +#: ../../library/urllib.request.rst:907 msgid ":class:`HTTPCookieProcessor` instances have one attribute:" msgstr "" -#: ../../library/urllib.request.rst:899 +#: ../../library/urllib.request.rst:911 msgid "The :class:`http.cookiejar.CookieJar` in which cookies are stored." msgstr "" -#: ../../library/urllib.request.rst:905 +#: ../../library/urllib.request.rst:917 msgid "ProxyHandler Objects" msgstr "ProxyHandler 物件" -#: ../../library/urllib.request.rst:911 +#: ../../library/urllib.request.rst:923 msgid "" "The :class:`ProxyHandler` will have a method :meth:`!_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " @@ -1212,17 +1223,17 @@ msgid "" "actually execute the protocol." msgstr "" -#: ../../library/urllib.request.rst:921 +#: ../../library/urllib.request.rst:933 msgid "HTTPPasswordMgr Objects" msgstr "HTTPPasswordMgr 物件" -#: ../../library/urllib.request.rst:923 +#: ../../library/urllib.request.rst:935 msgid "" "These methods are available on :class:`HTTPPasswordMgr` and :class:" "`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" -#: ../../library/urllib.request.rst:929 +#: ../../library/urllib.request.rst:941 msgid "" "*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and " "*passwd* must be strings. This causes ``(user, passwd)`` to be used as " @@ -1230,30 +1241,30 @@ msgid "" "of the given URIs is given." msgstr "" -#: ../../library/urllib.request.rst:937 +#: ../../library/urllib.request.rst:949 msgid "" "Get user/password for given realm and URI, if any. This method will return " "``(None, None)`` if there is no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:940 +#: ../../library/urllib.request.rst:952 msgid "" "For :class:`HTTPPasswordMgrWithDefaultRealm` objects, the realm ``None`` " "will be searched if the given *realm* has no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:947 +#: ../../library/urllib.request.rst:959 msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "HTTPPasswordMgrWithPriorAuth 物件" -#: ../../library/urllib.request.rst:949 +#: ../../library/urllib.request.rst:961 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" -#: ../../library/urllib.request.rst:956 +#: ../../library/urllib.request.rst:968 msgid "" "*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." "add_password`. *is_authenticated* sets the initial value of the " @@ -1261,25 +1272,25 @@ msgid "" "*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" -#: ../../library/urllib.request.rst:964 +#: ../../library/urllib.request.rst:976 msgid "Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects" msgstr "" -#: ../../library/urllib.request.rst:970 +#: ../../library/urllib.request.rst:982 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -#: ../../library/urllib.request.rst:976 +#: ../../library/urllib.request.rst:988 msgid "" "Returns the current state of the ``is_authenticated`` flag for the given URI." msgstr "" -#: ../../library/urllib.request.rst:983 +#: ../../library/urllib.request.rst:995 msgid "AbstractBasicAuthHandler Objects" msgstr "AbstractBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:988 +#: ../../library/urllib.request.rst:1000 msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " @@ -1288,7 +1299,7 @@ msgid "" "`Request` object, and *headers* should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:994 +#: ../../library/urllib.request.rst:1006 msgid "" "*host* is either an authority (e.g. ``\"python.org\"``) or a URL containing " "an authority component (e.g. ``\"http://python.org/\"``). In either case, " @@ -1296,24 +1307,24 @@ msgid "" "and ``\"python.org:80\"`` are fine, ``\"joe:password@python.org\"`` is not)." msgstr "" -#: ../../library/urllib.request.rst:1003 +#: ../../library/urllib.request.rst:1015 msgid "HTTPBasicAuthHandler Objects" msgstr "HTTPBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1008 ../../library/urllib.request.rst:1019 -#: ../../library/urllib.request.rst:1044 ../../library/urllib.request.rst:1055 +#: ../../library/urllib.request.rst:1020 ../../library/urllib.request.rst:1031 +#: ../../library/urllib.request.rst:1056 ../../library/urllib.request.rst:1067 msgid "Retry the request with authentication information, if available." msgstr "" -#: ../../library/urllib.request.rst:1014 +#: ../../library/urllib.request.rst:1026 msgid "ProxyBasicAuthHandler Objects" msgstr "ProxyBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1025 +#: ../../library/urllib.request.rst:1037 msgid "AbstractDigestAuthHandler Objects" msgstr "AbstractDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1030 +#: ../../library/urllib.request.rst:1042 msgid "" "*authreq* should be the name of the header where the information about the " "realm is included in the request, *host* should be the host to authenticate " @@ -1321,55 +1332,55 @@ msgid "" "should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:1039 +#: ../../library/urllib.request.rst:1051 msgid "HTTPDigestAuthHandler Objects" msgstr "HTTPDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1050 +#: ../../library/urllib.request.rst:1062 msgid "ProxyDigestAuthHandler Objects" msgstr "ProxyDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1061 +#: ../../library/urllib.request.rst:1073 msgid "HTTPHandler Objects" msgstr "HTTPHandler 物件" -#: ../../library/urllib.request.rst:1066 +#: ../../library/urllib.request.rst:1078 msgid "" "Send an HTTP request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1073 +#: ../../library/urllib.request.rst:1085 msgid "HTTPSHandler Objects" msgstr "HTTPSHandler 物件" -#: ../../library/urllib.request.rst:1078 +#: ../../library/urllib.request.rst:1090 msgid "" "Send an HTTPS request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1085 +#: ../../library/urllib.request.rst:1097 msgid "FileHandler Objects" msgstr "FileHandler 物件" -#: ../../library/urllib.request.rst:1090 +#: ../../library/urllib.request.rst:1102 msgid "" "Open the file locally, if there is no host name, or the host name is " "``'localhost'``." msgstr "" -#: ../../library/urllib.request.rst:1093 +#: ../../library/urllib.request.rst:1105 msgid "" "This method is applicable only for local hostnames. When a remote hostname " "is given, a :exc:`~urllib.error.URLError` is raised." msgstr "" -#: ../../library/urllib.request.rst:1101 +#: ../../library/urllib.request.rst:1113 msgid "DataHandler Objects" msgstr "DataHandler 物件" -#: ../../library/urllib.request.rst:1105 +#: ../../library/urllib.request.rst:1117 msgid "" "Read a data URL. This kind of URL contains the content encoded in the URL " "itself. The data URL syntax is specified in :rfc:`2397`. This implementation " @@ -1379,51 +1390,51 @@ msgid "" "implementation will raise a :exc:`ValueError` in that case." msgstr "" -#: ../../library/urllib.request.rst:1116 +#: ../../library/urllib.request.rst:1128 msgid "FTPHandler Objects" msgstr "FTPHandler 物件" -#: ../../library/urllib.request.rst:1121 +#: ../../library/urllib.request.rst:1133 msgid "" "Open the FTP file indicated by *req*. The login is always done with empty " "username and password." msgstr "" -#: ../../library/urllib.request.rst:1128 +#: ../../library/urllib.request.rst:1140 msgid "CacheFTPHandler Objects" msgstr "CacheFTPHandler 物件" -#: ../../library/urllib.request.rst:1130 +#: ../../library/urllib.request.rst:1142 msgid "" ":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the " "following additional methods:" msgstr "" -#: ../../library/urllib.request.rst:1136 +#: ../../library/urllib.request.rst:1148 msgid "Set timeout of connections to *t* seconds." msgstr "" -#: ../../library/urllib.request.rst:1141 +#: ../../library/urllib.request.rst:1153 msgid "Set maximum number of cached connections to *m*." msgstr "" -#: ../../library/urllib.request.rst:1147 +#: ../../library/urllib.request.rst:1159 msgid "UnknownHandler Objects" msgstr "UnknownHandler 物件" -#: ../../library/urllib.request.rst:1152 +#: ../../library/urllib.request.rst:1164 msgid "Raise a :exc:`~urllib.error.URLError` exception." msgstr "" -#: ../../library/urllib.request.rst:1158 +#: ../../library/urllib.request.rst:1170 msgid "HTTPErrorProcessor Objects" msgstr "HTTPErrorProcessor 物件" -#: ../../library/urllib.request.rst:1164 +#: ../../library/urllib.request.rst:1176 msgid "For 200 error codes, the response object is returned immediately." msgstr "" -#: ../../library/urllib.request.rst:1166 +#: ../../library/urllib.request.rst:1178 msgid "" "For non-200 error codes, this simply passes the job on to the :meth:`!" "http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " @@ -1431,31 +1442,31 @@ msgid "" "error.HTTPError` if no other handler handles the error." msgstr "" -#: ../../library/urllib.request.rst:1174 +#: ../../library/urllib.request.rst:1186 msgid "Process HTTPS error responses." msgstr "" -#: ../../library/urllib.request.rst:1176 +#: ../../library/urllib.request.rst:1188 msgid "The behavior is same as :meth:`http_response`." msgstr "" -#: ../../library/urllib.request.rst:1182 +#: ../../library/urllib.request.rst:1194 msgid "Examples" msgstr "範例" -#: ../../library/urllib.request.rst:1184 +#: ../../library/urllib.request.rst:1196 msgid "" "In addition to the examples below, more examples are given in :ref:`urllib-" "howto`." msgstr "" -#: ../../library/urllib.request.rst:1187 +#: ../../library/urllib.request.rst:1199 msgid "" "This example gets the python.org main page and displays the first 300 bytes " "of it. ::" msgstr "" -#: ../../library/urllib.request.rst:1190 +#: ../../library/urllib.request.rst:1202 msgid "" ">>> import urllib.request\n" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" @@ -1481,7 +1492,7 @@ msgstr "" ">\\n\n" "Python Programming '" -#: ../../library/urllib.request.rst:1200 +#: ../../library/urllib.request.rst:1212 msgid "" "Note that urlopen returns a bytes object. This is because there is no way " "for urlopen to automatically determine the encoding of the byte stream it " @@ -1490,20 +1501,20 @@ msgid "" "appropriate encoding." msgstr "" -#: ../../library/urllib.request.rst:1206 +#: ../../library/urllib.request.rst:1218 msgid "" "The following W3C document, https://www.w3.org/International/O-charset\\ , " "lists the various ways in which an (X)HTML or an XML document could have " "specified its encoding information." msgstr "" -#: ../../library/urllib.request.rst:1210 +#: ../../library/urllib.request.rst:1222 msgid "" "As the python.org website uses *utf-8* encoding as specified in its meta " "tag, we will use the same for decoding the bytes object. ::" msgstr "" -#: ../../library/urllib.request.rst:1213 +#: ../../library/urllib.request.rst:1225 msgid "" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" "... print(f.read(100).decode('utf-8'))\n" @@ -1517,13 +1528,13 @@ msgstr "" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" "\"http://www.w3.org/TR/xhtml1/DTD/xhtm" -#: ../../library/urllib.request.rst:1219 +#: ../../library/urllib.request.rst:1231 msgid "" "It is also possible to achieve the same result without using the :term:" "`context manager` approach. ::" msgstr "" -#: ../../library/urllib.request.rst:1222 +#: ../../library/urllib.request.rst:1234 msgid "" ">>> import urllib.request\n" ">>> f = urllib.request.urlopen('http://www.python.org/')\n" @@ -1537,14 +1548,14 @@ msgstr "" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" "\"http://www.w3.org/TR/xhtml1/DTD/xhtm" -#: ../../library/urllib.request.rst:1228 +#: ../../library/urllib.request.rst:1240 msgid "" "In the following example, we are sending a data-stream to the stdin of a CGI " "and reading the data it returns to us. Note that this example will only work " "when the Python installation supports SSL. ::" msgstr "" -#: ../../library/urllib.request.rst:1232 +#: ../../library/urllib.request.rst:1244 msgid "" ">>> import urllib.request\n" ">>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',\n" @@ -1555,11 +1566,11 @@ msgid "" "Got Data: \"This data is passed to stdin of the CGI\"" msgstr "" -#: ../../library/urllib.request.rst:1240 +#: ../../library/urllib.request.rst:1252 msgid "The code for the sample CGI used in the above example is::" msgstr "" -#: ../../library/urllib.request.rst:1242 +#: ../../library/urllib.request.rst:1254 msgid "" "#!/usr/bin/env python\n" "import sys\n" @@ -1571,11 +1582,11 @@ msgstr "" "data = sys.stdin.read()\n" "print('Content-type: text/plain\\n\\nGot Data: \"%s\"' % data)" -#: ../../library/urllib.request.rst:1247 +#: ../../library/urllib.request.rst:1259 msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::" msgstr "" -#: ../../library/urllib.request.rst:1249 +#: ../../library/urllib.request.rst:1261 msgid "" "import urllib.request\n" "DATA = b'some data'\n" @@ -1595,11 +1606,11 @@ msgstr "" "print(f.status)\n" "print(f.reason)" -#: ../../library/urllib.request.rst:1257 +#: ../../library/urllib.request.rst:1269 msgid "Use of Basic HTTP Authentication::" msgstr "" -#: ../../library/urllib.request.rst:1259 +#: ../../library/urllib.request.rst:1271 msgid "" "import urllib.request\n" "# Create an OpenerDirector with support for Basic HTTP Authentication...\n" @@ -1614,7 +1625,7 @@ msgid "" "urllib.request.urlopen('http://www.example.com/login.html')" msgstr "" -#: ../../library/urllib.request.rst:1271 +#: ../../library/urllib.request.rst:1283 msgid "" ":func:`build_opener` provides many handlers by default, including a :class:" "`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " @@ -1623,14 +1634,14 @@ msgid "" "read to obtain the HTTP proxy's URL." msgstr "" -#: ../../library/urllib.request.rst:1277 +#: ../../library/urllib.request.rst:1289 msgid "" "This example replaces the default :class:`ProxyHandler` with one that uses " "programmatically supplied proxy URLs, and adds proxy authorization support " "with :class:`ProxyBasicAuthHandler`. ::" msgstr "" -#: ../../library/urllib.request.rst:1281 +#: ../../library/urllib.request.rst:1293 msgid "" "proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example." "com:3128/'})\n" @@ -1650,15 +1661,15 @@ msgstr "" "# 這次我們直接使用它而不安裝 OpenerDirector:\n" "opener.open('http://www.example.com/login.html')" -#: ../../library/urllib.request.rst:1289 +#: ../../library/urllib.request.rst:1301 msgid "Adding HTTP headers:" msgstr "" -#: ../../library/urllib.request.rst:1291 +#: ../../library/urllib.request.rst:1303 msgid "Use the *headers* argument to the :class:`Request` constructor, or::" msgstr "" -#: ../../library/urllib.request.rst:1293 +#: ../../library/urllib.request.rst:1305 msgid "" "import urllib.request\n" "req = urllib.request.Request('http://www.example.com/')\n" @@ -1674,13 +1685,13 @@ msgstr "" "req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)')\n" "r = urllib.request.urlopen(req)" -#: ../../library/urllib.request.rst:1300 +#: ../../library/urllib.request.rst:1312 msgid "" ":class:`OpenerDirector` automatically adds a :mailheader:`User-Agent` header " "to every :class:`Request`. To change this::" msgstr "" -#: ../../library/urllib.request.rst:1303 +#: ../../library/urllib.request.rst:1315 msgid "" "import urllib.request\n" "opener = urllib.request.build_opener()\n" @@ -1692,20 +1703,20 @@ msgstr "" "opener.addheaders = [('User-agent', 'Mozilla/5.0')]\n" "opener.open('http://www.example.com/')" -#: ../../library/urllib.request.rst:1308 +#: ../../library/urllib.request.rst:1320 msgid "" "Also, remember that a few standard headers (:mailheader:`Content-Length`, :" "mailheader:`Content-Type` and :mailheader:`Host`) are added when the :class:" "`Request` is passed to :func:`urlopen` (or :meth:`OpenerDirector.open`)." msgstr "" -#: ../../library/urllib.request.rst:1315 +#: ../../library/urllib.request.rst:1327 msgid "" "Here is an example session that uses the ``GET`` method to retrieve a URL " "containing parameters::" msgstr "" -#: ../../library/urllib.request.rst:1318 +#: ../../library/urllib.request.rst:1330 msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -1723,14 +1734,14 @@ msgstr "" "... print(f.read().decode('utf-8'))\n" "..." -#: ../../library/urllib.request.rst:1326 +#: ../../library/urllib.request.rst:1338 msgid "" "The following example uses the ``POST`` method instead. Note that params " "output from urlencode is encoded to bytes before it is sent to urlopen as " "data::" msgstr "" -#: ../../library/urllib.request.rst:1329 +#: ../../library/urllib.request.rst:1341 msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -1750,13 +1761,13 @@ msgstr "" "... print(f.read().decode('utf-8'))\n" "..." -#: ../../library/urllib.request.rst:1337 +#: ../../library/urllib.request.rst:1349 msgid "" "The following example uses an explicitly specified HTTP proxy, overriding " "environment settings::" msgstr "" -#: ../../library/urllib.request.rst:1340 +#: ../../library/urllib.request.rst:1352 msgid "" ">>> import urllib.request\n" ">>> proxies = {'http': 'http://proxy.example.com:8080/'}\n" @@ -1772,13 +1783,13 @@ msgstr "" "... f.read().decode('utf-8')\n" "..." -#: ../../library/urllib.request.rst:1347 +#: ../../library/urllib.request.rst:1359 msgid "" "The following example uses no proxies at all, overriding environment " "settings::" msgstr "" -#: ../../library/urllib.request.rst:1349 +#: ../../library/urllib.request.rst:1361 msgid "" ">>> import urllib.request\n" ">>> opener = urllib.request.FancyURLopener({})\n" @@ -1792,18 +1803,18 @@ msgstr "" "... f.read().decode('utf-8')\n" "..." -#: ../../library/urllib.request.rst:1357 +#: ../../library/urllib.request.rst:1369 msgid "Legacy interface" msgstr "" -#: ../../library/urllib.request.rst:1359 +#: ../../library/urllib.request.rst:1371 msgid "" "The following functions and classes are ported from the Python 2 module " "``urllib`` (as opposed to ``urllib2``). They might become deprecated at " "some point in the future." msgstr "" -#: ../../library/urllib.request.rst:1365 +#: ../../library/urllib.request.rst:1377 msgid "" "Copy a network object denoted by a URL to a local file. If the URL points to " "a local file, the object will not be copied unless filename is supplied. " @@ -1813,7 +1824,7 @@ msgid "" "a remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1372 +#: ../../library/urllib.request.rst:1384 msgid "" "The second argument, if present, specifies the file location to copy to (if " "absent, the location will be a tempfile with a generated name). The third " @@ -1825,11 +1836,11 @@ msgid "" "file size in response to a retrieval request." msgstr "" -#: ../../library/urllib.request.rst:1381 +#: ../../library/urllib.request.rst:1393 msgid "The following example illustrates the most common usage scenario::" msgstr "" -#: ../../library/urllib.request.rst:1383 +#: ../../library/urllib.request.rst:1395 msgid "" ">>> import urllib.request\n" ">>> local_filename, headers = urllib.request.urlretrieve('http://python." @@ -1843,7 +1854,7 @@ msgstr "" ">>> html = open(local_filename)\n" ">>> html.close()" -#: ../../library/urllib.request.rst:1388 +#: ../../library/urllib.request.rst:1400 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1852,7 +1863,7 @@ msgid "" "parse.urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1394 +#: ../../library/urllib.request.rst:1406 msgid "" ":func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` " "when it detects that the amount of data available was less than the " @@ -1860,40 +1871,40 @@ msgid "" "This can occur, for example, when the download is interrupted." msgstr "" -#: ../../library/urllib.request.rst:1399 +#: ../../library/urllib.request.rst:1411 msgid "" "The *Content-Length* is treated as a lower bound: if there's more data to " "read, urlretrieve reads more data, but if less data is available, it raises " "the exception." msgstr "" -#: ../../library/urllib.request.rst:1403 +#: ../../library/urllib.request.rst:1415 msgid "" "You can still retrieve the downloaded data in this case, it is stored in " "the :attr:`!content` attribute of the exception instance." msgstr "" -#: ../../library/urllib.request.rst:1406 +#: ../../library/urllib.request.rst:1418 msgid "" "If no *Content-Length* header was supplied, urlretrieve can not check the " "size of the data it has downloaded, and just returns it. In this case you " "just have to assume that the download was successful." msgstr "" -#: ../../library/urllib.request.rst:1412 +#: ../../library/urllib.request.rst:1424 msgid "" "Cleans up temporary files that may have been left behind by previous calls " "to :func:`urlretrieve`." msgstr "" -#: ../../library/urllib.request.rst:1419 +#: ../../library/urllib.request.rst:1431 msgid "" "Base class for opening and reading URLs. Unless you need to support opening " "objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:" "`, you probably want to use :class:`FancyURLopener`." msgstr "" -#: ../../library/urllib.request.rst:1423 +#: ../../library/urllib.request.rst:1435 msgid "" "By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` " "header of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number. " @@ -1903,7 +1914,7 @@ msgid "" "subclass definition." msgstr "" -#: ../../library/urllib.request.rst:1429 +#: ../../library/urllib.request.rst:1441 msgid "" "The optional *proxies* parameter should be a dictionary mapping scheme names " "to proxy URLs, where an empty dictionary turns proxies off completely. Its " @@ -1911,7 +1922,7 @@ msgid "" "be used if present, as discussed in the definition of :func:`urlopen`, above." msgstr "" -#: ../../library/urllib.request.rst:1434 +#: ../../library/urllib.request.rst:1446 msgid "" "Additional keyword parameters, collected in *x509*, may be used for " "authentication of the client when using the :file:`https:` scheme. The " @@ -1919,13 +1930,13 @@ msgid "" "certificate; both are needed to support client authentication." msgstr "" -#: ../../library/urllib.request.rst:1439 +#: ../../library/urllib.request.rst:1451 msgid "" ":class:`URLopener` objects will raise an :exc:`OSError` exception if the " "server returns an error code." msgstr "" -#: ../../library/urllib.request.rst:1444 +#: ../../library/urllib.request.rst:1456 msgid "" "Open *fullurl* using the appropriate protocol. This method sets up cache " "and proxy information, then calls the appropriate open method with its input " @@ -1934,15 +1945,15 @@ msgid "" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1450 +#: ../../library/urllib.request.rst:1462 msgid "This method always quotes *fullurl* using :func:`~urllib.parse.quote`." msgstr "" -#: ../../library/urllib.request.rst:1454 +#: ../../library/urllib.request.rst:1466 msgid "Overridable interface to open unknown URL types." msgstr "" -#: ../../library/urllib.request.rst:1459 +#: ../../library/urllib.request.rst:1471 msgid "" "Retrieves the contents of *url* and places it in *filename*. The return " "value is a tuple consisting of a local filename and either an :class:`email." @@ -1959,7 +1970,7 @@ msgid "" "*reporthook* is ignored for local URLs." msgstr "" -#: ../../library/urllib.request.rst:1472 +#: ../../library/urllib.request.rst:1484 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1968,7 +1979,7 @@ msgid "" "urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1481 +#: ../../library/urllib.request.rst:1493 msgid "" "Variable that specifies the user agent of the opener object. To get :mod:" "`urllib` to tell servers that it is a particular user agent, set this in a " @@ -1976,7 +1987,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/urllib.request.rst:1491 +#: ../../library/urllib.request.rst:1503 msgid "" ":class:`FancyURLopener` subclasses :class:`URLopener` providing default " "handling for the following HTTP response codes: 301, 302, 303, 307 and 401. " @@ -1987,14 +1998,14 @@ msgid "" "defaults to 10." msgstr "" -#: ../../library/urllib.request.rst:1498 +#: ../../library/urllib.request.rst:1510 msgid "" "For all other response codes, the method :meth:`~BaseHandler." "http_error_default` is called which you can override in subclasses to handle " "the error appropriately." msgstr "" -#: ../../library/urllib.request.rst:1503 +#: ../../library/urllib.request.rst:1515 msgid "" "According to the letter of :rfc:`2616`, 301 and 302 responses to POST " "requests must not be automatically redirected without confirmation by the " @@ -2003,13 +2014,13 @@ msgid "" "behaviour." msgstr "" -#: ../../library/urllib.request.rst:1508 +#: ../../library/urllib.request.rst:1520 msgid "" "The parameters to the constructor are the same as those for :class:" "`URLopener`." msgstr "" -#: ../../library/urllib.request.rst:1512 +#: ../../library/urllib.request.rst:1524 msgid "" "When performing basic authentication, a :class:`FancyURLopener` instance " "calls its :meth:`prompt_user_passwd` method. The default implementation " @@ -2018,59 +2029,59 @@ msgid "" "needed." msgstr "" -#: ../../library/urllib.request.rst:1517 +#: ../../library/urllib.request.rst:1529 msgid "" "The :class:`FancyURLopener` class offers one additional method that should " "be overloaded to provide the appropriate behavior:" msgstr "" -#: ../../library/urllib.request.rst:1522 +#: ../../library/urllib.request.rst:1534 msgid "" "Return information needed to authenticate the user at the given host in the " "specified security realm. The return value should be a tuple, ``(user, " "password)``, which can be used for basic authentication." msgstr "" -#: ../../library/urllib.request.rst:1526 +#: ../../library/urllib.request.rst:1538 msgid "" "The implementation prompts for this information on the terminal; an " "application should override this method to use an appropriate interaction " "model in the local environment." msgstr "" -#: ../../library/urllib.request.rst:1532 +#: ../../library/urllib.request.rst:1544 msgid ":mod:`urllib.request` Restrictions" msgstr "" -#: ../../library/urllib.request.rst:1538 +#: ../../library/urllib.request.rst:1550 msgid "" "Currently, only the following protocols are supported: HTTP (versions 0.9 " "and 1.0), FTP, local files, and data URLs." msgstr "" -#: ../../library/urllib.request.rst:1541 +#: ../../library/urllib.request.rst:1553 msgid "Added support for data URLs." msgstr "" -#: ../../library/urllib.request.rst:1543 +#: ../../library/urllib.request.rst:1555 msgid "" "The caching feature of :func:`urlretrieve` has been disabled until someone " "finds the time to hack proper processing of Expiration time headers." msgstr "" -#: ../../library/urllib.request.rst:1546 +#: ../../library/urllib.request.rst:1558 msgid "" "There should be a function to query whether a particular URL is in the cache." msgstr "" -#: ../../library/urllib.request.rst:1548 +#: ../../library/urllib.request.rst:1560 msgid "" "For backward compatibility, if a URL appears to point to a local file but " "the file can't be opened, the URL is re-interpreted using the FTP protocol. " "This can sometimes cause confusing error messages." msgstr "" -#: ../../library/urllib.request.rst:1552 +#: ../../library/urllib.request.rst:1564 msgid "" "The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily " "long delays while waiting for a network connection to be set up. This means " @@ -2078,7 +2089,7 @@ msgid "" "functions without using threads." msgstr "" -#: ../../library/urllib.request.rst:1561 +#: ../../library/urllib.request.rst:1573 msgid "" "The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data " "returned by the server. This may be binary data (such as an image), plain " @@ -2088,7 +2099,7 @@ msgid "" "module :mod:`html.parser` to parse it." msgstr "" -#: ../../library/urllib.request.rst:1570 +#: ../../library/urllib.request.rst:1582 msgid "" "The code handling the FTP protocol cannot differentiate between a file and a " "directory. This can lead to unexpected behavior when attempting to read a " @@ -2106,11 +2117,11 @@ msgid "" "meet your needs." msgstr "" -#: ../../library/urllib.request.rst:1587 +#: ../../library/urllib.request.rst:1599 msgid ":mod:`urllib.response` --- Response classes used by urllib" msgstr "" -#: ../../library/urllib.request.rst:1592 +#: ../../library/urllib.request.rst:1604 msgid "" "The :mod:`urllib.response` module defines functions and classes which define " "a minimal file-like interface, including ``read()`` and ``readline()``. " @@ -2119,50 +2130,69 @@ msgid "" "addinfourl` instance:" msgstr "" -#: ../../library/urllib.request.rst:1601 +#: ../../library/urllib.request.rst:1613 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/urllib.request.rst:1605 +#: ../../library/urllib.request.rst:1617 msgid "" "Returns the headers of the response in the form of an :class:`~email.message." "EmailMessage` instance." msgstr "" -#: ../../library/urllib.request.rst:1611 +#: ../../library/urllib.request.rst:1623 msgid "Status code returned by server." msgstr "" -#: ../../library/urllib.request.rst:1615 +#: ../../library/urllib.request.rst:1627 msgid "Deprecated in favor of :attr:`~addinfourl.url`." msgstr "" -#: ../../library/urllib.request.rst:1620 +#: ../../library/urllib.request.rst:1632 msgid "Deprecated in favor of :attr:`~addinfourl.headers`." msgstr "" -#: ../../library/urllib.request.rst:1625 ../../library/urllib.request.rst:1630 +#: ../../library/urllib.request.rst:1637 ../../library/urllib.request.rst:1642 msgid "Deprecated in favor of :attr:`~addinfourl.status`." msgstr "" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1569 msgid "HTTP" msgstr "HTTP" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1569 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1568 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1580 msgid "FTP" msgstr "FTP" -#: ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1569 msgid "HTML" msgstr "HTML" +#~ msgid "" +#~ "Convert the pathname *path* from the local syntax for a path to the form " +#~ "used in the path component of a URL. This does not produce a complete " +#~ "URL. The return value will already be quoted using the :func:`~urllib." +#~ "parse.quote` function." +#~ msgstr "" +#~ "將路徑名 *path* 從路徑的本地語法 (local syntax) 轉換為 URL 中的 path " +#~ "component(路徑元件)格式。本函式並不會產生完整的 URL。回傳值將使用 :func:" +#~ "`~urllib.parse.quote` 函式先進行編碼過。" + +#~ msgid "" +#~ "Convert the path component *path* from a percent-encoded URL to the local " +#~ "syntax for a path. This does not accept a complete URL. This function " +#~ "uses :func:`~urllib.parse.unquote` to decode *path*." +#~ msgstr "" +#~ "將一個用 \"%\" 編碼過的 URL path component *path* 轉換為路徑的本地語法 " +#~ "(local syntax)。本函式並不接受完整的 URL。本函式使用 :func:`~urllib.parse." +#~ "unquote` 來將 *path* 解碼。" + #~ msgid "" #~ "The optional *cafile* and *capath* parameters specify a set of trusted CA " #~ "certificates for HTTPS requests. *cafile* should point to a single file " diff --git a/tutorial/errors.po b/tutorial/errors.po index 34973654d4..2d2815446d 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,12 +64,12 @@ msgstr "" #: ../../tutorial/errors.rst:26 #, fuzzy msgid "" -"The parser repeats the offending line and displays little 'arrow's pointing " -"at the token in the line where the error was detected. The error may be " -"caused by the absence of a token *before* the indicated token. In the " -"example, the error is detected at the function :func:`print`, since a colon " -"(``':'``) is missing before it. File name and line number are printed so " -"you know where to look in case the input came from a script." +"The parser repeats the offending line and displays little arrows pointing at " +"the token in the line where the error was detected. The error may be caused " +"by the absence of a token *before* the indicated token. In the example, the " +"error is detected at the function :func:`print`, since a colon (``':'``) is " +"missing before it. File name and line number are printed so you know where " +"to look in case the input came from a script." msgstr "" "剖析器 (parser) 會重複犯錯的那一行,並用一個小「箭頭」指向該行檢測到的第一個" "錯誤點。錯誤是由箭頭\\ *之前*\\ 的標記 (token) 導致的(或至少是在這裡檢測到" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 8073aa078d..84f2f50a74 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2825,7 +2825,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1982 msgid "" -"A new opcode, :opcode:`LOAD_CLASSDEREF`, has been added to fix a bug in the " +"A new opcode, :opcode:`!LOAD_CLASSDEREF`, has been added to fix a bug in the " "loading of free variables in class bodies that could be triggered by certain " "uses of :ref:`__prepare__ <prepare>`. (Contributed by Benjamin Peterson in :" "issue:`17853`.)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index da12479c9c..7fd5f35c2e 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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" @@ -3462,8 +3462,8 @@ msgstr "" #: ../../whatsnew/3.6.rst:2369 msgid "" -"The new :opcode:`FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part of " -"the :ref:`formatted string literal <whatsnew36-pep498>` implementation. " +"The new :opcode:`!FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part " +"of the :ref:`formatted string literal <whatsnew36-pep498>` implementation. " "(Contributed by Eric Smith in :issue:`25483` and Serhiy Storchaka in :issue:" "`27078`.)" msgstr "" @@ -3478,10 +3478,10 @@ msgstr "" #: ../../whatsnew/3.6.rst:2378 msgid "" "The function call opcodes have been heavily reworked for better performance " -"and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:" -"`CALL_FUNCTION`, :opcode:`CALL_FUNCTION_KW` and :opcode:" -"`BUILD_MAP_UNPACK_WITH_CALL` opcodes have been modified, the new :opcode:" -"`CALL_FUNCTION_EX` and :opcode:`BUILD_TUPLE_UNPACK_WITH_CALL` have been " +"and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:`!" +"CALL_FUNCTION`, :opcode:`!CALL_FUNCTION_KW` and :opcode:`!" +"BUILD_MAP_UNPACK_WITH_CALL` opcodes have been modified, the new :opcode:" +"`CALL_FUNCTION_EX` and :opcode:`!BUILD_TUPLE_UNPACK_WITH_CALL` have been " "added, and ``CALL_FUNCTION_VAR``, ``CALL_FUNCTION_VAR_KW`` and " "``MAKE_CLOSURE`` opcodes have been removed. (Contributed by Demur Rumed in :" "issue:`27095`, and Serhiy Storchaka in :issue:`27213`, :issue:`28257`.)" @@ -3489,7 +3489,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2389 msgid "" -"The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`STORE_ANNOTATION` opcodes " +"The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`!STORE_ANNOTATION` opcodes " "have been added to support the new :term:`variable annotation` syntax. " "(Contributed by Ivan Levkivskyi in :issue:`27985`.)" msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 2d895c796f..0bd0f4447b 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+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-" @@ -3544,14 +3544,14 @@ msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.7.rst:2479 msgid "" -"There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`CALL_METHOD`. " +"There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`!CALL_METHOD`. " "(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)" msgstr "" #: ../../whatsnew/3.7.rst:2482 msgid "" -"The :opcode:`STORE_ANNOTATION` opcode has been removed. (Contributed by Mark " -"Shannon in :issue:`32550`.)" +"The :opcode:`!STORE_ANNOTATION` opcode has been removed. (Contributed by " +"Mark Shannon in :issue:`32550`.)" msgstr "" #: ../../whatsnew/3.7.rst:2489 diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 856321dfb5..88fd0014ac 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-01 15:04+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3346,11 +3346,11 @@ msgstr "" #: ../../whatsnew/3.8.rst:2155 msgid "" -"Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" -"`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" -"`ROT_FOUR`, :opcode:`BEGIN_FINALLY`, :opcode:`CALL_FINALLY` and :opcode:" -"`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and :opcode:" -"`WITH_CLEANUP_START`." +"Removed opcodes :opcode:`!BREAK_LOOP`, :opcode:`!CONTINUE_LOOP`, :opcode:`!" +"SETUP_LOOP` and :opcode:`!SETUP_EXCEPT`. Added new opcodes :opcode:`!" +"ROT_FOUR`, :opcode:`!BEGIN_FINALLY`, :opcode:`!CALL_FINALLY` and :opcode:`!" +"POP_FINALLY`. Changed the behavior of :opcode:`!END_FINALLY` and :opcode:`!" +"WITH_CLEANUP_START`." msgstr "" #: ../../whatsnew/3.8.rst:2161 From c0c073d4e4df7e855d9d5cc6967a981f39b47c05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:12:14 +0000 Subject: [PATCH 10/14] sync with cpython 89f4b23f --- c-api/frame.po | 43 ++- c-api/init.po | 719 +++++++++++++++++++------------------ c-api/init_config.po | 227 ++++++------ c-api/object.po | 33 +- c-api/stable.po | 67 ++-- c-api/sys.po | 6 +- howto/gdb_helpers.po | 12 +- library/ast.po | 6 +- library/collections.po | 9 +- library/dis.po | 313 ++++++++-------- library/http.cookies.po | 8 +- library/itertools.po | 16 +- library/string.po | 266 +++++++------- library/traceback.po | 171 ++++----- library/xmlrpc.po | 10 +- reference/simple_stmts.po | 113 +++--- tutorial/datastructures.po | 21 +- using/ios.po | 108 +++++- whatsnew/3.0.po | 154 ++++---- 19 files changed, 1252 insertions(+), 1050 deletions(-) diff --git a/c-api/frame.po b/c-api/frame.po index 1e518a36e3..31dd038db1 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -155,34 +155,61 @@ msgid "" msgstr "" #: ../../c-api/frame.rst:134 -msgid "As part of :pep:`667`, return a proxy object for optimized scopes." +msgid "" +"As part of :pep:`667`, return an instance of :c:var:" +"`PyFrameLocalsProxy_Type`." msgstr "" #: ../../c-api/frame.rst:140 msgid "Return the line number that *frame* is currently executing." msgstr "" -#: ../../c-api/frame.rst:145 +#: ../../c-api/frame.rst:144 +msgid "Frame Locals Proxies" +msgstr "" + +#: ../../c-api/frame.rst:148 +msgid "" +"The :attr:`~frame.f_locals` attribute on a :ref:`frame object <frame-" +"objects>` is an instance of a \"frame-locals proxy\". The proxy object " +"exposes a write-through view of the underlying locals dictionary for the " +"frame. This ensures that the variables exposed by ``f_locals`` are always up " +"to date with the live local variables in the frame itself." +msgstr "" + +#: ../../c-api/frame.rst:154 +msgid "See :pep:`667` for more information." +msgstr "" + +#: ../../c-api/frame.rst:158 +msgid "The type of frame :func:`locals` proxy objects." +msgstr "" + +#: ../../c-api/frame.rst:162 +msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." +msgstr "" + +#: ../../c-api/frame.rst:165 msgid "Internal Frames" msgstr "" -#: ../../c-api/frame.rst:147 +#: ../../c-api/frame.rst:167 msgid "Unless using :pep:`523`, you will not need this." msgstr "" -#: ../../c-api/frame.rst:151 +#: ../../c-api/frame.rst:171 msgid "The interpreter's internal frame representation." msgstr "" -#: ../../c-api/frame.rst:157 +#: ../../c-api/frame.rst:177 msgid "Return a :term:`strong reference` to the code object for the frame." msgstr "" -#: ../../c-api/frame.rst:164 +#: ../../c-api/frame.rst:184 msgid "Return the byte offset into the last executed instruction." msgstr "" -#: ../../c-api/frame.rst:171 +#: ../../c-api/frame.rst:191 msgid "" "Return the currently executing line number, or -1 if there is no line number." msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 4f36329902..6f77c36b2c 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -820,17 +820,28 @@ msgid "" msgstr "" #: ../../c-api/init.rst:562 +msgid "" +"Register an :mod:`atexit` callback for the target interpreter *interp*. This " +"is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and " +"data pointer for the callback." +msgstr "" + +#: ../../c-api/init.rst:566 +msgid "The :term:`GIL` must be held for *interp*." +msgstr "" + +#: ../../c-api/init.rst:571 msgid "Process-wide parameters" msgstr "" -#: ../../c-api/init.rst:572 +#: ../../c-api/init.rst:581 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration <init-config>`." msgstr "" -#: ../../c-api/init.rst:576 +#: ../../c-api/init.rst:585 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -844,37 +855,37 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:587 ../../c-api/init.rst:829 ../../c-api/init.rst:865 -#: ../../c-api/init.rst:891 +#: ../../c-api/init.rst:596 ../../c-api/init.rst:838 ../../c-api/init.rst:874 +#: ../../c-api/init.rst:900 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" -#: ../../c-api/init.rst:595 +#: ../../c-api/init.rst:604 msgid "" "Return the program name set with :c:member:`PyConfig.program_name`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:667 -#: ../../c-api/init.rst:689 ../../c-api/init.rst:715 ../../c-api/init.rst:903 +#: ../../c-api/init.rst:608 ../../c-api/init.rst:630 ../../c-api/init.rst:676 +#: ../../c-api/init.rst:698 ../../c-api/init.rst:724 ../../c-api/init.rst:912 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。" -#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:670 -#: ../../c-api/init.rst:692 ../../c-api/init.rst:720 ../../c-api/init.rst:906 +#: ../../c-api/init.rst:611 ../../c-api/init.rst:633 ../../c-api/init.rst:679 +#: ../../c-api/init.rst:701 ../../c-api/init.rst:729 ../../c-api/init.rst:915 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。" -#: ../../c-api/init.rst:605 ../../c-api/init.rst:695 +#: ../../c-api/init.rst:614 ../../c-api/init.rst:704 msgid "Get :data:`sys.executable` instead." msgstr "" -#: ../../c-api/init.rst:611 +#: ../../c-api/init.rst:620 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -888,13 +899,13 @@ msgid "" "See also the next function." msgstr "" -#: ../../c-api/init.rst:627 +#: ../../c-api/init.rst:636 msgid "" "Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual " "environments <venv-def>` need to be handled." msgstr "" -#: ../../c-api/init.rst:634 +#: ../../c-api/init.rst:643 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -908,7 +919,7 @@ msgid "" "useful on Unix." msgstr "" -#: ../../c-api/init.rst:645 +#: ../../c-api/init.rst:654 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -917,7 +928,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:651 +#: ../../c-api/init.rst:660 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -931,7 +942,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:662 +#: ../../c-api/init.rst:671 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -939,13 +950,13 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:673 +#: ../../c-api/init.rst:682 msgid "" "Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:" "`virtual environments <venv-def>` need to be handled." msgstr "" -#: ../../c-api/init.rst:683 +#: ../../c-api/init.rst:692 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -954,7 +965,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:705 +#: ../../c-api/init.rst:714 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:member:`PyConfig.program_name`) and some environment " @@ -967,21 +978,21 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:723 +#: ../../c-api/init.rst:732 msgid "Get :data:`sys.path` instead." msgstr "" -#: ../../c-api/init.rst:729 +#: ../../c-api/init.rst:738 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: ../../c-api/init.rst:732 +#: ../../c-api/init.rst:741 msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -#: ../../c-api/init.rst:736 +#: ../../c-api/init.rst:745 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -990,11 +1001,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:741 +#: ../../c-api/init.rst:750 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:748 +#: ../../c-api/init.rst:757 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -1005,50 +1016,50 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:759 +#: ../../c-api/init.rst:768 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: ../../c-api/init.rst:761 +#: ../../c-api/init.rst:770 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:765 +#: ../../c-api/init.rst:774 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:771 +#: ../../c-api/init.rst:780 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: ../../c-api/init.rst:774 +#: ../../c-api/init.rst:783 msgid "\"[GCC 2.7.2.2]\"" msgstr "\"[GCC 2.7.2.2]\"" -#: ../../c-api/init.rst:778 ../../c-api/init.rst:792 +#: ../../c-api/init.rst:787 ../../c-api/init.rst:801 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:785 +#: ../../c-api/init.rst:794 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: ../../c-api/init.rst:788 +#: ../../c-api/init.rst:797 msgid "\"#67, Aug 1 1997, 22:34:28\"" msgstr "\"#67, Aug 1 1997, 22:34:28\"" -#: ../../c-api/init.rst:804 +#: ../../c-api/init.rst:813 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -1056,7 +1067,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:809 +#: ../../c-api/init.rst:818 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -1067,84 +1078,84 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:817 +#: ../../c-api/init.rst:826 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: ../../c-api/init.rst:821 +#: ../../c-api/init.rst:830 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:824 +#: ../../c-api/init.rst:833 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:832 ../../c-api/init.rst:868 +#: ../../c-api/init.rst:841 ../../c-api/init.rst:877 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration <init-config>`." msgstr "" -#: ../../c-api/init.rst:836 +#: ../../c-api/init.rst:845 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: ../../c-api/init.rst:841 +#: ../../c-api/init.rst:850 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:845 +#: ../../c-api/init.rst:854 msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -#: ../../c-api/init.rst:857 +#: ../../c-api/init.rst:866 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration <init-config>`." msgstr "" -#: ../../c-api/init.rst:861 +#: ../../c-api/init.rst:870 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:871 +#: ../../c-api/init.rst:880 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:878 +#: ../../c-api/init.rst:887 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "<init-config>`." msgstr "" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:891 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:886 +#: ../../c-api/init.rst:895 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -1152,24 +1163,24 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:899 +#: ../../c-api/init.rst:908 msgid "" "Return the default \"home\", that is, the value set by :c:member:`PyConfig." "home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " "is set." msgstr "" -#: ../../c-api/init.rst:909 +#: ../../c-api/init.rst:918 msgid "" "Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " "instead." msgstr "改為取得 :c:member:`PyConfig.home` 或 :envvar:`PYTHONHOME` 環境變數。" -#: ../../c-api/init.rst:917 +#: ../../c-api/init.rst:926 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:924 +#: ../../c-api/init.rst:933 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -1181,7 +1192,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:934 +#: ../../c-api/init.rst:943 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -1191,7 +1202,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:944 +#: ../../c-api/init.rst:953 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1199,17 +1210,17 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:950 +#: ../../c-api/init.rst:959 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:952 +#: ../../c-api/init.rst:961 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:955 +#: ../../c-api/init.rst:964 msgid "" "Save the thread state in a local variable.\n" "Release the global interpreter lock.\n" @@ -1218,29 +1229,29 @@ msgid "" "Restore the thread state from the local variable." msgstr "" -#: ../../c-api/init.rst:961 +#: ../../c-api/init.rst:970 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:963 +#: ../../c-api/init.rst:972 msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" -#: ../../c-api/init.rst:971 +#: ../../c-api/init.rst:980 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:975 +#: ../../c-api/init.rst:984 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:977 +#: ../../c-api/init.rst:986 msgid "" "PyThreadState *_save;\n" "\n" @@ -1249,7 +1260,7 @@ msgid "" "PyEval_RestoreThread(_save);" msgstr "" -#: ../../c-api/init.rst:987 +#: ../../c-api/init.rst:996 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1260,7 +1271,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:996 +#: ../../c-api/init.rst:1005 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1270,11 +1281,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:1007 +#: ../../c-api/init.rst:1016 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:1009 +#: ../../c-api/init.rst:1018 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1284,7 +1295,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:1016 +#: ../../c-api/init.rst:1025 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1295,14 +1306,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:1024 +#: ../../c-api/init.rst:1033 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:1028 +#: ../../c-api/init.rst:1037 msgid "" "PyGILState_STATE gstate;\n" "gstate = PyGILState_Ensure();\n" @@ -1315,7 +1326,7 @@ msgid "" "PyGILState_Release(gstate);" msgstr "" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:1047 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1324,11 +1335,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:1048 +#: ../../c-api/init.rst:1057 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:1050 +#: ../../c-api/init.rst:1059 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1337,7 +1348,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:1056 +#: ../../c-api/init.rst:1065 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1354,7 +1365,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:1071 +#: ../../c-api/init.rst:1080 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1367,17 +1378,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:1084 +#: ../../c-api/init.rst:1093 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:1086 +#: ../../c-api/init.rst:1095 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:1091 +#: ../../c-api/init.rst:1100 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1385,7 +1396,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:1096 +#: ../../c-api/init.rst:1105 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1393,41 +1404,41 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:1104 +#: ../../c-api/init.rst:1113 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:1109 +#: ../../c-api/init.rst:1118 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1120 +#: ../../c-api/init.rst:1129 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1122 +#: ../../c-api/init.rst:1131 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1124 +#: ../../c-api/init.rst:1133 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1127 +#: ../../c-api/init.rst:1136 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1131 +#: ../../c-api/init.rst:1140 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1141 +#: ../../c-api/init.rst:1150 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1435,7 +1446,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1149 +#: ../../c-api/init.rst:1158 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1443,8 +1454,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1155 ../../c-api/init.rst:1214 -#: ../../c-api/init.rst:1499 +#: ../../c-api/init.rst:1164 ../../c-api/init.rst:1223 +#: ../../c-api/init.rst:1508 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1453,44 +1464,44 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1163 +#: ../../c-api/init.rst:1172 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1167 +#: ../../c-api/init.rst:1176 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1181 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1176 +#: ../../c-api/init.rst:1185 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1183 +#: ../../c-api/init.rst:1192 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1188 +#: ../../c-api/init.rst:1197 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1193 +#: ../../c-api/init.rst:1202 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1503,7 +1514,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1203 +#: ../../c-api/init.rst:1212 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1513,13 +1524,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1210 +#: ../../c-api/init.rst:1219 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1222 +#: ../../c-api/init.rst:1231 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1527,13 +1538,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1227 +#: ../../c-api/init.rst:1236 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1242 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1541,7 +1552,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1241 +#: ../../c-api/init.rst:1250 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1552,13 +1563,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1253 +#: ../../c-api/init.rst:1262 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1259 +#: ../../c-api/init.rst:1268 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1566,7 +1577,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1267 +#: ../../c-api/init.rst:1276 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1574,40 +1585,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1275 +#: ../../c-api/init.rst:1284 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1281 +#: ../../c-api/init.rst:1290 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1287 +#: ../../c-api/init.rst:1296 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1289 +#: ../../c-api/init.rst:1298 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1291 +#: ../../c-api/init.rst:1300 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1297 +#: ../../c-api/init.rst:1306 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1301 +#: ../../c-api/init.rst:1310 msgid "" "Raises an :ref:`auditing event <auditing>` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1615,13 +1626,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1315 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1309 +#: ../../c-api/init.rst:1318 msgid "" "Raises an :ref:`auditing event <auditing>` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1629,44 +1640,44 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1314 +#: ../../c-api/init.rst:1323 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1321 +#: ../../c-api/init.rst:1330 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1328 +#: ../../c-api/init.rst:1337 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1331 +#: ../../c-api/init.rst:1340 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1335 +#: ../../c-api/init.rst:1344 msgid "The :c:member:`PyThreadState.on_delete` callback was removed." msgstr "" -#: ../../c-api/init.rst:1341 +#: ../../c-api/init.rst:1350 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1348 +#: ../../c-api/init.rst:1357 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1674,119 +1685,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1356 +#: ../../c-api/init.rst:1365 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1358 +#: ../../c-api/init.rst:1367 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1361 +#: ../../c-api/init.rst:1370 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1363 ../../c-api/init.rst:1372 -#: ../../c-api/init.rst:1381 +#: ../../c-api/init.rst:1372 ../../c-api/init.rst:1381 +#: ../../c-api/init.rst:1390 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1370 +#: ../../c-api/init.rst:1379 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1379 +#: ../../c-api/init.rst:1388 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1388 +#: ../../c-api/init.rst:1397 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1390 +#: ../../c-api/init.rst:1399 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1397 +#: ../../c-api/init.rst:1406 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1400 +#: ../../c-api/init.rst:1409 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1408 +#: ../../c-api/init.rst:1417 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1410 +#: ../../c-api/init.rst:1419 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1423 +#: ../../c-api/init.rst:1422 ../../c-api/init.rst:1432 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1420 +#: ../../c-api/init.rst:1429 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1430 +#: ../../c-api/init.rst:1439 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1434 +#: ../../c-api/init.rst:1443 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1441 +#: ../../c-api/init.rst:1450 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1452 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1446 +#: ../../c-api/init.rst:1455 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1449 +#: ../../c-api/init.rst:1458 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1454 +#: ../../c-api/init.rst:1463 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1456 ../../c-api/init.rst:1464 +#: ../../c-api/init.rst:1465 ../../c-api/init.rst:1473 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1462 +#: ../../c-api/init.rst:1471 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1471 +#: ../../c-api/init.rst:1480 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1795,7 +1806,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1480 +#: ../../c-api/init.rst:1489 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1807,33 +1818,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1488 +#: ../../c-api/init.rst:1497 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1503 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1505 +#: ../../c-api/init.rst:1514 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1510 +#: ../../c-api/init.rst:1519 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1516 +#: ../../c-api/init.rst:1525 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1842,17 +1853,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1522 +#: ../../c-api/init.rst:1531 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1529 +#: ../../c-api/init.rst:1538 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1540 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1860,7 +1871,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1536 +#: ../../c-api/init.rst:1545 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1871,31 +1882,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1543 +#: ../../c-api/init.rst:1552 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1549 +#: ../../c-api/init.rst:1558 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1555 +#: ../../c-api/init.rst:1564 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1559 +#: ../../c-api/init.rst:1568 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1563 +#: ../../c-api/init.rst:1572 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1903,44 +1914,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1571 +#: ../../c-api/init.rst:1580 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1584 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1580 +#: ../../c-api/init.rst:1589 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1585 +#: ../../c-api/init.rst:1594 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1590 +#: ../../c-api/init.rst:1599 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1596 +#: ../../c-api/init.rst:1605 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1603 +#: ../../c-api/init.rst:1612 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1949,37 +1960,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1610 +#: ../../c-api/init.rst:1619 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1615 +#: ../../c-api/init.rst:1624 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1622 +#: ../../c-api/init.rst:1631 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1626 +#: ../../c-api/init.rst:1635 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1630 +#: ../../c-api/init.rst:1639 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1632 +#: ../../c-api/init.rst:1641 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1646 +#: ../../c-api/init.rst:1655 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1992,13 +2003,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1656 +#: ../../c-api/init.rst:1665 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1659 +#: ../../c-api/init.rst:1668 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2009,7 +2020,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1668 +#: ../../c-api/init.rst:1677 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2021,13 +2032,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1688 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1691 #, fuzzy msgid "" "PyInterpreterConfig config = {\n" @@ -2056,7 +2067,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1697 +#: ../../c-api/init.rst:1706 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2064,11 +2075,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1715 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1717 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2076,7 +2087,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1714 +#: ../../c-api/init.rst:1723 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2088,7 +2099,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1734 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2098,7 +2109,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1745 +#: ../../c-api/init.rst:1754 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2107,7 +2118,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1757 +#: ../../c-api/init.rst:1766 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2117,17 +2128,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1765 +#: ../../c-api/init.rst:1774 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1770 +#: ../../c-api/init.rst:1779 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1772 +#: ../../c-api/init.rst:1781 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2139,7 +2150,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1782 +#: ../../c-api/init.rst:1791 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2153,7 +2164,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1793 +#: ../../c-api/init.rst:1802 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2161,7 +2172,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1798 +#: ../../c-api/init.rst:1807 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2171,11 +2182,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1809 +#: ../../c-api/init.rst:1818 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1811 +#: ../../c-api/init.rst:1820 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2188,7 +2199,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1821 +#: ../../c-api/init.rst:1830 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2197,7 +2208,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1827 +#: ../../c-api/init.rst:1836 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2209,25 +2220,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:1847 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1840 +#: ../../c-api/init.rst:1849 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1856 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1851 +#: ../../c-api/init.rst:1860 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2235,17 +2246,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1865 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1857 +#: ../../c-api/init.rst:1866 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1860 +#: ../../c-api/init.rst:1869 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2253,20 +2264,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1865 +#: ../../c-api/init.rst:1874 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:1877 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1882 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2276,7 +2287,7 @@ msgid "" "`PyGILState API<gilstate>`." msgstr "" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1891 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2284,18 +2295,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1891 +#: ../../c-api/init.rst:1900 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:1905 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1900 +#: ../../c-api/init.rst:1909 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2305,7 +2316,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1910 +#: ../../c-api/init.rst:1919 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 " @@ -2317,66 +2328,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1928 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1928 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1930 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1926 -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1930 ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1946 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1923 +#: ../../c-api/init.rst:1932 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1923 +#: ../../c-api/init.rst:1932 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1935 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1937 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1937 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1931 +#: ../../c-api/init.rst:1940 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1931 ../../c-api/init.rst:1933 -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1940 ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1944 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1942 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1944 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1946 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1951 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2385,7 +2396,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1951 +#: ../../c-api/init.rst:1960 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2397,7 +2408,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1962 +#: ../../c-api/init.rst:1971 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2405,31 +2416,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1970 +#: ../../c-api/init.rst:1979 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1976 +#: ../../c-api/init.rst:1985 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1982 +#: ../../c-api/init.rst:1991 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1988 +#: ../../c-api/init.rst:1997 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1994 +#: ../../c-api/init.rst:2003 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2437,7 +2448,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2002 +#: ../../c-api/init.rst:2011 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2447,29 +2458,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2009 +#: ../../c-api/init.rst:2018 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2011 ../../c-api/init.rst:2018 -#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2020 ../../c-api/init.rst:2027 +#: ../../c-api/init.rst:2046 ../../c-api/init.rst:2053 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2015 +#: ../../c-api/init.rst:2024 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2020 +#: ../../c-api/init.rst:2029 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2037 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2480,28 +2491,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2035 +#: ../../c-api/init.rst:2044 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2041 +#: ../../c-api/init.rst:2050 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2046 +#: ../../c-api/init.rst:2055 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2052 +#: ../../c-api/init.rst:2061 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2067 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2511,19 +2522,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2077 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2073 +#: ../../c-api/init.rst:2082 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2078 +#: ../../c-api/init.rst:2087 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2532,7 +2543,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2084 +#: ../../c-api/init.rst:2093 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2540,11 +2551,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2089 ../../c-api/init.rst:2100 +#: ../../c-api/init.rst:2098 ../../c-api/init.rst:2109 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2095 +#: ../../c-api/init.rst:2104 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2552,48 +2563,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2107 +#: ../../c-api/init.rst:2116 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2112 +#: ../../c-api/init.rst:2121 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2117 +#: ../../c-api/init.rst:2126 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2122 +#: ../../c-api/init.rst:2131 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2127 +#: ../../c-api/init.rst:2136 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2133 +#: ../../c-api/init.rst:2142 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2139 +#: ../../c-api/init.rst:2148 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2146 +#: ../../c-api/init.rst:2155 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2150 +#: ../../c-api/init.rst:2159 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2603,19 +2614,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2166 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2160 +#: ../../c-api/init.rst:2169 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2164 +#: ../../c-api/init.rst:2173 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2623,22 +2634,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2172 +#: ../../c-api/init.rst:2181 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2183 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2180 +#: ../../c-api/init.rst:2189 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2185 +#: ../../c-api/init.rst:2194 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2646,52 +2657,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2190 +#: ../../c-api/init.rst:2199 msgid "" "When :ref:`Py_LIMITED_API <stable>` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2196 +#: ../../c-api/init.rst:2205 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API <stable>`." msgstr "" -#: ../../c-api/init.rst:2201 +#: ../../c-api/init.rst:2210 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2203 +#: ../../c-api/init.rst:2212 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API <stable>`, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2210 +#: ../../c-api/init.rst:2219 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2217 +#: ../../c-api/init.rst:2226 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2232 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2228 +#: ../../c-api/init.rst:2237 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2230 +#: ../../c-api/init.rst:2239 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2699,13 +2710,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2238 +#: ../../c-api/init.rst:2247 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2244 +#: ../../c-api/init.rst:2253 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2714,7 +2725,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2253 +#: ../../c-api/init.rst:2262 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2723,31 +2734,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2262 +#: ../../c-api/init.rst:2271 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2269 +#: ../../c-api/init.rst:2278 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2277 +#: ../../c-api/init.rst:2286 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2279 +#: ../../c-api/init.rst:2288 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API <thread-" "specific-storage-api>`." msgstr "" -#: ../../c-api/init.rst:2284 +#: ../../c-api/init.rst:2293 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2756,62 +2767,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2289 +#: ../../c-api/init.rst:2298 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:2300 +#: ../../c-api/init.rst:2309 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2302 +#: ../../c-api/init.rst:2311 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2306 +#: ../../c-api/init.rst:2315 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2309 +#: ../../c-api/init.rst:2318 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2311 +#: ../../c-api/init.rst:2320 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2317 +#: ../../c-api/init.rst:2326 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2325 +#: ../../c-api/init.rst:2334 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2333 +#: ../../c-api/init.rst:2342 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2341 +#: ../../c-api/init.rst:2350 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2343 +#: ../../c-api/init.rst:2352 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded <free threading>` CPython. They are " @@ -2819,7 +2830,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2348 +#: ../../c-api/init.rst:2357 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2829,7 +2840,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2355 +#: ../../c-api/init.rst:2364 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2837,7 +2848,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2362 +#: ../../c-api/init.rst:2371 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2846,11 +2857,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2368 +#: ../../c-api/init.rst:2377 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2370 +#: ../../c-api/init.rst:2379 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2862,7 +2873,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2379 +#: ../../c-api/init.rst:2388 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2872,61 +2883,61 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2387 +#: ../../c-api/init.rst:2396 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2390 ../../c-api/init.rst:2404 -#: ../../c-api/init.rst:2419 ../../c-api/init.rst:2433 +#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2413 +#: ../../c-api/init.rst:2428 ../../c-api/init.rst:2442 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2392 +#: ../../c-api/init.rst:2401 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2396 ../../c-api/init.rst:2425 +#: ../../c-api/init.rst:2405 ../../c-api/init.rst:2434 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2402 +#: ../../c-api/init.rst:2411 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2406 +#: ../../c-api/init.rst:2415 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2438 +#: ../../c-api/init.rst:2418 ../../c-api/init.rst:2447 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2424 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2421 +#: ../../c-api/init.rst:2430 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2440 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2435 +#: ../../c-api/init.rst:2444 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -2940,148 +2951,148 @@ msgstr "PyEval_InitThreads()" msgid "modules (in module sys)" msgstr "modules(sys 模組中)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:710 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136 -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:710 ../../c-api/init.rst:1145 +#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:710 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:701 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:710 msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1702 ../../c-api/init.rst:1755 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1764 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" -#: ../../c-api/init.rst:567 +#: ../../c-api/init.rst:576 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/init.rst:567 ../../c-api/init.rst:799 +#: ../../c-api/init.rst:576 ../../c-api/init.rst:808 msgid "main()" msgstr "main()" -#: ../../c-api/init.rst:567 +#: ../../c-api/init.rst:576 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/init.rst:680 +#: ../../c-api/init.rst:689 msgid "executable (in module sys)" msgstr "executable(sys 模組中)" -#: ../../c-api/init.rst:734 ../../c-api/init.rst:776 ../../c-api/init.rst:790 +#: ../../c-api/init.rst:743 ../../c-api/init.rst:785 ../../c-api/init.rst:799 msgid "version (in module sys)" msgstr "version(sys 模組中)" -#: ../../c-api/init.rst:746 +#: ../../c-api/init.rst:755 msgid "platform (in module sys)" msgstr "platform(sys 模組中)" -#: ../../c-api/init.rst:763 +#: ../../c-api/init.rst:772 msgid "copyright (in module sys)" msgstr "copyright(sys 模組中)" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:808 msgid "Py_FatalError()" msgstr "Py_FatalError()" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:808 msgid "argv (in module sys)" msgstr "argv(sys 模組中)" -#: ../../c-api/init.rst:919 +#: ../../c-api/init.rst:928 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../c-api/init.rst:919 +#: ../../c-api/init.rst:928 msgid "interpreter lock" msgstr "interpreter lock(直譯器鎖)" -#: ../../c-api/init.rst:919 +#: ../../c-api/init.rst:928 msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" -#: ../../c-api/init.rst:932 +#: ../../c-api/init.rst:941 msgid "setswitchinterval (in module sys)" msgstr "setswitchinterval (sys 模組中)" -#: ../../c-api/init.rst:941 +#: ../../c-api/init.rst:950 msgid "PyThreadState (C type)" msgstr "PyThreadState(C 型別)" -#: ../../c-api/init.rst:967 +#: ../../c-api/init.rst:976 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:967 +#: ../../c-api/init.rst:976 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "Py_END_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:983 +#: ../../c-api/init.rst:992 msgid "PyEval_RestoreThread (C function)" msgstr "PyEval_RestoreThread(C 函式)" -#: ../../c-api/init.rst:983 +#: ../../c-api/init.rst:992 msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread(C 函式)" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:1123 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:1123 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:1123 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:1123 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:1136 +#: ../../c-api/init.rst:1145 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 +#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1711 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1732 +#: ../../c-api/init.rst:1741 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/init_config.po b/c-api/init_config.po index 0defbf5dcb..b2a0ecd6e1 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -479,7 +479,7 @@ msgstr "" #: ../../c-api/init_config.rst:952 ../../c-api/init_config.rst:1012 #: ../../c-api/init_config.rst:1064 ../../c-api/init_config.rst:1126 #: ../../c-api/init_config.rst:1180 ../../c-api/init_config.rst:1209 -#: ../../c-api/init_config.rst:1298 +#: ../../c-api/init_config.rst:1309 msgid "Default: ``0``." msgstr "預設:``0``。" @@ -573,7 +573,7 @@ msgid "" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359 +#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1370 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." @@ -902,7 +902,7 @@ msgid "stdin is always opened in buffered mode." msgstr "" #: ../../c-api/init_config.rst:645 ../../c-api/init_config.rst:678 -#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1330 +#: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1341 msgid "Default: ``1``." msgstr "預設值:``1``。" @@ -1215,7 +1215,7 @@ msgid "Install Python signal handlers?" msgstr "" #: ../../c-api/init_config.rst:863 ../../c-api/init_config.rst:1047 -#: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1282 +#: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1293 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" @@ -1434,8 +1434,8 @@ msgid "" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1317 -#: ../../c-api/init_config.rst:1336 +#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1328 +#: ../../c-api/init_config.rst:1347 msgid "Default: empty list." msgstr "" @@ -1740,88 +1740,101 @@ msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" #: ../../c-api/init_config.rst:1276 +msgid "" +"If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." +msgstr "" + +#: ../../c-api/init_config.rst:1279 +msgid "Only available on macOS 10.12 and later, and on iOS." +msgstr "" + +#: ../../c-api/init_config.rst:1281 +msgid "Default: ``0`` (don't use system log)." +msgstr "" + +#: ../../c-api/init_config.rst:1287 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1278 +#: ../../c-api/init_config.rst:1289 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1280 +#: ../../c-api/init_config.rst:1291 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1286 +#: ../../c-api/init_config.rst:1297 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1290 +#: ../../c-api/init_config.rst:1301 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1294 +#: ../../c-api/init_config.rst:1305 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1296 +#: ../../c-api/init_config.rst:1307 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1302 +#: ../../c-api/init_config.rst:1313 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1305 +#: ../../c-api/init_config.rst:1316 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1321 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1313 +#: ../../c-api/init_config.rst:1324 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1321 +#: ../../c-api/init_config.rst:1332 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1324 +#: ../../c-api/init_config.rst:1335 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1327 +#: ../../c-api/init_config.rst:1338 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1334 +#: ../../c-api/init_config.rst:1345 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1338 +#: ../../c-api/init_config.rst:1349 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1829,27 +1842,27 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1343 +#: ../../c-api/init_config.rst:1354 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1348 +#: ../../c-api/init_config.rst:1359 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1354 +#: ../../c-api/init_config.rst:1365 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1356 +#: ../../c-api/init_config.rst:1367 msgid "" "Initializing the interpreter from a populated configuration struct is " "handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: ../../c-api/init_config.rst:1362 +#: ../../c-api/init_config.rst:1373 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1858,17 +1871,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1369 +#: ../../c-api/init_config.rst:1380 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1372 +#: ../../c-api/init_config.rst:1383 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1374 +#: ../../c-api/init_config.rst:1385 msgid "" "void init_python(void)\n" "{\n" @@ -1922,7 +1935,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init_config.rst:1400 +#: ../../c-api/init_config.rst:1411 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1931,7 +1944,7 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1407 +#: ../../c-api/init_config.rst:1418 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" @@ -1986,18 +1999,18 @@ msgid "" "}" msgstr "" -#: ../../c-api/init_config.rst:1463 +#: ../../c-api/init_config.rst:1474 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1465 +#: ../../c-api/init_config.rst:1476 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1470 +#: ../../c-api/init_config.rst:1481 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -2005,115 +2018,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1475 +#: ../../c-api/init_config.rst:1486 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1483 +#: ../../c-api/init_config.rst:1494 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1485 +#: ../../c-api/init_config.rst:1496 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1489 +#: ../../c-api/init_config.rst:1500 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1492 +#: ../../c-api/init_config.rst:1503 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode <utf8-mode>` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1501 +#: ../../c-api/init_config.rst:1512 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1503 +#: ../../c-api/init_config.rst:1514 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1505 +#: ../../c-api/init_config.rst:1516 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1507 +#: ../../c-api/init_config.rst:1518 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1519 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1520 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1521 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1523 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1513 +#: ../../c-api/init_config.rst:1524 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1515 +#: ../../c-api/init_config.rst:1526 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1527 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1520 +#: ../../c-api/init_config.rst:1531 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1522 +#: ../../c-api/init_config.rst:1533 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1534 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1524 +#: ../../c-api/init_config.rst:1535 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1536 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1537 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1527 +#: ../../c-api/init_config.rst:1538 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -2121,11 +2134,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1529 +#: ../../c-api/init_config.rst:1540 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1531 +#: ../../c-api/init_config.rst:1542 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -2134,7 +2147,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1537 +#: ../../c-api/init_config.rst:1548 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -2144,52 +2157,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1544 +#: ../../c-api/init_config.rst:1555 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1547 +#: ../../c-api/init_config.rst:1558 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1551 +#: ../../c-api/init_config.rst:1562 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1553 +#: ../../c-api/init_config.rst:1564 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:1567 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1558 +#: ../../c-api/init_config.rst:1569 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1560 +#: ../../c-api/init_config.rst:1571 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1562 +#: ../../c-api/init_config.rst:1573 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1564 +#: ../../c-api/init_config.rst:1575 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -2198,143 +2211,143 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1570 +#: ../../c-api/init_config.rst:1581 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1572 +#: ../../c-api/init_config.rst:1583 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1584 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1585 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1576 +#: ../../c-api/init_config.rst:1587 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1578 +#: ../../c-api/init_config.rst:1589 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1579 +#: ../../c-api/init_config.rst:1590 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1591 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1581 +#: ../../c-api/init_config.rst:1592 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1583 +#: ../../c-api/init_config.rst:1594 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`." msgstr "" -#: ../../c-api/init_config.rst:1588 +#: ../../c-api/init_config.rst:1599 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1592 +#: ../../c-api/init_config.rst:1603 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1594 +#: ../../c-api/init_config.rst:1605 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1598 +#: ../../c-api/init_config.rst:1609 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1600 +#: ../../c-api/init_config.rst:1611 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1603 +#: ../../c-api/init_config.rst:1614 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1605 +#: ../../c-api/init_config.rst:1616 msgid "Builtin types;" msgstr "內建型別;" -#: ../../c-api/init_config.rst:1606 +#: ../../c-api/init_config.rst:1617 msgid "Builtin exceptions;" msgstr "內建例外;" -#: ../../c-api/init_config.rst:1607 +#: ../../c-api/init_config.rst:1618 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1608 +#: ../../c-api/init_config.rst:1619 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1611 +#: ../../c-api/init_config.rst:1622 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1613 +#: ../../c-api/init_config.rst:1624 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1614 +#: ../../c-api/init_config.rst:1625 msgid "Apply the :ref:`Path Configuration <init-path-config>`;" msgstr "" -#: ../../c-api/init_config.rst:1615 +#: ../../c-api/init_config.rst:1626 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1616 +#: ../../c-api/init_config.rst:1627 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1618 +#: ../../c-api/init_config.rst:1629 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1619 +#: ../../c-api/init_config.rst:1630 msgid "Import the :mod:`site` module;" msgstr "引入 :mod:`site` 模組;" -#: ../../c-api/init_config.rst:1620 +#: ../../c-api/init_config.rst:1631 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1622 +#: ../../c-api/init_config.rst:1633 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1624 +#: ../../c-api/init_config.rst:1635 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1629 +#: ../../c-api/init_config.rst:1640 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1631 +#: ../../c-api/init_config.rst:1642 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration <init-path-config>` is only " @@ -2343,14 +2356,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1637 +#: ../../c-api/init_config.rst:1648 msgid "" "It may become possible to calculate the :ref:`Path Configuration <init-path-" "config>` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1641 +#: ../../c-api/init_config.rst:1652 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2358,13 +2371,13 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1646 +#: ../../c-api/init_config.rst:1657 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" -#: ../../c-api/init_config.rst:1649 +#: ../../c-api/init_config.rst:1660 msgid "" "void init_python(void)\n" "{\n" diff --git a/c-api/object.po b/c-api/object.po index c0cc1ced33..5657a945c1 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -623,6 +623,13 @@ msgstr "" #: ../../c-api/object.rst:514 msgid "" +"This is equivalent to the Python ``__iter__(self): return self`` method. It " +"is intended for :term:`iterator` types, to be used in the :c:member:" +"`PyTypeObject.tp_iter` slot." +msgstr "" + +#: ../../c-api/object.rst:520 +msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " "This is typically a new iterator but if the argument is an :class:" @@ -630,67 +637,67 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:524 +#: ../../c-api/object.rst:530 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:526 +#: ../../c-api/object.rst:532 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:530 +#: ../../c-api/object.rst:536 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:536 +#: ../../c-api/object.rst:542 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:539 +#: ../../c-api/object.rst:545 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "<PyType_Spec.basicsize>`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:542 +#: ../../c-api/object.rst:548 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:546 +#: ../../c-api/object.rst:552 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:552 +#: ../../c-api/object.rst:558 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:555 +#: ../../c-api/object.rst:561 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: ../../c-api/object.rst:563 +#: ../../c-api/object.rst:569 msgid "Visit the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:565 ../../c-api/object.rst:574 +#: ../../c-api/object.rst:571 ../../c-api/object.rst:580 msgid "" "This function must only be called in a traverse function of the type which " "has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" -#: ../../c-api/object.rst:572 +#: ../../c-api/object.rst:578 msgid "Clear the managed dictionary of *obj*." msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po index 919634426e..58c72d5c6b 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 00:03+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -132,10 +132,11 @@ msgid "Limited C API" msgstr "受限 C API" #: ../../c-api/stable.rst:67 +#, fuzzy msgid "" "Python 3.2 introduced the *Limited API*, a subset of Python's C API. " -"Extensions that only use the Limited API can be compiled once and work with " -"multiple versions of Python. Contents of the Limited API are :ref:`listed " +"Extensions that only use the Limited API can be compiled once and be loaded " +"on multiple versions of Python. Contents of the Limited API are :ref:`listed " "below <limited-api-list>`." msgstr "" "Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。" @@ -150,12 +151,12 @@ msgstr "" "在包含 ``Python.h`` 之前定義此巨集以選擇只使用受限 API,並挑選受限 API 版本。" #: ../../c-api/stable.rst:77 +#, fuzzy msgid "" "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 " -"version." +"extension will be ABI-compatible with all Python 3 releases from the " +"specified one onward, and can use Limited API introduced up to that version." msgstr "" "將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:" "macro:`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 " @@ -184,14 +185,24 @@ msgid "Stable ABI" msgstr "穩定 ABI" #: ../../c-api/stable.rst:96 +#, fuzzy msgid "" "To enable this, Python provides a *Stable ABI*: a set of symbols that will " -"remain compatible across Python 3.x versions." +"remain ABI-compatible across Python 3.x versions." msgstr "" "為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python " "3.x 版本之間保持相容的符號。" -#: ../../c-api/stable.rst:99 +#: ../../c-api/stable.rst:101 +msgid "" +"The Stable ABI prevents ABI issues, like linker errors due to missing " +"symbols or data corruption due to changes in structure layouts or function " +"signatures. However, other changes in Python can change the *behavior* of " +"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for " +"details." +msgstr "" + +#: ../../c-api/stable.rst:107 msgid "" "The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-" "api>`, but also other ones – for example, functions necessary to support " @@ -200,7 +211,7 @@ msgstr "" "穩定 ABI 被包含在\\ :ref:`受限 API <limited-c-api>` 中開放的符號,但也包含其" "他符號 - 例如,支援舊版受限 API 所必需的函式。" -#: ../../c-api/stable.rst:103 +#: ../../c-api/stable.rst:111 msgid "" "On Windows, extensions that use the Stable ABI should be linked against " "``python3.dll`` rather than a version-specific library such as ``python39." @@ -209,7 +220,7 @@ msgstr "" "在 Windows 上,使用穩定 ABI 的擴充應該連接到 ``python3.dll`` 而不是特定版本的" "函式庫,例如 ``python39.dll``。" -#: ../../c-api/stable.rst:107 +#: ../../c-api/stable.rst:115 msgid "" "On some platforms, Python will look for and load shared library files named " "with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such " @@ -222,7 +233,7 @@ msgstr "" "用者(或者打包工具)身上,例如使用 3.10+ 受限 API 建置的擴充不會為較低版本的 " "Python 所安裝。" -#: ../../c-api/stable.rst:114 +#: ../../c-api/stable.rst:122 msgid "" "All functions in the Stable ABI are present as functions in Python's shared " "library, not solely as macros. This makes them usable from languages that " @@ -231,18 +242,18 @@ msgstr "" "穩定 ABI 中的所有函式都作為函式存在於 Python 的共享函式庫中,而不僅是作為巨" "集。這使得它們可被用於不使用 C 預處理器 (preprocessor) 的語言。" -#: ../../c-api/stable.rst:120 +#: ../../c-api/stable.rst:128 msgid "Limited API Scope and Performance" msgstr "受限 API 範圍和性能" -#: ../../c-api/stable.rst:122 +#: ../../c-api/stable.rst:130 msgid "" "The goal for the Limited API is to allow everything that is possible with " "the full C API, but possibly with a performance penalty." msgstr "" "受限 API 的目標是允許使用完整的 C API 進行所有可能的操作,但可能會降低性能。" -#: ../../c-api/stable.rst:125 +#: ../../c-api/stable.rst:133 msgid "" "For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro " "variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it " @@ -252,7 +263,7 @@ msgstr "" "`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list 物件的特定" "版本實作細節。" -#: ../../c-api/stable.rst:130 +#: ../../c-api/stable.rst:138 msgid "" "Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " "replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " @@ -263,7 +274,7 @@ msgstr "" "``Py_LIMITED_API`` 會禁用嵌入,從而隨著 Python 資料結構的改進而提高穩定性,但" "可能會降低性能。" -#: ../../c-api/stable.rst:135 +#: ../../c-api/stable.rst:143 msgid "" "By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " "a Limited API extension with a version-specific ABI. This can improve " @@ -277,11 +288,11 @@ msgstr "" "將產生一個擴充,可以在特定版本的擴充不可用的地方發布 — 例如,用於即將發布的 " "Python 版本的預發布版本 (prerelease)。" -#: ../../c-api/stable.rst:144 +#: ../../c-api/stable.rst:152 msgid "Limited API Caveats" msgstr "受限 API 注意事項" -#: ../../c-api/stable.rst:146 +#: ../../c-api/stable.rst:154 msgid "" "Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " "that code conforms to the :ref:`Limited API <limited-c-api>` or the :ref:" @@ -293,7 +304,7 @@ msgstr "" "``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他議題,例如預期的語義 " "(semantic)。" -#: ../../c-api/stable.rst:151 +#: ../../c-api/stable.rst:159 msgid "" "One issue that ``Py_LIMITED_API`` does not guard against is calling a " "function with arguments that are invalid in a lower Python version. For " @@ -307,7 +318,7 @@ msgstr "" "現在代表選擇預設行為,但在 Python 3.8 中,引數將被直接使用,導致 ``NULL`` 取" "消參照 (dereference) 且崩潰 (crash)。類似的引數適用於結構 (struct) 的欄位。" -#: ../../c-api/stable.rst:158 +#: ../../c-api/stable.rst:166 msgid "" "Another issue is that some struct fields are currently not hidden when " "``Py_LIMITED_API`` is defined, even though they're part of the Limited API." @@ -315,7 +326,7 @@ msgstr "" "另一個問題是,當有定義 ``Py_LIMITED_API`` 時,一些結構欄位目前不會被隱藏,即" "使它們是受限 API 的一部分。" -#: ../../c-api/stable.rst:161 +#: ../../c-api/stable.rst:169 msgid "" "For these reasons, we recommend testing an extension with *all* minor Python " "versions it supports, and preferably to build with the *lowest* such version." @@ -323,7 +334,7 @@ msgstr "" "出於這些原因,我們建議要以它支援的\\ *所有*\\ 次要 Python 版本來測試擴充,並" "且最好使用\\ *最低*\\ 版本進行建置。" -#: ../../c-api/stable.rst:164 +#: ../../c-api/stable.rst:172 msgid "" "We also recommend reviewing documentation of all used API to check if it is " "explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " @@ -334,7 +345,7 @@ msgstr "" "義 ``Py_LIMITED_API``,一些私有聲明也會因為技術原因(或者甚至是無意地,例如臭" "蟲)而被公開出來。" -#: ../../c-api/stable.rst:169 +#: ../../c-api/stable.rst:177 msgid "" "Also note that the Limited API is not necessarily stable: compiling with " "``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " @@ -346,11 +357,11 @@ msgstr "" "行編譯意味著擴充將能以 Python 3.12 運行,但不一定能以 Python 3.12 *編譯*。特" "別是如果穩定 ABI 保持穩定,部分受限 API 可能會被棄用和刪除。" -#: ../../c-api/stable.rst:179 +#: ../../c-api/stable.rst:187 msgid "Platform Considerations" msgstr "平台注意事項" -#: ../../c-api/stable.rst:181 +#: ../../c-api/stable.rst:189 msgid "" "ABI stability depends not only on Python, but also on the compiler used, " "lower-level libraries and compiler options. For the purposes of the :ref:" @@ -361,7 +372,7 @@ msgstr "" "於\\ :ref:`穩定 ABI <stable-abi>` 的目的,這些細節定義了一個「平台」。它們通" "常取決於作業系統種類和處理器架構" -#: ../../c-api/stable.rst:186 +#: ../../c-api/stable.rst:194 msgid "" "It is the responsibility of each particular distributor of Python to ensure " "that all Python versions on a particular platform are built in a way that " @@ -372,11 +383,11 @@ msgstr "" "定 ABI 的方式建置。``python.org`` 和許多第三方發布者發布的 Windows 和 macOS " "版本就是這種情況。" -#: ../../c-api/stable.rst:196 +#: ../../c-api/stable.rst:204 msgid "Contents of Limited API" msgstr "受限 API 的內容" -#: ../../c-api/stable.rst:199 +#: ../../c-api/stable.rst:207 msgid "" "Currently, the :ref:`Limited API <limited-c-api>` includes the following " "items:" diff --git a/c-api/sys.po b/c-api/sys.po index 5fa011518f..39d60789fe 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -486,6 +486,10 @@ msgid "" "should be called by *func*." msgstr "" +#: ../../c-api/sys.rst:432 +msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument." +msgstr "" + #: ../../c-api/sys.rst:101 msgid "USE_STACKCHECK (C macro)" msgstr "USE_STACKCHECK(C 巨集)" diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 67e53cc2e0..337d952c2b 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-12 00:04+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2024-05-11 14:42+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -389,15 +389,19 @@ msgstr "" "$4 = 42" #: ../../howto/gdb_helpers.rst:183 +#, fuzzy msgid "" "The internal structure can be revealed with a cast to :c:expr:`PyLongObject " -"*`:" +"*`::" msgstr "可以透過轉換 (cast) 為 :c:expr:`PyLongObject *` 來揭示內部結構:" #: ../../howto/gdb_helpers.rst:185 +#, fuzzy msgid "" -"(gdb) p *(PyLongObject*)some_python_integer $5 = {ob_base = {ob_base = " -"{ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1}, ob_digit = {42}}" +"(gdb) p *(PyLongObject*)some_python_integer\n" +"$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size " +"= 1},\n" +"ob_digit = {42}}" msgstr "" "(gdb) p *(PyLongObject*)some_python_integer $5 = {ob_base = {ob_base = " "{ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1}, ob_digit = {42}}" diff --git a/library/ast.po b/library/ast.po index 2a6accefab..f13f6ae313 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3245,7 +3245,7 @@ msgstr "" #: ../../library/ast.rst:1803 #, fuzzy msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[**P = (int, str)] = Callable[P, " +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " "int]\"), indent=4))\n" "Module(\n" " body=[\n" @@ -3254,7 +3254,7 @@ msgid "" " type_params=[\n" " ParamSpec(\n" " name='P',\n" -" default_value=Tuple(\n" +" default_value=List(\n" " elts=[\n" " Name(id='int', ctx=Load()),\n" " Name(id='str', ctx=Load())],\n" diff --git a/library/collections.po b/library/collections.po index 503c0d3f17..022f638608 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2024-01-22 21:42+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1225,13 +1225,14 @@ msgstr "" "值對序列轉換為包含 list 之字典:" #: ../../library/collections.rst:784 +#, fuzzy msgid "" "When each key is encountered for the first time, it is not already in the " "mapping; so an entry is automatically created using the :attr:`~defaultdict." -"default_factory` function which returns an empty :class:`list`. The :meth:" -"`list.append` operation then attaches the value to the new list. When keys " +"default_factory` function which returns an empty :class:`list`. The :meth:`!" +"list.append` operation then attaches the value to the new list. When keys " "are encountered again, the look-up proceeds normally (returning the list for " -"that key) and the :meth:`list.append` operation adds another value to the " +"that key) and the :meth:`!list.append` operation adds another value to the " "list. This technique is simpler and faster than an equivalent technique " "using :meth:`dict.setdefault`:" msgstr "" diff --git a/library/dis.po b/library/dis.po index 3ee0a161f6..4c73671690 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1119,7 +1119,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:994 ../../library/dis.rst:1665 +#: ../../library/dis.rst:994 ../../library/dis.rst:1686 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -1534,45 +1534,64 @@ msgstr "" #: ../../library/dis.rst:1388 msgid "" +"Pushes references to ``co_varnames[var_nums >> 4]`` and " +"``co_varnames[var_nums & 15]`` onto the stack." +msgstr "" + +#: ../../library/dis.rst:1395 +msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1396 +#: ../../library/dis.rst:1403 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1411 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1409 +#: ../../library/dis.rst:1415 +msgid "" +"Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " +"into ``co_varnames[var_nums & 15]``." +msgstr "" + +#: ../../library/dis.rst:1422 +msgid "" +"Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " +"pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " +"stack." +msgstr "" + +#: ../../library/dis.rst:1430 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1435 msgid "" "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:1422 +#: ../../library/dis.rst:1443 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:1425 ../../library/dis.rst:1447 -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1446 ../../library/dis.rst:1468 +#: ../../library/dis.rst:1479 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1431 +#: ../../library/dis.rst:1452 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1583,112 +1602,112 @@ msgid "" "class bodies." msgstr "" -#: ../../library/dis.rst:1444 +#: ../../library/dis.rst:1465 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1453 +#: ../../library/dis.rst:1474 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1464 +#: ../../library/dis.rst:1485 msgid "" "Copies the ``n`` :term:`free (closure) variables <closure variable>` from " "the closure into the frame. Removes the need for special code on the " "caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1473 +#: ../../library/dis.rst:1494 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1497 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1477 +#: ../../library/dis.rst:1498 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1499 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1484 +#: ../../library/dis.rst:1505 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1487 ../../library/dis.rst:1511 +#: ../../library/dis.rst:1508 ../../library/dis.rst:1532 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1488 ../../library/dis.rst:1512 +#: ../../library/dis.rst:1509 ../../library/dis.rst:1533 msgid "``self`` or ``NULL``" msgstr "" -#: ../../library/dis.rst:1489 ../../library/dis.rst:1513 +#: ../../library/dis.rst:1510 ../../library/dis.rst:1534 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1491 +#: ../../library/dis.rst:1512 msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: ../../library/dis.rst:1493 +#: ../../library/dis.rst:1514 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:1499 +#: ../../library/dis.rst:1520 msgid "The callable now always appears at the same position on the stack." msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1523 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: ../../library/dis.rst:1508 +#: ../../library/dis.rst:1529 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1535 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1515 +#: ../../library/dis.rst:1536 msgid "A :class:`tuple` of keyword argument names" msgstr "" -#: ../../library/dis.rst:1517 +#: ../../library/dis.rst:1538 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1541 msgid "" "``CALL_KW`` pops all arguments, the keyword names, 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:1529 +#: ../../library/dis.rst:1550 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 " @@ -1700,33 +1719,33 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1565 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:1553 +#: ../../library/dis.rst:1574 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1576 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1579 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1582 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1589 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " @@ -1734,42 +1753,42 @@ msgid "" "attribute to set:" msgstr "" -#: ../../library/dis.rst:1572 +#: ../../library/dis.rst:1593 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1574 +#: ../../library/dis.rst:1595 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1575 +#: ../../library/dis.rst:1596 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1597 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1585 +#: ../../library/dis.rst:1606 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1608 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1612 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1593 +#: ../../library/dis.rst:1614 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1781,11 +1800,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1619 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1603 +#: ../../library/dis.rst:1624 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 " @@ -1793,11 +1812,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1611 +#: ../../library/dis.rst:1632 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1634 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1807,28 +1826,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1617 +#: ../../library/dis.rst:1638 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1618 +#: ../../library/dis.rst:1639 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1640 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1621 ../../library/dis.rst:1634 -#: ../../library/dis.rst:1647 +#: ../../library/dis.rst:1642 ../../library/dis.rst:1655 +#: ../../library/dis.rst:1668 msgid "Used for implementing formatted literal strings (f-strings)." msgstr "" -#: ../../library/dis.rst:1628 +#: ../../library/dis.rst:1649 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1630 +#: ../../library/dis.rst:1651 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1838,11 +1857,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1661 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1663 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1854,14 +1873,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1654 +#: ../../library/dis.rst:1675 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1679 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1869,219 +1888,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1672 +#: ../../library/dis.rst:1693 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1674 +#: ../../library/dis.rst:1695 msgid "" "The ``context`` oparand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1677 +#: ../../library/dis.rst:1698 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1700 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1680 +#: ../../library/dis.rst:1701 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1702 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1683 +#: ../../library/dis.rst:1704 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1688 +#: ../../library/dis.rst:1709 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1694 +#: ../../library/dis.rst:1715 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1724 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1706 +#: ../../library/dis.rst:1727 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1736 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1719 +#: ../../library/dis.rst:1740 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1722 +#: ../../library/dis.rst:1743 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:1726 +#: ../../library/dis.rst:1747 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1731 +#: ../../library/dis.rst:1752 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1736 +#: ../../library/dis.rst:1757 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1740 ../../library/dis.rst:1794 +#: ../../library/dis.rst:1761 ../../library/dis.rst:1815 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 +#: ../../library/dis.rst:1764 ../../library/dis.rst:1818 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 +#: ../../library/dis.rst:1764 ../../library/dis.rst:1818 msgid "Description" msgstr "" -#: ../../library/dis.rst:1745 +#: ../../library/dis.rst:1766 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1745 ../../library/dis.rst:1799 +#: ../../library/dis.rst:1766 ../../library/dis.rst:1820 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1747 +#: ../../library/dis.rst:1768 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1747 +#: ../../library/dis.rst:1768 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1750 +#: ../../library/dis.rst:1771 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1750 +#: ../../library/dis.rst:1771 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1753 +#: ../../library/dis.rst:1774 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1753 +#: ../../library/dis.rst:1774 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1756 +#: ../../library/dis.rst:1777 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1756 +#: ../../library/dis.rst:1777 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1758 +#: ../../library/dis.rst:1779 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1758 +#: ../../library/dis.rst:1779 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1761 +#: ../../library/dis.rst:1782 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1761 +#: ../../library/dis.rst:1782 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1763 +#: ../../library/dis.rst:1784 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1763 +#: ../../library/dis.rst:1784 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1765 +#: ../../library/dis.rst:1786 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1765 +#: ../../library/dis.rst:1786 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1768 +#: ../../library/dis.rst:1789 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1768 +#: ../../library/dis.rst:1789 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1792 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1792 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1774 +#: ../../library/dis.rst:1795 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1774 +#: ../../library/dis.rst:1795 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1786 +#: ../../library/dis.rst:1807 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1789 +#: ../../library/dis.rst:1810 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2093,61 +2112,61 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1799 +#: ../../library/dis.rst:1820 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1801 +#: ../../library/dis.rst:1822 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1801 +#: ../../library/dis.rst:1822 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1805 +#: ../../library/dis.rst:1826 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1805 +#: ../../library/dis.rst:1826 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1808 +#: ../../library/dis.rst:1829 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1808 +#: ../../library/dis.rst:1829 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1812 +#: ../../library/dis.rst:1833 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1812 +#: ../../library/dis.rst:1833 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1819 +#: ../../library/dis.rst:1840 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1821 +#: ../../library/dis.rst:1842 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1826 +#: ../../library/dis.rst:1847 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1833 +#: ../../library/dis.rst:1854 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -2156,91 +2175,91 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1842 +#: ../../library/dis.rst:1863 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1846 +#: ../../library/dis.rst:1867 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1853 +#: ../../library/dis.rst:1874 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1859 +#: ../../library/dis.rst:1880 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1864 +#: ../../library/dis.rst:1885 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1867 +#: ../../library/dis.rst:1888 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1869 +#: ../../library/dis.rst:1890 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1875 +#: ../../library/dis.rst:1896 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1882 +#: ../../library/dis.rst:1903 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1884 +#: ../../library/dis.rst:1905 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1887 +#: ../../library/dis.rst:1908 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1894 +#: ../../library/dis.rst:1915 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1899 +#: ../../library/dis.rst:1920 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1904 +#: ../../library/dis.rst:1925 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1909 +#: ../../library/dis.rst:1930 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1916 +#: ../../library/dis.rst:1937 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1921 +#: ../../library/dis.rst:1942 msgid "" "Sequence of bytecodes that access a :term:`free (closure) variable <closure " "variable>`. 'free' in this context refers to names in the current scope that " @@ -2249,47 +2268,47 @@ msgid "" "scopes." msgstr "" -#: ../../library/dis.rst:1929 +#: ../../library/dis.rst:1950 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1934 +#: ../../library/dis.rst:1955 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:1941 +#: ../../library/dis.rst:1962 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1946 +#: ../../library/dis.rst:1967 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1950 +#: ../../library/dis.rst:1971 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1957 +#: ../../library/dis.rst:1978 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1959 +#: ../../library/dis.rst:1980 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:1965 +#: ../../library/dis.rst:1986 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1967 +#: ../../library/dis.rst:1988 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1604 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1604 msgid "slice" msgstr "slice(切片)" diff --git a/library/http.cookies.po b/library/http.cookies.po index 4bd8b76059..98ed410595 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -133,9 +133,9 @@ msgstr "" #: ../../library/http.cookies.rst:100 msgid "" "Return a string representation suitable to be sent as HTTP headers. *attrs* " -"and *header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* " -"is used to join the headers together, and is by default the combination " -"``'\\r\\n'`` (CRLF)." +"and *header* are sent to each :class:`Morsel`'s :meth:`~Morsel.output` " +"method. *sep* is used to join the headers together, and is by default the " +"combination ``'\\r\\n'`` (CRLF)." msgstr "" #: ../../library/http.cookies.rst:108 diff --git a/library/itertools.po b/library/itertools.po index 44026ccfba..67e1888a11 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1725,6 +1725,11 @@ msgid "" " \"Returns the sequence elements n times.\"\n" " return chain.from_iterable(repeat(tuple(iterable), n))\n" "\n" +"def loops(n):\n" +" \"Loop n times. Like range(n) but without creating integers.\"\n" +" # for _ in loops(100): ...\n" +" return repeat(None, n)\n" +"\n" "def tail(n, iterable):\n" " \"Return an iterator over the last n items.\"\n" " # tail(3, 'ABCDEFG') → E F G\n" @@ -1858,11 +1863,11 @@ msgid "" " yield func()" msgstr "" -#: ../../library/itertools.rst:1008 +#: ../../library/itertools.rst:1013 msgid "The following recipes have a more mathematical flavor:" msgstr "以下的應用技巧具有更多的數學風格:" -#: ../../library/itertools.rst:1010 +#: ../../library/itertools.rst:1015 msgid "" "def powerset(iterable):\n" " \"powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\"\n" @@ -1954,6 +1959,11 @@ msgid "" " data[p*p : n : p+p] = bytes(len(range(p*p, n, p+p)))\n" " yield from iter_index(data, 1, start=3)\n" "\n" +"def is_prime(n):\n" +" \"Return True if n is prime.\"\n" +" # is_prime(1_000_000_000_000_403) → True\n" +" return n > 1 and all(n % p for p in sieve(math.isqrt(n) + 1))\n" +"\n" "def factor(n):\n" " \"Prime factors of n.\"\n" " # factor(99) → 3 3 11\n" diff --git a/library/string.po b/library/string.po index b74343801a..b53a4fae17 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -462,8 +462,8 @@ msgid "Option" msgstr "選項" #: ../../library/string.rst:342 ../../library/string.rst:374 -#: ../../library/string.rst:457 ../../library/string.rst:468 -#: ../../library/string.rst:503 +#: ../../library/string.rst:459 ../../library/string.rst:470 +#: ../../library/string.rst:505 msgid "Meaning" msgstr "含義" @@ -579,16 +579,22 @@ msgid "" msgstr "" #: ../../library/string.rst:412 +#, fuzzy 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." +"The ``','`` option signals the use of a comma for a thousands separator for " +"floating-point presentation types and for integer presentation type ``'d'``. " +"For other presentation types, this option is an error. For a locale aware " +"separator, use the ``'n'`` integer presentation type instead." msgstr "" +"``'_'`` 選項表示對於浮點表示型別和整數表示型別 ``'d'`` 使用底線作為千位分隔符" +"號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" +"底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:416 +#: ../../library/string.rst:418 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:421 +#: ../../library/string.rst:423 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating-point presentation types and for integer presentation " @@ -600,11 +606,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:428 +#: ../../library/string.rst:430 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:431 +#: ../../library/string.rst:433 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " @@ -613,7 +619,7 @@ msgstr "" "*width* 是一個十進位整數,定義了最小總欄位寬度,包括任何前綴、分隔符號和其他" "格式字元。如果未指定,則欄位寬度將由內容決定。" -#: ../../library/string.rst:435 +#: ../../library/string.rst:437 #, fuzzy msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " @@ -625,13 +631,13 @@ msgstr "" "別啟用有符號察覺的零填充 (sign-aware zero-padding)。這相當於使用 ``'0'`` 為 " "*fill* 字元且對齊類型為 ``'='``。" -#: ../../library/string.rst:440 +#: ../../library/string.rst:442 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "在 *width* 欄位前面加上 ``'0'`` 不再影響字串的預設對齊方式。" -#: ../../library/string.rst:444 +#: ../../library/string.rst:446 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -646,89 +652,89 @@ msgstr "" "示類型,該欄位指定最大欄位大小 - 換言之,將使用欄位中的多少字元。整數表示類型" "不允許使用 *precision*。" -#: ../../library/string.rst:452 +#: ../../library/string.rst:454 msgid "Finally, the *type* determines how the data should be presented." msgstr "最終,型別決定了資料將會如何呈現" -#: ../../library/string.rst:454 +#: ../../library/string.rst:456 msgid "The available string presentation types are:" msgstr "可用的字串表示型別有:" -#: ../../library/string.rst:457 ../../library/string.rst:468 -#: ../../library/string.rst:503 +#: ../../library/string.rst:459 ../../library/string.rst:470 +#: ../../library/string.rst:505 msgid "Type" msgstr "型別" -#: ../../library/string.rst:459 +#: ../../library/string.rst:461 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:459 +#: ../../library/string.rst:461 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:462 ../../library/string.rst:491 -#: ../../library/string.rst:576 +#: ../../library/string.rst:464 ../../library/string.rst:493 +#: ../../library/string.rst:578 msgid "None" msgstr "None" -#: ../../library/string.rst:462 +#: ../../library/string.rst:464 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:465 +#: ../../library/string.rst:467 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:470 +#: ../../library/string.rst:472 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:470 +#: ../../library/string.rst:472 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:472 +#: ../../library/string.rst:474 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:475 +#: ../../library/string.rst:477 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:475 +#: ../../library/string.rst:477 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:477 +#: ../../library/string.rst:479 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:477 +#: ../../library/string.rst:479 msgid "Octal format. Outputs the number in base 8." 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 lower-case letters for the " "digits above 9." msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" -#: ../../library/string.rst:482 +#: ../../library/string.rst:484 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:482 +#: ../../library/string.rst:484 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 " @@ -737,21 +743,21 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:487 ../../library/string.rst:569 +#: ../../library/string.rst:489 ../../library/string.rst:571 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:487 +#: ../../library/string.rst:489 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:491 +#: ../../library/string.rst:493 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:494 +#: ../../library/string.rst:496 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating-point presentation types listed below (except ``'n'`` and " @@ -759,17 +765,17 @@ msgid "" "floating-point number before formatting." msgstr "" -#: ../../library/string.rst:499 +#: ../../library/string.rst:501 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:505 +#: ../../library/string.rst:507 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:505 +#: ../../library/string.rst:507 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -781,21 +787,21 @@ msgid "" "is used." msgstr "" -#: ../../library/string.rst:516 +#: ../../library/string.rst:518 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:516 +#: ../../library/string.rst:518 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:519 +#: ../../library/string.rst:521 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:519 +#: ../../library/string.rst:521 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 " @@ -805,21 +811,21 @@ msgid "" "point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:528 +#: ../../library/string.rst:530 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:528 +#: ../../library/string.rst:530 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:531 +#: ../../library/string.rst:533 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:531 +#: ../../library/string.rst:533 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 " @@ -827,7 +833,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:538 +#: ../../library/string.rst:540 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -840,7 +846,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:551 +#: ../../library/string.rst:553 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -850,40 +856,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:560 +#: ../../library/string.rst:562 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:565 +#: ../../library/string.rst:567 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:565 +#: ../../library/string.rst:567 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:569 +#: ../../library/string.rst:571 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:573 +#: ../../library/string.rst:575 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:573 +#: ../../library/string.rst:575 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:576 +#: ../../library/string.rst:578 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -892,20 +898,28 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:584 +#: ../../library/string.rst:586 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:588 +#: ../../library/string.rst:590 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:592 +#: ../../library/string.rst:594 +msgid "" +"The result should be correctly rounded to a given precision ``p`` of digits " +"after the decimal point. The rounding mode for :class:`float` matches that " +"of the :func:`round` builtin. For :class:`~decimal.Decimal`, the rounding " +"mode of the current :ref:`context <decimal-context>` will be used." +msgstr "" + +#: ../../library/string.rst:599 msgid "" "The available presentation types for :class:`complex` are the same as those " "for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " @@ -917,17 +931,17 @@ msgid "" "surrounded by parentheses), possibly altered by other format modifiers." msgstr "" -#: ../../library/string.rst:605 +#: ../../library/string.rst:612 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:607 +#: ../../library/string.rst:614 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:610 +#: ../../library/string.rst:617 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 " @@ -936,17 +950,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:614 +#: ../../library/string.rst:621 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:617 +#: ../../library/string.rst:624 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:619 +#: ../../library/string.rst:626 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -961,11 +975,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:630 +#: ../../library/string.rst:637 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:632 +#: ../../library/string.rst:639 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -975,11 +989,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:638 +#: ../../library/string.rst:645 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:640 +#: ../../library/string.rst:647 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -996,22 +1010,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:653 +#: ../../library/string.rst:660 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:655 +#: ../../library/string.rst:662 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:659 +#: ../../library/string.rst:666 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:661 +#: ../../library/string.rst:668 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1021,11 +1035,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:664 +#: ../../library/string.rst:671 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:666 +#: ../../library/string.rst:673 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1037,11 +1051,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:675 +#: ../../library/string.rst:682 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:677 +#: ../../library/string.rst:684 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1052,12 +1066,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:684 +#: ../../library/string.rst:691 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:686 +#: ../../library/string.rst:693 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1067,11 +1081,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:693 +#: ../../library/string.rst:700 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:695 +#: ../../library/string.rst:702 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1079,11 +1093,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:698 +#: ../../library/string.rst:705 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:700 +#: ../../library/string.rst:707 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1095,11 +1109,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:705 +#: ../../library/string.rst:712 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:707 +#: ../../library/string.rst:714 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1111,11 +1125,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:712 +#: ../../library/string.rst:719 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:714 +#: ../../library/string.rst:721 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1173,11 +1187,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:746 +#: ../../library/string.rst:753 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:748 +#: ../../library/string.rst:755 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1191,17 +1205,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "<https://flufli18n.readthedocs.io/en/latest/>`_ 套件。" -#: ../../library/string.rst:758 +#: ../../library/string.rst:765 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:760 +#: ../../library/string.rst:767 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:762 +#: ../../library/string.rst:769 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1211,30 +1225,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:769 +#: ../../library/string.rst:776 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:773 +#: ../../library/string.rst:780 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:776 +#: ../../library/string.rst:783 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:782 +#: ../../library/string.rst:789 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:787 +#: ../../library/string.rst:794 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1246,7 +1260,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:796 +#: ../../library/string.rst:803 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1259,7 +1273,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:802 +#: ../../library/string.rst:809 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 " @@ -1273,7 +1287,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:812 +#: ../../library/string.rst:819 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1281,18 +1295,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:820 +#: ../../library/string.rst:827 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:825 +#: ../../library/string.rst:832 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:829 +#: ../../library/string.rst:836 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." @@ -1300,11 +1314,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:832 +#: ../../library/string.rst:839 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:834 +#: ../../library/string.rst:841 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1338,7 +1352,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:850 +#: ../../library/string.rst:857 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1348,7 +1362,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:855 +#: ../../library/string.rst:862 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1362,7 +1376,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:862 +#: ../../library/string.rst:869 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1370,19 +1384,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:869 +#: ../../library/string.rst:876 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:873 +#: ../../library/string.rst:880 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:877 +#: ../../library/string.rst:884 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1391,7 +1405,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:885 +#: ../../library/string.rst:892 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1400,7 +1414,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:893 +#: ../../library/string.rst:900 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1409,13 +1423,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:899 +#: ../../library/string.rst:906 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:902 +#: ../../library/string.rst:909 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1423,7 +1437,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:905 +#: ../../library/string.rst:912 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1431,7 +1445,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:908 +#: ../../library/string.rst:915 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1439,7 +1453,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:911 +#: ../../library/string.rst:918 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1447,11 +1461,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:916 +#: ../../library/string.rst:923 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:920 +#: ../../library/string.rst:927 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1472,7 +1486,7 @@ msgstr "{} (花括號)" #: ../../library/string.rst:195 ../../library/string.rst:335 #: ../../library/string.rst:368 ../../library/string.rst:387 #: ../../library/string.rst:396 ../../library/string.rst:410 -#: ../../library/string.rst:419 +#: ../../library/string.rst:421 msgid "in string formatting" msgstr "於字串格式化" @@ -1528,14 +1542,14 @@ msgstr "# (井字號)" msgid ", (comma)" msgstr ", (逗號)" -#: ../../library/string.rst:419 +#: ../../library/string.rst:421 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:756 +#: ../../library/string.rst:763 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:756 +#: ../../library/string.rst:763 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/traceback.po b/library/traceback.po index 22e0a96d42..45e85e7fb2 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,11 +150,11 @@ msgid "" "when printing an unhandled exception." msgstr "" -#: ../../library/traceback.rst:104 ../../library/traceback.rst:208 +#: ../../library/traceback.rst:104 ../../library/traceback.rst:215 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:107 ../../library/traceback.rst:188 +#: ../../library/traceback.rst:107 ../../library/traceback.rst:195 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" @@ -205,6 +205,13 @@ msgstr "" #: ../../library/traceback.rst:162 msgid "" +"Print the list of tuples as returned by :func:`extract_tb` or :func:" +"`extract_stack` as a formatted stack trace to the given file. If *file* is " +"``None``, the output is written to :data:`sys.stderr`." +msgstr "" + +#: ../../library/traceback.rst:169 +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 " "printing. Each string in the resulting list corresponds to the item with " @@ -213,7 +220,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:172 +#: ../../library/traceback.rst:179 msgid "" "Format the exception part of a traceback using an exception value such as " "given by :data:`sys.last_value`. The return value is a list of strings, " @@ -224,31 +231,31 @@ msgid "" "contains the exception's :attr:`notes <BaseException.__notes__>`." msgstr "" -#: ../../library/traceback.rst:180 +#: ../../library/traceback.rst:187 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:184 ../../library/traceback.rst:415 +#: ../../library/traceback.rst:191 ../../library/traceback.rst:422 msgid "" "When *show_group* is ``True``, and the exception is an instance of :exc:" "`BaseExceptionGroup`, the nested exceptions are included as well, " "recursively, with indentation relative to their nesting depth." msgstr "" -#: ../../library/traceback.rst:192 +#: ../../library/traceback.rst:199 msgid "" "The returned list now includes any :attr:`notes <BaseException.__notes__>` " "attached to the exception." msgstr "" -#: ../../library/traceback.rst:196 +#: ../../library/traceback.rst:203 msgid "*show_group* parameter was added." msgstr "" -#: ../../library/traceback.rst:202 +#: ../../library/traceback.rst:209 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -257,69 +264,69 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:211 +#: ../../library/traceback.rst:218 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:218 +#: ../../library/traceback.rst:225 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:224 +#: ../../library/traceback.rst:231 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "``format_list(extract_tb(tb, limit))`` 的簡寫。" -#: ../../library/traceback.rst:229 +#: ../../library/traceback.rst:236 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "``format_list(extract_stack(f, limit))`` 的簡寫。" -#: ../../library/traceback.rst:233 +#: ../../library/traceback.rst:240 msgid "" "Clears the local variables of all the stack frames in a :ref:`traceback " "<traceback-objects>` *tb* by calling the :meth:`~frame.clear` method of " "each :ref:`frame object <frame-objects>`." msgstr "" -#: ../../library/traceback.rst:242 +#: ../../library/traceback.rst:249 msgid "" "Walk a stack following :attr:`f.f_back <frame.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:251 +#: ../../library/traceback.rst:258 msgid "" "Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and " "line number for each frame. This helper is used with :meth:`StackSummary." "extract`." msgstr "" -#: ../../library/traceback.rst:259 +#: ../../library/traceback.rst:266 msgid ":class:`!TracebackException` Objects" msgstr ":class:`!TracebackException` 物件" -#: ../../library/traceback.rst:263 +#: ../../library/traceback.rst:270 msgid "" ":class:`!TracebackException` objects are created from actual exceptions to " "capture data for later printing. They offer a more lightweight method of " "storing this information by avoiding holding references to :ref:" -"`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects In " +"`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In " "addition, they expose more options to configure the output compared to the " "module-level functions described above." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:279 msgid "" "Capture an exception for later rendering. The meaning of *limit*, " "*lookup_lines* and *capture_locals* are as for the :class:`StackSummary` " "class." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:283 msgid "" "If *compact* is true, only data that is required by :class:`!" "TracebackException`'s :meth:`format` method is saved in the class " @@ -327,12 +334,12 @@ msgid "" "if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false." msgstr "" -#: ../../library/traceback.rst:282 ../../library/traceback.rst:383 +#: ../../library/traceback.rst:289 ../../library/traceback.rst:390 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:291 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -341,128 +348,128 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:290 +#: ../../library/traceback.rst:297 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:293 +#: ../../library/traceback.rst:300 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" -#: ../../library/traceback.rst:298 +#: ../../library/traceback.rst:305 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__cause__`." msgstr "" -#: ../../library/traceback.rst:303 +#: ../../library/traceback.rst:310 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__context__`." msgstr "" -#: ../../library/traceback.rst:308 +#: ../../library/traceback.rst:315 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:316 +#: ../../library/traceback.rst:323 msgid "" "The :attr:`~BaseException.__suppress_context__` value from the original " "exception." msgstr "" -#: ../../library/traceback.rst:321 +#: ../../library/traceback.rst:328 msgid "" "The :attr:`~BaseException.__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:330 +#: ../../library/traceback.rst:337 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:334 +#: ../../library/traceback.rst:341 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:347 msgid "String display of the class of the original exception." msgstr "" -#: ../../library/traceback.rst:346 +#: ../../library/traceback.rst:353 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:350 +#: ../../library/traceback.rst:357 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:354 +#: ../../library/traceback.rst:361 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:361 +#: ../../library/traceback.rst:368 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:365 +#: ../../library/traceback.rst:372 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:369 +#: ../../library/traceback.rst:376 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:376 +#: ../../library/traceback.rst:383 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:387 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:387 +#: ../../library/traceback.rst:394 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:394 +#: ../../library/traceback.rst:401 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:396 +#: ../../library/traceback.rst:403 msgid "" "If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will " "not be formatted." msgstr "" -#: ../../library/traceback.rst:399 +#: ../../library/traceback.rst:406 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:405 +#: ../../library/traceback.rst:412 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:407 +#: ../../library/traceback.rst:414 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:409 +#: ../../library/traceback.rst:416 msgid "" "When *show_group* is ``False``, the generator emits the exception's message " "followed by its notes (if it has any). The exception message is normally a " @@ -471,33 +478,33 @@ msgid "" "the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:426 msgid "" "The exception's :attr:`notes <BaseException.__notes__>` are now included in " "the output." msgstr "" -#: ../../library/traceback.rst:423 +#: ../../library/traceback.rst:430 #, fuzzy msgid "Added the *show_group* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:428 +#: ../../library/traceback.rst:435 msgid ":class:`!StackSummary` Objects" msgstr ":class:`!StackSummary` 物件" -#: ../../library/traceback.rst:432 +#: ../../library/traceback.rst:439 msgid "" ":class:`!StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:438 +#: ../../library/traceback.rst:445 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:442 +#: ../../library/traceback.rst:449 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 " @@ -507,20 +514,20 @@ msgid "" "class:`!FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:450 +#: ../../library/traceback.rst:457 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:456 +#: ../../library/traceback.rst:463 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:463 +#: ../../library/traceback.rst:470 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single :ref:`frame <frame-objects>` from the stack. " @@ -528,18 +535,18 @@ msgid "" "well, for those items with source text lines." msgstr "" -#: ../../library/traceback.rst:469 +#: ../../library/traceback.rst:476 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:473 +#: ../../library/traceback.rst:480 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:478 +#: ../../library/traceback.rst:485 msgid "" "Returns a string for printing one of the :ref:`frames <frame-objects>` " "involved in the stack. This method is called for each :class:`FrameSummary` " @@ -547,17 +554,17 @@ msgid "" "the frame is omitted from the output." msgstr "" -#: ../../library/traceback.rst:488 +#: ../../library/traceback.rst:495 msgid ":class:`!FrameSummary` Objects" msgstr ":class:`!FrameSummary` 物件" -#: ../../library/traceback.rst:492 +#: ../../library/traceback.rst:499 msgid "" "A :class:`!FrameSummary` object represents a single :ref:`frame <frame-" "objects>` in a :ref:`traceback <traceback-objects>`." msgstr "" -#: ../../library/traceback.rst:497 +#: ../../library/traceback.rst:504 msgid "" "Represents a single :ref:`frame <frame-objects>` in the :ref:`traceback " "<traceback-objects>` or stack that is being formatted or printed. It may " @@ -571,38 +578,38 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:508 +#: ../../library/traceback.rst:515 msgid ":class:`!FrameSummary` instances have the following attributes:" msgstr "" -#: ../../library/traceback.rst:512 +#: ../../library/traceback.rst:519 msgid "" "The filename of the source code for this frame. Equivalent to accessing :" "attr:`f.f_code.co_filename <codeobject.co_filename>` on a :ref:`frame object " "<frame-objects>` *f*." msgstr "" -#: ../../library/traceback.rst:518 +#: ../../library/traceback.rst:525 msgid "The line number of the source code for this frame." msgstr "" -#: ../../library/traceback.rst:522 +#: ../../library/traceback.rst:529 msgid "" "Equivalent to accessing :attr:`f.f_code.co_name <codeobject.co_name>` on a :" "ref:`frame object <frame-objects>` *f*." msgstr "" -#: ../../library/traceback.rst:527 +#: ../../library/traceback.rst:534 msgid "" "A string representing the source code for this frame, with leading and " "trailing whitespace stripped. If the source is not available, it is ``None``." msgstr "" -#: ../../library/traceback.rst:534 +#: ../../library/traceback.rst:541 msgid "Examples of Using the Module-Level Functions" msgstr "" -#: ../../library/traceback.rst:536 +#: ../../library/traceback.rst:543 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 " @@ -610,7 +617,7 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:541 +#: ../../library/traceback.rst:548 msgid "" "import sys, traceback\n" "\n" @@ -629,13 +636,13 @@ msgid "" " run_user_code(envdir)" msgstr "" -#: ../../library/traceback.rst:558 +#: ../../library/traceback.rst:565 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:561 +#: ../../library/traceback.rst:568 msgid "" "import sys, traceback\n" "\n" @@ -667,11 +674,11 @@ msgid "" " print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)" msgstr "" -#: ../../library/traceback.rst:592 +#: ../../library/traceback.rst:599 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:594 +#: ../../library/traceback.rst:601 msgid "" "*** print_tb:\n" " File \"<doctest...>\", line 10, in <module>\n" @@ -721,13 +728,13 @@ msgid "" "*** tb_lineno: 10" msgstr "" -#: ../../library/traceback.rst:639 +#: ../../library/traceback.rst:646 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:641 +#: ../../library/traceback.rst:648 msgid "" ">>> import traceback\n" ">>> def another_function():\n" @@ -779,11 +786,11 @@ msgstr "" " ' File \"<doctest>\", line 8, in lumberstack\\n print(repr(traceback." "format_stack()))\\n']" -#: ../../library/traceback.rst:665 +#: ../../library/traceback.rst:672 msgid "This last example demonstrates the final few formatting functions:" msgstr "" -#: ../../library/traceback.rst:667 +#: ../../library/traceback.rst:674 msgid "" ">>> import traceback\n" ">>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),\n" @@ -795,16 +802,16 @@ msgid "" "['IndexError: tuple index out of range\\n']" msgstr "" -#: ../../library/traceback.rst:681 +#: ../../library/traceback.rst:688 #, fuzzy msgid "Examples of Using :class:`TracebackException`" msgstr ":class:`!TracebackException` 物件" -#: ../../library/traceback.rst:683 +#: ../../library/traceback.rst:690 msgid "With the helper class, we have more options::" msgstr "" -#: ../../library/traceback.rst:685 +#: ../../library/traceback.rst:692 msgid "" ">>> import sys\n" ">>> from traceback import TracebackException\n" diff --git a/library/xmlrpc.po b/library/xmlrpc.po index 15a6dc34eb..d8f526de32 100644 --- a/library/xmlrpc.po +++ b/library/xmlrpc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2022-02-16 01:58+0800\n" "Last-Translator: Matt Wang <mattwang44@gamil.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,7 +23,7 @@ msgstr "" msgid ":mod:`!xmlrpc` --- XMLRPC server and client modules" msgstr ":mod:`!xmlrpc` --- XMLRPC 伺服器與用戶模組" -#: ../../library/xmlrpc.rst:4 +#: ../../library/xmlrpc.rst:7 msgid "" "XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a " "transport. With it, a client can call methods with parameters on a remote " @@ -33,17 +33,17 @@ msgstr "" "(transport)的 XML 來做傳遞。有了它,用戶端可以在遠端伺服器上呼叫帶有參數的" "方法(伺服器以 URI 命名)並獲取結構化的資料。" -#: ../../library/xmlrpc.rst:8 +#: ../../library/xmlrpc.rst:11 msgid "" "``xmlrpc`` is a package that collects server and client modules implementing " "XML-RPC. The modules are:" msgstr "" "``xmlrpc`` 是一個集合了 XML-RPC 伺服器與用戶端模組實作的套件。這些模組是:" -#: ../../library/xmlrpc.rst:11 +#: ../../library/xmlrpc.rst:14 msgid ":mod:`xmlrpc.client`" msgstr ":mod:`xmlrpc.client`" -#: ../../library/xmlrpc.rst:12 +#: ../../library/xmlrpc.rst:15 msgid ":mod:`xmlrpc.server`" msgstr ":mod:`xmlrpc.server`" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index b29815534b..10d2fd6ad7 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -447,12 +447,13 @@ msgstr "" msgid "" "These equivalences assume that :const:`__debug__` and :exc:`AssertionError` " "refer to the built-in variables with those names. In the current " -"implementation, the built-in variable :const:`__debug__` is ``True`` under " -"normal circumstances, ``False`` when optimization is requested (command line " -"option :option:`-O`). The current code generator emits no code for an " -"assert statement when optimization is requested at compile time. Note that " -"it is unnecessary to include the source code for the expression that failed " -"in the error message; it will be displayed as part of the stack trace." +"implementation, the built-in variable ``__debug__`` is ``True`` under normal " +"circumstances, ``False`` when optimization is requested (command line " +"option :option:`-O`). The current code generator emits no code for an :" +"keyword:`assert` statement when optimization is requested at compile time. " +"Note that it is unnecessary to include the source code for the expression " +"that failed in the error message; it will be displayed as part of the stack " +"trace." msgstr "" #: ../../reference/simple_stmts.rst:416 @@ -569,7 +570,7 @@ msgstr ":keyword:`!yield` 陳述式" #: ../../reference/simple_stmts.rst:533 msgid "" "A :keyword:`yield` statement is semantically equivalent to a :ref:`yield " -"expression <yieldexpr>`. The yield statement can be used to omit the " +"expression <yieldexpr>`. The ``yield`` statement can be used to omit the " "parentheses that would otherwise be required in the equivalent yield " "expression statement. For example, the yield statements ::" msgstr "" @@ -598,8 +599,9 @@ msgstr "" msgid "" "Yield expressions and statements are only used when defining a :term:" "`generator` function, and are only used in the body of the generator " -"function. Using yield in a function definition is sufficient to cause that " -"definition to create a generator function instead of a normal function." +"function. Using :keyword:`yield` in a function definition is sufficient to " +"cause that definition to create a generator function instead of a normal " +"function." msgstr "" #: ../../reference/simple_stmts.rst:551 @@ -1153,35 +1155,20 @@ msgstr ":keyword:`!global` 陳述式" #: ../../reference/simple_stmts.rst:967 msgid "" -"The :keyword:`global` statement is a declaration which holds for the entire " -"current code block. It means that the listed identifiers are to be " -"interpreted as globals. It would be impossible to assign to a global " +"The :keyword:`global` statement causes the listed identifiers to be " +"interpreted as globals. It would be impossible to assign to a global " "variable without :keyword:`!global`, although free variables may refer to " "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:973 +#: ../../reference/simple_stmts.rst:972 msgid "" -"Names listed in a :keyword:`global` statement must not be used in the same " -"code block textually preceding that :keyword:`!global` statement." +"The :keyword:`global` statement applies to the entire scope of a function or " +"class body. A :exc:`SyntaxError` is raised if a variable is used or assigned " +"to prior to its global declaration in the scope." msgstr "" -#: ../../reference/simple_stmts.rst:976 -msgid "" -"Names listed in a :keyword:`global` statement must not be defined as formal " -"parameters, or as targets in :keyword:`with` statements or :keyword:`except` " -"clauses, or in a :keyword:`for` target list, :keyword:`class` definition, " -"function definition, :keyword:`import` statement, or variable annotation." -msgstr "" - -#: ../../reference/simple_stmts.rst:983 -msgid "" -"The current implementation does not enforce some of these restrictions, but " -"programs should not abuse this freedom, as future implementations may " -"enforce them or silently change the meaning of the program." -msgstr "" - -#: ../../reference/simple_stmts.rst:992 +#: ../../reference/simple_stmts.rst:981 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1193,11 +1180,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:1004 +#: ../../reference/simple_stmts.rst:993 msgid "The :keyword:`!nonlocal` statement" msgstr ":keyword:`!nonlocal` 陳述式" -#: ../../reference/simple_stmts.rst:1012 +#: ../../reference/simple_stmts.rst:1001 msgid "" "When the definition of a function or class is nested (enclosed) within the " "definitions of other functions, its nonlocal scopes are the local scopes of " @@ -1209,64 +1196,64 @@ msgid "" "`SyntaxError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:1021 +#: ../../reference/simple_stmts.rst:1010 msgid "" -"The nonlocal statement applies to the entire scope of a function or class " -"body. A :exc:`SyntaxError` is raised if a variable is used or assigned to " -"prior to its nonlocal declaration in the scope." +"The :keyword:`nonlocal` statement applies to the entire scope of a function " +"or class body. A :exc:`SyntaxError` is raised if a variable is used or " +"assigned to prior to its nonlocal declaration in the scope." msgstr "" -#: ../../reference/simple_stmts.rst:1027 +#: ../../reference/simple_stmts.rst:1016 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1028 +#: ../../reference/simple_stmts.rst:1017 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1030 +#: ../../reference/simple_stmts.rst:1019 msgid "" "**Programmer's note:** :keyword:`nonlocal` is a directive to the parser and " "applies only to code parsed along with it. See the note for the :keyword:" "`global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1038 +#: ../../reference/simple_stmts.rst:1027 msgid "The :keyword:`!type` statement" msgstr ":keyword:`!type` 陳述式" -#: ../../reference/simple_stmts.rst:1045 +#: ../../reference/simple_stmts.rst:1034 msgid "" "The :keyword:`!type` statement declares a type alias, which is an instance " "of :class:`typing.TypeAliasType`." msgstr "" -#: ../../reference/simple_stmts.rst:1048 +#: ../../reference/simple_stmts.rst:1037 msgid "For example, the following statement creates a type alias::" msgstr "" -#: ../../reference/simple_stmts.rst:1050 +#: ../../reference/simple_stmts.rst:1039 msgid "type Point = tuple[float, float]" msgstr "" -#: ../../reference/simple_stmts.rst:1052 +#: ../../reference/simple_stmts.rst:1041 msgid "This code is roughly equivalent to::" msgstr "" -#: ../../reference/simple_stmts.rst:1054 +#: ../../reference/simple_stmts.rst:1043 msgid "" "annotation-def VALUE_OF_Point():\n" " return tuple[float, float]\n" "Point = typing.TypeAliasType(\"Point\", VALUE_OF_Point())" msgstr "" -#: ../../reference/simple_stmts.rst:1058 +#: ../../reference/simple_stmts.rst:1047 msgid "" "``annotation-def`` indicates an :ref:`annotation scope <annotation-scopes>`, " "which behaves mostly like a function, but with several small differences." msgstr "" -#: ../../reference/simple_stmts.rst:1061 +#: ../../reference/simple_stmts.rst:1050 msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " @@ -1275,21 +1262,21 @@ msgid "" "not yet defined." msgstr "" -#: ../../reference/simple_stmts.rst:1067 +#: ../../reference/simple_stmts.rst:1056 msgid "" "Type aliases may be made generic by adding a :ref:`type parameter list <type-" "params>` after the name. See :ref:`generic-type-aliases` for more." msgstr "" -#: ../../reference/simple_stmts.rst:1070 +#: ../../reference/simple_stmts.rst:1059 msgid ":keyword:`!type` is a :ref:`soft keyword <soft-keywords>`." msgstr "" -#: ../../reference/simple_stmts.rst:1076 +#: ../../reference/simple_stmts.rst:1065 msgid ":pep:`695` - Type Parameter Syntax" msgstr "" -#: ../../reference/simple_stmts.rst:1077 +#: ../../reference/simple_stmts.rst:1066 msgid "" "Introduced the :keyword:`!type` statement and syntax for generic classes and " "functions." @@ -1307,8 +1294,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:523 ../../reference/simple_stmts.rst:559 #: ../../reference/simple_stmts.rst:684 ../../reference/simple_stmts.rst:718 #: ../../reference/simple_stmts.rst:743 ../../reference/simple_stmts.rst:873 -#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1006 -#: ../../reference/simple_stmts.rst:1040 +#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:995 +#: ../../reference/simple_stmts.rst:1029 msgid "statement" msgstr "statement(陳述式)" @@ -1322,7 +1309,7 @@ msgstr "" msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:987 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:976 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -1418,7 +1405,7 @@ msgstr "target" #: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:382 #: ../../reference/simple_stmts.rst:743 ../../reference/simple_stmts.rst:959 -#: ../../reference/simple_stmts.rst:1006 +#: ../../reference/simple_stmts.rst:995 msgid ", (comma)" msgstr ", (逗號)" @@ -1748,26 +1735,26 @@ msgstr "__future__" msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:1006 +#: ../../reference/simple_stmts.rst:959 ../../reference/simple_stmts.rst:995 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:987 +#: ../../reference/simple_stmts.rst:976 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:987 +#: ../../reference/simple_stmts.rst:976 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:987 +#: ../../reference/simple_stmts.rst:976 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:1006 +#: ../../reference/simple_stmts.rst:995 msgid "nonlocal" msgstr "nonlocal" -#: ../../reference/simple_stmts.rst:1040 +#: ../../reference/simple_stmts.rst:1029 msgid "type" msgstr "" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 23fac8f41f..68eb5e597b 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2024-01-22 21:43+0800\n" "Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,12 +193,13 @@ msgid "Using Lists as Stacks" msgstr "將 List 作為 Stack(堆疊)使用" #: ../../tutorial/datastructures.rst:143 +#, fuzzy msgid "" "The list methods make it very easy to use a list as a stack, where the last " "element added is the first element retrieved (\"last-in, first-out\"). To " -"add an item to the top of the stack, use :meth:`~list.append`. To retrieve " -"an item from the top of the stack, use :meth:`~list.pop` without an explicit " -"index. For example::" +"add an item to the top of the stack, use :meth:`!append`. To retrieve an " +"item from the top of the stack, use :meth:`!pop` without an explicit index. " +"For example::" msgstr "" "List 的操作方法使得它非常簡單可以用來實作 stack(堆疊)。Stack 為一個遵守最後" "加入元素最先被取回(後進先出,\"last-in, first-out\")規則的資料結構。你可以" @@ -558,11 +559,12 @@ msgid "The :keyword:`!del` statement" msgstr ":keyword:`!del` 陳述式" #: ../../tutorial/datastructures.rst:342 +#, fuzzy msgid "" "There is a way to remove an item from a list given its index instead of its " -"value: the :keyword:`del` statement. This differs from the :meth:`~list." -"pop` method which returns a value. The :keyword:`!del` statement can also " -"be used to remove slices from a list or clear the entire list (which we did " +"value: the :keyword:`del` statement. This differs from the :meth:`!pop` " +"method which returns a value. The :keyword:`!del` statement can also be " +"used to remove slices from a list or clear the entire list (which we did " "earlier by assignment of an empty list to the slice). For example::" msgstr "" "有一個方法可以藉由索引而不是值來刪除 list 中的項目::keyword:`del` 陳述式。這" @@ -816,6 +818,7 @@ msgid "Dictionaries" msgstr "字典(Dictionary)" #: ../../tutorial/datastructures.rst:495 +#, fuzzy msgid "" "Another useful data type built into Python is the *dictionary* (see :ref:" "`typesmapping`). Dictionaries are sometimes found in other languages as " @@ -825,8 +828,8 @@ msgid "" "can be used as keys if they contain only strings, numbers, or tuples; if a " "tuple contains any mutable object either directly or indirectly, it cannot " "be used as a key. You can't use lists as keys, since lists can be modified " -"in place using index assignments, slice assignments, or methods like :meth:" -"`~list.append` and :meth:`~list.extend`." +"in place using index assignments, slice assignments, or methods like :meth:`!" +"append` and :meth:`!extend`." msgstr "" "下一個常用的 Python 內建資料類型為 *dictionary*\\ (請參考\\ :ref:" "`typesmapping`\\ )。 Dictionary 有時被稱為「關聯記憶體」(associative " diff --git a/using/ios.po b/using/ios.po index f2c2df9111..7f568da788 100644 --- a/using/ios.po +++ b/using/ios.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -461,59 +461,65 @@ msgid "" msgstr "" #: ../../using/ios.rst:295 -msgid ":c:member:`UTF-8 mode <PyPreConfig.utf8_mode>` is *enabled*;" +msgid "UTF-8 mode (:c:member:`PyPreConfig.utf8_mode`) is *enabled*;" msgstr "" #: ../../using/ios.rst:296 -msgid ":c:member:`Buffered stdio <PyConfig.buffered_stdio>` is *disabled*;" +msgid "Buffered stdio (:c:member:`PyConfig.buffered_stdio`) is *disabled*;" msgstr "" #: ../../using/ios.rst:297 -msgid ":c:member:`Writing bytecode <PyConfig.write_bytecode>` is *disabled*;" +msgid "Writing bytecode (:c:member:`PyConfig.write_bytecode`) is *disabled*;" msgstr "" #: ../../using/ios.rst:298 msgid "" -":c:member:`Signal handlers <PyConfig.install_signal_handlers>` are *enabled*;" +"Signal handlers (:c:member:`PyConfig.install_signal_handlers`) are *enabled*;" msgstr "" #: ../../using/ios.rst:299 msgid "" +"System logging (:c:member:`PyConfig.use_system_logger`) is *enabled* " +"(optional, but strongly recommended);" +msgstr "" + +#: ../../using/ios.rst:301 +msgid "" "``PYTHONHOME`` for the interpreter is configured to point at the ``python`` " "subfolder of your app's bundle; and" msgstr "" -#: ../../using/ios.rst:301 +#: ../../using/ios.rst:303 msgid "The ``PYTHONPATH`` for the interpreter includes:" msgstr "" -#: ../../using/ios.rst:303 +#: ../../using/ios.rst:305 msgid "the ``python/lib/python3.X`` subfolder of your app's bundle," msgstr "" -#: ../../using/ios.rst:304 +#: ../../using/ios.rst:306 msgid "" "the ``python/lib/python3.X/lib-dynload`` subfolder of your app's bundle, and" msgstr "" -#: ../../using/ios.rst:305 +#: ../../using/ios.rst:307 msgid "the ``app`` subfolder of your app's bundle" msgstr "" -#: ../../using/ios.rst:307 +#: ../../using/ios.rst:309 msgid "" "Your app's bundle location can be determined using ``[[NSBundle mainBundle] " "resourcePath]``." msgstr "" -#: ../../using/ios.rst:310 +#: ../../using/ios.rst:312 msgid "" "Steps 8, 9 and 10 of these instructions assume that you have a single folder " "of pure Python application code, named ``app``. If you have third-party " "binary modules in your app, some additional steps will be required:" msgstr "" -#: ../../using/ios.rst:314 +#: ../../using/ios.rst:316 msgid "" "You need to ensure that any folders containing third-party binaries are " "either associated with the app target, or copied in as part of step 8. Step " @@ -522,24 +528,90 @@ msgid "" "building an app targeting the simulator)." msgstr "" -#: ../../using/ios.rst:320 +#: ../../using/ios.rst:322 msgid "" "Any folders that contain third-party binaries must be processed into " "framework form by step 9. The invocation of ``install_dylib`` that processes " "the ``lib-dynload`` folder can be copied and adapted for this purpose." msgstr "" -#: ../../using/ios.rst:324 +#: ../../using/ios.rst:326 msgid "" "If you're using a separate folder for third-party packages, ensure that " "folder is included as part of the ``PYTHONPATH`` configuration in step 10." msgstr "" -#: ../../using/ios.rst:328 +#: ../../using/ios.rst:330 +msgid "Testing a Python package" +msgstr "" + +#: ../../using/ios.rst:332 +msgid "" +"The CPython source tree contains :source:`a testbed project <iOS/testbed>` " +"that is used to run the CPython test suite on the iOS simulator. This " +"testbed can also be used as a testbed project for running your Python " +"library's test suite on iOS." +msgstr "" + +#: ../../using/ios.rst:336 +msgid "" +"After building or obtaining an iOS XCFramework (See :source:`iOS/README.rst` " +"for details), create a clone of the Python iOS testbed project by running:" +msgstr "" + +#: ../../using/ios.rst:339 +msgid "" +"$ python iOS/testbed clone --framework <path/to/Python.xcframework> --app " +"<path/to/module1> --app <path/to/module2> app-testbed" +msgstr "" + +#: ../../using/ios.rst:343 +msgid "" +"You will need to modify the ``iOS/testbed`` reference to point to that " +"directory in the CPython source tree; any folders specified with the ``--" +"app`` flag will be copied into the cloned testbed project. The resulting " +"testbed will be created in the ``app-testbed`` folder. In this example, the " +"``module1`` and ``module2`` would be importable modules at runtime. If your " +"project has additional dependencies, they can be installed into the ``app-" +"testbed/iOSTestbed/app_packages`` folder (using ``pip install --target app-" +"testbed/iOSTestbed/app_packages`` or similar)." +msgstr "" + +#: ../../using/ios.rst:352 +msgid "" +"You can then use the ``app-testbed`` folder to run the test suite for your " +"app, For example, if ``module1.tests`` was the entry point to your test " +"suite, you could run:" +msgstr "" + +#: ../../using/ios.rst:356 +msgid "$ python app-testbed run -- module1.tests" +msgstr "" + +#: ../../using/ios.rst:360 +msgid "" +"This is the equivalent of running ``python -m module1.tests`` on a desktop " +"Python build. Any arguments after the ``--`` will be passed to the testbed " +"as if they were arguments to ``python -m`` on a desktop machine." +msgstr "" + +#: ../../using/ios.rst:364 +msgid "You can also open the testbed project in Xcode by running:" +msgstr "" + +#: ../../using/ios.rst:366 +msgid "$ open app-testbed/iOSTestbed.xcodeproj" +msgstr "" + +#: ../../using/ios.rst:370 +msgid "This will allow you to use the full Xcode suite of tools for debugging." +msgstr "" + +#: ../../using/ios.rst:373 msgid "App Store Compliance" msgstr "" -#: ../../using/ios.rst:330 +#: ../../using/ios.rst:375 msgid "" "The only mechanism for distributing apps to third-party iOS devices is to " "submit the app to the iOS App Store; apps submitted for distribution must " @@ -548,7 +620,7 @@ msgid "" "problematic code." msgstr "" -#: ../../using/ios.rst:335 +#: ../../using/ios.rst:380 msgid "" "The Python standard library contains some code that is known to violate " "these automated rules. While these violations appear to be false positives, " @@ -556,7 +628,7 @@ msgid "" "Python standard library for an app to pass App Store review." msgstr "" -#: ../../using/ios.rst:340 +#: ../../using/ios.rst:385 msgid "" "The Python source tree contains :source:`a patch file <Mac/Resources/app-" "store-compliance.patch>` that will remove all code that is known to cause " diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 676d40f4b3..445a5f9898 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-15 18:10+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,7 +158,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:153 msgid "" -"Also, the :meth:`dict.iterkeys`, :meth:`dict.iteritems` and :meth:`dict." +"Also, the :meth:`!dict.iterkeys`, :meth:`!dict.iteritems` and :meth:`!dict." "itervalues` methods are no longer supported." msgstr "" @@ -185,7 +185,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:173 msgid "" -":func:`range` now behaves like :func:`xrange` used to behave, except it " +":func:`range` now behaves like :func:`!xrange` used to behave, except it " "works with values of arbitrary size. The latter no longer exists." msgstr "" @@ -215,18 +215,19 @@ msgstr "" #: ../../whatsnew/3.0.rst:195 msgid "" -":meth:`builtin.sorted` and :meth:`list.sort` no longer accept the *cmp* " -"argument providing a comparison function. Use the *key* argument instead. N." -"B. the *key* and *reverse* arguments are now \"keyword-only\"." +":meth:`sorted` and :meth:`list.sort` no longer accept the *cmp* argument " +"providing a comparison function. Use the *key* argument instead. N.B. the " +"*key* and *reverse* arguments are now \"keyword-only\"." msgstr "" #: ../../whatsnew/3.0.rst:200 msgid "" -"The :func:`cmp` function should be treated as gone, and the :meth:`__cmp__` " -"special method is no longer supported. Use :meth:`__lt__` for sorting, :" -"meth:`__eq__` with :meth:`__hash__`, and other rich comparisons as needed. " -"(If you really need the :func:`cmp` functionality, you could use the " -"expression ``(a > b) - (a < b)`` as the equivalent for ``cmp(a, b)``.)" +"The :func:`!cmp` function should be treated as gone, and the :meth:`!" +"__cmp__` special method is no longer supported. Use :meth:`~object.__lt__` " +"for sorting, :meth:`~object.__eq__` with :meth:`~object.__hash__`, and other " +"rich comparisons as needed. (If you really need the :func:`!cmp` " +"functionality, you could use the expression ``(a > b) - (a < b)`` as the " +"equivalent for ``cmp(a, b)``.)" msgstr "" #: ../../whatsnew/3.0.rst:207 @@ -235,9 +236,9 @@ msgstr "整數" #: ../../whatsnew/3.0.rst:209 msgid "" -":pep:`237`: Essentially, :class:`long` renamed to :class:`int`. That is, " +":pep:`237`: Essentially, :class:`!long` renamed to :class:`int`. That is, " "there is only one built-in integral type, named :class:`int`; but it behaves " -"mostly like the old :class:`long` type." +"mostly like the old :class:`!long` type." msgstr "" #: ../../whatsnew/3.0.rst:213 @@ -249,11 +250,11 @@ msgstr "" #: ../../whatsnew/3.0.rst:217 msgid "" -"The :data:`sys.maxint` constant was removed, since there is no longer a " +"The :data:`!sys.maxint` constant was removed, since there is no longer a " "limit to the value of integers. However, :data:`sys.maxsize` can be used as " "an integer larger than any practical list or string index. It conforms to " "the implementation's \"natural\" integer size and is typically the same as :" -"data:`sys.maxint` in previous releases on the same platform (assuming the " +"data:`!sys.maxint` in previous releases on the same platform (assuming the " "same build options)." msgstr "" @@ -298,7 +299,7 @@ msgid "" "uses Unicode, encodings or binary data most likely has to change. The " "change is for the better, as in the 2.x world there were numerous bugs " "having to do with mixing encoded and unencoded text. To be prepared in " -"Python 2.x, start using :class:`unicode` for all unencoded text, and :class:" +"Python 2.x, start using :class:`!unicode` for all unencoded text, and :class:" "`str` for binary or encoded data only. Then the ``2to3`` tool will do most " "of the work for you." msgstr "" @@ -323,7 +324,8 @@ msgid "" "Like :class:`str`, the :class:`bytes` type is immutable. There is a " "separate *mutable* type to hold buffered binary data, :class:`bytearray`. " "Nearly all APIs that accept :class:`bytes` also accept :class:`bytearray`. " -"The mutable API is based on :class:`collections.MutableSequence`." +"The mutable API is based on :class:`collections.MutableSequence <collections." +"abc.MutableSequence>`." msgstr "" #: ../../whatsnew/3.0.rst:274 @@ -338,10 +340,10 @@ msgstr "" #: ../../whatsnew/3.0.rst:281 msgid "" -"The built-in :class:`basestring` abstract type was removed. Use :class:" +"The built-in :class:`!basestring` abstract type was removed. Use :class:" "`str` instead. The :class:`str` and :class:`bytes` types don't have " "functionality enough in common to warrant a shared base class. The ``2to3`` " -"tool (see below) replaces every occurrence of :class:`basestring` with :" +"tool (see below) replaces every occurrence of :class:`!basestring` with :" "class:`str`." msgstr "" @@ -443,9 +445,9 @@ msgid "" ":pep:`3107`: Function argument and return value annotations. This provides " "a standardized way of annotating a function's parameters and return value. " "There are no semantics attached to such annotations except that they can be " -"introspected at runtime using the :attr:`~object.__annotations__` " -"attribute. The intent is to encourage experimentation through metaclasses, " -"decorators or frameworks." +"introspected at runtime using the :attr:`!__annotations__` attribute. The " +"intent is to encourage experimentation through metaclasses, decorators or " +"frameworks." msgstr "" #: ../../whatsnew/3.0.rst:363 @@ -571,7 +573,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:431 msgid "" -"The module-global :data:`__metaclass__` variable is no longer supported. " +"The module-global :data:`!__metaclass__` variable is no longer supported. " "(It was a crutch to make it easier to default to new-style classes without " "deriving every class from :class:`object`.)" msgstr "" @@ -715,15 +717,15 @@ msgid "" "and has additional keyword arguments *encoding*, *errors*, *newline* and " "*closefd*. Also note that an invalid *mode* argument now raises :exc:" "`ValueError`, not :exc:`IOError`. The binary file object underlying a text " -"file object can be accessed as :attr:`f.buffer` (but beware that the text " +"file object can be accessed as :attr:`!f.buffer` (but beware that the text " "object maintains a buffer of itself in order to speed up the encoding and " "decoding operations)." msgstr "" #: ../../whatsnew/3.0.rst:529 msgid "" -":ref:`pep-3118`. The old builtin :func:`buffer` is now really gone; the new " -"builtin :func:`memoryview` provides (mostly) similar functionality." +":ref:`pep-3118`. The old builtin :func:`!buffer` is now really gone; the " +"new builtin :func:`memoryview` provides (mostly) similar functionality." msgstr "" #: ../../whatsnew/3.0.rst:533 @@ -731,8 +733,9 @@ msgid "" ":ref:`pep-3119`. The :mod:`abc` module and the ABCs defined in the :mod:" "`collections` module plays a somewhat more prominent role in the language " "now, and built-in collection types like :class:`dict` and :class:`list` " -"conform to the :class:`collections.MutableMapping` and :class:`collections." -"MutableSequence` ABCs, respectively." +"conform to the :class:`collections.MutableMapping <collections.abc." +"MutableMapping>` and :class:`collections.MutableSequence <collections.abc." +"MutableSequence>` ABCs, respectively." msgstr "" #: ../../whatsnew/3.0.rst:539 @@ -905,10 +908,10 @@ msgstr "" #: ../../whatsnew/3.0.rst:615 msgid "" -":mod:`tkinter` (all :mod:`Tkinter`-related modules except :mod:`turtle`). " -"The target audience of :mod:`turtle` doesn't really care about :mod:" -"`tkinter`. Also note that as of Python 2.6, the functionality of :mod:" -"`turtle` has been greatly enhanced." +":mod:`tkinter` (all ``Tkinter``-related modules except :mod:`turtle`). The " +"target audience of :mod:`turtle` doesn't really care about :mod:`tkinter`. " +"Also note that as of Python 2.6, the functionality of :mod:`turtle` has been " +"greatly enhanced." msgstr "" #: ../../whatsnew/3.0.rst:620 @@ -938,24 +941,25 @@ msgstr "移除 :mod:`!sets`。請使用內建的 :func:`set` 類別。" #: ../../whatsnew/3.0.rst:631 msgid "" -"Cleanup of the :mod:`sys` module: removed :func:`sys.exitfunc`, :func:`sys." -"exc_clear`, :data:`sys.exc_type`, :data:`sys.exc_value`, :data:`sys." +"Cleanup of the :mod:`sys` module: removed :func:`!sys.exitfunc`, :func:`!sys." +"exc_clear`, :data:`!sys.exc_type`, :data:`!sys.exc_value`, :data:`!sys." "exc_traceback`. (Note that :data:`sys.last_type` etc. remain.)" msgstr "" #: ../../whatsnew/3.0.rst:636 msgid "" -"Cleanup of the :class:`array.array` type: the :meth:`read` and :meth:`write` " -"methods are gone; use :meth:`fromfile` and :meth:`tofile` instead. Also, " -"the ``'c'`` typecode for array is gone -- use either ``'b'`` for bytes or " -"``'u'`` for Unicode characters." +"Cleanup of the :class:`array.array` type: the :meth:`!read` and :meth:`!" +"write` methods are gone; use :meth:`~array.array.fromfile` and :meth:`~array." +"array.tofile` instead. Also, the ``'c'`` typecode for array is gone -- use " +"either ``'b'`` for bytes or ``'u'`` for Unicode characters." msgstr "" #: ../../whatsnew/3.0.rst:642 +#, fuzzy msgid "" -"Cleanup of the :mod:`operator` module: removed :func:`sequenceIncludes` and :" -"func:`isCallable`." -msgstr "" +"Cleanup of the :mod:`operator` module: removed :func:`!sequenceIncludes` " +"and :func:`!isCallable`." +msgstr "清理 :mod:`random` 模組:移除 :func:`jumpahead` API。" #: ../../whatsnew/3.0.rst:645 msgid "" @@ -965,7 +969,9 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:649 -msgid "Cleanup of the :mod:`random` module: removed the :func:`jumpahead` API." +#, fuzzy +msgid "" +"Cleanup of the :mod:`random` module: removed the :func:`!jumpahead` API." msgstr "清理 :mod:`random` 模組:移除 :func:`jumpahead` API。" #: ../../whatsnew/3.0.rst:651 @@ -974,8 +980,8 @@ msgstr "移除 :mod:`!new` 模組。" #: ../../whatsnew/3.0.rst:653 msgid "" -"The functions :func:`os.tmpnam`, :func:`os.tempnam` and :func:`os.tmpfile` " -"have been removed in favor of the :mod:`tempfile` module." +"The functions :func:`!os.tmpnam`, :func:`!os.tempnam` and :func:`!os." +"tmpfile` have been removed in favor of the :mod:`tempfile` module." msgstr "" #: ../../whatsnew/3.0.rst:657 @@ -986,19 +992,19 @@ msgstr "" #: ../../whatsnew/3.0.rst:661 msgid "" -":data:`string.letters` and its friends (:data:`string.lowercase` and :data:" -"`string.uppercase`) are gone. Use :data:`string.ascii_letters` etc. " -"instead. (The reason for the removal is that :data:`string.letters` and " +":data:`!string.letters` and its friends (:data:`!string.lowercase` and :data:" +"`!string.uppercase`) are gone. Use :data:`string.ascii_letters` etc. " +"instead. (The reason for the removal is that :data:`!string.letters` and " "friends had locale-specific behavior, which is a bad idea for such " "attractively named global \"constants\".)" msgstr "" #: ../../whatsnew/3.0.rst:668 msgid "" -"Renamed module :mod:`__builtin__` to :mod:`builtins` (removing the " -"underscores, adding an 's'). The :data:`__builtins__` variable found in " +"Renamed module :mod:`!__builtin__` to :mod:`builtins` (removing the " +"underscores, adding an 's'). The :data:`!__builtins__` variable found in " "most global namespaces is unchanged. To modify a builtin, you should use :" -"mod:`builtins`, not :data:`__builtins__`!" +"mod:`builtins`, not :data:`!__builtins__`!" msgstr "" #: ../../whatsnew/3.0.rst:675 @@ -1043,13 +1049,14 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:705 -msgid ":exc:`StandardError` was removed." +#, fuzzy +msgid ":exc:`!StandardError` was removed." msgstr ":exc:`StandardError` 被移除。" #: ../../whatsnew/3.0.rst:707 msgid "" -"Exceptions no longer behave as sequences. Use the :attr:`args` attribute " -"instead." +"Exceptions no longer behave as sequences. Use the :attr:`~BaseException." +"args` attribute instead." msgstr "" #: ../../whatsnew/3.0.rst:710 @@ -1135,10 +1142,10 @@ msgstr "" #: ../../whatsnew/3.0.rst:768 msgid "" -":meth:`__getslice__`, :meth:`__setslice__` and :meth:`__delslice__` were " +":meth:`!__getslice__`, :meth:`!__setslice__` and :meth:`!__delslice__` were " "killed. The syntax ``a[i:j]`` now translates to ``a.__getitem__(slice(i, " -"j))`` (or :meth:`__setitem__` or :meth:`__delitem__`, when used as an " -"assignment or deletion target, respectively)." +"j))`` (or :meth:`~object.__setitem__` or :meth:`~object.__delitem__`, when " +"used as an assignment or deletion target, respectively)." msgstr "" #: ../../whatsnew/3.0.rst:774 @@ -1149,13 +1156,14 @@ msgstr "" #: ../../whatsnew/3.0.rst:777 msgid "" -"The :meth:`__oct__` and :meth:`__hex__` special methods are removed -- :func:" -"`oct` and :func:`hex` use :meth:`__index__` now to convert the argument to " -"an integer." +"The :meth:`!__oct__` and :meth:`!__hex__` special methods are removed -- :" +"func:`oct` and :func:`hex` use :meth:`~object.__index__` now to convert the " +"argument to an integer." msgstr "" #: ../../whatsnew/3.0.rst:781 -msgid "Removed support for :attr:`__members__` and :attr:`__methods__`." +#, fuzzy +msgid "Removed support for :attr:`!__members__` and :attr:`!__methods__`." msgstr "移除對 :attr:`__members__` 和 :attr:`__methods__` 的支援。" #: ../../whatsnew/3.0.rst:783 @@ -1189,7 +1197,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:805 msgid "" -":pep:`3111`: :func:`raw_input` was renamed to :func:`input`. That is, the " +":pep:`3111`: :func:`!raw_input` was renamed to :func:`input`. That is, the " "new :func:`input` function reads a line from :data:`sys.stdin` and returns " "it with the trailing newline stripped. It raises :exc:`EOFError` if the " "input is terminated prematurely. To get the old behavior of :func:`input`, " @@ -1214,30 +1222,34 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:823 -msgid "Moved :func:`intern` to :func:`sys.intern`." +msgid "Moved :func:`!intern` to :func:`sys.intern`." msgstr "" #: ../../whatsnew/3.0.rst:825 +#, fuzzy msgid "" -"Removed: :func:`apply`. Instead of ``apply(f, args)`` use ``f(*args)``." +"Removed: :func:`!apply`. Instead of ``apply(f, args)`` use ``f(*args)``." msgstr "" +"移除 :func:`execfile`。請使用 ``exec(open(fn).read())`` 來替換 " +"``execfile(fn)``。" #: ../../whatsnew/3.0.rst:828 msgid "" "Removed :func:`callable`. Instead of ``callable(f)`` you can use " -"``isinstance(f, collections.Callable)``. The :func:`operator.isCallable` " +"``isinstance(f, collections.Callable)``. The :func:`!operator.isCallable` " "function is also gone." msgstr "" #: ../../whatsnew/3.0.rst:832 msgid "" -"Removed :func:`coerce`. This function no longer serves a purpose now that " +"Removed :func:`!coerce`. This function no longer serves a purpose now that " "classic classes are gone." msgstr "" #: ../../whatsnew/3.0.rst:835 +#, fuzzy msgid "" -"Removed :func:`execfile`. Instead of ``execfile(fn)`` use ``exec(open(fn)." +"Removed :func:`!execfile`. Instead of ``execfile(fn)`` use ``exec(open(fn)." "read())``." msgstr "" "移除 :func:`execfile`。請使用 ``exec(open(fn).read())`` 來替換 " @@ -1245,24 +1257,24 @@ msgstr "" #: ../../whatsnew/3.0.rst:838 msgid "" -"Removed the :class:`file` type. Use :func:`open`. There are now several " +"Removed the :class:`!file` type. Use :func:`open`. There are now several " "different kinds of streams that open can return in the :mod:`io` module." msgstr "" #: ../../whatsnew/3.0.rst:841 msgid "" -"Removed :func:`reduce`. Use :func:`functools.reduce` if you really need it; " -"however, 99 percent of the time an explicit :keyword:`for` loop is more " +"Removed :func:`!reduce`. Use :func:`functools.reduce` if you really need " +"it; however, 99 percent of the time an explicit :keyword:`for` loop is more " "readable." msgstr "" #: ../../whatsnew/3.0.rst:845 -msgid "Removed :func:`reload`. Use :func:`!imp.reload`." +msgid "Removed :func:`!reload`. Use :func:`!imp.reload`." msgstr "" #: ../../whatsnew/3.0.rst:847 msgid "" -"Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator instead." +"Removed. :meth:`!dict.has_key` -- use the :keyword:`in` operator instead." msgstr "" #: ../../whatsnew/3.0.rst:854 From e450235e20c103bb77378e7e1b15dbad5b331b4b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:20:55 +0000 Subject: [PATCH 11/14] sync with cpython aea2e03b --- c-api/object.po | 173 ++--- howto/argparse-optparse.po | 80 ++- howto/argparse.po | 317 ++++----- library/argparse.po | 761 +++++++++++----------- library/cmdlinelibs.po | 32 + library/enum.po | 414 ++++++------ library/filesys.po | 14 +- library/getopt.po | 114 ++-- library/itertools.po | 514 +++++++-------- library/optparse.po | 1221 ++++++++++++++++++++--------------- library/ssl.po | 11 +- library/superseded.po | 27 +- reference/compound_stmts.po | 846 ++++++++++++------------ whatsnew/3.13.po | 935 ++++++++++++++------------- 14 files changed, 2933 insertions(+), 2526 deletions(-) create mode 100644 library/cmdlinelibs.po diff --git a/c-api/object.po b/c-api/object.po index 5657a945c1..ae0f232382 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,19 +196,20 @@ msgstr "" #: ../../c-api/object.rst:113 msgid "" "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_HasAttrWithError`, :c:func:" -"`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead." +"`~object.__getattribute__` methods aren't propagated, but instead given to :" +"func:`sys.unraisablehook`. For proper error handling, use :c:func:" +"`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:" +"`PyObject_GetAttr` instead." msgstr "" -#: ../../c-api/object.rst:121 +#: ../../c-api/object.rst:122 msgid "" "This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/object.rst:127 +#: ../../c-api/object.rst:128 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" "`~object.__getattribute__` methods or while creating the temporary :class:" @@ -217,39 +218,39 @@ msgid "" "or :c:func:`PyObject_GetAttrString` instead." msgstr "" -#: ../../c-api/object.rst:137 +#: ../../c-api/object.rst:138 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:141 +#: ../../c-api/object.rst:142 msgid "" "If the missing attribute should not be treated as a failure, you can use :c:" "func:`PyObject_GetOptionalAttr` instead." msgstr "" -#: ../../c-api/object.rst:147 +#: ../../c-api/object.rst:148 msgid "" "This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/object.rst:151 +#: ../../c-api/object.rst:152 msgid "" "If the missing attribute should not be treated as a failure, you can use :c:" "func:`PyObject_GetOptionalAttrString` instead." msgstr "" -#: ../../c-api/object.rst:157 +#: ../../c-api/object.rst:158 msgid "" "Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:" "`AttributeError` if the attribute is not found." msgstr "" -#: ../../c-api/object.rst:160 +#: ../../c-api/object.rst:161 msgid "" "If the attribute is found, return ``1`` and set *\\*result* to a new :term:" "`strong reference` to the attribute. If the attribute is not found, return " @@ -258,14 +259,14 @@ msgid "" "``-1`` and set *\\*result* to ``NULL``." msgstr "" -#: ../../c-api/object.rst:172 +#: ../../c-api/object.rst:173 msgid "" "This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is " "specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " "a :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/object.rst:180 +#: ../../c-api/object.rst:181 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 " @@ -275,34 +276,34 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:190 +#: ../../c-api/object.rst:191 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:195 +#: ../../c-api/object.rst:196 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:202 +#: ../../c-api/object.rst:203 msgid "" "This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/object.rst:206 +#: ../../c-api/object.rst:207 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:209 +#: ../../c-api/object.rst:210 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " @@ -312,7 +313,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/object.rst:219 +#: ../../c-api/object.rst:220 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 " @@ -324,20 +325,20 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:231 +#: ../../c-api/object.rst:232 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:237 +#: ../../c-api/object.rst:238 msgid "" "This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/object.rst:241 +#: ../../c-api/object.rst:242 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " @@ -347,13 +348,13 @@ msgid "" "internally to create a key object for lookup." msgstr "" -#: ../../c-api/object.rst:252 +#: ../../c-api/object.rst:253 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " "creates the dictionary if necessary." msgstr "" -#: ../../c-api/object.rst:255 +#: ../../c-api/object.rst:256 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 " @@ -362,30 +363,30 @@ msgid "" "the object." msgstr "" -#: ../../c-api/object.rst:261 +#: ../../c-api/object.rst:262 msgid "On failure, returns ``NULL`` with an exception set." msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。" -#: ../../c-api/object.rst:268 +#: ../../c-api/object.rst:269 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:276 +#: ../../c-api/object.rst:277 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:279 +#: ../../c-api/object.rst:280 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:286 +#: ../../c-api/object.rst:287 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" @@ -396,33 +397,33 @@ msgid "" "success, or ``NULL`` on failure." msgstr "" -#: ../../c-api/object.rst:296 +#: ../../c-api/object.rst:297 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if " "the result is false, ``1`` otherwise." msgstr "" -#: ../../c-api/object.rst:301 +#: ../../c-api/object.rst:302 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " "will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:306 +#: ../../c-api/object.rst:307 msgid "" "Format *obj* using *format_spec*. This is equivalent to the Python " "expression ``format(obj, format_spec)``." msgstr "" -#: ../../c-api/object.rst:309 +#: ../../c-api/object.rst:310 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:317 +#: ../../c-api/object.rst:318 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -430,13 +431,13 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:321 ../../c-api/object.rst:345 +#: ../../c-api/object.rst:322 ../../c-api/object.rst:346 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:329 +#: ../../c-api/object.rst:330 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:" @@ -445,7 +446,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:340 +#: ../../c-api/object.rst:341 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -453,7 +454,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:354 +#: ../../c-api/object.rst:355 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 " @@ -462,20 +463,20 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:363 +#: ../../c-api/object.rst:364 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:366 ../../c-api/object.rst:385 +#: ../../c-api/object.rst:367 ../../c-api/object.rst:386 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:370 +#: ../../c-api/object.rst:371 msgid "" "If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -483,52 +484,52 @@ msgid "" "e. contained in :attr:`cls.__mro__ <type.__mro__>`." msgstr "" -#: ../../c-api/object.rst:375 +#: ../../c-api/object.rst:376 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:`~type.__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:382 +#: ../../c-api/object.rst:383 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:389 +#: ../../c-api/object.rst:390 msgid "" "If *cls* has a :meth:`~type.__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:393 +#: ../../c-api/object.rst:394 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`~object.__class__` attribute." msgstr "" -#: ../../c-api/object.rst:396 +#: ../../c-api/object.rst:397 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`~type.__bases__` attribute (which must be a " "tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:405 +#: ../../c-api/object.rst:406 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:408 +#: ../../c-api/object.rst:409 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:415 +#: ../../c-api/object.rst:416 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 " @@ -536,21 +537,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:423 +#: ../../c-api/object.rst:424 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:430 +#: ../../c-api/object.rst:431 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:439 +#: ../../c-api/object.rst:440 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 " @@ -561,13 +562,13 @@ msgid "" "when a new :term:`strong reference` is needed." msgstr "" -#: ../../c-api/object.rst:451 +#: ../../c-api/object.rst:452 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:460 +#: ../../c-api/object.rst:461 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, " @@ -575,7 +576,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:467 +#: ../../c-api/object.rst:468 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 " @@ -584,26 +585,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:477 +#: ../../c-api/object.rst:478 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:483 +#: ../../c-api/object.rst:484 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:491 +#: ../../c-api/object.rst:492 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:497 +#: ../../c-api/object.rst:498 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -613,7 +614,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:506 +#: ../../c-api/object.rst:507 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 " @@ -621,14 +622,14 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:514 +#: ../../c-api/object.rst:515 msgid "" "This is equivalent to the Python ``__iter__(self): return self`` method. It " "is intended for :term:`iterator` types, to be used in the :c:member:" "`PyTypeObject.tp_iter` slot." msgstr "" -#: ../../c-api/object.rst:520 +#: ../../c-api/object.rst:521 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -637,104 +638,104 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:530 +#: ../../c-api/object.rst:531 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:532 +#: ../../c-api/object.rst:533 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:536 +#: ../../c-api/object.rst:537 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:542 +#: ../../c-api/object.rst:543 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:545 +#: ../../c-api/object.rst:546 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "<PyType_Spec.basicsize>`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:548 +#: ../../c-api/object.rst:549 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:552 +#: ../../c-api/object.rst:553 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:558 +#: ../../c-api/object.rst:559 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:561 +#: ../../c-api/object.rst:562 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: ../../c-api/object.rst:569 +#: ../../c-api/object.rst:570 msgid "Visit the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:571 ../../c-api/object.rst:580 +#: ../../c-api/object.rst:572 ../../c-api/object.rst:581 msgid "" "This function must only be called in a traverse function of the type which " "has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" -#: ../../c-api/object.rst:578 +#: ../../c-api/object.rst:579 msgid "Clear the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:315 ../../c-api/object.rst:327 -#: ../../c-api/object.rst:352 ../../c-api/object.rst:403 -#: ../../c-api/object.rst:437 ../../c-api/object.rst:458 +#: ../../c-api/object.rst:316 ../../c-api/object.rst:328 +#: ../../c-api/object.rst:353 ../../c-api/object.rst:404 +#: ../../c-api/object.rst:438 ../../c-api/object.rst:459 msgid "built-in function" msgstr "bulit-in function(內建函式)" -#: ../../c-api/object.rst:315 +#: ../../c-api/object.rst:316 msgid "repr" msgstr "repr" -#: ../../c-api/object.rst:327 +#: ../../c-api/object.rst:328 msgid "ascii" msgstr "ascii" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:336 msgid "string" msgstr "string(字串)" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:336 msgid "PyObject_Str (C function)" msgstr "PyObject_Str(C 函式)" -#: ../../c-api/object.rst:352 +#: ../../c-api/object.rst:353 msgid "bytes" msgstr "bytes(位元組)" -#: ../../c-api/object.rst:403 +#: ../../c-api/object.rst:404 msgid "hash" msgstr "hash(雜湊)" -#: ../../c-api/object.rst:437 +#: ../../c-api/object.rst:438 msgid "type" msgstr "type(型別)" -#: ../../c-api/object.rst:458 +#: ../../c-api/object.rst:459 msgid "len" msgstr "len" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index 550beb2efd..a2e3055353 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,61 +17,77 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../howto/argparse-optparse.rst:7 -msgid "Upgrading optparse code" +#: ../../howto/argparse-optparse.rst:8 +msgid "Migrating ``optparse`` code to ``argparse``" msgstr "" -#: ../../howto/argparse-optparse.rst:9 +#: ../../howto/argparse-optparse.rst:10 msgid "" -"Originally, the :mod:`argparse` module had attempted to maintain " -"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " -"to extend transparently, particularly with the changes required to support " -"``nargs=`` specifiers and better usage messages. When most everything in :" -"mod:`optparse` had either been copy-pasted over or monkey-patched, it no " -"longer seemed practical to try to maintain the backwards compatibility." +"The :mod:`argparse` module offers several higher level features not natively " +"provided by the :mod:`optparse` module, including:" msgstr "" -#: ../../howto/argparse-optparse.rst:16 -msgid "" -"The :mod:`argparse` module improves on the :mod:`optparse` module in a " -"number of ways including:" -msgstr "" - -#: ../../howto/argparse-optparse.rst:19 +#: ../../howto/argparse-optparse.rst:13 msgid "Handling positional arguments." msgstr "" -#: ../../howto/argparse-optparse.rst:20 +#: ../../howto/argparse-optparse.rst:14 msgid "Supporting subcommands." msgstr "" -#: ../../howto/argparse-optparse.rst:21 +#: ../../howto/argparse-optparse.rst:15 msgid "Allowing alternative option prefixes like ``+`` and ``/``." msgstr "" -#: ../../howto/argparse-optparse.rst:22 +#: ../../howto/argparse-optparse.rst:16 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" -#: ../../howto/argparse-optparse.rst:23 +#: ../../howto/argparse-optparse.rst:17 msgid "Producing more informative usage messages." msgstr "" -#: ../../howto/argparse-optparse.rst:24 +#: ../../howto/argparse-optparse.rst:18 msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" -#: ../../howto/argparse-optparse.rst:26 -msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" +#: ../../howto/argparse-optparse.rst:20 +msgid "" +"Originally, the :mod:`argparse` module attempted to maintain compatibility " +"with :mod:`optparse`. However, the fundamental design differences between " +"supporting declarative command line option processing (while leaving " +"positional argument processing to application code), and supporting both " +"named options and positional arguments in the declarative interface mean " +"that the API has diverged from that of ``optparse`` over time." +msgstr "" + +#: ../../howto/argparse-optparse.rst:27 +msgid "" +"As described in :ref:`choosing-an-argument-parser`, applications that are " +"currently using :mod:`optparse` and are happy with the way it works can just " +"continue to use ``optparse``." msgstr "" -#: ../../howto/argparse-optparse.rst:28 +#: ../../howto/argparse-optparse.rst:31 +msgid "" +"Application developers that are considering migrating should also review the " +"list of intrinsic behavioural differences described in that section before " +"deciding whether or not migration is desirable." +msgstr "" + +#: ../../howto/argparse-optparse.rst:35 +msgid "" +"For applications that do choose to migrate from :mod:`optparse` to :mod:" +"`argparse`, the following suggestions should be helpful:" +msgstr "" + +#: ../../howto/argparse-optparse.rst:38 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" -#: ../../howto/argparse-optparse.rst:31 +#: ../../howto/argparse-optparse.rst:41 msgid "" "Replace ``(options, args) = parser.parse_args()`` with ``args = parser." "parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " @@ -79,39 +95,39 @@ msgid "" "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -#: ../../howto/argparse-optparse.rst:36 +#: ../../howto/argparse-optparse.rst:46 msgid "" "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" -#: ../../howto/argparse-optparse.rst:40 +#: ../../howto/argparse-optparse.rst:50 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" -#: ../../howto/argparse-optparse.rst:43 +#: ../../howto/argparse-optparse.rst:53 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -#: ../../howto/argparse-optparse.rst:46 +#: ../../howto/argparse-optparse.rst:56 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" -#: ../../howto/argparse-optparse.rst:50 +#: ../../howto/argparse-optparse.rst:60 msgid "" "Replace strings with implicit arguments such as ``%default`` or ``%prog`` " "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" -#: ../../howto/argparse-optparse.rst:54 +#: ../../howto/argparse-optparse.rst:64 msgid "" "Replace the OptionParser constructor ``version`` argument with a call to " "``parser.add_argument('--version', action='version', version='<the " diff --git a/howto/argparse.po b/howto/argparse.po index 1c399843a2..6681c8f583 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2023-12-11 17:33+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,27 +46,30 @@ msgstr "" #: ../../howto/argparse.rst:16 msgid "" -"There are two other modules that fulfill the same task, namely :mod:`getopt` " -"(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." +"The standard library includes two other libraries directly related to " +"command-line parameter processing: the lower level :mod:`optparse` module " +"(which may require more code to configure for a given application, but also " +"allows an application to request behaviors that ``argparse`` doesn't " +"support), and the very low level :mod:`getopt` (which specifically serves as " +"an equivalent to the :c:func:`!getopt` family of functions available to C " +"programmers). While neither of those modules is covered directly in this " +"guide, many of the core concepts in ``argparse`` first originated in " +"``optparse``, so some aspects of this tutorial will also be relevant to " +"``optparse`` users." msgstr "" -"另外還有兩個模組可以完成相同的任務,即 :mod:`getopt`\\ (相當於 C 語言中的 " -"``getopt()``)和已棄用的 :mod:`optparse`。另請注意,:mod:`argparse` 是基於 :" -"mod:`optparse` 的,因此在用法上非常相似。" -#: ../../howto/argparse.rst:24 +#: ../../howto/argparse.rst:29 msgid "Concepts" msgstr "概念" -#: ../../howto/argparse.rst:26 +#: ../../howto/argparse.rst:31 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:29 +#: ../../howto/argparse.rst:34 msgid "" "$ ls\n" "cpython devguide prog.py pypy rm-unused-function.patch\n" @@ -102,11 +105,11 @@ msgstr "" "Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" "..." -#: ../../howto/argparse.rst:48 +#: ../../howto/argparse.rst:53 msgid "A few concepts we can learn from the four commands:" msgstr "我們可以從這四個命令中學到一些概念:" -#: ../../howto/argparse.rst:50 +#: ../../howto/argparse.rst:55 msgid "" "The :command:`ls` command is useful when run without any options at all. It " "defaults to displaying the contents of the current directory." @@ -114,7 +117,7 @@ msgstr "" ":command:`ls` 命令即便在沒有任何選項的情況下執行仍非常有用。它預設顯示目前目" "錄的內容。" -#: ../../howto/argparse.rst:53 +#: ../../howto/argparse.rst:58 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 " @@ -131,7 +134,7 @@ msgstr "" "command:`cp` 這樣的指令更相關,其最基本的用法是 ``cp SRC DEST``。第一個是\\ *" "你想要複製的位置*,第二個是\\ *你想要複製過去的位置*。" -#: ../../howto/argparse.rst:62 +#: ../../howto/argparse.rst:67 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 " @@ -140,7 +143,7 @@ msgstr "" "現在假設我們想要改變程式的行為。在我們的範例中,我們顯示每個檔案的更多資訊," "而不僅是顯示檔案名稱。在這種情況下,``-l`` 被稱為可選引數。" -#: ../../howto/argparse.rst:66 +#: ../../howto/argparse.rst:71 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 " @@ -149,15 +152,15 @@ msgstr "" "這是幫助文字的片段。它非常有用,因為當你遇到以前從未使用過的程式時,只需閱讀" "其幫助文字即可了解它的工作原理。" -#: ../../howto/argparse.rst:72 +#: ../../howto/argparse.rst:77 msgid "The basics" msgstr "基本用法" -#: ../../howto/argparse.rst:74 +#: ../../howto/argparse.rst:79 msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "讓我們從一個非常簡單的例子開始,它(幾乎)什麼都不做: ::" -#: ../../howto/argparse.rst:76 +#: ../../howto/argparse.rst:81 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -167,12 +170,12 @@ msgstr "" "parser = argparse.ArgumentParser()\n" "parser.parse_args()" -#: ../../howto/argparse.rst:80 ../../howto/argparse.rst:188 -#: ../../howto/argparse.rst:209 +#: ../../howto/argparse.rst:85 ../../howto/argparse.rst:193 +#: ../../howto/argparse.rst:214 msgid "Following is a result of running the code:" msgstr "程式碼執行結果如下:" -#: ../../howto/argparse.rst:82 +#: ../../howto/argparse.rst:87 msgid "" "$ python prog.py\n" "$ python prog.py --help\n" @@ -200,18 +203,18 @@ msgstr "" "usage: prog.py [-h]\n" "prog.py: error: unrecognized arguments: foo" -#: ../../howto/argparse.rst:97 ../../howto/argparse.rst:254 -#: ../../howto/argparse.rst:298 +#: ../../howto/argparse.rst:102 ../../howto/argparse.rst:259 +#: ../../howto/argparse.rst:303 msgid "Here is what is happening:" msgstr "這是發生的事情:" -#: ../../howto/argparse.rst:99 +#: ../../howto/argparse.rst:104 msgid "" "Running the script without any options results in nothing displayed to " "stdout. Not so useful." msgstr "執行不帶任何選項的腳本不會在標準輸出中顯示任何內容。不太有用。" -#: ../../howto/argparse.rst:102 +#: ../../howto/argparse.rst:107 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." @@ -219,7 +222,7 @@ msgstr "" "第二個開始能夠顯現 :mod:`argparse` 模組的有用之處。我們幾乎什麼也沒做,但我們" "已經收到了一個很好的幫助訊息。" -#: ../../howto/argparse.rst:105 +#: ../../howto/argparse.rst:110 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 " @@ -230,15 +233,15 @@ msgstr "" "它)。指定任何其他內容都會導致錯誤。但即便如此,我們也還是輕鬆地獲得了有用的" "使用資訊。" -#: ../../howto/argparse.rst:112 +#: ../../howto/argparse.rst:117 msgid "Introducing Positional arguments" msgstr "位置引數的介紹" -#: ../../howto/argparse.rst:114 +#: ../../howto/argparse.rst:119 msgid "An example::" msgstr "例如: ::" -#: ../../howto/argparse.rst:116 +#: ../../howto/argparse.rst:121 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -252,11 +255,11 @@ msgstr "" "args = parser.parse_args()\n" "print(args.echo)" -#: ../../howto/argparse.rst:122 +#: ../../howto/argparse.rst:127 msgid "And running the code:" msgstr "執行這段程式碼:" -#: ../../howto/argparse.rst:124 +#: ../../howto/argparse.rst:129 msgid "" "$ python prog.py\n" "usage: prog.py [-h] echo\n" @@ -286,11 +289,11 @@ msgstr "" "$ python prog.py foo\n" "foo" -#: ../../howto/argparse.rst:140 +#: ../../howto/argparse.rst:145 msgid "Here is what's happening:" msgstr "這是會發生的事情:" -#: ../../howto/argparse.rst:142 +#: ../../howto/argparse.rst:147 msgid "" "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 " @@ -300,11 +303,11 @@ msgstr "" "我們新增了 :meth:`~ArgumentParser.add_argument` 方法,我們用它來指定程式願意" "接受哪些命令列選項。在本例中,我將其命名為 ``echo``,以便與其功能一致。" -#: ../../howto/argparse.rst:146 +#: ../../howto/argparse.rst:151 msgid "Calling our program now requires us to specify an option." msgstr "現在呼叫我們的程式時需要指定一個選項。" -#: ../../howto/argparse.rst:148 +#: ../../howto/argparse.rst:153 msgid "" "The :meth:`~ArgumentParser.parse_args` method actually returns some data " "from the options specified, in this case, ``echo``." @@ -312,7 +315,7 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` 方法實際上從指定的選項中回傳一些資料,在本" "例中為 ``echo``。" -#: ../../howto/argparse.rst:151 +#: ../../howto/argparse.rst:156 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 " @@ -322,7 +325,7 @@ msgstr "" "該變數是某種形式的「魔法」,:mod:`argparse` 可以自由執行(即無需指定該值儲存" "在哪個變數中)。你還會注意到,它的名稱與提供給方法 ``echo`` 的字串引數相符。" -#: ../../howto/argparse.rst:156 +#: ../../howto/argparse.rst:161 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 " @@ -334,7 +337,7 @@ msgstr "" "看到 ``echo`` 作為位置引數,但除了猜測或閱讀原始程式碼之外,我們不知道它的作" "用。那麼,我們來讓它變得更有用一點: ::" -#: ../../howto/argparse.rst:161 +#: ../../howto/argparse.rst:166 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -348,11 +351,11 @@ msgstr "" "args = parser.parse_args()\n" "print(args.echo)" -#: ../../howto/argparse.rst:167 +#: ../../howto/argparse.rst:172 msgid "And we get:" msgstr "然後我們得到:" -#: ../../howto/argparse.rst:169 +#: ../../howto/argparse.rst:174 msgid "" "$ python prog.py -h\n" "usage: prog.py [-h] echo\n" @@ -372,11 +375,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../howto/argparse.rst:180 +#: ../../howto/argparse.rst:185 msgid "Now, how about doing something even more useful::" msgstr "現在來做一些更有用處的事情: ::" -#: ../../howto/argparse.rst:182 +#: ../../howto/argparse.rst:187 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -392,7 +395,7 @@ msgstr "" "args = parser.parse_args()\n" "print(args.square**2)" -#: ../../howto/argparse.rst:190 +#: ../../howto/argparse.rst:195 msgid "" "$ python prog.py 4\n" "Traceback (most recent call last):\n" @@ -406,7 +409,7 @@ msgstr "" " print(args.square**2)\n" "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" -#: ../../howto/argparse.rst:198 +#: ../../howto/argparse.rst:203 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:" @@ -415,7 +418,7 @@ msgstr "" "進展不太順利。這是因為,除非我們另有說明,:mod:`argparse` 會將我們給它的選項" "視為字串。因此,讓我們告訴 :mod:`argparse` 將該輸入視為整數: ::" -#: ../../howto/argparse.rst:202 +#: ../../howto/argparse.rst:207 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -433,7 +436,7 @@ msgstr "" "args = parser.parse_args()\n" "print(args.square**2)" -#: ../../howto/argparse.rst:211 +#: ../../howto/argparse.rst:216 msgid "" "$ python prog.py 4\n" "16\n" @@ -447,23 +450,23 @@ msgstr "" "usage: prog.py [-h] square\n" "prog.py: error: argument square: invalid int value: 'four'" -#: ../../howto/argparse.rst:219 +#: ../../howto/argparse.rst:224 msgid "" "That went well. The program now even helpfully quits on bad illegal input " "before proceeding." msgstr "順利進展。現在該程式甚至可以在繼續操作之前因錯誤的非法輸入而退出。" -#: ../../howto/argparse.rst:224 +#: ../../howto/argparse.rst:229 msgid "Introducing Optional arguments" msgstr "可選引數的介紹" -#: ../../howto/argparse.rst:226 +#: ../../howto/argparse.rst:231 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:229 +#: ../../howto/argparse.rst:234 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -479,12 +482,12 @@ msgstr "" "if args.verbosity:\n" " print(\"verbosity turned on\")" -#: ../../howto/argparse.rst:236 ../../howto/argparse.rst:282 -#: ../../howto/argparse.rst:398 ../../howto/argparse.rst:432 +#: ../../howto/argparse.rst:241 ../../howto/argparse.rst:287 +#: ../../howto/argparse.rst:403 ../../howto/argparse.rst:437 msgid "And the output:" msgstr "接者是結果:" -#: ../../howto/argparse.rst:238 +#: ../../howto/argparse.rst:243 msgid "" "$ python prog.py --verbosity 1\n" "verbosity turned on\n" @@ -514,7 +517,7 @@ msgstr "" "usage: prog.py [-h] [--verbosity VERBOSITY]\n" "prog.py: error: argument --verbosity: expected one argument" -#: ../../howto/argparse.rst:256 +#: ../../howto/argparse.rst:261 msgid "" "The program is written so as to display something when ``--verbosity`` is " "specified and display nothing when not." @@ -522,7 +525,7 @@ msgstr "" "程式被編寫為在指定 ``--verbosity`` 時顯示一些內容,並在未指定時不顯示任何內" "容。" -#: ../../howto/argparse.rst:259 +#: ../../howto/argparse.rst:264 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 " @@ -534,17 +537,17 @@ msgstr "" "情況下,如果未使用可選引數,則相關變數(在本例中為 ``args.verbosity``)將被賦" "予 ``None`` 作為值,這就是它未能通過 :keyword:`if` 陳述式真值測試的原因。" -#: ../../howto/argparse.rst:265 +#: ../../howto/argparse.rst:270 msgid "The help message is a bit different." msgstr "幫助訊息有點不同。" -#: ../../howto/argparse.rst:267 +#: ../../howto/argparse.rst:272 msgid "" "When using the ``--verbosity`` option, one must also specify some value, any " "value." msgstr "當使用 ``--verbosity`` 選項時必須要指定一些值,任何值都可以。" -#: ../../howto/argparse.rst:270 +#: ../../howto/argparse.rst:275 msgid "" "The above example accepts arbitrary integer values for ``--verbosity``, but " "for our simple program, only two values are actually useful, ``True`` or " @@ -553,7 +556,7 @@ msgstr "" "在上面的例子中,``--verbosity`` 接受任意的整數,但對我們的程式來說只接受兩個" "輸入值, ``True`` 或 ``False``。所以我們來修改一下程式碼使其符合: ::" -#: ../../howto/argparse.rst:274 +#: ../../howto/argparse.rst:279 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -571,7 +574,7 @@ msgstr "" "if args.verbose:\n" " print(\"verbosity turned on\")" -#: ../../howto/argparse.rst:284 +#: ../../howto/argparse.rst:289 msgid "" "$ python prog.py --verbose\n" "verbosity turned on\n" @@ -597,7 +600,7 @@ msgstr "" " -h, --help show this help message and exit\n" " --verbose increase output verbosity" -#: ../../howto/argparse.rst:300 +#: ../../howto/argparse.rst:305 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 " @@ -610,21 +613,21 @@ msgstr "" "``\"store_true\"``。這意味著,如果指定了該選項,則將值 ``True`` 指派給 " "``args.verbose``。不指定它代表為 ``False``。" -#: ../../howto/argparse.rst:307 +#: ../../howto/argparse.rst:312 msgid "" "It complains when you specify a value, in true spirit of what flags actually " "are." msgstr "當你指定一個值時,它會本著旗標的實際精神來抱怨。" -#: ../../howto/argparse.rst:310 +#: ../../howto/argparse.rst:315 msgid "Notice the different help text." msgstr "請注意不同的幫助文字。" -#: ../../howto/argparse.rst:314 +#: ../../howto/argparse.rst:319 msgid "Short options" msgstr "短選項" -#: ../../howto/argparse.rst:316 +#: ../../howto/argparse.rst:321 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 " @@ -632,7 +635,7 @@ msgid "" msgstr "" "如果你熟悉命令列用法,你會注意到我尚未提及選項的簡短版本。這很簡單: ::" -#: ../../howto/argparse.rst:320 +#: ../../howto/argparse.rst:325 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -652,11 +655,11 @@ msgstr "" "if args.verbose:\n" " print(\"verbosity turned on\")" -#: ../../howto/argparse.rst:328 +#: ../../howto/argparse.rst:333 msgid "And here goes:" msgstr "而這為:" -#: ../../howto/argparse.rst:330 +#: ../../howto/argparse.rst:335 msgid "" "$ python prog.py -v\n" "verbosity turned on\n" @@ -676,19 +679,19 @@ msgstr "" " -h, --help show this help message and exit\n" " -v, --verbose increase output verbosity" -#: ../../howto/argparse.rst:341 +#: ../../howto/argparse.rst:346 msgid "Note that the new ability is also reflected in the help text." msgstr "請注意,新功能也反映在幫助文字中。" -#: ../../howto/argparse.rst:345 +#: ../../howto/argparse.rst:350 msgid "Combining Positional and Optional arguments" msgstr "組合位置引數和可選引數" -#: ../../howto/argparse.rst:347 +#: ../../howto/argparse.rst:352 msgid "Our program keeps growing in complexity::" msgstr "我們的程式的複雜性不斷增加: ::" -#: ../../howto/argparse.rst:349 +#: ../../howto/argparse.rst:354 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -716,11 +719,11 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:362 +#: ../../howto/argparse.rst:367 msgid "And now the output:" msgstr "然後現在的輸出結果:" -#: ../../howto/argparse.rst:364 +#: ../../howto/argparse.rst:369 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] square\n" @@ -742,15 +745,15 @@ msgstr "" "$ python prog.py --verbose 4\n" "the square of 4 equals 16" -#: ../../howto/argparse.rst:376 +#: ../../howto/argparse.rst:381 msgid "We've brought back a positional argument, hence the complaint." msgstr "我們帶回了位置引數,因而被抱怨。" -#: ../../howto/argparse.rst:378 +#: ../../howto/argparse.rst:383 msgid "Note that the order does not matter." msgstr "請注意,順序並不重要。" -#: ../../howto/argparse.rst:380 +#: ../../howto/argparse.rst:385 msgid "" "How about we give this program of ours back the ability to have multiple " "verbosity values, and actually get to use them::" @@ -758,7 +761,7 @@ msgstr "" "我們讓這個程式擁有多個訊息詳細級別 (verbosity) 之值的能力,並實際使用它" "們: ::" -#: ../../howto/argparse.rst:383 +#: ../../howto/argparse.rst:388 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -790,7 +793,7 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:400 +#: ../../howto/argparse.rst:405 msgid "" "$ python prog.py 4\n" "16\n" @@ -816,7 +819,7 @@ msgstr "" "$ python prog.py 4 -v 3\n" "16" -#: ../../howto/argparse.rst:414 +#: ../../howto/argparse.rst:419 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 " @@ -825,7 +828,7 @@ msgstr "" "除了最後一個外都看起來正常,它透露了我們程式中的一個錯誤。我們可透過限制 ``--" "verbosity`` 選項可以接受的值來修復它: ::" -#: ../../howto/argparse.rst:417 +#: ../../howto/argparse.rst:422 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -857,7 +860,7 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:434 +#: ../../howto/argparse.rst:439 #, fuzzy msgid "" "$ python prog.py 4 -v 3\n" @@ -890,13 +893,13 @@ msgstr "" " -v {0,1,2}, --verbosity {0,1,2}\n" " increase output verbosity" -#: ../../howto/argparse.rst:450 +#: ../../howto/argparse.rst:455 msgid "" "Note that the change also reflects both in the error message as well as the " "help string." msgstr "請注意,更改也會反映在錯誤訊息和幫助字串中。" -#: ../../howto/argparse.rst:453 +#: ../../howto/argparse.rst:458 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 " @@ -905,7 +908,7 @@ msgstr "" "現在,讓我們使用另一種常見方法來玩玩訊息詳細級別。它也與 CPython 執行檔處理其" "自身訊息詳細級別引數的方式相符(請見 ``python --help`` 的輸出): ::" -#: ../../howto/argparse.rst:457 +#: ../../howto/argparse.rst:462 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -937,13 +940,13 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:472 +#: ../../howto/argparse.rst:477 msgid "" "We have introduced another action, \"count\", to count the number of " "occurrences of specific options." msgstr "我們已經介紹過另一個操作 \"count\" 用來計算指定的選項出現的次數。" -#: ../../howto/argparse.rst:476 +#: ../../howto/argparse.rst:481 msgid "" "$ python prog.py 4\n" "16\n" @@ -991,7 +994,7 @@ msgstr "" "$ python prog.py 4 -vvv\n" "16" -#: ../../howto/argparse.rst:501 +#: ../../howto/argparse.rst:506 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." @@ -999,29 +1002,29 @@ msgstr "" "是的,現在它更像是我們上一版腳本中的旗標(類似於 " "``action=\"store_true\"``),這應該可以解釋抱怨的原因。" -#: ../../howto/argparse.rst:504 +#: ../../howto/argparse.rst:509 msgid "It also behaves similar to \"store_true\" action." msgstr "它的行為也類似 \"store_true\" 操作。" -#: ../../howto/argparse.rst:506 +#: ../../howto/argparse.rst:511 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:509 +#: ../../howto/argparse.rst:514 msgid "" "And if you don't specify the ``-v`` flag, that flag is considered to have " "``None`` value." msgstr "如果你不指定 ``-v`` 旗標,則該旗標被視為具有 ``None`` 值。" -#: ../../howto/argparse.rst:512 +#: ../../howto/argparse.rst:517 msgid "" "As should be expected, specifying the long form of the flag, we should get " "the same output." msgstr "正如預期的那樣,指定長形式旗標,我們應該得到相同的輸出。" -#: ../../howto/argparse.rst:515 +#: ../../howto/argparse.rst:520 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 " @@ -1030,15 +1033,15 @@ msgstr "" "遺憾的是,我們的幫助輸出對於我們腳本獲得的新功能並沒有提供太多資訊,但我們都" "可以透過改進腳本的文件來解決這個問題(例如:透過 ``help`` 關鍵字引數)。" -#: ../../howto/argparse.rst:519 +#: ../../howto/argparse.rst:524 msgid "That last output exposes a bug in our program." msgstr "最後的輸出透露了我們程式中的一個錯誤。" -#: ../../howto/argparse.rst:522 +#: ../../howto/argparse.rst:527 msgid "Let's fix::" msgstr "讓我們來解決問題: ::" -#: ../../howto/argparse.rst:524 +#: ../../howto/argparse.rst:529 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -1074,11 +1077,11 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:541 +#: ../../howto/argparse.rst:546 msgid "And this is what it gives:" msgstr "這就是它給出的:" -#: ../../howto/argparse.rst:543 +#: ../../howto/argparse.rst:548 msgid "" "$ python prog.py 4 -vvv\n" "the square of 4 equals 16\n" @@ -1100,7 +1103,7 @@ msgstr "" " if args.verbosity >= 2:\n" "TypeError: '>=' not supported between instances of 'NoneType' and 'int'" -#: ../../howto/argparse.rst:556 +#: ../../howto/argparse.rst:561 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." @@ -1108,15 +1111,15 @@ msgstr "" "第一次輸出順利進行,並修復了我們之前遇到的錯誤。也就是說,我們希望任何 >= 2 " "的值都盡可能詳細。" -#: ../../howto/argparse.rst:559 +#: ../../howto/argparse.rst:564 msgid "Third output not so good." msgstr "第三個輸出不太好。" -#: ../../howto/argparse.rst:561 +#: ../../howto/argparse.rst:566 msgid "Let's fix that bug::" msgstr "我們來修復這個錯誤: ::" -#: ../../howto/argparse.rst:563 +#: ../../howto/argparse.rst:568 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -1148,7 +1151,7 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:578 +#: ../../howto/argparse.rst:583 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 " @@ -1160,11 +1163,11 @@ msgstr "" "int 值進行比較。請記住,預設情況下,如果未指定可選引數,它將獲得 ``None`` " "值,並且不能與 int 值進行比較(因此會出現 :exc:`TypeError` 例外)。" -#: ../../howto/argparse.rst:585 +#: ../../howto/argparse.rst:590 msgid "And:" msgstr "而且:" -#: ../../howto/argparse.rst:587 +#: ../../howto/argparse.rst:592 msgid "" "$ python prog.py 4\n" "16" @@ -1172,7 +1175,7 @@ msgstr "" "$ python prog.py 4\n" "16" -#: ../../howto/argparse.rst:592 +#: ../../howto/argparse.rst:597 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 " @@ -1182,17 +1185,17 @@ msgstr "" "毛而已。:mod:`argparse` 模組非常強大,在結束本教學之前我們會對它進行更多探" "索。" -#: ../../howto/argparse.rst:599 +#: ../../howto/argparse.rst:604 msgid "Getting a little more advanced" msgstr "更進階一點" -#: ../../howto/argparse.rst:601 +#: ../../howto/argparse.rst:606 msgid "" "What if we wanted to expand our tiny program to perform other powers, not " "just squares::" msgstr "如果我們想擴充我們的小程式來執行其他次方的運算,而不僅是平方: ::" -#: ../../howto/argparse.rst:604 +#: ../../howto/argparse.rst:609 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -1222,12 +1225,12 @@ msgstr "" "else:\n" " print(answer)" -#: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 -#: ../../howto/argparse.rst:872 +#: ../../howto/argparse.rst:623 ../../howto/argparse.rst:661 +#: ../../howto/argparse.rst:877 msgid "Output:" msgstr "結果:" -#: ../../howto/argparse.rst:620 +#: ../../howto/argparse.rst:625 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] x y\n" @@ -1261,7 +1264,7 @@ msgstr "" "$ python prog.py 4 2 -v\n" "4^2 == 16" -#: ../../howto/argparse.rst:639 +#: ../../howto/argparse.rst:644 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 " @@ -1270,7 +1273,7 @@ msgstr "" "請注意,到目前為止,我們一直在使用詳細級別來\\ *更改*\\ 顯示的文字。以下範例" "使用詳細級別來顯示\\ *更多*\\ 文字: ::" -#: ../../howto/argparse.rst:643 +#: ../../howto/argparse.rst:648 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -1298,7 +1301,7 @@ msgstr "" " print(f\"{args.x}^{args.y} == \", end=\"\")\n" "print(answer)" -#: ../../howto/argparse.rst:658 +#: ../../howto/argparse.rst:663 msgid "" "$ python prog.py 4 2\n" "16\n" @@ -1316,11 +1319,11 @@ msgstr "" "Running 'prog.py'\n" "4^2 == 16" -#: ../../howto/argparse.rst:672 +#: ../../howto/argparse.rst:677 msgid "Specifying ambiguous arguments" msgstr "指定不明確的引數" -#: ../../howto/argparse.rst:674 +#: ../../howto/argparse.rst:679 msgid "" "When there is ambiguity in deciding whether an argument is positional or for " "an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " @@ -1329,7 +1332,7 @@ msgstr "" "當決定一個引數是位置引數還是引數會有歧義,可以使用 ``--`` 來告訴 :meth:" "`~ArgumentParser.parse_args` 之後的所有內容都是位置引數: ::" -#: ../../howto/argparse.rst:678 +#: ../../howto/argparse.rst:683 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-n', nargs='+')\n" @@ -1369,11 +1372,11 @@ msgstr "" ">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" "Namespace(args=['2', '3'], n=['1'])" -#: ../../howto/argparse.rst:699 +#: ../../howto/argparse.rst:704 msgid "Conflicting options" msgstr "相互衝突的選項" -#: ../../howto/argparse.rst:701 +#: ../../howto/argparse.rst:706 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" @@ -1387,7 +1390,7 @@ msgstr "" "許我們指定彼此衝突的選項。我們還可以更改程式的其餘部分,以使得新功能更有意" "義:我們將引入 ``--quiet`` 選項,該選項與 ``--verbose`` 選項相反: ::" -#: ../../howto/argparse.rst:709 +#: ../../howto/argparse.rst:714 msgid "" "import argparse\n" "\n" @@ -1425,7 +1428,7 @@ msgstr "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" -#: ../../howto/argparse.rst:727 +#: ../../howto/argparse.rst:732 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" @@ -1433,7 +1436,7 @@ msgstr "" "我們的程式現在更簡單了,我們因為功能展示失去了一些功能,但無論如何,以下這是" "輸出:" -#: ../../howto/argparse.rst:730 +#: ../../howto/argparse.rst:735 msgid "" "$ python prog.py 4 2\n" "4^2 == 16\n" @@ -1461,7 +1464,7 @@ msgstr "" "usage: prog.py [-h] [-v | -q] x y\n" "prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" -#: ../../howto/argparse.rst:745 +#: ../../howto/argparse.rst:750 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 " @@ -1470,14 +1473,14 @@ msgstr "" "這應該很容易理解。我新增了最後一個輸出,以便看到所獲得的靈活性,即可以混合長" "形式與短形式選項。" -#: ../../howto/argparse.rst:749 +#: ../../howto/argparse.rst:754 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" msgstr "" "在我們結束之前,你可能想告訴使用者你的程式的主要目的,以防他們不知道: ::" -#: ../../howto/argparse.rst:752 +#: ../../howto/argparse.rst:757 msgid "" "import argparse\n" "\n" @@ -1517,7 +1520,7 @@ msgstr "" "else:\n" " print(f\"{args.x}^{args.y} == {answer}\")" -#: ../../howto/argparse.rst:770 +#: ../../howto/argparse.rst:775 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 " @@ -1526,7 +1529,7 @@ msgstr "" "請注意用法文字中的細微差別。注意 ``[-v | -q]``,它告訴我們可以使用 ``-v`` 或 " "``-q``,但不能同時使用:" -#: ../../howto/argparse.rst:774 ../../howto/argparse.rst:801 +#: ../../howto/argparse.rst:779 ../../howto/argparse.rst:806 msgid "" "$ python prog.py --help\n" "usage: prog.py [-h] [-v | -q] x y\n" @@ -1556,11 +1559,11 @@ msgstr "" " -v, --verbose\n" " -q, --quiet" -#: ../../howto/argparse.rst:792 +#: ../../howto/argparse.rst:797 msgid "How to translate the argparse output" msgstr "如何翻譯 argparse 輸出" -#: ../../howto/argparse.rst:794 +#: ../../howto/argparse.rst:799 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 " @@ -1571,11 +1574,11 @@ msgstr "" "`gettext` 模組進行翻譯。這允許應用程式能輕鬆本地化 :mod:`argparse` 生成的訊" "息。另請參閱 :ref:`i18n-howto`。" -#: ../../howto/argparse.rst:799 +#: ../../howto/argparse.rst:804 msgid "For instance, in this :mod:`argparse` output:" msgstr "例如,在此 :mod:`argparse` 輸出中:" -#: ../../howto/argparse.rst:817 +#: ../../howto/argparse.rst:822 msgid "" "The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " "this help message and exit`` are all translatable." @@ -1583,7 +1586,7 @@ msgstr "" "字串 ``usage:``、``positional arguments:``、``options:`` 和 ``show this help " "message and exit`` 都是可被翻譯的。" -#: ../../howto/argparse.rst:820 +#: ../../howto/argparse.rst:825 msgid "" "In order to translate these strings, they must first be extracted into a ``." "po`` file. For example, using `Babel <https://babel.pocoo.org/>`__, run this " @@ -1592,11 +1595,11 @@ msgstr "" "為了翻譯這些字串,必須先將它們提取到 ``.po`` 檔案中。例如,使用 `Babel " "<https://babel.pocoo.org/>`__ 並執行下列命令:" -#: ../../howto/argparse.rst:824 +#: ../../howto/argparse.rst:829 msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" msgstr "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" -#: ../../howto/argparse.rst:828 +#: ../../howto/argparse.rst:833 msgid "" "This command will extract all translatable strings from the :mod:`argparse` " "module and output them into a file named ``messages.po``. This command " @@ -1605,13 +1608,13 @@ msgstr "" "此命令將從 :mod:`argparse` 模組中提取出所有可翻譯的字串,並將它們輸出到名為 " "``messages.po`` 的檔案中。這個指令假設你的 Python 是安裝在 ``/usr/lib`` 中。" -#: ../../howto/argparse.rst:832 +#: ../../howto/argparse.rst:837 msgid "" "You can find out the location of the :mod:`argparse` module on your system " "using this script::" msgstr "你可以使用以下腳本找到 :mod:`argparse` 模組在系統上的位置: ::" -#: ../../howto/argparse.rst:835 +#: ../../howto/argparse.rst:840 msgid "" "import argparse\n" "print(argparse.__file__)" @@ -1619,7 +1622,7 @@ msgstr "" "import argparse\n" "print(argparse.__file__)" -#: ../../howto/argparse.rst:838 +#: ../../howto/argparse.rst:843 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 " @@ -1628,17 +1631,17 @@ msgstr "" "一旦翻譯了 ``.po`` 檔案中的訊息並使用 :mod:`gettext` 安裝了翻譯,:mod:" "`argparse` 將能夠顯示翻譯後的訊息。" -#: ../../howto/argparse.rst:842 +#: ../../howto/argparse.rst:847 msgid "" "To translate your own strings in the :mod:`argparse` output, use :mod:" "`gettext`." msgstr "若要在 :mod:`argparse` 輸出中翻譯你自己的字串,請使用 :mod:`gettext`。" -#: ../../howto/argparse.rst:845 +#: ../../howto/argparse.rst:850 msgid "Custom type converters" msgstr "" -#: ../../howto/argparse.rst:847 +#: ../../howto/argparse.rst:852 msgid "" "The :mod:`argparse` module allows you to specify custom type converters for " "your command-line arguments. This allows you to modify user input before " @@ -1646,7 +1649,7 @@ msgid "" "need to pre-process the input before it is used in your program." msgstr "" -#: ../../howto/argparse.rst:852 +#: ../../howto/argparse.rst:857 msgid "" "When using a custom type converter, you can use any callable that takes a " "single string argument (the argument value) and returns the converted value. " @@ -1654,13 +1657,13 @@ msgid "" "action class with the **action** parameter instead." msgstr "" -#: ../../howto/argparse.rst:857 +#: ../../howto/argparse.rst:862 msgid "" "For example, let's say you want to handle arguments with different prefixes " "and process them accordingly::" msgstr "" -#: ../../howto/argparse.rst:860 +#: ../../howto/argparse.rst:865 #, fuzzy msgid "" "import argparse\n" @@ -1683,31 +1686,31 @@ msgstr "" "args = parser.parse_args()\n" "print(args.square**2)" -#: ../../howto/argparse.rst:874 +#: ../../howto/argparse.rst:879 msgid "" "$ python prog.py -a value1 +a value2\n" "Namespace(a=[('-', 'value1'), ('+', 'value2')])" msgstr "" -#: ../../howto/argparse.rst:879 +#: ../../howto/argparse.rst:884 #, fuzzy msgid "In this example, we:" msgstr "例如: ::" -#: ../../howto/argparse.rst:881 +#: ../../howto/argparse.rst:886 msgid "" "Created a parser with custom prefix characters using the ``prefix_chars`` " "parameter." msgstr "" -#: ../../howto/argparse.rst:884 +#: ../../howto/argparse.rst:889 msgid "" "Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " "to create custom type converters to store the value in a tuple with the " "prefix." msgstr "" -#: ../../howto/argparse.rst:887 +#: ../../howto/argparse.rst:892 msgid "" "Without the custom type converters, the arguments would have treated the ``-" "a`` and ``+a`` as the same argument, which would have been undesirable. By " @@ -1715,11 +1718,11 @@ msgid "" "arguments." msgstr "" -#: ../../howto/argparse.rst:892 +#: ../../howto/argparse.rst:897 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:894 +#: ../../howto/argparse.rst:899 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 " @@ -1727,3 +1730,13 @@ msgid "" msgstr "" ":mod:`argparse` 模組提供的功能比此篇內容的要多得多。它的文件非常詳細與透徹並" "有很多範例。讀完本教學後,你應該可以輕鬆消化它們,而不會感到不知所措。" + +#~ msgid "" +#~ "There are two other modules that fulfill the same task, namely :mod:" +#~ "`getopt` (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 語言中" +#~ "的 ``getopt()``)和已棄用的 :mod:`optparse`。另請注意,:mod:`argparse` 是" +#~ "基於 :mod:`optparse` 的,因此在用法上非常相似。" diff --git a/library/argparse.po b/library/argparse.po index 95b39fd4f1..106376b879 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,31 @@ msgstr "" msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "**原始碼:**\\ :source:`Lib/argparse.py`" +#: ../../library/argparse.rst:16 +msgid "" +"While :mod:`argparse` is the default recommended standard library module for " +"implementing basic command line applications, authors with more exacting " +"requirements for exactly how their command line applications behave may find " +"it doesn't provide the necessary level of control. Refer to :ref:`choosing-" +"an-argument-parser` for alternatives to consider when ``argparse`` doesn't " +"support behaviors that the application requires (such as entirely disabling " +"support for interspersed options and positional arguments, or accepting " +"option parameter values that start with ``-`` even when they correspond to " +"another defined option)." +msgstr "" + #: ../../library/argparse.rst:-1 msgid "Tutorial" msgstr "教學" -#: ../../library/argparse.rst:18 +#: ../../library/argparse.rst:30 msgid "" "This page contains the API reference information. For a more gentle " "introduction to Python command-line parsing, have a look at the :ref:" "`argparse tutorial <argparse-tutorial>`." msgstr "" -#: ../../library/argparse.rst:22 +#: ../../library/argparse.rst:34 msgid "" "The :mod:`!argparse` module makes it easy to write user-friendly command-" "line interfaces. The program defines what arguments it requires, and :mod:`!" @@ -49,7 +62,7 @@ msgid "" "invalid arguments." msgstr "" -#: ../../library/argparse.rst:28 +#: ../../library/argparse.rst:40 msgid "" "The :mod:`!argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " @@ -57,7 +70,7 @@ msgid "" "whole::" msgstr "" -#: ../../library/argparse.rst:32 +#: ../../library/argparse.rst:44 msgid "" "parser = argparse.ArgumentParser(\n" " prog='ProgramName',\n" @@ -65,14 +78,14 @@ msgid "" " epilog='Text at the bottom of help')" msgstr "" -#: ../../library/argparse.rst:37 +#: ../../library/argparse.rst:49 msgid "" "The :meth:`ArgumentParser.add_argument` method attaches individual argument " "specifications to the parser. It supports positional arguments, options " "that accept values, and on/off flags::" msgstr "" -#: ../../library/argparse.rst:41 +#: ../../library/argparse.rst:53 msgid "" "parser.add_argument('filename') # positional argument\n" "parser.add_argument('-c', '--count') # option that takes a value\n" @@ -80,154 +93,154 @@ msgid "" " action='store_true') # on/off flag" msgstr "" -#: ../../library/argparse.rst:46 +#: ../../library/argparse.rst:58 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" -#: ../../library/argparse.rst:49 +#: ../../library/argparse.rst:61 msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" -#: ../../library/argparse.rst:53 +#: ../../library/argparse.rst:65 msgid "" "If you're looking for a guide about how to upgrade :mod:`optparse` code to :" "mod:`!argparse`, see :ref:`Upgrading Optparse Code <upgrading-optparse-" "code>`." msgstr "" -#: ../../library/argparse.rst:57 +#: ../../library/argparse.rst:69 msgid "ArgumentParser objects" msgstr "ArgumentParser 物件" -#: ../../library/argparse.rst:66 +#: ../../library/argparse.rst:78 msgid "" "Create a new :class:`ArgumentParser` object. All parameters should be passed " "as keyword arguments. Each parameter has its own more detailed description " "below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:70 +#: ../../library/argparse.rst:82 msgid "" "prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" msgstr "" -#: ../../library/argparse.rst:73 +#: ../../library/argparse.rst:85 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" msgstr "" -#: ../../library/argparse.rst:76 +#: ../../library/argparse.rst:88 msgid "" "description_ - Text to display before the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:79 +#: ../../library/argparse.rst:91 msgid "epilog_ - Text to display after the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:81 +#: ../../library/argparse.rst:93 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" msgstr "" -#: ../../library/argparse.rst:84 +#: ../../library/argparse.rst:96 msgid "formatter_class_ - A class for customizing the help output" msgstr "" -#: ../../library/argparse.rst:86 +#: ../../library/argparse.rst:98 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" msgstr "" -#: ../../library/argparse.rst:89 +#: ../../library/argparse.rst:101 msgid "" "fromfile_prefix_chars_ - The set of characters that prefix files from which " "additional arguments should be read (default: ``None``)" msgstr "" -#: ../../library/argparse.rst:92 +#: ../../library/argparse.rst:104 msgid "" "argument_default_ - The global default value for arguments (default: " "``None``)" msgstr "" -#: ../../library/argparse.rst:95 +#: ../../library/argparse.rst:107 msgid "" "conflict_handler_ - The strategy for resolving conflicting optionals " "(usually unnecessary)" msgstr "" -#: ../../library/argparse.rst:98 +#: ../../library/argparse.rst:110 msgid "" "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:100 +#: ../../library/argparse.rst:112 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " "unambiguous. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:103 +#: ../../library/argparse.rst:115 msgid "" "exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " "with error info when an error occurs. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:106 +#: ../../library/argparse.rst:118 msgid "*allow_abbrev* parameter was added." msgstr "新增 *allow_abbrev* 參數。" -#: ../../library/argparse.rst:109 +#: ../../library/argparse.rst:121 msgid "" "In previous versions, *allow_abbrev* also disabled grouping of short flags " "such as ``-vv`` to mean ``-v -v``." msgstr "" -#: ../../library/argparse.rst:113 +#: ../../library/argparse.rst:125 msgid "*exit_on_error* parameter was added." msgstr "新增 *exit_on_error* 參數。" -#: ../../library/argparse.rst:116 ../../library/argparse.rst:598 +#: ../../library/argparse.rst:128 ../../library/argparse.rst:610 msgid "The following sections describe how each of these are used." msgstr "" -#: ../../library/argparse.rst:122 +#: ../../library/argparse.rst:134 msgid "prog" msgstr "" -#: ../../library/argparse.rst:125 +#: ../../library/argparse.rst:137 msgid "" "By default, :class:`ArgumentParser` calculates the name of the program to " "display in help messages depending on the way the Python interpreter was run:" msgstr "" -#: ../../library/argparse.rst:128 +#: ../../library/argparse.rst:140 msgid "" "The :func:`base name <os.path.basename>` of ``sys.argv[0]`` if a file was " "passed as argument." msgstr "" -#: ../../library/argparse.rst:130 +#: ../../library/argparse.rst:142 msgid "" "The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " "zipfile was passed as argument." msgstr "" -#: ../../library/argparse.rst:132 +#: ../../library/argparse.rst:144 msgid "" "The Python interpreter name followed by ``-m`` followed by the module or " "package name if the :option:`-m` option was used." msgstr "" -#: ../../library/argparse.rst:135 +#: ../../library/argparse.rst:147 msgid "" "This default is almost always desirable because it will make the help " "messages match the string that was used to invoke the program on the command " @@ -235,7 +248,7 @@ msgid "" "supplied using the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:140 +#: ../../library/argparse.rst:152 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -251,14 +264,14 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:147 +#: ../../library/argparse.rst:159 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " "the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " "format specifier." msgstr "" -#: ../../library/argparse.rst:153 +#: ../../library/argparse.rst:165 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -278,18 +291,18 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" -#: ../../library/argparse.rst:164 +#: ../../library/argparse.rst:176 msgid "usage" msgstr "" -#: ../../library/argparse.rst:166 +#: ../../library/argparse.rst:178 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " "arguments it contains. The default message can be overridden with the " "``usage=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:170 +#: ../../library/argparse.rst:182 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -319,17 +332,17 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" -#: ../../library/argparse.rst:183 +#: ../../library/argparse.rst:195 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." msgstr "" -#: ../../library/argparse.rst:190 +#: ../../library/argparse.rst:202 msgid "description" msgstr "描述" -#: ../../library/argparse.rst:192 +#: ../../library/argparse.rst:204 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " @@ -338,24 +351,24 @@ msgid "" "messages for the various arguments." msgstr "" -#: ../../library/argparse.rst:198 +#: ../../library/argparse.rst:210 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." msgstr "" -#: ../../library/argparse.rst:203 +#: ../../library/argparse.rst:215 msgid "epilog" msgstr "" -#: ../../library/argparse.rst:205 +#: ../../library/argparse.rst:217 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:209 +#: ../../library/argparse.rst:221 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -383,18 +396,18 @@ msgstr "" "\n" "And that's how you'd foo a bar" -#: ../../library/argparse.rst:222 +#: ../../library/argparse.rst:234 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:228 +#: ../../library/argparse.rst:240 msgid "parents" msgstr "" -#: ../../library/argparse.rst:230 +#: ../../library/argparse.rst:242 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -405,7 +418,7 @@ msgid "" "object being constructed::" msgstr "" -#: ../../library/argparse.rst:237 +#: ../../library/argparse.rst:249 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -433,32 +446,32 @@ msgstr "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" -#: ../../library/argparse.rst:250 +#: ../../library/argparse.rst:262 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -#: ../../library/argparse.rst:255 +#: ../../library/argparse.rst:267 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " "not be reflected in the child." msgstr "" -#: ../../library/argparse.rst:263 +#: ../../library/argparse.rst:275 msgid "formatter_class" msgstr "formatter_class" -#: ../../library/argparse.rst:265 +#: ../../library/argparse.rst:277 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " "classes:" msgstr "" -#: ../../library/argparse.rst:274 +#: ../../library/argparse.rst:286 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -466,7 +479,7 @@ msgid "" "command-line help messages::" msgstr "" -#: ../../library/argparse.rst:279 +#: ../../library/argparse.rst:291 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -490,14 +503,14 @@ msgid "" "will be wrapped across a couple lines" msgstr "" -#: ../../library/argparse.rst:299 +#: ../../library/argparse.rst:311 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " "should not be line-wrapped::" msgstr "" -#: ../../library/argparse.rst:303 +#: ../../library/argparse.rst:315 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -522,7 +535,7 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: ../../library/argparse.rst:325 +#: ../../library/argparse.rst:337 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " "text, including argument descriptions. However, multiple newlines are " @@ -530,13 +543,13 @@ msgid "" "between the newlines." msgstr "" -#: ../../library/argparse.rst:330 +#: ../../library/argparse.rst:342 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" msgstr "" -#: ../../library/argparse.rst:333 +#: ../../library/argparse.rst:345 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -568,14 +581,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" -#: ../../library/argparse.rst:348 +#: ../../library/argparse.rst:360 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " "dest_ as the regular formatter does)::" msgstr "" -#: ../../library/argparse.rst:352 +#: ../../library/argparse.rst:364 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -607,11 +620,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo int" -#: ../../library/argparse.rst:369 +#: ../../library/argparse.rst:381 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:371 +#: ../../library/argparse.rst:383 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " @@ -619,7 +632,7 @@ msgid "" "``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" msgstr "" -#: ../../library/argparse.rst:377 +#: ../../library/argparse.rst:389 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -633,18 +646,18 @@ msgstr "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" -#: ../../library/argparse.rst:383 +#: ../../library/argparse.rst:395 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " "disallowed." msgstr "" -#: ../../library/argparse.rst:389 +#: ../../library/argparse.rst:401 msgid "fromfile_prefix_chars" msgstr "fromfile_prefix_chars" -#: ../../library/argparse.rst:391 +#: ../../library/argparse.rst:403 msgid "" "Sometimes, when dealing with a particularly long argument list, it may make " "sense to keep the list of arguments in a file rather than typing it out at " @@ -654,7 +667,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: ../../library/argparse.rst:398 +#: ../../library/argparse.rst:410 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -672,7 +685,7 @@ msgstr "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" -#: ../../library/argparse.rst:406 +#: ../../library/argparse.rst:418 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -682,19 +695,19 @@ msgid "" "f', 'bar']``." msgstr "" -#: ../../library/argparse.rst:412 +#: ../../library/argparse.rst:424 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" -#: ../../library/argparse.rst:415 +#: ../../library/argparse.rst:427 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: ../../library/argparse.rst:418 +#: ../../library/argparse.rst:430 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) <locale." @@ -703,11 +716,11 @@ msgid "" "ANSI Codepage on Windows." msgstr "" -#: ../../library/argparse.rst:426 +#: ../../library/argparse.rst:438 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:428 +#: ../../library/argparse.rst:440 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -719,7 +732,7 @@ msgid "" "supply ``argument_default=SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:437 +#: ../../library/argparse.rst:449 msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -737,22 +750,22 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace()" -#: ../../library/argparse.rst:448 +#: ../../library/argparse.rst:460 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:450 +#: ../../library/argparse.rst:462 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations <prefix-matching>` of long options." msgstr "" -#: ../../library/argparse.rst:454 +#: ../../library/argparse.rst:466 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:456 +#: ../../library/argparse.rst:468 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -768,11 +781,11 @@ msgstr "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" -#: ../../library/argparse.rst:467 +#: ../../library/argparse.rst:479 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:469 +#: ../../library/argparse.rst:481 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -780,7 +793,7 @@ msgid "" "that is already in use::" msgstr "" -#: ../../library/argparse.rst:474 +#: ../../library/argparse.rst:486 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -796,7 +809,7 @@ msgstr "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" -#: ../../library/argparse.rst:481 +#: ../../library/argparse.rst:493 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -804,7 +817,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:486 +#: ../../library/argparse.rst:498 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -830,7 +843,7 @@ msgstr "" " -f FOO old foo help\n" " --foo FOO new foo help" -#: ../../library/argparse.rst:497 +#: ../../library/argparse.rst:509 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -838,25 +851,25 @@ msgid "" "option string was overridden." msgstr "" -#: ../../library/argparse.rst:504 +#: ../../library/argparse.rst:516 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:506 +#: ../../library/argparse.rst:518 msgid "" "By default, :class:`ArgumentParser` objects add an option which simply " "displays the parser's help message. If ``-h`` or ``--help`` is supplied at " "the command line, the :class:`!ArgumentParser` help will be printed." msgstr "" -#: ../../library/argparse.rst:510 +#: ../../library/argparse.rst:522 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:514 +#: ../../library/argparse.rst:526 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -874,7 +887,7 @@ msgstr "" "options:\n" " --foo FOO foo help" -#: ../../library/argparse.rst:522 +#: ../../library/argparse.rst:534 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -882,7 +895,7 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: ../../library/argparse.rst:528 +#: ../../library/argparse.rst:540 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -898,24 +911,24 @@ msgstr "" "options:\n" " +h, ++help show this help message and exit" -#: ../../library/argparse.rst:537 +#: ../../library/argparse.rst:549 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:539 +#: ../../library/argparse.rst:551 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" -#: ../../library/argparse.rst:543 +#: ../../library/argparse.rst:555 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:546 +#: ../../library/argparse.rst:558 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -941,81 +954,81 @@ msgstr "" "...\n" "Catching an argumentError" -#: ../../library/argparse.rst:560 +#: ../../library/argparse.rst:572 msgid "The add_argument() method" msgstr "" -#: ../../library/argparse.rst:566 +#: ../../library/argparse.rst:578 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:569 +#: ../../library/argparse.rst:581 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " "or ``'-f', '--foo'``." msgstr "" -#: ../../library/argparse.rst:572 +#: ../../library/argparse.rst:584 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:575 +#: ../../library/argparse.rst:587 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:577 +#: ../../library/argparse.rst:589 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:579 +#: ../../library/argparse.rst:591 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:582 +#: ../../library/argparse.rst:594 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:584 +#: ../../library/argparse.rst:596 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:586 +#: ../../library/argparse.rst:598 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:589 +#: ../../library/argparse.rst:601 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:591 +#: ../../library/argparse.rst:603 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:593 +#: ../../library/argparse.rst:605 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:596 +#: ../../library/argparse.rst:608 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "" -#: ../../library/argparse.rst:604 +#: ../../library/argparse.rst:616 msgid "name or flags" msgstr "" -#: ../../library/argparse.rst:606 +#: ../../library/argparse.rst:618 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1024,30 +1037,30 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:612 +#: ../../library/argparse.rst:624 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:614 +#: ../../library/argparse.rst:626 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:616 +#: ../../library/argparse.rst:628 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:618 +#: ../../library/argparse.rst:630 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:620 +#: ../../library/argparse.rst:632 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:624 +#: ../../library/argparse.rst:636 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1071,11 +1084,11 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:639 +#: ../../library/argparse.rst:651 msgid "action" msgstr "" -#: ../../library/argparse.rst:641 +#: ../../library/argparse.rst:653 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1085,13 +1098,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:647 +#: ../../library/argparse.rst:659 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action." msgstr "" -#: ../../library/argparse.rst:650 +#: ../../library/argparse.rst:662 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1099,7 +1112,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:655 +#: ../../library/argparse.rst:667 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1111,7 +1124,7 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:660 +#: ../../library/argparse.rst:672 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " @@ -1119,7 +1132,7 @@ msgid "" "``True`` respectively::" msgstr "" -#: ../../library/argparse.rst:665 +#: ../../library/argparse.rst:677 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1135,7 +1148,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:672 +#: ../../library/argparse.rst:684 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -1144,7 +1157,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: ../../library/argparse.rst:678 +#: ../../library/argparse.rst:690 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append')\n" @@ -1156,7 +1169,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['1', '2'])" -#: ../../library/argparse.rst:683 +#: ../../library/argparse.rst:695 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -1165,7 +1178,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:689 +#: ../../library/argparse.rst:701 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1183,7 +1196,7 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[<class 'str'>, <class 'int'>])" -#: ../../library/argparse.rst:695 +#: ../../library/argparse.rst:707 msgid "" "``'extend'`` - This stores a list and appends each item from the multi-value " "argument list to it. The ``'extend'`` action is typically used with the " @@ -1192,7 +1205,7 @@ msgid "" "will be appended to the list. Example usage::" msgstr "" -#: ../../library/argparse.rst:703 +#: ../../library/argparse.rst:715 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1208,13 +1221,13 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:710 +#: ../../library/argparse.rst:722 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:713 +#: ../../library/argparse.rst:725 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1222,11 +1235,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: ../../library/argparse.rst:718 +#: ../../library/argparse.rst:730 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:720 +#: ../../library/argparse.rst:732 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1234,14 +1247,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:725 +#: ../../library/argparse.rst:737 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:729 +#: ../../library/argparse.rst:741 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1257,13 +1270,13 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:735 +#: ../../library/argparse.rst:747 msgid "" "Only actions that consume command-line arguments (e.g. ``'store'``, " "``'append'`` or ``'extend'``) can be used with positional arguments." msgstr "" -#: ../../library/argparse.rst:740 +#: ../../library/argparse.rst:752 msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " "subclass or other object that implements the same interface. The :class:`!" @@ -1271,7 +1284,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:745 +#: ../../library/argparse.rst:757 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1285,7 +1298,7 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:753 +#: ../../library/argparse.rst:765 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1294,11 +1307,11 @@ msgid "" "their registered name." msgstr "" -#: ../../library/argparse.rst:758 +#: ../../library/argparse.rst:770 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:760 +#: ../../library/argparse.rst:772 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1319,15 +1332,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:778 +#: ../../library/argparse.rst:790 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:784 +#: ../../library/argparse.rst:796 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:786 +#: ../../library/argparse.rst:798 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1336,13 +1349,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:791 +#: ../../library/argparse.rst:803 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:794 +#: ../../library/argparse.rst:806 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1356,13 +1369,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:800 +#: ../../library/argparse.rst:812 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:805 +#: ../../library/argparse.rst:817 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1372,7 +1385,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:812 +#: ../../library/argparse.rst:824 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1394,13 +1407,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:822 +#: ../../library/argparse.rst:834 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:825 +#: ../../library/argparse.rst:837 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1426,7 +1439,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='<stdout>' encoding='UTF-8'>)" -#: ../../library/argparse.rst:839 +#: ../../library/argparse.rst:851 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1434,7 +1447,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:844 +#: ../../library/argparse.rst:856 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1450,14 +1463,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:853 +#: ../../library/argparse.rst:865 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:857 +#: ../../library/argparse.rst:869 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1475,7 +1488,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:865 +#: ../../library/argparse.rst:877 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1484,11 +1497,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:875 +#: ../../library/argparse.rst:887 msgid "const" msgstr "" -#: ../../library/argparse.rst:877 +#: ../../library/argparse.rst:889 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1496,7 +1509,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:881 +#: ../../library/argparse.rst:893 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1506,7 +1519,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:889 +#: ../../library/argparse.rst:901 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1516,17 +1529,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:896 +#: ../../library/argparse.rst:908 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:903 +#: ../../library/argparse.rst:915 msgid "default" msgstr "" -#: ../../library/argparse.rst:905 +#: ../../library/argparse.rst:917 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1536,7 +1549,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:912 +#: ../../library/argparse.rst:924 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1552,13 +1565,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:919 +#: ../../library/argparse.rst:931 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:922 +#: ../../library/argparse.rst:934 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1570,7 +1583,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:927 +#: ../../library/argparse.rst:939 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1578,7 +1591,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:932 +#: ../../library/argparse.rst:944 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1592,13 +1605,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:938 +#: ../../library/argparse.rst:950 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:941 +#: ../../library/argparse.rst:953 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1614,20 +1627,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:948 +#: ../../library/argparse.rst:960 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:952 +#: ../../library/argparse.rst:964 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:955 +#: ../../library/argparse.rst:967 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1643,11 +1656,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:966 +#: ../../library/argparse.rst:978 msgid "type" msgstr "" -#: ../../library/argparse.rst:968 +#: ../../library/argparse.rst:980 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1656,13 +1669,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:974 +#: ../../library/argparse.rst:986 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:977 +#: ../../library/argparse.rst:989 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1671,11 +1684,11 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:995 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:985 +#: ../../library/argparse.rst:997 #, fuzzy msgid "" "import argparse\n" @@ -1703,11 +1716,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:998 +#: ../../library/argparse.rst:1010 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1000 +#: ../../library/argparse.rst:1012 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1725,14 +1738,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:1022 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1014 +#: ../../library/argparse.rst:1026 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1740,7 +1753,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1019 +#: ../../library/argparse.rst:1031 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." @@ -1748,7 +1761,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1024 +#: ../../library/argparse.rst:1036 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1758,17 +1771,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:1043 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1038 +#: ../../library/argparse.rst:1050 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1040 +#: ../../library/argparse.rst:1052 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1777,7 +1790,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1046 +#: ../../library/argparse.rst:1058 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1797,26 +1810,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1055 +#: ../../library/argparse.rst:1067 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1059 +#: ../../library/argparse.rst:1071 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1062 +#: ../../library/argparse.rst:1074 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1065 +#: ../../library/argparse.rst:1077 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1824,11 +1837,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1086 msgid "required" msgstr "" -#: ../../library/argparse.rst:1076 +#: ../../library/argparse.rst:1088 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1836,7 +1849,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1081 +#: ../../library/argparse.rst:1093 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1854,24 +1867,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1089 +#: ../../library/argparse.rst:1101 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1095 +#: ../../library/argparse.rst:1107 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1102 +#: ../../library/argparse.rst:1114 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1104 +#: ../../library/argparse.rst:1116 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1879,7 +1892,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1109 +#: ../../library/argparse.rst:1121 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1888,7 +1901,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1126 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1914,19 +1927,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1126 +#: ../../library/argparse.rst:1138 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1129 +#: ../../library/argparse.rst:1141 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1132 +#: ../../library/argparse.rst:1144 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1944,11 +1957,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1156 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1146 +#: ../../library/argparse.rst:1158 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -1960,7 +1973,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1155 +#: ../../library/argparse.rst:1167 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1992,11 +2005,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1170 +#: ../../library/argparse.rst:1182 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1172 +#: ../../library/argparse.rst:1184 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2028,21 +2041,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1187 +#: ../../library/argparse.rst:1199 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1191 +#: ../../library/argparse.rst:1203 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1195 +#: ../../library/argparse.rst:1207 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2066,11 +2079,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1210 +#: ../../library/argparse.rst:1222 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1212 +#: ../../library/argparse.rst:1224 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2080,7 +2093,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1219 +#: ../../library/argparse.rst:1231 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2092,7 +2105,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1224 +#: ../../library/argparse.rst:1236 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2104,7 +2117,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1233 +#: ../../library/argparse.rst:1245 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2122,11 +2135,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1241 +#: ../../library/argparse.rst:1253 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1243 +#: ../../library/argparse.rst:1255 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2138,11 +2151,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1252 +#: ../../library/argparse.rst:1264 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1254 +#: ../../library/argparse.rst:1266 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2153,7 +2166,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1264 +#: ../../library/argparse.rst:1276 #, fuzzy msgid "" ">>> import argparse\n" @@ -2172,11 +2185,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1277 +#: ../../library/argparse.rst:1289 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1279 +#: ../../library/argparse.rst:1291 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2184,7 +2197,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1288 +#: ../../library/argparse.rst:1300 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2193,7 +2206,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1294 +#: ../../library/argparse.rst:1306 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2202,46 +2215,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1302 +#: ../../library/argparse.rst:1314 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1317 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1307 +#: ../../library/argparse.rst:1319 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1311 +#: ../../library/argparse.rst:1323 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1315 +#: ../../library/argparse.rst:1327 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1319 +#: ../../library/argparse.rst:1331 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1324 +#: ../../library/argparse.rst:1336 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2249,47 +2262,47 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1330 +#: ../../library/argparse.rst:1342 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1334 +#: ../../library/argparse.rst:1346 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1337 +#: ../../library/argparse.rst:1349 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1341 +#: ../../library/argparse.rst:1353 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1344 +#: ../../library/argparse.rst:1356 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1361 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1351 +#: ../../library/argparse.rst:1363 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1355 +#: ../../library/argparse.rst:1367 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2307,14 +2320,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1363 +#: ../../library/argparse.rst:1375 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1379 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2322,13 +2335,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1370 +#: ../../library/argparse.rst:1382 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1373 +#: ../../library/argparse.rst:1385 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2336,13 +2349,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1376 +#: ../../library/argparse.rst:1388 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1391 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2358,11 +2371,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1388 +#: ../../library/argparse.rst:1400 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1390 +#: ../../library/argparse.rst:1402 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2370,7 +2383,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1395 +#: ../../library/argparse.rst:1407 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2392,11 +2405,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1416 +#: ../../library/argparse.rst:1428 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1418 +#: ../../library/argparse.rst:1430 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2408,7 +2421,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1426 +#: ../../library/argparse.rst:1438 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2441,7 +2454,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1456 +#: ../../library/argparse.rst:1468 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2449,7 +2462,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1461 +#: ../../library/argparse.rst:1473 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2457,24 +2470,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1464 +#: ../../library/argparse.rst:1476 msgid "" "See also :ref:`the argparse howto on ambiguous arguments <specifying-" "ambiguous-arguments>` for more details." msgstr "" -#: ../../library/argparse.rst:1470 +#: ../../library/argparse.rst:1482 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1472 +#: ../../library/argparse.rst:1484 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "<allow_abbrev>` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1476 +#: ../../library/argparse.rst:1488 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2498,17 +2511,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1487 +#: ../../library/argparse.rst:1499 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1493 +#: ../../library/argparse.rst:1505 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1495 +#: ../../library/argparse.rst:1507 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2516,7 +2529,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1500 +#: ../../library/argparse.rst:1512 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2542,24 +2555,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=<built-in function sum>, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1515 +#: ../../library/argparse.rst:1527 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1519 +#: ../../library/argparse.rst:1531 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1522 +#: ../../library/argparse.rst:1534 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1526 +#: ../../library/argparse.rst:1538 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2573,14 +2586,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1532 +#: ../../library/argparse.rst:1544 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1536 +#: ../../library/argparse.rst:1548 msgid "" ">>> class C:\n" "... pass\n" @@ -2602,15 +2615,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1548 +#: ../../library/argparse.rst:1560 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1551 +#: ../../library/argparse.rst:1563 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1558 +#: ../../library/argparse.rst:1570 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2625,69 +2638,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1582 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1572 +#: ../../library/argparse.rst:1584 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1576 +#: ../../library/argparse.rst:1588 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1579 +#: ../../library/argparse.rst:1591 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1583 +#: ../../library/argparse.rst:1595 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1586 +#: ../../library/argparse.rst:1598 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1589 +#: ../../library/argparse.rst:1601 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1592 +#: ../../library/argparse.rst:1604 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1595 +#: ../../library/argparse.rst:1607 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1597 +#: ../../library/argparse.rst:1609 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1600 +#: ../../library/argparse.rst:1612 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1602 +#: ../../library/argparse.rst:1614 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2710,7 +2723,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1621 +#: ../../library/argparse.rst:1633 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2720,7 +2733,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1628 +#: ../../library/argparse.rst:1640 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2729,7 +2742,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1636 +#: ../../library/argparse.rst:1648 #, fuzzy msgid "" ">>> parser.parse_args(['--help'])\n" @@ -2788,14 +2801,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1664 +#: ../../library/argparse.rst:1676 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1668 +#: ../../library/argparse.rst:1680 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2831,7 +2844,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1685 +#: ../../library/argparse.rst:1697 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2839,7 +2852,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1690 +#: ../../library/argparse.rst:1702 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2855,13 +2868,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1697 +#: ../../library/argparse.rst:1709 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1711 +#: ../../library/argparse.rst:1723 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2869,7 +2882,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1716 +#: ../../library/argparse.rst:1728 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2904,7 +2917,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1748 +#: ../../library/argparse.rst:1760 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2914,7 +2927,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1755 +#: ../../library/argparse.rst:1767 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2934,15 +2947,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1764 +#: ../../library/argparse.rst:1776 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1769 +#: ../../library/argparse.rst:1781 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1773 +#: ../../library/argparse.rst:1785 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2951,7 +2964,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1779 +#: ../../library/argparse.rst:1791 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2969,14 +2982,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1785 +#: ../../library/argparse.rst:1797 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1789 +#: ../../library/argparse.rst:1801 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2988,15 +3001,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1794 +#: ../../library/argparse.rst:1806 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1799 +#: ../../library/argparse.rst:1811 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1804 +#: ../../library/argparse.rst:1816 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3005,7 +3018,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1810 +#: ../../library/argparse.rst:1822 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3029,7 +3042,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1821 +#: ../../library/argparse.rst:1833 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3040,7 +3053,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1829 +#: ../../library/argparse.rst:1841 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3078,7 +3091,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1847 +#: ../../library/argparse.rst:1859 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3087,13 +3100,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1852 +#: ../../library/argparse.rst:1864 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1855 +#: ../../library/argparse.rst:1867 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3101,18 +3114,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1863 +#: ../../library/argparse.rst:1875 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1867 +#: ../../library/argparse.rst:1879 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1871 +#: ../../library/argparse.rst:1883 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3138,14 +3151,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1883 +#: ../../library/argparse.rst:1895 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1887 +#: ../../library/argparse.rst:1899 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3163,7 +3176,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1895 +#: ../../library/argparse.rst:1907 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3171,7 +3184,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1901 +#: ../../library/argparse.rst:1913 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3207,7 +3220,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1918 +#: ../../library/argparse.rst:1930 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3215,11 +3228,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1926 +#: ../../library/argparse.rst:1938 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1930 +#: ../../library/argparse.rst:1942 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3228,7 +3241,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1936 +#: ../../library/argparse.rst:1948 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3242,12 +3255,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1954 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1944 +#: ../../library/argparse.rst:1956 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3261,20 +3274,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1950 +#: ../../library/argparse.rst:1962 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1956 +#: ../../library/argparse.rst:1968 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1960 +#: ../../library/argparse.rst:1972 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3286,54 +3299,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1967 +#: ../../library/argparse.rst:1979 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:1969 +#: ../../library/argparse.rst:1981 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1975 +#: ../../library/argparse.rst:1987 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1993 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1985 +#: ../../library/argparse.rst:1997 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1990 +#: ../../library/argparse.rst:2002 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1995 +#: ../../library/argparse.rst:2007 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2000 +#: ../../library/argparse.rst:2012 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2004 +#: ../../library/argparse.rst:2016 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3344,7 +3357,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2013 +#: ../../library/argparse.rst:2025 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3358,7 +3371,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2020 +#: ../../library/argparse.rst:2032 msgid "" ":ref:`Prefix matching <prefix-matching>` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3366,11 +3379,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2027 +#: ../../library/argparse.rst:2039 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2031 +#: ../../library/argparse.rst:2043 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3378,20 +3391,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2036 +#: ../../library/argparse.rst:2048 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:2052 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2043 +#: ../../library/argparse.rst:2055 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3401,18 +3414,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2049 +#: ../../library/argparse.rst:2061 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2053 +#: ../../library/argparse.rst:2065 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2057 +#: ../../library/argparse.rst:2069 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3426,17 +3439,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2065 +#: ../../library/argparse.rst:2077 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2070 +#: ../../library/argparse.rst:2082 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2075 +#: ../../library/argparse.rst:2087 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3444,7 +3457,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2080 +#: ../../library/argparse.rst:2092 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3452,7 +3465,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2085 +#: ../../library/argparse.rst:2097 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3460,7 +3473,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2091 +#: ../../library/argparse.rst:2103 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3480,7 +3493,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2100 +#: ../../library/argparse.rst:2112 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3488,11 +3501,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2109 +#: ../../library/argparse.rst:2121 msgid "Registering custom types or actions" msgstr "" -#: ../../library/argparse.rst:2113 +#: ../../library/argparse.rst:2125 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " @@ -3500,7 +3513,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: ../../library/argparse.rst:2118 +#: ../../library/argparse.rst:2130 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -3508,12 +3521,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: ../../library/argparse.rst:2123 +#: ../../library/argparse.rst:2135 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: ../../library/argparse.rst:2125 +#: ../../library/argparse.rst:2137 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3529,43 +3542,43 @@ msgid "" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" -#: ../../library/argparse.rst:2137 +#: ../../library/argparse.rst:2149 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2141 +#: ../../library/argparse.rst:2153 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2143 +#: ../../library/argparse.rst:2155 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2148 +#: ../../library/argparse.rst:2160 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2152 +#: ../../library/argparse.rst:2164 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:803 +#: ../../library/argparse.rst:815 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:803 ../../library/argparse.rst:837 -#: ../../library/argparse.rst:851 +#: ../../library/argparse.rst:815 ../../library/argparse.rst:849 +#: ../../library/argparse.rst:863 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:849 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:851 +#: ../../library/argparse.rst:863 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po new file mode 100644 index 0000000000..7f602d81ea --- /dev/null +++ b/library/cmdlinelibs.po @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cmdlinelibs.rst:5 +msgid "Command Line Interface Libraries" +msgstr "" + +#: ../../library/cmdlinelibs.rst:7 +msgid "" +"The modules described in this chapter assist with implementing command line " +"and terminal interfaces for applications." +msgstr "" + +#: ../../library/cmdlinelibs.rst:10 +msgid "Here's an overview:" +msgstr "" diff --git a/library/enum.po b/library/enum.po index f316dee80c..f05642bc5b 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -228,10 +228,19 @@ msgstr "" "對如何處理非法值做更細微的控制。" #: ../../library/enum.rst:113 +#, fuzzy +msgid ":class:`EnumDict`" +msgstr ":class:`Enum`" + +#: ../../library/enum.rst:115 +msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." +msgstr "" + +#: ../../library/enum.rst:117 msgid ":class:`auto`" msgstr ":class:`auto`" -#: ../../library/enum.rst:115 +#: ../../library/enum.rst:119 msgid "" "Instances are replaced with an appropriate value for Enum members. :class:" "`StrEnum` defaults to the lower-cased version of the member name, while " @@ -240,11 +249,11 @@ msgstr "" "列舉成員的實例會被取代成合適的值。:class:`StrEnum` 預設是小寫版本的成員名稱," "其它列舉則預設是 1 且往後遞增。" -#: ../../library/enum.rst:119 +#: ../../library/enum.rst:123 msgid ":func:`~enum.property`" msgstr ":func:`~enum.property`" -#: ../../library/enum.rst:121 +#: ../../library/enum.rst:125 msgid "" "Allows :class:`Enum` members to have attributes without conflicting with " "member names. The ``value`` and ``name`` attributes are implemented this " @@ -253,46 +262,46 @@ msgstr "" "允許 :class:`Enum` 成員擁有屬性且不會與成員名稱有衝突。``value`` 及 ``name`` " "屬性是用這個方式來實作。" -#: ../../library/enum.rst:125 +#: ../../library/enum.rst:129 msgid ":func:`unique`" msgstr ":func:`unique`" -#: ../../library/enum.rst:127 +#: ../../library/enum.rst:131 msgid "" "Enum class decorator that ensures only one name is bound to any one value." msgstr "Enum 類別的裝飾器,用來確保任何值只有綁定到一個名稱上。" -#: ../../library/enum.rst:129 +#: ../../library/enum.rst:133 msgid ":func:`verify`" msgstr ":func:`verify`" -#: ../../library/enum.rst:131 +#: ../../library/enum.rst:135 msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." msgstr "Enum 類別的裝飾器,用來檢查列舉上使用者所選的限制。" -#: ../../library/enum.rst:134 +#: ../../library/enum.rst:138 msgid ":func:`member`" msgstr ":func:`member`" -#: ../../library/enum.rst:136 +#: ../../library/enum.rst:140 msgid "Make ``obj`` a member. Can be used as a decorator." msgstr "讓 ``obj`` 變成成員。可以當作裝飾器使用。" -#: ../../library/enum.rst:138 +#: ../../library/enum.rst:142 msgid ":func:`nonmember`" msgstr ":func:`nonmember`" -#: ../../library/enum.rst:140 +#: ../../library/enum.rst:144 msgid "Do not make ``obj`` a member. Can be used as a decorator." msgstr "不讓 ``obj`` 變成成員。可以當作裝飾器使用。" -#: ../../library/enum.rst:142 +#: ../../library/enum.rst:146 msgid ":func:`global_enum`" msgstr ":func:`global_enum`" -#: ../../library/enum.rst:144 +#: ../../library/enum.rst:148 msgid "" "Modify the :class:`str() <str>` and :func:`repr` of an enum to show its " "members as belonging to the module instead of its class, and export the enum " @@ -301,19 +310,19 @@ msgstr "" "修改列舉上的 :class:`str() <str>` 及 :func:`repr` ,讓成員顯示為屬於模組而不" "是類別,並將該列舉成員匯出到全域命名空間。" -#: ../../library/enum.rst:148 +#: ../../library/enum.rst:152 msgid ":func:`show_flag_values`" msgstr ":func:`show_flag_values`" -#: ../../library/enum.rst:150 +#: ../../library/enum.rst:154 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "回傳旗標 (flag) 裡包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:153 +#: ../../library/enum.rst:157 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "``Flag``, ``IntFlag``, ``auto``" -#: ../../library/enum.rst:154 +#: ../../library/enum.rst:158 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" @@ -322,10 +331,14 @@ msgstr "" "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" #: ../../library/enum.rst:159 +msgid "``EnumDict``" +msgstr "" + +#: ../../library/enum.rst:164 msgid "Data Types" msgstr "資料型別" -#: ../../library/enum.rst:164 +#: ../../library/enum.rst:169 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-" @@ -334,7 +347,7 @@ msgstr "" "*EnumType* 是\\ *列舉*\\ 的 :term:`metaclass`。*EnumType* 可以有子類別 -- 細" "節請參考 :ref:`建立 EnumType 的子類別 <enumtype-examples>`。" -#: ../../library/enum.rst:168 +#: ../../library/enum.rst:173 #, fuzzy msgid "" "``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" @@ -346,11 +359,11 @@ msgstr "" "__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成員," "並正確處理重複,提供列舉類別的疊代等等。" -#: ../../library/enum.rst:175 +#: ../../library/enum.rst:180 msgid "This method is called in two different ways:" msgstr "這個方法可以用兩種不同的方式呼叫:" -#: ../../library/enum.rst:177 +#: ../../library/enum.rst:182 msgid "to look up an existing member:" msgstr "查詢已存在的成員:" @@ -358,7 +371,7 @@ msgstr "查詢已存在的成員:" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:179 ../../library/enum.rst:185 +#: ../../library/enum.rst:184 ../../library/enum.rst:190 msgid "The enum class being called." msgstr "所呼叫的列舉類別。" @@ -366,17 +379,17 @@ msgstr "所呼叫的列舉類別。" msgid "value" msgstr "value" -#: ../../library/enum.rst:180 +#: ../../library/enum.rst:185 msgid "The value to lookup." msgstr "要查詢的值。" -#: ../../library/enum.rst:182 +#: ../../library/enum.rst:187 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" msgstr "使用 ``cls`` 列舉來建立新列舉(只有在現有列舉沒有任何成員時)" -#: ../../library/enum.rst:186 +#: ../../library/enum.rst:191 msgid "The name of the new Enum to create." msgstr "要建立的新列舉的名稱。" @@ -384,7 +397,7 @@ msgstr "要建立的新列舉的名稱。" msgid "names" msgstr "names" -#: ../../library/enum.rst:187 +#: ../../library/enum.rst:192 msgid "The names/values of the members for the new Enum." msgstr "新列舉的成員的名稱/值。" @@ -392,7 +405,7 @@ msgstr "新列舉的成員的名稱/值。" msgid "module" msgstr "module" -#: ../../library/enum.rst:188 +#: ../../library/enum.rst:193 msgid "The name of the module the new Enum is created in." msgstr "新列舉要建立在哪個模組名稱下。" @@ -400,7 +413,7 @@ msgstr "新列舉要建立在哪個模組名稱下。" msgid "qualname" msgstr "qualname" -#: ../../library/enum.rst:189 +#: ../../library/enum.rst:194 msgid "The actual location in the module where this Enum can be found." msgstr "這個列舉在模組裡實際上的位置。" @@ -408,7 +421,7 @@ msgstr "這個列舉在模組裡實際上的位置。" msgid "type" msgstr "type" -#: ../../library/enum.rst:190 +#: ../../library/enum.rst:195 msgid "A mix-in type for the new Enum." msgstr "新列舉的混合類型。" @@ -416,7 +429,7 @@ msgstr "新列舉的混合類型。" msgid "start" msgstr "start" -#: ../../library/enum.rst:191 +#: ../../library/enum.rst:196 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" @@ -424,16 +437,16 @@ msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" msgid "boundary" msgstr "boundary" -#: ../../library/enum.rst:192 +#: ../../library/enum.rst:197 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會用到)" -#: ../../library/enum.rst:196 +#: ../../library/enum.rst:201 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" -#: ../../library/enum.rst:198 +#: ../../library/enum.rst:203 msgid "" ">>> some_var = Color.RED\n" ">>> some_var in Color\n" @@ -447,7 +460,7 @@ msgstr "" ">>> Color.RED.value in Color\n" "True" -#: ../../library/enum.rst:206 +#: ../../library/enum.rst:211 msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " "in a containment check." @@ -455,7 +468,7 @@ msgstr "" "在 Python 3.12 之前,如果用非列舉成員做屬於檢查 (containment check) 會引發 " "``TypeError``。" -#: ../../library/enum.rst:211 +#: ../../library/enum.rst:216 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" @@ -463,7 +476,7 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" "員名稱: ::" -#: ../../library/enum.rst:214 +#: ../../library/enum.rst:219 msgid "" ">>> dir(Color)\n" "['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " @@ -475,13 +488,13 @@ msgstr "" "'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " "'__module__', '__name__', '__qualname__']" -#: ../../library/enum.rst:219 +#: ../../library/enum.rst:224 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" -#: ../../library/enum.rst:221 +#: ../../library/enum.rst:226 msgid "" ">>> Color['BLUE']\n" "<Color.BLUE: 3>" @@ -489,11 +502,11 @@ msgstr "" ">>> Color['BLUE']\n" "<Color.BLUE: 3>" -#: ../../library/enum.rst:226 +#: ../../library/enum.rst:231 msgid "Returns each member in *cls* in definition order::" msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" -#: ../../library/enum.rst:228 +#: ../../library/enum.rst:233 msgid "" ">>> list(Color)\n" "[<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 3>]" @@ -501,11 +514,11 @@ msgstr "" ">>> list(Color)\n" "[<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 3>]" -#: ../../library/enum.rst:233 +#: ../../library/enum.rst:238 msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" -#: ../../library/enum.rst:235 +#: ../../library/enum.rst:240 msgid "" ">>> len(Color)\n" "3" @@ -513,15 +526,15 @@ msgstr "" ">>> len(Color)\n" "3" -#: ../../library/enum.rst:240 +#: ../../library/enum.rst:245 msgid "Returns a mapping of every enum name to its member, including aliases" msgstr "回傳每個列舉名稱到其成員的對映,包括別名" -#: ../../library/enum.rst:244 +#: ../../library/enum.rst:249 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:246 +#: ../../library/enum.rst:251 msgid "" ">>> list(reversed(Color))\n" "[<Color.BLUE: 3>, <Color.GREEN: 2>, <Color.RED: 1>]" @@ -529,19 +542,19 @@ msgstr "" ">>> list(reversed(Color))\n" "[<Color.BLUE: 3>, <Color.GREEN: 2>, <Color.RED: 1>]" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:256 msgid "" "Adds a new name as an alias to an existing member. Raises a :exc:" "`NameError` if the name is already assigned to a different member." msgstr "" -#: ../../library/enum.rst:256 +#: ../../library/enum.rst:261 msgid "" "Adds a new value as an alias to an existing member. Raises a :exc:" "`ValueError` if the value is already linked with a different member." msgstr "" -#: ../../library/enum.rst:261 +#: ../../library/enum.rst:266 #, fuzzy msgid "" "Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " @@ -549,15 +562,15 @@ msgid "" msgstr "" "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" -#: ../../library/enum.rst:266 +#: ../../library/enum.rst:271 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:270 +#: ../../library/enum.rst:275 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:277 msgid "" ">>> Color.BLUE.name\n" "'BLUE'" @@ -565,11 +578,11 @@ msgstr "" ">>> Color.BLUE.name\n" "'BLUE'" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:282 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:284 msgid "" ">>> Color.RED.value\n" "1" @@ -577,15 +590,15 @@ msgstr "" ">>> Color.RED.value\n" "1" -#: ../../library/enum.rst:282 ../../library/enum.rst:302 +#: ../../library/enum.rst:287 ../../library/enum.rst:307 msgid "Value of the member, can be set in :meth:`~Enum.__new__`." msgstr "成員的值,可以在 :meth:`~Enum.__new__` 設定。" -#: ../../library/enum.rst:284 +#: ../../library/enum.rst:289 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:286 +#: ../../library/enum.rst:291 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 " @@ -595,7 +608,7 @@ msgstr "" "重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" -#: ../../library/enum.rst:291 +#: ../../library/enum.rst:296 msgid "" "While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " "mutable :class:`~dataclasses.dataclass`, can be used, they will have a " @@ -603,23 +616,23 @@ msgid "" "mutable/unhashable values in the enum." msgstr "" -#: ../../library/enum.rst:298 +#: ../../library/enum.rst:303 msgid "Name of the member." msgstr "成員名稱。" -#: ../../library/enum.rst:306 +#: ../../library/enum.rst:311 msgid "" "No longer used, kept for backward compatibility. (class attribute, removed " "during class creation)." msgstr "已不再使用,只為了向後相容而保留(類別屬性,在類別建立時移除)" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:316 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:314 +#: ../../library/enum.rst:319 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:" @@ -628,7 +641,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod <enum-time-period>`。" -#: ../../library/enum.rst:320 +#: ../../library/enum.rst:325 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -636,7 +649,7 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__module__', 'name', 'value']`` 及任何 " "*self.__class__* 上定義的公開方法: ::" -#: ../../library/enum.rst:323 +#: ../../library/enum.rst:328 msgid "" ">>> from datetime import date\n" ">>> class Weekday(Enum):\n" @@ -676,11 +689,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:341 +#: ../../library/enum.rst:346 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:342 +#: ../../library/enum.rst:347 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -688,7 +701,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:343 +#: ../../library/enum.rst:348 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -696,17 +709,17 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:344 +#: ../../library/enum.rst:349 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:346 +#: ../../library/enum.rst:351 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:349 +#: ../../library/enum.rst:354 msgid "" ">>> from enum import auto\n" ">>> class PowersOfThree(Enum):\n" @@ -730,7 +743,7 @@ msgstr "" ">>> PowersOfThree.SECOND.value\n" "9" -#: ../../library/enum.rst:362 +#: ../../library/enum.rst:367 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." @@ -738,19 +751,19 @@ msgstr "" "預設情況下,不執行任何操作。如果在成員賦值中給出多個值,這些值將成為與 " "``__init__`` 分別的引數;例如" -#: ../../library/enum.rst:369 +#: ../../library/enum.rst:374 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "``Weekday.__init__()`` 將被稱為 ``Weekday.__init__(self, 1, 'Mon')``" -#: ../../library/enum.rst:373 +#: ../../library/enum.rst:378 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:378 +#: ../../library/enum.rst:383 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -758,7 +771,7 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:381 +#: ../../library/enum.rst:386 msgid "" ">>> from enum import StrEnum\n" ">>> class Build(StrEnum):\n" @@ -794,7 +807,7 @@ msgstr "" ">>> Build('deBUG')\n" "<Build.DEBUG: 'debug'>" -#: ../../library/enum.rst:400 +#: ../../library/enum.rst:405 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " @@ -803,12 +816,12 @@ msgstr "" "預設情況下不存在。如果有指定,無論是在列舉類別定義中還是在 mixin 類別中(例" "如 ``int``\\ ),都將傳遞成員賦值中給出的所有值;例如" -#: ../../library/enum.rst:408 +#: ../../library/enum.rst:413 msgid "" "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." msgstr "" -#: ../../library/enum.rst:412 +#: ../../library/enum.rst:417 msgid "" "When writing a custom ``__new__``, do not use ``super().__new__`` -- call " "the appropriate ``__new__`` instead." @@ -816,7 +829,7 @@ msgstr "" "當寫自訂的 ``__new__`` 時,不要使用 ``super().__new__``,而是要呼叫適當的 " "``__new__``。" -#: ../../library/enum.rst:417 +#: ../../library/enum.rst:422 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -824,7 +837,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:420 +#: ../../library/enum.rst:425 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -850,7 +863,7 @@ msgstr "" "ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" -#: ../../library/enum.rst:433 +#: ../../library/enum.rst:438 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -858,7 +871,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:436 +#: ../../library/enum.rst:441 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -882,7 +895,7 @@ msgstr "" "ALTERNATE}\"\n" "(<OtherStyle.ALTERNATE: 1>, 'ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:448 +#: ../../library/enum.rst:453 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -890,7 +903,7 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:451 +#: ../../library/enum.rst:456 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -914,17 +927,17 @@ msgstr "" "ALTERNATE}\"\n" "(<OtherStyle.ALTERNATE: 1>, 'OtherStyle.ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:463 +#: ../../library/enum.rst:468 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:466 +#: ../../library/enum.rst:471 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:476 #, fuzzy msgid "" "*IntEnum* is the same as :class:`Enum`, but its members are also integers " @@ -935,13 +948,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:492 +#: ../../library/enum.rst:497 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:495 +#: ../../library/enum.rst:500 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -951,7 +964,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:502 +#: ../../library/enum.rst:507 #, fuzzy msgid "" "``StrEnum`` is the same as :class:`Enum`, but its members are also strings " @@ -962,7 +975,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:508 +#: ../../library/enum.rst:513 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 " @@ -973,13 +986,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:515 +#: ../../library/enum.rst:520 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:520 +#: ../../library/enum.rst:525 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -989,7 +1002,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:528 +#: ../../library/enum.rst:533 msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " @@ -999,11 +1012,11 @@ msgstr "" "(*OR*)、``^`` (*XOR*) 和 ``~`` (*INVERT*);這些操作的結果是列舉的成員(的別" "名)。" -#: ../../library/enum.rst:534 +#: ../../library/enum.rst:539 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:536 +#: ../../library/enum.rst:541 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1039,11 +1052,11 @@ msgstr "" ">>> white in purple\n" "False" -#: ../../library/enum.rst:555 +#: ../../library/enum.rst:560 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:557 +#: ../../library/enum.rst:562 msgid "" ">>> list(Color.RED)\n" "[<Color.RED: 1>]\n" @@ -1055,11 +1068,11 @@ msgstr "" ">>> list(purple)\n" "[<Color.RED: 1>, <Color.BLUE: 4>]" -#: ../../library/enum.rst:566 +#: ../../library/enum.rst:571 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:568 +#: ../../library/enum.rst:573 msgid "" ">>> len(Color.GREEN)\n" "1\n" @@ -1071,11 +1084,11 @@ msgstr "" ">>> len(white)\n" "3" -#: ../../library/enum.rst:577 +#: ../../library/enum.rst:582 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:579 +#: ../../library/enum.rst:584 msgid "" ">>> bool(Color.GREEN)\n" "True\n" @@ -1093,11 +1106,11 @@ msgstr "" ">>> bool(black)\n" "False" -#: ../../library/enum.rst:589 +#: ../../library/enum.rst:594 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:591 +#: ../../library/enum.rst:596 msgid "" ">>> Color.RED | Color.GREEN\n" "<Color.RED|GREEN: 3>" @@ -1105,11 +1118,11 @@ msgstr "" ">>> Color.RED | Color.GREEN\n" "<Color.RED|GREEN: 3>" -#: ../../library/enum.rst:596 +#: ../../library/enum.rst:601 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:598 +#: ../../library/enum.rst:603 msgid "" ">>> purple & white\n" "<Color.RED|BLUE: 5>\n" @@ -1121,11 +1134,11 @@ msgstr "" ">>> purple & Color.GREEN\n" "<Color: 0>" -#: ../../library/enum.rst:605 +#: ../../library/enum.rst:610 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:607 +#: ../../library/enum.rst:612 msgid "" ">>> purple ^ white\n" "<Color.GREEN: 2>\n" @@ -1137,12 +1150,12 @@ msgstr "" ">>> purple ^ Color.GREEN\n" "<Color.RED|GREEN|BLUE: 7>" -#: ../../library/enum.rst:614 +#: ../../library/enum.rst:619 #, fuzzy msgid "Returns all the flags in *type(self)* that are not in *self*::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:616 +#: ../../library/enum.rst:621 msgid "" ">>> ~white\n" "<Color: 0>\n" @@ -1158,7 +1171,7 @@ msgstr "" ">>> ~Color.RED\n" "<Color.GREEN|BLUE: 6>" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:630 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -1166,17 +1179,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:630 +#: ../../library/enum.rst:635 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:633 +#: ../../library/enum.rst:638 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:646 #, fuzzy msgid "" "``IntFlag`` is the same as :class:`Flag`, but its members are also integers " @@ -1185,13 +1198,13 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:655 +#: ../../library/enum.rst:660 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:658 +#: ../../library/enum.rst:663 msgid "" ">>> Color.RED + 2\n" "3" @@ -1199,35 +1212,35 @@ msgstr "" ">>> Color.RED + 2\n" "3" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:666 #, fuzzy msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:663 +#: ../../library/enum.rst:668 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:664 +#: ../../library/enum.rst:669 #, fuzzy msgid "" "the result is not a valid *IntFlag*: the result depends on the :class:" "`FlagBoundary` setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:666 +#: ../../library/enum.rst:671 #, fuzzy msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:673 +#: ../../library/enum.rst:678 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:678 +#: ../../library/enum.rst:683 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -1237,7 +1250,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:682 +#: ../../library/enum.rst:687 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 " @@ -1246,7 +1259,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:688 +#: ../../library/enum.rst:693 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() <Enum.__repr__>` of :class:`Enum`, " "but the :class:`str() <str>` of the mixed-in data type:" @@ -1254,15 +1267,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() <Enum.__repr__>`,但使" "用混合資料類型的 :class:`str() <str>`:" -#: ../../library/enum.rst:691 +#: ../../library/enum.rst:696 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:692 +#: ../../library/enum.rst:697 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:694 +#: ../../library/enum.rst:699 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() <str>` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -1271,7 +1284,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() <str>` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() <Enum.__str__>`。" -#: ../../library/enum.rst:703 +#: ../../library/enum.rst:708 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -1279,11 +1292,11 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:708 +#: ../../library/enum.rst:713 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:710 +#: ../../library/enum.rst:715 msgid "" ">>> from enum import Enum, verify, UNIQUE\n" ">>> @verify(UNIQUE)\n" @@ -1307,13 +1320,13 @@ msgstr "" "...\n" "ValueError: aliases found in <enum 'Color'>: CRIMSON -> RED" -#: ../../library/enum.rst:724 +#: ../../library/enum.rst:729 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:727 +#: ../../library/enum.rst:732 msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" ">>> @verify(CONTINUOUS)\n" @@ -1335,7 +1348,7 @@ msgstr "" "...\n" "ValueError: invalid enum 'Color': missing values 3, 4" -#: ../../library/enum.rst:739 +#: ../../library/enum.rst:744 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -1343,7 +1356,7 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:742 +#: ../../library/enum.rst:747 msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" ">>> @verify(NAMED_FLAGS)\n" @@ -1371,25 +1384,25 @@ msgstr "" "ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " "combined values of 0x18 [use enum.show_flag_values(value) for details]" -#: ../../library/enum.rst:756 +#: ../../library/enum.rst:761 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:762 +#: ../../library/enum.rst:767 #, fuzzy msgid "" "``FlagBoundary`` controls how out-of-range values are handled in :class:" "`Flag` and its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:772 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:775 msgid "" ">>> from enum import Flag, STRICT, auto\n" ">>> class StrictFlag(Flag, boundary=STRICT):\n" @@ -1417,14 +1430,14 @@ msgstr "" " given 0b0 10100\n" " allowed 0b0 00111" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:790 #, fuzzy msgid "" "Out-of-range values have invalid values removed, leaving a valid :class:" "`Flag` value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:793 msgid "" ">>> from enum import Flag, CONFORM, auto\n" ">>> class ConformFlag(Flag, boundary=CONFORM):\n" @@ -1444,14 +1457,14 @@ msgstr "" ">>> ConformFlag(2**2 + 2**4)\n" "<ConformFlag.BLUE: 4>" -#: ../../library/enum.rst:799 +#: ../../library/enum.rst:804 #, fuzzy msgid "" "Out-of-range values lose their :class:`Flag` membership and revert to :class:" "`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:812 +#: ../../library/enum.rst:817 #, fuzzy msgid "" "Out-of-range values are kept, and the :class:`Flag` membership is kept. This " @@ -1460,7 +1473,7 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:815 +#: ../../library/enum.rst:820 msgid "" ">>> from enum import Flag, KEEP, auto\n" ">>> class KeepFlag(Flag, boundary=KEEP):\n" @@ -1480,11 +1493,34 @@ msgstr "" ">>> KeepFlag(2**2 + 2**4)\n" "<KeepFlag.BLUE|16: 20>" -#: ../../library/enum.rst:829 +#: ../../library/enum.rst:833 +msgid "" +"*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " +"defining enum classes (see :ref:`prepare`). It is exposed to allow " +"subclasses of :class:`EnumType` with advanced behavior like having multiple " +"values per member. It should be called with the name of the enum class being " +"created, otherwise private names and internal classes will not be handled " +"correctly." +msgstr "" + +#: ../../library/enum.rst:840 +msgid "" +"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" +"`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " +"possible to bypass the checks using other :class:`!dict` operations like :" +"meth:`|= <object.__ior__>`." +msgstr "" + +#: ../../library/enum.rst:847 +#, fuzzy +msgid "A list of member names." +msgstr "一個之前值的串列。" + +#: ../../library/enum.rst:854 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:856 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -1492,7 +1528,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:834 +#: ../../library/enum.rst:859 #, fuzzy msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " @@ -1503,38 +1539,38 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:865 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:842 +#: ../../library/enum.rst:867 msgid "" ":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr "" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:869 msgid "" ":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " "existing member." msgstr "" -#: ../../library/enum.rst:846 +#: ../../library/enum.rst:871 msgid ":attr:`~Enum._name_` -- name of the member" msgstr ":attr:`~Enum._name_` -- 成員名稱" -#: ../../library/enum.rst:847 +#: ../../library/enum.rst:872 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr ":attr:`~Enum._value_` -- 成員的值;可以在 ``__new__`` 設定" -#: ../../library/enum.rst:848 +#: ../../library/enum.rst:873 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" ":meth:`~Enum._missing_` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:850 +#: ../../library/enum.rst:875 msgid "" ":attr:`~Enum._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 " @@ -1543,7 +1579,7 @@ msgstr "" ":attr:`~Enum._ignore_` -- 一個名稱的串列,可以是 :class:`list` 或 :class:" "`str`,它不會被轉換成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:878 msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" @@ -1551,14 +1587,14 @@ msgstr "" ":attr:`~Enum._order_` -- 不再被使用,僅為了向後相容而保留(類別屬性,在類別建" "立時移除)" -#: ../../library/enum.rst:855 +#: ../../library/enum.rst:880 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" ":meth:`~Enum._generate_next_value_` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:860 +#: ../../library/enum.rst:885 #, fuzzy msgid "" "For standard :class:`Enum` classes the next value chosen is the highest " @@ -1566,7 +1602,7 @@ msgid "" msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:863 +#: ../../library/enum.rst:888 #, fuzzy msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " @@ -1575,34 +1611,34 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:891 msgid "" "While ``_sunder_`` names are generally reserved for the further development " "of the :class:`Enum` class and can not be used, some are explicitly allowed:" msgstr "" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:894 msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:896 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``、``_order_``、``_generate_next_value_``" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:897 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:873 +#: ../../library/enum.rst:898 msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" msgstr "" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:904 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:883 +#: ../../library/enum.rst:908 #, fuzzy msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " @@ -1619,16 +1655,16 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:916 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:893 +#: ../../library/enum.rst:918 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:919 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1636,7 +1672,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:921 msgid "" "``THREE = [auto(), -3]`` will *not* work (``<auto instance>, -3`` is used to " "create the ``THREE`` enum member)" @@ -1644,19 +1680,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``<auto 實例>, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:926 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:929 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:907 +#: ../../library/enum.rst:932 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 " @@ -1665,7 +1701,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:938 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1674,7 +1710,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:917 +#: ../../library/enum.rst:942 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, " @@ -1684,7 +1720,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:926 +#: ../../library/enum.rst:951 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1694,7 +1730,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:930 +#: ../../library/enum.rst:955 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -1720,7 +1756,7 @@ msgstr "" "...\n" "ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE" -#: ../../library/enum.rst:944 +#: ../../library/enum.rst:969 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1729,15 +1765,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:952 +#: ../../library/enum.rst:977 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:958 +#: ../../library/enum.rst:983 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:964 +#: ../../library/enum.rst:989 msgid "" "A decorator to change the :class:`str() <str>` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1748,19 +1784,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:974 +#: ../../library/enum.rst:998 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:981 +#: ../../library/enum.rst:1006 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:983 +#: ../../library/enum.rst:1008 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:985 +#: ../../library/enum.rst:1010 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:" @@ -1768,17 +1804,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:988 +#: ../../library/enum.rst:1013 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:990 +#: ../../library/enum.rst:1015 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:993 +#: ../../library/enum.rst:1018 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::" @@ -1786,7 +1822,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:996 +#: ../../library/enum.rst:1021 msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" @@ -1796,11 +1832,11 @@ msgstr "" ">>> class MyIntEnum(int, Enum):\n" "... pass" -#: ../../library/enum.rst:1000 +#: ../../library/enum.rst:1025 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" -#: ../../library/enum.rst:1002 +#: ../../library/enum.rst:1027 msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" diff --git a/library/filesys.po b/library/filesys.po index 039d7bf996..7aca43b2ca 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-18 00:04+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2021-11-22 20:13+0800\n" "Last-Translator: Allen Wu <allen91.wu@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,11 +36,11 @@ msgstr "" "取檔案的屬性、以可攜 (portable) 方式操作路徑以及建立暫存檔。本章中的完整 " "module 清單是:" -#: ../../library/filesys.rst:29 +#: ../../library/filesys.rst:28 msgid "Module :mod:`os`" msgstr "Module :mod:`os`" -#: ../../library/filesys.rst:30 +#: ../../library/filesys.rst:29 msgid "" "Operating system interfaces, including functions to work with files at a " "lower level than Python :term:`file objects <file object>`." @@ -48,11 +48,11 @@ msgstr "" "作業系統介面,包括處理比 Python :term:`檔案物件 <file object>`\\ 更低階檔案的" "函式。" -#: ../../library/filesys.rst:33 +#: ../../library/filesys.rst:32 msgid "Module :mod:`io`" msgstr "Module :mod:`io`" -#: ../../library/filesys.rst:34 +#: ../../library/filesys.rst:33 msgid "" "Python's built-in I/O library, including both abstract classes and some " "concrete classes such as file I/O." @@ -60,10 +60,10 @@ msgstr "" "Python 的內建 I/O 函式庫,包含抽象類別和一些具體類別 (concrete class),如檔" "案 I/O。" -#: ../../library/filesys.rst:37 +#: ../../library/filesys.rst:36 msgid "Built-in function :func:`open`" msgstr "內建函式 :func:`open`" -#: ../../library/filesys.rst:38 +#: ../../library/filesys.rst:37 msgid "The standard way to open files for reading and writing with Python." msgstr "使用 Python 打開檔案以進行讀寫檔案的標準方法。" diff --git a/library/getopt.po b/library/getopt.po index 1e4506b15c..e8956c58a6 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2016-01-31 07:19+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,22 +26,16 @@ msgstr ":mod:`!getopt` --- 用於命令列選項的 C 風格剖析器" msgid "**Source code:** :source:`Lib/getopt.py`" msgstr "**原始碼:**\\ :source:`Lib/getopt.py`" -#: ../../library/getopt.rst:10 +#: ../../library/getopt.rst:12 msgid "" -"The :mod:`getopt` module is :term:`soft deprecated` and will not be " -"developed further; development will continue with the :mod:`argparse` module." +"This module is considered feature complete. A more declarative and " +"extensible alternative to this API is provided in the :mod:`optparse` " +"module. Further functional enhancements for command line parameter " +"processing are provided either as third party modules on PyPI, or else as " +"features in the :mod:`argparse` module." msgstr "" -#: ../../library/getopt.rst:17 -msgid "" -"The :mod:`getopt` module is a parser for command line options whose API is " -"designed to be familiar to users of the C :c:func:`!getopt` function. Users " -"who are unfamiliar with the C :c:func:`!getopt` function or who would like " -"to write less code and get better help and error messages should consider " -"using the :mod:`argparse` module instead." -msgstr "" - -#: ../../library/getopt.rst:25 +#: ../../library/getopt.rst:20 msgid "" "This module helps scripts to parse the command line arguments in ``sys." "argv``. It supports the same conventions as the Unix :c:func:`!getopt` " @@ -50,11 +44,21 @@ msgid "" "be used as well via an optional third argument." msgstr "" -#: ../../library/getopt.rst:31 +#: ../../library/getopt.rst:26 +msgid "" +"Users who are unfamiliar with the Unix :c:func:`!getopt` function should " +"consider using the :mod:`argparse` module instead. Users who are familiar " +"with the Unix :c:func:`!getopt` function, but would like to get equivalent " +"behavior while writing less code and getting better help and error messages " +"should consider using the :mod:`optparse` module. See :ref:`choosing-an-" +"argument-parser` for additional details." +msgstr "" + +#: ../../library/getopt.rst:33 msgid "This module provides two functions and an exception:" msgstr "" -#: ../../library/getopt.rst:37 +#: ../../library/getopt.rst:39 msgid "" "Parses command line options and parameter list. *args* is the argument list " "to be parsed, without the leading reference to the running program. " @@ -64,14 +68,14 @@ msgid "" "func:`!getopt` uses)." msgstr "" -#: ../../library/getopt.rst:45 +#: ../../library/getopt.rst:47 msgid "" "Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " "arguments are considered also non-options. This is similar to the way non-" "GNU Unix systems work." msgstr "" -#: ../../library/getopt.rst:49 +#: ../../library/getopt.rst:51 msgid "" "*longopts*, if specified, must be a list of strings with the names of the " "long options which should be supported. The leading ``'--'`` characters " @@ -85,7 +89,7 @@ msgid "" "uniquely, so :exc:`GetoptError` will be raised." msgstr "" -#: ../../library/getopt.rst:60 +#: ../../library/getopt.rst:62 msgid "" "The return value consists of two elements: the first is a list of ``(option, " "value)`` pairs; the second is the list of program arguments left after the " @@ -98,7 +102,7 @@ msgid "" "occurrences. Long and short options may be mixed." msgstr "" -#: ../../library/getopt.rst:73 +#: ../../library/getopt.rst:75 msgid "" "This function works like :func:`getopt`, except that GNU style scanning mode " "is used by default. This means that option and non-option arguments may be " @@ -106,14 +110,14 @@ msgid "" "a non-option argument is encountered." msgstr "" -#: ../../library/getopt.rst:78 +#: ../../library/getopt.rst:80 msgid "" "If the first character of the option string is ``'+'``, or if the " "environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " "processing stops as soon as a non-option argument is encountered." msgstr "" -#: ../../library/getopt.rst:85 +#: ../../library/getopt.rst:87 msgid "" "This is raised when an unrecognized option is found in the argument list or " "when an option requiring an argument is given none. The argument to the " @@ -124,15 +128,15 @@ msgid "" "which the exception relates, :attr:`!opt` is an empty string." msgstr "" -#: ../../library/getopt.rst:96 +#: ../../library/getopt.rst:98 msgid "Alias for :exc:`GetoptError`; for backward compatibility." msgstr "" -#: ../../library/getopt.rst:98 +#: ../../library/getopt.rst:100 msgid "An example using only Unix style options:" msgstr "" -#: ../../library/getopt.rst:100 +#: ../../library/getopt.rst:102 msgid "" ">>> import getopt\n" ">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" @@ -145,11 +149,11 @@ msgid "" "['a1', 'a2']" msgstr "" -#: ../../library/getopt.rst:112 +#: ../../library/getopt.rst:114 msgid "Using long option names is equally easy:" msgstr "" -#: ../../library/getopt.rst:114 +#: ../../library/getopt.rst:116 msgid "" ">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" ">>> args = s.split()\n" @@ -165,11 +169,11 @@ msgid "" "['a1', 'a2']" msgstr "" -#: ../../library/getopt.rst:127 +#: ../../library/getopt.rst:129 msgid "In a script, typical usage is something like this:" msgstr "" -#: ../../library/getopt.rst:129 +#: ../../library/getopt.rst:131 msgid "" "import getopt, sys\n" "\n" @@ -195,20 +199,38 @@ msgid "" " output = a\n" " else:\n" " assert False, \"unhandled option\"\n" -" # ...\n" +" process(args, output=output, verbose=verbose)\n" "\n" "if __name__ == \"__main__\":\n" " main()" msgstr "" -#: ../../library/getopt.rst:158 +#: ../../library/getopt.rst:160 msgid "" "Note that an equivalent command line interface could be produced with less " "code and more informative help and error messages by using the :mod:" -"`argparse` module:" +"`optparse` module:" msgstr "" -#: ../../library/getopt.rst:161 +#: ../../library/getopt.rst:163 +msgid "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" +msgstr "" + +#: ../../library/getopt.rst:174 +msgid "" +"A roughly equivalent command line interface for this case can also be " +"produced by using the :mod:`argparse` module:" +msgstr "" + +#: ../../library/getopt.rst:177 msgid "" "import argparse\n" "\n" @@ -216,15 +238,31 @@ msgid "" " parser = argparse.ArgumentParser()\n" " parser.add_argument('-o', '--output')\n" " parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" " args = parser.parse_args()\n" -" # ... do something with args.output ...\n" -" # ... do something with args.verbose .." +" process(args.rest, output=args.output, verbose=args.verbose)" +msgstr "" + +#: ../../library/getopt.rst:189 +msgid "" +"See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " +"version of this code differs in behaviour from the ``optparse`` (and " +"``getopt``) version." +msgstr "" + +#: ../../library/getopt.rst:195 +#, fuzzy +msgid "Module :mod:`optparse`" +msgstr ":mod:`argparse` 模組" + +#: ../../library/getopt.rst:196 +msgid "Declarative command line option parsing." msgstr "" -#: ../../library/getopt.rst:175 +#: ../../library/getopt.rst:198 msgid "Module :mod:`argparse`" msgstr ":mod:`argparse` 模組" -#: ../../library/getopt.rst:176 -msgid "Alternative command line option and argument parsing library." +#: ../../library/getopt.rst:199 +msgid "More opinionated command line option and argument parsing library." msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 67e1888a11..9dab9f209a 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,384 +55,372 @@ msgstr "" "f(1), ...``。在 Python 中,可以透過結合 :func:`map` 和 :func:`count` 組成 " "``map(f, count())`` 以達到同樣的效果。" -#: ../../library/itertools.rst:33 -msgid "" -"These tools and their built-in counterparts also work well with the high-" -"speed functions in the :mod:`operator` module. For example, the " -"multiplication operator can be mapped across two vectors to form an " -"efficient dot-product: ``sum(starmap(operator.mul, zip(vec1, vec2, " -"strict=True)))``." -msgstr "" -"這些工具及其內建的對等部分 (counterpart) 也可以很好地與 :mod:`operator` 模組" -"中的高速函式配合使用。例如,乘法運算子可以對映到兩個向量上以組成高效率的內" -"積:``sum(starmap(operator.mul, zip(vec1, vec2, strict=True)))``。" - -#: ../../library/itertools.rst:39 +#: ../../library/itertools.rst:34 msgid "**Infinite iterators:**" msgstr "**無限疊代器:**" -#: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:73 +#: ../../library/itertools.rst:37 ../../library/itertools.rst:47 +#: ../../library/itertools.rst:68 msgid "Iterator" msgstr "疊代器" -#: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:73 +#: ../../library/itertools.rst:37 ../../library/itertools.rst:47 +#: ../../library/itertools.rst:68 msgid "Arguments" msgstr "引數" -#: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:73 ../../library/itertools.rst:82 +#: ../../library/itertools.rst:37 ../../library/itertools.rst:47 +#: ../../library/itertools.rst:68 ../../library/itertools.rst:77 msgid "Results" msgstr "結果" -#: ../../library/itertools.rst:42 ../../library/itertools.rst:52 +#: ../../library/itertools.rst:37 ../../library/itertools.rst:47 msgid "Example" msgstr "範例" -#: ../../library/itertools.rst:44 +#: ../../library/itertools.rst:39 msgid ":func:`count`" msgstr ":func:`count`" -#: ../../library/itertools.rst:44 +#: ../../library/itertools.rst:39 msgid "[start[, step]]" msgstr "[start[, step]]" -#: ../../library/itertools.rst:44 +#: ../../library/itertools.rst:39 msgid "start, start+step, start+2*step, ..." msgstr "start, start+step, start+2*step, ..." -#: ../../library/itertools.rst:44 +#: ../../library/itertools.rst:39 msgid "``count(10) → 10 11 12 13 14 ...``" msgstr "``count(10) → 10 11 12 13 14 ...``" -#: ../../library/itertools.rst:45 +#: ../../library/itertools.rst:40 msgid ":func:`cycle`" msgstr ":func:`cycle`" -#: ../../library/itertools.rst:45 +#: ../../library/itertools.rst:40 msgid "p" msgstr "p" -#: ../../library/itertools.rst:45 +#: ../../library/itertools.rst:40 msgid "p0, p1, ... plast, p0, p1, ..." msgstr "p0, p1, ... plast, p0, p1, ..." -#: ../../library/itertools.rst:45 +#: ../../library/itertools.rst:40 msgid "``cycle('ABCD') → A B C D A B C D ...``" msgstr "``cycle('ABCD') → A B C D A B C D ...``" -#: ../../library/itertools.rst:46 +#: ../../library/itertools.rst:41 msgid ":func:`repeat`" msgstr ":func:`repeat`" -#: ../../library/itertools.rst:46 +#: ../../library/itertools.rst:41 msgid "elem [,n]" msgstr "elem [,n]" -#: ../../library/itertools.rst:46 +#: ../../library/itertools.rst:41 msgid "elem, elem, elem, ... endlessly or up to n times" msgstr "elem, elem, elem,... 重複無限次或 n 次" -#: ../../library/itertools.rst:46 +#: ../../library/itertools.rst:41 msgid "``repeat(10, 3) → 10 10 10``" msgstr "``repeat(10, 3) → 10 10 10``" -#: ../../library/itertools.rst:49 +#: ../../library/itertools.rst:44 msgid "**Iterators terminating on the shortest input sequence:**" msgstr "**在最短輸入序列 (shortest input sequence) 處終止的疊代器:**" -#: ../../library/itertools.rst:54 +#: ../../library/itertools.rst:49 msgid ":func:`accumulate`" msgstr ":func:`accumulate`" -#: ../../library/itertools.rst:54 +#: ../../library/itertools.rst:49 msgid "p [,func]" msgstr "p [,func]" -#: ../../library/itertools.rst:54 +#: ../../library/itertools.rst:49 msgid "p0, p0+p1, p0+p1+p2, ..." msgstr "p0, p0+p1, p0+p1+p2, ..." -#: ../../library/itertools.rst:54 +#: ../../library/itertools.rst:49 msgid "``accumulate([1,2,3,4,5]) → 1 3 6 10 15``" msgstr "``accumulate([1,2,3,4,5]) → 1 3 6 10 15``" -#: ../../library/itertools.rst:55 +#: ../../library/itertools.rst:50 msgid ":func:`batched`" msgstr ":func:`batched`" -#: ../../library/itertools.rst:55 +#: ../../library/itertools.rst:50 msgid "p, n" msgstr "p, n" -#: ../../library/itertools.rst:55 +#: ../../library/itertools.rst:50 msgid "(p0, p1, ..., p_n-1), ..." msgstr "(p0, p1, ..., p_n-1), ..." -#: ../../library/itertools.rst:55 +#: ../../library/itertools.rst:50 msgid "``batched('ABCDEFG', n=3) → ABC DEF G``" msgstr "``batched('ABCDEFG', n=3) → ABC DEF G``" -#: ../../library/itertools.rst:56 +#: ../../library/itertools.rst:51 msgid ":func:`chain`" msgstr ":func:`chain`" -#: ../../library/itertools.rst:56 ../../library/itertools.rst:67 +#: ../../library/itertools.rst:51 ../../library/itertools.rst:62 msgid "p, q, ..." msgstr "p, q, ..." -#: ../../library/itertools.rst:56 ../../library/itertools.rst:57 +#: ../../library/itertools.rst:51 ../../library/itertools.rst:52 msgid "p0, p1, ... plast, q0, q1, ..." msgstr "p0, p1, ... plast, q0, q1, ..." -#: ../../library/itertools.rst:56 +#: ../../library/itertools.rst:51 msgid "``chain('ABC', 'DEF') → A B C D E F``" msgstr "``chain('ABC', 'DEF') → A B C D E F``" -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:52 msgid ":func:`chain.from_iterable`" msgstr ":func:`chain.from_iterable`" -#: ../../library/itertools.rst:57 ../../library/itertools.rst:63 +#: ../../library/itertools.rst:52 ../../library/itertools.rst:58 msgid "iterable" msgstr "可疊代物件" -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:52 msgid "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" msgstr "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:53 msgid ":func:`compress`" msgstr ":func:`compress`" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:53 msgid "data, selectors" msgstr "data, selectors" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:53 msgid "(d[0] if s[0]), (d[1] if s[1]), ..." msgstr "(d[0] if s[0]), (d[1] if s[1]), ..." -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:53 msgid "``compress('ABCDEF', [1,0,1,0,1,1]) → A C E F``" msgstr "``compress('ABCDEF', [1,0,1,0,1,1]) → A C E F``" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:54 msgid ":func:`dropwhile`" msgstr ":func:`dropwhile`" -#: ../../library/itertools.rst:59 ../../library/itertools.rst:60 -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:54 ../../library/itertools.rst:55 +#: ../../library/itertools.rst:60 msgid "predicate, seq" msgstr "predicate, seq" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:54 msgid "seq[n], seq[n+1], starting when predicate fails" msgstr "seq[n], seq[n+1],當 predicate 失敗時開始" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:54 msgid "``dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8``" msgstr "``dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8``" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:55 msgid ":func:`filterfalse`" msgstr ":func:`filterfalse`" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:55 msgid "elements of seq where predicate(elem) fails" msgstr "當 predicate(elem) 失敗時 seq 的元素" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:55 msgid "``filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8``" msgstr "``filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8``" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:56 msgid ":func:`groupby`" msgstr ":func:`groupby`" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:56 msgid "iterable[, key]" msgstr "iterable[, key]" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:56 msgid "sub-iterators grouped by value of key(v)" msgstr "根據 key(v) 的值分組的子疊代器" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:56 #, fuzzy msgid "``groupby(['A','B','DEF'], len) → (1, A B) (3, DEF)``" msgstr "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:57 msgid ":func:`islice`" msgstr ":func:`islice`" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:57 msgid "seq, [start,] stop [, step]" msgstr "seq, [start,] stop [, step]" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:57 msgid "elements from seq[start:stop:step]" msgstr "seq[start:stop:step] 的元素" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:57 msgid "``islice('ABCDEFG', 2, None) → C D E F G``" msgstr "``islice('ABCDEFG', 2, None) → C D E F G``" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:58 msgid ":func:`pairwise`" msgstr ":func:`pairwise`" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:58 msgid "(p[0], p[1]), (p[1], p[2])" msgstr "(p[0], p[1]), (p[1], p[2])" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:58 msgid "``pairwise('ABCDEFG') → AB BC CD DE EF FG``" msgstr "``pairwise('ABCDEFG') → AB BC CD DE EF FG``" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:59 msgid ":func:`starmap`" msgstr ":func:`starmap`" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:59 msgid "func, seq" msgstr "func, seq" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:59 msgid "func(\\*seq[0]), func(\\*seq[1]), ..." msgstr "func(\\*seq[0]), func(\\*seq[1]), ..." -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:59 msgid "``starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000``" msgstr "``starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000``" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:60 msgid ":func:`takewhile`" msgstr ":func:`takewhile`" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:60 msgid "seq[0], seq[1], until predicate fails" msgstr "seq[0], seq[1],直到 predicate 失敗" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:60 msgid "``takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4``" msgstr "``takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4``" -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:61 msgid ":func:`tee`" msgstr ":func:`tee`" -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:61 msgid "it, n" msgstr "it, n" -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:61 msgid "it1, it2, ... itn splits one iterator into n" msgstr "it1, it2, ... itn,將一個疊代器分成 n 個" -#: ../../library/itertools.rst:67 +#: ../../library/itertools.rst:62 msgid ":func:`zip_longest`" msgstr ":func:`zip_longest`" -#: ../../library/itertools.rst:67 +#: ../../library/itertools.rst:62 msgid "(p[0], q[0]), (p[1], q[1]), ..." msgstr "(p[0], q[0]), (p[1], q[1]), ..." -#: ../../library/itertools.rst:67 +#: ../../library/itertools.rst:62 msgid "``zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-``" msgstr "``zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-``" -#: ../../library/itertools.rst:70 +#: ../../library/itertools.rst:65 msgid "**Combinatoric iterators:**" msgstr "**組合疊代器:**" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:70 msgid ":func:`product`" msgstr ":func:`product`" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:70 msgid "p, q, ... [repeat=1]" msgstr "p, q, ... [repeat=1]" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:70 msgid "cartesian product, equivalent to a nested for-loop" msgstr "笛卡爾乘積 (cartesian product),相當於巢狀的 for 迴圈" -#: ../../library/itertools.rst:76 +#: ../../library/itertools.rst:71 msgid ":func:`permutations`" msgstr ":func:`permutations`" -#: ../../library/itertools.rst:76 +#: ../../library/itertools.rst:71 msgid "p[, r]" msgstr "p[, r]" -#: ../../library/itertools.rst:76 +#: ../../library/itertools.rst:71 msgid "r-length tuples, all possible orderings, no repeated elements" msgstr "長度為 r 的元組,所有可能的定序,無重複元素" -#: ../../library/itertools.rst:77 +#: ../../library/itertools.rst:72 msgid ":func:`combinations`" msgstr ":func:`combinations`" -#: ../../library/itertools.rst:77 ../../library/itertools.rst:78 +#: ../../library/itertools.rst:72 ../../library/itertools.rst:73 msgid "p, r" msgstr "p, r" -#: ../../library/itertools.rst:77 +#: ../../library/itertools.rst:72 msgid "r-length tuples, in sorted order, no repeated elements" msgstr "長度為 r 的元組,按照排序過後的定序,無重複元素" -#: ../../library/itertools.rst:78 +#: ../../library/itertools.rst:73 msgid ":func:`combinations_with_replacement`" msgstr ":func:`combinations_with_replacement`" -#: ../../library/itertools.rst:78 +#: ../../library/itertools.rst:73 msgid "r-length tuples, in sorted order, with repeated elements" msgstr "長度為 r 的元組,按照排序過後的定序,有重複元素" -#: ../../library/itertools.rst:82 +#: ../../library/itertools.rst:77 msgid "Examples" msgstr "範例" -#: ../../library/itertools.rst:84 +#: ../../library/itertools.rst:79 msgid "``product('ABCD', repeat=2)``" msgstr "``product('ABCD', repeat=2)``" -#: ../../library/itertools.rst:84 +#: ../../library/itertools.rst:79 msgid "``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``" msgstr "``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``" -#: ../../library/itertools.rst:85 +#: ../../library/itertools.rst:80 msgid "``permutations('ABCD', 2)``" msgstr "``permutations('ABCD', 2)``" -#: ../../library/itertools.rst:85 +#: ../../library/itertools.rst:80 msgid "``AB AC AD BA BC BD CA CB CD DA DB DC``" msgstr "``AB AC AD BA BC BD CA CB CD DA DB DC``" -#: ../../library/itertools.rst:86 +#: ../../library/itertools.rst:81 msgid "``combinations('ABCD', 2)``" msgstr "``combinations('ABCD', 2)``" -#: ../../library/itertools.rst:86 +#: ../../library/itertools.rst:81 msgid "``AB AC AD BC BD CD``" msgstr "``AB AC AD BC BD CD``" -#: ../../library/itertools.rst:87 +#: ../../library/itertools.rst:82 msgid "``combinations_with_replacement('ABCD', 2)``" msgstr "``combinations_with_replacement('ABCD', 2)``" -#: ../../library/itertools.rst:87 +#: ../../library/itertools.rst:82 msgid "``AA AB AC AD BB BC BD CC CD DD``" msgstr "``AA AB AC AD BB BC BD CC CD DD``" -#: ../../library/itertools.rst:94 +#: ../../library/itertools.rst:89 msgid "Itertool Functions" msgstr "Itertool 函式" -#: ../../library/itertools.rst:96 +#: ../../library/itertools.rst:91 #, fuzzy msgid "" "The following functions all construct and return iterators. Some provide " @@ -442,13 +430,13 @@ msgstr "" "以下的模組函式都會建構並回傳疊代器。一些函式提供無限長度的串流 (stream),因此" "應僅由截斷串流的函式或迴圈來存取它們。" -#: ../../library/itertools.rst:103 +#: ../../library/itertools.rst:98 msgid "" "Make an iterator that returns accumulated sums or accumulated results from " "other binary functions." msgstr "建立一個回傳累積和的疊代器,或其他二進位函式的累積結果。" -#: ../../library/itertools.rst:106 +#: ../../library/itertools.rst:101 msgid "" "The *function* defaults to addition. The *function* should accept two " "arguments, an accumulated total and a value from the *iterable*." @@ -456,7 +444,7 @@ msgstr "" "*function* 預設為加法。*function* 應接受兩個引數,即累積總和和來自 " "*iterable* 的值。" -#: ../../library/itertools.rst:109 +#: ../../library/itertools.rst:104 msgid "" "If an *initial* value is provided, the accumulation will start with that " "value and the output will have one more element than the input iterable." @@ -464,15 +452,15 @@ msgstr "" "如果提供了 *initial* 值,則累積將從該值開始,並且輸出的元素數將比輸入的可疊代" "物件多一個。" -#: ../../library/itertools.rst:113 ../../library/itertools.rst:186 -#: ../../library/itertools.rst:245 ../../library/itertools.rst:288 -#: ../../library/itertools.rst:489 ../../library/itertools.rst:524 -#: ../../library/itertools.rst:561 ../../library/itertools.rst:637 -#: ../../library/itertools.rst:698 ../../library/itertools.rst:779 +#: ../../library/itertools.rst:108 ../../library/itertools.rst:181 +#: ../../library/itertools.rst:240 ../../library/itertools.rst:283 +#: ../../library/itertools.rst:484 ../../library/itertools.rst:519 +#: ../../library/itertools.rst:556 ../../library/itertools.rst:632 +#: ../../library/itertools.rst:693 ../../library/itertools.rst:774 msgid "Roughly equivalent to::" msgstr "大致等價於: ::" -#: ../../library/itertools.rst:115 +#: ../../library/itertools.rst:110 msgid "" "def accumulate(iterable, function=operator.add, *, initial=None):\n" " 'Return running totals'\n" @@ -494,7 +482,7 @@ msgid "" " yield total" msgstr "" -#: ../../library/itertools.rst:134 +#: ../../library/itertools.rst:129 #, fuzzy msgid "" "To compute a running minimum, set *function* to :func:`min`. For a running " @@ -508,7 +496,7 @@ msgstr "" "也可以透過累積利息和付款來建立\\ `攤銷表 (Amortization tables) <https://www." "ramseysolutions.com/real-estate/amortization-schedule>`_ :" -#: ../../library/itertools.rst:141 +#: ../../library/itertools.rst:136 msgid "" ">>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8]\n" ">>> list(accumulate(data, max)) # running maximum\n" @@ -522,35 +510,35 @@ msgid "" "[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 497]" msgstr "" -#: ../../library/itertools.rst:154 +#: ../../library/itertools.rst:149 msgid "" "See :func:`functools.reduce` for a similar function that returns only the " "final accumulated value." msgstr "" "可參見 :func:`functools.reduce`,其是個類似的函式,但僅回傳最終的累積值。" -#: ../../library/itertools.rst:159 +#: ../../library/itertools.rst:154 msgid "Added the optional *function* parameter." msgstr "新增可選的 *function* 參數。" -#: ../../library/itertools.rst:162 +#: ../../library/itertools.rst:157 msgid "Added the optional *initial* parameter." msgstr "新增可選的 *initial* 參數。" -#: ../../library/itertools.rst:168 +#: ../../library/itertools.rst:163 msgid "" "Batch data from the *iterable* into tuples of length *n*. The last batch may " "be shorter than *n*." msgstr "" "將來自 *iterable* 的資料分批為長度為 *n* 的元組。最後一個批次可能比 *n* 短。" -#: ../../library/itertools.rst:171 +#: ../../library/itertools.rst:166 msgid "" "If *strict* is true, will raise a :exc:`ValueError` if the final batch is " "shorter than *n*." msgstr "" -#: ../../library/itertools.rst:174 +#: ../../library/itertools.rst:169 msgid "" "Loops over the input iterable and accumulates data into tuples up to size " "*n*. The input is consumed lazily, just enough to fill a batch. The result " @@ -561,7 +549,7 @@ msgstr "" "消耗 (consumed lazily) 的,會剛好足夠填充一批的資料。一旦批次填滿或輸入的可疊" "代物件耗盡,就會 yield 出結果:" -#: ../../library/itertools.rst:179 +#: ../../library/itertools.rst:174 msgid "" ">>> flattened_data = ['roses', 'red', 'violets', 'blue', 'sugar', 'sweet']\n" ">>> unflattened = list(batched(flattened_data, 2))\n" @@ -573,7 +561,7 @@ msgstr "" ">>> unflattened\n" "[('roses', 'red'), ('violets', 'blue'), ('sugar', 'sweet')]" -#: ../../library/itertools.rst:188 +#: ../../library/itertools.rst:183 #, fuzzy msgid "" "def batched(iterable, n, *, strict=False):\n" @@ -594,11 +582,11 @@ msgstr "" " while batch := tuple(islice(iterator, n)):\n" " yield batch" -#: ../../library/itertools.rst:200 +#: ../../library/itertools.rst:195 msgid "Added the *strict* option." msgstr "" -#: ../../library/itertools.rst:206 +#: ../../library/itertools.rst:201 #, fuzzy msgid "" "Make an iterator that returns elements from the first iterable until it is " @@ -610,7 +598,7 @@ msgstr "" "代物件,直到所有可疊代物件都耗盡。用於將連續的序列做為單一序列處理。大致等價" "於: ::" -#: ../../library/itertools.rst:211 +#: ../../library/itertools.rst:206 msgid "" "def chain(*iterables):\n" " # chain('ABC', 'DEF') → A B C D E F\n" @@ -618,7 +606,7 @@ msgid "" " yield from iterable" msgstr "" -#: ../../library/itertools.rst:219 +#: ../../library/itertools.rst:214 msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" @@ -626,7 +614,7 @@ msgstr "" ":func:`chain` 的另一個建構函式。從單個可疊代的引數中得到鏈接的輸入,該引數是" "惰性計算的。大致等價於:" -#: ../../library/itertools.rst:222 +#: ../../library/itertools.rst:217 msgid "" "def from_iterable(iterables):\n" " # chain.from_iterable(['ABC', 'DEF']) → A B C D E F\n" @@ -638,11 +626,11 @@ msgstr "" " for iterable in iterables:\n" " yield from iterable" -#: ../../library/itertools.rst:230 +#: ../../library/itertools.rst:225 msgid "Return *r* length subsequences of elements from the input *iterable*." msgstr "從輸入 *iterable* 中回傳長度為 *r* 的元素的子序列。" -#: ../../library/itertools.rst:232 +#: ../../library/itertools.rst:227 msgid "" "The output is a subsequence of :func:`product` keeping only entries that are " "subsequences of the *iterable*. The length of the output is given by :func:" @@ -653,7 +641,7 @@ msgstr "" "度由 :func:`math.comb` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / r! / (n - r)!" "``,當 ``r > n`` 時為零。" -#: ../../library/itertools.rst:237 +#: ../../library/itertools.rst:232 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the output " @@ -662,7 +650,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:241 +#: ../../library/itertools.rst:236 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within " @@ -671,7 +659,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則每" "個組合內將不會有重複的值。" -#: ../../library/itertools.rst:247 +#: ../../library/itertools.rst:242 msgid "" "def combinations(iterable, r):\n" " # combinations('ABCD', 2) → AB AC AD BC BD CD\n" @@ -696,14 +684,14 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:272 +#: ../../library/itertools.rst:267 msgid "" "Return *r* length subsequences of elements from the input *iterable* " "allowing individual elements to be repeated more than once." msgstr "" "回傳來自輸入 *iterable* 的長度為 *r* 的子序列,且允許個別元素重複多次。" -#: ../../library/itertools.rst:275 +#: ../../library/itertools.rst:270 msgid "" "The output is a subsequence of :func:`product` that keeps only entries that " "are subsequences (with possible repeated elements) of the *iterable*. The " @@ -714,7 +702,7 @@ msgstr "" "複元素)的條目。當 ``n > 0`` 時,回傳的子序列數量為 ``(n + r - 1)! / r! / (n " "- 1)!``。" -#: ../../library/itertools.rst:280 +#: ../../library/itertools.rst:275 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. if the input *iterable* is sorted, the output " @@ -723,7 +711,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:284 +#: ../../library/itertools.rst:279 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, the generated combinations will also be " @@ -732,7 +720,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,生成" "的組合也將是獨特的。" -#: ../../library/itertools.rst:290 +#: ../../library/itertools.rst:285 msgid "" "def combinations_with_replacement(iterable, r):\n" " # combinations_with_replacement('ABC', 2) → AA AB AC BB BC CC\n" @@ -754,7 +742,7 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:314 +#: ../../library/itertools.rst:309 msgid "" "Make an iterator that returns elements from *data* where the corresponding " "element in *selectors* is true. Stops when either the *data* or *selectors* " @@ -763,14 +751,14 @@ msgstr "" "建立一個疊代器,回傳 *data* 中對應 *selectors* 的元素為 true 的元素。當 " "*data* 或 *selectors* 可疊代物件耗盡時停止。大致等價於: ::" -#: ../../library/itertools.rst:319 +#: ../../library/itertools.rst:314 msgid "" "def compress(data, selectors):\n" " # compress('ABCDEF', [1,0,1,0,1,1]) → A C E F\n" " return (datum for datum, selector in zip(data, selectors) if selector)" msgstr "" -#: ../../library/itertools.rst:328 +#: ../../library/itertools.rst:323 msgid "" "Make an iterator that returns evenly spaced values beginning with *start*. " "Can be used with :func:`map` to generate consecutive data points or with :" @@ -779,7 +767,7 @@ msgstr "" "建立一個疊代器,回傳從 *start* 開始的等差的值。可以與 :func:`map` 一起使用來" "產生連續的資料點,或與 :func:`zip` 一起使用來增加序列號。大致等價於: ::" -#: ../../library/itertools.rst:333 +#: ../../library/itertools.rst:328 msgid "" "def count(start=0, step=1):\n" " # count(10) → 10 11 12 13 14 ...\n" @@ -797,7 +785,7 @@ msgstr "" " yield n\n" " n += step" -#: ../../library/itertools.rst:341 +#: ../../library/itertools.rst:336 msgid "" "When counting with floating-point numbers, better accuracy can sometimes be " "achieved by substituting multiplicative code such as: ``(start + step * i " @@ -806,11 +794,11 @@ msgstr "" "當用浮點數計數時,將上述程式碼替換為乘法有時可以獲得更好的精確度,例如:" "``(start + step * i for i in count())``。" -#: ../../library/itertools.rst:345 +#: ../../library/itertools.rst:340 msgid "Added *step* argument and allowed non-integer arguments." msgstr "新增 *step* 引數並允許非整數引數。" -#: ../../library/itertools.rst:351 +#: ../../library/itertools.rst:346 msgid "" "Make an iterator returning elements from the *iterable* and saving a copy of " "each. When the iterable is exhausted, return elements from the saved copy. " @@ -819,7 +807,7 @@ msgstr "" "建立一個疊代器,回傳 *iterable* 中的元素並保存每個元素的副本。當可疊代物件耗" "盡時,從保存的副本中回傳元素。會無限次的重複。大致等價於: ::" -#: ../../library/itertools.rst:355 +#: ../../library/itertools.rst:350 #, fuzzy msgid "" "def cycle(iterable):\n" @@ -844,13 +832,13 @@ msgstr "" " for element in saved:\n" " yield element" -#: ../../library/itertools.rst:367 +#: ../../library/itertools.rst:362 msgid "" "This itertool may require significant auxiliary storage (depending on the " "length of the iterable)." msgstr "此 itertool 可能需要大量的輔助儲存空間(取決於可疊代物件的長度)。" -#: ../../library/itertools.rst:373 +#: ../../library/itertools.rst:368 msgid "" "Make an iterator that drops elements from the *iterable* while the " "*predicate* is true and afterwards returns every element. Roughly " @@ -859,7 +847,7 @@ msgstr "" "建立一個疊代器,在 *predicate* 為 true 時丟棄 *iterable* 中的元素,之後回傳每" "個元素。大致等價於:" -#: ../../library/itertools.rst:377 +#: ../../library/itertools.rst:372 msgid "" "def dropwhile(predicate, iterable):\n" " # dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8\n" @@ -885,7 +873,7 @@ msgstr "" " for x in iterator:\n" " yield x" -#: ../../library/itertools.rst:389 +#: ../../library/itertools.rst:384 msgid "" "Note this does not produce *any* output until the predicate first becomes " "false, so this itertool may have a lengthy start-up time." @@ -893,7 +881,7 @@ msgstr "" "注意,在 predicate 首次變為 False 之前,這不會產生\\ *任何*\\ 輸出,所以此 " "itertool 可能會有較長的啟動時間。" -#: ../../library/itertools.rst:395 +#: ../../library/itertools.rst:390 msgid "" "Make an iterator that filters elements from the *iterable* returning only " "those for which the *predicate* returns a false value. If *predicate* is " @@ -902,7 +890,7 @@ msgstr "" "建立一個疊代器,過濾 *iterable* 中的元素,僅回傳 *predicate* 為 False 值的元" "素。如果 *predicate* 是 ``None``,則回傳為 False 的項目。大致等價於: ::" -#: ../../library/itertools.rst:400 +#: ../../library/itertools.rst:395 #, fuzzy msgid "" "def filterfalse(predicate, iterable):\n" @@ -923,7 +911,7 @@ msgstr "" " if not predicate(x):\n" " yield x" -#: ../../library/itertools.rst:413 +#: ../../library/itertools.rst:408 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -936,7 +924,7 @@ msgstr "" "(identity function),並回傳未被更改的元素。一般來說,可疊代物件需要已經用相同" "的鍵函式進行排序。" -#: ../../library/itertools.rst:419 +#: ../../library/itertools.rst:414 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -949,7 +937,7 @@ msgstr "" "料進行排序)。這種行為不同於 SQL 的 GROUP BY,其無論輸入順序如何都會聚合相同" "的元素。" -#: ../../library/itertools.rst:425 +#: ../../library/itertools.rst:420 msgid "" "The returned group is itself an iterator that shares the underlying iterable " "with :func:`groupby`. Because the source is shared, when the :func:" @@ -960,7 +948,7 @@ msgstr "" "共享的,當 :func:`groupby` 物件前進時,前一個群組將不再可見。因此,如果之後需" "要該資料,應將其儲存為串列: ::" -#: ../../library/itertools.rst:430 +#: ../../library/itertools.rst:425 msgid "" "groups = []\n" "uniquekeys = []\n" @@ -970,11 +958,11 @@ msgid "" " uniquekeys.append(k)" msgstr "" -#: ../../library/itertools.rst:437 +#: ../../library/itertools.rst:432 msgid ":func:`groupby` is roughly equivalent to::" msgstr ":func:`groupby` 大致等價於: ::" -#: ../../library/itertools.rst:439 +#: ../../library/itertools.rst:434 msgid "" "def groupby(iterable, key=None):\n" " # [k for k, g in groupby('AAAABBBCCDAABBB')] → A B C D A B\n" @@ -1040,7 +1028,7 @@ msgstr "" " for _ in curr_group:\n" " pass" -#: ../../library/itertools.rst:475 +#: ../../library/itertools.rst:470 msgid "" "Make an iterator that returns selected elements from the iterable. Works " "like sequence slicing but does not support negative values for *start*, " @@ -1049,7 +1037,7 @@ msgstr "" "建立一個疊代器,回傳從 iterable 中選取的元素。其作用類似於序列切片 (sequence " "slicing),但不支援負數的 *start*、*stop* 或 *step* 的值。" -#: ../../library/itertools.rst:479 +#: ../../library/itertools.rst:474 msgid "" "If *start* is zero or ``None``, iteration starts at zero. Otherwise, " "elements from the iterable are skipped until *start* is reached." @@ -1057,7 +1045,7 @@ msgstr "" "如果 *start* 為零或 ``None``,則從零開始疊代。否則在達到 *start* 之前,會跳" "過 iterable 中的元素。" -#: ../../library/itertools.rst:482 +#: ../../library/itertools.rst:477 #, fuzzy msgid "" "If *stop* is ``None``, iteration continues until the input is exhausted, if " @@ -1066,7 +1054,7 @@ msgstr "" "如果 *stop* 為 ``None``,則疊代將繼續前進直到疊代器耗盡。如果指定了 *stop*," "則在達到指定位置時停止。" -#: ../../library/itertools.rst:485 +#: ../../library/itertools.rst:480 msgid "" "If *step* is ``None``, the step defaults to one. Elements are returned " "consecutively unless *step* is set higher than one which results in items " @@ -1075,7 +1063,7 @@ msgstr "" "如果 *step* 為 ``None``,則步長 (step) 預設為一。元素會連續回傳,除非將 " "*step* 設定為大於一,這會導致一些項目被跳過。" -#: ../../library/itertools.rst:491 +#: ../../library/itertools.rst:486 msgid "" "def islice(iterable, *args):\n" " # islice('ABCDEFG', 2) → A B\n" @@ -1117,17 +1105,17 @@ msgstr "" " yield element\n" " next_i += step" -#: ../../library/itertools.rst:511 +#: ../../library/itertools.rst:506 msgid "" "If the input is an iterator, then fully consuming the *islice* advances the " "input iterator by ``max(start, stop)`` steps regardless of the *step* value." msgstr "" -#: ../../library/itertools.rst:518 +#: ../../library/itertools.rst:513 msgid "Return successive overlapping pairs taken from the input *iterable*." msgstr "回傳從輸入的 *iterable* 中提取的連續重疊對。" -#: ../../library/itertools.rst:520 +#: ../../library/itertools.rst:515 msgid "" "The number of 2-tuples in the output iterator will be one fewer than the " "number of inputs. It will be empty if the input iterable has fewer than two " @@ -1136,7 +1124,7 @@ msgstr "" "輸出疊代器中的 2 元組數量將比輸入少一個。如果輸入的可疊代物件中的值少於兩個," "則輸出將為空值。" -#: ../../library/itertools.rst:526 +#: ../../library/itertools.rst:521 #, fuzzy msgid "" "def pairwise(iterable):\n" @@ -1157,7 +1145,7 @@ msgstr "" " yield a, b\n" " a = b" -#: ../../library/itertools.rst:541 +#: ../../library/itertools.rst:536 msgid "" "Return successive *r* length `permutations of elements <https://www." "britannica.com/science/permutation>`_ from the *iterable*." @@ -1165,7 +1153,7 @@ msgstr "" "回傳 *iterable* 中連續且長度為 *r* 的\\ `元素排列 <https://www.britannica." "com/science/permutation>`_ 。" -#: ../../library/itertools.rst:544 +#: ../../library/itertools.rst:539 msgid "" "If *r* is not specified or is ``None``, then *r* defaults to the length of " "the *iterable* and all possible full-length permutations are generated." @@ -1173,7 +1161,7 @@ msgstr "" "如果未指定 *r* 或其值為 ``None``,則 *r* 預設為 *iterable* 的長度,並產生所有" "可能的完整長度的排列。" -#: ../../library/itertools.rst:548 +#: ../../library/itertools.rst:543 msgid "" "The output is a subsequence of :func:`product` where entries with repeated " "elements have been filtered out. The length of the output is given by :func:" @@ -1184,7 +1172,7 @@ msgstr "" "func:`math.perm` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / (n - r)!``,當 ``r " "> n`` 時為零。" -#: ../../library/itertools.rst:553 +#: ../../library/itertools.rst:548 msgid "" "The permutation tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the " @@ -1193,7 +1181,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,排列的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:557 +#: ../../library/itertools.rst:552 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within a " @@ -1202,7 +1190,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則排" "列中將不會有重複的值。" -#: ../../library/itertools.rst:563 +#: ../../library/itertools.rst:558 msgid "" "def permutations(iterable, r=None):\n" " # permutations('ABCD', 2) → AB AC AD BA BC BD CA CB CD DA DB DC\n" @@ -1260,13 +1248,13 @@ msgstr "" " else:\n" " return" -#: ../../library/itertools.rst:594 +#: ../../library/itertools.rst:589 msgid "" "`Cartesian product <https://en.wikipedia.org/wiki/Cartesian_product>`_ of " "the input iterables." msgstr "" -#: ../../library/itertools.rst:597 +#: ../../library/itertools.rst:592 msgid "" "Roughly equivalent to nested for-loops in a generator expression. For " "example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in " @@ -1275,7 +1263,7 @@ msgstr "" "大致等價於產生器運算式中的巢狀 for 迴圈。例如,``product(A, B)`` 的回傳結果" "與 ``((x,y) for x in A for y in B)`` 相同。" -#: ../../library/itertools.rst:600 +#: ../../library/itertools.rst:595 msgid "" "The nested loops cycle like an odometer with the rightmost element advancing " "on every iteration. This pattern creates a lexicographic ordering so that " @@ -1285,7 +1273,7 @@ msgstr "" "巢狀迴圈的循環類似於里程表,最右邊的元素在每次疊代時前進。這種模式會建立字典" "順序,因此如果輸入的 iterables 已排序,則輸出的乘積元組也將按排序的順序產生。" -#: ../../library/itertools.rst:605 +#: ../../library/itertools.rst:600 msgid "" "To compute the product of an iterable with itself, specify the number of " "repetitions with the optional *repeat* keyword argument. For example, " @@ -1294,7 +1282,7 @@ msgstr "" "要計算可疊代物件自身的乘積,可以使用可選的 *repeat* 關鍵字引數來指定重複次" "數。例如,``product(A, repeat=4)`` 與 ``product(A, A, A, A)`` 相同。" -#: ../../library/itertools.rst:609 +#: ../../library/itertools.rst:604 msgid "" "This function is roughly equivalent to the following code, except that the " "actual implementation does not build up intermediate results in memory::" @@ -1302,7 +1290,7 @@ msgstr "" "此函式大致等價於以下的程式碼,不同之處在於真正的實作不會在記憶體中建立中間結" "果: ::" -#: ../../library/itertools.rst:612 +#: ../../library/itertools.rst:607 #, fuzzy msgid "" "def product(*iterables, repeat=1):\n" @@ -1333,7 +1321,7 @@ msgstr "" " for prod in result:\n" " yield tuple(prod)" -#: ../../library/itertools.rst:627 +#: ../../library/itertools.rst:622 msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " @@ -1342,7 +1330,7 @@ msgstr "" "在 :func:`product` 執行之前,它會完全消耗輸入的 iterables,並將值的池 (pools " "of values) 保存在記憶體中以產生乘積。因此,它僅對有限的輸入有用。" -#: ../../library/itertools.rst:634 +#: ../../library/itertools.rst:629 msgid "" "Make an iterator that returns *object* over and over again. Runs " "indefinitely unless the *times* argument is specified." @@ -1350,7 +1338,7 @@ msgstr "" "建立一個疊代器,反覆回傳 *object*。除非指定了 *times* 引數,否則會執行無限" "次。" -#: ../../library/itertools.rst:639 +#: ../../library/itertools.rst:634 msgid "" "def repeat(object, times=None):\n" " # repeat(10, 3) → 10 10 10\n" @@ -1370,13 +1358,13 @@ msgstr "" " for i in range(times):\n" " yield object" -#: ../../library/itertools.rst:648 +#: ../../library/itertools.rst:643 msgid "" "A common use for *repeat* is to supply a stream of constant values to *map* " "or *zip*:" msgstr "*repeat* 的常見用途是為 *map* 或 *zip* 提供定值的串流:" -#: ../../library/itertools.rst:651 +#: ../../library/itertools.rst:646 msgid "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" @@ -1384,7 +1372,7 @@ msgstr "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" -#: ../../library/itertools.rst:659 +#: ../../library/itertools.rst:654 msgid "" "Make an iterator that computes the *function* using arguments obtained from " "the *iterable*. Used instead of :func:`map` when argument parameters have " @@ -1393,7 +1381,7 @@ msgstr "" "建立一個疊代器,使用從 *iterable* 獲取的引數計算 *function* 。當引數參數已經" "被「預先壓縮 (pre-zipped)」成元組時,使用此方法代替 :func:`map`。" -#: ../../library/itertools.rst:663 +#: ../../library/itertools.rst:658 msgid "" "The difference between :func:`map` and :func:`starmap` parallels the " "distinction between ``function(a,b)`` and ``function(*c)``. Roughly " @@ -1402,7 +1390,7 @@ msgstr "" ":func:`map` 和 :func:`starmap` 之間的區別類似於 ``function(a,b)`` 和 " "``function(*c)`` 之間的區別。大致等價於:" -#: ../../library/itertools.rst:667 +#: ../../library/itertools.rst:662 msgid "" "def starmap(function, iterable):\n" " # starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000\n" @@ -1414,7 +1402,7 @@ msgstr "" " for args in iterable:\n" " yield function(*args)" -#: ../../library/itertools.rst:675 +#: ../../library/itertools.rst:670 msgid "" "Make an iterator that returns elements from the *iterable* as long as the " "*predicate* is true. Roughly equivalent to::" @@ -1422,7 +1410,7 @@ msgstr "" "建立一個疊代器,只在 *predicate* 為 true 時回傳 *iterable* 中的元素。大致等價" "於:" -#: ../../library/itertools.rst:678 +#: ../../library/itertools.rst:673 msgid "" "def takewhile(predicate, iterable):\n" " # takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4\n" @@ -1438,13 +1426,14 @@ msgstr "" " break\n" " yield x" -#: ../../library/itertools.rst:685 +#: ../../library/itertools.rst:680 +#, fuzzy msgid "" "Note, the element that first fails the predicate condition is consumed from " "the input iterator and there is no way to access it. This could be an issue " "if an application wants to further consume the input iterator after " "*takewhile* has been run to exhaustion. To work around this problem, " -"consider using `more-iterools before_and_after() <https://more-itertools." +"consider using `more-itertools before_and_after() <https://more-itertools." "readthedocs.io/en/stable/api.html#more_itertools.before_and_after>`_ instead." msgstr "" "注意,第一個不符合條件判斷的元素將從輸入疊代器中被消耗,且無法再存取它。如果" @@ -1453,11 +1442,11 @@ msgstr "" "more-itertools.readthedocs.io/en/stable/api.html#more_itertools." "before_and_after>`_ 作為替代。" -#: ../../library/itertools.rst:696 +#: ../../library/itertools.rst:691 msgid "Return *n* independent iterators from a single iterable." msgstr "從一個 iterable 中回傳 *n* 個獨立的疊代器。" -#: ../../library/itertools.rst:700 +#: ../../library/itertools.rst:695 msgid "" "def tee(iterable, n=2):\n" " if n < 0:\n" @@ -1493,7 +1482,7 @@ msgid "" " return value" msgstr "" -#: ../../library/itertools.rst:733 +#: ../../library/itertools.rst:728 msgid "" "When the input *iterable* is already a tee iterator object, all members of " "the return tuple are constructed as if they had been produced by the " @@ -1502,11 +1491,11 @@ msgid "" "update step rather than a chain of calls." msgstr "" -#: ../../library/itertools.rst:739 +#: ../../library/itertools.rst:734 msgid "The flattening property makes tee iterators efficiently peekable:" msgstr "" -#: ../../library/itertools.rst:741 +#: ../../library/itertools.rst:736 msgid "" "def lookahead(tee_iterator):\n" " \"Return the next value without moving the input forward\"\n" @@ -1514,7 +1503,7 @@ msgid "" " return next(forked_iterator)" msgstr "" -#: ../../library/itertools.rst:748 +#: ../../library/itertools.rst:743 msgid "" ">>> iterator = iter('abcdef')\n" ">>> [iterator] = tee(iterator, 1) # Make the input peekable\n" @@ -1526,7 +1515,7 @@ msgid "" "'b'" msgstr "" -#: ../../library/itertools.rst:759 +#: ../../library/itertools.rst:754 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " "when simultaneously using iterators returned by the same :func:`tee` call, " @@ -1536,7 +1525,7 @@ msgstr "" "呼叫所回傳的疊代器時,即使原始的 *iterable* 是執行緒安全的,也可能引發 :exc:" "`RuntimeError`。" -#: ../../library/itertools.rst:763 +#: ../../library/itertools.rst:758 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -1547,11 +1536,11 @@ msgstr "" "果一個疊代器在另一個疊代器開始之前使用了大部分或全部的資料,使用 :func:" "`list` 會比 :func:`tee` 更快。" -#: ../../library/itertools.rst:771 +#: ../../library/itertools.rst:766 msgid "Make an iterator that aggregates elements from each of the *iterables*." msgstr "建立一個疊代器,聚合來自每個 *iterables* 中的元素。" -#: ../../library/itertools.rst:774 +#: ../../library/itertools.rst:769 msgid "" "If the iterables are of uneven length, missing values are filled-in with " "*fillvalue*. If not specified, *fillvalue* defaults to ``None``." @@ -1559,11 +1548,11 @@ msgstr "" "如果 iterables 的長度不一,則使用 *fillvalue* 填充缺少的值。如果未指定," "*fillvalue* 會預設為 ``None``。" -#: ../../library/itertools.rst:777 +#: ../../library/itertools.rst:772 msgid "Iteration continues until the longest iterable is exhausted." msgstr "疊代將持續直到最長的可疊代物件耗盡為止。" -#: ../../library/itertools.rst:781 +#: ../../library/itertools.rst:776 msgid "" "def zip_longest(*iterables, fillvalue=None):\n" " # zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-\n" @@ -1609,7 +1598,7 @@ msgstr "" " values.append(value)\n" " yield tuple(values)" -#: ../../library/itertools.rst:803 +#: ../../library/itertools.rst:798 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " @@ -1618,18 +1607,18 @@ msgstr "" "如果其中一個 iterables 可能是無限的,那麼應該用別的可以限制呼叫次數的方法來包" "裝 :func:`zip_longest` 函式(例如 :func:`islice` 或 :func:`takewhile`)。" -#: ../../library/itertools.rst:811 +#: ../../library/itertools.rst:806 msgid "Itertools Recipes" msgstr "Itertools 應用技巧" -#: ../../library/itertools.rst:813 +#: ../../library/itertools.rst:808 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" "此段落展示了使用現有的 itertools 作為構建塊來建立擴展工具集的應用技巧。" -#: ../../library/itertools.rst:816 +#: ../../library/itertools.rst:811 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -1647,7 +1636,7 @@ msgstr "" "`collections` 模組一同使用以及與內建 itertools(如 ``map()``、``filter()``、" "``reversed()`` 和 ``enumerate()``)一同使用的模式。" -#: ../../library/itertools.rst:825 +#: ../../library/itertools.rst:820 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " @@ -1659,7 +1648,7 @@ msgstr "" "``sliding_window()``、``iter_index()`` 和 ``sieve()`` 的應用技巧正在被測試," "以確定它們是否有價值被收錄到內建的 itertools 中。" -#: ../../library/itertools.rst:830 +#: ../../library/itertools.rst:825 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the :pypi:`more-itertools` project found on the Python Package Index::" @@ -1667,11 +1656,11 @@ msgstr "" "幾乎所有這些應用技巧以及許多其他應用技巧都可以從 Python Package Index 上的 :" "pypi:`more-itertools` 專案中安裝: ::" -#: ../../library/itertools.rst:834 +#: ../../library/itertools.rst:829 msgid "python -m pip install more-itertools" msgstr "python -m pip install more-itertools" -#: ../../library/itertools.rst:836 +#: ../../library/itertools.rst:831 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -1689,14 +1678,13 @@ msgstr "" "用「向量化 (vectorized)」的構建塊而不是使用會造成直譯器負擔的 for 迴圈和\\ :" "term:`產生器 <generator>`,則能保持高速度。" -#: ../../library/itertools.rst:844 +#: ../../library/itertools.rst:839 msgid "" -"import collections\n" -"import contextlib\n" -"import functools\n" -"import math\n" -"import operator\n" -"import random\n" +"from collections import deque\n" +"from contextlib import suppress\n" +"from functools import reduce\n" +"from math import sumprod, isqrt\n" +"from operator import itemgetter, getitem, mul, neg\n" "\n" "def take(n, iterable):\n" " \"Return first n items of the iterable as a list.\"\n" @@ -1711,11 +1699,11 @@ msgid "" " \"Return function(0), function(1), ...\"\n" " return map(function, count(start))\n" "\n" -"def repeatfunc(func, times=None, *args):\n" -" \"Repeat calls to func with specified arguments.\"\n" +"def repeatfunc(function, times=None, *args):\n" +" \"Repeat calls to a function with specified arguments.\"\n" " if times is None:\n" -" return starmap(func, repeat(args))\n" -" return starmap(func, repeat(args, times))\n" +" return starmap(function, repeat(args))\n" +" return starmap(function, repeat(args, times))\n" "\n" "def flatten(list_of_lists):\n" " \"Flatten one level of nesting.\"\n" @@ -1733,13 +1721,13 @@ msgid "" "def tail(n, iterable):\n" " \"Return an iterator over the last n items.\"\n" " # tail(3, 'ABCDEFG') → E F G\n" -" return iter(collections.deque(iterable, maxlen=n))\n" +" return iter(deque(iterable, maxlen=n))\n" "\n" "def consume(iterator, n=None):\n" " \"Advance the iterator n-steps ahead. If n is None, consume entirely.\"\n" " # Use functions that consume iterators at C speed.\n" " if n is None:\n" -" collections.deque(iterator, maxlen=0)\n" +" deque(iterator, maxlen=0)\n" " else:\n" " next(islice(iterator, n, n), None)\n" "\n" @@ -1770,8 +1758,8 @@ msgid "" " # unique_justseen('AAAABBBCCDAABBB') → A B C D A B\n" " # unique_justseen('ABBcCAD', str.casefold) → A B c A D\n" " if key is None:\n" -" return map(operator.itemgetter(0), groupby(iterable))\n" -" return map(next, map(operator.itemgetter(1), groupby(iterable, key)))\n" +" return map(itemgetter(0), groupby(iterable))\n" +" return map(next, map(itemgetter(1), groupby(iterable, key)))\n" "\n" "def unique_everseen(iterable, key=None):\n" " \"Yield unique elements, preserving order. Remember all elements ever " @@ -1793,14 +1781,14 @@ msgid "" "def unique(iterable, key=None, reverse=False):\n" " \"Yield unique elements in sorted order. Supports unhashable inputs.\"\n" " # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]\n" -" return unique_justseen(sorted(iterable, key=key, reverse=reverse), " -"key=key)\n" +" sequenced = sorted(iterable, key=key, reverse=reverse)\n" +" return unique_justseen(sequenced, key=key)\n" "\n" "def sliding_window(iterable, n):\n" " \"Collect data into overlapping fixed-length chunks or blocks.\"\n" " # sliding_window('ABCDEFG', 4) → ABCD BCDE CDEF DEFG\n" " iterator = iter(iterable)\n" -" window = collections.deque(islice(iterator, n - 1), maxlen=n)\n" +" window = deque(islice(iterator, n - 1), maxlen=n)\n" " for x in iterator:\n" " window.append(x)\n" " yield tuple(window)\n" @@ -1834,7 +1822,7 @@ msgid "" " \"Return all contiguous non-empty subslices of a sequence.\"\n" " # subslices('ABCD') → A AB ABC ABCD B BC BCD C CD D\n" " slices = starmap(slice, combinations(range(len(seq) + 1), 2))\n" -" return map(operator.getitem, repeat(seq), slices)\n" +" return map(getitem, repeat(seq), slices)\n" "\n" "def iter_index(iterable, value, start=0, stop=None):\n" " \"Return indices where a value occurs in a sequence or iterable.\"\n" @@ -1848,41 +1836,42 @@ msgid "" " else:\n" " stop = len(iterable) if stop is None else stop\n" " i = start\n" -" with contextlib.suppress(ValueError):\n" +" with suppress(ValueError):\n" " while True:\n" " yield (i := seq_index(value, i, stop))\n" " i += 1\n" "\n" -"def iter_except(func, exception, first=None):\n" +"def iter_except(function, exception, first=None):\n" " \"Convert a call-until-exception interface to an iterator interface.\"\n" " # iter_except(d.popitem, KeyError) → non-blocking dictionary iterator\n" -" with contextlib.suppress(exception):\n" +" with suppress(exception):\n" " if first is not None:\n" " yield first()\n" " while True:\n" -" yield func()" +" yield function()" msgstr "" -#: ../../library/itertools.rst:1013 +#: ../../library/itertools.rst:1008 msgid "The following recipes have a more mathematical flavor:" msgstr "以下的應用技巧具有更多的數學風格:" -#: ../../library/itertools.rst:1015 +#: ../../library/itertools.rst:1010 msgid "" "def powerset(iterable):\n" -" \"powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\"\n" +" \"Subsequences of the iterable from shortest to longest.\"\n" +" # powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\n" " s = list(iterable)\n" " return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))\n" "\n" "def sum_of_squares(iterable):\n" " \"Add up the squares of the input values.\"\n" " # sum_of_squares([10, 20, 30]) → 1400\n" -" return math.sumprod(*tee(iterable))\n" +" return sumprod(*tee(iterable))\n" "\n" -"def reshape(matrix, cols):\n" +"def reshape(matrix, columns):\n" " \"Reshape a 2-D matrix to have a given number of columns.\"\n" " # reshape([(0, 1), (2, 3), (4, 5)], 3) → (0, 1, 2), (3, 4, 5)\n" -" return batched(chain.from_iterable(matrix), cols, strict=True)\n" +" return batched(chain.from_iterable(matrix), columns, strict=True)\n" "\n" "def transpose(matrix):\n" " \"Swap the rows and columns of a 2-D matrix.\"\n" @@ -1893,7 +1882,7 @@ msgid "" " \"Multiply two matrices.\"\n" " # matmul([(7, 5), (3, 5)], [(2, 5), (7, 9)]) → (49, 80), (41, 60)\n" " n = len(m2[0])\n" -" return batched(starmap(math.sumprod, product(m1, transpose(m2))), n)\n" +" return batched(starmap(sumprod, product(m1, transpose(m2))), n)\n" "\n" "def convolve(signal, kernel):\n" " \"\"\"Discrete linear convolution of two iterables.\n" @@ -1914,7 +1903,7 @@ msgid "" " n = len(kernel)\n" " padded_signal = chain(repeat(0, n-1), signal, repeat(0, n-1))\n" " windowed_signal = sliding_window(padded_signal, n)\n" -" return map(math.sumprod, repeat(kernel), windowed_signal)\n" +" return map(sumprod, repeat(kernel), windowed_signal)\n" "\n" "def polynomial_from_roots(roots):\n" " \"\"\"Compute a polynomial's coefficients from its roots.\n" @@ -1922,8 +1911,8 @@ msgid "" " (x - 5) (x + 4) (x - 3) expands to: x³ -4x² -17x + 60\n" " \"\"\"\n" " # polynomial_from_roots([5, -4, 3]) → [1, -4, -17, 60]\n" -" factors = zip(repeat(1), map(operator.neg, roots))\n" -" return list(functools.reduce(convolve, factors, [1]))\n" +" factors = zip(repeat(1), map(neg, roots))\n" +" return list(reduce(convolve, factors, [1]))\n" "\n" "def polynomial_eval(coefficients, x):\n" " \"\"\"Evaluate a polynomial at a specific value.\n" @@ -1936,7 +1925,7 @@ msgid "" " if not n:\n" " return type(x)(0)\n" " powers = map(pow, repeat(x), reversed(range(n)))\n" -" return math.sumprod(coefficients, powers)\n" +" return sumprod(coefficients, powers)\n" "\n" "def polynomial_derivative(coefficients):\n" " \"\"\"Compute the first derivative of a polynomial.\n" @@ -1947,7 +1936,7 @@ msgid "" " # polynomial_derivative([1, -4, -17, 60]) → [3, -8, -17]\n" " n = len(coefficients)\n" " powers = reversed(range(1, n))\n" -" return list(map(operator.mul, coefficients, powers))\n" +" return list(map(mul, coefficients, powers))\n" "\n" "def sieve(n):\n" " \"Primes less than n.\"\n" @@ -1955,21 +1944,16 @@ msgid "" " if n > 2:\n" " yield 2\n" " data = bytearray((0, 1)) * (n // 2)\n" -" for p in iter_index(data, 1, start=3, stop=math.isqrt(n) + 1):\n" +" for p in iter_index(data, 1, start=3, stop=isqrt(n) + 1):\n" " data[p*p : n : p+p] = bytes(len(range(p*p, n, p+p)))\n" " yield from iter_index(data, 1, start=3)\n" "\n" -"def is_prime(n):\n" -" \"Return True if n is prime.\"\n" -" # is_prime(1_000_000_000_000_403) → True\n" -" return n > 1 and all(n % p for p in sieve(math.isqrt(n) + 1))\n" -"\n" "def factor(n):\n" " \"Prime factors of n.\"\n" " # factor(99) → 3 3 11\n" " # factor(1_000_000_000_000_007) → 47 59 360620266859\n" " # factor(1_000_000_000_000_403) → 1000000000000403\n" -" for prime in sieve(math.isqrt(n) + 1):\n" +" for prime in sieve(isqrt(n) + 1):\n" " while not n % prime:\n" " yield prime\n" " n //= prime\n" @@ -1978,6 +1962,11 @@ msgid "" " if n > 1:\n" " yield n\n" "\n" +"def is_prime(n):\n" +" \"Return True if n is prime.\"\n" +" # is_prime(1_000_000_000_000_403) → True\n" +" return n > 1 and next(factor(n)) == n\n" +"\n" "def totient(n):\n" " \"Count of natural numbers up to n that are coprime to n.\"\n" " # https://mathworld.wolfram.com/TotientFunction.html\n" @@ -1987,6 +1976,17 @@ msgid "" " return n" msgstr "" +#~ msgid "" +#~ "These tools and their built-in counterparts also work well with the high-" +#~ "speed functions in the :mod:`operator` module. For example, the " +#~ "multiplication operator can be mapped across two vectors to form an " +#~ "efficient dot-product: ``sum(starmap(operator.mul, zip(vec1, vec2, " +#~ "strict=True)))``." +#~ msgstr "" +#~ "這些工具及其內建的對等部分 (counterpart) 也可以很好地與 :mod:`operator` 模" +#~ "組中的高速函式配合使用。例如,乘法運算子可以對映到兩個向量上以組成高效率的" +#~ "內積:``sum(starmap(operator.mul, zip(vec1, vec2, strict=True)))``。" + #~ msgid "Cartesian product of input iterables." #~ msgstr "輸入的 iterables 的笛卡爾乘積。" diff --git a/library/optparse.po b/library/optparse.po index 7f39b49f93..74b7731bc9 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -22,20 +22,205 @@ msgstr "" msgid ":mod:`!optparse` --- Parser for command line options" msgstr ":mod:`!optparse` --- 命令列選項剖析器" -#: ../../library/optparse.rst:11 +#: ../../library/optparse.rst:10 msgid "**Source code:** :source:`Lib/optparse.py`" msgstr "**原始碼:**\\ :source:`Lib/optparse.py`" -#: ../../library/optparse.rst:13 +#: ../../library/optparse.rst:17 +msgid "Choosing an argument parsing library" +msgstr "" + +#: ../../library/optparse.rst:19 +msgid "The standard library includes three argument parsing libraries:" +msgstr "" + +#: ../../library/optparse.rst:21 +msgid "" +":mod:`getopt`: a module that closely mirrors the procedural C ``getopt`` " +"API. Included in the standard library since before the initial Python 1.0 " +"release." +msgstr "" + +#: ../../library/optparse.rst:23 +msgid "" +":mod:`optparse`: a declarative replacement for ``getopt`` that provides " +"equivalent functionality without requiring each application to implement its " +"own procedural option parsing logic. Included in the standard library since " +"the Python 2.3 release." +msgstr "" + +#: ../../library/optparse.rst:27 +msgid "" +":mod:`argparse`: a more opinionated alternative to ``optparse`` that " +"provides more functionality by default, at the expense of reduced " +"application flexibility in controlling exactly how arguments are processed. " +"Included in the standard library since the Python 2.7 and Python 3.2 " +"releases." +msgstr "" + +#: ../../library/optparse.rst:32 +msgid "" +"In the absence of more specific argument parsing design constraints, :mod:" +"`argparse` is the recommended choice for implementing command line " +"applications, as it offers the highest level of baseline functionality with " +"the least application level code." +msgstr "" + +#: ../../library/optparse.rst:36 +msgid "" +":mod:`getopt` is retained almost entirely for backwards compatibility " +"reasons. However, it also serves a niche use case as a tool for prototyping " +"and testing command line argument handling in ``getopt``-based C " +"applications." +msgstr "" + +#: ../../library/optparse.rst:40 +msgid "" +":mod:`optparse` should be considered as an alternative to :mod:`argparse` in " +"the following cases:" +msgstr "" + +#: ../../library/optparse.rst:43 +msgid "" +"an application is already using :mod:`optparse` and doesn't want to risk the " +"subtle behavioural changes that may arise when migrating to :mod:`argparse`" +msgstr "" + +#: ../../library/optparse.rst:45 +msgid "" +"the application requires additional control over the way options and " +"positional parameters are interleaved on the command line (including the " +"ability to disable the interleaving feature completely)" +msgstr "" + +#: ../../library/optparse.rst:48 +msgid "" +"the application requires additional control over the incremental parsing of " +"command line elements (while ``argparse`` does support this, the exact way " +"it works in practice is undesirable for some use cases)" +msgstr "" + +#: ../../library/optparse.rst:51 +msgid "" +"the application requires additional control over the handling of options " +"which accept parameter values that may start with ``-`` (such as delegated " +"options to be passed to invoked subprocesses)" +msgstr "" + +#: ../../library/optparse.rst:54 +msgid "" +"the application requires some other command line parameter processing " +"behavior which ``argparse`` does not support, but which can be implemented " +"in terms of the lower level interface offered by ``optparse``" +msgstr "" + +#: ../../library/optparse.rst:58 +msgid "" +"These considerations also mean that :mod:`optparse` is likely to provide a " +"better foundation for library authors writing third party command line " +"argument processing libraries." +msgstr "" + +#: ../../library/optparse.rst:62 +msgid "" +"As a concrete example, consider the following two command line argument " +"parsing configurations, the first using ``optparse``, and the second using " +"``argparse``:" +msgstr "" + +#: ../../library/optparse.rst:66 +msgid "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" +msgstr "" + +#: ../../library/optparse.rst:77 +msgid "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" +msgstr "" + +#: ../../library/optparse.rst:89 msgid "" -"The :mod:`optparse` module is :term:`soft deprecated` and will not be " -"developed further; development will continue with the :mod:`argparse` module." +"The most obvious difference is that in the ``optparse`` version, the non-" +"option arguments are processed separately by the application after the " +"option processing is complete. In the ``argparse`` version, positional " +"arguments are declared and processed in the same way as the named options." msgstr "" -#: ../../library/optparse.rst:20 +#: ../../library/optparse.rst:94 +msgid "" +"However, the ``argparse`` version will also handle some parameter " +"combination differently from the way the ``optparse`` version would handle " +"them. For example (amongst other differences):" +msgstr "" + +#: ../../library/optparse.rst:98 +msgid "" +"supplying ``-o -v`` gives ``output=\"-v\"`` and ``verbose=False`` when using " +"``optparse``, but a usage error with ``argparse`` (complaining that no value " +"has been supplied for ``-o/--output``, since ``-v`` is interpreted as " +"meaning the verbosity flag)" +msgstr "" + +#: ../../library/optparse.rst:102 +msgid "" +"similarly, supplying ``-o --`` gives ``output=\"--\"`` and ``args=()`` when " +"using ``optparse``, but a usage error with ``argparse`` (also complaining " +"that no value has been supplied for ``-o/--output``, since ``--`` is " +"interpreted as terminating the option processing and treating all remaining " +"values as positional arguments)" +msgstr "" + +#: ../../library/optparse.rst:107 +msgid "" +"supplying ``-o=foo`` gives ``output=\"=foo\"`` when using ``optparse``, but " +"gives ``output=\"foo\"`` with ``argparse`` (since ``=`` is special cased as " +"an alternative separator for option parameter values)" +msgstr "" + +#: ../../library/optparse.rst:111 +msgid "" +"Whether these differing behaviors in the ``argparse`` version are considered " +"desirable or a problem will depend on the specific command line application " +"use case." +msgstr "" + +#: ../../library/optparse.rst:117 +msgid "" +":pypi:`click` is a third party argument processing library (originally based " +"on ``optparse``), which allows command line applications to be developed as " +"a set of decorated command implementation functions." +msgstr "" + +#: ../../library/optparse.rst:121 +msgid "" +"Other third party libraries, such as :pypi:`typer` or :pypi:`msgspec-click`, " +"allow command line interfaces to be specified in ways that more effectively " +"integrate with static checking of Python type annotations." +msgstr "" + +#: ../../library/optparse.rst:127 +msgid "Introduction" +msgstr "" + +#: ../../library/optparse.rst:129 msgid "" ":mod:`optparse` is a more convenient, flexible, and powerful library for " -"parsing command-line options than the old :mod:`getopt` module. :mod:" +"parsing command-line options than the minimalist :mod:`getopt` module. :mod:" "`optparse` uses a more declarative style of command-line parsing: you create " "an instance of :class:`OptionParser`, populate it with options, and parse " "the command line. :mod:`optparse` allows users to specify options in the " @@ -43,11 +228,11 @@ msgid "" "messages for you." msgstr "" -#: ../../library/optparse.rst:27 +#: ../../library/optparse.rst:137 msgid "Here's an example of using :mod:`optparse` in a simple script::" msgstr "" -#: ../../library/optparse.rst:29 +#: ../../library/optparse.rst:139 msgid "" "from optparse import OptionParser\n" "...\n" @@ -61,17 +246,17 @@ msgid "" "(options, args) = parser.parse_args()" msgstr "" -#: ../../library/optparse.rst:40 +#: ../../library/optparse.rst:150 msgid "" "With these few lines of code, users of your script can now do the \"usual " "thing\" on the command-line, for example::" msgstr "" -#: ../../library/optparse.rst:43 +#: ../../library/optparse.rst:153 msgid "<yourscript> --file=outfile -q" msgstr "" -#: ../../library/optparse.rst:45 +#: ../../library/optparse.rst:155 msgid "" "As it parses the command line, :mod:`optparse` sets attributes of the " "``options`` object returned by :meth:`~OptionParser.parse_args` based on " @@ -84,7 +269,7 @@ msgid "" "the above example::" msgstr "" -#: ../../library/optparse.rst:54 +#: ../../library/optparse.rst:164 msgid "" "<yourscript> -f outfile --quiet\n" "<yourscript> --quiet --file outfile\n" @@ -92,22 +277,22 @@ msgid "" "<yourscript> -qfoutfile" msgstr "" -#: ../../library/optparse.rst:59 +#: ../../library/optparse.rst:169 msgid "Additionally, users can run one of the following ::" msgstr "" -#: ../../library/optparse.rst:61 +#: ../../library/optparse.rst:171 msgid "" "<yourscript> -h\n" "<yourscript> --help" msgstr "" -#: ../../library/optparse.rst:64 +#: ../../library/optparse.rst:174 msgid "" "and :mod:`optparse` will print out a brief summary of your script's options:" msgstr "" -#: ../../library/optparse.rst:66 +#: ../../library/optparse.rst:176 msgid "" "Usage: <yourscript> [options]\n" "\n" @@ -117,34 +302,36 @@ msgid "" " -q, --quiet don't print status messages to stdout" msgstr "" -#: ../../library/optparse.rst:75 +#: ../../library/optparse.rst:185 msgid "" "where the value of *yourscript* is determined at runtime (normally from " "``sys.argv[0]``)." msgstr "" -#: ../../library/optparse.rst:82 +#: ../../library/optparse.rst:192 msgid "Background" msgstr "背景" -#: ../../library/optparse.rst:84 +#: ../../library/optparse.rst:194 msgid "" ":mod:`optparse` was explicitly designed to encourage the creation of " -"programs with straightforward, conventional command-line interfaces. To " -"that end, it supports only the most common command-line syntax and semantics " -"conventionally used under Unix. If you are unfamiliar with these " -"conventions, read this section to acquaint yourself with them." +"programs with straightforward command-line interfaces that follow the " +"conventions established by the :c:func:`!getopt` family of functions " +"available to C developers. To that end, it supports only the most common " +"command-line syntax and semantics conventionally used under Unix. If you " +"are unfamiliar with these conventions, reading this section will allow you " +"to acquaint yourself with them." msgstr "" -#: ../../library/optparse.rst:94 +#: ../../library/optparse.rst:205 msgid "Terminology" msgstr "術語" -#: ../../library/optparse.rst:96 +#: ../../library/optparse.rst:207 msgid "argument" msgstr "" -#: ../../library/optparse.rst:97 +#: ../../library/optparse.rst:208 msgid "" "a string entered on the command-line, and passed by the shell to ``execl()`` " "or ``execv()``. In Python, arguments are elements of ``sys.argv[1:]`` " @@ -152,7 +339,7 @@ msgid "" "also use the term \"word\"." msgstr "" -#: ../../library/optparse.rst:102 +#: ../../library/optparse.rst:213 msgid "" "It is occasionally desirable to substitute an argument list other than ``sys." "argv[1:]``, so you should read \"argument\" as \"an element of ``sys." @@ -160,11 +347,11 @@ msgid "" "argv[1:]``\"." msgstr "" -#: ../../library/optparse.rst:107 +#: ../../library/optparse.rst:218 msgid "option" msgstr "" -#: ../../library/optparse.rst:108 +#: ../../library/optparse.rst:219 msgid "" "an argument used to supply extra information to guide or customize the " "execution of a program. There are many different syntaxes for options; the " @@ -176,36 +363,36 @@ msgid "" "option syntaxes provided by :mod:`optparse`." msgstr "" -#: ../../library/optparse.rst:117 +#: ../../library/optparse.rst:228 msgid "Some other option syntaxes that the world has seen include:" msgstr "" -#: ../../library/optparse.rst:119 +#: ../../library/optparse.rst:230 msgid "" "a hyphen followed by a few letters, e.g. ``-pf`` (this is *not* the same as " "multiple options merged into a single argument)" msgstr "" -#: ../../library/optparse.rst:122 +#: ../../library/optparse.rst:233 msgid "" "a hyphen followed by a whole word, e.g. ``-file`` (this is technically " "equivalent to the previous syntax, but they aren't usually seen in the same " "program)" msgstr "" -#: ../../library/optparse.rst:126 +#: ../../library/optparse.rst:237 msgid "" "a plus sign followed by a single letter, or a few letters, or a word, e.g. " "``+f``, ``+rgb``" msgstr "" -#: ../../library/optparse.rst:129 +#: ../../library/optparse.rst:240 msgid "" "a slash followed by a letter, or a few letters, or a word, e.g. ``/f``, ``/" "file``" msgstr "" -#: ../../library/optparse.rst:132 +#: ../../library/optparse.rst:243 msgid "" "These option syntaxes are not supported by :mod:`optparse`, and they never " "will be. This is deliberate: the first three are non-standard on any " @@ -213,11 +400,11 @@ msgid "" "Windows or certain legacy platforms (e.g. VMS, MS-DOS)." msgstr "" -#: ../../library/optparse.rst:137 +#: ../../library/optparse.rst:248 msgid "option argument" msgstr "" -#: ../../library/optparse.rst:138 +#: ../../library/optparse.rst:249 msgid "" "an argument that follows an option, is closely associated with that option, " "and is consumed from the argument list when that option is. With :mod:" @@ -225,23 +412,23 @@ msgid "" "option:" msgstr "" -#: ../../library/optparse.rst:143 +#: ../../library/optparse.rst:254 msgid "" "-f foo\n" "--file foo" msgstr "" -#: ../../library/optparse.rst:148 +#: ../../library/optparse.rst:259 msgid "or included in the same argument:" msgstr "" -#: ../../library/optparse.rst:150 +#: ../../library/optparse.rst:261 msgid "" "-ffoo\n" "--file=foo" msgstr "" -#: ../../library/optparse.rst:155 +#: ../../library/optparse.rst:266 msgid "" "Typically, a given option either takes an argument or it doesn't. Lots of " "people want an \"optional option arguments\" feature, meaning that some " @@ -252,22 +439,22 @@ msgid "" "support this feature." msgstr "" -#: ../../library/optparse.rst:163 +#: ../../library/optparse.rst:274 msgid "positional argument" msgstr "" -#: ../../library/optparse.rst:164 +#: ../../library/optparse.rst:275 msgid "" "something leftover in the argument list after options have been parsed, i.e. " "after options and their arguments have been parsed and removed from the " "argument list." msgstr "" -#: ../../library/optparse.rst:168 +#: ../../library/optparse.rst:279 msgid "required option" msgstr "" -#: ../../library/optparse.rst:169 +#: ../../library/optparse.rst:280 msgid "" "an option that must be supplied on the command-line; note that the phrase " "\"required option\" is self-contradictory in English. :mod:`optparse` " @@ -275,26 +462,26 @@ msgid "" "much help at it either." msgstr "" -#: ../../library/optparse.rst:174 +#: ../../library/optparse.rst:285 msgid "For example, consider this hypothetical command-line::" msgstr "" -#: ../../library/optparse.rst:176 +#: ../../library/optparse.rst:287 msgid "prog -v --report report.txt foo bar" msgstr "" -#: ../../library/optparse.rst:178 +#: ../../library/optparse.rst:289 msgid "" "``-v`` and ``--report`` are both options. Assuming that ``--report`` takes " "one argument, ``report.txt`` is an option argument. ``foo`` and ``bar`` are " "positional arguments." msgstr "" -#: ../../library/optparse.rst:186 +#: ../../library/optparse.rst:297 msgid "What are options for?" msgstr "" -#: ../../library/optparse.rst:188 +#: ../../library/optparse.rst:299 msgid "" "Options are used to provide extra information to tune or customize the " "execution of a program. In case it wasn't clear, options are usually " @@ -306,7 +493,7 @@ msgid "" "interfaces.)" msgstr "" -#: ../../library/optparse.rst:196 +#: ../../library/optparse.rst:307 msgid "" "Lots of people want their programs to have \"required options\". Think " "about it. If it's required, then it's *not optional*! If there is a piece " @@ -314,7 +501,7 @@ msgid "" "successfully, that's what positional arguments are for." msgstr "" -#: ../../library/optparse.rst:201 +#: ../../library/optparse.rst:312 msgid "" "As an example of good command-line interface design, consider the humble " "``cp`` utility, for copying files. It doesn't make much sense to try to " @@ -323,13 +510,13 @@ msgid "" "useful syntax that does not require any options at all::" msgstr "" -#: ../../library/optparse.rst:207 +#: ../../library/optparse.rst:318 msgid "" "cp SOURCE DEST\n" "cp SOURCE ... DEST-DIR" msgstr "" -#: ../../library/optparse.rst:210 +#: ../../library/optparse.rst:321 msgid "" "You can get pretty far with just that. Most ``cp`` implementations provide " "a bunch of options to tweak exactly how the files are copied: you can " @@ -339,17 +526,17 @@ msgid "" "files to another directory." msgstr "" -#: ../../library/optparse.rst:221 +#: ../../library/optparse.rst:332 msgid "What are positional arguments for?" msgstr "" -#: ../../library/optparse.rst:223 +#: ../../library/optparse.rst:334 msgid "" "Positional arguments are for those pieces of information that your program " "absolutely, positively requires to run." msgstr "" -#: ../../library/optparse.rst:226 +#: ../../library/optparse.rst:337 msgid "" "A good user interface should have as few absolute requirements as possible. " "If your program requires 17 distinct pieces of information in order to run " @@ -360,7 +547,7 @@ msgid "" "most of them will simply give up." msgstr "" -#: ../../library/optparse.rst:234 +#: ../../library/optparse.rst:345 msgid "" "In short, try to minimize the amount of information that users are " "absolutely required to supply---use sensible defaults whenever possible. Of " @@ -373,65 +560,65 @@ msgid "" "make your code much harder to maintain." msgstr "" -#: ../../library/optparse.rst:247 +#: ../../library/optparse.rst:358 msgid "Tutorial" msgstr "教學" -#: ../../library/optparse.rst:249 +#: ../../library/optparse.rst:360 msgid "" "While :mod:`optparse` is quite flexible and powerful, it's also " "straightforward to use in most cases. This section covers the code patterns " "that are common to any :mod:`optparse`\\ -based program." msgstr "" -#: ../../library/optparse.rst:253 +#: ../../library/optparse.rst:364 msgid "" "First, you need to import the OptionParser class; then, early in the main " "program, create an OptionParser instance::" msgstr "" -#: ../../library/optparse.rst:256 +#: ../../library/optparse.rst:367 msgid "" "from optparse import OptionParser\n" "...\n" "parser = OptionParser()" msgstr "" -#: ../../library/optparse.rst:260 +#: ../../library/optparse.rst:371 msgid "Then you can start defining options. The basic syntax is::" msgstr "" -#: ../../library/optparse.rst:262 +#: ../../library/optparse.rst:373 msgid "" "parser.add_option(opt_str, ...,\n" " attr=value, ...)" msgstr "" -#: ../../library/optparse.rst:265 +#: ../../library/optparse.rst:376 msgid "" "Each option has one or more option strings, such as ``-f`` or ``--file``, " "and several option attributes that tell :mod:`optparse` what to expect and " "what to do when it encounters that option on the command line." msgstr "" -#: ../../library/optparse.rst:269 +#: ../../library/optparse.rst:380 msgid "" "Typically, each option will have one short option string and one long option " "string, e.g.::" msgstr "" -#: ../../library/optparse.rst:272 +#: ../../library/optparse.rst:383 msgid "parser.add_option(\"-f\", \"--file\", ...)" msgstr "" -#: ../../library/optparse.rst:274 +#: ../../library/optparse.rst:385 msgid "" "You're free to define as many short option strings and as many long option " "strings as you like (including zero), as long as there is at least one " "option string overall." msgstr "" -#: ../../library/optparse.rst:278 +#: ../../library/optparse.rst:389 msgid "" "The option strings passed to :meth:`OptionParser.add_option` are effectively " "labels for the option defined by that call. For brevity, we will frequently " @@ -439,28 +626,28 @@ msgid "" "`optparse` encounters *option strings* and looks up options from them." msgstr "" -#: ../../library/optparse.rst:284 +#: ../../library/optparse.rst:395 msgid "" "Once all of your options are defined, instruct :mod:`optparse` to parse your " "program's command line::" msgstr "" -#: ../../library/optparse.rst:287 +#: ../../library/optparse.rst:398 msgid "(options, args) = parser.parse_args()" msgstr "" -#: ../../library/optparse.rst:289 +#: ../../library/optparse.rst:400 msgid "" "(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:292 +#: ../../library/optparse.rst:403 msgid ":meth:`~OptionParser.parse_args` returns two values:" msgstr ":meth:`~OptionParser.parse_args` 回傳兩個值:" -#: ../../library/optparse.rst:294 +#: ../../library/optparse.rst:405 msgid "" "``options``, an object containing values for all of your options---e.g. if " "``--file`` takes a single string argument, then ``options.file`` will be the " @@ -468,12 +655,12 @@ msgid "" "option" msgstr "" -#: ../../library/optparse.rst:299 +#: ../../library/optparse.rst:410 msgid "" "``args``, the list of positional arguments leftover after parsing options" msgstr "" -#: ../../library/optparse.rst:301 +#: ../../library/optparse.rst:412 msgid "" "This tutorial section only covers the four most important option " "attributes: :attr:`~Option.action`, :attr:`~Option.type`, :attr:`~Option." @@ -481,11 +668,11 @@ msgid "" "action` is the most fundamental." msgstr "" -#: ../../library/optparse.rst:310 +#: ../../library/optparse.rst:421 msgid "Understanding option actions" msgstr "" -#: ../../library/optparse.rst:312 +#: ../../library/optparse.rst:423 msgid "" "Actions tell :mod:`optparse` what to do when it encounters an option on the " "command line. There is a fixed set of actions hard-coded into :mod:" @@ -495,44 +682,44 @@ msgid "" "and store it in an attribute of ``options``." msgstr "" -#: ../../library/optparse.rst:319 +#: ../../library/optparse.rst:430 msgid "" "If you don't specify an option action, :mod:`optparse` defaults to ``store``." msgstr "" -#: ../../library/optparse.rst:325 +#: ../../library/optparse.rst:436 msgid "The store action" msgstr "" -#: ../../library/optparse.rst:327 +#: ../../library/optparse.rst:438 msgid "" "The most common option action is ``store``, which tells :mod:`optparse` to " "take the next argument (or the remainder of the current argument), ensure " "that it is of the correct type, and store it to your chosen destination." msgstr "" -#: ../../library/optparse.rst:331 +#: ../../library/optparse.rst:442 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/optparse.rst:333 +#: ../../library/optparse.rst:444 msgid "" "parser.add_option(\"-f\", \"--file\",\n" " action=\"store\", type=\"string\", dest=\"filename\")" msgstr "" -#: ../../library/optparse.rst:336 +#: ../../library/optparse.rst:447 msgid "" "Now let's make up a fake command line and ask :mod:`optparse` to parse it::" msgstr "" -#: ../../library/optparse.rst:338 +#: ../../library/optparse.rst:449 msgid "" "args = [\"-f\", \"foo.txt\"]\n" "(options, args) = parser.parse_args(args)" msgstr "" -#: ../../library/optparse.rst:341 +#: ../../library/optparse.rst:452 msgid "" "When :mod:`optparse` sees the option string ``-f``, it consumes the next " "argument, ``foo.txt``, and stores it in ``options.filename``. So, after " @@ -540,51 +727,51 @@ msgid "" "``\"foo.txt\"``." msgstr "" -#: ../../library/optparse.rst:345 +#: ../../library/optparse.rst:456 msgid "" "Some other option types supported by :mod:`optparse` are ``int`` and " "``float``. Here's an option that expects an integer argument::" msgstr "" -#: ../../library/optparse.rst:348 +#: ../../library/optparse.rst:459 msgid "parser.add_option(\"-n\", type=\"int\", dest=\"num\")" msgstr "" -#: ../../library/optparse.rst:350 +#: ../../library/optparse.rst:461 msgid "" "Note that this option has no long option string, which is perfectly " "acceptable. Also, there's no explicit action, since the default is ``store``." msgstr "" -#: ../../library/optparse.rst:353 +#: ../../library/optparse.rst:464 msgid "" "Let's parse another fake command-line. This time, we'll jam the option " "argument right up against the option: since ``-n42`` (one argument) is " "equivalent to ``-n 42`` (two arguments), the code ::" msgstr "" -#: ../../library/optparse.rst:357 +#: ../../library/optparse.rst:468 msgid "" "(options, args) = parser.parse_args([\"-n42\"])\n" "print(options.num)" msgstr "" -#: ../../library/optparse.rst:360 +#: ../../library/optparse.rst:471 msgid "will print ``42``." msgstr "" -#: ../../library/optparse.rst:362 +#: ../../library/optparse.rst:473 msgid "" "If you don't specify a type, :mod:`optparse` assumes ``string``. Combined " "with the fact that the default action is ``store``, that means our first " "example can be a lot shorter::" msgstr "" -#: ../../library/optparse.rst:366 +#: ../../library/optparse.rst:477 msgid "parser.add_option(\"-f\", \"--file\", dest=\"filename\")" msgstr "" -#: ../../library/optparse.rst:368 +#: ../../library/optparse.rst:479 msgid "" "If you don't supply a destination, :mod:`optparse` figures out a sensible " "default from the option strings: if the first long option string is ``--foo-" @@ -593,17 +780,17 @@ msgid "" "default destination for ``-f`` is ``f``." msgstr "" -#: ../../library/optparse.rst:374 +#: ../../library/optparse.rst:485 msgid "" ":mod:`optparse` also includes the built-in ``complex`` type. Adding types " "is covered in section :ref:`optparse-extending-optparse`." msgstr "" -#: ../../library/optparse.rst:381 +#: ../../library/optparse.rst:492 msgid "Handling boolean (flag) options" msgstr "" -#: ../../library/optparse.rst:383 +#: ../../library/optparse.rst:494 msgid "" "Flag options---set a variable to true or false when a particular option is " "seen---are quite common. :mod:`optparse` supports them with two separate " @@ -611,77 +798,77 @@ msgid "" "``verbose`` flag that is turned on with ``-v`` and off with ``-q``::" msgstr "" -#: ../../library/optparse.rst:388 +#: ../../library/optparse.rst:499 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" -#: ../../library/optparse.rst:391 +#: ../../library/optparse.rst:502 msgid "" "Here we have two different options with the same destination, which is " "perfectly OK. (It just means you have to be a bit careful when setting " "default values---see below.)" msgstr "" -#: ../../library/optparse.rst:395 +#: ../../library/optparse.rst:506 msgid "" "When :mod:`optparse` encounters ``-v`` on the command line, it sets " "``options.verbose`` to ``True``; when it encounters ``-q``, ``options." "verbose`` is set to ``False``." msgstr "" -#: ../../library/optparse.rst:403 +#: ../../library/optparse.rst:514 msgid "Other actions" msgstr "" -#: ../../library/optparse.rst:405 +#: ../../library/optparse.rst:516 msgid "Some other actions supported by :mod:`optparse` are:" msgstr "" -#: ../../library/optparse.rst:407 ../../library/optparse.rst:929 +#: ../../library/optparse.rst:518 ../../library/optparse.rst:1040 msgid "``\"store_const\"``" msgstr "``\"store_const\"``" -#: ../../library/optparse.rst:408 ../../library/optparse.rst:930 +#: ../../library/optparse.rst:519 ../../library/optparse.rst:1041 msgid "store a constant value, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:410 ../../library/optparse.rst:938 +#: ../../library/optparse.rst:521 ../../library/optparse.rst:1049 msgid "``\"append\"``" msgstr "``\"append\"``" -#: ../../library/optparse.rst:411 ../../library/optparse.rst:939 +#: ../../library/optparse.rst:522 ../../library/optparse.rst:1050 msgid "append this option's argument to a list" msgstr "" -#: ../../library/optparse.rst:413 ../../library/optparse.rst:944 +#: ../../library/optparse.rst:524 ../../library/optparse.rst:1055 msgid "``\"count\"``" msgstr "``\"count\"``" -#: ../../library/optparse.rst:414 ../../library/optparse.rst:945 +#: ../../library/optparse.rst:525 ../../library/optparse.rst:1056 msgid "increment a counter by one" msgstr "" -#: ../../library/optparse.rst:416 ../../library/optparse.rst:947 +#: ../../library/optparse.rst:527 ../../library/optparse.rst:1058 msgid "``\"callback\"``" msgstr "``\"callback\"``" -#: ../../library/optparse.rst:417 ../../library/optparse.rst:948 +#: ../../library/optparse.rst:528 ../../library/optparse.rst:1059 msgid "call a specified function" msgstr "" -#: ../../library/optparse.rst:419 +#: ../../library/optparse.rst:530 msgid "" "These are covered in section :ref:`optparse-reference-guide`, and section :" "ref:`optparse-option-callbacks`." msgstr "" -#: ../../library/optparse.rst:426 +#: ../../library/optparse.rst:537 msgid "Default values" msgstr "" -#: ../../library/optparse.rst:428 +#: ../../library/optparse.rst:539 msgid "" "All of the above examples involve setting some variable (the " "\"destination\") when certain command-line options are seen. What happens " @@ -691,38 +878,38 @@ msgid "" "destination, which is assigned before the command line is parsed." msgstr "" -#: ../../library/optparse.rst:435 +#: ../../library/optparse.rst:546 msgid "" "First, consider the verbose/quiet example. If we want :mod:`optparse` to " "set ``verbose`` to ``True`` unless ``-q`` is seen, then we can do this::" msgstr "" -#: ../../library/optparse.rst:438 +#: ../../library/optparse.rst:549 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " "default=True)\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" -#: ../../library/optparse.rst:441 +#: ../../library/optparse.rst:552 msgid "" "Since default values apply to the *destination* rather than to any " "particular option, and these two options happen to have the same " "destination, this is exactly equivalent::" msgstr "" -#: ../../library/optparse.rst:445 +#: ../../library/optparse.rst:556 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\", " "default=True)" msgstr "" -#: ../../library/optparse.rst:448 +#: ../../library/optparse.rst:559 msgid "Consider this::" msgstr "" -#: ../../library/optparse.rst:450 +#: ../../library/optparse.rst:561 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " "default=False)\n" @@ -730,38 +917,38 @@ msgid "" "default=True)" msgstr "" -#: ../../library/optparse.rst:453 +#: ../../library/optparse.rst:564 msgid "" "Again, the default value for ``verbose`` will be ``True``: the last default " "value supplied for any particular destination is the one that counts." msgstr "" -#: ../../library/optparse.rst:456 +#: ../../library/optparse.rst:567 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:" "`~OptionParser.parse_args`::" msgstr "" -#: ../../library/optparse.rst:460 +#: ../../library/optparse.rst:571 msgid "" "parser.set_defaults(verbose=True)\n" "parser.add_option(...)\n" "(options, args) = parser.parse_args()" msgstr "" -#: ../../library/optparse.rst:464 +#: ../../library/optparse.rst:575 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:472 +#: ../../library/optparse.rst:583 msgid "Generating help" msgstr "" -#: ../../library/optparse.rst:474 +#: ../../library/optparse.rst:585 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 " @@ -770,7 +957,7 @@ msgid "" "populated with user-friendly (documented) options::" msgstr "" -#: ../../library/optparse.rst:480 +#: ../../library/optparse.rst:591 msgid "" "usage = \"usage: %prog [options] arg1 arg2\"\n" "parser = OptionParser(usage=usage)\n" @@ -788,14 +975,14 @@ msgid "" " \"or expert [default: %default]\")" msgstr "" -#: ../../library/optparse.rst:495 +#: ../../library/optparse.rst:606 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:499 +#: ../../library/optparse.rst:610 msgid "" "Usage: <yourscript> [options] arg1 arg2\n" "\n" @@ -809,58 +996,58 @@ msgid "" " expert [default: intermediate]" msgstr "" -#: ../../library/optparse.rst:512 +#: ../../library/optparse.rst:623 msgid "" "(If the help output is triggered by a help option, :mod:`optparse` exits " "after printing the help text.)" msgstr "" -#: ../../library/optparse.rst:515 +#: ../../library/optparse.rst:626 msgid "" "There's a lot going on here to help :mod:`optparse` generate the best " "possible help message:" msgstr "" -#: ../../library/optparse.rst:518 +#: ../../library/optparse.rst:629 msgid "the script defines its own usage message::" msgstr "" -#: ../../library/optparse.rst:520 +#: ../../library/optparse.rst:631 msgid "usage = \"usage: %prog [options] arg1 arg2\"" msgstr "" -#: ../../library/optparse.rst:522 +#: ../../library/optparse.rst:633 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:526 +#: ../../library/optparse.rst:637 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:530 +#: ../../library/optparse.rst:641 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:534 +#: ../../library/optparse.rst:645 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:648 msgid "-m MODE, --mode=MODE" msgstr "" -#: ../../library/optparse.rst:539 +#: ../../library/optparse.rst:650 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:" @@ -870,11 +1057,11 @@ msgid "" "this automatically generated option description::" msgstr "" -#: ../../library/optparse.rst:546 +#: ../../library/optparse.rst:657 msgid "-f FILE, --filename=FILE" msgstr "" -#: ../../library/optparse.rst:548 +#: ../../library/optparse.rst:659 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 " @@ -884,7 +1071,7 @@ msgid "" "users." msgstr "" -#: ../../library/optparse.rst:554 +#: ../../library/optparse.rst:665 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 " @@ -892,58 +1079,58 @@ msgid "" "``None``), ``%default`` expands to ``none``." msgstr "" -#: ../../library/optparse.rst:560 +#: ../../library/optparse.rst:671 msgid "Grouping Options" msgstr "" -#: ../../library/optparse.rst:562 +#: ../../library/optparse.rst:673 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:566 +#: ../../library/optparse.rst:677 msgid "An option group is obtained using the class :class:`OptionGroup`:" msgstr "" -#: ../../library/optparse.rst:570 ../../library/optparse.rst:1641 +#: ../../library/optparse.rst:681 ../../library/optparse.rst:1752 msgid "where" msgstr "" -#: ../../library/optparse.rst:572 +#: ../../library/optparse.rst:683 msgid "" "parser is the :class:`OptionParser` instance the group will be inserted in to" msgstr "" -#: ../../library/optparse.rst:574 +#: ../../library/optparse.rst:685 msgid "title is the group title" msgstr "" -#: ../../library/optparse.rst:575 +#: ../../library/optparse.rst:686 msgid "description, optional, is a long description of the group" msgstr "" -#: ../../library/optparse.rst:577 +#: ../../library/optparse.rst:688 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:581 +#: ../../library/optparse.rst:692 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:584 +#: ../../library/optparse.rst:695 msgid "" "Continuing with the parser defined in the previous section, adding an :class:" "`OptionGroup` to a parser is easy::" msgstr "" -#: ../../library/optparse.rst:587 +#: ../../library/optparse.rst:698 msgid "" "group = OptionGroup(parser, \"Dangerous Options\",\n" " \"Caution: use these options at your own risk. \"\n" @@ -952,11 +1139,11 @@ msgid "" "parser.add_option_group(group)" msgstr "" -#: ../../library/optparse.rst:593 +#: ../../library/optparse.rst:704 msgid "This would result in the following help output:" msgstr "" -#: ../../library/optparse.rst:595 +#: ../../library/optparse.rst:706 msgid "" "Usage: <yourscript> [options] arg1 arg2\n" "\n" @@ -976,13 +1163,13 @@ msgid "" " -g Group option." msgstr "" -#: ../../library/optparse.rst:614 +#: ../../library/optparse.rst:725 msgid "" "A bit more complete example might involve using more than one group: still " "extending the previous example::" msgstr "" -#: ../../library/optparse.rst:617 +#: ../../library/optparse.rst:728 msgid "" "group = OptionGroup(parser, \"Dangerous Options\",\n" " \"Caution: use these options at your own risk. \"\n" @@ -1000,11 +1187,11 @@ msgid "" "parser.add_option_group(group)" msgstr "" -#: ../../library/optparse.rst:631 +#: ../../library/optparse.rst:742 msgid "that results in the following output:" msgstr "" -#: ../../library/optparse.rst:633 +#: ../../library/optparse.rst:744 msgid "" "Usage: <yourscript> [options] arg1 arg2\n" "\n" @@ -1029,35 +1216,35 @@ msgid "" " -e Print every action done" msgstr "" -#: ../../library/optparse.rst:657 +#: ../../library/optparse.rst:768 msgid "" "Another interesting method, in particular when working programmatically with " "option groups is:" msgstr "" -#: ../../library/optparse.rst:662 +#: ../../library/optparse.rst:773 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:669 +#: ../../library/optparse.rst:780 msgid "Printing a version string" msgstr "" -#: ../../library/optparse.rst:671 +#: ../../library/optparse.rst:782 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:786 msgid "parser = OptionParser(usage=\"%prog [-f] [-q]\", version=\"%prog 1.0\")" msgstr "" -#: ../../library/optparse.rst:677 +#: ../../library/optparse.rst:788 msgid "" "``%prog`` is expanded just like it is in ``usage``. Apart from that, " "``version`` can contain anything you like. When you supply it, :mod:" @@ -1066,23 +1253,23 @@ msgid "" "string (by replacing ``%prog``), prints it to stdout, and exits." msgstr "" -#: ../../library/optparse.rst:683 +#: ../../library/optparse.rst:794 msgid "For example, if your script is called ``/usr/bin/foo``:" msgstr "" -#: ../../library/optparse.rst:685 +#: ../../library/optparse.rst:796 msgid "" "$ /usr/bin/foo --version\n" "foo 1.0" msgstr "" -#: ../../library/optparse.rst:690 +#: ../../library/optparse.rst:801 msgid "" "The following two methods can be used to print and get the ``version`` " "string:" msgstr "" -#: ../../library/optparse.rst:694 +#: ../../library/optparse.rst:805 msgid "" "Print the version message for the current program (``self.version``) to " "*file* (default stdout). As with :meth:`print_usage`, any occurrence of " @@ -1090,17 +1277,17 @@ msgid "" "program. Does nothing if ``self.version`` is empty or undefined." msgstr "" -#: ../../library/optparse.rst:701 +#: ../../library/optparse.rst:812 msgid "" "Same as :meth:`print_version` but returns the version string instead of " "printing it." msgstr "" -#: ../../library/optparse.rst:708 +#: ../../library/optparse.rst:819 msgid "How :mod:`optparse` handles errors" msgstr "" -#: ../../library/optparse.rst:710 +#: ../../library/optparse.rst:821 msgid "" "There are two broad classes of errors that :mod:`optparse` has to worry " "about: programmer errors and user errors. Programmer errors are usually " @@ -1110,7 +1297,7 @@ msgid "" "OptionError` or :exc:`TypeError`) and let the program crash." msgstr "" -#: ../../library/optparse.rst:717 +#: ../../library/optparse.rst:828 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 " @@ -1121,7 +1308,7 @@ msgid "" "error condition::" msgstr "" -#: ../../library/optparse.rst:725 +#: ../../library/optparse.rst:836 msgid "" "(options, args) = parser.parse_args()\n" "...\n" @@ -1129,20 +1316,20 @@ msgid "" " parser.error(\"options -a and -b are mutually exclusive\")" msgstr "" -#: ../../library/optparse.rst:730 +#: ../../library/optparse.rst:841 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:734 +#: ../../library/optparse.rst:845 msgid "" "Consider the first example above, where the user passes ``4x`` to an option " "that takes an integer:" msgstr "" -#: ../../library/optparse.rst:737 +#: ../../library/optparse.rst:848 msgid "" "$ /usr/bin/foo -n 4x\n" "Usage: foo [options]\n" @@ -1150,11 +1337,11 @@ msgid "" "foo: error: option -n: invalid integer value: '4x'" msgstr "" -#: ../../library/optparse.rst:744 +#: ../../library/optparse.rst:855 msgid "Or, where the user fails to pass a value at all:" msgstr "" -#: ../../library/optparse.rst:746 +#: ../../library/optparse.rst:857 msgid "" "$ /usr/bin/foo -n\n" "Usage: foo [options]\n" @@ -1162,29 +1349,29 @@ msgid "" "foo: error: -n option requires an argument" msgstr "" -#: ../../library/optparse.rst:753 +#: ../../library/optparse.rst:864 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:757 +#: ../../library/optparse.rst:868 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:765 +#: ../../library/optparse.rst:876 msgid "Putting it all together" msgstr "" -#: ../../library/optparse.rst:767 +#: ../../library/optparse.rst:878 msgid "Here's what :mod:`optparse`\\ -based scripts usually look like::" msgstr "" -#: ../../library/optparse.rst:769 +#: ../../library/optparse.rst:880 msgid "" "from optparse import OptionParser\n" "...\n" @@ -1209,32 +1396,32 @@ msgid "" " main()" msgstr "" -#: ../../library/optparse.rst:795 +#: ../../library/optparse.rst:906 msgid "Reference Guide" msgstr "" -#: ../../library/optparse.rst:801 +#: ../../library/optparse.rst:912 msgid "Creating the parser" msgstr "" -#: ../../library/optparse.rst:803 +#: ../../library/optparse.rst:914 msgid "" "The first step in using :mod:`optparse` is to create an OptionParser " "instance." msgstr "" -#: ../../library/optparse.rst:807 +#: ../../library/optparse.rst:918 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:811 +#: ../../library/optparse.rst:922 msgid "``usage`` (default: ``\"%prog [options]\"``)" msgstr "" -#: ../../library/optparse.rst:812 +#: ../../library/optparse.rst:923 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 " @@ -1243,11 +1430,11 @@ msgid "" "value :const:`optparse.SUPPRESS_USAGE`." msgstr "" -#: ../../library/optparse.rst:818 +#: ../../library/optparse.rst:929 msgid "``option_list`` (default: ``[]``)" msgstr "" -#: ../../library/optparse.rst:819 +#: ../../library/optparse.rst:930 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 " @@ -1256,19 +1443,19 @@ msgid "" "the parser instead." msgstr "" -#: ../../library/optparse.rst:825 +#: ../../library/optparse.rst:936 msgid "``option_class`` (default: optparse.Option)" msgstr "" -#: ../../library/optparse.rst:826 +#: ../../library/optparse.rst:937 msgid "Class to use when adding options to the parser in :meth:`add_option`." msgstr "" -#: ../../library/optparse.rst:828 +#: ../../library/optparse.rst:939 msgid "``version`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:829 +#: ../../library/optparse.rst:940 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 " @@ -1276,21 +1463,21 @@ msgid "" "``%prog`` is expanded the same as for ``usage``." msgstr "" -#: ../../library/optparse.rst:834 +#: ../../library/optparse.rst:945 msgid "``conflict_handler`` (default: ``\"error\"``)" msgstr "" -#: ../../library/optparse.rst:835 +#: ../../library/optparse.rst:946 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:839 +#: ../../library/optparse.rst:950 msgid "``description`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:840 +#: ../../library/optparse.rst:951 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 " @@ -1298,74 +1485,74 @@ msgid "" "options)." msgstr "" -#: ../../library/optparse.rst:845 +#: ../../library/optparse.rst:956 msgid "``formatter`` (default: a new :class:`IndentedHelpFormatter`)" msgstr "" -#: ../../library/optparse.rst:846 +#: ../../library/optparse.rst:957 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:961 msgid "``add_help_option`` (default: ``True``)" msgstr "" -#: ../../library/optparse.rst:851 +#: ../../library/optparse.rst:962 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:965 msgid "``prog``" msgstr "``prog``" -#: ../../library/optparse.rst:855 +#: ../../library/optparse.rst:966 msgid "" "The string to use when expanding ``%prog`` in ``usage`` and ``version`` " "instead of ``os.path.basename(sys.argv[0])``." msgstr "" -#: ../../library/optparse.rst:858 +#: ../../library/optparse.rst:969 msgid "``epilog`` (default: ``None``)" msgstr "" -#: ../../library/optparse.rst:859 +#: ../../library/optparse.rst:970 msgid "A paragraph of help text to print after the option help." msgstr "" -#: ../../library/optparse.rst:864 +#: ../../library/optparse.rst:975 msgid "Populating the parser" msgstr "" -#: ../../library/optparse.rst:866 +#: ../../library/optparse.rst:977 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:870 +#: ../../library/optparse.rst:981 msgid "pass it an Option instance (as returned by :func:`make_option`)" msgstr "" -#: ../../library/optparse.rst:872 +#: ../../library/optparse.rst:983 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:876 +#: ../../library/optparse.rst:987 msgid "" "The other alternative is to pass a list of pre-constructed Option instances " "to the OptionParser constructor, as in::" msgstr "" -#: ../../library/optparse.rst:879 +#: ../../library/optparse.rst:990 msgid "" "option_list = [\n" " make_option(\"-f\", \"--filename\",\n" @@ -1376,7 +1563,7 @@ msgid "" "parser = OptionParser(option_list=option_list)" msgstr "" -#: ../../library/optparse.rst:887 +#: ../../library/optparse.rst:998 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 :" @@ -1385,40 +1572,40 @@ msgid "" "Option directly.)" msgstr "" -#: ../../library/optparse.rst:896 +#: ../../library/optparse.rst:1007 msgid "Defining options" msgstr "" -#: ../../library/optparse.rst:898 +#: ../../library/optparse.rst:1009 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:902 +#: ../../library/optparse.rst:1013 msgid "" "The canonical way to create an :class:`Option` instance is with the :meth:" "`add_option` method of :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:908 +#: ../../library/optparse.rst:1019 msgid "To define an option with only a short option string::" msgstr "" -#: ../../library/optparse.rst:910 +#: ../../library/optparse.rst:1021 msgid "parser.add_option(\"-f\", attr=value, ...)" msgstr "" -#: ../../library/optparse.rst:912 +#: ../../library/optparse.rst:1023 msgid "And to define an option with only a long option string::" msgstr "" -#: ../../library/optparse.rst:914 +#: ../../library/optparse.rst:1025 msgid "parser.add_option(\"--foo\", attr=value, ...)" msgstr "" -#: ../../library/optparse.rst:916 +#: ../../library/optparse.rst:1027 msgid "" "The keyword arguments define attributes of the new Option object. The most " "important option attribute is :attr:`~Option.action`, and it largely " @@ -1427,69 +1614,69 @@ msgid "" "raises an :exc:`OptionError` exception explaining your mistake." msgstr "" -#: ../../library/optparse.rst:922 +#: ../../library/optparse.rst:1033 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:926 +#: ../../library/optparse.rst:1037 msgid "``\"store\"``" msgstr "``\"store\"``" -#: ../../library/optparse.rst:927 +#: ../../library/optparse.rst:1038 msgid "store this option's argument (default)" msgstr "" -#: ../../library/optparse.rst:932 +#: ../../library/optparse.rst:1043 msgid "``\"store_true\"``" msgstr "``\"store_true\"``" -#: ../../library/optparse.rst:933 +#: ../../library/optparse.rst:1044 msgid "store ``True``" msgstr "" -#: ../../library/optparse.rst:935 +#: ../../library/optparse.rst:1046 msgid "``\"store_false\"``" msgstr "``\"store_false\"``" -#: ../../library/optparse.rst:936 +#: ../../library/optparse.rst:1047 msgid "store ``False``" msgstr "" -#: ../../library/optparse.rst:941 +#: ../../library/optparse.rst:1052 msgid "``\"append_const\"``" msgstr "``\"append_const\"``" -#: ../../library/optparse.rst:942 +#: ../../library/optparse.rst:1053 msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" -#: ../../library/optparse.rst:950 ../../library/optparse.rst:1245 +#: ../../library/optparse.rst:1061 ../../library/optparse.rst:1356 msgid "``\"help\"``" msgstr "``\"help\"``" -#: ../../library/optparse.rst:951 +#: ../../library/optparse.rst:1062 msgid "" "print a usage message including all options and the documentation for them" msgstr "" -#: ../../library/optparse.rst:953 +#: ../../library/optparse.rst:1064 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:957 +#: ../../library/optparse.rst:1068 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:963 +#: ../../library/optparse.rst:1074 msgid "" "An object holding parsed argument names and values as attributes. Normally " "created by calling when calling :meth:`OptionParser.parse_args`, and can be " @@ -1498,35 +1685,35 @@ msgid "" "arguments`)." msgstr "" -#: ../../library/optparse.rst:968 +#: ../../library/optparse.rst:1079 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:972 +#: ../../library/optparse.rst:1083 msgid "For example, when you call ::" msgstr "例如說,當你呼叫: ::" -#: ../../library/optparse.rst:974 +#: ../../library/optparse.rst:1085 msgid "parser.parse_args()" msgstr "parser.parse_args()" -#: ../../library/optparse.rst:976 +#: ../../library/optparse.rst:1087 msgid "" "one of the first things :mod:`optparse` does is create the ``options`` " "object::" msgstr "" -#: ../../library/optparse.rst:978 +#: ../../library/optparse.rst:1089 msgid "options = Values()" msgstr "options = Values()" -#: ../../library/optparse.rst:980 +#: ../../library/optparse.rst:1091 msgid "If one of the options in this parser is defined with ::" msgstr "" -#: ../../library/optparse.rst:982 +#: ../../library/optparse.rst:1093 msgid "" "parser.add_option(\"-f\", \"--file\", action=\"store\", type=\"string\", " "dest=\"filename\")" @@ -1534,11 +1721,11 @@ msgstr "" "parser.add_option(\"-f\", \"--file\", action=\"store\", type=\"string\", " "dest=\"filename\")" -#: ../../library/optparse.rst:984 +#: ../../library/optparse.rst:1095 msgid "and the command-line being parsed includes any of the following::" msgstr "" -#: ../../library/optparse.rst:986 +#: ../../library/optparse.rst:1097 msgid "" "-ffoo\n" "-f foo\n" @@ -1550,27 +1737,27 @@ msgstr "" "--file=foo\n" "--file foo" -#: ../../library/optparse.rst:991 +#: ../../library/optparse.rst:1102 msgid "" "then :mod:`optparse`, on seeing this option, will do the equivalent of ::" msgstr "" -#: ../../library/optparse.rst:993 +#: ../../library/optparse.rst:1104 msgid "options.filename = \"foo\"" msgstr "options.filename = \"foo\"" -#: ../../library/optparse.rst:995 +#: ../../library/optparse.rst:1106 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:1003 +#: ../../library/optparse.rst:1114 msgid "Option attributes" msgstr "" -#: ../../library/optparse.rst:1007 +#: ../../library/optparse.rst:1118 msgid "" "A single command line argument, with various attributes passed by keyword to " "the constructor. Normally created with :meth:`OptionParser.add_option` " @@ -1578,7 +1765,7 @@ msgid "" "*option_class* argument to :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:1013 +#: ../../library/optparse.rst:1124 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 " @@ -1586,33 +1773,33 @@ msgid "" "attribute, :mod:`optparse` raises :exc:`OptionError`." msgstr "" -#: ../../library/optparse.rst:1020 +#: ../../library/optparse.rst:1131 msgid "(default: ``\"store\"``)" msgstr "(預設值: ``\"store\"`` )" -#: ../../library/optparse.rst:1022 +#: ../../library/optparse.rst:1133 msgid "" "Determines :mod:`optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here <optparse-" "standard-option-actions>`." msgstr "" -#: ../../library/optparse.rst:1028 +#: ../../library/optparse.rst:1139 msgid "(default: ``\"string\"``)" msgstr "(預設值: ``\"string\"`` )" -#: ../../library/optparse.rst:1030 +#: ../../library/optparse.rst:1141 msgid "" "The argument type expected by this option (e.g., ``\"string\"`` or " "``\"int\"``); the available option types are documented :ref:`here <optparse-" "standard-option-types>`." msgstr "" -#: ../../library/optparse.rst:1036 ../../library/optparse.rst:1086 +#: ../../library/optparse.rst:1147 ../../library/optparse.rst:1197 msgid "(default: derived from option strings)" msgstr "" -#: ../../library/optparse.rst:1038 +#: ../../library/optparse.rst:1149 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 " @@ -1620,47 +1807,47 @@ msgid "" "the command line." msgstr "" -#: ../../library/optparse.rst:1045 +#: ../../library/optparse.rst:1156 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:1050 +#: ../../library/optparse.rst:1161 msgid "(default: 1)" msgstr "(預設值:1)" -#: ../../library/optparse.rst:1052 +#: ../../library/optparse.rst:1163 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:1058 +#: ../../library/optparse.rst:1169 msgid "For actions that store a constant value, the constant value to store." msgstr "" -#: ../../library/optparse.rst:1062 +#: ../../library/optparse.rst:1173 msgid "" "For options of type ``\"choice\"``, the list of strings the user may choose " "from." msgstr "" -#: ../../library/optparse.rst:1067 +#: ../../library/optparse.rst:1178 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:1074 +#: ../../library/optparse.rst:1185 msgid "" "Additional positional and keyword arguments to pass to ``callback`` after " "the four standard callback arguments." msgstr "" -#: ../../library/optparse.rst:1079 +#: ../../library/optparse.rst:1190 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 " @@ -1668,17 +1855,17 @@ msgid "" "this option, use the special value :const:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1088 +#: ../../library/optparse.rst:1199 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:1095 +#: ../../library/optparse.rst:1206 msgid "Standard option actions" msgstr "" -#: ../../library/optparse.rst:1097 +#: ../../library/optparse.rst:1208 msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " @@ -1686,13 +1873,13 @@ msgid "" "attributes, which you must specify for any option using that action." msgstr "" -#: ../../library/optparse.rst:1102 +#: ../../library/optparse.rst:1213 msgid "" "``\"store\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1105 +#: ../../library/optparse.rst:1216 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 :" @@ -1702,17 +1889,17 @@ msgid "" "option-types` section." msgstr "" -#: ../../library/optparse.rst:1112 +#: ../../library/optparse.rst:1223 msgid "" "If :attr:`~Option.choices` is supplied (a list or tuple of strings), the " "type defaults to ``\"choice\"``." msgstr "" -#: ../../library/optparse.rst:1115 +#: ../../library/optparse.rst:1226 msgid "If :attr:`~Option.type` is not supplied, it defaults to ``\"string\"``." msgstr "" -#: ../../library/optparse.rst:1117 +#: ../../library/optparse.rst:1228 msgid "" "If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " @@ -1720,13 +1907,13 @@ msgid "" "destination from the first short option string (e.g., ``-f`` implies ``f``)." msgstr "" -#: ../../library/optparse.rst:1122 ../../library/optparse.rst:1142 -#: ../../library/optparse.rst:1164 ../../library/optparse.rst:1182 -#: ../../library/optparse.rst:1221 ../../library/optparse.rst:1259 +#: ../../library/optparse.rst:1233 ../../library/optparse.rst:1253 +#: ../../library/optparse.rst:1275 ../../library/optparse.rst:1293 +#: ../../library/optparse.rst:1332 ../../library/optparse.rst:1370 msgid "Example::" msgstr "範例: ::" -#: ../../library/optparse.rst:1124 +#: ../../library/optparse.rst:1235 msgid "" "parser.add_option(\"-f\")\n" "parser.add_option(\"-p\", type=\"float\", nargs=3, dest=\"point\")" @@ -1734,19 +1921,19 @@ msgstr "" "parser.add_option(\"-f\")\n" "parser.add_option(\"-p\", type=\"float\", nargs=3, dest=\"point\")" -#: ../../library/optparse.rst:1127 +#: ../../library/optparse.rst:1238 msgid "As it parses the command line ::" msgstr "" -#: ../../library/optparse.rst:1129 +#: ../../library/optparse.rst:1240 msgid "-f foo.txt -p 1 -3.5 4 -fbar.txt" msgstr "-f foo.txt -p 1 -3.5 4 -fbar.txt" -#: ../../library/optparse.rst:1131 +#: ../../library/optparse.rst:1242 msgid ":mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1133 +#: ../../library/optparse.rst:1244 msgid "" "options.f = \"foo.txt\"\n" "options.point = (1.0, -3.5, 4.0)\n" @@ -1756,17 +1943,17 @@ msgstr "" "options.point = (1.0, -3.5, 4.0)\n" "options.f = \"bar.txt\"" -#: ../../library/optparse.rst:1137 +#: ../../library/optparse.rst:1248 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1140 +#: ../../library/optparse.rst:1251 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1144 +#: ../../library/optparse.rst:1255 msgid "" "parser.add_option(\"-q\", \"--quiet\",\n" " action=\"store_const\", const=0, dest=\"verbose\")\n" @@ -1782,33 +1969,33 @@ msgstr "" "parser.add_option(\"--noisy\",\n" " action=\"store_const\", const=2, dest=\"verbose\")" -#: ../../library/optparse.rst:1151 +#: ../../library/optparse.rst:1262 msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" msgstr "" -#: ../../library/optparse.rst:1153 +#: ../../library/optparse.rst:1264 msgid "options.verbose = 2" msgstr "options.verbose = 2" -#: ../../library/optparse.rst:1155 +#: ../../library/optparse.rst:1266 msgid "``\"store_true\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1157 +#: ../../library/optparse.rst:1268 msgid "" "A special case of ``\"store_const\"`` that stores ``True`` to :attr:`~Option." "dest`." msgstr "" -#: ../../library/optparse.rst:1160 +#: ../../library/optparse.rst:1271 msgid "``\"store_false\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1162 +#: ../../library/optparse.rst:1273 msgid "Like ``\"store_true\"``, but stores ``False``." msgstr "" -#: ../../library/optparse.rst:1166 +#: ../../library/optparse.rst:1277 msgid "" "parser.add_option(\"--clobber\", action=\"store_true\", dest=\"clobber\")\n" "parser.add_option(\"--no-clobber\", action=\"store_false\", dest=\"clobber\")" @@ -1816,13 +2003,13 @@ msgstr "" "parser.add_option(\"--clobber\", action=\"store_true\", dest=\"clobber\")\n" "parser.add_option(\"--no-clobber\", action=\"store_false\", dest=\"clobber\")" -#: ../../library/optparse.rst:1169 +#: ../../library/optparse.rst:1280 msgid "" "``\"append\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: ../../library/optparse.rst:1172 +#: ../../library/optparse.rst:1283 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 " @@ -1832,25 +2019,25 @@ msgid "" "is appended to :attr:`~Option.dest`." msgstr "" -#: ../../library/optparse.rst:1179 +#: ../../library/optparse.rst:1290 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:1295 msgid "" "parser.add_option(\"-t\", \"--tracks\", action=\"append\", type=\"int\")" msgstr "" "parser.add_option(\"-t\", \"--tracks\", action=\"append\", type=\"int\")" -#: ../../library/optparse.rst:1186 +#: ../../library/optparse.rst:1297 msgid "" "If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " "of::" msgstr "" -#: ../../library/optparse.rst:1189 +#: ../../library/optparse.rst:1300 msgid "" "options.tracks = []\n" "options.tracks.append(int(\"3\"))" @@ -1858,15 +2045,15 @@ msgstr "" "options.tracks = []\n" "options.tracks.append(int(\"3\"))" -#: ../../library/optparse.rst:1192 +#: ../../library/optparse.rst:1303 msgid "If, a little later on, ``--tracks=4`` is seen, it does::" msgstr "" -#: ../../library/optparse.rst:1194 +#: ../../library/optparse.rst:1305 msgid "options.tracks.append(int(\"4\"))" msgstr "options.tracks.append(int(\"4\"))" -#: ../../library/optparse.rst:1196 +#: ../../library/optparse.rst:1307 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 " @@ -1875,7 +2062,7 @@ msgid "" "with any values from the command line appended after those default values::" msgstr "" -#: ../../library/optparse.rst:1202 +#: ../../library/optparse.rst:1313 msgid "" ">>> parser.add_option(\"--files\", action=\"append\", default=['~/.mypkg/" "defaults'])\n" @@ -1889,13 +2076,13 @@ msgstr "" ">>> opts.files\n" "['~/.mypkg/defaults', 'overrides.mypkg']" -#: ../../library/optparse.rst:1207 +#: ../../library/optparse.rst:1318 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1210 +#: ../../library/optparse.rst:1321 msgid "" "Like ``\"store_const\"``, but the value :attr:`~Option.const` is appended " "to :attr:`~Option.dest`; as with ``\"append\"``, :attr:`~Option.dest` " @@ -1903,28 +2090,28 @@ msgid "" "time the option is encountered." msgstr "" -#: ../../library/optparse.rst:1215 +#: ../../library/optparse.rst:1326 msgid "``\"count\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: ../../library/optparse.rst:1217 +#: ../../library/optparse.rst:1328 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:1334 msgid "parser.add_option(\"-v\", action=\"count\", dest=\"verbosity\")" msgstr "parser.add_option(\"-v\", action=\"count\", dest=\"verbosity\")" -#: ../../library/optparse.rst:1225 +#: ../../library/optparse.rst:1336 msgid "" "The first time ``-v`` is seen on the command line, :mod:`optparse` does the " "equivalent of::" msgstr "" -#: ../../library/optparse.rst:1228 +#: ../../library/optparse.rst:1339 msgid "" "options.verbosity = 0\n" "options.verbosity += 1" @@ -1932,36 +2119,36 @@ msgstr "" "options.verbosity = 0\n" "options.verbosity += 1" -#: ../../library/optparse.rst:1231 +#: ../../library/optparse.rst:1342 msgid "Every subsequent occurrence of ``-v`` results in ::" msgstr "" -#: ../../library/optparse.rst:1233 +#: ../../library/optparse.rst:1344 msgid "options.verbosity += 1" msgstr "options.verbosity += 1" -#: ../../library/optparse.rst:1235 +#: ../../library/optparse.rst:1346 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:1239 +#: ../../library/optparse.rst:1350 msgid "" "Call the function specified by :attr:`~Option.callback`, which is called " "as ::" msgstr "" -#: ../../library/optparse.rst:1241 ../../library/optparse.rst:1639 +#: ../../library/optparse.rst:1352 ../../library/optparse.rst:1750 msgid "func(option, opt_str, value, parser, *args, **kwargs)" msgstr "func(option, opt_str, value, parser, *args, **kwargs)" -#: ../../library/optparse.rst:1243 +#: ../../library/optparse.rst:1354 msgid "See section :ref:`optparse-option-callbacks` for more detail." msgstr "更多細節請見 :ref:`optparse-option-callbacks`。" -#: ../../library/optparse.rst:1247 +#: ../../library/optparse.rst:1358 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 " @@ -1969,20 +2156,20 @@ msgid "" "every option." msgstr "" -#: ../../library/optparse.rst:1252 +#: ../../library/optparse.rst:1363 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 :const:`optparse.SUPPRESS_HELP`." msgstr "" -#: ../../library/optparse.rst:1256 +#: ../../library/optparse.rst:1367 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:1261 +#: ../../library/optparse.rst:1372 msgid "" "from optparse import OptionParser, SUPPRESS_HELP\n" "\n" @@ -1998,14 +2185,14 @@ msgid "" "parser.add_option(\"--secret\", help=SUPPRESS_HELP)" msgstr "" -#: ../../library/optparse.rst:1274 +#: ../../library/optparse.rst:1385 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:1278 +#: ../../library/optparse.rst:1389 msgid "" "Usage: foo.py [options]\n" "\n" @@ -2021,17 +2208,17 @@ msgstr "" " -v Be moderately verbose\n" " --file=FILENAME Input file to read data from" -#: ../../library/optparse.rst:1287 +#: ../../library/optparse.rst:1398 msgid "" "After printing the help message, :mod:`optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" -#: ../../library/optparse.rst:1290 +#: ../../library/optparse.rst:1401 msgid "``\"version\"``" msgstr "``\"version\"``" -#: ../../library/optparse.rst:1292 +#: ../../library/optparse.rst:1403 msgid "" "Prints the version number supplied to the OptionParser to stdout and exits. " "The version number is actually formatted and printed by the " @@ -2041,58 +2228,58 @@ msgid "" "since :mod:`optparse` automatically adds them when needed." msgstr "" -#: ../../library/optparse.rst:1303 +#: ../../library/optparse.rst:1414 msgid "Standard option types" msgstr "" -#: ../../library/optparse.rst:1305 +#: ../../library/optparse.rst:1416 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:1309 +#: ../../library/optparse.rst:1420 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:1312 +#: ../../library/optparse.rst:1423 msgid "Integer arguments (type ``\"int\"``) are parsed as follows:" msgstr "" -#: ../../library/optparse.rst:1314 +#: ../../library/optparse.rst:1425 msgid "if the number starts with ``0x``, it is parsed as a hexadecimal number" msgstr "" -#: ../../library/optparse.rst:1316 +#: ../../library/optparse.rst:1427 msgid "if the number starts with ``0``, it is parsed as an octal number" msgstr "" -#: ../../library/optparse.rst:1318 +#: ../../library/optparse.rst:1429 msgid "if the number starts with ``0b``, it is parsed as a binary number" msgstr "" -#: ../../library/optparse.rst:1320 +#: ../../library/optparse.rst:1431 msgid "otherwise, the number is parsed as a decimal number" msgstr "" -#: ../../library/optparse.rst:1323 +#: ../../library/optparse.rst:1434 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:1327 +#: ../../library/optparse.rst:1438 msgid "" "``\"float\"`` and ``\"complex\"`` option arguments are converted directly " "with :func:`float` and :func:`complex`, with similar error-handling." msgstr "" -#: ../../library/optparse.rst:1330 +#: ../../library/optparse.rst:1441 msgid "" "``\"choice\"`` options are a subtype of ``\"string\"`` options. The :attr:" "`~Option.choices` option attribute (a sequence of strings) defines the set " @@ -2101,63 +2288,63 @@ msgid "" "`OptionValueError` if an invalid string is given." msgstr "" -#: ../../library/optparse.rst:1340 +#: ../../library/optparse.rst:1451 msgid "Parsing arguments" msgstr "剖析引數" -#: ../../library/optparse.rst:1342 +#: ../../library/optparse.rst:1453 msgid "" "The whole point of creating and populating an OptionParser is to call its :" "meth:`~OptionParser.parse_args` method." msgstr "" -#: ../../library/optparse.rst:1347 +#: ../../library/optparse.rst:1458 msgid "Parse the command-line options found in *args*." msgstr "" -#: ../../library/optparse.rst:1349 +#: ../../library/optparse.rst:1460 msgid "The input parameters are" msgstr "" -#: ../../library/optparse.rst:1351 ../../library/optparse.rst:1365 -#: ../../library/optparse.rst:1683 +#: ../../library/optparse.rst:1462 ../../library/optparse.rst:1476 +#: ../../library/optparse.rst:1794 msgid "``args``" msgstr "``args``" -#: ../../library/optparse.rst:1352 +#: ../../library/optparse.rst:1463 msgid "the list of arguments to process (default: ``sys.argv[1:]``)" msgstr "" -#: ../../library/optparse.rst:1354 +#: ../../library/optparse.rst:1465 msgid "``values``" msgstr "``values``" -#: ../../library/optparse.rst:1355 +#: ../../library/optparse.rst:1466 msgid "" "a :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:1359 +#: ../../library/optparse.rst:1470 msgid "and the return value is a pair ``(options, args)`` where" msgstr "" -#: ../../library/optparse.rst:1361 +#: ../../library/optparse.rst:1472 msgid "``options``" msgstr "``options``" -#: ../../library/optparse.rst:1362 +#: ../../library/optparse.rst:1473 msgid "" "the same object that was passed in as *values*, or the ``optparse.Values`` " "instance created by :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1366 +#: ../../library/optparse.rst:1477 msgid "the leftover positional arguments after all options have been processed" msgstr "" -#: ../../library/optparse.rst:1368 +#: ../../library/optparse.rst:1479 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 " @@ -2165,7 +2352,7 @@ msgid "" "by :meth:`~OptionParser.parse_args`." msgstr "" -#: ../../library/optparse.rst:1373 +#: ../../library/optparse.rst:1484 msgid "" "If :meth:`~OptionParser.parse_args` encounters any errors in the argument " "list, it calls the OptionParser's :meth:`error` method with an appropriate " @@ -2173,69 +2360,69 @@ msgid "" "status of 2 (the traditional Unix exit status for command-line errors)." msgstr "" -#: ../../library/optparse.rst:1382 +#: ../../library/optparse.rst:1493 msgid "Querying and manipulating your option parser" msgstr "" -#: ../../library/optparse.rst:1384 +#: ../../library/optparse.rst:1495 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:1390 +#: ../../library/optparse.rst:1501 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:1394 +#: ../../library/optparse.rst:1505 msgid "prog -a arg1 -b arg2" msgstr "prog -a arg1 -b arg2" -#: ../../library/optparse.rst:1396 +#: ../../library/optparse.rst:1507 msgid "and treats it as equivalent to ::" msgstr "" -#: ../../library/optparse.rst:1398 +#: ../../library/optparse.rst:1509 msgid "prog -a -b arg1 arg2" msgstr "prog -a -b arg1 arg2" -#: ../../library/optparse.rst:1400 +#: ../../library/optparse.rst:1511 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:1404 +#: ../../library/optparse.rst:1515 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:1410 +#: ../../library/optparse.rst:1521 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:1415 +#: ../../library/optparse.rst:1526 msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -#: ../../library/optparse.rst:1420 +#: ../../library/optparse.rst:1531 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -#: ../../library/optparse.rst:1425 +#: ../../library/optparse.rst:1536 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 " @@ -2243,17 +2430,17 @@ msgid "" "option belonging to this :class:`OptionParser`, raises :exc:`ValueError`." msgstr "" -#: ../../library/optparse.rst:1434 +#: ../../library/optparse.rst:1545 msgid "Conflicts between options" msgstr "" -#: ../../library/optparse.rst:1436 +#: ../../library/optparse.rst:1547 msgid "" "If you're not careful, it's easy to define options with conflicting option " "strings::" msgstr "" -#: ../../library/optparse.rst:1439 +#: ../../library/optparse.rst:1550 msgid "" "parser.add_option(\"-n\", \"--dry-run\", ...)\n" "...\n" @@ -2263,13 +2450,13 @@ msgstr "" "...\n" "parser.add_option(\"-n\", \"--noisy\", ...)" -#: ../../library/optparse.rst:1443 +#: ../../library/optparse.rst:1554 msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -#: ../../library/optparse.rst:1446 +#: ../../library/optparse.rst:1557 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 " @@ -2277,47 +2464,47 @@ msgid "" "constructor::" msgstr "" -#: ../../library/optparse.rst:1450 +#: ../../library/optparse.rst:1561 msgid "parser = OptionParser(..., conflict_handler=handler)" msgstr "parser = OptionParser(..., conflict_handler=handler)" -#: ../../library/optparse.rst:1452 +#: ../../library/optparse.rst:1563 msgid "or with a separate call::" msgstr "" -#: ../../library/optparse.rst:1454 +#: ../../library/optparse.rst:1565 msgid "parser.set_conflict_handler(handler)" msgstr "parser.set_conflict_handler(handler)" -#: ../../library/optparse.rst:1456 +#: ../../library/optparse.rst:1567 msgid "The available conflict handlers are:" msgstr "" -#: ../../library/optparse.rst:1458 +#: ../../library/optparse.rst:1569 msgid "``\"error\"`` (default)" msgstr "" -#: ../../library/optparse.rst:1459 +#: ../../library/optparse.rst:1570 msgid "" "assume option conflicts are a programming error and raise :exc:" "`OptionConflictError`" msgstr "" -#: ../../library/optparse.rst:1462 +#: ../../library/optparse.rst:1573 msgid "``\"resolve\"``" msgstr "``\"resolve\"``" -#: ../../library/optparse.rst:1463 +#: ../../library/optparse.rst:1574 msgid "resolve option conflicts intelligently (see below)" msgstr "" -#: ../../library/optparse.rst:1466 +#: ../../library/optparse.rst:1577 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:1580 msgid "" "parser = OptionParser(conflict_handler=\"resolve\")\n" "parser.add_option(\"-n\", \"--dry-run\", ..., help=\"do no harm\")\n" @@ -2327,7 +2514,7 @@ msgstr "" "parser.add_option(\"-n\", \"--dry-run\", ..., help=\"do no harm\")\n" "parser.add_option(\"-n\", \"--noisy\", ..., help=\"be noisy\")" -#: ../../library/optparse.rst:1473 +#: ../../library/optparse.rst:1584 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " @@ -2337,7 +2524,7 @@ msgid "" "message will reflect that::" msgstr "" -#: ../../library/optparse.rst:1479 +#: ../../library/optparse.rst:1590 msgid "" "Options:\n" " --dry-run do no harm\n" @@ -2345,7 +2532,7 @@ msgid "" " -n, --noisy be noisy" msgstr "" -#: ../../library/optparse.rst:1484 +#: ../../library/optparse.rst:1595 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 " @@ -2354,17 +2541,17 @@ msgid "" "Carrying on with our existing OptionParser::" msgstr "" -#: ../../library/optparse.rst:1490 +#: ../../library/optparse.rst:1601 msgid "parser.add_option(\"--dry-run\", ..., help=\"new dry-run option\")" msgstr "parser.add_option(\"--dry-run\", ..., help=\"new dry-run option\")" -#: ../../library/optparse.rst:1492 +#: ../../library/optparse.rst:1603 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:1495 +#: ../../library/optparse.rst:1606 msgid "" "Options:\n" " ...\n" @@ -2376,11 +2563,11 @@ msgstr "" " -n, --noisy be noisy\n" " --dry-run new dry-run option" -#: ../../library/optparse.rst:1504 +#: ../../library/optparse.rst:1615 msgid "Cleanup" msgstr "" -#: ../../library/optparse.rst:1506 +#: ../../library/optparse.rst:1617 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 " @@ -2390,15 +2577,15 @@ msgid "" "OptionParser." msgstr "" -#: ../../library/optparse.rst:1517 +#: ../../library/optparse.rst:1628 msgid "Other methods" msgstr "其他方法" -#: ../../library/optparse.rst:1519 +#: ../../library/optparse.rst:1630 msgid "OptionParser supports several other public methods:" msgstr "" -#: ../../library/optparse.rst:1523 +#: ../../library/optparse.rst:1634 msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " @@ -2406,7 +2593,7 @@ msgid "" "message." msgstr "" -#: ../../library/optparse.rst:1529 +#: ../../library/optparse.rst:1640 msgid "" "Print the usage message for the current program (``self.usage``) to *file* " "(default stdout). Any occurrence of the string ``%prog`` in ``self.usage`` " @@ -2414,13 +2601,13 @@ msgid "" "usage`` is empty or not defined." msgstr "" -#: ../../library/optparse.rst:1536 +#: ../../library/optparse.rst:1647 msgid "" "Same as :meth:`print_usage` but returns the usage string instead of printing " "it." msgstr "" -#: ../../library/optparse.rst:1541 +#: ../../library/optparse.rst:1652 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 " @@ -2429,7 +2616,7 @@ msgid "" "default, and the last one wins::" msgstr "" -#: ../../library/optparse.rst:1547 +#: ../../library/optparse.rst:1658 msgid "" "parser.add_option(\"--advanced\", action=\"store_const\",\n" " dest=\"mode\", const=\"advanced\",\n" @@ -2439,11 +2626,11 @@ msgid "" " default=\"advanced\") # overrides above setting" msgstr "" -#: ../../library/optparse.rst:1554 +#: ../../library/optparse.rst:1665 msgid "To avoid this confusion, use :meth:`set_defaults`::" msgstr "" -#: ../../library/optparse.rst:1556 +#: ../../library/optparse.rst:1667 msgid "" "parser.set_defaults(mode=\"advanced\")\n" "parser.add_option(\"--advanced\", action=\"store_const\",\n" @@ -2457,11 +2644,11 @@ msgstr "" "parser.add_option(\"--novice\", action=\"store_const\",\n" " dest=\"mode\", const=\"novice\")" -#: ../../library/optparse.rst:1566 +#: ../../library/optparse.rst:1677 msgid "Option Callbacks" msgstr "" -#: ../../library/optparse.rst:1568 +#: ../../library/optparse.rst:1679 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 " @@ -2469,25 +2656,25 @@ msgid "" "a lot of simple cases. Quite often a simple callback is all you need." msgstr "" -#: ../../library/optparse.rst:1573 +#: ../../library/optparse.rst:1684 msgid "There are two steps to defining a callback option:" msgstr "" -#: ../../library/optparse.rst:1575 +#: ../../library/optparse.rst:1686 msgid "define the option itself using the ``\"callback\"`` action" msgstr "" -#: ../../library/optparse.rst:1577 +#: ../../library/optparse.rst:1688 msgid "" "write the callback; this is a function (or method) that takes at least four " "arguments, as described below" msgstr "" -#: ../../library/optparse.rst:1584 +#: ../../library/optparse.rst:1695 msgid "Defining a callback option" msgstr "" -#: ../../library/optparse.rst:1586 +#: ../../library/optparse.rst:1697 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 " @@ -2495,11 +2682,11 @@ msgid "" "call::" msgstr "" -#: ../../library/optparse.rst:1590 +#: ../../library/optparse.rst:1701 msgid "parser.add_option(\"-c\", action=\"callback\", callback=my_callback)" msgstr "parser.add_option(\"-c\", action=\"callback\", callback=my_callback)" -#: ../../library/optparse.rst:1592 +#: ../../library/optparse.rst:1703 msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " @@ -2511,7 +2698,7 @@ msgid "" "tricky; it's covered later in this section." msgstr "" -#: ../../library/optparse.rst:1601 +#: ../../library/optparse.rst:1712 msgid "" ":mod:`optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" @@ -2519,25 +2706,25 @@ msgid "" "minimal callback function signature is::" msgstr "" -#: ../../library/optparse.rst:1606 +#: ../../library/optparse.rst:1717 msgid "def my_callback(option, opt, value, parser):" msgstr "def my_callback(option, opt, value, parser):" -#: ../../library/optparse.rst:1608 +#: ../../library/optparse.rst:1719 msgid "The four arguments to a callback are described below." msgstr "" -#: ../../library/optparse.rst:1610 +#: ../../library/optparse.rst:1721 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:1724 msgid ":attr:`~Option.type`" msgstr ":attr:`~Option.type`" -#: ../../library/optparse.rst:1614 +#: ../../library/optparse.rst:1725 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:" @@ -2545,11 +2732,11 @@ msgid "" "though, :mod:`optparse` passes it to your callback function." msgstr "" -#: ../../library/optparse.rst:1619 +#: ../../library/optparse.rst:1730 msgid ":attr:`~Option.nargs`" msgstr ":attr:`~Option.nargs`" -#: ../../library/optparse.rst:1620 +#: ../../library/optparse.rst:1731 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 " @@ -2557,43 +2744,43 @@ msgid "" "callback." msgstr "" -#: ../../library/optparse.rst:1625 +#: ../../library/optparse.rst:1736 msgid ":attr:`~Option.callback_args`" msgstr ":attr:`~Option.callback_args`" -#: ../../library/optparse.rst:1626 +#: ../../library/optparse.rst:1737 msgid "a tuple of extra positional arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1628 +#: ../../library/optparse.rst:1739 msgid ":attr:`~Option.callback_kwargs`" msgstr ":attr:`~Option.callback_kwargs`" -#: ../../library/optparse.rst:1629 +#: ../../library/optparse.rst:1740 msgid "a dictionary of extra keyword arguments to pass to the callback" msgstr "" -#: ../../library/optparse.rst:1635 +#: ../../library/optparse.rst:1746 msgid "How callbacks are called" msgstr "" -#: ../../library/optparse.rst:1637 +#: ../../library/optparse.rst:1748 msgid "All callbacks are called as follows::" msgstr "" -#: ../../library/optparse.rst:1643 +#: ../../library/optparse.rst:1754 msgid "``option``" msgstr "``option``" -#: ../../library/optparse.rst:1644 +#: ../../library/optparse.rst:1755 msgid "is the Option instance that's calling the callback" msgstr "" -#: ../../library/optparse.rst:1646 +#: ../../library/optparse.rst:1757 msgid "``opt_str``" msgstr "``opt_str``" -#: ../../library/optparse.rst:1647 +#: ../../library/optparse.rst:1758 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 " @@ -2602,11 +2789,11 @@ msgid "" "``\"--foobar\"``.)" msgstr "" -#: ../../library/optparse.rst:1653 +#: ../../library/optparse.rst:1764 msgid "``value``" msgstr "``value``" -#: ../../library/optparse.rst:1654 +#: ../../library/optparse.rst:1765 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 " @@ -2616,21 +2803,21 @@ msgid "" "of values of the appropriate type." msgstr "" -#: ../../library/optparse.rst:1660 +#: ../../library/optparse.rst:1771 msgid "``parser``" msgstr "``parser``" -#: ../../library/optparse.rst:1661 +#: ../../library/optparse.rst:1772 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:1775 msgid "``parser.largs``" msgstr "``parser.largs``" -#: ../../library/optparse.rst:1665 +#: ../../library/optparse.rst:1776 msgid "" "the current list of leftover arguments, ie. arguments that have been " "consumed but are neither options nor option arguments. Feel free to modify " @@ -2639,22 +2826,22 @@ msgid "" "parse_args`.)" msgstr "" -#: ../../library/optparse.rst:1670 +#: ../../library/optparse.rst:1781 msgid "``parser.rargs``" msgstr "``parser.rargs``" -#: ../../library/optparse.rst:1671 +#: ../../library/optparse.rst:1782 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:1676 +#: ../../library/optparse.rst:1787 msgid "``parser.values``" msgstr "``parser.values``" -#: ../../library/optparse.rst:1677 +#: ../../library/optparse.rst:1788 msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " @@ -2663,27 +2850,27 @@ msgid "" "of any options already encountered on the command-line." msgstr "" -#: ../../library/optparse.rst:1684 +#: ../../library/optparse.rst:1795 msgid "" "is a tuple of arbitrary positional arguments supplied via the :attr:`~Option." "callback_args` option attribute." msgstr "" -#: ../../library/optparse.rst:1687 +#: ../../library/optparse.rst:1798 msgid "``kwargs``" msgstr "``kwargs``" -#: ../../library/optparse.rst:1688 +#: ../../library/optparse.rst:1799 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" -#: ../../library/optparse.rst:1695 +#: ../../library/optparse.rst:1806 msgid "Raising errors in a callback" msgstr "" -#: ../../library/optparse.rst:1697 +#: ../../library/optparse.rst:1808 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " "problems with the option or its argument(s). :mod:`optparse` catches this " @@ -2693,17 +2880,17 @@ msgid "" "they did wrong." msgstr "" -#: ../../library/optparse.rst:1707 +#: ../../library/optparse.rst:1818 msgid "Callback example 1: trivial callback" msgstr "" -#: ../../library/optparse.rst:1709 +#: ../../library/optparse.rst:1820 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:1712 +#: ../../library/optparse.rst:1823 msgid "" "def record_foo_seen(option, opt_str, value, parser):\n" " parser.values.saw_foo = True\n" @@ -2715,21 +2902,21 @@ msgstr "" "\n" "parser.add_option(\"--foo\", action=\"callback\", callback=record_foo_seen)" -#: ../../library/optparse.rst:1717 +#: ../../library/optparse.rst:1828 msgid "Of course, you could do that with the ``\"store_true\"`` action." msgstr "" -#: ../../library/optparse.rst:1723 +#: ../../library/optparse.rst:1834 msgid "Callback example 2: check option order" msgstr "" -#: ../../library/optparse.rst:1725 +#: ../../library/optparse.rst:1836 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:1728 +#: ../../library/optparse.rst:1839 msgid "" "def check_order(option, opt_str, value, parser):\n" " if parser.values.b:\n" @@ -2747,18 +2934,18 @@ msgstr "" "parser.add_option(\"-a\", action=\"callback\", callback=check_order)\n" "parser.add_option(\"-b\", action=\"store_true\", dest=\"b\")" -#: ../../library/optparse.rst:1740 +#: ../../library/optparse.rst:1851 msgid "Callback example 3: check option order (generalized)" msgstr "" -#: ../../library/optparse.rst:1742 +#: ../../library/optparse.rst:1853 msgid "" "If you want to reuse 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:1746 +#: ../../library/optparse.rst:1857 msgid "" "def check_order(option, opt_str, value, parser):\n" " if parser.values.b:\n" @@ -2782,11 +2969,11 @@ msgstr "" "parser.add_option(\"-c\", action=\"callback\", callback=check_order, " "dest='c')" -#: ../../library/optparse.rst:1759 +#: ../../library/optparse.rst:1870 msgid "Callback example 4: check arbitrary condition" msgstr "" -#: ../../library/optparse.rst:1761 +#: ../../library/optparse.rst:1872 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 " @@ -2794,7 +2981,7 @@ msgid "" "is this::" msgstr "" -#: ../../library/optparse.rst:1765 +#: ../../library/optparse.rst:1876 msgid "" "def check_moon(option, opt_str, value, parser):\n" " if is_moon_full():\n" @@ -2814,16 +3001,16 @@ msgstr "" "parser.add_option(\"--foo\",\n" " action=\"callback\", callback=check_moon, dest=\"foo\")" -#: ../../library/optparse.rst:1774 +#: ../../library/optparse.rst:1885 msgid "" "(The definition of ``is_moon_full()`` is left as an exercise for the reader.)" msgstr "" -#: ../../library/optparse.rst:1780 +#: ../../library/optparse.rst:1891 msgid "Callback example 5: fixed arguments" msgstr "" -#: ../../library/optparse.rst:1782 +#: ../../library/optparse.rst:1893 msgid "" "Things get slightly more interesting when you define callback options that " "take a fixed number of arguments. Specifying that a callback option takes " @@ -2833,12 +3020,12 @@ msgid "" "nargs`, then the option takes :attr:`~Option.nargs` arguments." msgstr "" -#: ../../library/optparse.rst:1789 +#: ../../library/optparse.rst:1900 msgid "" "Here's an example that just emulates the standard ``\"store\"`` action::" msgstr "" -#: ../../library/optparse.rst:1791 +#: ../../library/optparse.rst:1902 msgid "" "def store_value(option, opt_str, value, parser):\n" " setattr(parser.values, option.dest, value)\n" @@ -2854,18 +3041,18 @@ msgstr "" " action=\"callback\", callback=store_value,\n" " type=\"int\", nargs=3, dest=\"foo\")" -#: ../../library/optparse.rst:1798 +#: ../../library/optparse.rst:1909 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:1806 +#: ../../library/optparse.rst:1917 msgid "Callback example 6: variable arguments" msgstr "" -#: ../../library/optparse.rst:1808 +#: ../../library/optparse.rst:1919 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` " @@ -2875,23 +3062,23 @@ msgid "" "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" -#: ../../library/optparse.rst:1815 +#: ../../library/optparse.rst:1926 msgid "either ``--`` or ``-`` can be option arguments" msgstr "" -#: ../../library/optparse.rst:1817 +#: ../../library/optparse.rst:1928 msgid "" "bare ``--`` (if not the argument to some option): halt command-line " "processing and discard the ``--``" msgstr "" -#: ../../library/optparse.rst:1820 +#: ../../library/optparse.rst:1931 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:1823 +#: ../../library/optparse.rst:1934 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 " @@ -2900,13 +3087,13 @@ msgid "" "directly)." msgstr "" -#: ../../library/optparse.rst:1829 +#: ../../library/optparse.rst:1940 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -#: ../../library/optparse.rst:1832 +#: ../../library/optparse.rst:1943 msgid "" "def vararg_callback(option, opt_str, value, parser):\n" " assert value is None\n" @@ -2936,22 +3123,22 @@ msgid "" " action=\"callback\", callback=vararg_callback)" msgstr "" -#: ../../library/optparse.rst:1863 +#: ../../library/optparse.rst:1974 msgid "Extending :mod:`optparse`" msgstr "" -#: ../../library/optparse.rst:1865 +#: ../../library/optparse.rst:1976 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:1873 +#: ../../library/optparse.rst:1984 msgid "Adding new types" msgstr "" -#: ../../library/optparse.rst:1875 +#: ../../library/optparse.rst:1986 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 :" @@ -2959,23 +3146,23 @@ msgid "" "TYPE_CHECKER`." msgstr "" -#: ../../library/optparse.rst:1881 +#: ../../library/optparse.rst:1992 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:1886 +#: ../../library/optparse.rst:1997 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -#: ../../library/optparse.rst:1889 +#: ../../library/optparse.rst:2000 msgid "def check_mytype(option, opt, value)" msgstr "def check_mytype(option, opt, value)" -#: ../../library/optparse.rst:1891 +#: ../../library/optparse.rst:2002 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 " @@ -2986,7 +3173,7 @@ msgid "" "``value`` parameter." msgstr "" -#: ../../library/optparse.rst:1899 +#: ../../library/optparse.rst:2010 msgid "" "Your type-checking function should raise :exc:`OptionValueError` if it " "encounters any problems. :exc:`OptionValueError` takes a single string " @@ -2995,7 +3182,7 @@ msgid "" "\"`` and prints everything to stderr before terminating the process." msgstr "" -#: ../../library/optparse.rst:1905 +#: ../../library/optparse.rst:2016 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 " @@ -3003,11 +3190,11 @@ msgid "" "support for complex numbers, but never mind.)" msgstr "" -#: ../../library/optparse.rst:1910 +#: ../../library/optparse.rst:2021 msgid "First, the necessary imports::" msgstr "" -#: ../../library/optparse.rst:1912 +#: ../../library/optparse.rst:2023 msgid "" "from copy import copy\n" "from optparse import Option, OptionValueError" @@ -3015,13 +3202,13 @@ msgstr "" "from copy import copy\n" "from optparse import Option, OptionValueError" -#: ../../library/optparse.rst:1915 +#: ../../library/optparse.rst:2026 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:1918 +#: ../../library/optparse.rst:2029 msgid "" "def check_complex(option, opt, value):\n" " try:\n" @@ -3037,11 +3224,11 @@ msgstr "" " raise OptionValueError(\n" " \"option %s: invalid complex value: %r\" % (opt, value))" -#: ../../library/optparse.rst:1925 +#: ../../library/optparse.rst:2036 msgid "Finally, the Option subclass::" msgstr "" -#: ../../library/optparse.rst:1927 +#: ../../library/optparse.rst:2038 msgid "" "class MyOption (Option):\n" " TYPES = Option.TYPES + (\"complex\",)\n" @@ -3053,7 +3240,7 @@ msgstr "" " TYPE_CHECKER = copy(Option.TYPE_CHECKER)\n" " TYPE_CHECKER[\"complex\"] = check_complex" -#: ../../library/optparse.rst:1932 +#: ../../library/optparse.rst:2043 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:" @@ -3061,14 +3248,14 @@ msgid "" "that except good manners and common sense.)" msgstr "" -#: ../../library/optparse.rst:1937 +#: ../../library/optparse.rst:2048 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:1941 +#: ../../library/optparse.rst:2052 msgid "" "parser = OptionParser(option_class=MyOption)\n" "parser.add_option(\"-c\", type=\"complex\")" @@ -3076,14 +3263,14 @@ msgstr "" "parser = OptionParser(option_class=MyOption)\n" "parser.add_option(\"-c\", type=\"complex\")" -#: ../../library/optparse.rst:1944 +#: ../../library/optparse.rst:2055 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:1948 +#: ../../library/optparse.rst:2059 msgid "" "option_list = [MyOption(\"-c\", action=\"store\", type=\"complex\", " "dest=\"c\")]\n" @@ -3093,32 +3280,32 @@ msgstr "" "dest=\"c\")]\n" "parser = OptionParser(option_list=option_list)" -#: ../../library/optparse.rst:1955 +#: ../../library/optparse.rst:2066 msgid "Adding new actions" msgstr "" -#: ../../library/optparse.rst:1957 +#: ../../library/optparse.rst:2068 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:1960 +#: ../../library/optparse.rst:2071 msgid "\"store\" actions" msgstr "" -#: ../../library/optparse.rst:1961 +#: ../../library/optparse.rst:2072 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:2076 msgid "\"typed\" actions" msgstr "" -#: ../../library/optparse.rst:1966 +#: ../../library/optparse.rst:2077 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. " @@ -3126,7 +3313,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/optparse.rst:1971 +#: ../../library/optparse.rst:2082 msgid "" "These are overlapping sets: some default \"store\" actions are " "``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " @@ -3134,25 +3321,25 @@ msgid "" "``\"callback\"``." msgstr "" -#: ../../library/optparse.rst:1975 +#: ../../library/optparse.rst:2086 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:1980 +#: ../../library/optparse.rst:2091 msgid "All actions must be listed in ACTIONS." msgstr "" -#: ../../library/optparse.rst:1984 +#: ../../library/optparse.rst:2095 msgid "\"store\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1988 +#: ../../library/optparse.rst:2099 msgid "\"typed\" actions are additionally listed here." msgstr "" -#: ../../library/optparse.rst:1992 +#: ../../library/optparse.rst:2103 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` " @@ -3160,13 +3347,13 @@ msgid "" "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" -#: ../../library/optparse.rst:1997 +#: ../../library/optparse.rst:2108 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:2000 +#: ../../library/optparse.rst:2111 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 " @@ -3176,23 +3363,23 @@ msgid "" "option of type ``\"string\"``, the command line ::" msgstr "" -#: ../../library/optparse.rst:2007 +#: ../../library/optparse.rst:2118 msgid "--names=foo,bar --names blah --names ding,dong" msgstr "--names=foo,bar --names blah --names ding,dong" -#: ../../library/optparse.rst:2009 +#: ../../library/optparse.rst:2120 msgid "would result in a list ::" msgstr "" -#: ../../library/optparse.rst:2011 +#: ../../library/optparse.rst:2122 msgid "[\"foo\", \"bar\", \"blah\", \"ding\", \"dong\"]" msgstr "[\"foo\", \"bar\", \"blah\", \"ding\", \"dong\"]" -#: ../../library/optparse.rst:2013 +#: ../../library/optparse.rst:2124 msgid "Again we define a subclass of Option::" msgstr "" -#: ../../library/optparse.rst:2015 +#: ../../library/optparse.rst:2126 msgid "" "class MyOption(Option):\n" "\n" @@ -3224,43 +3411,43 @@ msgstr "" " Option.take_action(\n" " self, action, dest, opt, value, values, parser)" -#: ../../library/optparse.rst:2030 +#: ../../library/optparse.rst:2141 msgid "Features of note:" msgstr "" -#: ../../library/optparse.rst:2032 +#: ../../library/optparse.rst:2143 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:2036 +#: ../../library/optparse.rst:2147 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:2040 +#: ../../library/optparse.rst:2151 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:2044 +#: ../../library/optparse.rst:2155 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:2048 +#: ../../library/optparse.rst:2159 msgid "values.ensure_value(attr, value)" msgstr "values.ensure_value(attr, value)" -#: ../../library/optparse.rst:2050 +#: ../../library/optparse.rst:2161 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 " @@ -3273,28 +3460,28 @@ msgid "" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" -#: ../../library/optparse.rst:2061 +#: ../../library/optparse.rst:2172 msgid "Exceptions" msgstr "例外" -#: ../../library/optparse.rst:2065 +#: ../../library/optparse.rst:2176 msgid "" "Raised if an :class:`Option` instance is created with invalid or " "inconsistent arguments." msgstr "" -#: ../../library/optparse.rst:2070 +#: ../../library/optparse.rst:2181 msgid "Raised if conflicting options are added to an :class:`OptionParser`." msgstr "" -#: ../../library/optparse.rst:2074 +#: ../../library/optparse.rst:2185 msgid "Raised if an invalid option value is encountered on the command line." msgstr "" -#: ../../library/optparse.rst:2078 +#: ../../library/optparse.rst:2189 msgid "Raised if an invalid option is passed on the command line." msgstr "" -#: ../../library/optparse.rst:2082 +#: ../../library/optparse.rst:2193 msgid "Raised if an ambiguous option is passed on the command line." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 77b7368436..595e262f25 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3543,10 +3543,11 @@ msgstr "" #: ../../library/ssl.rst:2510 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets <ssl-" -"nonblocking>` and provides a higher level API. It polls for events using " -"the :mod:`selectors` module and handles :exc:`SSLWantWriteError`, :exc:" -"`SSLWantReadError` and :exc:`BlockingIOError` exceptions. It runs the SSL " -"handshake asynchronously as well." +"nonblocking>` and provides a higher level :ref:`Streams API <asyncio-" +"streams>`. It polls for events using the :mod:`selectors` module and " +"handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` and :exc:" +"`BlockingIOError` exceptions. It runs the SSL handshake asynchronously as " +"well." msgstr "" #: ../../library/ssl.rst:2519 diff --git a/library/superseded.po b/library/superseded.po index 179f3bcb8a..c3e28f3d53 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2022-02-15 20:45+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,9 +26,28 @@ msgstr "已被取代的模組" #: ../../library/superseded.rst:7 #, fuzzy msgid "" -"The modules described in this chapter are deprecated or :term:`soft " -"deprecated` and only kept for backwards compatibility. They have been " -"superseded by other modules." +"The modules described in this chapter have been superseded by other modules " +"for most use cases, and are retained primarily to preserve backwards " +"compatibility." msgstr "" "此章節所描述的模組 (modules) 均已被棄用,僅為了向後相容性而被保留下來。它們已" "經被其他模組所取代。" + +#: ../../library/superseded.rst:10 +msgid "" +"Modules may appear in this chapter because they only cover a limited subset " +"of a problem space, and a more generally applicable solution is available " +"elsewhere in the standard library (for example, :mod:`getopt` covers the " +"very specific task of \"mimic the C :c:func:`!getopt` API in Python\", " +"rather than the broader command line option parsing and argument parsing " +"capabilities offered by :mod:`optparse` and :mod:`argparse`)." +msgstr "" + +#: ../../library/superseded.rst:17 +msgid "" +"Alternatively, modules may appear in this chapter because they are " +"deprecated outright, and awaiting removal in a future release, or they are :" +"term:`soft deprecated` and their use is actively discouraged in new " +"projects. With the removal of various obsolete modules through :pep:`594`, " +"there are currently no modules in this latter category." +msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 0b0bdb43e2..8730b76362 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -610,8 +610,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1544 -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1547 +#: ../../reference/compound_stmts.rst:1588 msgid "The following code::" msgstr "" @@ -624,8 +624,8 @@ msgstr "" " SUITE" #: ../../reference/compound_stmts.rst:531 -#: ../../reference/compound_stmts.rst:553 -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:556 +#: ../../reference/compound_stmts.rst:1593 msgid "is semantically equivalent to::" msgstr "" @@ -636,20 +636,23 @@ msgid "" "enter = type(manager).__enter__\n" "exit = type(manager).__exit__\n" "value = enter(manager)\n" +"hit_except = False\n" "\n" "try:\n" " TARGET = value\n" " SUITE\n" "except:\n" +" hit_except = True\n" " if not exit(manager, *sys.exc_info()):\n" " raise\n" -"else:\n" -" exit(manager, None, None, None)" +"finally:\n" +" if not hit_except:\n" +" exit(manager, None, None, None)" msgstr "" "manager = (EXPRESSION)\n" -"enter = type(manager).__enter__\n" -"exit = type(manager).__exit__\n" -"value = enter(manager)\n" +"aenter = type(manager).__aenter__\n" +"aexit = type(manager).__aexit__\n" +"value = await aenter(manager)\n" "hit_except = False\n" "\n" "try:\n" @@ -657,19 +660,19 @@ msgstr "" " SUITE\n" "except:\n" " hit_except = True\n" -" if not exit(manager, *sys.exc_info()):\n" +" if not await aexit(manager, *sys.exc_info()):\n" " raise\n" "finally:\n" " if not hit_except:\n" -" exit(manager, None, None, None)" +" await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:547 +#: ../../reference/compound_stmts.rst:550 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:550 +#: ../../reference/compound_stmts.rst:553 msgid "" "with A() as a, B() as b:\n" " SUITE" @@ -677,7 +680,7 @@ msgstr "" "with A() as a, B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:555 +#: ../../reference/compound_stmts.rst:558 msgid "" "with A() as a:\n" " with B() as b:\n" @@ -687,13 +690,13 @@ msgstr "" " with B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:559 +#: ../../reference/compound_stmts.rst:562 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:562 +#: ../../reference/compound_stmts.rst:565 msgid "" "with (\n" " A() as a,\n" @@ -707,88 +710,88 @@ msgstr "" "):\n" " SUITE" -#: ../../reference/compound_stmts.rst:568 +#: ../../reference/compound_stmts.rst:571 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:574 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:576 +#: ../../reference/compound_stmts.rst:579 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:577 +#: ../../reference/compound_stmts.rst:580 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:583 +#: ../../reference/compound_stmts.rst:586 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:600 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:606 +#: ../../reference/compound_stmts.rst:609 msgid "" "This section uses single quotes to denote :ref:`soft keywords <soft-" "keywords>`." msgstr "" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:612 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:616 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:615 +#: ../../reference/compound_stmts.rst:618 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:621 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords <soft-keywords>`." msgstr "" -#: ../../reference/compound_stmts.rst:622 -#: ../../reference/compound_stmts.rst:1179 +#: ../../reference/compound_stmts.rst:625 +#: ../../reference/compound_stmts.rst:1182 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:623 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:626 +#: ../../reference/compound_stmts.rst:1183 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:627 +#: ../../reference/compound_stmts.rst:630 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:629 +#: ../../reference/compound_stmts.rst:632 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:632 +#: ../../reference/compound_stmts.rst:635 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 <typesseq-tuple>`." msgstr "" -#: ../../reference/compound_stmts.rst:636 +#: ../../reference/compound_stmts.rst:639 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 " @@ -798,7 +801,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:645 +#: ../../reference/compound_stmts.rst:648 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 " @@ -807,38 +810,38 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:652 +#: ../../reference/compound_stmts.rst:655 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:658 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:661 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:660 +#: ../../reference/compound_stmts.rst:663 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:664 +#: ../../reference/compound_stmts.rst:667 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:671 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:670 +#: ../../reference/compound_stmts.rst:673 msgid "" ">>> flag = False\n" ">>> match (100, 200):\n" @@ -854,56 +857,56 @@ msgid "" "Case 3, y: 200" msgstr "" -#: ../../reference/compound_stmts.rst:684 +#: ../../reference/compound_stmts.rst:687 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:690 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:694 +#: ../../reference/compound_stmts.rst:697 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:702 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:701 +#: ../../reference/compound_stmts.rst:704 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:708 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:707 +#: ../../reference/compound_stmts.rst:710 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:710 +#: ../../reference/compound_stmts.rst:713 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:716 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:716 +#: ../../reference/compound_stmts.rst:719 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 " @@ -912,17 +915,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:726 +#: ../../reference/compound_stmts.rst:729 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:730 +#: ../../reference/compound_stmts.rst:733 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:736 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 " @@ -930,47 +933,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:738 +#: ../../reference/compound_stmts.rst:741 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:740 +#: ../../reference/compound_stmts.rst:743 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:742 +#: ../../reference/compound_stmts.rst:745 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:744 +#: ../../reference/compound_stmts.rst:747 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:746 +#: ../../reference/compound_stmts.rst:749 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:753 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:757 +#: ../../reference/compound_stmts.rst:760 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:759 +#: ../../reference/compound_stmts.rst:762 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:761 +#: ../../reference/compound_stmts.rst:764 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:767 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:778 +#: ../../reference/compound_stmts.rst:781 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -980,70 +983,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:788 +#: ../../reference/compound_stmts.rst:791 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:790 +#: ../../reference/compound_stmts.rst:793 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:796 +#: ../../reference/compound_stmts.rst:799 msgid "" "Only the final subpattern may be :ref:`irrefutable <irrefutable_case>`, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:799 +#: ../../reference/compound_stmts.rst:802 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:806 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:812 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:811 +#: ../../reference/compound_stmts.rst:814 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:820 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:824 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = <subject>``." msgstr "" -#: ../../reference/compound_stmts.rst:828 +#: ../../reference/compound_stmts.rst:831 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:830 +#: ../../reference/compound_stmts.rst:833 msgid "" "A literal pattern corresponds to most :ref:`literals <literals>` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:843 +#: ../../reference/compound_stmts.rst:846 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -1051,42 +1054,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:848 +#: ../../reference/compound_stmts.rst:851 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers <imaginary>`; 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:855 msgid "" "In simple terms, ``LITERAL`` will succeed only if ``<subject> == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:858 +#: ../../reference/compound_stmts.rst:861 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:860 +#: ../../reference/compound_stmts.rst:863 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:866 +#: ../../reference/compound_stmts.rst:869 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:873 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:876 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -1094,55 +1097,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:878 +#: ../../reference/compound_stmts.rst:881 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "<subject>``." msgstr "" -#: ../../reference/compound_stmts.rst:883 +#: ../../reference/compound_stmts.rst:886 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:885 +#: ../../reference/compound_stmts.rst:888 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:891 +#: ../../reference/compound_stmts.rst:894 msgid "" "``_`` is a :ref:`soft keyword <soft-keywords>` 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:898 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:900 +#: ../../reference/compound_stmts.rst:903 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:902 +#: ../../reference/compound_stmts.rst:905 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:910 +#: ../../reference/compound_stmts.rst:913 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules <resolve_names>`. 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:918 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if ``<subject> == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:919 +#: ../../reference/compound_stmts.rst:922 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 " @@ -1150,44 +1153,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:927 +#: ../../reference/compound_stmts.rst:930 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:929 +#: ../../reference/compound_stmts.rst:932 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:939 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:941 +#: ../../reference/compound_stmts.rst:944 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:943 +#: ../../reference/compound_stmts.rst:946 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:957 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:961 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern <group-patterns>`. 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:966 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 " @@ -1195,40 +1198,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:968 +#: ../../reference/compound_stmts.rst:971 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:974 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:974 +#: ../../reference/compound_stmts.rst:977 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:980 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:983 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:982 +#: ../../reference/compound_stmts.rst:985 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:988 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 " @@ -1236,118 +1239,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:990 +#: ../../reference/compound_stmts.rst:993 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:992 +#: ../../reference/compound_stmts.rst:995 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:998 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:1001 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:1005 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:1008 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 <value-patterns>`." msgstr "" -#: ../../reference/compound_stmts.rst:1011 +#: ../../reference/compound_stmts.rst:1014 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P<N>]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1017 msgid "check ``<subject>`` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1015 +#: ../../reference/compound_stmts.rst:1018 msgid "``len(subject) == <N>``" msgstr "``len(subject) == <N>``" -#: ../../reference/compound_stmts.rst:1016 +#: ../../reference/compound_stmts.rst:1019 msgid "" "``P1`` matches ``<subject>[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1020 msgid "" "``P2`` matches ``<subject>[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1021 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1023 +#: ../../reference/compound_stmts.rst:1026 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1025 +#: ../../reference/compound_stmts.rst:1028 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:1039 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:1042 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:1046 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:1049 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1048 +#: ../../reference/compound_stmts.rst:1051 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:1055 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:1059 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 " @@ -1355,256 +1358,256 @@ msgid "" "`~object.__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1061 +#: ../../reference/compound_stmts.rst:1064 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:1067 msgid "check ``<subject>`` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1065 +#: ../../reference/compound_stmts.rst:1068 msgid "``KEY1 in <subject>``" msgstr "``KEY1 in <subject>``" -#: ../../reference/compound_stmts.rst:1066 +#: ../../reference/compound_stmts.rst:1069 msgid "``P1`` matches ``<subject>[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1067 +#: ../../reference/compound_stmts.rst:1070 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1073 +#: ../../reference/compound_stmts.rst:1076 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1075 +#: ../../reference/compound_stmts.rst:1078 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:1089 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1088 +#: ../../reference/compound_stmts.rst:1091 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:1094 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:1097 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:1100 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:1104 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:1108 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:1111 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1110 +#: ../../reference/compound_stmts.rst:1113 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1116 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1115 +#: ../../reference/compound_stmts.rst:1118 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:1123 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1122 +#: ../../reference/compound_stmts.rst:1125 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:1129 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1128 +#: ../../reference/compound_stmts.rst:1131 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1130 +#: ../../reference/compound_stmts.rst:1133 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:1136 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:1139 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:1143 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1142 +#: ../../reference/compound_stmts.rst:1145 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1144 +#: ../../reference/compound_stmts.rst:1147 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1148 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1147 +#: ../../reference/compound_stmts.rst:1150 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1150 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1151 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1152 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1153 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1157 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1157 -#: ../../reference/compound_stmts.rst:1875 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1878 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1161 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1162 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1878 +#: ../../reference/compound_stmts.rst:1163 +#: ../../reference/compound_stmts.rst:1881 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1165 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:1169 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1168 +#: ../../reference/compound_stmts.rst:1171 msgid "``isinstance(<subject>, CLS)``" msgstr "``isinstance(<subject>, CLS)``" -#: ../../reference/compound_stmts.rst:1169 +#: ../../reference/compound_stmts.rst:1172 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1170 +#: ../../reference/compound_stmts.rst:1173 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1175 msgid "``hasattr(<subject>, \"attr\")``" msgstr "``hasattr(<subject>, \"attr\")``" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1176 msgid "``P2`` matches ``<subject>.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1178 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1190 +#: ../../reference/compound_stmts.rst:1193 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1205 +#: ../../reference/compound_stmts.rst:1208 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1225 +#: ../../reference/compound_stmts.rst:1228 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 " @@ -1613,13 +1616,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1231 +#: ../../reference/compound_stmts.rst:1234 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:1240 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1630,7 +1633,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1244 +#: ../../reference/compound_stmts.rst:1247 msgid "" "@f1(arg)\n" "@f2\n" @@ -1640,12 +1643,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1248 -#: ../../reference/compound_stmts.rst:1443 +#: ../../reference/compound_stmts.rst:1251 +#: ../../reference/compound_stmts.rst:1446 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1250 +#: ../../reference/compound_stmts.rst:1253 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1653,20 +1656,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1256 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1255 +#: ../../reference/compound_stmts.rst:1258 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:1260 +#: ../../reference/compound_stmts.rst:1263 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1676,12 +1679,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1267 -#: ../../reference/compound_stmts.rst:1462 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1465 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1275 +#: ../../reference/compound_stmts.rst:1278 msgid "" "When one or more :term:`parameters <parameter>` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1692,7 +1695,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1283 +#: ../../reference/compound_stmts.rst:1286 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1705,7 +1708,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1293 +#: ../../reference/compound_stmts.rst:1296 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1714,7 +1717,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1304 +#: ../../reference/compound_stmts.rst:1307 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1730,13 +1733,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1316 +#: ../../reference/compound_stmts.rst:1319 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1325 +#: ../../reference/compound_stmts.rst:1328 msgid "" "Parameters may have an :term:`annotation <function annotation>` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1755,13 +1758,13 @@ msgid "" "in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1339 +#: ../../reference/compound_stmts.rst:1342 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1345 +#: ../../reference/compound_stmts.rst:1348 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1773,7 +1776,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1353 +#: ../../reference/compound_stmts.rst:1356 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1782,61 +1785,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1362 +#: ../../reference/compound_stmts.rst:1365 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1368 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1370 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1371 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1371 +#: ../../reference/compound_stmts.rst:1374 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1372 +#: ../../reference/compound_stmts.rst:1375 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:1375 +#: ../../reference/compound_stmts.rst:1378 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1379 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1382 +#: ../../reference/compound_stmts.rst:1385 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1397 +#: ../../reference/compound_stmts.rst:1400 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1404 +#: ../../reference/compound_stmts.rst:1407 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1845,7 +1848,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1410 +#: ../../reference/compound_stmts.rst:1413 msgid "" "class Foo:\n" " pass" @@ -1853,11 +1856,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1413 +#: ../../reference/compound_stmts.rst:1416 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1415 +#: ../../reference/compound_stmts.rst:1418 msgid "" "class Foo(object):\n" " pass" @@ -1865,7 +1868,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1421 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 " @@ -1877,7 +1880,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1430 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's :attr:`~type.__dict__`. Note that this is reliable only " @@ -1885,17 +1888,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1432 +#: ../../reference/compound_stmts.rst:1435 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "<metaclasses>`." msgstr "" -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1440 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1439 +#: ../../reference/compound_stmts.rst:1442 msgid "" "@f1(arg)\n" "@f2\n" @@ -1905,7 +1908,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1445 +#: ../../reference/compound_stmts.rst:1448 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1913,20 +1916,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1451 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:1451 +#: ../../reference/compound_stmts.rst:1454 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:1456 +#: ../../reference/compound_stmts.rst:1459 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1935,7 +1938,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1465 +#: ../../reference/compound_stmts.rst:1468 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1948,35 +1951,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1477 +#: ../../reference/compound_stmts.rst:1480 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1478 +#: ../../reference/compound_stmts.rst:1481 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:1482 +#: ../../reference/compound_stmts.rst:1485 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1483 +#: ../../reference/compound_stmts.rst:1486 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1490 +#: ../../reference/compound_stmts.rst:1493 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1501 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1508 +#: ../../reference/compound_stmts.rst:1511 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1984,23 +1987,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1512 +#: ../../reference/compound_stmts.rst:1515 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:1515 +#: ../../reference/compound_stmts.rst:1518 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1521 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1520 +#: ../../reference/compound_stmts.rst:1523 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2010,30 +2013,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1524 +#: ../../reference/compound_stmts.rst:1527 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:1532 +#: ../../reference/compound_stmts.rst:1535 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1537 +#: ../../reference/compound_stmts.rst:1540 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:1541 +#: ../../reference/compound_stmts.rst:1544 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1546 +#: ../../reference/compound_stmts.rst:1549 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2045,11 +2048,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1551 +#: ../../reference/compound_stmts.rst:1554 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1553 +#: ../../reference/compound_stmts.rst:1556 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2079,28 +2082,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1567 +#: ../../reference/compound_stmts.rst:1570 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1569 +#: ../../reference/compound_stmts.rst:1572 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1577 +#: ../../reference/compound_stmts.rst:1580 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1582 +#: ../../reference/compound_stmts.rst:1585 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:1587 +#: ../../reference/compound_stmts.rst:1590 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2108,7 +2111,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1592 +#: ../../reference/compound_stmts.rst:1595 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2144,44 +2147,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1609 +#: ../../reference/compound_stmts.rst:1612 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1614 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1616 +#: ../../reference/compound_stmts.rst:1619 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1620 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1626 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1630 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1640 +#: ../../reference/compound_stmts.rst:1643 msgid "" ":ref:`Functions <def>` (including :ref:`coroutines <async def>`), :ref:" "`classes <class>` and :ref:`type aliases <type>` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1644 +#: ../../reference/compound_stmts.rst:1647 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2213,7 +2216,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1659 +#: ../../reference/compound_stmts.rst:1662 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2221,7 +2224,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1664 +#: ../../reference/compound_stmts.rst:1667 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2233,36 +2236,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1676 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1679 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1678 +#: ../../reference/compound_stmts.rst:1681 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1680 +#: ../../reference/compound_stmts.rst:1683 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1683 +#: ../../reference/compound_stmts.rst:1686 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1686 +#: ../../reference/compound_stmts.rst:1689 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2274,7 +2277,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1695 +#: ../../reference/compound_stmts.rst:1698 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2284,13 +2287,13 @@ msgid "" "<annotation-scopes>`." msgstr "" -#: ../../reference/compound_stmts.rst:1701 +#: ../../reference/compound_stmts.rst:1704 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1704 +#: ../../reference/compound_stmts.rst:1707 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2303,13 +2306,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1714 +#: ../../reference/compound_stmts.rst:1717 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1716 +#: ../../reference/compound_stmts.rst:1719 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2341,24 +2344,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1734 +#: ../../reference/compound_stmts.rst:1737 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1736 +#: ../../reference/compound_stmts.rst:1739 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1738 +#: ../../reference/compound_stmts.rst:1741 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1740 -#: ../../reference/compound_stmts.rst:1800 +#: ../../reference/compound_stmts.rst:1743 +#: ../../reference/compound_stmts.rst:1803 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1742 +#: ../../reference/compound_stmts.rst:1745 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2374,7 +2377,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1749 +#: ../../reference/compound_stmts.rst:1752 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope <annotation-" "scopes>`, which is not actually bound to any name at runtime. (One other " @@ -2383,20 +2386,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1755 +#: ../../reference/compound_stmts.rst:1758 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1759 +#: ../../reference/compound_stmts.rst:1762 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1762 +#: ../../reference/compound_stmts.rst:1765 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2406,13 +2409,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1766 +#: ../../reference/compound_stmts.rst:1769 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1772 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2434,25 +2437,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1788 +#: ../../reference/compound_stmts.rst:1791 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1794 +#: ../../reference/compound_stmts.rst:1797 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1796 +#: ../../reference/compound_stmts.rst:1799 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1798 +#: ../../reference/compound_stmts.rst:1801 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1802 +#: ../../reference/compound_stmts.rst:1805 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2470,14 +2473,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1810 +#: ../../reference/compound_stmts.rst:1813 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope <annotation-scopes>`, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1814 +#: ../../reference/compound_stmts.rst:1817 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2485,7 +2488,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1820 +#: ../../reference/compound_stmts.rst:1823 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2493,11 +2496,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1823 +#: ../../reference/compound_stmts.rst:1826 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1825 +#: ../../reference/compound_stmts.rst:1828 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2515,27 +2518,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1836 +#: ../../reference/compound_stmts.rst:1839 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1838 +#: ../../reference/compound_stmts.rst:1841 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1840 +#: ../../reference/compound_stmts.rst:1843 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1845 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1848 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2548,105 +2551,105 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1854 +#: ../../reference/compound_stmts.rst:1857 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope <annotation-scopes>`. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1859 +#: ../../reference/compound_stmts.rst:1862 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1860 +#: ../../reference/compound_stmts.rst:1863 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:1864 +#: ../../reference/compound_stmts.rst:1867 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1866 +#: ../../reference/compound_stmts.rst:1869 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1867 +#: ../../reference/compound_stmts.rst:1870 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1871 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1869 -#: ../../reference/compound_stmts.rst:1888 +#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1891 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1874 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1873 +#: ../../reference/compound_stmts.rst:1876 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1877 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1876 +#: ../../reference/compound_stmts.rst:1879 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1880 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1883 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1886 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1885 +#: ../../reference/compound_stmts.rst:1888 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1886 +#: ../../reference/compound_stmts.rst:1889 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1887 +#: ../../reference/compound_stmts.rst:1890 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1893 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1893 +#: ../../reference/compound_stmts.rst:1896 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1897 +#: ../../reference/compound_stmts.rst:1900 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's :attr:`~type.__doc__` item and therefore " @@ -2666,12 +2669,12 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:437 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:585 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 -#: ../../reference/compound_stmts.rst:1494 -#: ../../reference/compound_stmts.rst:1528 -#: ../../reference/compound_stmts.rst:1573 +#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1576 msgid "statement" msgstr "statement(陳述式)" @@ -2707,7 +2710,7 @@ msgstr "" msgid "else" msgstr "else" -#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:588 msgid "if" msgstr "if" @@ -2718,8 +2721,8 @@ msgstr "if" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:585 -#: ../../reference/compound_stmts.rst:1504 +#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:1507 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2731,10 +2734,10 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:585 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1320 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1387 msgid ": (colon)" msgstr ": (冒號)" @@ -2742,9 +2745,9 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:585 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2789,8 +2792,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "object" msgstr "object(物件)" @@ -2822,7 +2825,7 @@ msgstr "finally" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:265 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:588 msgid "as" msgstr "as" @@ -2860,199 +2863,232 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:588 msgid "match" msgstr "match" -#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:588 msgid "case" msgstr "case" -#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:588 msgid "pattern matching" msgstr "pattern matching(模式匹配)" -#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:588 msgid "match statement" msgstr "match statement(匹配陳述式)" -#: ../../reference/compound_stmts.rst:689 +#: ../../reference/compound_stmts.rst:692 msgid "guard" msgstr "guard" -#: ../../reference/compound_stmts.rst:728 +#: ../../reference/compound_stmts.rst:731 msgid "irrefutable case block" msgstr "" -#: ../../reference/compound_stmts.rst:728 +#: ../../reference/compound_stmts.rst:731 msgid "case block" msgstr "" -#: ../../reference/compound_stmts.rst:752 +#: ../../reference/compound_stmts.rst:755 msgid "! patterns" msgstr "" -#: ../../reference/compound_stmts.rst:752 +#: ../../reference/compound_stmts.rst:755 msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1186 +#: ../../reference/compound_stmts.rst:1273 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1234 -#: ../../reference/compound_stmts.rst:1270 -#: ../../reference/compound_stmts.rst:1299 +#: ../../reference/compound_stmts.rst:1186 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1302 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1195 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1323 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1195 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1387 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1195 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1234 -#: ../../reference/compound_stmts.rst:1434 +#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1437 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1273 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1273 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1273 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1273 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1299 +#: ../../reference/compound_stmts.rst:1302 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1299 +#: ../../reference/compound_stmts.rst:1302 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1299 +#: ../../reference/compound_stmts.rst:1302 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1323 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1323 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1323 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1343 +#: ../../reference/compound_stmts.rst:1346 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1343 +#: ../../reference/compound_stmts.rst:1346 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1384 -#: ../../reference/compound_stmts.rst:1434 +#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1437 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1387 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1497 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1504 +#: ../../reference/compound_stmts.rst:1507 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1504 +#: ../../reference/compound_stmts.rst:1507 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1528 +#: ../../reference/compound_stmts.rst:1531 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1573 +#: ../../reference/compound_stmts.rst:1576 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1633 msgid "type parameters" msgstr "type parameter(型別參數)" + +#, fuzzy +#~ msgid "" +#~ "manager = (EXPRESSION)\n" +#~ "enter = type(manager).__enter__\n" +#~ "exit = type(manager).__exit__\n" +#~ "value = enter(manager)\n" +#~ "\n" +#~ "try:\n" +#~ " TARGET = value\n" +#~ " SUITE\n" +#~ "except:\n" +#~ " if not exit(manager, *sys.exc_info()):\n" +#~ " raise\n" +#~ "else:\n" +#~ " exit(manager, None, None, None)" +#~ msgstr "" +#~ "manager = (EXPRESSION)\n" +#~ "enter = type(manager).__enter__\n" +#~ "exit = type(manager).__exit__\n" +#~ "value = enter(manager)\n" +#~ "hit_except = False\n" +#~ "\n" +#~ "try:\n" +#~ " TARGET = value\n" +#~ " SUITE\n" +#~ "except:\n" +#~ " hit_except = True\n" +#~ " if not exit(manager, *sys.exc_info()):\n" +#~ " raise\n" +#~ "finally:\n" +#~ " if not hit_except:\n" +#~ " exit(manager, None, None, None)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 4f21d99532..a149ab838e 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2024-12-29 16:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -339,7 +339,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1970 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1985 msgid "New Features" msgstr "" @@ -1126,7 +1126,7 @@ msgid "compileall" msgstr "" #: ../../whatsnew/3.13.rst:757 ../../whatsnew/3.13.rst:765 -#: ../../whatsnew/3.13.rst:1017 +#: ../../whatsnew/3.13.rst:1024 msgid "" "The default number of worker threads and processes is now selected using :" "func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " @@ -1137,7 +1137,7 @@ msgstr "" msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1614 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1621 msgid "configparser" msgstr "" @@ -1318,33 +1318,43 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:893 -msgid "fractions" +msgid "enum" msgstr "" #: ../../whatsnew/3.13.rst:895 msgid "" +":class:`~enum.EnumDict` has been made public to better support subclassing :" +"class:`~enum.EnumType`." +msgstr "" + +#: ../../whatsnew/3.13.rst:900 +msgid "fractions" +msgstr "" + +#: ../../whatsnew/3.13.rst:902 +msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language <formatspec>` rules for fill, alignment, sign " "handling, minimum width, and grouping. (Contributed by Mark Dickinson in :gh:" "`111320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:902 +#: ../../whatsnew/3.13.rst:909 msgid "glob" msgstr "" -#: ../../whatsnew/3.13.rst:904 +#: ../../whatsnew/3.13.rst:911 msgid "" "Add :func:`~glob.translate`, a function to convert a path specification with " "shell-style wildcards to a regular expression. (Contributed by Barney Gale " "in :gh:`72904`.)" msgstr "" -#: ../../whatsnew/3.13.rst:910 +#: ../../whatsnew/3.13.rst:917 msgid "importlib" msgstr "" -#: ../../whatsnew/3.13.rst:912 +#: ../../whatsnew/3.13.rst:919 msgid "" "The following functions in :mod:`importlib.resources` now allow accessing a " "directory (or tree) of resources, using multiple positional arguments (the " @@ -1352,37 +1362,37 @@ msgid "" "keyword-only):" msgstr "" -#: ../../whatsnew/3.13.rst:917 +#: ../../whatsnew/3.13.rst:924 msgid ":func:`~importlib.resources.is_resource`" msgstr "" -#: ../../whatsnew/3.13.rst:918 +#: ../../whatsnew/3.13.rst:925 msgid ":func:`~importlib.resources.open_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:919 +#: ../../whatsnew/3.13.rst:926 msgid ":func:`~importlib.resources.open_text`" msgstr "" -#: ../../whatsnew/3.13.rst:920 +#: ../../whatsnew/3.13.rst:927 msgid ":func:`~importlib.resources.path`" msgstr "" -#: ../../whatsnew/3.13.rst:921 +#: ../../whatsnew/3.13.rst:928 msgid ":func:`~importlib.resources.read_binary`" msgstr "" -#: ../../whatsnew/3.13.rst:922 +#: ../../whatsnew/3.13.rst:929 msgid ":func:`~importlib.resources.read_text`" msgstr "" -#: ../../whatsnew/3.13.rst:924 +#: ../../whatsnew/3.13.rst:931 msgid "" "These functions are no longer deprecated and are not scheduled for removal. " "(Contributed by Petr Viktorin in :gh:`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:927 +#: ../../whatsnew/3.13.rst:934 msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " @@ -1390,11 +1400,11 @@ msgid "" "`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:934 +#: ../../whatsnew/3.13.rst:941 msgid "io" msgstr "" -#: ../../whatsnew/3.13.rst:936 +#: ../../whatsnew/3.13.rst:943 msgid "" "The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" "`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " @@ -1403,17 +1413,17 @@ msgid "" "build>`. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:945 +#: ../../whatsnew/3.13.rst:952 msgid "ipaddress" msgstr "" -#: ../../whatsnew/3.13.rst:947 +#: ../../whatsnew/3.13.rst:954 msgid "" "Add the :attr:`.IPv4Address.ipv6_mapped` property, which returns the IPv4-" "mapped IPv6 address. (Contributed by Charles Machalow in :gh:`109466`.)" msgstr "" -#: ../../whatsnew/3.13.rst:951 +#: ../../whatsnew/3.13.rst:958 msgid "" "Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." "IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." @@ -1421,22 +1431,22 @@ msgid "" "Stasiak in :gh:`113171`.)" msgstr "" -#: ../../whatsnew/3.13.rst:958 +#: ../../whatsnew/3.13.rst:965 msgid "itertools" msgstr "" -#: ../../whatsnew/3.13.rst:960 +#: ../../whatsnew/3.13.rst:967 msgid "" ":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" "`ValueError` if the final batch is shorter than the specified batch size. " "(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" -#: ../../whatsnew/3.13.rst:967 +#: ../../whatsnew/3.13.rst:974 msgid "marshal" msgstr "" -#: ../../whatsnew/3.13.rst:969 +#: ../../whatsnew/3.13.rst:976 msgid "" "Add the *allow_code* parameter in module functions. Passing " "``allow_code=False`` prevents serialization and de-serialization of code " @@ -1444,11 +1454,11 @@ msgid "" "Serhiy Storchaka in :gh:`113626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:976 +#: ../../whatsnew/3.13.rst:983 msgid "math" msgstr "" -#: ../../whatsnew/3.13.rst:978 +#: ../../whatsnew/3.13.rst:985 msgid "" "The new function :func:`~math.fma` performs fused multiply-add operations. " "This computes ``x * y + z`` with only a single round, and so avoids any " @@ -1458,11 +1468,11 @@ msgid "" "Stinner in :gh:`73468`.)" msgstr "" -#: ../../whatsnew/3.13.rst:988 +#: ../../whatsnew/3.13.rst:995 msgid "mimetypes" msgstr "" -#: ../../whatsnew/3.13.rst:990 +#: ../../whatsnew/3.13.rst:997 msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " @@ -1470,18 +1480,18 @@ msgid "" "`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:997 +#: ../../whatsnew/3.13.rst:1004 msgid "mmap" msgstr "" -#: ../../whatsnew/3.13.rst:999 +#: ../../whatsnew/3.13.rst:1006 msgid "" ":class:`~mmap.mmap` is now protected from crashing on Windows when the " "mapped memory is inaccessible due to file system errors or access " "violations. (Contributed by Jannis Weigend in :gh:`118209`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1003 +#: ../../whatsnew/3.13.rst:1010 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " "used when a seekable file-like object is required. The :meth:`~mmap.mmap." @@ -1489,7 +1499,7 @@ msgid "" "Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1008 +#: ../../whatsnew/3.13.rst:1015 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " @@ -1497,22 +1507,22 @@ msgid "" "gh:`78502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1015 +#: ../../whatsnew/3.13.rst:1022 msgid "multiprocessing" msgstr "" -#: ../../whatsnew/3.13.rst:1023 +#: ../../whatsnew/3.13.rst:1030 msgid "os" msgstr "" -#: ../../whatsnew/3.13.rst:1025 +#: ../../whatsnew/3.13.rst:1032 msgid "" "Add :func:`~os.process_cpu_count` function to get the number of logical CPU " "cores usable by the calling thread of the current process. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1029 +#: ../../whatsnew/3.13.rst:1036 msgid "" ":func:`~os.cpu_count` and :func:`~os.process_cpu_count` can be overridden " "through the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new " @@ -1522,7 +1532,7 @@ msgid "" "Na in :gh:`109595`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1037 +#: ../../whatsnew/3.13.rst:1044 msgid "" "Add a :ref:`low level interface <os-timerfd>` to Linux's :manpage:`timer " "file descriptors <timerfd_create(2)>` via :func:`~os.timerfd_create`, :func:" @@ -1533,7 +1543,7 @@ msgid "" "in :gh:`108277`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1046 +#: ../../whatsnew/3.13.rst:1053 msgid "" ":func:`~os.lchmod` and the *follow_symlinks* argument of :func:`~os.chmod` " "are both now available on Windows. Note that the default value of " @@ -1541,14 +1551,14 @@ msgid "" "by Serhiy Storchaka in :gh:`59616`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1052 +#: ../../whatsnew/3.13.rst:1059 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " "both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" "`113191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1056 +#: ../../whatsnew/3.13.rst:1063 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " @@ -1557,14 +1567,14 @@ msgid "" "Steve Dower in :gh:`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1063 +#: ../../whatsnew/3.13.rst:1070 msgid "" ":func:`~os.posix_spawn` now accepts ``None`` for the *env* argument, which " "makes the newly spawned process use the current process environment. " "(Contributed by Jakub Kulik in :gh:`113119`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1067 +#: ../../whatsnew/3.13.rst:1074 msgid "" ":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" @@ -1572,76 +1582,76 @@ msgid "" "gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1074 +#: ../../whatsnew/3.13.rst:1081 msgid "os.path" msgstr "" -#: ../../whatsnew/3.13.rst:1076 +#: ../../whatsnew/3.13.rst:1083 msgid "" "Add :func:`~os.path.isreserved` to check if a path is reserved on the " "current system. This function is only available on Windows. (Contributed by " "Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1081 +#: ../../whatsnew/3.13.rst:1088 msgid "" "On Windows, :func:`~os.path.isabs` no longer considers paths starting with " "exactly one slash (``\\`` or ``/``) to be absolute. (Contributed by Barney " "Gale and Jon Foster in :gh:`44626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1085 +#: ../../whatsnew/3.13.rst:1092 msgid "" ":func:`~os.path.realpath` now resolves MS-DOS style file names even if the " "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1654 +#: ../../whatsnew/3.13.rst:1098 ../../whatsnew/3.13.rst:1677 msgid "pathlib" msgstr "" -#: ../../whatsnew/3.13.rst:1093 +#: ../../whatsnew/3.13.rst:1100 msgid "" "Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" "`NotImplementedError` when a path operation isn't supported. (Contributed by " "Barney Gale in :gh:`89812`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1097 +#: ../../whatsnew/3.13.rst:1104 msgid "" "Add a new constructor for creating :class:`~pathlib.Path` objects from " "'file' URIs (``file:///``), :meth:`.Path.from_uri`. (Contributed by Barney " "Gale in :gh:`107465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1101 +#: ../../whatsnew/3.13.rst:1108 msgid "" "Add :meth:`.PurePath.full_match` for matching paths with shell-style " "wildcards, including the recursive wildcard \"``**``\". (Contributed by " "Barney Gale in :gh:`73435`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1105 +#: ../../whatsnew/3.13.rst:1112 msgid "" "Add the :attr:`.PurePath.parser` class attribute to store the implementation " "of :mod:`os.path` used for low-level path parsing and joining. This will be " "either :mod:`!posixpath` or :mod:`!ntpath`." msgstr "" -#: ../../whatsnew/3.13.rst:1110 +#: ../../whatsnew/3.13.rst:1117 msgid "" "Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" "`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1114 +#: ../../whatsnew/3.13.rst:1121 msgid "" ":meth:`.Path.glob` and :meth:`~pathlib.Path.rglob` now return files and " "directories when given a pattern that ends with \"``**``\". Previously, only " "directories were returned. (Contributed by Barney Gale in :gh:`70303`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1119 +#: ../../whatsnew/3.13.rst:1126 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " "<pathlib.Path.is_file>`, :meth:`Path.is_dir <pathlib.Path.is_dir>`, :meth:`." @@ -1649,11 +1659,11 @@ msgid "" "`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1127 +#: ../../whatsnew/3.13.rst:1134 msgid "pdb" msgstr "" -#: ../../whatsnew/3.13.rst:1129 +#: ../../whatsnew/3.13.rst:1136 msgid "" ":func:`breakpoint` and :func:`~pdb.set_trace` now enter the debugger " "immediately rather than on the next line of code to be executed. This change " @@ -1662,20 +1672,20 @@ msgid "" "Gao in :gh:`118579`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1135 +#: ../../whatsnew/3.13.rst:1142 msgid "" "``sys.path[0]`` is no longer replaced by the directory of the script being " "debugged when :attr:`sys.flags.safe_path` is set. (Contributed by Tian Gao " "and Christian Walther in :gh:`111762`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1139 +#: ../../whatsnew/3.13.rst:1146 msgid "" ":mod:`zipapp` is now supported as a debugging target. (Contributed by Tian " "Gao in :gh:`118501`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1142 +#: ../../whatsnew/3.13.rst:1149 msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " @@ -1683,101 +1693,101 @@ msgid "" "`106676`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1147 +#: ../../whatsnew/3.13.rst:1154 msgid "" "Expressions and statements whose prefix is a pdb command are now correctly " "identified and executed. (Contributed by Tian Gao in :gh:`108464`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1153 +#: ../../whatsnew/3.13.rst:1160 msgid "queue" msgstr "" -#: ../../whatsnew/3.13.rst:1155 +#: ../../whatsnew/3.13.rst:1162 msgid "" "Add :meth:`Queue.shutdown <queue.Queue.shutdown>` and :exc:`~queue.ShutDown` " "to manage queue termination. (Contributed by Laurie Opperman and Yves Duprat " "in :gh:`104750`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1161 +#: ../../whatsnew/3.13.rst:1168 msgid "random" msgstr "" -#: ../../whatsnew/3.13.rst:1163 +#: ../../whatsnew/3.13.rst:1170 msgid "" "Add a :ref:`command-line interface <random-cli>`. (Contributed by Hugo van " "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1662 +#: ../../whatsnew/3.13.rst:1175 ../../whatsnew/3.13.rst:1685 msgid "re" msgstr "" -#: ../../whatsnew/3.13.rst:1170 +#: ../../whatsnew/3.13.rst:1177 msgid "" "Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" "exc:`!re.error` is kept for backward compatibility." msgstr "" -#: ../../whatsnew/3.13.rst:1175 +#: ../../whatsnew/3.13.rst:1182 msgid "shutil" msgstr "" -#: ../../whatsnew/3.13.rst:1177 +#: ../../whatsnew/3.13.rst:1184 msgid "" "Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" "`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" -#: ../../whatsnew/3.13.rst:1183 +#: ../../whatsnew/3.13.rst:1190 msgid "site" msgstr "" -#: ../../whatsnew/3.13.rst:1185 +#: ../../whatsnew/3.13.rst:1192 msgid "" ":file:`.pth` files are now decoded using UTF-8 first, and then with the :" "term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " "in :gh:`117802`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1191 +#: ../../whatsnew/3.13.rst:1198 msgid "sqlite3" msgstr "" -#: ../../whatsnew/3.13.rst:1193 +#: ../../whatsnew/3.13.rst:1200 msgid "" "A :exc:`ResourceWarning` is now emitted if a :class:`~sqlite3.Connection` " "object is not :meth:`closed <sqlite3.Connection.close>` explicitly. " "(Contributed by Erlend E. Aasland in :gh:`105539`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1197 +#: ../../whatsnew/3.13.rst:1204 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " "filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" "`91602`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1203 +#: ../../whatsnew/3.13.rst:1210 msgid "ssl" msgstr "" -#: ../../whatsnew/3.13.rst:1205 +#: ../../whatsnew/3.13.rst:1212 msgid "" "The :func:`~ssl.create_default_context` API now includes :data:`~ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " "default flags." msgstr "" -#: ../../whatsnew/3.13.rst:1211 +#: ../../whatsnew/3.13.rst:1218 msgid "" ":data:`~ssl.VERIFY_X509_STRICT` may reject pre-:rfc:`5280` or malformed " "certificates that the underlying OpenSSL implementation might otherwise " "accept. Whilst disabling this is not recommended, you can do so using:" msgstr "" -#: ../../whatsnew/3.13.rst:1216 +#: ../../whatsnew/3.13.rst:1223 msgid "" "import ssl\n" "\n" @@ -1785,15 +1795,15 @@ msgid "" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" msgstr "" -#: ../../whatsnew/3.13.rst:1223 +#: ../../whatsnew/3.13.rst:1230 msgid "(Contributed by William Woodruff in :gh:`112389`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1227 +#: ../../whatsnew/3.13.rst:1234 msgid "statistics" msgstr "" -#: ../../whatsnew/3.13.rst:1229 +#: ../../whatsnew/3.13.rst:1236 msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " @@ -1801,24 +1811,24 @@ msgid "" "`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1234 +#: ../../whatsnew/3.13.rst:1241 msgid "" "Add :func:`~statistics.kde_random` for sampling from an estimated " "probability density function created by :func:`~statistics.kde`. " "(Contributed by Raymond Hettinger in :gh:`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1242 +#: ../../whatsnew/3.13.rst:1249 msgid "subprocess" msgstr "" -#: ../../whatsnew/3.13.rst:1244 +#: ../../whatsnew/3.13.rst:1251 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations." msgstr "" -#: ../../whatsnew/3.13.rst:1247 +#: ../../whatsnew/3.13.rst:1254 msgid "" "Notably, when *close_fds* is ``True`` (the default), :func:`~os.posix_spawn` " "will be used when the C library provides :c:func:`!" @@ -1827,7 +1837,7 @@ msgid "" "existing Linux :c:func:`!vfork` based code." msgstr "" -#: ../../whatsnew/3.13.rst:1254 +#: ../../whatsnew/3.13.rst:1261 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " "``False`` if you need to force :mod:`subprocess` to never use :func:`~os." @@ -1837,22 +1847,22 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1264 ../../whatsnew/3.13.rst:2717 +#: ../../whatsnew/3.13.rst:1271 ../../whatsnew/3.13.rst:2732 msgid "sys" msgstr "" -#: ../../whatsnew/3.13.rst:1266 +#: ../../whatsnew/3.13.rst:1273 msgid "" "Add the :func:`~sys._is_interned` function to test if a string was interned. " "This function is not guaranteed to exist in all implementations of Python. " "(Contributed by Serhiy Storchaka in :gh:`78573`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1272 +#: ../../whatsnew/3.13.rst:1279 msgid "tempfile" msgstr "" -#: ../../whatsnew/3.13.rst:1274 +#: ../../whatsnew/3.13.rst:1281 msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " @@ -1860,11 +1870,11 @@ msgid "" "`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1281 +#: ../../whatsnew/3.13.rst:1288 msgid "time" msgstr "" -#: ../../whatsnew/3.13.rst:1283 +#: ../../whatsnew/3.13.rst:1290 msgid "" "On Windows, :func:`~time.monotonic` now uses the " "``QueryPerformanceCounter()`` clock for a resolution of 1 microsecond, " @@ -1872,7 +1882,7 @@ msgid "" "milliseconds. (Contributed by Victor Stinner in :gh:`88494`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1289 +#: ../../whatsnew/3.13.rst:1296 msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " @@ -1881,11 +1891,11 @@ msgid "" "`63207`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1297 +#: ../../whatsnew/3.13.rst:1304 msgid "tkinter" msgstr "" -#: ../../whatsnew/3.13.rst:1299 +#: ../../whatsnew/3.13.rst:1306 msgid "" "Add :mod:`tkinter` widget methods: :meth:`!tk_busy_hold`, :meth:`!" "tk_busy_configure`, :meth:`!tk_busy_cget`, :meth:`!tk_busy_forget`, :meth:`!" @@ -1893,7 +1903,7 @@ msgid "" "klappnase and Serhiy Storchaka in :gh:`72684`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1305 +#: ../../whatsnew/3.13.rst:1312 msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " @@ -1902,14 +1912,14 @@ msgid "" "wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1312 +#: ../../whatsnew/3.13.rst:1319 msgid "" ":meth:`!wm_attributes` can now return attributes as a :class:`dict`, by " "using the new optional keyword-only parameter *return_python_dict*. " "(Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1316 +#: ../../whatsnew/3.13.rst:1323 msgid "" ":meth:`!Text.count` can now return a simple :class:`int` when the new " "optional keyword-only parameter *return_ints* is used. Otherwise, the single " @@ -1917,27 +1927,27 @@ msgid "" "in :gh:`97928`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1321 +#: ../../whatsnew/3.13.rst:1328 msgid "" "Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." "element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " "Storchaka in :gh:`68166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1326 +#: ../../whatsnew/3.13.rst:1333 msgid "" "Add the :meth:`!after_info` method for Tkinter widgets. (Contributed by " "Cheryl Sabella in :gh:`77020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1329 +#: ../../whatsnew/3.13.rst:1336 msgid "" "Add a new :meth:`!copy_replace` method to :class:`!PhotoImage` to copy a " "region from one image to another, possibly with pixel zooming, subsampling, " "or both. (Contributed by Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1334 +#: ../../whatsnew/3.13.rst:1341 msgid "" "Add *from_coords* parameter to the :class:`!PhotoImage` methods :meth:`!" "copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* " @@ -1945,7 +1955,7 @@ msgid "" "Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1340 +#: ../../whatsnew/3.13.rst:1347 msgid "" "Add the :class:`!PhotoImage` methods :meth:`!read` to read an image from a " "file and :meth:`!data` to get the image data. Add *background* and " @@ -1953,11 +1963,11 @@ msgid "" "Storchaka in :gh:`118271`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1348 +#: ../../whatsnew/3.13.rst:1355 msgid "traceback" msgstr "" -#: ../../whatsnew/3.13.rst:1350 +#: ../../whatsnew/3.13.rst:1357 msgid "" "Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" "class:`~traceback.TracebackException`, which holds a string display of the " @@ -1967,7 +1977,7 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1359 +#: ../../whatsnew/3.13.rst:1366 msgid "" "Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." "format_exception_only` to (recursively) format the nested exceptions of a :" @@ -1975,11 +1985,11 @@ msgid "" "`105292`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1366 +#: ../../whatsnew/3.13.rst:1373 msgid "types" msgstr "" -#: ../../whatsnew/3.13.rst:1368 +#: ../../whatsnew/3.13.rst:1375 msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " @@ -1987,63 +1997,63 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1687 +#: ../../whatsnew/3.13.rst:1382 ../../whatsnew/3.13.rst:1710 msgid "typing" msgstr "" -#: ../../whatsnew/3.13.rst:1377 +#: ../../whatsnew/3.13.rst:1384 msgid "" ":pep:`705`: Add :data:`~typing.ReadOnly`, a special typing construct to mark " "a :class:`~typing.TypedDict` item as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:1380 +#: ../../whatsnew/3.13.rst:1387 msgid "" ":pep:`742`: Add :data:`~typing.TypeIs`, a typing construct that can be used " "to instruct a type checker how to narrow a type." msgstr "" -#: ../../whatsnew/3.13.rst:1383 +#: ../../whatsnew/3.13.rst:1390 msgid "" "Add :data:`~typing.NoDefault`, a sentinel object used to represent the " "defaults of some parameters in the :mod:`typing` module. (Contributed by " "Jelle Zijlstra in :gh:`116126`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1387 +#: ../../whatsnew/3.13.rst:1394 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " "defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" "`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1391 +#: ../../whatsnew/3.13.rst:1398 msgid "" "Add :func:`~typing.is_protocol` to check whether a class is a :class:" "`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1395 +#: ../../whatsnew/3.13.rst:1402 msgid "" ":data:`~typing.ClassVar` can now be nested in :data:`~typing.Final`, and " "vice versa. (Contributed by Mehdi Drissi in :gh:`89547`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1401 +#: ../../whatsnew/3.13.rst:1408 msgid "unicodedata" msgstr "" -#: ../../whatsnew/3.13.rst:1403 +#: ../../whatsnew/3.13.rst:1410 msgid "" "Update the Unicode database to `version 15.1.0`__. (Contributed by James " "Gerity in :gh:`109559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1410 +#: ../../whatsnew/3.13.rst:1417 msgid "venv" msgstr "" -#: ../../whatsnew/3.13.rst:1412 +#: ../../whatsnew/3.13.rst:1419 msgid "" "Add support for creating source control management (SCM) ignore files in a " "virtual environment's directory. By default, Git is supported. This is " @@ -2053,11 +2063,11 @@ msgid "" "Cannon in :gh:`108125`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1423 +#: ../../whatsnew/3.13.rst:1430 msgid "warnings" msgstr "" -#: ../../whatsnew/3.13.rst:1425 +#: ../../whatsnew/3.13.rst:1432 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator provides a way to " "communicate deprecations to a :term:`static type checker` and to warn on " @@ -2066,62 +2076,62 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`104003`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1434 +#: ../../whatsnew/3.13.rst:1441 msgid "xml" msgstr "" -#: ../../whatsnew/3.13.rst:1436 +#: ../../whatsnew/3.13.rst:1443 msgid "" "Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by " "adding five new methods:" msgstr "" -#: ../../whatsnew/3.13.rst:1439 +#: ../../whatsnew/3.13.rst:1446 msgid ":meth:`xml.etree.ElementTree.XMLParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1440 +#: ../../whatsnew/3.13.rst:1447 msgid ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1441 +#: ../../whatsnew/3.13.rst:1448 msgid ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1442 +#: ../../whatsnew/3.13.rst:1449 msgid ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" msgstr "" -#: ../../whatsnew/3.13.rst:1443 +#: ../../whatsnew/3.13.rst:1450 msgid ":meth:`!xml.sax.expatreader.ExpatParser.flush`" msgstr "" -#: ../../whatsnew/3.13.rst:1445 +#: ../../whatsnew/3.13.rst:1452 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1447 +#: ../../whatsnew/3.13.rst:1454 msgid "" "Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." "ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " "Storchaka in :gh:`69893`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1453 +#: ../../whatsnew/3.13.rst:1460 msgid "zipimport" msgstr "" -#: ../../whatsnew/3.13.rst:1455 +#: ../../whatsnew/3.13.rst:1462 msgid "" "Add support for ZIP64_ format files. Everybody loves huge data, right? " "(Contributed by Tim Hatch in :gh:`94146`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1463 +#: ../../whatsnew/3.13.rst:1470 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.13.rst:1465 +#: ../../whatsnew/3.13.rst:1472 msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " @@ -2132,13 +2142,13 @@ msgid "" "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1476 +#: ../../whatsnew/3.13.rst:1483 msgid "" ":func:`textwrap.indent` is now around 30% faster than before for large " "input. (Contributed by Inada Naoki in :gh:`107369`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1479 +#: ../../whatsnew/3.13.rst:1486 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations, including when *close_fds* is ``True`` (the default) on " @@ -2148,15 +2158,15 @@ msgid "" "Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1489 +#: ../../whatsnew/3.13.rst:1496 msgid "Removed Modules And APIs" msgstr "" -#: ../../whatsnew/3.13.rst:1495 +#: ../../whatsnew/3.13.rst:1502 msgid "PEP 594: Remove \"dead batteries\" from the standard library" msgstr "" -#: ../../whatsnew/3.13.rst:1497 +#: ../../whatsnew/3.13.rst:1504 msgid "" ":pep:`594` proposed removing 19 modules from the standard library, " "colloquially referred to as 'dead batteries' due to their historic, " @@ -2164,23 +2174,23 @@ msgid "" "in Python 3.11, and are now removed:" msgstr "" -#: ../../whatsnew/3.13.rst:1503 +#: ../../whatsnew/3.13.rst:1510 msgid ":mod:`!aifc`" msgstr "" -#: ../../whatsnew/3.13.rst:1504 +#: ../../whatsnew/3.13.rst:1511 msgid ":mod:`!audioop`" msgstr "" -#: ../../whatsnew/3.13.rst:1505 +#: ../../whatsnew/3.13.rst:1512 msgid ":mod:`!chunk`" msgstr "" -#: ../../whatsnew/3.13.rst:1506 +#: ../../whatsnew/3.13.rst:1513 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr "" -#: ../../whatsnew/3.13.rst:1508 +#: ../../whatsnew/3.13.rst:1515 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2188,7 +2198,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1513 +#: ../../whatsnew/3.13.rst:1520 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2196,14 +2206,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1518 +#: ../../whatsnew/3.13.rst:1525 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1522 +#: ../../whatsnew/3.13.rst:1529 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2212,7 +2222,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1530 +#: ../../whatsnew/3.13.rst:1537 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2220,41 +2230,41 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1536 +#: ../../whatsnew/3.13.rst:1543 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1541 +#: ../../whatsnew/3.13.rst:1548 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1550 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1545 +#: ../../whatsnew/3.13.rst:1552 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1547 +#: ../../whatsnew/3.13.rst:1554 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1550 +#: ../../whatsnew/3.13.rst:1557 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1555 +#: ../../whatsnew/3.13.rst:1562 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2262,85 +2272,85 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1561 +#: ../../whatsnew/3.13.rst:1568 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1563 +#: ../../whatsnew/3.13.rst:1570 msgid ":mod:`!msilib`" msgstr "" -#: ../../whatsnew/3.13.rst:1564 +#: ../../whatsnew/3.13.rst:1571 msgid ":mod:`!nis`" msgstr "" -#: ../../whatsnew/3.13.rst:1565 +#: ../../whatsnew/3.13.rst:1572 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1567 +#: ../../whatsnew/3.13.rst:1574 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1569 +#: ../../whatsnew/3.13.rst:1576 msgid "" ":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." "quote` to replace the undocumented ``pipes.quote`` function." msgstr "" -#: ../../whatsnew/3.13.rst:1573 +#: ../../whatsnew/3.13.rst:1580 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1583 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1578 +#: ../../whatsnew/3.13.rst:1585 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1586 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1581 +#: ../../whatsnew/3.13.rst:1588 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1590 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1592 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1589 +#: ../../whatsnew/3.13.rst:1596 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1591 +#: ../../whatsnew/3.13.rst:1598 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1597 +#: ../../whatsnew/3.13.rst:1604 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1599 +#: ../../whatsnew/3.13.rst:1606 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2350,47 +2360,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1608 +#: ../../whatsnew/3.13.rst:1615 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1616 +#: ../../whatsnew/3.13.rst:1623 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1623 +#: ../../whatsnew/3.13.rst:1630 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1625 +#: ../../whatsnew/3.13.rst:1632 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint <entry-points>` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1631 +#: ../../whatsnew/3.13.rst:1638 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1633 +#: ../../whatsnew/3.13.rst:1640 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1639 +#: ../../whatsnew/3.13.rst:1646 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1641 +#: ../../whatsnew/3.13.rst:1648 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2398,7 +2408,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1646 +#: ../../whatsnew/3.13.rst:1653 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2406,43 +2416,60 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1656 +#: ../../whatsnew/3.13.rst:1661 +msgid "optparse" +msgstr "" + +#: ../../whatsnew/3.13.rst:1663 +msgid "" +"This module is no longer considered :term:`soft deprecated`. While :mod:" +"`argparse` remains preferred for new projects that aren't using a third " +"party command line argument processing library, there are aspects of the way " +"``argparse`` works that mean the lower level ``optparse`` module may provide " +"a better foundation for *writing* argument processing libraries, and for " +"implementing command line applications which adhere more strictly than " +"``argparse`` does to various Unix command line processing conventions that " +"originate in the behaviour of the C :c:func:`!getopt` function . " +"(Contributed by Alyssa Coghlan and Serhiy Storchaka in :gh:`126180`.)" +msgstr "" + +#: ../../whatsnew/3.13.rst:1679 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1664 +#: ../../whatsnew/3.13.rst:1687 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1670 +#: ../../whatsnew/3.13.rst:1693 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1672 +#: ../../whatsnew/3.13.rst:1695 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1678 +#: ../../whatsnew/3.13.rst:1701 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1680 +#: ../../whatsnew/3.13.rst:1703 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1689 +#: ../../whatsnew/3.13.rst:1712 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2450,66 +2477,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1695 +#: ../../whatsnew/3.13.rst:1718 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1724 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1726 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1728 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1706 +#: ../../whatsnew/3.13.rst:1729 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1730 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1709 +#: ../../whatsnew/3.13.rst:1732 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1711 +#: ../../whatsnew/3.13.rst:1734 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1712 +#: ../../whatsnew/3.13.rst:1735 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1713 +#: ../../whatsnew/3.13.rst:1736 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1715 +#: ../../whatsnew/3.13.rst:1738 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1717 +#: ../../whatsnew/3.13.rst:1740 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1723 +#: ../../whatsnew/3.13.rst:1746 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1725 +#: ../../whatsnew/3.13.rst:1748 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2520,33 +2547,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1759 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1761 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1743 +#: ../../whatsnew/3.13.rst:1766 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name <webbrowser.controller.name>` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1750 +#: ../../whatsnew/3.13.rst:1773 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1752 +#: ../../whatsnew/3.13.rst:1775 msgid ":ref:`User-defined functions <user-defined-funcs>`:" msgstr "" -#: ../../whatsnew/3.13.rst:1754 +#: ../../whatsnew/3.13.rst:1777 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2554,12 +2581,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1760 +#: ../../whatsnew/3.13.rst:1783 #: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1762 +#: ../../whatsnew/3.13.rst:1785 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2568,73 +2595,61 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1792 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1771 +#: ../../whatsnew/3.13.rst:1794 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1798 msgid "" ":term:`Soft-deprecate <soft deprecated>` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1779 +#: ../../whatsnew/3.13.rst:1802 msgid ":mod:`decimal`:" msgstr "" -#: ../../whatsnew/3.13.rst:1781 +#: ../../whatsnew/3.13.rst:1804 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1786 +#: ../../whatsnew/3.13.rst:1809 msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1788 +#: ../../whatsnew/3.13.rst:1811 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1792 -msgid ":mod:`getopt` and :mod:`optparse`:" -msgstr "" - -#: ../../whatsnew/3.13.rst:1794 -msgid "" -"Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " -"for new projects. This is a new soft-deprecation for the :mod:`!getopt` " -"module, whereas the :mod:`!optparse` module was already *de facto* soft " -"deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" -msgstr "" - -#: ../../whatsnew/3.13.rst:1800 +#: ../../whatsnew/3.13.rst:1815 msgid ":mod:`gettext`:" msgstr "" -#: ../../whatsnew/3.13.rst:1802 +#: ../../whatsnew/3.13.rst:1817 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1807 +#: ../../whatsnew/3.13.rst:1822 msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1809 +#: ../../whatsnew/3.13.rst:1824 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2642,12 +2657,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1814 +#: ../../whatsnew/3.13.rst:1829 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1816 +#: ../../whatsnew/3.13.rst:1831 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2656,29 +2671,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1823 +#: ../../whatsnew/3.13.rst:1838 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1828 +#: ../../whatsnew/3.13.rst:1843 msgid ":mod:`mimetypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1830 +#: ../../whatsnew/3.13.rst:1845 msgid "" ":term:`Soft-deprecate <soft deprecated>` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1835 +#: ../../whatsnew/3.13.rst:1850 msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1837 +#: ../../whatsnew/3.13.rst:1852 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2687,46 +2702,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1844 +#: ../../whatsnew/3.13.rst:1859 #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1846 +#: ../../whatsnew/3.13.rst:1861 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1851 +#: ../../whatsnew/3.13.rst:1866 #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1853 +#: ../../whatsnew/3.13.rst:1868 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1859 +#: ../../whatsnew/3.13.rst:1874 msgid ":mod:`pydoc`:" msgstr "" -#: ../../whatsnew/3.13.rst:1861 +#: ../../whatsnew/3.13.rst:1876 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1864 +#: ../../whatsnew/3.13.rst:1879 #: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1881 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2734,7 +2749,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1872 +#: ../../whatsnew/3.13.rst:1887 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2742,7 +2757,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1878 +#: ../../whatsnew/3.13.rst:1893 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2752,46 +2767,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1886 +#: ../../whatsnew/3.13.rst:1901 #: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1888 +#: ../../whatsnew/3.13.rst:1903 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1908 #: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1895 +#: ../../whatsnew/3.13.rst:1910 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1899 +#: ../../whatsnew/3.13.rst:1914 msgid ":mod:`traceback`:" msgstr "" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1916 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1905 +#: ../../whatsnew/3.13.rst:1920 #: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1907 +#: ../../whatsnew/3.13.rst:1922 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2799,7 +2814,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1914 +#: ../../whatsnew/3.13.rst:1929 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2811,7 +2826,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1924 +#: ../../whatsnew/3.13.rst:1939 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2819,7 +2834,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1930 +#: ../../whatsnew/3.13.rst:1945 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2828,12 +2843,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1938 +#: ../../whatsnew/3.13.rst:1953 #: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1940 +#: ../../whatsnew/3.13.rst:1955 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -3580,11 +3595,11 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1957 +#: ../../whatsnew/3.13.rst:1972 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1959 +#: ../../whatsnew/3.13.rst:1974 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3593,97 +3608,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1967 +#: ../../whatsnew/3.13.rst:1982 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1972 +#: ../../whatsnew/3.13.rst:1987 msgid "" "Add the :ref:`PyMonitoring C API <c-api-monitoring>` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1990 msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:1976 +#: ../../whatsnew/3.13.rst:1991 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1992 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1978 +#: ../../whatsnew/3.13.rst:1993 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1994 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1980 +#: ../../whatsnew/3.13.rst:1995 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1996 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:1997 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1983 +#: ../../whatsnew/3.13.rst:1998 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1984 +#: ../../whatsnew/3.13.rst:1999 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:2000 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:2001 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:2002 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1988 +#: ../../whatsnew/3.13.rst:2003 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1989 +#: ../../whatsnew/3.13.rst:2004 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1990 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1992 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1993 +#: ../../whatsnew/3.13.rst:2008 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:1995 +#: ../../whatsnew/3.13.rst:2010 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:1997 +#: ../../whatsnew/3.13.rst:2012 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3691,52 +3706,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2018 msgid "" "Add the :ref:`PyTime C API <c-api-time>` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2020 msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2021 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2022 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2008 +#: ../../whatsnew/3.13.rst:2023 msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2009 +#: ../../whatsnew/3.13.rst:2024 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2025 msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:2026 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:2027 msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2013 +#: ../../whatsnew/3.13.rst:2028 msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2015 +#: ../../whatsnew/3.13.rst:2030 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2017 +#: ../../whatsnew/3.13.rst:2032 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3744,7 +3759,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2023 +#: ../../whatsnew/3.13.rst:2038 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3754,7 +3769,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2031 +#: ../../whatsnew/3.13.rst:2046 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3763,7 +3778,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2039 +#: ../../whatsnew/3.13.rst:2054 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3772,7 +3787,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2061 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3783,7 +3798,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2056 +#: ../../whatsnew/3.13.rst:2071 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3794,37 +3809,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2066 +#: ../../whatsnew/3.13.rst:2081 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2086 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 <whatsnew313-locals-semantics>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2075 +#: ../../whatsnew/3.13.rst:2090 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2076 +#: ../../whatsnew/3.13.rst:2091 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2077 +#: ../../whatsnew/3.13.rst:2092 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2079 +#: ../../whatsnew/3.13.rst:2094 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2096 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong <strong reference>` or :term:`borrowed " @@ -3833,7 +3848,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2088 +#: ../../whatsnew/3.13.rst:2103 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3841,35 +3856,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2093 +#: ../../whatsnew/3.13.rst:2108 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down <interpreter shutdown>`. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2098 +#: ../../whatsnew/3.13.rst:2113 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2103 +#: ../../whatsnew/3.13.rst:2118 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2107 +#: ../../whatsnew/3.13.rst:2122 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2112 +#: ../../whatsnew/3.13.rst:2127 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -3877,27 +3892,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2118 +#: ../../whatsnew/3.13.rst:2133 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2123 +#: ../../whatsnew/3.13.rst:2138 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2127 +#: ../../whatsnew/3.13.rst:2142 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2130 +#: ../../whatsnew/3.13.rst:2145 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -3906,7 +3921,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2153 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -3914,14 +3929,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2144 +#: ../../whatsnew/3.13.rst:2159 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2149 +#: ../../whatsnew/3.13.rst:2164 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -3929,7 +3944,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2155 +#: ../../whatsnew/3.13.rst:2170 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -3937,14 +3952,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2161 +#: ../../whatsnew/3.13.rst:2176 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2166 +#: ../../whatsnew/3.13.rst:2181 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -3953,7 +3968,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2173 +#: ../../whatsnew/3.13.rst:2188 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -3961,47 +3976,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2194 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2181 +#: ../../whatsnew/3.13.rst:2196 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2182 +#: ../../whatsnew/3.13.rst:2197 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2184 +#: ../../whatsnew/3.13.rst:2199 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2185 +#: ../../whatsnew/3.13.rst:2200 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2188 +#: ../../whatsnew/3.13.rst:2203 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2191 +#: ../../whatsnew/3.13.rst:2206 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2195 +#: ../../whatsnew/3.13.rst:2210 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2197 +#: ../../whatsnew/3.13.rst:2212 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4014,20 +4029,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2209 +#: ../../whatsnew/3.13.rst:2224 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2213 +#: ../../whatsnew/3.13.rst:2228 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2217 +#: ../../whatsnew/3.13.rst:2232 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4038,35 +4053,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2226 +#: ../../whatsnew/3.13.rst:2241 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2229 +#: ../../whatsnew/3.13.rst:2244 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2230 +#: ../../whatsnew/3.13.rst:2245 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2231 +#: ../../whatsnew/3.13.rst:2246 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2247 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2234 +#: ../../whatsnew/3.13.rst:2249 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2237 +#: ../../whatsnew/3.13.rst:2252 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4075,7 +4090,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2243 +#: ../../whatsnew/3.13.rst:2258 msgid "" "If Python is built in :ref:`debug mode <debug-build>` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4083,60 +4098,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2251 +#: ../../whatsnew/3.13.rst:2266 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2268 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2270 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2256 +#: ../../whatsnew/3.13.rst:2271 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2272 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2273 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2274 msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2260 +#: ../../whatsnew/3.13.rst:2275 msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2261 +#: ../../whatsnew/3.13.rst:2276 msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2263 +#: ../../whatsnew/3.13.rst:2278 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2265 +#: ../../whatsnew/3.13.rst:2280 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API <limited-c-api>`. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2286 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2273 +#: ../../whatsnew/3.13.rst:2288 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4146,13 +4161,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2281 +#: ../../whatsnew/3.13.rst:2296 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2284 +#: ../../whatsnew/3.13.rst:2299 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4161,13 +4176,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2292 +#: ../../whatsnew/3.13.rst:2307 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2295 +#: ../../whatsnew/3.13.rst:2310 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4178,13 +4193,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2305 +#: ../../whatsnew/3.13.rst:2320 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2308 +#: ../../whatsnew/3.13.rst:2323 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4194,21 +4209,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2317 +#: ../../whatsnew/3.13.rst:2332 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2319 +#: ../../whatsnew/3.13.rst:2334 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2321 +#: ../../whatsnew/3.13.rst:2336 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2326 +#: ../../whatsnew/3.13.rst:2341 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4219,106 +4234,106 @@ msgid "" "`PyTuple_New(0) <PyTuple_New>`." msgstr "" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2351 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2338 +#: ../../whatsnew/3.13.rst:2353 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2340 +#: ../../whatsnew/3.13.rst:2355 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2343 +#: ../../whatsnew/3.13.rst:2358 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2345 +#: ../../whatsnew/3.13.rst:2360 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2348 +#: ../../whatsnew/3.13.rst:2363 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2350 +#: ../../whatsnew/3.13.rst:2365 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2367 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2369 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2356 +#: ../../whatsnew/3.13.rst:2371 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2358 +#: ../../whatsnew/3.13.rst:2373 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2375 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2363 +#: ../../whatsnew/3.13.rst:2378 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2366 +#: ../../whatsnew/3.13.rst:2381 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration <init-config>` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2370 +#: ../../whatsnew/3.13.rst:2385 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2390 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2376 +#: ../../whatsnew/3.13.rst:2391 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2377 +#: ../../whatsnew/3.13.rst:2392 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2379 +#: ../../whatsnew/3.13.rst:2394 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2381 +#: ../../whatsnew/3.13.rst:2396 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4327,7 +4342,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2388 +#: ../../whatsnew/3.13.rst:2403 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4336,26 +4351,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2395 +#: ../../whatsnew/3.13.rst:2410 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2400 +#: ../../whatsnew/3.13.rst:2415 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2404 +#: ../../whatsnew/3.13.rst:2419 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2407 +#: ../../whatsnew/3.13.rst:2422 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4363,77 +4378,77 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2429 msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2431 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2418 +#: ../../whatsnew/3.13.rst:2433 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2420 +#: ../../whatsnew/3.13.rst:2435 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2437 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2439 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2426 +#: ../../whatsnew/3.13.rst:2441 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2443 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2445 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2434 +#: ../../whatsnew/3.13.rst:2449 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2436 +#: ../../whatsnew/3.13.rst:2451 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2442 +#: ../../whatsnew/3.13.rst:2457 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2446 +#: ../../whatsnew/3.13.rst:2461 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2452 +#: ../../whatsnew/3.13.rst:2467 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4442,7 +4457,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2459 +#: ../../whatsnew/3.13.rst:2474 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4765,56 +4780,56 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2479 +#: ../../whatsnew/3.13.rst:2494 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2481 +#: ../../whatsnew/3.13.rst:2496 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 <whatsnew313-platform-support>` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2486 +#: ../../whatsnew/3.13.rst:2501 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 <whatsnew313-platform-support>` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2491 +#: ../../whatsnew/3.13.rst:2506 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2509 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2497 +#: ../../whatsnew/3.13.rst:2512 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2500 +#: ../../whatsnew/3.13.rst:2515 msgid "" "Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " "Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2504 +#: ../../whatsnew/3.13.rst:2519 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2508 +#: ../../whatsnew/3.13.rst:2523 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license <mimalloc-license>`. The bundled " @@ -4822,28 +4837,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2516 +#: ../../whatsnew/3.13.rst:2531 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2520 +#: ../../whatsnew/3.13.rst:2535 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build <debug-build>`. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2525 +#: ../../whatsnew/3.13.rst:2540 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2529 +#: ../../whatsnew/3.13.rst:2544 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -4853,27 +4868,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2538 +#: ../../whatsnew/3.13.rst:2553 msgid "Porting to Python 3.13" msgstr "" -#: ../../whatsnew/3.13.rst:2540 +#: ../../whatsnew/3.13.rst:2555 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2544 +#: ../../whatsnew/3.13.rst:2559 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.13.rst:2548 +#: ../../whatsnew/3.13.rst:2563 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals <frame.f_locals>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2551 +#: ../../whatsnew/3.13.rst:2566 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -4885,7 +4900,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2560 +#: ../../whatsnew/3.13.rst:2575 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -4895,7 +4910,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2567 +#: ../../whatsnew/3.13.rst:2582 msgid "" "Accessing :attr:`FrameType.f_locals <frame.f_locals>` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -4904,7 +4919,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2573 +#: ../../whatsnew/3.13.rst:2588 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -4912,14 +4927,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2579 +#: ../../whatsnew/3.13.rst:2594 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2584 +#: ../../whatsnew/3.13.rst:2599 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -4928,13 +4943,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2590 +#: ../../whatsnew/3.13.rst:2605 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2593 +#: ../../whatsnew/3.13.rst:2608 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -4942,25 +4957,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2598 +#: ../../whatsnew/3.13.rst:2613 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2603 +#: ../../whatsnew/3.13.rst:2618 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2610 +#: ../../whatsnew/3.13.rst:2625 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.13.rst:2612 +#: ../../whatsnew/3.13.rst:2627 msgid "" "``Python.h`` no longer includes the ``<ieeefp.h>`` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -4969,7 +4984,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2618 +#: ../../whatsnew/3.13.rst:2633 msgid "" "``Python.h`` no longer includes these standard header files: ``<time.h>``, " "``<sys/select.h>`` and ``<sys/time.h>``. If needed, they should now be " @@ -4980,7 +4995,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2626 +#: ../../whatsnew/3.13.rst:2641 msgid "" "On Windows, ``Python.h`` no longer includes the ``<stddef.h>`` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -4990,7 +5005,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2633 +#: ../../whatsnew/3.13.rst:2648 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -4998,18 +5013,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2638 +#: ../../whatsnew/3.13.rst:2653 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2642 +#: ../../whatsnew/3.13.rst:2657 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2644 +#: ../../whatsnew/3.13.rst:2659 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5021,11 +5036,11 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2668 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2655 +#: ../../whatsnew/3.13.rst:2670 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5037,7 +5052,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2664 +#: ../../whatsnew/3.13.rst:2679 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5045,13 +5060,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2671 +#: ../../whatsnew/3.13.rst:2686 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2674 +#: ../../whatsnew/3.13.rst:2689 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5065,7 +5080,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2687 +#: ../../whatsnew/3.13.rst:2702 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5074,25 +5089,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2694 +#: ../../whatsnew/3.13.rst:2709 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2699 +#: ../../whatsnew/3.13.rst:2714 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes <optimized scope>`." msgstr "" -#: ../../whatsnew/3.13.rst:2704 +#: ../../whatsnew/3.13.rst:2719 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2706 +#: ../../whatsnew/3.13.rst:2721 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " @@ -5101,11 +5116,11 @@ msgid "" "in :gh:`110769`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2714 +#: ../../whatsnew/3.13.rst:2729 msgid "Notable changes in 3.13.1" msgstr "" -#: ../../whatsnew/3.13.rst:2719 +#: ../../whatsnew/3.13.rst:2734 msgid "" "The previously undocumented special function :func:`sys.getobjects`, which " "only exists in specialized builds of Python, may now return objects from " From 1920fa8597f3a9eb40dd8e9b1770d0caaa5e877d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:42:28 +0000 Subject: [PATCH 12/14] sync with cpython aae0a1f9 --- about.po | 33 +- c-api/arg.po | 333 +++++++------ c-api/init.po | 387 +++++++-------- c-api/module.po | 81 ++-- c-api/object.po | 39 +- c-api/unicode.po | 333 +++++++------ c-api/veryhigh.po | 14 +- faq/programming.po | 163 +++---- glossary.po | 378 +++++++-------- howto/free-threading-python.po | 4 +- howto/mro.po | 4 +- library/asyncio-eventloop.po | 796 ++++++++++++++++--------------- library/asyncio-queue.po | 12 +- library/calendar.po | 270 +++++++---- library/collections.abc.po | 175 +++---- library/datetime.po | 6 +- library/decimal.po | 4 +- library/email.contentmanager.po | 31 +- library/email.policy.po | 6 +- library/errno.po | 116 ++++- library/exceptions.po | 200 ++++---- library/fnmatch.po | 42 +- library/importlib.metadata.po | 4 +- library/importlib.po | 456 +++++++++--------- library/itertools.po | 14 +- library/json.po | 654 +++++++++++++++---------- library/logging.po | 4 +- library/math.po | 243 +++++----- library/os.po | 171 +++---- library/pdb.po | 231 ++++----- library/plistlib.po | 4 +- library/site.po | 4 +- library/socket.po | 194 ++++---- library/socketserver.po | 89 ++-- library/ssl.po | 8 +- library/string.po | 430 +++++++++-------- library/sys.po | 5 +- library/sysconfig.po | 40 +- library/time.po | 411 ++++++++-------- library/tokenize.po | 75 ++- library/turtle.po | 6 +- license.po | 271 ++++++----- reference/compound_stmts.po | 388 +++++++-------- sphinx.po | 64 +-- using/cmdline.po | 6 +- using/configure.po | 588 +++++++++++------------ whatsnew/2.3.po | 4 +- whatsnew/2.7.po | 4 +- whatsnew/3.12.po | 9 +- whatsnew/3.13.po | 818 +++++++++++++++++++------------- whatsnew/3.3.po | 6 +- whatsnew/3.4.po | 4 +- whatsnew/changelog.po | 4 +- 53 files changed, 4669 insertions(+), 3967 deletions(-) diff --git a/about.po b/about.po index 34c5041570..73207a19f7 100644 --- a/about.po +++ b/about.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2022-05-12 00:11+0800\n" "Last-Translator: hsiao yi <hsiaoyi0504@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,18 +27,21 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../about.rst:3 -msgid "About these documents" +#, fuzzy +msgid "About this documentation" msgstr "關於這些說明文件" #: ../../about.rst:6 +#, fuzzy msgid "" -"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, " -"a document processor specifically written for the Python documentation." +"Python's documentation is generated from `reStructuredText`_ sources using " +"`Sphinx`_, a documentation generator originally created for Python and now " +"maintained as an independent project." msgstr "" "這些說明文件是透過 `Sphinx`_ (一個專為 Python 說明文件所撰寫的文件處理器)將" "使用 `reStructuredText`_ 撰寫的原始檔轉換而成。" -#: ../../about.rst:15 +#: ../../about.rst:16 msgid "" "Development of the documentation and its toolchain is an entirely volunteer " "effort, just like Python itself. If you want to contribute, please take a " @@ -49,18 +52,19 @@ msgstr "" "報臭蟲,請見 :ref:`reporting-bugs` 頁面,內含相關資訊。我們永遠歡迎新的自願者" "加入!" -#: ../../about.rst:20 +#: ../../about.rst:21 msgid "Many thanks go to:" msgstr "致謝:" -#: ../../about.rst:22 +#: ../../about.rst:23 +#, fuzzy msgid "" "Fred L. Drake, Jr., the creator of the original Python documentation toolset " -"and writer of much of the content;" +"and author of much of the content;" msgstr "" "Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者;" -#: ../../about.rst:24 +#: ../../about.rst:25 msgid "" "the `Docutils <https://docutils.sourceforge.io/>`_ project for creating " "reStructuredText and the Docutils suite;" @@ -68,7 +72,7 @@ msgstr "" "創造 reStructuredText 和 Docutils 工具組的 `Docutils <https://docutils." "sourceforge.io/>`_ 專案;" -#: ../../about.rst:26 +#: ../../about.rst:27 msgid "" "Fredrik Lundh for his Alternative Python Reference project from which Sphinx " "got many good ideas." @@ -76,11 +80,12 @@ msgstr "" "Fredrik Lundh 先生,Sphinx 從他的 Alternative Python Reference 計劃中獲得許多" "的好主意。" -#: ../../about.rst:31 -msgid "Contributors to the Python Documentation" +#: ../../about.rst:32 +#, fuzzy +msgid "Contributors to the Python documentation" msgstr "Python 文件的貢獻者們" -#: ../../about.rst:33 +#: ../../about.rst:34 msgid "" "Many people have contributed to the Python language, the Python standard " "library, and the Python documentation. See :source:`Misc/ACKS` in the " @@ -89,7 +94,7 @@ msgstr "" "許多人都曾為 Python 這門語言、Python 標準函式庫和 Python 說明文件貢獻過。" "Python 所發佈的原始碼中含有部份貢獻者的清單,請見 :source:`Misc/ACKS` 。" -#: ../../about.rst:37 +#: ../../about.rst:38 msgid "" "It is only with the input and contributions of the Python community that " "Python has such wonderful documentation -- Thank You!" diff --git a/c-api/arg.po b/c-api/arg.po index f62175c411..565059f701 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -177,7 +177,7 @@ msgid "" "encoding." msgstr "" -#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:593 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]" @@ -417,38 +417,58 @@ msgid "Numbers" msgstr "數字" #: ../../c-api/arg.rst:232 +msgid "" +"These formats allow representing Python numbers or single characters as C " +"numbers. Formats that require :class:`int`, :class:`float` or :class:" +"`complex` can also use the corresponding special methods :meth:`~object." +"__index__`, :meth:`~object.__float__` or :meth:`~object.__complex__` to " +"convert the Python object to the required type." +msgstr "" + +#: ../../c-api/arg.rst:238 +msgid "" +"For signed integer formats, :exc:`OverflowError` is raised if the value is " +"out of range for the C type. For unsigned integer formats, no range checking " +"is done --- the most significant bits are silently truncated when the " +"receiving field is too small to receive the value." +msgstr "" + +#: ../../c-api/arg.rst:244 msgid "``b`` (:class:`int`) [unsigned char]" msgstr "``b`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:233 +#: ../../c-api/arg.rst:245 +#, fuzzy msgid "" -"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" -"c:expr:`unsigned char`." -msgstr "" +"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " +"a C :c:expr:`unsigned char`." +msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:236 ../../c-api/arg.rst:615 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:627 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:237 +#: ../../c-api/arg.rst:249 +#, fuzzy msgid "" -"Convert a Python integer to a tiny int without overflow checking, stored in " -"a C :c:expr:`unsigned char`." +"Convert a Python integer to a tiny integer without overflow checking, stored " +"in a C :c:expr:`unsigned char`." msgstr "" +"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:240 ../../c-api/arg.rst:609 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:621 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" -#: ../../c-api/arg.rst:241 +#: ../../c-api/arg.rst:253 msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" -#: ../../c-api/arg.rst:243 ../../c-api/arg.rst:618 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:630 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" -#: ../../c-api/arg.rst:244 +#: ../../c-api/arg.rst:256 msgid "" "Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." @@ -456,57 +476,57 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:247 ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:615 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" -#: ../../c-api/arg.rst:248 +#: ../../c-api/arg.rst:260 msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:250 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:633 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" -#: ../../c-api/arg.rst:251 +#: ../../c-api/arg.rst:263 msgid "" "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:254 ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:624 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" -#: ../../c-api/arg.rst:255 +#: ../../c-api/arg.rst:267 msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" -#: ../../c-api/arg.rst:257 ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:636 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" -#: ../../c-api/arg.rst:258 +#: ../../c-api/arg.rst:270 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:261 ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:273 ../../c-api/arg.rst:639 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" -#: ../../c-api/arg.rst:262 +#: ../../c-api/arg.rst:274 msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" -#: ../../c-api/arg.rst:264 ../../c-api/arg.rst:630 +#: ../../c-api/arg.rst:276 ../../c-api/arg.rst:642 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" -#: ../../c-api/arg.rst:265 +#: ../../c-api/arg.rst:277 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." @@ -514,71 +534,71 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:633 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:645 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:269 +#: ../../c-api/arg.rst:281 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." msgstr "將一個 Python 整數轉換成 C 的 :c:type:`Py_ssize_t`。" -#: ../../c-api/arg.rst:271 +#: ../../c-api/arg.rst:283 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" msgstr "``c``\\ (:class:`bytes` 或長度為 1 的 :class:`bytearray`)[char]" -#: ../../c-api/arg.rst:272 +#: ../../c-api/arg.rst:284 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " "object of length 1, to a C :c:expr:`char`." msgstr "" -#: ../../c-api/arg.rst:275 +#: ../../c-api/arg.rst:287 msgid "Allow :class:`bytearray` objects." msgstr "允許 :class:`bytearray` 物件。" -#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:640 +#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:652 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" -#: ../../c-api/arg.rst:279 +#: ../../c-api/arg.rst:291 msgid "" "Convert a Python character, represented as a :class:`str` object of length " "1, to a C :c:expr:`int`." msgstr "" -#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:647 +#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:659 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" -#: ../../c-api/arg.rst:283 +#: ../../c-api/arg.rst:295 msgid "Convert a Python floating-point number to a C :c:expr:`float`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" -#: ../../c-api/arg.rst:285 ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:656 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" -#: ../../c-api/arg.rst:286 +#: ../../c-api/arg.rst:298 msgid "Convert a Python floating-point number to a C :c:expr:`double`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`double`。" -#: ../../c-api/arg.rst:288 +#: ../../c-api/arg.rst:300 msgid "``D`` (:class:`complex`) [Py_complex]" msgstr "``D`` (:class:`complex`) [Py_complex]" -#: ../../c-api/arg.rst:289 +#: ../../c-api/arg.rst:301 msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" -#: ../../c-api/arg.rst:292 +#: ../../c-api/arg.rst:304 msgid "Other objects" msgstr "其他物件" -#: ../../c-api/arg.rst:294 ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:665 msgid "``O`` (object) [PyObject \\*]" msgstr "``O``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:295 +#: ../../c-api/arg.rst:307 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " "program thus receives the actual object that was passed. A new :term:" @@ -586,11 +606,11 @@ msgid "" "not increased). The pointer stored is not ``NULL``." msgstr "" -#: ../../c-api/arg.rst:301 +#: ../../c-api/arg.rst:313 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:302 +#: ../../c-api/arg.rst:314 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -599,11 +619,12 @@ msgid "" "required type, :exc:`TypeError` is raised." msgstr "" -#: ../../c-api/arg.rst:310 ../../c-api/arg.rst:671 -msgid "``O&`` (object) [*converter*, *anything*]" +#: ../../c-api/arg.rst:322 +#, fuzzy +msgid "``O&`` (object) [*converter*, *address*]" msgstr "``O&``\\ (物件)[*converter*, *anything*]" -#: ../../c-api/arg.rst:311 +#: ../../c-api/arg.rst:323 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -611,11 +632,11 @@ msgid "" "*converter* function in turn is called as follows::" msgstr "" -#: ../../c-api/arg.rst:316 +#: ../../c-api/arg.rst:328 msgid "status = converter(object, address);" msgstr "status = converter(object, address);" -#: ../../c-api/arg.rst:318 +#: ../../c-api/arg.rst:330 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" "expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " @@ -625,24 +646,31 @@ msgid "" "unmodified." msgstr "" -#: ../../c-api/arg.rst:324 +#: ../../c-api/arg.rst:339 msgid "" -"If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " -"second time if the argument parsing eventually fails, giving the converter a " -"chance to release any memory that it had already allocated. In this second " -"call, the *object* parameter will be ``NULL``; *address* will have the same " -"value as in the original call." +"If the *converter* returns :c:macro:`!Py_CLEANUP_SUPPORTED`, it may get " +"called a second time if the argument parsing eventually fails, giving the " +"converter a chance to release any memory that it had already allocated. In " +"this second call, the *object* parameter will be ``NULL``; *address* will " +"have the same value as in the original call." msgstr "" -#: ../../c-api/arg.rst:330 -msgid "``Py_CLEANUP_SUPPORTED`` was added." +#: ../../c-api/arg.rst:345 +msgid "" +"Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:" +"`PyUnicode_FSDecoder`." +msgstr "" + +#: ../../c-api/arg.rst:348 +#, fuzzy +msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." msgstr "加入 ``Py_CLEANUP_SUPPORTED``。" -#: ../../c-api/arg.rst:333 +#: ../../c-api/arg.rst:351 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:334 +#: ../../c-api/arg.rst:352 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -651,37 +679,28 @@ msgid "" "how Python tests values for truth." msgstr "" -#: ../../c-api/arg.rst:342 ../../c-api/arg.rst:677 +#: ../../c-api/arg.rst:360 ../../c-api/arg.rst:689 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:343 +#: ../../c-api/arg.rst:361 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " "units in *items*. Format units for sequences may be nested." msgstr "" -#: ../../c-api/arg.rst:347 -msgid "" -"It is possible to pass \"long\" integers (integers whose value exceeds the " -"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)." -msgstr "" - -#: ../../c-api/arg.rst:353 +#: ../../c-api/arg.rst:365 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" msgstr "" -#: ../../c-api/arg.rst:356 +#: ../../c-api/arg.rst:368 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:357 +#: ../../c-api/arg.rst:369 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -690,11 +709,11 @@ msgid "" "corresponding C variable(s)." msgstr "" -#: ../../c-api/arg.rst:363 +#: ../../c-api/arg.rst:375 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:364 +#: ../../c-api/arg.rst:376 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -702,36 +721,36 @@ msgid "" "be specified before ``$`` in the format string." msgstr "" -#: ../../c-api/arg.rst:372 +#: ../../c-api/arg.rst:384 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:373 +#: ../../c-api/arg.rst:385 msgid "" "The list of format units ends here; the string after the colon is used as " "the function name in error messages (the \"associated value\" of the " "exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" -#: ../../c-api/arg.rst:377 +#: ../../c-api/arg.rst:389 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:390 msgid "" "The list of format units ends here; the string after the semicolon is used " "as the error message *instead* of the default error message. ``:`` and ``;" "`` mutually exclude each other." msgstr "" -#: ../../c-api/arg.rst:382 +#: ../../c-api/arg.rst:394 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not release them (i.e. do not decrement their " "reference count)!" msgstr "" -#: ../../c-api/arg.rst:386 +#: ../../c-api/arg.rst:398 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -741,7 +760,7 @@ msgid "" "unit in that case." msgstr "" -#: ../../c-api/arg.rst:392 +#: ../../c-api/arg.rst:404 msgid "" "For the conversion to succeed, the *arg* object must match the format and " "the format must be exhausted. On success, the ``PyArg_Parse*`` functions " @@ -751,24 +770,24 @@ msgid "" "the following format units are left untouched." msgstr "" -#: ../../c-api/arg.rst:401 +#: ../../c-api/arg.rst:413 msgid "API Functions" msgstr "API 函式" -#: ../../c-api/arg.rst:405 +#: ../../c-api/arg.rst:417 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " "and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:412 +#: ../../c-api/arg.rst:424 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:418 +#: ../../c-api/arg.rst:430 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -778,51 +797,51 @@ msgid "" "failure, it returns false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:429 +#: ../../c-api/arg.rst:441 msgid "" "The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:" "expr:`const char * const *` in C++. This can be overridden with the :c:macro:" "`PY_CXX_CONST` macro." msgstr "" -#: ../../c-api/arg.rst:433 +#: ../../c-api/arg.rst:445 msgid "" "Added support for :ref:`positional-only parameters <positional-" "only_parameter>`." msgstr "" -#: ../../c-api/arg.rst:437 +#: ../../c-api/arg.rst:449 msgid "" "The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:" "expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " "support for non-ASCII keyword parameter names." msgstr "" -#: ../../c-api/arg.rst:446 +#: ../../c-api/arg.rst:458 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:452 +#: ../../c-api/arg.rst:464 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: ../../c-api/arg.rst:461 +#: ../../c-api/arg.rst:473 msgid "" "Parse the parameter of a function that takes a single positional parameter " "into a local variable. Returns true on success; on failure, it returns " "false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:465 +#: ../../c-api/arg.rst:477 msgid "Example::" msgstr "" -#: ../../c-api/arg.rst:467 +#: ../../c-api/arg.rst:479 msgid "" "// Function using METH_O calling convention\n" "static PyObject*\n" @@ -836,7 +855,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/arg.rst:481 +#: ../../c-api/arg.rst:493 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 " @@ -854,13 +873,13 @@ msgid "" "if there was a failure." msgstr "" -#: ../../c-api/arg.rst:496 +#: ../../c-api/arg.rst:508 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" msgstr "" -#: ../../c-api/arg.rst:499 +#: ../../c-api/arg.rst:511 msgid "" "static PyObject *\n" "weakref_ref(PyObject *self, PyObject *args)\n" @@ -888,17 +907,17 @@ msgstr "" " return result;\n" "}" -#: ../../c-api/arg.rst:512 +#: ../../c-api/arg.rst:524 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: ../../c-api/arg.rst:515 +#: ../../c-api/arg.rst:527 msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" msgstr "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" -#: ../../c-api/arg.rst:519 +#: ../../c-api/arg.rst:531 msgid "" "The value to be inserted, if any, before :c:expr:`char * const *` in the " "*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " @@ -907,11 +926,11 @@ msgid "" "to the desired value before including :file:`Python.h`." msgstr "" -#: ../../c-api/arg.rst:533 +#: ../../c-api/arg.rst:545 msgid "Building values" msgstr "" -#: ../../c-api/arg.rst:537 +#: ../../c-api/arg.rst:549 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -919,7 +938,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: ../../c-api/arg.rst:542 +#: ../../c-api/arg.rst:554 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -928,7 +947,7 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: ../../c-api/arg.rst:548 +#: ../../c-api/arg.rst:560 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " @@ -939,7 +958,7 @@ msgid "" "`Py_BuildValue` returns." msgstr "" -#: ../../c-api/arg.rst:556 +#: ../../c-api/arg.rst:568 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -947,155 +966,155 @@ msgid "" "be passed." msgstr "" -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:572 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: ../../c-api/arg.rst:564 +#: ../../c-api/arg.rst:576 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:565 +#: ../../c-api/arg.rst:577 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: ../../c-api/arg.rst:568 +#: ../../c-api/arg.rst:580 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:581 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:573 +#: ../../c-api/arg.rst:585 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:574 +#: ../../c-api/arg.rst:586 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:577 +#: ../../c-api/arg.rst:589 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:590 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:582 ../../c-api/arg.rst:598 +#: ../../c-api/arg.rst:594 ../../c-api/arg.rst:610 msgid "Same as ``s``." msgstr "和 ``s`` 相同。" -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:596 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:585 ../../c-api/arg.rst:601 +#: ../../c-api/arg.rst:597 ../../c-api/arg.rst:613 msgid "Same as ``s#``." msgstr "和 ``s#`` 相同。" -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:599 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:588 +#: ../../c-api/arg.rst:600 msgid "" "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 "" -#: ../../c-api/arg.rst:592 +#: ../../c-api/arg.rst:604 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:605 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:597 +#: ../../c-api/arg.rst:609 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:612 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:616 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:606 +#: ../../c-api/arg.rst:618 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:619 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:622 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:625 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:628 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:619 +#: ../../c-api/arg.rst:631 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:622 +#: ../../c-api/arg.rst:634 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:625 +#: ../../c-api/arg.rst:637 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:628 +#: ../../c-api/arg.rst:640 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:631 +#: ../../c-api/arg.rst:643 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:634 +#: ../../c-api/arg.rst:646 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。" -#: ../../c-api/arg.rst:636 +#: ../../c-api/arg.rst:648 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" -#: ../../c-api/arg.rst:637 +#: ../../c-api/arg.rst:649 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." @@ -1103,7 +1122,7 @@ msgstr "" "將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`bytes`。" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:653 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." @@ -1111,23 +1130,23 @@ msgstr "" "將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`str`。" -#: ../../c-api/arg.rst:645 +#: ../../c-api/arg.rst:657 msgid "Convert a C :c:expr:`double` to a Python floating-point number." msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:660 msgid "Convert a C :c:expr:`float` to a Python floating-point number." msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:650 +#: ../../c-api/arg.rst:662 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:651 +#: ../../c-api/arg.rst:663 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" -#: ../../c-api/arg.rst:654 +#: ../../c-api/arg.rst:666 msgid "" "Pass a Python object untouched but create a new :term:`strong reference` to " "it (i.e. its reference count is incremented by one). If the object passed in " @@ -1137,26 +1156,30 @@ msgid "" "no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -#: ../../c-api/arg.rst:663 +#: ../../c-api/arg.rst:675 msgid "``S`` (object) [PyObject \\*]" msgstr "``S``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:664 +#: ../../c-api/arg.rst:676 msgid "Same as ``O``." msgstr "和 ``O`` 相同。" -#: ../../c-api/arg.rst:666 +#: ../../c-api/arg.rst:678 msgid "``N`` (object) [PyObject \\*]" msgstr "``N``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:667 +#: ../../c-api/arg.rst:679 msgid "" "Same as ``O``, except it doesn't create a new :term:`strong reference`. " "Useful when the object is created by a call to an object constructor in the " "argument list." msgstr "" -#: ../../c-api/arg.rst:672 +#: ../../c-api/arg.rst:683 +msgid "``O&`` (object) [*converter*, *anything*]" +msgstr "``O&``\\ (物件)[*converter*, *anything*]" + +#: ../../c-api/arg.rst:684 msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:expr:" @@ -1164,40 +1187,40 @@ msgid "" "``NULL`` if an error occurred." msgstr "" -#: ../../c-api/arg.rst:678 +#: ../../c-api/arg.rst:690 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:680 +#: ../../c-api/arg.rst:692 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:681 +#: ../../c-api/arg.rst:693 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:683 +#: ../../c-api/arg.rst:695 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:684 +#: ../../c-api/arg.rst:696 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: ../../c-api/arg.rst:688 +#: ../../c-api/arg.rst:700 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: ../../c-api/arg.rst:693 +#: ../../c-api/arg.rst:705 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." diff --git a/c-api/init.po b/c-api/init.po index 6f77c36b2c..cf4a4109c7 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1455,7 +1455,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1164 ../../c-api/init.rst:1223 -#: ../../c-api/init.rst:1508 +#: ../../c-api/init.rst:1519 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1743,6 +1743,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1422 ../../c-api/init.rst:1432 +#: ../../c-api/init.rst:1454 msgid "The caller must hold the GIL." msgstr "" @@ -1765,39 +1766,45 @@ msgid "" "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1450 +#: ../../c-api/init.rst:1451 +msgid "" +"Return a :term:`strong reference` to the ``__main__`` :ref:`module object " +"<moduleobjects>` for the given interpreter." +msgstr "" + +#: ../../c-api/init.rst:1461 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1452 +#: ../../c-api/init.rst:1463 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1455 +#: ../../c-api/init.rst:1466 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1458 +#: ../../c-api/init.rst:1469 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1463 +#: ../../c-api/init.rst:1474 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1465 ../../c-api/init.rst:1473 +#: ../../c-api/init.rst:1476 ../../c-api/init.rst:1484 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1471 +#: ../../c-api/init.rst:1482 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1480 +#: ../../c-api/init.rst:1491 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1806,7 +1813,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1489 +#: ../../c-api/init.rst:1500 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1818,33 +1825,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1497 +#: ../../c-api/init.rst:1508 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1503 +#: ../../c-api/init.rst:1514 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1514 +#: ../../c-api/init.rst:1525 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1530 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1525 +#: ../../c-api/init.rst:1536 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1853,17 +1860,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1542 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1538 +#: ../../c-api/init.rst:1549 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1551 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1871,7 +1878,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1545 +#: ../../c-api/init.rst:1556 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1882,31 +1889,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1552 +#: ../../c-api/init.rst:1563 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1558 +#: ../../c-api/init.rst:1569 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1564 +#: ../../c-api/init.rst:1575 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1568 +#: ../../c-api/init.rst:1579 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1583 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1914,44 +1921,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1580 +#: ../../c-api/init.rst:1591 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1595 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1589 +#: ../../c-api/init.rst:1600 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1594 +#: ../../c-api/init.rst:1605 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1599 +#: ../../c-api/init.rst:1610 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1616 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1623 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1960,37 +1967,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1630 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1624 +#: ../../c-api/init.rst:1635 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1631 +#: ../../c-api/init.rst:1642 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1635 +#: ../../c-api/init.rst:1646 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1639 +#: ../../c-api/init.rst:1650 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1641 +#: ../../c-api/init.rst:1652 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1655 +#: ../../c-api/init.rst:1666 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -2003,13 +2010,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1676 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1668 +#: ../../c-api/init.rst:1679 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2020,7 +2027,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1688 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2032,13 +2039,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1688 +#: ../../c-api/init.rst:1699 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1691 +#: ../../c-api/init.rst:1702 #, fuzzy msgid "" "PyInterpreterConfig config = {\n" @@ -2067,7 +2074,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1717 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2075,11 +2082,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1726 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1717 +#: ../../c-api/init.rst:1728 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2087,7 +2094,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1723 +#: ../../c-api/init.rst:1734 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2099,7 +2106,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1734 +#: ../../c-api/init.rst:1745 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2109,7 +2116,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1754 +#: ../../c-api/init.rst:1765 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2118,7 +2125,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1777 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2128,17 +2135,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1774 +#: ../../c-api/init.rst:1785 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1779 +#: ../../c-api/init.rst:1790 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1781 +#: ../../c-api/init.rst:1792 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2150,7 +2157,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1802 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2164,7 +2171,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1813 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2172,7 +2179,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1818 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2182,11 +2189,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1818 +#: ../../c-api/init.rst:1829 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1831 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2199,7 +2206,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:1841 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2208,7 +2215,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1836 +#: ../../c-api/init.rst:1847 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2220,25 +2227,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1858 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1860 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1867 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1860 +#: ../../c-api/init.rst:1871 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2246,17 +2253,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1865 +#: ../../c-api/init.rst:1876 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1877 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:1880 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2264,20 +2271,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1885 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1877 +#: ../../c-api/init.rst:1888 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1893 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2287,7 +2294,7 @@ msgid "" "`PyGILState API<gilstate>`." msgstr "" -#: ../../c-api/init.rst:1891 +#: ../../c-api/init.rst:1902 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2295,18 +2302,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1900 +#: ../../c-api/init.rst:1911 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1905 +#: ../../c-api/init.rst:1916 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1920 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2316,7 +2323,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1930 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 " @@ -2328,66 +2335,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1939 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1939 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1941 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1930 ../../c-api/init.rst:1935 -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1941 ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1957 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1932 +#: ../../c-api/init.rst:1943 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1932 +#: ../../c-api/init.rst:1943 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1946 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1948 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1937 +#: ../../c-api/init.rst:1948 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1940 +#: ../../c-api/init.rst:1951 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1940 ../../c-api/init.rst:1942 -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1951 ../../c-api/init.rst:1953 +#: ../../c-api/init.rst:1955 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:1953 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1955 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:1957 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1951 +#: ../../c-api/init.rst:1962 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2396,7 +2403,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1971 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2408,7 +2415,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1971 +#: ../../c-api/init.rst:1982 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2416,31 +2423,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1979 +#: ../../c-api/init.rst:1990 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1985 +#: ../../c-api/init.rst:1996 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1991 +#: ../../c-api/init.rst:2002 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1997 +#: ../../c-api/init.rst:2008 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:2003 +#: ../../c-api/init.rst:2014 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2448,7 +2455,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2022 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2458,29 +2465,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2029 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2020 ../../c-api/init.rst:2027 -#: ../../c-api/init.rst:2046 ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2031 ../../c-api/init.rst:2038 +#: ../../c-api/init.rst:2057 ../../c-api/init.rst:2064 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2024 +#: ../../c-api/init.rst:2035 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:2040 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2048 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2491,28 +2498,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2055 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2050 +#: ../../c-api/init.rst:2061 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2055 +#: ../../c-api/init.rst:2066 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2061 +#: ../../c-api/init.rst:2072 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2067 +#: ../../c-api/init.rst:2078 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2522,19 +2529,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2077 +#: ../../c-api/init.rst:2088 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2082 +#: ../../c-api/init.rst:2093 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2087 +#: ../../c-api/init.rst:2098 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2543,7 +2550,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2093 +#: ../../c-api/init.rst:2104 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2551,11 +2558,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2098 ../../c-api/init.rst:2109 +#: ../../c-api/init.rst:2109 ../../c-api/init.rst:2120 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2104 +#: ../../c-api/init.rst:2115 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2563,48 +2570,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2116 +#: ../../c-api/init.rst:2127 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2132 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2137 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2131 +#: ../../c-api/init.rst:2142 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2136 +#: ../../c-api/init.rst:2147 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2142 +#: ../../c-api/init.rst:2153 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2148 +#: ../../c-api/init.rst:2159 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2155 +#: ../../c-api/init.rst:2166 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2159 +#: ../../c-api/init.rst:2170 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2614,19 +2621,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2166 +#: ../../c-api/init.rst:2177 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2169 +#: ../../c-api/init.rst:2180 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2184 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2634,22 +2641,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2181 +#: ../../c-api/init.rst:2192 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2194 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2189 +#: ../../c-api/init.rst:2200 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2194 +#: ../../c-api/init.rst:2205 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2657,52 +2664,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2199 +#: ../../c-api/init.rst:2210 msgid "" "When :ref:`Py_LIMITED_API <stable>` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2205 +#: ../../c-api/init.rst:2216 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API <stable>`." msgstr "" -#: ../../c-api/init.rst:2210 +#: ../../c-api/init.rst:2221 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2212 +#: ../../c-api/init.rst:2223 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API <stable>`, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2219 +#: ../../c-api/init.rst:2230 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2226 +#: ../../c-api/init.rst:2237 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2232 +#: ../../c-api/init.rst:2243 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2237 +#: ../../c-api/init.rst:2248 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2239 +#: ../../c-api/init.rst:2250 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2710,13 +2717,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2258 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2253 +#: ../../c-api/init.rst:2264 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2725,7 +2732,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2262 +#: ../../c-api/init.rst:2273 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2734,31 +2741,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2271 +#: ../../c-api/init.rst:2282 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2278 +#: ../../c-api/init.rst:2289 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:2297 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2288 +#: ../../c-api/init.rst:2299 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API <thread-" "specific-storage-api>`." msgstr "" -#: ../../c-api/init.rst:2293 +#: ../../c-api/init.rst:2304 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2767,62 +2774,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2298 +#: ../../c-api/init.rst:2309 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:2309 +#: ../../c-api/init.rst:2320 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2311 +#: ../../c-api/init.rst:2322 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2315 +#: ../../c-api/init.rst:2326 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2318 +#: ../../c-api/init.rst:2329 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2320 +#: ../../c-api/init.rst:2331 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2326 +#: ../../c-api/init.rst:2337 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:2345 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2342 +#: ../../c-api/init.rst:2353 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2350 +#: ../../c-api/init.rst:2361 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2352 +#: ../../c-api/init.rst:2363 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded <free threading>` CPython. They are " @@ -2830,7 +2837,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2357 +#: ../../c-api/init.rst:2368 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2840,7 +2847,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2364 +#: ../../c-api/init.rst:2375 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2848,7 +2855,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2371 +#: ../../c-api/init.rst:2382 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2857,11 +2864,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2377 +#: ../../c-api/init.rst:2388 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2379 +#: ../../c-api/init.rst:2390 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2873,7 +2880,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2388 +#: ../../c-api/init.rst:2399 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2883,61 +2890,61 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2396 +#: ../../c-api/init.rst:2407 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2413 -#: ../../c-api/init.rst:2428 ../../c-api/init.rst:2442 +#: ../../c-api/init.rst:2410 ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2439 ../../c-api/init.rst:2453 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2401 +#: ../../c-api/init.rst:2412 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2405 ../../c-api/init.rst:2434 +#: ../../c-api/init.rst:2416 ../../c-api/init.rst:2445 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2411 +#: ../../c-api/init.rst:2422 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2426 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2418 ../../c-api/init.rst:2447 +#: ../../c-api/init.rst:2429 ../../c-api/init.rst:2458 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2435 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2430 +#: ../../c-api/init.rst:2441 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2440 +#: ../../c-api/init.rst:2451 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2444 +#: ../../c-api/init.rst:2455 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -2956,19 +2963,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:710 ../../c-api/init.rst:1145 -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "sys" msgstr "sys" @@ -2980,7 +2987,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1711 ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1722 ../../c-api/init.rst:1775 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3076,23 +3083,23 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1647 ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1658 ../../c-api/init.rst:1757 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1711 +#: ../../c-api/init.rst:1722 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1741 +#: ../../c-api/init.rst:1752 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/module.po b/c-api/module.po index 10b3dd1087..da4559e834 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -583,18 +583,12 @@ msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:526 -msgid "" -"Return ``-1`` if *value* is ``NULL``. It must be called with an exception " -"raised in this case." -msgstr "" - -#: ../../c-api/module.rst:529 ../../c-api/module.rst:576 -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:526 ../../c-api/module.rst:577 +#: ../../c-api/module.rst:604 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:531 +#: ../../c-api/module.rst:528 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -620,13 +614,20 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:543 +#: ../../c-api/module.rst:540 +msgid "" +"To be convenient, the function accepts ``NULL`` *value* with an exception " +"set. In this case, return ``-1`` and just leave the raised exception " +"unchanged." +msgstr "" + +#: ../../c-api/module.rst:544 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:546 +#: ../../c-api/module.rst:547 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -646,13 +647,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:555 +#: ../../c-api/module.rst:556 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:558 +#: ../../c-api/module.rst:559 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -662,7 +663,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:571 +#: ../../c-api/module.rst:572 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -670,39 +671,39 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:578 +#: ../../c-api/module.rst:579 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" -#: ../../c-api/module.rst:587 +#: ../../c-api/module.rst:588 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:590 +#: ../../c-api/module.rst:591 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:597 +#: ../../c-api/module.rst:598 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:600 +#: ../../c-api/module.rst:601 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:605 +#: ../../c-api/module.rst:606 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -716,24 +717,24 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:618 +#: ../../c-api/module.rst:619 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: ../../c-api/module.rst:623 +#: ../../c-api/module.rst:624 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:627 +#: ../../c-api/module.rst:628 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:633 +#: ../../c-api/module.rst:634 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -741,14 +742,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:638 +#: ../../c-api/module.rst:639 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:645 +#: ../../c-api/module.rst:646 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -756,11 +757,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:653 +#: ../../c-api/module.rst:654 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:657 +#: ../../c-api/module.rst:658 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -768,7 +769,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:667 +#: ../../c-api/module.rst:668 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -779,25 +780,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:680 +#: ../../c-api/module.rst:681 msgid "Module lookup" msgstr "模組查找" -#: ../../c-api/module.rst:682 +#: ../../c-api/module.rst:683 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:686 +#: ../../c-api/module.rst:687 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:691 +#: ../../c-api/module.rst:692 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -806,18 +807,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:698 +#: ../../c-api/module.rst:699 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:701 +#: ../../c-api/module.rst:702 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:703 +#: ../../c-api/module.rst:704 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -828,15 +829,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:711 ../../c-api/module.rst:722 +#: ../../c-api/module.rst:712 ../../c-api/module.rst:723 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:713 +#: ../../c-api/module.rst:714 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:719 +#: ../../c-api/module.rst:720 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." diff --git a/c-api/object.po b/c-api/object.po index ae0f232382..19197cf526 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -606,6 +606,13 @@ msgstr "" #: ../../c-api/object.rst:498 msgid "" +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/object.rst:505 +msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " "``NULL`` if there was an error. If the argument is ``NULL``, this is like " @@ -614,7 +621,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:507 +#: ../../c-api/object.rst:514 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 " @@ -622,14 +629,14 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:515 +#: ../../c-api/object.rst:522 msgid "" "This is equivalent to the Python ``__iter__(self): return self`` method. It " "is intended for :term:`iterator` types, to be used in the :c:member:" "`PyTypeObject.tp_iter` slot." msgstr "" -#: ../../c-api/object.rst:521 +#: ../../c-api/object.rst:528 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -638,67 +645,67 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:531 +#: ../../c-api/object.rst:538 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:533 +#: ../../c-api/object.rst:540 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:537 +#: ../../c-api/object.rst:544 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:543 +#: ../../c-api/object.rst:550 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:546 +#: ../../c-api/object.rst:553 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "<PyType_Spec.basicsize>`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:549 +#: ../../c-api/object.rst:556 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:553 +#: ../../c-api/object.rst:560 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:559 +#: ../../c-api/object.rst:566 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:562 +#: ../../c-api/object.rst:569 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: ../../c-api/object.rst:570 +#: ../../c-api/object.rst:577 msgid "Visit the managed dictionary of *obj*." msgstr "" -#: ../../c-api/object.rst:572 ../../c-api/object.rst:581 +#: ../../c-api/object.rst:579 ../../c-api/object.rst:588 msgid "" "This function must only be called in a traverse function of the type which " "has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." msgstr "" -#: ../../c-api/object.rst:579 +#: ../../c-api/object.rst:586 msgid "Clear the managed dictionary of *obj*." msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 42e81982ea..40ca2f04d7 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -955,7 +955,7 @@ msgstr "" msgid "This function ignores the :ref:`Python UTF-8 Mode <utf8-mode>`." msgstr "" -#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:832 +#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:851 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" @@ -988,7 +988,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:863 +#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:882 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" @@ -1013,90 +1013,111 @@ msgstr "" #: ../../c-api/unicode.rst:788 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " -"``\"O&\"`` converter should be used, passing :c:func:`PyUnicode_FSConverter` " -"as the conversion function:" +"``\"O&\"`` converter should be used, passing :c:func:`!" +"PyUnicode_FSConverter` as the conversion function:" msgstr "" #: ../../c-api/unicode.rst:794 msgid "" -"ParseTuple converter: encode :class:`str` objects -- obtained directly or " -"through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" -"func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is. " -"*result* must be a :c:expr:`PyBytesObject*` which must be released when it " -"is no longer used." +":ref:`PyArg_Parse\\* converter <arg-parsing>`: encode :class:`str` objects " +"-- obtained directly or through the :class:`os.PathLike` interface -- to :" +"class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " +"objects are output as-is. *result* must be an address of a C variable of " +"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " +"variable to a new :term:`strong reference` to a :ref:`bytes object " +"<bytesobjects>` which must be released when it is no longer used and return " +"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are " +"not allowed in the result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:802 ../../c-api/unicode.rst:819 +#: ../../c-api/unicode.rst:806 +msgid "" +"If *obj* is ``NULL``, the function releases a strong reference stored in the " +"variable referred by *result* and returns ``1``." +msgstr "" + +#: ../../c-api/unicode.rst:811 ../../c-api/unicode.rst:838 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../c-api/unicode.rst:805 +#: ../../c-api/unicode.rst:814 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " -"converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " +"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:811 +#: ../../c-api/unicode.rst:820 msgid "" -"ParseTuple converter: decode :class:`bytes` objects -- obtained either " -"directly or indirectly through the :class:`os.PathLike` interface -- to :" -"class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` " -"objects are output as-is. *result* must be a :c:expr:`PyUnicodeObject*` " -"which must be released when it is no longer used." +":ref:`PyArg_Parse\\* converter <arg-parsing>`: decode :class:`bytes` objects " +"-- obtained either directly or indirectly through the :class:`os.PathLike` " +"interface -- to :class:`str` using :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. " +"*result* must be an address of a C variable of type :c:expr:`PyObject*` (or :" +"c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:" +"`strong reference` to a :ref:`Unicode object <unicodeobjects>` which must be " +"released when it is no longer used and return a non-zero value (:c:macro:" +"`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the " +"result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:825 +#: ../../c-api/unicode.rst:833 +msgid "" +"If *obj* is ``NULL``, release the strong reference to the object referred to " +"by *result* and return ``1``." +msgstr "" + +#: ../../c-api/unicode.rst:844 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:827 +#: ../../c-api/unicode.rst:846 msgid "" "If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:834 ../../c-api/unicode.rst:847 -#: ../../c-api/unicode.rst:867 +#: ../../c-api/unicode.rst:853 ../../c-api/unicode.rst:866 +#: ../../c-api/unicode.rst:886 msgid "" "The :term:`filesystem error handler <filesystem encoding and error handler>` " "is now used." msgstr "" -#: ../../c-api/unicode.rst:841 +#: ../../c-api/unicode.rst:860 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:844 +#: ../../c-api/unicode.rst:863 msgid "" "If the string length is known, use :c:func:" "`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" -#: ../../c-api/unicode.rst:854 +#: ../../c-api/unicode.rst:873 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:858 +#: ../../c-api/unicode.rst:877 msgid "" "If you need to encode a string to the current locale encoding, use :c:func:" "`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:872 +#: ../../c-api/unicode.rst:891 msgid "wchar_t Support" msgstr "wchar_t 支援" -#: ../../c-api/unicode.rst:874 +#: ../../c-api/unicode.rst:893 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" -#: ../../c-api/unicode.rst:878 +#: ../../c-api/unicode.rst:897 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1104,7 +1125,7 @@ msgid "" "failure." msgstr "" -#: ../../c-api/unicode.rst:886 +#: ../../c-api/unicode.rst:905 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1112,13 +1133,13 @@ msgid "" "`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:891 +#: ../../c-api/unicode.rst:910 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: ../../c-api/unicode.rst:894 +#: ../../c-api/unicode.rst:913 msgid "" "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:" @@ -1128,7 +1149,7 @@ msgid "" "most C functions." msgstr "" -#: ../../c-api/unicode.rst:904 +#: ../../c-api/unicode.rst:923 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 " @@ -1139,37 +1160,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:912 +#: ../../c-api/unicode.rst:931 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (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 failed." msgstr "" -#: ../../c-api/unicode.rst:919 +#: ../../c-api/unicode.rst:938 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:927 +#: ../../c-api/unicode.rst:946 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:929 +#: ../../c-api/unicode.rst:948 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:932 +#: ../../c-api/unicode.rst:951 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:936 +#: ../../c-api/unicode.rst:955 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1177,28 +1198,28 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:941 +#: ../../c-api/unicode.rst:960 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:945 +#: ../../c-api/unicode.rst:964 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:950 +#: ../../c-api/unicode.rst:969 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:952 +#: ../../c-api/unicode.rst:971 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:958 +#: ../../c-api/unicode.rst:977 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1207,7 +1228,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:968 +#: ../../c-api/unicode.rst:987 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1216,21 +1237,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:976 +#: ../../c-api/unicode.rst:995 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:978 +#: ../../c-api/unicode.rst:997 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:983 +#: ../../c-api/unicode.rst:1002 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:990 +#: ../../c-api/unicode.rst:1009 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1238,20 +1259,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:998 +#: ../../c-api/unicode.rst:1017 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1002 ../../c-api/unicode.rst:1017 +#: ../../c-api/unicode.rst:1021 ../../c-api/unicode.rst:1036 msgid "" "The function fails if the string contains surrogate code points (``U+D800`` " "- ``U+DFFF``)." msgstr "" -#: ../../c-api/unicode.rst:1008 +#: ../../c-api/unicode.rst:1027 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1260,13 +1281,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1014 +#: ../../c-api/unicode.rst:1033 msgid "" "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " "return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:1020 +#: ../../c-api/unicode.rst:1039 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1275,47 +1296,57 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1027 ../../c-api/unicode.rst:1040 +#: ../../c-api/unicode.rst:1046 ../../c-api/unicode.rst:1068 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:1049 msgid "This function is a part of the :ref:`limited API <limited-c-api>`." msgstr "" -#: ../../c-api/unicode.rst:1036 +#: ../../c-api/unicode.rst:1055 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1045 +#: ../../c-api/unicode.rst:1059 +msgid "" +"This function does not have any special behavior for `null characters " +"<https://en.wikipedia.org/wiki/Null_character>`_ embedded within *unicode*. " +"As a result, strings containing null characters will remain in the returned " +"string, which some C functions might interpret as the end of the string, " +"leading to truncation. If truncation is an issue, it is recommended to use :" +"c:func:`PyUnicode_AsUTF8AndSize` instead." +msgstr "" + +#: ../../c-api/unicode.rst:1073 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1047 +#: ../../c-api/unicode.rst:1075 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1053 +#: ../../c-api/unicode.rst:1081 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1057 ../../c-api/unicode.rst:1107 +#: ../../c-api/unicode.rst:1085 ../../c-api/unicode.rst:1135 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1060 ../../c-api/unicode.rst:1110 +#: ../../c-api/unicode.rst:1088 ../../c-api/unicode.rst:1138 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: ../../c-api/unicode.rst:1064 +#: ../../c-api/unicode.rst:1092 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1323,21 +1354,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1069 +#: ../../c-api/unicode.rst:1097 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1072 ../../c-api/unicode.rst:1123 +#: ../../c-api/unicode.rst:1100 ../../c-api/unicode.rst:1151 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1074 ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1102 ../../c-api/unicode.rst:1153 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1080 +#: ../../c-api/unicode.rst:1108 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1346,29 +1377,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1089 +#: ../../c-api/unicode.rst:1117 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1123 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1097 +#: ../../c-api/unicode.rst:1125 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1131 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1114 +#: ../../c-api/unicode.rst:1142 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1377,13 +1408,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1120 +#: ../../c-api/unicode.rst:1148 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1131 +#: ../../c-api/unicode.rst:1159 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1393,28 +1424,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1140 +#: ../../c-api/unicode.rst:1168 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1146 +#: ../../c-api/unicode.rst:1174 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1148 +#: ../../c-api/unicode.rst:1176 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1153 +#: ../../c-api/unicode.rst:1181 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1160 +#: ../../c-api/unicode.rst:1188 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1422,101 +1453,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1167 +#: ../../c-api/unicode.rst:1195 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1169 +#: ../../c-api/unicode.rst:1197 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1175 +#: ../../c-api/unicode.rst:1203 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1181 +#: ../../c-api/unicode.rst:1209 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1187 +#: ../../c-api/unicode.rst:1215 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1189 +#: ../../c-api/unicode.rst:1217 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1195 +#: ../../c-api/unicode.rst:1223 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1201 +#: ../../c-api/unicode.rst:1229 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1207 +#: ../../c-api/unicode.rst:1235 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1237 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1215 +#: ../../c-api/unicode.rst:1243 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1221 +#: ../../c-api/unicode.rst:1249 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1227 +#: ../../c-api/unicode.rst:1255 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1229 +#: ../../c-api/unicode.rst:1257 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1235 +#: ../../c-api/unicode.rst:1263 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1241 +#: ../../c-api/unicode.rst:1269 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1247 +#: ../../c-api/unicode.rst:1275 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1249 +#: ../../c-api/unicode.rst:1277 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1526,18 +1557,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1255 +#: ../../c-api/unicode.rst:1283 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1260 +#: ../../c-api/unicode.rst:1288 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1264 +#: ../../c-api/unicode.rst:1292 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1547,14 +1578,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1275 +#: ../../c-api/unicode.rst:1303 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1279 +#: ../../c-api/unicode.rst:1307 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1562,41 +1593,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1285 +#: ../../c-api/unicode.rst:1313 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1289 +#: ../../c-api/unicode.rst:1317 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1293 +#: ../../c-api/unicode.rst:1321 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: ../../c-api/unicode.rst:1296 +#: ../../c-api/unicode.rst:1324 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1300 +#: ../../c-api/unicode.rst:1328 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: ../../c-api/unicode.rst:1305 +#: ../../c-api/unicode.rst:1333 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1307 +#: ../../c-api/unicode.rst:1335 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1604,13 +1635,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1314 +#: ../../c-api/unicode.rst:1342 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1349 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1618,44 +1649,44 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1329 +#: ../../c-api/unicode.rst:1357 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1336 +#: ../../c-api/unicode.rst:1364 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:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1344 +#: ../../c-api/unicode.rst:1372 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1350 +#: ../../c-api/unicode.rst:1378 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1352 +#: ../../c-api/unicode.rst:1380 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1356 +#: ../../c-api/unicode.rst:1384 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1361 +#: ../../c-api/unicode.rst:1389 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1366 +#: ../../c-api/unicode.rst:1394 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1664,27 +1695,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1374 +#: ../../c-api/unicode.rst:1402 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1381 +#: ../../c-api/unicode.rst:1409 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1388 +#: ../../c-api/unicode.rst:1416 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1396 +#: ../../c-api/unicode.rst:1424 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1693,7 +1724,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1406 +#: ../../c-api/unicode.rst:1434 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1703,37 +1734,37 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1414 +#: ../../c-api/unicode.rst:1442 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1421 +#: ../../c-api/unicode.rst:1449 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1428 +#: ../../c-api/unicode.rst:1456 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1435 +#: ../../c-api/unicode.rst:1463 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1438 +#: ../../c-api/unicode.rst:1466 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1444 +#: ../../c-api/unicode.rst:1472 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " @@ -1742,18 +1773,18 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/unicode.rst:1451 ../../c-api/unicode.rst:1472 +#: ../../c-api/unicode.rst:1479 ../../c-api/unicode.rst:1500 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1458 +#: ../../c-api/unicode.rst:1486 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1467 +#: ../../c-api/unicode.rst:1495 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1761,47 +1792,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1477 +#: ../../c-api/unicode.rst:1505 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1479 +#: ../../c-api/unicode.rst:1507 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1480 +#: ../../c-api/unicode.rst:1508 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1481 +#: ../../c-api/unicode.rst:1509 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1483 +#: ../../c-api/unicode.rst:1511 msgid "" "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:1489 +#: ../../c-api/unicode.rst:1517 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1495 +#: ../../c-api/unicode.rst:1523 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1498 +#: ../../c-api/unicode.rst:1526 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1504 +#: ../../c-api/unicode.rst:1532 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -1812,7 +1843,7 @@ msgid "" "interns it." msgstr "" -#: ../../c-api/unicode.rst:1511 +#: ../../c-api/unicode.rst:1539 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1820,39 +1851,39 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1516 +#: ../../c-api/unicode.rst:1544 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1519 +#: ../../c-api/unicode.rst:1547 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1523 +#: ../../c-api/unicode.rst:1551 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1529 +#: ../../c-api/unicode.rst:1557 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: ../../c-api/unicode.rst:1532 +#: ../../c-api/unicode.rst:1560 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1536 +#: ../../c-api/unicode.rst:1564 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " @@ -1861,6 +1892,6 @@ msgid "" "`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1544 +#: ../../c-api/unicode.rst:1572 msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 2bccfe497c..c2902a2f86 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -390,7 +390,17 @@ msgstr "" msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:354 +#: ../../c-api/veryhigh.rst:351 +msgid "The available compiler flags are accessible as macros:" +msgstr "" + +#: ../../c-api/veryhigh.rst:360 +msgid "" +"See :ref:`compiler flags <ast-compiler-flags>` in documentation of the :py:" +"mod:`!ast` Python module, which exports these constants under the same names." +msgstr "" + +#: ../../c-api/veryhigh.rst:366 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." diff --git a/faq/programming.po b/faq/programming.po index 1a9a7ceef4..a0d01fa38f 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-04-25 14:17+0800\n" "Last-Translator: KNChiu <y9760210@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3804,11 +3804,11 @@ msgid "" msgstr "在標準函式庫程式碼中,你將看到幾種正確使用識別性測試的常見模式:" #: ../../faq/programming.rst:1908 +#, fuzzy msgid "" -"1) As recommended by :pep:`8`, an identity test is the preferred way to " -"check for ``None``. This reads like plain English in code and avoids " -"confusion with other objects that may have boolean values that evaluate to " -"false." +"As recommended by :pep:`8`, an identity test is the preferred way to check " +"for ``None``. This reads like plain English in code and avoids confusion " +"with other objects that may have boolean values that evaluate to false." msgstr "" "1) 正如 :pep:`8` 所推薦的,識別性測試是檢查 ``None`` 的首選方法。這在程式碼中" "讀起來像簡單的英語,並避免與其他可能具有評估為 false 的布林值的物件混淆。" @@ -3816,10 +3816,10 @@ msgstr "" #: ../../faq/programming.rst:1912 #, fuzzy msgid "" -"2) Detecting optional arguments can be tricky when ``None`` is a valid input " +"Detecting optional arguments can be tricky when ``None`` is a valid input " "value. In those situations, you can create a singleton sentinel object " "guaranteed to be distinct from other objects. For example, here is how to " -"implement a method that behaves like :meth:`dict.pop`::" +"implement a method that behaves like :meth:`dict.pop`:" msgstr "" "2)當 ``None`` 是有效輸入值時,檢測可選引數可能會很棘手。在這些情況下,你可以" "建立一個保證與其他物件不同的單例哨兵物件。例如,這裡是如何實作一個行為類似" @@ -3849,23 +3849,24 @@ msgstr "" " raise KeyError(key)\n" " return default" -#: ../../faq/programming.rst:1928 +#: ../../faq/programming.rst:1930 +#, fuzzy msgid "" -"3) Container implementations sometimes need to augment equality tests with " +"Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" "3) 容器實作有時需要透過識別性測試來增強相等性測試。這可以防止程式碼被諸如 " "float('NaN') 之類的不等於自身的物件所混淆。" -#: ../../faq/programming.rst:1932 +#: ../../faq/programming.rst:1934 msgid "" "For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" "例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" -#: ../../faq/programming.rst:1935 +#: ../../faq/programming.rst:1937 msgid "" "def __contains__(self, value):\n" " for v in self:\n" @@ -3879,12 +3880,12 @@ msgstr "" " return True\n" " return False" -#: ../../faq/programming.rst:1943 +#: ../../faq/programming.rst:1945 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "子類別如何控制不可變實例中存儲的資料?" -#: ../../faq/programming.rst:1945 +#: ../../faq/programming.rst:1947 #, fuzzy msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " @@ -3896,14 +3897,14 @@ msgstr "" "`~object.__init__` 方法。後者僅在*建立實例後*運行,這為時已晚,無法更改不可變" "實例中的資料。" -#: ../../faq/programming.rst:1950 +#: ../../faq/programming.rst:1952 #, fuzzy msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "所有這些不可變類別都具有與其父類別不同的簽名:" -#: ../../faq/programming.rst:1953 +#: ../../faq/programming.rst:1955 msgid "" "from datetime import date\n" "\n" @@ -3927,11 +3928,11 @@ msgid "" " return super().__new__(cls, s)" msgstr "" -#: ../../faq/programming.rst:1976 +#: ../../faq/programming.rst:1978 msgid "The classes can be used like this:" msgstr "這些類別可以像這樣使用:" -#: ../../faq/programming.rst:1978 +#: ../../faq/programming.rst:1980 msgid "" ">>> FirstOfMonthDate(2012, 2, 14)\n" "FirstOfMonthDate(2012, 2, 1)\n" @@ -3951,11 +3952,11 @@ msgstr "" ">>> TitleStr('Blog: Why Python Rocks')\n" "'blog-why-python-rocks'" -#: ../../faq/programming.rst:1993 +#: ../../faq/programming.rst:1995 msgid "How do I cache method calls?" msgstr "如何快取方法呼叫?" -#: ../../faq/programming.rst:1995 +#: ../../faq/programming.rst:1997 #, fuzzy msgid "" "The two principal tools for caching methods are :func:`functools." @@ -3965,7 +3966,7 @@ msgstr "" "快取方法的兩個主要工具是 func:`functools.cached_property` 和 :func:" "`functools.lru_cache`。前者在實例級別存儲結果,後者在類別級別存儲結果。" -#: ../../faq/programming.rst:2000 +#: ../../faq/programming.rst:2002 #, fuzzy msgid "" "The *cached_property* approach only works with methods that do not take any " @@ -3975,7 +3976,7 @@ msgstr "" "*cached_property* 方法僅適用於不帶任何引數的方法。它不會建立對實例的參照。只" "要實例還活著,快取的方法結果就會被保留。" -#: ../../faq/programming.rst:2004 +#: ../../faq/programming.rst:2006 #, fuzzy msgid "" "The advantage is that when an instance is no longer used, the cached method " @@ -3986,7 +3987,7 @@ msgstr "" "好處是當一個實例不再使用時,快取的方法結果會立即釋放。缺點是如果實例累積,累" "積的方法結果也會累積。他們可以不受限制地成長。" -#: ../../faq/programming.rst:2009 +#: ../../faq/programming.rst:2011 msgid "" "The *lru_cache* approach works with methods that have :term:`hashable` " "arguments. It creates a reference to the instance unless special efforts " @@ -3995,7 +3996,7 @@ msgstr "" "*lru_cache* 方法適用於具有\\ :term:`可雜湊 <hashable>`\\ 引數的方法。除非特別" "努力傳遞弱參照,否則它會建立對實例的參照。" -#: ../../faq/programming.rst:2013 +#: ../../faq/programming.rst:2015 #, fuzzy msgid "" "The advantage of the least recently used algorithm is that the cache is " @@ -4005,11 +4006,11 @@ msgstr "" "最近最少使用演算法的優點是快取受指定的 *maxsize* 限制。缺點是實例會一直保持活" "動狀態,直到它們從快取中老化或快取被清除。" -#: ../../faq/programming.rst:2018 +#: ../../faq/programming.rst:2020 msgid "This example shows the various techniques::" msgstr "這個例子展示了各種技術: ::" -#: ../../faq/programming.rst:2020 +#: ../../faq/programming.rst:2022 msgid "" "class Weather:\n" " \"Lookup weather information on a government website\"\n" @@ -4034,7 +4035,7 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2042 +#: ../../faq/programming.rst:2044 #, fuzzy msgid "" "The above example assumes that the *station_id* never changes. If the " @@ -4044,7 +4045,7 @@ msgstr "" "上面的例子假設 *station_id* 永遠不會改變。如果相關的實例屬性是可變的,則 " "*cached_property* 方法無法工作,因為它無法檢測到屬性的更改。" -#: ../../faq/programming.rst:2047 +#: ../../faq/programming.rst:2049 #, fuzzy msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " @@ -4055,7 +4056,7 @@ msgstr "" "`~object.__eq__` 和 :meth:`~object.__hash__` 方法,以便快取可以檢測相關屬性更" "新: ::" -#: ../../faq/programming.rst:2051 +#: ../../faq/programming.rst:2053 msgid "" "class Weather:\n" " \"Example with a mutable station identifier\"\n" @@ -4078,15 +4079,15 @@ msgid "" " # Depends on the station_id, date, and units." msgstr "" -#: ../../faq/programming.rst:2073 +#: ../../faq/programming.rst:2075 msgid "Modules" msgstr "模組" -#: ../../faq/programming.rst:2076 +#: ../../faq/programming.rst:2078 msgid "How do I create a .pyc file?" msgstr "如何建立 .pyc 檔案?" -#: ../../faq/programming.rst:2078 +#: ../../faq/programming.rst:2080 #, fuzzy msgid "" "When a module is imported for the first time (or when the source file has " @@ -4103,7 +4104,7 @@ msgstr "" "間部分依賴於特定的``python `` 建立它的二進製檔案。(有關詳細資訊,請參閱 :" "pep:`3147`。)" -#: ../../faq/programming.rst:2086 +#: ../../faq/programming.rst:2088 #, fuzzy msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " @@ -4116,7 +4117,7 @@ msgstr "" "__pycache__ 子目錄。例如,如果你以一個使用者的身份開發但以另一個使用者的身份" "運行,例如你正在使用 Web 服務器進行測試,就會發生這種情況。" -#: ../../faq/programming.rst:2091 +#: ../../faq/programming.rst:2093 #, fuzzy msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " @@ -4129,7 +4130,7 @@ msgstr "" "並且 Python 有能力(權限,空閒空間等)建立一個 .pyc 檔案是自動的建立一個" "``__pycache__ `` 子目錄並將編譯後的模組寫入該子目錄。" -#: ../../faq/programming.rst:2096 +#: ../../faq/programming.rst:2098 #, fuzzy msgid "" "Running Python on a top level script is not considered an import and no ``." @@ -4144,7 +4145,7 @@ msgstr "" "入 ``python foo.py`` 作為一個 shell 命令),將為 xyz 建立一個 .pyc 因為引入" "了 xyz,但是不會為 foo 建立 .pyc 檔案,因為 ` `foo.py`` 沒有被引入。" -#: ../../faq/programming.rst:2103 +#: ../../faq/programming.rst:2105 #, fuzzy msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." @@ -4154,7 +4155,7 @@ msgstr "" "如果你需要為 ``foo`` 建立一個 ``.pyc`` 檔案——也就是說,為一個未引入的模組建立" "一個 ``.pyc`` 檔案——你可以使用 :mod :`py_compile` 和 :mod:`compileall` 模組。" -#: ../../faq/programming.rst:2107 +#: ../../faq/programming.rst:2109 #, fuzzy msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " @@ -4163,7 +4164,7 @@ msgstr "" ":mod:`py_compile` 模組可以手動編譯任何模組。一種方法是在該模組中以交互方式使" "用 ``compile()`` 函式: ::" -#: ../../faq/programming.rst:2110 +#: ../../faq/programming.rst:2112 msgid "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " @@ -4171,7 +4172,7 @@ msgstr "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " -#: ../../faq/programming.rst:2113 +#: ../../faq/programming.rst:2115 #, fuzzy msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " @@ -4181,7 +4182,7 @@ msgstr "" "這會將 .pyc 寫入與 foo.py 相同位置的 __pycache__ 子目錄(或者你可以使用可選參" "數 cfile 覆蓋它)。" -#: ../../faq/programming.rst:2117 +#: ../../faq/programming.rst:2119 #, fuzzy msgid "" "You can also automatically compile all files in a directory or directories " @@ -4192,15 +4193,15 @@ msgstr "" "你還可以使用 :mod:`compileall` 模組自動編譯目錄中的所有檔案。你可以在 shell " "提示符下運行 ``compileall.py`` 並提供包含要編譯的 Python 檔案的目錄路徑: ::" -#: ../../faq/programming.rst:2122 +#: ../../faq/programming.rst:2124 msgid "python -m compileall ." msgstr "python -m compileall ." -#: ../../faq/programming.rst:2126 +#: ../../faq/programming.rst:2128 msgid "How do I find the current module name?" msgstr "如何找到當前模組名稱?" -#: ../../faq/programming.rst:2128 +#: ../../faq/programming.rst:2130 #, fuzzy msgid "" "A module can find out its own module name by looking at the predefined " @@ -4213,7 +4214,7 @@ msgstr "" "值為``'__main__'``,則該程式作為腳本運行。許多通常透過引入使用的模組還提供命" "令行界面或自檢,只有在檢查 ``__name__`` 後才執行此程式碼: ::" -#: ../../faq/programming.rst:2134 +#: ../../faq/programming.rst:2136 msgid "" "def main():\n" " print('Running test...')\n" @@ -4223,20 +4224,20 @@ msgid "" " main()" msgstr "" -#: ../../faq/programming.rst:2143 +#: ../../faq/programming.rst:2145 #, fuzzy msgid "How can I have modules that mutually import each other?" msgstr "我怎樣才能擁有相互引入的模組?" -#: ../../faq/programming.rst:2145 +#: ../../faq/programming.rst:2147 msgid "Suppose you have the following modules:" msgstr "假設你有以下模組:" -#: ../../faq/programming.rst:2147 +#: ../../faq/programming.rst:2149 msgid ":file:`foo.py`::" msgstr ":file:`foo.py`: ::" -#: ../../faq/programming.rst:2149 +#: ../../faq/programming.rst:2151 msgid "" "from bar import bar_var\n" "foo_var = 1" @@ -4244,11 +4245,11 @@ msgstr "" "from bar import bar_var\n" "foo_var = 1" -#: ../../faq/programming.rst:2152 +#: ../../faq/programming.rst:2154 msgid ":file:`bar.py`::" msgstr ":file:`bar.py`: ::" -#: ../../faq/programming.rst:2154 +#: ../../faq/programming.rst:2156 msgid "" "from foo import foo_var\n" "bar_var = 2" @@ -4256,39 +4257,39 @@ msgstr "" "from foo import foo_var\n" "bar_var = 2" -#: ../../faq/programming.rst:2157 +#: ../../faq/programming.rst:2159 #, fuzzy msgid "The problem is that the interpreter will perform the following steps:" msgstr "問題是直譯器將執行以下步驟:" -#: ../../faq/programming.rst:2159 +#: ../../faq/programming.rst:2161 #, fuzzy msgid "main imports ``foo``" msgstr "主要引入 ``foo``" -#: ../../faq/programming.rst:2160 +#: ../../faq/programming.rst:2162 #, fuzzy msgid "Empty globals for ``foo`` are created" msgstr "建立了 ``foo`` 的空全域變數" -#: ../../faq/programming.rst:2161 +#: ../../faq/programming.rst:2163 msgid "``foo`` is compiled and starts executing" msgstr "``foo`` 被編譯並開始執行" -#: ../../faq/programming.rst:2162 +#: ../../faq/programming.rst:2164 msgid "``foo`` imports ``bar``" msgstr "``foo`` 引入 ``bar``" -#: ../../faq/programming.rst:2163 +#: ../../faq/programming.rst:2165 #, fuzzy msgid "Empty globals for ``bar`` are created" msgstr "建立了 ``bar`` 的空全域變數" -#: ../../faq/programming.rst:2164 +#: ../../faq/programming.rst:2166 msgid "``bar`` is compiled and starts executing" msgstr "``bar`` 已被編譯並開始執行" -#: ../../faq/programming.rst:2165 +#: ../../faq/programming.rst:2167 #, fuzzy msgid "" "``bar`` imports ``foo`` (which is a no-op since there already is a module " @@ -4296,7 +4297,7 @@ msgid "" msgstr "" "``bar`` 引入 ``foo``(這是一個空操作,因為已經有一個名為 ``foo`` 的模組)" -#: ../../faq/programming.rst:2166 +#: ../../faq/programming.rst:2168 #, fuzzy msgid "" "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " @@ -4305,7 +4306,7 @@ msgstr "" "引入機制嘗試從 ``foo`` 全域變數中讀取 ``foo_var`` ,以設定 ``bar.foo_var = " "foo.foo_var`` " -#: ../../faq/programming.rst:2168 +#: ../../faq/programming.rst:2170 #, fuzzy msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " @@ -4314,7 +4315,7 @@ msgstr "" "最後一步失敗了,因為 Python 還沒有完成對 ``foo`` 的直譯,而 ``foo`` 的全域符" "號字典仍然是空的。" -#: ../../faq/programming.rst:2171 +#: ../../faq/programming.rst:2173 #, fuzzy msgid "" "The same thing happens when you use ``import foo``, and then try to access " @@ -4323,11 +4324,11 @@ msgstr "" "當你使用 ``import foo``,然後嘗試在全域程式碼中存取 ``foo.foo_var`` 時,也會" "發生同樣的事情。" -#: ../../faq/programming.rst:2174 +#: ../../faq/programming.rst:2176 msgid "There are (at least) three possible workarounds for this problem." msgstr "此問題有(至少)三種可能的解決方法。" -#: ../../faq/programming.rst:2176 +#: ../../faq/programming.rst:2178 #, fuzzy msgid "" "Guido van Rossum recommends avoiding all uses of ``from <module> import ..." @@ -4340,28 +4341,28 @@ msgstr "" "函式中。全域變數和類別變數的初始化應該只使用常數或內建函式。這意味著來自引入" "模組的所有內容都被參照為 ``<module>.<name>``。" -#: ../../faq/programming.rst:2181 +#: ../../faq/programming.rst:2183 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "Jim Roskind 建議在每個模組中按以下順序執行各個步驟:" -#: ../../faq/programming.rst:2183 +#: ../../faq/programming.rst:2185 #, fuzzy msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "導出(不需要引入基底類別的全域變數、函式和類別)" -#: ../../faq/programming.rst:2185 +#: ../../faq/programming.rst:2187 msgid "``import`` statements" msgstr "``import`` 陳述式" -#: ../../faq/programming.rst:2186 +#: ../../faq/programming.rst:2188 msgid "" "active code (including globals that are initialized from imported values)." msgstr "活躍程式碼(包括從引入值初始化的全域變數)。" -#: ../../faq/programming.rst:2188 +#: ../../faq/programming.rst:2190 #, fuzzy msgid "" "Van Rossum doesn't like this approach much because the imports appear in a " @@ -4369,21 +4370,21 @@ msgid "" msgstr "" "Van Rossum 不太喜歡這種方法,因為引入出現在一個奇怪的地方,但它確實有效。" -#: ../../faq/programming.rst:2191 +#: ../../faq/programming.rst:2193 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "Matthias Urlichs 建議重構你的程式碼,以便打從一開始就不需要遞迴引入。" -#: ../../faq/programming.rst:2194 +#: ../../faq/programming.rst:2196 msgid "These solutions are not mutually exclusive." msgstr "這些方案並不衝突。" -#: ../../faq/programming.rst:2198 +#: ../../faq/programming.rst:2200 msgid "__import__('x.y.z') returns <module 'x'>; how do I get z?" msgstr "__import__('x.y.z') 回傳 <module 'x'>,那我怎麼得到 z?" -#: ../../faq/programming.rst:2200 +#: ../../faq/programming.rst:2202 #, fuzzy msgid "" "Consider using the convenience function :func:`~importlib.import_module` " @@ -4392,17 +4393,17 @@ msgstr "" "考慮使用來自 :mod:`importlib` 的便利函式 :func:`~importlib.import_module` 代" "替: ::" -#: ../../faq/programming.rst:2203 +#: ../../faq/programming.rst:2205 msgid "z = importlib.import_module('x.y.z')" msgstr "z = importlib.import_module('x.y.z')" -#: ../../faq/programming.rst:2207 +#: ../../faq/programming.rst:2209 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" msgstr "當我編輯需要引入的模組並重新引入它時,更動沒有反應出來。為什麼會這樣?" -#: ../../faq/programming.rst:2209 +#: ../../faq/programming.rst:2211 #, fuzzy msgid "" "For reasons of efficiency as well as consistency, Python only reads the " @@ -4415,7 +4416,7 @@ msgstr "" "一個由許多模組組成的程式中,每個模組都引入相同的基本模組,基本模組將被解析和" "重新解析很多次。要強制重新讀取已更改的模組,請執行以下操作: ::" -#: ../../faq/programming.rst:2215 +#: ../../faq/programming.rst:2217 msgid "" "import importlib\n" "import modname\n" @@ -4425,18 +4426,18 @@ msgstr "" "import modname\n" "importlib.reload(modname)" -#: ../../faq/programming.rst:2219 +#: ../../faq/programming.rst:2221 #, fuzzy msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "警告:此技術並非 100% 萬無一失。尤其是,包含像這樣的陳述式的模組: ::" -#: ../../faq/programming.rst:2222 +#: ../../faq/programming.rst:2224 msgid "from modname import some_objects" msgstr "from modname import some_objects" -#: ../../faq/programming.rst:2224 +#: ../../faq/programming.rst:2226 #, fuzzy msgid "" "will continue to work with the old version of the imported objects. If the " @@ -4447,7 +4448,7 @@ msgstr "" "將繼續使用舊版本的引入物件。如果模組包含類別定義,現有的類別實例將*不會*更新" "為使用新的類別定義。這可能會導致以下自相矛盾的行為: ::" -#: ../../faq/programming.rst:2229 +#: ../../faq/programming.rst:2231 msgid "" ">>> import importlib\n" ">>> import cls\n" @@ -4458,13 +4459,13 @@ msgid "" "False" msgstr "" -#: ../../faq/programming.rst:2237 +#: ../../faq/programming.rst:2239 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" msgstr "如果印出類別物件的「識別性」,問題的本質就很清楚了: ::" -#: ../../faq/programming.rst:2240 +#: ../../faq/programming.rst:2242 msgid "" ">>> hex(id(c.__class__))\n" "'0x7352a0'\n" diff --git a/glossary.po b/glossary.po index c75b153e71..16ce516d25 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,12 +256,13 @@ msgstr "" "運算式。" #: ../../glossary.rst:112 +#, 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:`~object.__anext__`, it picks up " -"where it left off. See :pep:`492` and :pep:`525`." +"execution state (including local variables and pending try-statements). " +"When the *asynchronous generator iterator* effectively resumes 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:`~object." @@ -1258,11 +1259,12 @@ msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" #: ../../glossary.rst:556 +#, fuzzy msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " -"location execution state (including local variables and pending try-" -"statements). When the *generator iterator* resumes, it picks up where it " -"left off (in contrast to functions which start fresh on every invocation)." +"execution state (including local variables and pending try-statements). " +"When the *generator iterator* resumes, it picks up where it left off (in " +"contrast to functions which start fresh on every invocation)." msgstr "" "每個 :keyword:`yield` 會暫停處理程序,並記住位置執行狀態(包括區域變數及擱置" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" @@ -1721,7 +1723,7 @@ msgstr "" msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:771 ../../glossary.rst:1075 +#: ../../glossary.rst:771 ../../glossary.rst:1077 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" @@ -1807,32 +1809,34 @@ msgstr "loader(載入器)" #: ../../glossary.rst:804 #, fuzzy msgid "" -"An object that loads a module. It must define a method named :meth:" -"`load_module`. A loader is typically returned by a :term:`finder`. See also:" +"An object that loads a module. It must define the :meth:`!exec_module` and :" +"meth:`!create_module` methods to implement the :class:`~importlib.abc." +"Loader` interface. A loader is typically returned by a :term:`finder`. See " +"also:" msgstr "" "一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" "法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`。" -#: ../../glossary.rst:808 +#: ../../glossary.rst:810 msgid ":ref:`finders-and-loaders`" msgstr "" -#: ../../glossary.rst:809 +#: ../../glossary.rst:811 msgid ":class:`importlib.abc.Loader`" msgstr "" -#: ../../glossary.rst:810 +#: ../../glossary.rst:812 #, fuzzy msgid ":pep:`302`" msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:811 +#: ../../glossary.rst:813 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:813 +#: ../../glossary.rst:815 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) <locale.setlocale>`." @@ -1840,36 +1844,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) <locale.setlocale>` 來設定。" -#: ../../glossary.rst:816 +#: ../../glossary.rst:818 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:818 +#: ../../glossary.rst:820 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:822 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:822 +#: ../../glossary.rst:824 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:823 +#: ../../glossary.rst:825 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:827 +#: ../../glossary.rst:829 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:828 +#: ../../glossary.rst:830 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:830 +#: ../../glossary.rst:832 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1884,11 +1888,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:836 +#: ../../glossary.rst:838 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:838 +#: ../../glossary.rst:840 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders <path " @@ -1898,18 +1902,18 @@ msgstr "" "徑尋檢器與\\ :term:`路徑項目尋檢器 (path entry finder) <path entry finder>` " "相關但是不同。" -#: ../../glossary.rst:842 +#: ../../glossary.rst:844 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:844 +#: ../../glossary.rst:846 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:846 +#: ../../glossary.rst:848 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1929,15 +1933,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:856 +#: ../../glossary.rst:858 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:825 ../../glossary.rst:857 ../../glossary.rst:1220 +#: ../../glossary.rst:827 ../../glossary.rst:859 ../../glossary.rst:1222 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:859 +#: ../../glossary.rst:861 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1949,11 +1953,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:863 +#: ../../glossary.rst:865 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:865 +#: ../../glossary.rst:867 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -1962,11 +1966,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:868 +#: ../../glossary.rst:870 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:870 +#: ../../glossary.rst:872 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1976,15 +1980,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:874 +#: ../../glossary.rst:876 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:875 +#: ../../glossary.rst:877 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:877 +#: ../../glossary.rst:879 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1992,24 +1996,24 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:880 +#: ../../glossary.rst:882 #, fuzzy msgid "See also :ref:`module-specs`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:881 +#: ../../glossary.rst:883 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:883 +#: ../../glossary.rst:885 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:884 +#: ../../glossary.rst:886 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:886 +#: ../../glossary.rst:888 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -2017,11 +2021,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:888 +#: ../../glossary.rst:890 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:890 +#: ../../glossary.rst:892 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2031,7 +2035,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:894 +#: ../../glossary.rst:896 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -2040,7 +2044,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:898 +#: ../../glossary.rst:900 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2050,7 +2054,7 @@ msgid "" "True" msgstr "" -#: ../../glossary.rst:905 +#: ../../glossary.rst:907 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2067,11 +2071,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:913 +#: ../../glossary.rst:915 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:915 +#: ../../glossary.rst:917 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -2091,11 +2095,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:925 +#: ../../glossary.rst:927 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:927 +#: ../../glossary.rst:929 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -2106,15 +2110,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:934 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:933 +#: ../../glossary.rst:935 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:935 +#: ../../glossary.rst:937 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2129,11 +2133,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:942 +#: ../../glossary.rst:944 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:944 +#: ../../glossary.rst:946 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2145,11 +2149,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:949 +#: ../../glossary.rst:951 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:951 +#: ../../glossary.rst:953 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2157,11 +2161,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:954 +#: ../../glossary.rst:956 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:956 +#: ../../glossary.rst:958 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2172,11 +2176,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:963 +#: ../../glossary.rst:965 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:965 +#: ../../glossary.rst:967 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2186,17 +2190,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:969 +#: ../../glossary.rst:971 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:970 +#: ../../glossary.rst:972 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:972 +#: ../../glossary.rst:974 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2206,7 +2210,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:976 +#: ../../glossary.rst:978 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally <argument>` or as a :term:`keyword argument " @@ -2217,11 +2221,11 @@ msgstr "" "置 <argument>`\\ 或是作為\\ :term:`關鍵字引數 <argument>`\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:981 +#: ../../glossary.rst:983 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:985 +#: ../../glossary.rst:987 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2232,11 +2236,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:990 +#: ../../glossary.rst:992 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:994 +#: ../../glossary.rst:996 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2249,11 +2253,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1002 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1002 +#: ../../glossary.rst:1004 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2265,11 +2269,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1008 +#: ../../glossary.rst:1010 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1012 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2280,14 +2284,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1018 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1019 +#: ../../glossary.rst:1021 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters <faq-argument-vs-parameter>`, " @@ -2298,11 +2302,11 @@ msgstr "" "參數之間的差異 <faq-argument-vs-parameter>`、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1025 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1027 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2310,11 +2314,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1029 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1029 +#: ../../glossary.rst:1031 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2324,7 +2328,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1035 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2332,11 +2336,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1035 +#: ../../glossary.rst:1037 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1037 +#: ../../glossary.rst:1039 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2346,11 +2350,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1042 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1042 +#: ../../glossary.rst:1044 msgid "" "One of the default :term:`meta path finders <meta path finder>` which " "searches an :term:`import path` for modules." @@ -2358,11 +2362,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) <meta path finder>` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1044 +#: ../../glossary.rst:1046 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1048 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2380,11 +2384,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1054 +#: ../../glossary.rst:1056 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1058 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2395,7 +2399,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1062 +#: ../../glossary.rst:1064 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2407,15 +2411,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1068 +#: ../../glossary.rst:1070 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1071 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1073 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2423,15 +2427,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1075 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1078 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1080 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2447,7 +2451,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1089 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2456,7 +2460,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1091 +#: ../../glossary.rst:1093 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2465,19 +2469,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1094 +#: ../../glossary.rst:1096 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1098 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1097 +#: ../../glossary.rst:1099 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1101 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2486,11 +2490,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1104 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1106 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2504,7 +2508,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1111 +#: ../../glossary.rst:1113 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2512,11 +2516,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1114 +#: ../../glossary.rst:1116 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1116 +#: ../../glossary.rst:1118 msgid "" "for piece in food:\n" " print(piece)" @@ -2524,11 +2528,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1120 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1122 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2539,7 +2543,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1127 msgid "" ">>> class C:\n" "... class D:\n" @@ -2565,7 +2569,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1139 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2574,7 +2578,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1143 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2584,11 +2588,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1144 +#: ../../glossary.rst:1146 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1148 #, fuzzy msgid "" "The number of references to an object. When the reference count of an " @@ -2605,11 +2609,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1154 +#: ../../glossary.rst:1156 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1158 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2617,25 +2621,25 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1159 +#: ../../glossary.rst:1161 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1162 msgid "REPL" msgstr "" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1164 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." msgstr "" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1166 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1168 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2648,11 +2652,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1173 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1175 #, fuzzy msgid "" "An :term:`iterable` which supports efficient element access using integer " @@ -2672,7 +2676,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` " "鍵,而不是整數。" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1184 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2689,11 +2693,11 @@ msgstr "" "用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" "\\ :ref:`常見序列操作 <typesseq-common>`。" -#: ../../glossary.rst:1191 +#: ../../glossary.rst:1193 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1195 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2704,11 +2708,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1197 +#: ../../glossary.rst:1199 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1201 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2716,11 +2720,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1203 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1205 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2732,34 +2736,34 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1209 msgid "soft deprecated" msgstr "" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1211 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " "will not be enhanced further." msgstr "" -#: ../../glossary.rst:1213 +#: ../../glossary.rst:1215 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "" -#: ../../glossary.rst:1216 +#: ../../glossary.rst:1218 msgid "" "See `PEP 387: Soft Deprecation <https://peps.python.org/pep-0387/#soft-" "deprecation>`_." msgstr "" -#: ../../glossary.rst:1218 +#: ../../glossary.rst:1220 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1224 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2770,11 +2774,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1228 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1230 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2784,11 +2788,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1233 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1235 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints <type hint>` and the :" @@ -2798,11 +2802,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) <type hint>` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1238 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1240 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2813,7 +2817,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1246 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2823,15 +2827,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1251 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1252 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1254 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 " @@ -2840,7 +2844,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1258 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2848,7 +2852,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1261 msgid "" "There are a variety of different text serialization :ref:`codecs <standard-" "encodings>`, which are collectively referred to as \"text encodings\"." @@ -2856,11 +2860,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs <standard-encodings>`),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1262 +#: ../../glossary.rst:1264 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1266 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2874,7 +2878,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1273 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects <bytes-like object>`." @@ -2882,11 +2886,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) <bytes-like object>` 的檔案物件。" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1275 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1277 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2901,11 +2905,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1284 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1286 #, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " @@ -2916,22 +2920,22 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1288 +#: ../../glossary.rst:1290 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1292 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1294 msgid "" "Type aliases are useful for simplifying :term:`type hints <type hint>`. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) <type hint>` 很有用。例如: ::" -#: ../../glossary.rst:1295 +#: ../../glossary.rst:1297 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2941,11 +2945,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1299 +#: ../../glossary.rst:1301 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1301 +#: ../../glossary.rst:1303 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2957,15 +2961,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1306 ../../glossary.rst:1320 +#: ../../glossary.rst:1308 ../../glossary.rst:1322 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1307 +#: ../../glossary.rst:1309 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1311 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2973,7 +2977,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1312 +#: ../../glossary.rst:1314 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers <static type checker>`. They can also aid " @@ -2983,7 +2987,7 @@ msgstr "" "(static type checkers) <static type checker>`\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1316 +#: ../../glossary.rst:1318 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2991,11 +2995,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1321 +#: ../../glossary.rst:1323 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1325 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3008,20 +3012,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1328 +#: ../../glossary.rst:1330 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1330 +#: ../../glossary.rst:1332 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1332 +#: ../../glossary.rst:1334 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1336 msgid "" "class C:\n" " field: 'annotation'" @@ -3029,7 +3033,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1337 +#: ../../glossary.rst:1339 msgid "" "Variable annotations are usually used for :term:`type hints <type hint>`: " "for example this variable is expected to take :class:`int` values::" @@ -3037,15 +3041,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) <type hint>`:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1341 +#: ../../glossary.rst:1343 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1345 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1347 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3054,11 +3058,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1349 +#: ../../glossary.rst:1351 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1353 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3069,15 +3073,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1356 +#: ../../glossary.rst:1358 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1357 +#: ../../glossary.rst:1359 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1361 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3085,11 +3089,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1361 +#: ../../glossary.rst:1363 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1365 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3106,11 +3110,11 @@ msgstr "C-contiguous(C 連續的)" msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:825 +#: ../../glossary.rst:827 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1220 +#: ../../glossary.rst:1222 msgid "special" msgstr "special" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 24a20d0c2e..0b66f7083b 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -82,7 +82,7 @@ msgstr "" #: ../../howto/free-threading-python.rst:45 msgid "" "To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " "build\". The new :func:`sys._is_gil_enabled` function can be used to check " "whether the GIL is actually disabled in the running process." msgstr "" diff --git a/howto/mro.po b/howto/mro.po index 625bb55f05..9ef8ae5e1b 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -614,7 +614,7 @@ msgstr "" msgid "" "We see that class G inherits from F and E, with F *before* E: therefore we " "would expect the attribute *G.remember2buy* to be inherited by *F." -"rembermer2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" +"remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" msgstr "" #: ../../howto/mro.rst:407 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 7a232640e8..922e40650d 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -296,8 +296,8 @@ msgid "" msgstr "請注意,使用 :func:`asyncio.run` 時不需要呼叫此函式。" #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1269 -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1721 msgid "Example::" msgstr "範例: ::" @@ -403,27 +403,34 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:239 msgid "" +"This function is safe to be called from a reentrant context or signal " +"handler, however, it is not safe or fruitful to use the returned handle in " +"such contexts." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:242 +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 "" "如果在已關閉的迴圈上呼叫,則引發 :exc:`RuntimeError`。在主應用程式關閉時,這" "可能發生在次要執行緒上。" -#: ../../library/asyncio-eventloop.rst:243 +#: ../../library/asyncio-eventloop.rst:246 msgid "" "See the :ref:`concurrency and multithreading <asyncio-multithreading>` " "section of the documentation." msgstr "請參閱文件的\\ :ref:`並行和多執行緒 <asyncio-multithreading>`\\ 部分。" -#: ../../library/asyncio-eventloop.rst:246 -#: ../../library/asyncio-eventloop.rst:296 -#: ../../library/asyncio-eventloop.rst:316 +#: ../../library/asyncio-eventloop.rst:249 +#: ../../library/asyncio-eventloop.rst:299 +#: ../../library/asyncio-eventloop.rst:319 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "新增了 *context* 僅限關鍵字參數。詳細資訊請參閱 :pep:`567`。" -#: ../../library/asyncio-eventloop.rst:254 +#: ../../library/asyncio-eventloop.rst:257 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" @@ -431,14 +438,14 @@ msgstr "" "大多數 :mod:`asyncio` 排程函式不允許傳遞關鍵字引數。要傳遞關鍵字引數,請使" "用 :func:`functools.partial`: ::" -#: ../../library/asyncio-eventloop.rst:257 +#: ../../library/asyncio-eventloop.rst:260 msgid "" "# will schedule \"print(\"Hello\", flush=True)\"\n" "loop.call_soon(\n" " functools.partial(print, \"Hello\", flush=True))" msgstr "" -#: ../../library/asyncio-eventloop.rst:261 +#: ../../library/asyncio-eventloop.rst:264 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." @@ -446,11 +453,11 @@ msgstr "" "通常使用 partial 物件比使用 lambda 更方便,因為 asyncio 可以在除錯和錯誤訊息" "中更好地呈現 partial 物件。" -#: ../../library/asyncio-eventloop.rst:269 +#: ../../library/asyncio-eventloop.rst:272 msgid "Scheduling delayed callbacks" msgstr "排程延遲的回呼函式" -#: ../../library/asyncio-eventloop.rst:271 +#: ../../library/asyncio-eventloop.rst:274 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." @@ -458,20 +465,20 @@ msgstr "" "事件迴圈提供為回呼函式排程在將來某個時間點才呼叫的機制。事件迴圈使用了單調時" "鐘來追蹤時間。" -#: ../../library/asyncio-eventloop.rst:278 +#: ../../library/asyncio-eventloop.rst:281 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "排程 *callback* 在給定的 *delay* 秒數後呼叫(可以是整數或浮點數)。" -#: ../../library/asyncio-eventloop.rst:281 -#: ../../library/asyncio-eventloop.rst:313 +#: ../../library/asyncio-eventloop.rst:284 +#: ../../library/asyncio-eventloop.rst:316 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "回傳 :class:`asyncio.TimerHandle` 的實例,可用於取消回呼函式。" -#: ../../library/asyncio-eventloop.rst:284 +#: ../../library/asyncio-eventloop.rst:287 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." @@ -479,7 +486,7 @@ msgstr "" "*callback* 將只被呼叫恰好一次。如果有兩個回呼函式被排程在完全相同的時間,則其" "呼叫順序是不定的。" -#: ../../library/asyncio-eventloop.rst:288 +#: ../../library/asyncio-eventloop.rst:291 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 :" @@ -488,7 +495,7 @@ msgstr "" "可選的位置引數 *args* 將在呼叫回呼函式時傳遞。如果要使用關鍵字引數呼叫回呼函" "數,請使用 :func:`functools.partial`。" -#: ../../library/asyncio-eventloop.rst:292 +#: ../../library/asyncio-eventloop.rst:295 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " @@ -497,7 +504,7 @@ msgstr "" "可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義的 :class:" "`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用當前情境。" -#: ../../library/asyncio-eventloop.rst:300 +#: ../../library/asyncio-eventloop.rst:303 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." @@ -505,7 +512,7 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*delay* 不能超過一天。這" "在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:307 +#: ../../library/asyncio-eventloop.rst:310 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`." @@ -513,11 +520,11 @@ msgstr "" "排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用與 :" "meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:314 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "此方法的行為與 :meth:`call_later` 相同。" -#: ../../library/asyncio-eventloop.rst:320 +#: ../../library/asyncio-eventloop.rst:323 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. " @@ -526,13 +533,13 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*when* 和當前時間之間的差" "值不能超過一天。這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:327 +#: ../../library/asyncio-eventloop.rst:330 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "根據事件迴圈的內部單調時鐘,回傳當前時間,以 :class:`float` 值表示。" -#: ../../library/asyncio-eventloop.rst:331 +#: ../../library/asyncio-eventloop.rst:334 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." @@ -540,19 +547,19 @@ msgstr "" "在 Python 3.7 及更早版本中,超時(相對 *delay* 或絕對 *when*)不應超過一天。" "這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:337 +#: ../../library/asyncio-eventloop.rst:340 msgid "The :func:`asyncio.sleep` function." msgstr "函式 :func:`asyncio.sleep`。" -#: ../../library/asyncio-eventloop.rst:341 +#: ../../library/asyncio-eventloop.rst:344 msgid "Creating Futures and Tasks" msgstr "建立 Futures 和 Tasks" -#: ../../library/asyncio-eventloop.rst:345 +#: ../../library/asyncio-eventloop.rst:348 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "建立附加到事件迴圈的 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:347 +#: ../../library/asyncio-eventloop.rst:350 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " @@ -561,13 +568,13 @@ msgstr "" "這是在 asyncio 中建立 Futures 的首選方式。這允許第三方事件迴圈提供 Future 物" "件的替代實作(具有更好的性能或儀器計測表現)。" -#: ../../library/asyncio-eventloop.rst:355 +#: ../../library/asyncio-eventloop.rst:358 msgid "" "Schedule the execution of :ref:`coroutine <coroutine>` *coro*. Return a :" "class:`Task` object." msgstr "排程執行\\ :ref:`協程 <coroutine>` *coro*。回傳 :class:`Task` 物件。" -#: ../../library/asyncio-eventloop.rst:358 +#: ../../library/asyncio-eventloop.rst:361 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:" @@ -576,7 +583,7 @@ msgstr "" "第三方事件迴圈可以使用其自己的 :class:`Task` 子類別以實現互操作性" "(interoperability)。在這種情況下,結果類型是 :class:`Task` 的子類別。" -#: ../../library/asyncio-eventloop.rst:362 +#: ../../library/asyncio-eventloop.rst:365 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." @@ -584,7 +591,7 @@ msgstr "" "如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使用 :meth:" "`Task.set_name`。" -#: ../../library/asyncio-eventloop.rst:365 +#: ../../library/asyncio-eventloop.rst:368 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " @@ -594,19 +601,19 @@ msgstr "" "`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立當前情境的副" "本。" -#: ../../library/asyncio-eventloop.rst:369 +#: ../../library/asyncio-eventloop.rst:372 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:372 +#: ../../library/asyncio-eventloop.rst:375 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:377 +#: ../../library/asyncio-eventloop.rst:380 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "設置將由 :meth:`loop.create_task` 使用的任務工廠。" -#: ../../library/asyncio-eventloop.rst:380 +#: ../../library/asyncio-eventloop.rst:383 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -619,21 +626,21 @@ msgstr "" "事件迴圈的參照,*coro* 是一個協程物件。該可呼叫物件必須回傳一個與 :class:" "`asyncio.Future` 相容的物件。" -#: ../../library/asyncio-eventloop.rst:388 +#: ../../library/asyncio-eventloop.rst:391 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "回傳任務工廠,如果使用預設任務工廠則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:392 +#: ../../library/asyncio-eventloop.rst:395 msgid "Opening network connections" msgstr "打開網路連線" -#: ../../library/asyncio-eventloop.rst:403 +#: ../../library/asyncio-eventloop.rst:406 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "打開以 *host* 和 *port* 指定之給定地址的串流傳輸連線。" -#: ../../library/asyncio-eventloop.rst:406 +#: ../../library/asyncio-eventloop.rst:409 msgid "" "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 " @@ -642,13 +649,13 @@ msgstr "" "根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以是 :py:const:" "`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:413 msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_STREAM`。" -#: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1180 -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:1205 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "<asyncio-protocol>` implementation." @@ -656,24 +663,24 @@ msgstr "" "*protocol_factory* 必須是一個回傳 :ref:`asyncio protocol <asyncio-protocol>` " "實作的可呼叫函式。" -#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:418 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" "此方法將嘗試在背景建立連線。成功時,它將回傳一對 ``(transport, protocol)``。" -#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:421 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "底層操作的時間軸簡介如下:" -#: ../../library/asyncio-eventloop.rst:420 +#: ../../library/asyncio-eventloop.rst:423 msgid "" "The connection is established and a :ref:`transport <asyncio-transport>` is " "created for it." msgstr "建立連線並為其建立\\ :ref:`傳輸 <asyncio-transport>`。" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:426 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol <asyncio-protocol>` instance." @@ -681,7 +688,7 @@ msgstr "" "*protocol_factory* 在無引數的情況下被呼叫,並且預計回傳一個 :ref:`協定 " "<asyncio-protocol>` 實例。" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:429 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." @@ -689,21 +696,21 @@ msgstr "" "通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協議實例與傳輸連線在" "一起。" -#: ../../library/asyncio-eventloop.rst:429 +#: ../../library/asyncio-eventloop.rst:432 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "成功時回傳一個 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:431 +#: ../../library/asyncio-eventloop.rst:434 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "建立的傳輸是一個依賴實作的雙向串流。" -#: ../../library/asyncio-eventloop.rst:434 -#: ../../library/asyncio-eventloop.rst:566 +#: ../../library/asyncio-eventloop.rst:437 +#: ../../library/asyncio-eventloop.rst:569 msgid "Other arguments:" msgstr "其他引數:" -#: ../../library/asyncio-eventloop.rst:436 +#: ../../library/asyncio-eventloop.rst:439 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` " @@ -715,11 +722,11 @@ msgstr "" "果 *ssl* 為 :class:`ssl.SSLContext` 物件,則使用該情境來建立傳輸;如果 *ssl* " "為 :const:`True`,則使用 :func:`ssl.create_default_context` 回傳的預設情境。" -#: ../../library/asyncio-eventloop.rst:442 +#: ../../library/asyncio-eventloop.rst:445 msgid ":ref:`SSL/TLS security considerations <ssl-security>`" msgstr ":ref:`SSL/TLS 安全考量 <ssl-security>`" -#: ../../library/asyncio-eventloop.rst:444 +#: ../../library/asyncio-eventloop.rst:447 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 " @@ -734,7 +741,7 @@ msgstr "" "預設值,必須傳遞 *server_hostname* 的值。若 *server_hostname* 為空字串,將停" "用主機名稱匹配(這是一個嚴重的安全風險,可能導致中間人攻擊)。" -#: ../../library/asyncio-eventloop.rst:452 +#: ../../library/asyncio-eventloop.rst:455 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -745,7 +752,7 @@ msgstr "" "getaddrinfo() 進行 *host* 解析。若有給定這些應該都是相應 :mod:`socket` 模組常" "數的整數。" -#: ../../library/asyncio-eventloop.rst:457 +#: ../../library/asyncio-eventloop.rst:460 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -759,7 +766,7 @@ msgstr "" "`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒(250 毫" "秒)。" -#: ../../library/asyncio-eventloop.rst:465 +#: ../../library/asyncio-eventloop.rst:468 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -775,7 +782,7 @@ msgstr "" "族計數」。如果未指定 *happy_eyeballs_delay*,則預設值為 ``0``,如果指定則為 " "``1``。" -#: ../../library/asyncio-eventloop.rst:474 +#: ../../library/asyncio-eventloop.rst:477 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 " @@ -786,9 +793,9 @@ msgstr "" "輸使用。如果提供了 *sock*,則不應指定 *host*、*port*、*family*、*proto*、" "*flags*、*happy_eyeballs_delay*、*interleave* 和 *local_addr* 中的任何一項。" -#: ../../library/asyncio-eventloop.rst:482 -#: ../../library/asyncio-eventloop.rst:597 -#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:485 +#: ../../library/asyncio-eventloop.rst:600 +#: ../../library/asyncio-eventloop.rst:844 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -797,7 +804,7 @@ msgstr "" "引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸的 :meth:" "`~asyncio.BaseTransport.close` 方法。" -#: ../../library/asyncio-eventloop.rst:486 +#: ../../library/asyncio-eventloop.rst:489 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 " @@ -807,8 +814,8 @@ msgstr "" "地綁定 socket。將使用 ``getaddrinfo()`` 查找 *local_host* 和 *local_port*,方" "式類似於 *host* 和 *port*。" -#: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:935 +#: ../../library/asyncio-eventloop.rst:493 +#: ../../library/asyncio-eventloop.rst:938 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. " @@ -818,10 +825,10 @@ msgstr "" "在那之前若未完成則會中斷連線。如果為 ``None`` (預設值),則會等待 ``60.0`` " "秒。" -#: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:750 -#: ../../library/asyncio-eventloop.rst:852 -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:497 +#: ../../library/asyncio-eventloop.rst:753 +#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:942 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`` " @@ -830,7 +837,7 @@ msgstr "" "*ssl_shutdown_timeout* 是等待 SSL 關閉完成以前中斷連線的時間,以秒為單位。如" "果為 ``None`` (預設值),則會等待 ``30.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:498 +#: ../../library/asyncio-eventloop.rst:501 msgid "" "*all_errors* determines what exceptions are raised when a connection cannot " "be created. By default, only a single ``Exception`` is raised: the first " @@ -844,12 +851,12 @@ msgstr "" "包含所有錯誤訊息的單一 ``OSError``。當 ``all_errors`` 為 ``True`` 時,將引發" "包含所有例外的 ``ExceptionGroup`` (即使只有一個例外)。" -#: ../../library/asyncio-eventloop.rst:508 -#: ../../library/asyncio-eventloop.rst:762 +#: ../../library/asyncio-eventloop.rst:511 +#: ../../library/asyncio-eventloop.rst:765 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" -#: ../../library/asyncio-eventloop.rst:512 +#: ../../library/asyncio-eventloop.rst:515 msgid "" "The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set " "by default for all TCP connections." @@ -857,16 +864,16 @@ msgstr "" "所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY <socket-unix-constants>` " "socket 選項。" -#: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:862 +#: ../../library/asyncio-eventloop.rst:520 +#: ../../library/asyncio-eventloop.rst:865 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:521 +#: ../../library/asyncio-eventloop.rst:524 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:523 +#: ../../library/asyncio-eventloop.rst:526 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 " @@ -882,24 +889,24 @@ msgstr "" "用戶端的使用者體驗變差。本文件具體說明了減少此用戶可見延遲的演算法要求並提供" "了一種演算法。" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:535 msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:660 -#: ../../library/asyncio-eventloop.rst:776 -#: ../../library/asyncio-eventloop.rst:815 -#: ../../library/asyncio-eventloop.rst:866 -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:539 +#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:818 +#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:950 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:541 msgid "*all_errors* was added." msgstr "已新增 *all_errors*。" -#: ../../library/asyncio-eventloop.rst:543 +#: ../../library/asyncio-eventloop.rst:546 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " @@ -908,11 +915,11 @@ msgstr "" "函式 :func:`open_connection` 是高階的替代 API。它回傳一對 (:class:" "`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中使用。" -#: ../../library/asyncio-eventloop.rst:553 +#: ../../library/asyncio-eventloop.rst:556 msgid "Create a datagram connection." msgstr "建立一個資料報連線。" -#: ../../library/asyncio-eventloop.rst:555 +#: ../../library/asyncio-eventloop.rst:558 msgid "" "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 " @@ -922,13 +929,13 @@ msgstr "" "或 :py:const:`~socket.AF_UNIX`,視乎 *host*\\ (或提供的 *family* 引數)而" "定。" -#: ../../library/asyncio-eventloop.rst:559 +#: ../../library/asyncio-eventloop.rst:562 msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_DGRAM`。" -#: ../../library/asyncio-eventloop.rst:561 -#: ../../library/asyncio-eventloop.rst:686 -#: ../../library/asyncio-eventloop.rst:833 +#: ../../library/asyncio-eventloop.rst:564 +#: ../../library/asyncio-eventloop.rst:689 +#: ../../library/asyncio-eventloop.rst:836 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol <asyncio-" "protocol>` implementation." @@ -936,12 +943,12 @@ msgstr "" "*protocol_factory* 必須是可呼叫的函式,回傳 :ref:`protocol <asyncio-" "protocol>` 實作。" -#: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:567 +#: ../../library/asyncio-eventloop.rst:645 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "成功時回傳 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:568 +#: ../../library/asyncio-eventloop.rst:571 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 :" @@ -950,7 +957,7 @@ msgstr "" "*local_addr*,如果提供,是一個 ``(local_host, local_port)`` 元組,用於在本地" "綁定 socket。*local_host* 和 *local_port* 使用 :meth:`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:572 +#: ../../library/asyncio-eventloop.rst:575 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* " @@ -960,7 +967,7 @@ msgstr "" "socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使用 :meth:" "`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:579 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -971,7 +978,7 @@ msgstr "" "的可選地址家族、協定和旗標。如果提供,這些應該都是來自相應的 :mod:`socket` 模" "組常數的整數。" -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:584 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 " @@ -983,13 +990,13 @@ msgstr "" "時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定義 :py:" "const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:590 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "*allow_broadcast* 告訴核心允許此端點向廣播位址發送訊息。" -#: ../../library/asyncio-eventloop.rst:590 +#: ../../library/asyncio-eventloop.rst:593 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 " @@ -1000,7 +1007,7 @@ msgstr "" "供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須是 :const:" "`None`\\ )。" -#: ../../library/asyncio-eventloop.rst:601 +#: ../../library/asyncio-eventloop.rst:604 msgid "" "See :ref:`UDP echo client protocol <asyncio-udp-echo-client-protocol>` and :" "ref:`UDP echo server protocol <asyncio-udp-echo-server-protocol>` examples." @@ -1008,7 +1015,7 @@ msgstr "" "請參閱 :ref:`UDP 回應用戶端協議 <asyncio-udp-echo-client-protocol>` 和 :ref:" "`UDP 回應伺服器協議 <asyncio-udp-echo-server-protocol>` 範例。" -#: ../../library/asyncio-eventloop.rst:604 +#: ../../library/asyncio-eventloop.rst:607 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." @@ -1016,11 +1023,11 @@ msgstr "" "新增 *family*、*proto*、*flags*、*reuse_address*、*reuse_port*、" "*allow_broadcast* 和 *sock* 參數。" -#: ../../library/asyncio-eventloop.rst:608 +#: ../../library/asyncio-eventloop.rst:611 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:611 +#: ../../library/asyncio-eventloop.rst:614 msgid "" "The *reuse_address* parameter is no longer supported, as using :ref:`socket." "SO_REUSEADDR <socket-unix-constants>` poses a significant security concern " @@ -1029,7 +1036,7 @@ msgstr "" "不再支援 *reuse_address* 參數,因為使用 :py:const:`~sockets.SO_REUSEADDR` 對" "於 UDP 存有重大的安全疑慮。明確傳遞 ``reuse_address=True`` 將引發例外。" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:620 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " @@ -1038,7 +1045,7 @@ msgstr "" "當具有不同 UID 的多個行程使用 ``SO_REUSEADDR`` 將 socket 分配給相同的 UDP " "socket 地址時,傳入的封包可能會在 socket 之間隨機分佈。" -#: ../../library/asyncio-eventloop.rst:621 +#: ../../library/asyncio-eventloop.rst:624 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT <socket-" @@ -1049,18 +1056,18 @@ msgstr "" "*reuse_port*,將改為使用 :py:const:`~sockets.SO_REUSEPORT`,該選項明確禁止具" "有不同 UID 的行程將 socket 分配給相同的 socket 地址。" -#: ../../library/asyncio-eventloop.rst:628 +#: ../../library/asyncio-eventloop.rst:631 msgid "" "The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" "自 Python 3.9.0、3.8.1、3.7.6 和 3.6.10 起,已完全移除 *reuse_address* 參數。" -#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:640 msgid "Create a Unix connection." msgstr "建立一個 Unix 連線。" -#: ../../library/asyncio-eventloop.rst:639 +#: ../../library/asyncio-eventloop.rst:642 msgid "" "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" "py:const:`~socket.SOCK_STREAM`." @@ -1068,7 +1075,7 @@ msgstr "" "Socket 家族將為 :py:const:`~socket.AF_UNIX`;socket 類型將為 :py:const:" "`~socket.SOCK_STREAM`。" -#: ../../library/asyncio-eventloop.rst:644 +#: ../../library/asyncio-eventloop.rst:647 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:" @@ -1077,22 +1084,22 @@ msgstr "" "*path* 是 Unix 域 socket 的名稱,除非指定 *sock* 參數,否則為必填。支援抽象 " "Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路徑。" -#: ../../library/asyncio-eventloop.rst:649 +#: ../../library/asyncio-eventloop.rst:652 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" "有關此方法的引數資訊,請參閱 :meth:`loop.create_connection` 方法的文件。" -#: ../../library/asyncio-eventloop.rst:652 -#: ../../library/asyncio-eventloop.rst:806 -#: ../../library/asyncio-eventloop.rst:1249 -#: ../../library/asyncio-eventloop.rst:1782 -#: ../../library/asyncio-eventloop.rst:1789 +#: ../../library/asyncio-eventloop.rst:655 +#: ../../library/asyncio-eventloop.rst:809 +#: ../../library/asyncio-eventloop.rst:1258 +#: ../../library/asyncio-eventloop.rst:1791 +#: ../../library/asyncio-eventloop.rst:1798 msgid "Availability" msgstr "" -#: ../../library/asyncio-eventloop.rst:654 +#: ../../library/asyncio-eventloop.rst:657 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." @@ -1100,11 +1107,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是 :term:`path-like " "object`。" -#: ../../library/asyncio-eventloop.rst:664 +#: ../../library/asyncio-eventloop.rst:667 msgid "Creating network servers" msgstr "建立網路伺服器" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:682 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." @@ -1112,33 +1119,33 @@ msgstr "" "建立一個 TCP 伺服器(socket 類型 :const:`~socket.SOCK_STREAM`\\ ),監聽 " "*host* 位址的 *port*。" -#: ../../library/asyncio-eventloop.rst:682 +#: ../../library/asyncio-eventloop.rst:685 msgid "Returns a :class:`Server` object." msgstr "回傳一個 :class:`Server` 物件。" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:687 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:689 +#: ../../library/asyncio-eventloop.rst:692 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "可以將 *host* 參數設為幾種類型,以確定伺服器將監聽的位置:" -#: ../../library/asyncio-eventloop.rst:692 +#: ../../library/asyncio-eventloop.rst:695 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "如果 *host* 是字串,則 TCP 伺服器綁定到由 *host* 指定的單個網路介面。" -#: ../../library/asyncio-eventloop.rst:695 +#: ../../library/asyncio-eventloop.rst:698 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "如果 *host* 是字串序列,則 TCP 伺服器綁定到序列指定的所有網路介面。" -#: ../../library/asyncio-eventloop.rst:698 +#: ../../library/asyncio-eventloop.rst:701 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 " @@ -1147,7 +1154,7 @@ msgstr "" "若 *host* 是空字串或 ``None``,則所有介面都被假定並回傳多個 socket 的清單(可" "能一個用於 IPv4,另一個用於 IPv6)。" -#: ../../library/asyncio-eventloop.rst:702 +#: ../../library/asyncio-eventloop.rst:705 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 " @@ -1158,7 +1165,7 @@ msgstr "" "設值),將隨機選擇一個未使用的埠(請注意,如果 *host* 解析為多個網路介面,將" "為每個介面隨機選擇不同的隨機埠)。" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:710 msgid "" "*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* " @@ -1168,11 +1175,11 @@ msgstr "" "制使用 IPv4 或 IPv6。如果未設定,*family* 將從主機名稱決定(預設為 :const:" "`~socket.AF_UNSPEC`\\ )。" -#: ../../library/asyncio-eventloop.rst:712 +#: ../../library/asyncio-eventloop.rst:715 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "*flags* 是 :meth:`getaddrinfo` 的位元遮罩。" -#: ../../library/asyncio-eventloop.rst:714 +#: ../../library/asyncio-eventloop.rst:717 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." @@ -1180,7 +1187,7 @@ msgstr "" "可以可選地指定 *sock* 以使用現有的 socket 物件。如果指定了,*host* 和 *port* " "不能指定。" -#: ../../library/asyncio-eventloop.rst:719 +#: ../../library/asyncio-eventloop.rst:722 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." @@ -1188,7 +1195,7 @@ msgstr "" "*sock* 引數將 socket 的所有權轉移給建立的伺服器。要關閉 socket,請呼叫伺服器" "的 :meth:`~asyncio.Server.close` 方法。" -#: ../../library/asyncio-eventloop.rst:723 +#: ../../library/asyncio-eventloop.rst:726 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." @@ -1196,14 +1203,14 @@ msgstr "" "*backlog* 是傳遞給 :meth:`~socket.socket.listen` 的最大佇列連線數(預設為 " "100)。" -#: ../../library/asyncio-eventloop.rst:726 +#: ../../library/asyncio-eventloop.rst:729 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" "*ssl* 可以設定為 :class:`~ssl.SSLContext` 實例以在接受的連線上啟用 TLS。" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:732 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 " @@ -1212,7 +1219,7 @@ msgstr "" "*reuse_address* 告訴內核重用 ``TIME_WAIT`` 狀態下的本地 socket,而不等待其自" "然超時過期。如果未指定,在 Unix 上將自動設置為 ``True``。" -#: ../../library/asyncio-eventloop.rst:734 +#: ../../library/asyncio-eventloop.rst:737 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 " @@ -1221,18 +1228,18 @@ msgstr "" "*reuse_port* 告訴內核允許此端點繫結到與其他現有端點繫結的相同埠,只要它們在建" "立時都設置了此旗標。此選項在旗標 Windows 上不受支援。" -#: ../../library/asyncio-eventloop.rst:739 +#: ../../library/asyncio-eventloop.rst:742 msgid "" "*keep_alive* set to ``True`` keeps connections active by enabling the " "periodic transmission of messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:744 +#: ../../library/asyncio-eventloop.rst:747 #, fuzzy msgid "Added the *keep_alive* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:746 +#: ../../library/asyncio-eventloop.rst:749 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`` " @@ -1241,7 +1248,7 @@ msgstr "" "(對於 TLS 伺服器)\\ *ssl_handshake_timeout* 是在中斷連線之前等待 TLS 握手完" "成的時間(以秒為單位)。如果為 ``None``\\ (預設),則為 ``60.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:754 +#: ../../library/asyncio-eventloop.rst:757 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1252,11 +1259,11 @@ msgstr "" "接。當設置為 ``False`` 時,用戶應該等待 :meth:`Server.start_serving` 或 :" "meth:`Server.serve_forever` 來使伺服器開始接受連線。" -#: ../../library/asyncio-eventloop.rst:766 +#: ../../library/asyncio-eventloop.rst:769 msgid "The *host* parameter can be a sequence of strings." msgstr "*host* 參數可以是字串序列。" -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:773 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default " @@ -1265,7 +1272,7 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" "ref:`socket.TCP_NODELAY <socket-unix-constants>` socket 選項。" -#: ../../library/asyncio-eventloop.rst:780 +#: ../../library/asyncio-eventloop.rst:783 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " @@ -1274,7 +1281,7 @@ msgstr "" ":func:`start_server` 函式是一個更高階的替代 API,它回傳一對 :class:" "`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼中使用。" -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:794 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." @@ -1282,7 +1289,7 @@ msgstr "" "類似 :meth:`loop.create_server`,但適用於 :py:const:`~socket.AF_UNIX` socket " "家族。" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:797 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`, " @@ -1292,20 +1299,20 @@ msgstr "" "象 Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路" "徑。" -#: ../../library/asyncio-eventloop.rst:799 +#: ../../library/asyncio-eventloop.rst:802 msgid "" "If *cleanup_socket* is true then the Unix socket will automatically be " "removed from the filesystem when the server is closed, unless the socket has " "been replaced after the server has been created." msgstr "" -#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:806 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "有關此方法的引數資訊,請參閱 :meth:`loop.create_server` 方法的文件。" -#: ../../library/asyncio-eventloop.rst:810 +#: ../../library/asyncio-eventloop.rst:813 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1313,27 +1320,27 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可為一" "個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:819 +#: ../../library/asyncio-eventloop.rst:822 #, fuzzy msgid "Added the *cleanup_socket* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:826 +#: ../../library/asyncio-eventloop.rst:829 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "將已接受的連線包裝成傳輸層/協議對。" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:831 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "此方法可以由在 asyncio 外接受連線但使用 asyncio 處理連線的伺服器使用。" -#: ../../library/asyncio-eventloop.rst:831 -#: ../../library/asyncio-eventloop.rst:921 +#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:924 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:839 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "<socket.socket.accept>`." @@ -1341,13 +1348,13 @@ msgstr "" "*sock* 是從 :meth:`socket.accept <socket.socket.accept>` 回傳的預先存在的 " "socket 物件。" -#: ../../library/asyncio-eventloop.rst:845 +#: ../../library/asyncio-eventloop.rst:848 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "*ssl* 可以設置為 :class:`~ssl.SSLContext` 以在已接受的連線上啟用 SSL。" -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:851 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. " @@ -1356,29 +1363,29 @@ msgstr "" "(對於 SSL 連線)\\ *ssl_handshake_timeout* 是在中斷連線之前等待 SSL 握手完成" "的時間(以秒為單位)。如果為 ``None``\\ (預設),則為 ``60.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:856 +#: ../../library/asyncio-eventloop.rst:859 msgid "Returns a ``(transport, protocol)`` pair." msgstr "回傳 ``(transport, protocol)`` 對。" -#: ../../library/asyncio-eventloop.rst:870 +#: ../../library/asyncio-eventloop.rst:873 msgid "Transferring files" msgstr "傳輸檔案" -#: ../../library/asyncio-eventloop.rst:875 +#: ../../library/asyncio-eventloop.rst:878 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "通過 *transport* 發送 *file*。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:878 +#: ../../library/asyncio-eventloop.rst:881 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "如果可用,該方法使用高性能 :meth:`os.sendfile`。" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:883 msgid "*file* must be a regular file object opened in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:882 -#: ../../library/asyncio-eventloop.rst:1127 +#: ../../library/asyncio-eventloop.rst:885 +#: ../../library/asyncio-eventloop.rst:1136 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 " @@ -1390,7 +1397,7 @@ msgstr "" "不是發送檔案直到達到 EOF。即使此方法引發錯誤時,檔案位置也始終更新,可以使" "用 :meth:`file.tell() <io.IOBase.tell>` 取得實際發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:892 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 " @@ -1399,7 +1406,7 @@ msgstr "" "將 *fallback* 設置為 ``True`` 會使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:893 +#: ../../library/asyncio-eventloop.rst:896 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." @@ -1407,15 +1414,15 @@ msgstr "" "如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引發 :exc:" "`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:900 +#: ../../library/asyncio-eventloop.rst:903 msgid "TLS Upgrade" msgstr "TLS 升級" -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:910 msgid "Upgrade an existing transport-based connection to TLS." msgstr "將基於傳輸的現有連線升級到 TLS。" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:912 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " @@ -1424,7 +1431,7 @@ msgstr "" "建立 TLS 編解碼器實例並在 *transport* 和 *protocol* 之間插入它。編解碼器既實" "作了對於 *transport* 的協議,也實作了對於 *protocol* 的傳輸。" -#: ../../library/asyncio-eventloop.rst:913 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1435,13 +1442,13 @@ msgstr "" "*transport*,僅與回傳的物件通信,因為編碼器快取了 *protocol* 端的資料,並且" "與 *transport* 間歇性地交換額外的 TLS session 封包。" -#: ../../library/asyncio-eventloop.rst:918 +#: ../../library/asyncio-eventloop.rst:921 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "在某些情況下(例如傳入的傳輸已經關閉),此函式可能回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:923 +#: ../../library/asyncio-eventloop.rst:926 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." @@ -1449,11 +1456,11 @@ msgstr "" "*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` 和 :meth:" "`~loop.create_connection` 等方法回傳。" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:930 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "*sslcontext*:配置好的 :class:`~ssl.SSLContext` 實例。" -#: ../../library/asyncio-eventloop.rst:929 +#: ../../library/asyncio-eventloop.rst:932 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." @@ -1461,17 +1468,17 @@ msgstr "" "當升級伺服器端連線時(像由 :meth:`~loop.create_server` 建立的那樣)傳遞 " "``True``。" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:935 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "*server_hostname*:設置或覆蓋將用於匹配目標伺服器憑證的主機名。" -#: ../../library/asyncio-eventloop.rst:952 +#: ../../library/asyncio-eventloop.rst:955 msgid "Watching file descriptors" msgstr "監視檔案描述器" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:959 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." @@ -1479,7 +1486,14 @@ msgstr "" "開始監視 *fd* 檔案描述器的讀取可用性,一但 *fd* 可讀取,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:962 +#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:977 +msgid "" +"Any preexisting callback registered for *fd* is cancelled and replaced by " +"*callback*." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:968 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." @@ -1487,7 +1501,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的讀取可用性。如果 *fd* 之前正在監視讀取,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:967 +#: ../../library/asyncio-eventloop.rst:973 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." @@ -1495,8 +1509,8 @@ msgstr "" "開始監視 *fd* 檔案描述器的寫入可用性,一旦 *fd* 可寫入,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:971 -#: ../../library/asyncio-eventloop.rst:1236 +#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:1245 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-" "keywords>` to *callback*." @@ -1504,7 +1518,7 @@ msgstr "" "使用 :func:`functools.partial` 向 *callback* :ref:`傳送關鍵字引數 <asyncio-" "pass-keywords>`。" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:985 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." @@ -1512,7 +1526,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的寫入可用性。如果 *fd* 之前正在監視寫入,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:988 msgid "" "See also :ref:`Platform Support <asyncio-platform-support>` section for some " "limitations of these methods." @@ -1520,11 +1534,11 @@ msgstr "" "另請參閱\\ :ref:`平台支援 <asyncio-platform-support>`\\ 部分以了解這些方法的" "一些限制。" -#: ../../library/asyncio-eventloop.rst:984 +#: ../../library/asyncio-eventloop.rst:993 msgid "Working with socket objects directly" msgstr "直接使用 socket 物件" -#: ../../library/asyncio-eventloop.rst:986 +#: ../../library/asyncio-eventloop.rst:995 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1536,7 +1550,7 @@ msgstr "" "`loop.create_server`\\ )的協議實作比直接使用 socket 的實作更快。然而在某些情" "況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" -#: ../../library/asyncio-eventloop.rst:995 +#: ../../library/asyncio-eventloop.rst:1004 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() <socket.socket.recv>`." @@ -1544,23 +1558,23 @@ msgstr "" "從 *sock* 接收最多 *nbytes*。:meth:`socket.recv() <socket.socket.recv>` 的非" "同步版本。" -#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1007 msgid "Return the received data as a bytes object." msgstr "將接收到的資料作為 bytes 物件回傳。" -#: ../../library/asyncio-eventloop.rst:1000 -#: ../../library/asyncio-eventloop.rst:1014 -#: ../../library/asyncio-eventloop.rst:1025 -#: ../../library/asyncio-eventloop.rst:1037 -#: ../../library/asyncio-eventloop.rst:1052 -#: ../../library/asyncio-eventloop.rst:1067 -#: ../../library/asyncio-eventloop.rst:1077 -#: ../../library/asyncio-eventloop.rst:1103 -#: ../../library/asyncio-eventloop.rst:1141 +#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1034 +#: ../../library/asyncio-eventloop.rst:1046 +#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1076 +#: ../../library/asyncio-eventloop.rst:1086 +#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1150 msgid "*sock* must be a non-blocking socket." msgstr "*sock* 必須是非阻塞 socket。" -#: ../../library/asyncio-eventloop.rst:1002 +#: ../../library/asyncio-eventloop.rst:1011 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 " @@ -1569,7 +1583,7 @@ msgstr "" "儘管此方法一直記錄為協程方法,但 Python 3.7 之前的版本回傳 :class:`Future`。" "自 Python 3.7 起,這是 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1018 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() <socket.socket.recv_into>` method." @@ -1577,11 +1591,11 @@ msgstr "" "從 *sock* 接收資料到 *buf* 緩衝區。仿照阻塞 :meth:`socket.recv_into() " "<socket.socket.recv_into>` 方法。" -#: ../../library/asyncio-eventloop.rst:1012 +#: ../../library/asyncio-eventloop.rst:1021 msgid "Return the number of bytes written to the buffer." msgstr "回傳寫入緩衝區位元組的數目。" -#: ../../library/asyncio-eventloop.rst:1020 +#: ../../library/asyncio-eventloop.rst:1029 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() <socket.socket.recvfrom>`." @@ -1589,11 +1603,11 @@ msgstr "" "從 *sock* 接收最多 *bufsize* 大小的資料單元。:meth:`socket.recvfrom() " "<socket.socket.recvfrom>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1032 msgid "Return a tuple of (received data, remote address)." msgstr "回傳一個元組 (received data, remote address)。" -#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1040 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() <socket.socket.recvfrom_into>`." @@ -1601,11 +1615,11 @@ msgstr "" "從 *sock* 接收最多 *nbytes* 大小的資料單元到 *buf*。:meth:`socket." "recvfrom_into() <socket.socket.recvfrom_into>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1044 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "回傳一個元組 (number of bytes received, remote address)。" -#: ../../library/asyncio-eventloop.rst:1043 +#: ../../library/asyncio-eventloop.rst:1052 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() <socket.socket.sendall>`." @@ -1613,7 +1627,7 @@ msgstr "" "將 *data* 發送到 *sock* socket。:meth:`socket.sendall() <socket.socket." "sendall>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1046 +#: ../../library/asyncio-eventloop.rst:1055 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 " @@ -1625,8 +1639,8 @@ msgstr "" "回傳 ``None``。錯誤時引發例外。此外,沒有辦法確定接收端成功處理了多少資料(如" "果有的話)。" -#: ../../library/asyncio-eventloop.rst:1054 -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:1063 +#: ../../library/asyncio-eventloop.rst:1114 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 " @@ -1635,7 +1649,7 @@ msgstr "" "儘管該方法一直被記錄為協程方法,但在 Python 3.7 之前它回傳 :class:`Future`。" "從 Python 3.7 開始,這是一個 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1070 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() <socket.socket.sendto>`." @@ -1643,20 +1657,20 @@ msgstr "" "從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() <socket." "socket.sendto>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1074 msgid "Return the number of bytes sent." msgstr "回傳發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1082 msgid "Connect *sock* to a remote socket at *address*." msgstr "將 *sock* 連線到位於 *address* 的遠端 socket。" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1084 msgid "" "Asynchronous version of :meth:`socket.connect() <socket.socket.connect>`." msgstr ":meth:`socket.connect() <socket.socket.connect>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1079 +#: ../../library/asyncio-eventloop.rst:1088 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1667,7 +1681,7 @@ msgstr "" "inet_pton` 檢查 *address* 是否已解析。如果沒有,將使用 :meth:`loop." "getaddrinfo` 解析 *address*。" -#: ../../library/asyncio-eventloop.rst:1088 +#: ../../library/asyncio-eventloop.rst:1097 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "<open_connection>`." @@ -1675,7 +1689,7 @@ msgstr "" ":meth:`loop.create_connection` 和 :func:`asyncio.open_connection() " "<open_connection>`。" -#: ../../library/asyncio-eventloop.rst:1094 +#: ../../library/asyncio-eventloop.rst:1103 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "<socket.socket.accept>` method." @@ -1683,7 +1697,7 @@ msgstr "" "接受一個連線。模擬阻塞的 :meth:`socket.accept() <socket.socket.accept>` 方" "法。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1106 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 " @@ -1694,34 +1708,34 @@ msgstr "" "中 *conn* 是一個 *新* socket 物件,可在連線上發送和接收資料,*address* 是連接" "另一端對應的 socket 地址。" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1121 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`。" -#: ../../library/asyncio-eventloop.rst:1117 +#: ../../library/asyncio-eventloop.rst:1126 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" "如果可行,使用高性能 :mod:`os.sendfile` 發送檔案。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:1120 +#: ../../library/asyncio-eventloop.rst:1129 msgid "" "Asynchronous version of :meth:`socket.sendfile() <socket.socket.sendfile>`." msgstr ":meth:`socket.sendfile() <socket.socket.sendfile>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1122 +#: ../../library/asyncio-eventloop.rst:1131 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" "*sock* 必須是非阻塞的 :const:`socket.SOCK_STREAM` :class:`~socket.socket`。" -#: ../../library/asyncio-eventloop.rst:1125 +#: ../../library/asyncio-eventloop.rst:1134 msgid "*file* must be a regular file object open in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:1134 +#: ../../library/asyncio-eventloop.rst:1143 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 " @@ -1730,7 +1744,7 @@ msgstr "" "當設置為 ``True`` 時,*fallback* 使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1147 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." @@ -1738,19 +1752,19 @@ msgstr "" "如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引發 :exc:" "`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1156 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1152 +#: ../../library/asyncio-eventloop.rst:1161 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr ":meth:`socket.getaddrinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1165 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr ":meth:`socket.getnameinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1159 +#: ../../library/asyncio-eventloop.rst:1168 msgid "" "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " "versions through the loop's default thread pool executor. When this executor " @@ -1760,7 +1774,7 @@ msgid "" "executor with a larger number of workers." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1175 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1771,19 +1785,19 @@ msgstr "" "它們實際上回傳 :class:`asyncio.Future` 物件。從 Python 3.7 開始,兩個方法都是" "協程。" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1183 msgid "Working with pipes" msgstr "使用管道" -#: ../../library/asyncio-eventloop.rst:1178 +#: ../../library/asyncio-eventloop.rst:1187 msgid "Register the read end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的讀取端。" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1192 msgid "*pipe* is a :term:`file-like object <file object>`." msgstr "*pipe* 是 :term:`類檔案物件 <file object>`。" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1194 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " @@ -1792,22 +1806,22 @@ msgstr "" "回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" "`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1189 -#: ../../library/asyncio-eventloop.rst:1205 +#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1214 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "使用 :class:`SelectorEventLoop` 事件迴圈時,*pipe* 設置為非阻塞模式。" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1203 msgid "Register the write end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的寫入端。" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1208 msgid "*pipe* is :term:`file-like object <file object>`." msgstr "*pipe* 是 :term:`file-like object <file object>`。" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:1210 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " @@ -1816,7 +1830,7 @@ msgstr "" "回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" "`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1219 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." @@ -1824,20 +1838,20 @@ msgstr "" ":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使用 :" "class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1215 +#: ../../library/asyncio-eventloop.rst:1224 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr ":meth:`loop.subprocess_exec` 和 :meth:`loop.subprocess_shell` 方法。" -#: ../../library/asyncio-eventloop.rst:1220 +#: ../../library/asyncio-eventloop.rst:1229 msgid "Unix signals" msgstr "Unix 訊號" -#: ../../library/asyncio-eventloop.rst:1226 +#: ../../library/asyncio-eventloop.rst:1235 msgid "Set *callback* as the handler for the *signum* signal." msgstr "將 *callback* 設置為 *signum* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1228 +#: ../../library/asyncio-eventloop.rst:1237 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1848,7 +1862,7 @@ msgstr "" "用 :func:`signal.signal` 註冊的訊號處理程式不同,使用此函式註冊的回呼允許與事" "件迴圈進行互動。" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1242 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." @@ -1856,16 +1870,16 @@ msgstr "" "如果訊號號無效或不可捕獲,引發 :exc:`ValueError`。如果設定處理程序有問題,拋" "出 :exc:`RuntimeError`。" -#: ../../library/asyncio-eventloop.rst:1239 +#: ../../library/asyncio-eventloop.rst:1248 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "像 :func:`signal.signal` 一樣,此函式必須在主執行緒中呼叫。" -#: ../../library/asyncio-eventloop.rst:1244 +#: ../../library/asyncio-eventloop.rst:1253 msgid "Remove the handler for the *sig* signal." msgstr "移除 *sig* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1246 +#: ../../library/asyncio-eventloop.rst:1255 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." @@ -1873,19 +1887,19 @@ msgstr "" "如果訊號處理程式被移除,回傳 ``True``;如果給定訊號沒有設置處理程式,回傳 " "``False``。" -#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1262 msgid "The :mod:`signal` module." msgstr ":mod:`signal` 模組。" -#: ../../library/asyncio-eventloop.rst:1257 +#: ../../library/asyncio-eventloop.rst:1266 msgid "Executing code in thread or process pools" msgstr "在執行緒池或行程池中執行程式碼" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1270 msgid "Arrange for *func* to be called in the specified executor." msgstr "安排在指定的執行器中呼叫 *func*。" -#: ../../library/asyncio-eventloop.rst:1263 +#: ../../library/asyncio-eventloop.rst:1272 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``. The " @@ -1894,7 +1908,7 @@ msgid "" "and used by :func:`run_in_executor` if needed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1280 msgid "" "import asyncio\n" "import concurrent.futures\n" @@ -1937,7 +1951,7 @@ msgid "" " asyncio.run(main())" msgstr "" -#: ../../library/asyncio-eventloop.rst:1311 +#: ../../library/asyncio-eventloop.rst:1320 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1949,11 +1963,11 @@ msgstr "" "== '__main__'``\\ )。請參閱\\ :ref:`主模組的安全引入 <multiprocessing-safe-" "main-import>`。" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1325 msgid "This method returns a :class:`asyncio.Future` object." msgstr "此方法回傳 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1327 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-" "keywords>` to *func*." @@ -1961,7 +1975,7 @@ msgstr "" "使用 :func:`functools.partial` 將來\\ :ref:`關鍵字引數傳遞 <asyncio-pass-" "keywords>`\\ 給 *func*。" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1330 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 " @@ -1972,7 +1986,7 @@ msgstr "" "``max_workers``,而是讓執行緒池執行器(\\ :class:`~concurrent.futures." "ThreadPoolExecutor`)設定預設值。" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1339 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." @@ -1981,26 +1995,26 @@ msgstr "" "將 *executor* 設置為 :meth:`run_in_executor` 使用的預設執行器。*executor* 必" "須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1343 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" "*executor* 必須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1349 msgid "Error Handling API" msgstr "錯誤處理 API" -#: ../../library/asyncio-eventloop.rst:1342 +#: ../../library/asyncio-eventloop.rst:1351 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "允許自定義事件迴圈中的例外處理方式。" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1355 msgid "Set *handler* as the new event loop exception handler." msgstr "將 *handler* 設定為新的事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1348 +#: ../../library/asyncio-eventloop.rst:1357 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -2013,7 +2027,7 @@ msgstr "" "圈的,``context`` 是包含例外詳細資訊的 ``dict`` 物件(有關情境的詳細資訊,請" "參閱 :meth:`call_exception_handler` 文件)。" -#: ../../library/asyncio-eventloop.rst:1356 +#: ../../library/asyncio-eventloop.rst:1365 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " @@ -2022,7 +2036,7 @@ msgstr "" "如果代表 :class:`~asyncio.Task` 或 :class:`~asyncio.Handle` 呼叫處理程式,它" "將在該任務或回呼處理程式的 :class:`contextvars.Context` 中運行。" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1371 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." @@ -2030,18 +2044,18 @@ msgstr "" "處理程式可能在引發例外的任務或處理程式的 :class:`~contextvars.Context` 中被呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" "回傳當前的例外處理程式,如果未設置自定義例外處理程式,則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:1374 +#: ../../library/asyncio-eventloop.rst:1383 msgid "Default exception handler." msgstr "預設例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1385 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 " @@ -2050,17 +2064,17 @@ msgstr "" "當發生例外且未設置例外處理程式時呼叫此函式。自定義例外處理程式可以呼叫此函式" "以轉由預設處理程式處理。" -#: ../../library/asyncio-eventloop.rst:1380 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "*context* 參數與 :meth:`call_exception_handler` 中的意思相同。" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1394 msgid "Call the current event loop exception handler." msgstr "呼叫當前事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1396 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" @@ -2068,47 +2082,47 @@ msgstr "" "*context* 是一個包含以下鍵的 ``dict`` 物件(未來的 Python 版本中可能會引入新" "的鍵):" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1399 msgid "'message': Error message;" msgstr "'message':錯誤訊息;" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1400 msgid "'exception' (optional): Exception object;" msgstr "'exception'(可選):例外物件;" -#: ../../library/asyncio-eventloop.rst:1392 +#: ../../library/asyncio-eventloop.rst:1401 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future'(可選): :class:`asyncio.Future` 實例;" -#: ../../library/asyncio-eventloop.rst:1393 +#: ../../library/asyncio-eventloop.rst:1402 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "'task'(可選): :class:`asyncio.Task` 實例;" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1403 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "'handle'(可選): :class:`asyncio.Handle` 實例;" -#: ../../library/asyncio-eventloop.rst:1395 +#: ../../library/asyncio-eventloop.rst:1404 msgid "'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;" msgstr "'protocol'(可選): :ref:`Protocol <asyncio-protocol>` 實例;" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1405 msgid "'transport' (optional): :ref:`Transport <asyncio-transport>` instance;" msgstr "'transport'(可選): :ref:`Transport <asyncio-transport>` 實例;" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1406 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "'socket'(可選): :class:`socket.socket` 實例;" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1407 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "'asyncgen'(可選): 非同步產生器引發" -#: ../../library/asyncio-eventloop.rst:1399 +#: ../../library/asyncio-eventloop.rst:1408 msgid "the exception." msgstr "例外。" -#: ../../library/asyncio-eventloop.rst:1403 +#: ../../library/asyncio-eventloop.rst:1412 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." @@ -2116,15 +2130,15 @@ msgstr "" "此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使用 :meth:" "`set_exception_handler` 方法。" -#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1417 msgid "Enabling debug mode" msgstr "啟用除錯模式" -#: ../../library/asyncio-eventloop.rst:1412 +#: ../../library/asyncio-eventloop.rst:1421 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "取得事件迴圈的除錯模式(\\ :class:`bool`\\ )。" -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." @@ -2132,17 +2146,17 @@ msgstr "" "如果環境變數 :envvar:`PYTHONASYNCIODEBUG` 被設定為非空字串,則預設值為 " "``True``,否則為 ``False``。" -#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1429 msgid "Set the debug mode of the event loop." msgstr "設定事件迴圈的除錯模式。" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1433 msgid "" "The new :ref:`Python Development Mode <devmode>` can now also be used to " "enable the debug mode." msgstr "現在也可以使用新的 :ref:`Python 開發模式 <devmode>` 啟用除錯模式。" -#: ../../library/asyncio-eventloop.rst:1429 +#: ../../library/asyncio-eventloop.rst:1438 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " @@ -2151,19 +2165,19 @@ msgstr "" "此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式" "後,\"慢\"回呼將被記錄。" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1442 msgid "Default value is 100 milliseconds." msgstr "預設值為 100 毫秒" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1446 msgid "The :ref:`debug mode of asyncio <asyncio-debug-mode>`." msgstr ":ref:`asyncio 的除錯模式 <asyncio-debug-mode>`。" -#: ../../library/asyncio-eventloop.rst:1441 +#: ../../library/asyncio-eventloop.rst:1450 msgid "Running Subprocesses" msgstr "運行子行程" -#: ../../library/asyncio-eventloop.rst:1443 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " @@ -2173,7 +2187,7 @@ msgstr "" "func:`asyncio.create_subprocess_shell` 和 :func:`asyncio." "create_subprocess_exec` 輔助功能而不是。" -#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1459 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" @@ -2183,26 +2197,26 @@ msgstr "" "`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行程的支援 " "<asyncio-windows-subprocess>`。" -#: ../../library/asyncio-eventloop.rst:1461 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "從 *args* 指定的一個或多個字串引數建立子行程。" -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1473 msgid "*args* must be a list of strings represented by:" msgstr "*args* 必須是由以下項表示的字串串列:" -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1475 msgid ":class:`str`;" msgstr ":class:`str`;" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1476 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding <filesystem-" "encoding>`." msgstr "或 :class:`bytes`,編碼為 :ref:`檔案系統編碼 <filesystem-encoding>`。" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " @@ -2211,7 +2225,7 @@ msgstr "" "第一個字串指定程序可執行檔案,其餘字串指定引數。字串引數一起組成程序的 " "``argv``。" -#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1483 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 " @@ -2222,7 +2236,7 @@ msgstr "" "字串串列作為第一個引數傳遞;然而,:class:`~subprocess.Popen` 接受單個字串串列" "引數,*subprocess_exec* 接受多個字串引數。" -#: ../../library/asyncio-eventloop.rst:1480 +#: ../../library/asyncio-eventloop.rst:1489 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." @@ -2230,67 +2244,67 @@ msgstr "" "*protocol_factory* 必須是回傳 :class:`asyncio.SubprocessProtocol` 子類別的可" "呼叫物件。" -#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1492 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1485 +#: ../../library/asyncio-eventloop.rst:1494 msgid "*stdin* can be any of these:" msgstr "*stdin* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1487 -#: ../../library/asyncio-eventloop.rst:1498 -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1517 msgid "a file-like object" msgstr "類檔案物件" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1497 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe`" msgstr "現有的檔案描述器(正整數),例如用 :meth:`os.pipe` 建立的" -#: ../../library/asyncio-eventloop.rst:1489 -#: ../../library/asyncio-eventloop.rst:1499 -#: ../../library/asyncio-eventloop.rst:1509 +#: ../../library/asyncio-eventloop.rst:1498 +#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1518 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr ":const:`subprocess.PIPE` 常數(預設),它將建立一個新的管道並連線," -#: ../../library/asyncio-eventloop.rst:1491 -#: ../../library/asyncio-eventloop.rst:1501 -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1520 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "值 ``None`` 將使子行程從此行程繼承檔案描述器" -#: ../../library/asyncio-eventloop.rst:1493 -#: ../../library/asyncio-eventloop.rst:1503 -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1502 +#: ../../library/asyncio-eventloop.rst:1512 +#: ../../library/asyncio-eventloop.rst:1522 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" ":const:`subprocess.DEVNULL` 常數,表示將使用特殊的 :data:`os.devnull` 檔案" -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1505 msgid "*stdout* can be any of these:" msgstr "*stdout* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1506 +#: ../../library/asyncio-eventloop.rst:1515 msgid "*stderr* can be any of these:" msgstr "*stderr* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1515 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" ":const:`subprocess.STDOUT` 常數,它將標準錯誤串流連線到行程的標準輸出串流" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " @@ -2300,7 +2314,7 @@ msgstr "" "*bufsize*、*universal_newlines*、*shell*、*text*、*encoding* 和 *errors* 除" "外,這些不應該指定。" -#: ../../library/asyncio-eventloop.rst:1523 +#: ../../library/asyncio-eventloop.rst:1532 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 " @@ -2309,7 +2323,7 @@ msgstr "" "``asyncio`` 子行程 API 不支援將串流解碼為文本。可以使用 :func:`bytes.decode` " "將從串流回傳的位元組轉換為文本。" -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1536 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -2320,13 +2334,13 @@ msgstr "" "端應該使用 :meth:`~loop.connect_write_pipe` 或 :meth:`~loop." "connect_read_pipe` 註冊到事件迴圈中。" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1541 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "有關其他引數的文件,請參閱 :class:`subprocess.Popen` 類別的建構函式。" -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1544 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " @@ -2336,7 +2350,7 @@ msgstr "" "SubprocessTransport` 基底類別,*protocol* 是由 *protocol_factory* 實例化的物" "件。" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1552 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding <filesystem-" @@ -2345,7 +2359,7 @@ msgstr "" "使用平台的 “shell” 語法從 *cmd* 建立子行程,*cmd* 可以是 :class:`str` 或編碼" "為 :ref:`檔案系統編碼 <filesystem-encoding>` 的 :class:`bytes` 字串。" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1557 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2353,7 +2367,7 @@ msgstr "" "這類似於標準函式庫中的 :class:`subprocess.Popen` 類別,使用 ``shell=True`` 呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." @@ -2361,13 +2375,13 @@ msgstr "" "*protocol_factory* 必須是回傳 :class:`SubprocessProtocol` 子類別的可呼叫物" "件。" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "有關其餘引數的更多詳細資訊,請參閱 :meth:`~loop.subprocess_exec`。" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1566 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " @@ -2377,7 +2391,7 @@ msgstr "" "`SubprocessTransport` 基底類別,而 *protocol* 是由 *protocol_factory* 實例化" "的物件。" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2390,11 +2404,11 @@ msgstr "" "wikipedia.org/wiki/Shell_injection#Shell_injection>`_\\ 風險。可以使用 :func:" "`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊字元。" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1580 msgid "Callback Handles" msgstr "回呼處理" -#: ../../library/asyncio-eventloop.rst:1575 +#: ../../library/asyncio-eventloop.rst:1584 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." @@ -2402,46 +2416,46 @@ msgstr "" "由 :meth:`loop.call_soon` 和 :meth:`loop.call_soon_threadsafe` 回傳的回呼包裝" "器。" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1589 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "回傳與處理相關聯的 :class:`contextvars.Context` 物件。" -#: ../../library/asyncio-eventloop.rst:1587 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "取消回呼。如果回呼已被取消或執行,此方法將不起作用。" -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:1601 msgid "Return ``True`` if the callback was cancelled." msgstr "如果回呼已被取消,回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1598 +#: ../../library/asyncio-eventloop.rst:1607 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "由 :meth:`loop.call_later` 和 :meth:`loop.call_at` 回傳的回呼包裝器。" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1610 msgid "This class is a subclass of :class:`Handle`." msgstr "這個類別是 :class:`Handle` 的子類別。" -#: ../../library/asyncio-eventloop.rst:1605 +#: ../../library/asyncio-eventloop.rst:1614 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "回傳預定的回呼時間,以 :class:`float` 秒為單位。" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1616 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "時間是一個絕對的時間戳,使用與 :meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:1614 +#: ../../library/asyncio-eventloop.rst:1623 msgid "Server Objects" msgstr "Server 物件" -#: ../../library/asyncio-eventloop.rst:1616 +#: ../../library/asyncio-eventloop.rst:1625 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " @@ -2451,11 +2465,11 @@ msgstr "" "create_unix_server`、:func:`start_server` 和 :func:`start_unix_server` 函式所" "建立。" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1629 msgid "Do not instantiate the :class:`Server` class directly." msgstr "請勿直接實例化 :class:`Server` 類別。" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1633 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 " @@ -2464,7 +2478,7 @@ msgstr "" "*Server* 物件是非同步情境管理器。當在 ``async with`` 陳述中使用時,可以保證在" "完成 ``async with`` 陳述時,Server 物件將會關閉並停止接受新的連線: ::" -#: ../../library/asyncio-eventloop.rst:1629 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2474,30 +2488,30 @@ msgid "" "# At this point, srv is closed and no longer accepts new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1637 +#: ../../library/asyncio-eventloop.rst:1646 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "自 Python 3.7 起,Server 物件是非同步情境管理器。" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1649 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" "此類別在 Python 3.9.11、3.10.3 和 3.11 中以 ``asyncio.Server`` 的形式被公開。" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1654 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "停止服務:關閉監聽的 sockets 並將 :attr:`sockets` 屬性設為 ``None``。" -#: ../../library/asyncio-eventloop.rst:1648 +#: ../../library/asyncio-eventloop.rst:1657 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1651 +#: ../../library/asyncio-eventloop.rst:1660 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." @@ -2505,54 +2519,54 @@ msgstr "" "伺服器以非同步方式關閉;使用 :meth:`wait_close` 協程等待伺服器關閉(不再有活" "躍連線)。" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1666 #, fuzzy msgid "Close all existing incoming client connections." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1659 +#: ../../library/asyncio-eventloop.rst:1668 msgid "" "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." msgstr "" -#: ../../library/asyncio-eventloop.rst:1662 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" ":meth:`close` should be called before :meth:`close_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1669 +#: ../../library/asyncio-eventloop.rst:1678 msgid "" "Close all existing incoming client connections immediately, without waiting " "for pending operations to complete." msgstr "" -#: ../../library/asyncio-eventloop.rst:1672 +#: ../../library/asyncio-eventloop.rst:1681 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." msgstr "" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1684 msgid "" ":meth:`close` should be called before :meth:`abort_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1682 +#: ../../library/asyncio-eventloop.rst:1691 msgid "Return the event loop associated with the server object." msgstr "回傳與伺服器物件關聯的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1688 +#: ../../library/asyncio-eventloop.rst:1697 msgid "Start accepting connections." msgstr "開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1690 +#: ../../library/asyncio-eventloop.rst:1699 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "此方法是幂等的,因此可以在伺服器已經運行時呼叫。" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1702 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 " @@ -2565,14 +2579,14 @@ msgstr "" "種情況下,可以使用 ``Server.start_serving()`` 或 :meth:`Server." "serve_forever` 來使 Server 開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1704 +#: ../../library/asyncio-eventloop.rst:1713 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" "開始接受連線,直到協程被取消。取消 ``serve_forever`` 任務會導致伺服器關閉。" -#: ../../library/asyncio-eventloop.rst:1708 +#: ../../library/asyncio-eventloop.rst:1717 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2580,7 +2594,7 @@ msgstr "" "如果伺服器已經接受連線,則可以呼叫此方法。每個 *Server* 物件只能存在一個 " "``serve_forever`` 任務。" -#: ../../library/asyncio-eventloop.rst:1714 +#: ../../library/asyncio-eventloop.rst:1723 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2595,24 +2609,24 @@ msgid "" "asyncio.run(main('127.0.0.1', 0))" msgstr "" -#: ../../library/asyncio-eventloop.rst:1730 +#: ../../library/asyncio-eventloop.rst:1739 msgid "Return ``True`` if the server is accepting new connections." msgstr "如果伺服器正在接受新連線,則回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1745 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "等待 :meth:`close` 方法完成且所有活動連線都已結束。" -#: ../../library/asyncio-eventloop.rst:1741 +#: ../../library/asyncio-eventloop.rst:1750 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" "伺服器正在監聽的類似 socket 的物件串列,``asyncio.trsock.TransportSocket``。" -#: ../../library/asyncio-eventloop.rst:1744 +#: ../../library/asyncio-eventloop.rst:1753 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." @@ -2620,11 +2634,11 @@ msgstr "" "在 Python 3.7 之前,``Server.sockets`` 曾經直接回傳內部伺服器 sockets 的串" "列。在 3.7 中回傳了該串列的副本。" -#: ../../library/asyncio-eventloop.rst:1754 +#: ../../library/asyncio-eventloop.rst:1763 msgid "Event Loop Implementations" msgstr "事件迴圈實作" -#: ../../library/asyncio-eventloop.rst:1756 +#: ../../library/asyncio-eventloop.rst:1765 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." @@ -2632,21 +2646,21 @@ msgstr "" "asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` 和 :class:" "`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1759 +#: ../../library/asyncio-eventloop.rst:1768 #, fuzzy msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "" "預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " "Windows 上使用 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1764 +#: ../../library/asyncio-eventloop.rst:1773 #, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." msgstr "基於 :mod:`selectors` 模組的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1767 +#: ../../library/asyncio-eventloop.rst:1776 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2655,7 +2669,7 @@ msgstr "" "使用特定平台上最有效的 *selector*。也可以手動配置要使用的確切 selector 實" "作: ::" -#: ../../library/asyncio-eventloop.rst:1771 +#: ../../library/asyncio-eventloop.rst:1780 msgid "" "import asyncio\n" "import selectors\n" @@ -2677,14 +2691,14 @@ msgstr "" "\n" "asyncio.set_event_loop_policy(MyPolicy())" -#: ../../library/asyncio-eventloop.rst:1787 +#: ../../library/asyncio-eventloop.rst:1796 #, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" -#: ../../library/asyncio-eventloop.rst:1793 +#: ../../library/asyncio-eventloop.rst:1802 #, fuzzy msgid "" "`MSDN documentation on I/O Completion Ports <https://learn.microsoft.com/" @@ -2693,13 +2707,13 @@ msgstr "" "`I/O 完成埠(I/O Completion Ports)的 MSDN 文件 <https://docs.microsoft.com/" "zh-tw/windows/desktop/FileIO/i-o-completion-ports>`_。" -#: ../../library/asyncio-eventloop.rst:1798 +#: ../../library/asyncio-eventloop.rst:1807 msgid "" "An alias to the most efficient available subclass of :class:" "`AbstractEventLoop` for the given platform." msgstr "" -#: ../../library/asyncio-eventloop.rst:1801 +#: ../../library/asyncio-eventloop.rst:1810 #, fuzzy msgid "" "It is an alias to :class:`SelectorEventLoop` on Unix and :class:" @@ -2708,11 +2722,11 @@ msgstr "" "預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " "Windows 上使用 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1807 +#: ../../library/asyncio-eventloop.rst:1816 msgid "Abstract base class for asyncio-compliant event loops." msgstr "為符合 asyncio 標準的事件迴圈的抽象基礎類別。" -#: ../../library/asyncio-eventloop.rst:1809 +#: ../../library/asyncio-eventloop.rst:1818 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." @@ -2720,11 +2734,11 @@ msgstr "" ":ref:`asyncio-event-loop-methods` 部分列出了替代 ``AbstractEventLoop`` 實作應" "該定義的所有方法。" -#: ../../library/asyncio-eventloop.rst:1815 +#: ../../library/asyncio-eventloop.rst:1824 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1817 +#: ../../library/asyncio-eventloop.rst:1826 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." @@ -2735,11 +2749,11 @@ msgstr "" "`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式很少需要這" "種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1836 msgid "Hello World with call_soon()" msgstr "使用 call_soon() 的 Hello World 範例" -#: ../../library/asyncio-eventloop.rst:1829 +#: ../../library/asyncio-eventloop.rst:1838 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::" @@ -2747,7 +2761,7 @@ msgstr "" "使用 :meth:`loop.call_soon` 方法排程回呼的範例。回呼會顯示 ``\"Hello " "World\"``,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1833 +#: ../../library/asyncio-eventloop.rst:1842 msgid "" "import asyncio\n" "\n" @@ -2768,18 +2782,18 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1853 +#: ../../library/asyncio-eventloop.rst:1862 msgid "" "A similar :ref:`Hello World <coroutine>` example created with a coroutine " "and the :func:`run` function." msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`Hello World <coroutine>` 範例。" -#: ../../library/asyncio-eventloop.rst:1860 +#: ../../library/asyncio-eventloop.rst:1869 msgid "Display the current date with call_later()" msgstr "使用 call_later() 顯示目前日期" -#: ../../library/asyncio-eventloop.rst:1862 +#: ../../library/asyncio-eventloop.rst:1871 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 " @@ -2788,7 +2802,7 @@ msgstr "" "一個回呼的範例,每秒顯示目前日期。回呼使用 :meth:`loop.call_later` 方法在 5 " "秒後重新排程自己,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1866 +#: ../../library/asyncio-eventloop.rst:1875 msgid "" "import asyncio\n" "import datetime\n" @@ -2813,7 +2827,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1890 +#: ../../library/asyncio-eventloop.rst:1899 msgid "" "A similar :ref:`current date <asyncio_example_sleep>` example created with a " "coroutine and the :func:`run` function." @@ -2821,11 +2835,11 @@ msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`current date " "<asyncio_example_sleep>` 範例。" -#: ../../library/asyncio-eventloop.rst:1897 +#: ../../library/asyncio-eventloop.rst:1906 msgid "Watch a file descriptor for read events" msgstr "監聽檔案描述器以進行讀取事件" -#: ../../library/asyncio-eventloop.rst:1899 +#: ../../library/asyncio-eventloop.rst:1908 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" @@ -2833,7 +2847,7 @@ msgstr "" "使用 :meth:`loop.add_reader` 方法等待檔案描述器接收到某些資料,然後關閉事件迴" "圈: ::" -#: ../../library/asyncio-eventloop.rst:1902 +#: ../../library/asyncio-eventloop.rst:1911 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -2869,7 +2883,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1937 +#: ../../library/asyncio-eventloop.rst:1946 msgid "" "A similar :ref:`example <asyncio_example_create_connection>` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -2877,7 +2891,7 @@ msgstr "" "使用傳輸、協定和 :meth:`loop.create_connection` 方法的類似 :ref:`範例 " "<asyncio_example_create_connection>`。" -#: ../../library/asyncio-eventloop.rst:1941 +#: ../../library/asyncio-eventloop.rst:1950 msgid "" "Another similar :ref:`example <asyncio_example_create_connection-streams>` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -2885,15 +2899,15 @@ msgstr "" "另一個使用高階 :func:`asyncio.open_connection` 函式和串流的類似 :ref:`範例 " "<asyncio_example_create_connection-streams>`。" -#: ../../library/asyncio-eventloop.rst:1949 +#: ../../library/asyncio-eventloop.rst:1958 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "設定 SIGINT 和 SIGTERM 的訊號處理程式" -#: ../../library/asyncio-eventloop.rst:1951 +#: ../../library/asyncio-eventloop.rst:1960 msgid "(This ``signals`` example only works on Unix.)" msgstr "(此 ``signals`` 範例僅在 Unix 上運作。)" -#: ../../library/asyncio-eventloop.rst:1953 +#: ../../library/asyncio-eventloop.rst:1962 msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" @@ -2901,7 +2915,7 @@ msgstr "" "使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` 和 :py:" "data:`SIGTERM` 的處理程式: ::" -#: ../../library/asyncio-eventloop.rst:1956 +#: ../../library/asyncio-eventloop.rst:1965 msgid "" "import asyncio\n" "import functools\n" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 088dea0967..d768445817 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -183,14 +183,16 @@ msgid "" msgstr "" #: ../../library/asyncio-queue.rst:118 -msgid "Indicate that a formerly enqueued task is complete." +#, fuzzy +msgid "Indicate that a formerly enqueued work item is complete." msgstr "表示前面一個排隊的任務已經完成。" #: ../../library/asyncio-queue.rst:120 +#, fuzzy msgid "" -"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a task, a " -"subsequent call to :meth:`task_done` tells the queue that the processing on " -"the task is complete." +"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " +"item, a subsequent call to :meth:`task_done` tells the queue that the " +"processing on the work item is complete." msgstr "" "由佇列消耗者使用。對於每個用於獲取一個任務的 :meth:`~Queue.get`,接續的 :" "meth:`task_done` 呼叫會告訴佇列這個任務的處理已經完成。" diff --git a/library/calendar.po b/library/calendar.po index 1cc98594b4..1bc71bc814 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,19 +76,48 @@ msgstr "" "做任何格式化,這是子類別的工作。" #: ../../library/calendar.rst:41 -msgid ":class:`Calendar` instances have the following methods:" +#, fuzzy +msgid ":class:`Calendar` instances have the following methods and attributes:" msgstr ":class:`Calendar` 實例有以下方法:" #: ../../library/calendar.rst:45 +msgid "The first weekday as an integer (0--6)." +msgstr "" + +#: ../../library/calendar.rst:47 +msgid "" +"This property can also be set and read using :meth:`~Calendar." +"setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." +msgstr "" + +#: ../../library/calendar.rst:53 +msgid "Return an :class:`int` for the current first weekday (0--6)." +msgstr "" + +#: ../../library/calendar.rst:55 +msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." +msgstr "" + +#: ../../library/calendar.rst:59 +msgid "" +"Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)" +msgstr "" + +#: ../../library/calendar.rst:61 +msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." +msgstr "" + +#: ../../library/calendar.rst:65 +#, fuzzy msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" -"`firstweekday` property." +"`~Calendar.firstweekday` property." msgstr "" "回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" "`firstweekday` 屬性的值一樣。" -#: ../../library/calendar.rst:52 +#: ../../library/calendar.rst:72 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -98,7 +127,7 @@ msgstr "" "回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" "期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" -#: ../../library/calendar.rst:60 +#: ../../library/calendar.rst:80 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -109,7 +138,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" "之外的日期數字會是 ``0``。" -#: ../../library/calendar.rst:68 +#: ../../library/calendar.rst:88 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -120,7 +149,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" "幾的數字組成的元組。" -#: ../../library/calendar.rst:76 +#: ../../library/calendar.rst:96 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -131,7 +160,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" "元組。" -#: ../../library/calendar.rst:86 +#: ../../library/calendar.rst:106 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -142,7 +171,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" "數字組成的元組。" -#: ../../library/calendar.rst:96 +#: ../../library/calendar.rst:116 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." @@ -150,7 +179,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" "class:`datetime.date` 物件。" -#: ../../library/calendar.rst:102 +#: ../../library/calendar.rst:122 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -158,7 +187,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字及代表週幾的數字組成的元組。" -#: ../../library/calendar.rst:109 +#: ../../library/calendar.rst:129 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -166,7 +195,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字。" -#: ../../library/calendar.rst:115 +#: ../../library/calendar.rst:135 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -177,7 +206,7 @@ msgstr "" "*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" "一天則是一個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:123 +#: ../../library/calendar.rst:143 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " @@ -186,7 +215,7 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:130 +#: ../../library/calendar.rst:150 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " @@ -195,15 +224,48 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:137 +#: ../../library/calendar.rst:157 msgid "This class can be used to generate plain text calendars." msgstr "這個類別用來產生純文字的日曆。" -#: ../../library/calendar.rst:139 +#: ../../library/calendar.rst:159 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:143 +#: ../../library/calendar.rst:164 +msgid "" +"Return a string representing a single day formatted with the given *width*. " +"If *theday* is ``0``, return a string of spaces of the specified width, " +"representing an empty day. The *weekday* parameter is unused." +msgstr "" + +#: ../../library/calendar.rst:171 +#, fuzzy +msgid "" +"Return a single week in a string with no newline. If *w* is provided, it " +"specifies the width of the date columns, which are centered. Depends on the " +"first weekday as specified in the constructor or set by the :meth:" +"`setfirstweekday` method." +msgstr "" +"以多行字串的形式回傳一個月份的日曆。如果給定 *w*,它會指定置中的日期欄的寬" +"度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" +"者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" + +#: ../../library/calendar.rst:178 +msgid "" +"Return a string representing the name of a single weekday formatted to the " +"specified *width*. The *weekday* parameter is an integer representing the " +"day of the week, where ``0`` is Monday and ``6`` is Sunday." +msgstr "" + +#: ../../library/calendar.rst:184 +msgid "" +"Return a string containing the header row of weekday names, formatted with " +"the given *width* for each column. The names depend on the locale settings " +"and are padded to the specified width." +msgstr "" + +#: ../../library/calendar.rst:190 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -215,11 +277,19 @@ msgstr "" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" -#: ../../library/calendar.rst:152 +#: ../../library/calendar.rst:198 +msgid "" +"Return a string representing the month's name centered within the specified " +"*width*. If *withyear* is ``True``, include the year in the output. The " +"*theyear* and *themonth* parameters specify the year and month for the name " +"to be formatted respectively." +msgstr "" + +#: ../../library/calendar.rst:205 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" -#: ../../library/calendar.rst:157 +#: ../../library/calendar.rst:210 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -233,20 +303,20 @@ msgstr "" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" "的年份會依據平台而不同。" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:220 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" -#: ../../library/calendar.rst:172 +#: ../../library/calendar.rst:225 msgid "This class can be used to generate HTML calendars." msgstr "這個類別用來產生 HTML 日曆。" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:228 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:179 +#: ../../library/calendar.rst:232 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -254,14 +324,14 @@ msgstr "" "以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:186 +#: ../../library/calendar.rst:239 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" "以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" -#: ../../library/calendar.rst:192 +#: ../../library/calendar.rst:245 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -273,7 +343,7 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:201 +#: ../../library/calendar.rst:254 msgid "" "Return a month name as an HTML table row. If *withyear* is true the year " "will be included in the row, otherwise just the month name will be used." @@ -281,28 +351,28 @@ msgstr "" "以 HTML 表列的形式回傳一個月份的名稱。如果 *withyear* 是 true 則該列會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:206 +#: ../../library/calendar.rst:259 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:211 +#: ../../library/calendar.rst:264 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:213 +#: ../../library/calendar.rst:266 msgid "" "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" msgstr "" "cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" -#: ../../library/calendar.rst:215 +#: ../../library/calendar.rst:268 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:217 +#: ../../library/calendar.rst:270 msgid "" "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " "\"sat\", \"sun red\"]" @@ -310,15 +380,15 @@ msgstr "" "cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " "\"sat\", \"sun red\"]" -#: ../../library/calendar.rst:219 +#: ../../library/calendar.rst:272 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:277 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:231 +#: ../../library/calendar.rst:284 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -326,7 +396,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:239 +#: ../../library/calendar.rst:292 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -334,7 +404,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:247 +#: ../../library/calendar.rst:300 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -342,14 +412,14 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:255 +#: ../../library/calendar.rst:308 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:263 +#: ../../library/calendar.rst:316 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." @@ -357,7 +427,7 @@ msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:322 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -367,15 +437,15 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:273 +#: ../../library/calendar.rst:326 msgid "\"text-bold text-red\"" msgstr "\"text-bold text-red\"" -#: ../../library/calendar.rst:275 +#: ../../library/calendar.rst:328 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:277 +#: ../../library/calendar.rst:330 msgid "" "class CustomHTMLCal(calendar.HTMLCalendar):\n" " cssclasses = [style + \" text-nowrap\" for style in\n" @@ -391,7 +461,7 @@ msgstr "" " cssclass_month = \"text-center month\"\n" " cssclass_year = \"text-italic lead\"" -#: ../../library/calendar.rst:287 +#: ../../library/calendar.rst:340 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -399,7 +469,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:293 +#: ../../library/calendar.rst:346 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -407,7 +477,7 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:299 +#: ../../library/calendar.rst:352 msgid "" "The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -418,11 +488,11 @@ msgstr "" "會把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:305 +#: ../../library/calendar.rst:358 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:309 +#: ../../library/calendar.rst:362 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -433,7 +503,7 @@ msgstr "" "`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" "`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:314 +#: ../../library/calendar.rst:367 msgid "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" @@ -441,27 +511,27 @@ msgstr "" "import calendar\n" "calendar.setfirstweekday(calendar.SUNDAY)" -#: ../../library/calendar.rst:320 +#: ../../library/calendar.rst:373 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:325 +#: ../../library/calendar.rst:378 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:330 +#: ../../library/calendar.rst:383 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "" "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:333 +#: ../../library/calendar.rst:386 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:338 +#: ../../library/calendar.rst:391 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -469,19 +539,19 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:344 +#: ../../library/calendar.rst:397 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:350 +#: ../../library/calendar.rst:403 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:356 +#: ../../library/calendar.rst:409 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " @@ -490,11 +560,11 @@ msgstr "" "回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" "一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:363 +#: ../../library/calendar.rst:416 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:368 +#: ../../library/calendar.rst:421 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." @@ -502,12 +572,12 @@ msgstr "" "以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`~TextCalendar.formatmonth`。" -#: ../../library/calendar.rst:374 +#: ../../library/calendar.rst:427 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:379 +#: ../../library/calendar.rst:432 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." @@ -515,7 +585,7 @@ msgstr "" "以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`~TextCalendar.formatyear`。" -#: ../../library/calendar.rst:385 +#: ../../library/calendar.rst:438 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -527,31 +597,31 @@ msgstr "" "gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" "碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" -#: ../../library/calendar.rst:392 +#: ../../library/calendar.rst:445 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:396 +#: ../../library/calendar.rst:449 #, fuzzy msgid "" "A sequence that represents the days of the week in the current locale, where " "Monday is day number 0." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:406 +#: ../../library/calendar.rst:459 #, fuzzy msgid "" "A sequence that represents the abbreviated days of the week in the current " "locale, where Mon is day number 0." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:421 +#: ../../library/calendar.rst:474 msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:429 +#: ../../library/calendar.rst:482 msgid "" "Enumeration defining days of the week as integer constants. The members of " "this enumeration are exported to the module scope as :data:`MONDAY` through :" @@ -560,17 +630,17 @@ msgstr "" "將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` 到 :" "data:`SUNDAY` 匯出到模組作用域。" -#: ../../library/calendar.rst:438 +#: ../../library/calendar.rst:491 #, fuzzy msgid "" "A sequence that represents the months of the year in the current locale. " "This follows normal convention of January being month number 1, so it has a " -"length of 13 and ``month_name[0]`` is the empty string." +"length of 13 and ``month_name[0]`` is the empty string." msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:449 +#: ../../library/calendar.rst:502 #, fuzzy msgid "" "A sequence that represents the abbreviated months of the year in the current " @@ -580,14 +650,14 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:470 +#: ../../library/calendar.rst:523 msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." msgstr "" "一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:478 +#: ../../library/calendar.rst:531 msgid "" "Enumeration defining months of the year as integer constants. The members of " "this enumeration are exported to the module scope as :data:`JANUARY` " @@ -596,61 +666,61 @@ msgstr "" "將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` 到 :" "data:`DECEMBER` 匯出到模組作用域。" -#: ../../library/calendar.rst:485 +#: ../../library/calendar.rst:538 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr ":mod:`calendar` 模組定義了以下例外:" -#: ../../library/calendar.rst:489 +#: ../../library/calendar.rst:542 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的月份數字超出 1-12 範圍(含)時引發。" -#: ../../library/calendar.rst:494 +#: ../../library/calendar.rst:547 msgid "The invalid month number." msgstr "無效的月份號。" -#: ../../library/calendar.rst:499 +#: ../../library/calendar.rst:552 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" ":exc:`ValueError` 的子類別,當給定的週幾的數字超出 0-6(含)範圍時引發。" -#: ../../library/calendar.rst:504 +#: ../../library/calendar.rst:557 msgid "The invalid weekday number." msgstr "無效的週幾編號。" -#: ../../library/calendar.rst:509 +#: ../../library/calendar.rst:562 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:510 +#: ../../library/calendar.rst:563 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:513 +#: ../../library/calendar.rst:566 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:514 +#: ../../library/calendar.rst:567 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" -#: ../../library/calendar.rst:520 +#: ../../library/calendar.rst:573 msgid "Command-Line Usage" msgstr "命令列用法" -#: ../../library/calendar.rst:524 +#: ../../library/calendar.rst:577 msgid "" "The :mod:`calendar` module can be executed as a script from the command line " "to interactively print a calendar." msgstr ":mod:`calendar` 模組可以作為腳本從命令列執行,並以互動方式列印日曆。" -#: ../../library/calendar.rst:527 +#: ../../library/calendar.rst:580 #, fuzzy msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" @@ -661,11 +731,11 @@ msgstr "" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" " [year] [month]" -#: ../../library/calendar.rst:534 +#: ../../library/calendar.rst:587 msgid "For example, to print a calendar for the year 2000:" msgstr "例如,要列印 2000 年的日曆:" -#: ../../library/calendar.rst:536 +#: ../../library/calendar.rst:589 msgid "" "$ python -m calendar 2000\n" " 2000\n" @@ -743,42 +813,42 @@ msgstr "" "23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" "30 31" -#: ../../library/calendar.rst:577 +#: ../../library/calendar.rst:630 msgid "The following options are accepted:" msgstr "接受以下選項:" -#: ../../library/calendar.rst:584 +#: ../../library/calendar.rst:637 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/calendar.rst:589 +#: ../../library/calendar.rst:642 msgid "The locale to use for month and weekday names. Defaults to English." msgstr "用於月份和週幾名稱的語系。預設為英語。" -#: ../../library/calendar.rst:595 +#: ../../library/calendar.rst:648 msgid "" "The encoding to use for output. :option:`--encoding` is required if :option:" "`--locale` is set." msgstr "" "用於輸出的編碼。如有設定 :option:`--locale` 則必須給定 :option:`--encoding`。" -#: ../../library/calendar.rst:601 +#: ../../library/calendar.rst:654 msgid "Print the calendar to the terminal as text, or as an HTML document." msgstr "將日曆以文字或 HTML 文件的形式印出到終端機。" -#: ../../library/calendar.rst:607 +#: ../../library/calendar.rst:660 #, fuzzy msgid "" "The weekday to start each week. Must be a number between 0 (Monday) and 6 " "(Sunday). Defaults to 0." msgstr "印出日曆的年份。必須是 1 到 9999 之間的數字。預設為當前年份。" -#: ../../library/calendar.rst:615 +#: ../../library/calendar.rst:668 #, fuzzy msgid "The year to print the calendar for. Defaults to the current year." msgstr "印出日曆的年份。必須是 1 到 9999 之間的數字。預設為當前年份。" -#: ../../library/calendar.rst:621 +#: ../../library/calendar.rst:674 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12, and may only be used in text mode. Defaults to " @@ -787,11 +857,11 @@ msgstr "" "要列印日曆的指定 :option:`year` 的月份。必須是 1 到 12 之間的數字,並且只能在" "文字模式下使用。預設列印全年日曆。" -#: ../../library/calendar.rst:627 +#: ../../library/calendar.rst:680 msgid "*Text-mode options:*" msgstr "*文字模式選項:*" -#: ../../library/calendar.rst:631 +#: ../../library/calendar.rst:684 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." @@ -799,7 +869,7 @@ msgstr "" "終端機行中日期行的寬度。日期印出在行的中央。任何小於 2 的值都會被忽略。預設" "為 2。" -#: ../../library/calendar.rst:639 +#: ../../library/calendar.rst:692 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." @@ -807,21 +877,21 @@ msgstr "" "終端機列中每週的列數。日期印出時頂部會對齊。任何小於 1 的值都會被忽略。預設" "為 1。" -#: ../../library/calendar.rst:647 +#: ../../library/calendar.rst:700 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." msgstr "行中月份之間的間距。任何小於 2 的值都會被忽略。預設為 6。" -#: ../../library/calendar.rst:654 +#: ../../library/calendar.rst:707 msgid "The number of months printed per row. Defaults to 3." msgstr "每列印出的月份數量。預設為 3。" -#: ../../library/calendar.rst:658 +#: ../../library/calendar.rst:711 msgid "*HTML-mode options:*" msgstr "*HTML 模式選項:*" -#: ../../library/calendar.rst:662 +#: ../../library/calendar.rst:715 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." diff --git a/library/collections.abc.po b/library/collections.abc.po index 0012205941..bb2177c5f9 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-07 03:11+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,7 +232,7 @@ msgstr ":class:`Generator` [1]_" msgid ":class:`Iterator`" msgstr ":class:`Iterator`" -#: ../../library/collections.abc.rst:128 ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:128 ../../library/collections.abc.rst:177 msgid "``send``, ``throw``" msgstr "``send``、``throw``" @@ -244,7 +244,7 @@ msgstr "``close``、``__iter__``、``__next__``" msgid ":class:`Sized` [1]_" msgstr ":class:`Sized` [1]_" -#: ../../library/collections.abc.rst:129 ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:129 msgid "``__len__``" msgstr "``__len__``" @@ -311,45 +311,47 @@ msgstr ":class:`ByteString`" msgid "Inherited :class:`Sequence` methods" msgstr "" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:152 msgid ":class:`Set`" msgstr ":class:`Set`" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:158 msgid ":class:`Collection`" msgstr ":class:`Collection`" #: ../../library/collections.abc.rst:147 +#, fuzzy msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " -"``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint``" +"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " +"``__rxor__`` and ``isdisjoint``" msgstr "" "``__le__``、``__lt__``、``__eq__``、``__ne__``、``__gt__``、``__ge__``、" "``__and__``、``__or__``、``__sub__``、``__xor__`` 與 ``isdisjoint``" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid ":class:`MutableSet`" msgstr ":class:`MutableSet`" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "``__contains__``、``__iter__``、``__len__``、``add``、``discard``" -#: ../../library/collections.abc.rst:151 +#: ../../library/collections.abc.rst:152 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:157 ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:158 ../../library/collections.abc.rst:162 msgid ":class:`Mapping`" msgstr ":class:`Mapping`" -#: ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:158 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "``__getitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:157 +#: ../../library/collections.abc.rst:158 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" @@ -357,124 +359,129 @@ msgstr "" "``__contains__``、``keys``、``items``、``values``、``get``、``__eq__`` 和 " "``__ne__``" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid ":class:`MutableMapping`" msgstr ":class:`MutableMapping`" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" "``__getitem__``、``__setitem__``、``__delitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:161 +#: ../../library/collections.abc.rst:162 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:169 msgid ":class:`MappingView`" msgstr ":class:`MappingView`" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:169 msgid ":class:`Sized`" msgstr ":class:`Sized`" #: ../../library/collections.abc.rst:169 +#, fuzzy +msgid "``__init__``, ``__len__`` and ``__repr__``" +msgstr "``__getitem__``、``__iter__``、``__len__``" + +#: ../../library/collections.abc.rst:170 msgid ":class:`ItemsView`" msgstr ":class:`ItemsView`" -#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 msgid ":class:`MappingView`, :class:`Set`" msgstr ":class:`MappingView`、:class:`Set`" -#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:174 msgid "``__contains__``, ``__iter__``" msgstr "``__contains__``、``__iter__``" -#: ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:172 msgid ":class:`KeysView`" msgstr ":class:`KeysView`" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:174 msgid ":class:`ValuesView`" msgstr ":class:`ValuesView`" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:174 msgid ":class:`MappingView`, :class:`Collection`" msgstr ":class:`MappingView`、:class:`Collection`" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:176 msgid ":class:`Awaitable` [1]_" msgstr ":class:`Awaitable` [1]_" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:176 msgid "``__await__``" msgstr "``__await__``" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid ":class:`Coroutine` [1]_" msgstr ":class:`Coroutine` [1]_" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid ":class:`Awaitable`" msgstr ":class:`Awaitable`" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:177 msgid "``close``" msgstr "``close``" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterable` [1]_" msgstr ":class:`AsyncIterable` [1]_" -#: ../../library/collections.abc.rst:177 ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:178 ../../library/collections.abc.rst:179 msgid "``__aiter__``" msgstr "``__aiter__``" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterator` [1]_" msgstr ":class:`AsyncIterator` [1]_" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterable`" msgstr ":class:`AsyncIterable`" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:179 msgid "``__anext__``" msgstr "``__anext__``" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid ":class:`AsyncGenerator` [1]_" msgstr ":class:`AsyncGenerator` [1]_" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid ":class:`AsyncIterator`" msgstr ":class:`AsyncIterator`" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid "``asend``, ``athrow``" msgstr "``asend``、``athrow``" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:180 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``、``__aiter__``、``__anext__``" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:181 msgid ":class:`Buffer` [1]_" msgstr ":class:`Buffer` [1]_" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:181 msgid "``__buffer__``" msgstr "``__buffer__``" -#: ../../library/collections.abc.rst:185 +#: ../../library/collections.abc.rst:186 msgid "Footnotes" msgstr "註解" -#: ../../library/collections.abc.rst:186 +#: ../../library/collections.abc.rst:187 msgid "" "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " "an interface by verifying the required methods are present and have not been " @@ -482,7 +489,7 @@ msgid "" "interfaces require registration or direct subclassing." msgstr "" -#: ../../library/collections.abc.rst:192 +#: ../../library/collections.abc.rst:193 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " @@ -491,37 +498,37 @@ msgid "" "`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:200 +#: ../../library/collections.abc.rst:201 msgid "Collections Abstract Base Classes -- Detailed Descriptions" msgstr "" -#: ../../library/collections.abc.rst:205 +#: ../../library/collections.abc.rst:206 msgid "ABC for classes that provide the :meth:`~object.__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:209 +#: ../../library/collections.abc.rst:210 msgid "ABC for classes that provide the :meth:`~object.__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:213 +#: ../../library/collections.abc.rst:214 msgid "ABC for classes that provide the :meth:`~object.__len__` method." msgstr "" -#: ../../library/collections.abc.rst:217 +#: ../../library/collections.abc.rst:218 msgid "ABC for classes that provide the :meth:`~object.__call__` method." msgstr "" -#: ../../library/collections.abc.rst:219 +#: ../../library/collections.abc.rst:220 msgid "" "See :ref:`annotating-callables` for details on how to use :class:`!Callable` " "in type annotations." msgstr "" -#: ../../library/collections.abc.rst:224 +#: ../../library/collections.abc.rst:225 msgid "ABC for classes that provide the :meth:`~container.__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:226 +#: ../../library/collections.abc.rst:227 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " @@ -530,23 +537,23 @@ msgid "" "`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:235 +#: ../../library/collections.abc.rst:236 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:241 +#: ../../library/collections.abc.rst:242 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:247 +#: ../../library/collections.abc.rst:248 msgid "" "ABC for iterable classes that also provide the :meth:`~object.__reversed__` " "method." msgstr "" -#: ../../library/collections.abc.rst:254 +#: ../../library/collections.abc.rst:255 msgid "" "ABC for :term:`generator` classes that implement the protocol defined in :" "pep:`342` that extends :term:`iterators <iterator>` with the :meth:" @@ -554,17 +561,17 @@ msgid "" "methods." msgstr "" -#: ../../library/collections.abc.rst:259 +#: ../../library/collections.abc.rst:260 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Generator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:268 +#: ../../library/collections.abc.rst:269 msgid "ABCs for read-only and mutable :term:`sequences <sequence>`." msgstr "" -#: ../../library/collections.abc.rst:270 +#: ../../library/collections.abc.rst:271 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`~container." "__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make repeated " @@ -575,44 +582,44 @@ msgid "" "quadratic performance and will likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:279 +#: ../../library/collections.abc.rst:280 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:283 +#: ../../library/collections.abc.rst:284 msgid "" "The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " "use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`." msgstr "" -#: ../../library/collections.abc.rst:292 +#: ../../library/collections.abc.rst:293 msgid "ABCs for read-only and mutable :ref:`sets <types-set>`." msgstr "" -#: ../../library/collections.abc.rst:297 +#: ../../library/collections.abc.rst:298 msgid "ABCs for read-only and mutable :term:`mappings <mapping>`." msgstr "" -#: ../../library/collections.abc.rst:304 +#: ../../library/collections.abc.rst:305 msgid "" "ABCs for mapping, items, keys, and values :term:`views <dictionary view>`." msgstr "" -#: ../../library/collections.abc.rst:308 +#: ../../library/collections.abc.rst:309 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`~object." "__await__` method." msgstr "" -#: ../../library/collections.abc.rst:312 +#: ../../library/collections.abc.rst:313 msgid "" ":term:`Coroutine <coroutine>` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:316 +#: ../../library/collections.abc.rst:317 msgid "" "In CPython, generator-based coroutines (:term:`generators <generator>` " "decorated with :func:`@types.coroutine <types.coroutine>`) are *awaitables*, " @@ -621,7 +628,7 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:326 +#: ../../library/collections.abc.rst:327 msgid "" "ABC for :term:`coroutine` compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -630,7 +637,7 @@ msgid "" "instances are also instances of :class:`Awaitable`." msgstr "" -#: ../../library/collections.abc.rst:334 +#: ../../library/collections.abc.rst:335 msgid "" "In CPython, generator-based coroutines (:term:`generators <generator>` " "decorated with :func:`@types.coroutine <types.coroutine>`) are *awaitables*, " @@ -639,54 +646,54 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:340 +#: ../../library/collections.abc.rst:341 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Coroutine` in type annotations. The variance and order of type parameters " "correspond to those of :class:`Generator`." msgstr "" -#: ../../library/collections.abc.rst:349 +#: ../../library/collections.abc.rst:350 msgid "" "ABC for classes that provide an ``__aiter__`` method. See also the " "definition of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:356 +#: ../../library/collections.abc.rst:357 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:363 +#: ../../library/collections.abc.rst:364 msgid "" "ABC for :term:`asynchronous generator` classes that implement the protocol " "defined in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:366 +#: ../../library/collections.abc.rst:367 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!AsyncGenerator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:373 +#: ../../library/collections.abc.rst:374 msgid "" "ABC for classes that provide the :meth:`~object.__buffer__` method, " "implementing the :ref:`buffer protocol <bufferobjects>`. See :pep:`688`." msgstr "" -#: ../../library/collections.abc.rst:379 +#: ../../library/collections.abc.rst:380 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:381 +#: ../../library/collections.abc.rst:382 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:384 +#: ../../library/collections.abc.rst:385 msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" @@ -696,7 +703,7 @@ msgstr "" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" -#: ../../library/collections.abc.rst:388 +#: ../../library/collections.abc.rst:389 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -706,7 +713,7 @@ msgid "" "methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:395 +#: ../../library/collections.abc.rst:396 msgid "" "class ListBasedSet(collections.abc.Set):\n" " ''' Alternate set implementation favoring space over speed\n" @@ -732,11 +739,11 @@ msgid "" "automatically" msgstr "" -#: ../../library/collections.abc.rst:417 +#: ../../library/collections.abc.rst:418 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:420 +#: ../../library/collections.abc.rst:421 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an :term:`iterable`. The class constructor " @@ -749,14 +756,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:431 +#: ../../library/collections.abc.rst:432 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " "other operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:437 +#: ../../library/collections.abc.rst:438 msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " @@ -765,12 +772,12 @@ msgid "" "define ``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:445 +#: ../../library/collections.abc.rst:446 msgid "" "`OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:448 +#: ../../library/collections.abc.rst:449 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`。" diff --git a/library/datetime.po b/library/datetime.po index 91307be588..abbb5f0ab2 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-19 10:40+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid <gridwing@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1492,7 +1492,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:940 -msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." +msgid "Use :meth:`datetime.now` with :const:`UTC` instead." msgstr "" #: ../../library/datetime.rst:945 @@ -1592,7 +1592,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:1012 -msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." +msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" #: ../../library/datetime.rst:1017 diff --git a/library/decimal.po b/library/decimal.po index 0ab719a400..740f69550e 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2810,7 +2810,7 @@ msgstr "" #: ../../library/decimal.rst:2248 msgid "" -"For inexact results, :attr:`MAX_PREC` is far too large on 64-bit platforms " +"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" msgstr "" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 0f16e267a8..b7f373d04d 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -218,10 +218,19 @@ msgstr "" #: ../../library/email.contentmanager.rst:159 msgid "" "For ``str`` objects, if *cte* is not set use heuristics to determine the " -"most compact encoding." +"most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to " +"normalize all line boundaries, ensuring that each line of the payload is " +"terminated by the current policy's :data:`~email.policy.Policy.linesep` " +"property (even if the original string did not end with one)." msgstr "" -#: ../../library/email.contentmanager.rst:161 +#: ../../library/email.contentmanager.rst:165 +msgid "" +"For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " +"aforementioned newline translation is not performed." +msgstr "" + +#: ../../library/email.contentmanager.rst:167 msgid "" "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " "a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " @@ -230,14 +239,14 @@ msgid "" "For all other values of *subtype*, use ``7bit``." msgstr "" -#: ../../library/email.contentmanager.rst:168 +#: ../../library/email.contentmanager.rst:174 msgid "" "A *cte* of ``binary`` does not actually work correctly yet. The " "``EmailMessage`` object as modified by ``set_content`` is correct, but :" "class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" -#: ../../library/email.contentmanager.rst:173 +#: ../../library/email.contentmanager.rst:179 msgid "" "If *disposition* is set, use it as the value of the :mailheader:`Content-" "Disposition` header. If not specified, and *filename* is specified, add the " @@ -246,37 +255,37 @@ msgid "" "values for *disposition* are ``attachment`` and ``inline``." msgstr "" -#: ../../library/email.contentmanager.rst:180 +#: ../../library/email.contentmanager.rst:186 msgid "" "If *filename* is specified, use it as the value of the ``filename`` " "parameter of the :mailheader:`Content-Disposition` header." msgstr "" -#: ../../library/email.contentmanager.rst:183 +#: ../../library/email.contentmanager.rst:189 msgid "" "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " "its value." msgstr "" -#: ../../library/email.contentmanager.rst:186 +#: ../../library/email.contentmanager.rst:192 msgid "" "If *params* is specified, iterate its ``items`` method and use the resulting " "``(key, value)`` pairs to set additional parameters on the :mailheader:" "`Content-Type` header." msgstr "" -#: ../../library/email.contentmanager.rst:190 +#: ../../library/email.contentmanager.rst:196 msgid "" "If *headers* is specified and is a list of strings of the form ``headername: " "headervalue`` or a list of ``header`` objects (distinguished from strings by " "having a ``name`` attribute), add the headers to *msg*." msgstr "" -#: ../../library/email.contentmanager.rst:197 +#: ../../library/email.contentmanager.rst:203 msgid "Footnotes" msgstr "註解" -#: ../../library/email.contentmanager.rst:198 +#: ../../library/email.contentmanager.rst:204 msgid "" "Originally added in 3.4 as a :term:`provisional module <provisional package>`" msgstr "" diff --git a/library/email.policy.po b/library/email.policy.po index 20f6c5e82b..c30e817522 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -355,7 +355,7 @@ msgstr "" #: ../../library/email.policy.rst:268 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " -"*defect* will always be a subclass of :class:`~email.errors.Defect`." +"*defect* will always be a subclass of :class:`~email.errors.MessageDefect`." msgstr "" #: ../../library/email.policy.rst:272 @@ -368,7 +368,7 @@ msgstr "" #: ../../library/email.policy.rst:279 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " -"a subclass of :class:`~email.errors.Defect`." +"a subclass of :class:`~email.errors.MessageDefect`." msgstr "" #: ../../library/email.policy.rst:282 diff --git a/library/errno.po b/library/errno.po index 7de3106068..46eecaa81d 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -581,25 +581,129 @@ msgstr "" msgid "Interface output queue is full" msgstr "" -#: ../../library/errno.rst:670 +#: ../../library/errno.rst:671 +msgid "No medium found" +msgstr "" + +#: ../../library/errno.rst:676 +msgid "Wrong medium type" +msgstr "" + +#: ../../library/errno.rst:681 +msgid "Required key not available" +msgstr "" + +#: ../../library/errno.rst:686 +msgid "Key has expired" +msgstr "" + +#: ../../library/errno.rst:691 +msgid "Key has been revoked" +msgstr "" + +#: ../../library/errno.rst:696 +msgid "Key was rejected by service" +msgstr "" + +#: ../../library/errno.rst:701 +msgid "Operation not possible due to RF-kill" +msgstr "" + +#: ../../library/errno.rst:706 +msgid "Locked lock was unmapped" +msgstr "" + +#: ../../library/errno.rst:711 +msgid "Facility is not active" +msgstr "" + +#: ../../library/errno.rst:716 +msgid "Authentication error" +msgstr "" + +#: ../../library/errno.rst:723 +msgid "Bad CPU type in executable" +msgstr "" + +#: ../../library/errno.rst:730 +msgid "Bad executable (or shared library)" +msgstr "" + +#: ../../library/errno.rst:737 +msgid "Malformed Mach-o file" +msgstr "" + +#: ../../library/errno.rst:744 +msgid "Device error" +msgstr "" + +#: ../../library/errno.rst:751 +msgid "Inappropriate file type or format" +msgstr "" + +#: ../../library/errno.rst:758 +msgid "Need authenticator" +msgstr "" + +#: ../../library/errno.rst:765 +msgid "Attribute not found" +msgstr "" + +#: ../../library/errno.rst:772 +msgid "Policy not found" +msgstr "" + +#: ../../library/errno.rst:779 +msgid "Too many processes" +msgstr "" + +#: ../../library/errno.rst:786 +msgid "Bad procedure for program" +msgstr "" + +#: ../../library/errno.rst:793 +msgid "Program version wrong" +msgstr "" + +#: ../../library/errno.rst:800 +msgid "RPC prog. not avail" +msgstr "" + +#: ../../library/errno.rst:807 +msgid "Device power is off" +msgstr "" + +#: ../../library/errno.rst:814 +msgid "RPC struct is bad" +msgstr "" + +#: ../../library/errno.rst:821 +msgid "RPC version wrong" +msgstr "" + +#: ../../library/errno.rst:828 +msgid "Shared library version mismatch" +msgstr "" + +#: ../../library/errno.rst:835 msgid "" "Capabilities insufficient. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:673 +#: ../../library/errno.rst:838 msgid "Availability" msgstr "" -#: ../../library/errno.rst:680 +#: ../../library/errno.rst:845 msgid "Operation canceled" msgstr "" -#: ../../library/errno.rst:687 +#: ../../library/errno.rst:852 msgid "Owner died" msgstr "" -#: ../../library/errno.rst:694 +#: ../../library/errno.rst:859 msgid "State not recoverable" msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 836c4bee5c..dda90d7665 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-09-17 09:18+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -512,8 +512,8 @@ msgstr "" #: ../../library/exceptions.rst:347 msgid "" "This exception is raised when a system function returns a system-related " -"error, including I/O failures such as \"file not found\" or \"disk full\" " -"(not for illegal argument types or other incidental errors)." +"error, including I/O failures such as \"file not found\" or \"disk " +"full\" (not for illegal argument types or other incidental errors)." msgstr "" "當系統函式回傳系統相關錯誤,包含像\"找不到檔案\"或\"硬碟已滿\"的 I/O 失敗會引" "發此例外(而非不合法的引數或其他次要的錯誤)。" @@ -840,27 +840,33 @@ msgstr "" "`IndentationError` 的子類別。" #: ../../library/exceptions.rst:563 +#, fuzzy msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " -"a string indicating what went wrong (in low-level terms)." +"a string indicating what went wrong (in low-level terms). In :term:" +"`CPython`, this could be raised by incorrectly using Python's C API, such as " +"returning a ``NULL`` value without an exception set." msgstr "" "當直譯器找到一個內部錯誤,但該情況看起來沒有嚴重到要讓它放棄所有的希望時會引" "發此例外。關聯值是一個表示什麼地方出錯的字串(以低階的方式表達)。" -#: ../../library/exceptions.rst:567 +#: ../../library/exceptions.rst:569 +#, fuzzy msgid "" -"You should report this to the author or maintainer of your Python " -"interpreter. Be sure to report the version of the Python interpreter (``sys." -"version``; it is also printed at the start of an interactive Python " -"session), the exact error message (the exception's associated value) and if " -"possible the source of the program that triggered the error." +"If you're confident that this exception wasn't your fault, or the fault of a " +"package you're using, you should report this to the author or maintainer of " +"your Python interpreter. Be sure to report the version of the Python " +"interpreter (``sys.version``; it is also printed at the start of an " +"interactive Python session), the exact error message (the exception's " +"associated value) and if possible the source of the program that triggered " +"the error." msgstr "" "你應該向你的 Python 直譯器作者或維護者回報此錯誤。務必要回報該 Python 直譯器" "的版本(``sys.version``;這也會在互動式 Python 會話的開頭被印出)、確切的錯誤" "訊息(該例外的關聯值)及如果可能的話,觸發此錯誤的程式來源。" -#: ../../library/exceptions.rst:576 +#: ../../library/exceptions.rst:580 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -881,7 +887,7 @@ msgstr "" "``None``,結束狀態會是 0;如果它是其他類型(例如字串),則物件的值會被印出而" "結束狀態是 1。" -#: ../../library/exceptions.rst:587 +#: ../../library/exceptions.rst:591 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -895,13 +901,13 @@ msgstr "" "風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." "fork` 之後 )可以使用 :func:`os._exit` 函式。" -#: ../../library/exceptions.rst:596 +#: ../../library/exceptions.rst:600 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" -#: ../../library/exceptions.rst:602 +#: ../../library/exceptions.rst:606 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -910,7 +916,7 @@ msgstr "" "當一個操作或函式被用在不適合的類型的物件時會引發此例外。關聯值是一個字串,提" "供關於不相符類型的細節。" -#: ../../library/exceptions.rst:605 +#: ../../library/exceptions.rst:609 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -921,7 +927,7 @@ msgstr "" "這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" "是 :exc:`NotImplementedError`。" -#: ../../library/exceptions.rst:610 +#: ../../library/exceptions.rst:614 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -932,7 +938,7 @@ msgstr "" "導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" "導致 :exc:`ValueError`。" -#: ../../library/exceptions.rst:617 +#: ../../library/exceptions.rst:621 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" @@ -941,7 +947,7 @@ msgstr "" "當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" "外。這是 :exc:`NameError` 的子類別。" -#: ../../library/exceptions.rst:624 +#: ../../library/exceptions.rst:628 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -949,7 +955,7 @@ msgstr "" "當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" "子類別。" -#: ../../library/exceptions.rst:627 +#: ../../library/exceptions.rst:631 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -958,27 +964,27 @@ msgstr "" ":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" "err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" -#: ../../library/exceptions.rst:633 +#: ../../library/exceptions.rst:637 msgid "The name of the encoding that raised the error." msgstr "引發錯誤的編碼名稱。" -#: ../../library/exceptions.rst:637 +#: ../../library/exceptions.rst:641 msgid "A string describing the specific codec error." msgstr "描述特定編解碼器錯誤的字串。" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:645 msgid "The object the codec was attempting to encode or decode." msgstr "編解碼器嘗試編碼或解碼的物件。" -#: ../../library/exceptions.rst:645 +#: ../../library/exceptions.rst:649 msgid "The first index of invalid data in :attr:`object`." msgstr "在 :attr:`object` 中無效資料的開始索引。" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:653 msgid "The index after the last invalid data in :attr:`object`." msgstr "在 :attr:`object` 中最後的無效資料後的索引。" -#: ../../library/exceptions.rst:654 +#: ../../library/exceptions.rst:658 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -986,7 +992,7 @@ msgstr "" "在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:664 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -994,7 +1000,7 @@ msgstr "" "在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:666 +#: ../../library/exceptions.rst:670 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1002,7 +1008,7 @@ msgstr "" "在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:672 +#: ../../library/exceptions.rst:676 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1011,7 +1017,7 @@ msgstr "" "當一個操作或函式收到引數是正確類型但是不適合的值,且該情況無法被更精確的例外" "例如 :exc:`IndexError` 所描述時會引發此例外。" -#: ../../library/exceptions.rst:679 +#: ../../library/exceptions.rst:683 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1020,7 +1026,7 @@ msgstr "" "當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" "值是一個字串,表示運算元及運算的類型。" -#: ../../library/exceptions.rst:684 +#: ../../library/exceptions.rst:688 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1028,21 +1034,21 @@ msgstr "" "以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" "`OSError` 的別名。" -#: ../../library/exceptions.rst:693 +#: ../../library/exceptions.rst:697 msgid "Only available on Windows." msgstr "僅限於在 Windows 中使用。" -#: ../../library/exceptions.rst:697 +#: ../../library/exceptions.rst:701 msgid "OS exceptions" msgstr "作業系統例外" -#: ../../library/exceptions.rst:699 +#: ../../library/exceptions.rst:703 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "以下的例外是 :exc:`OSError` 的子類別,它們根據系統錯誤代碼來引發。" -#: ../../library/exceptions.rst:704 +#: ../../library/exceptions.rst:708 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1053,14 +1059,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:" "py:const:`~errno.EWOULDBLOCK` 及 :py:const:`~errno.EINPROGRESS`。" -#: ../../library/exceptions.rst:709 +#: ../../library/exceptions.rst:713 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" "除了 :exc:`OSError` 的那些屬性之外,:exc:`BlockingIOError` 有多一個屬性:" -#: ../../library/exceptions.rst:714 +#: ../../library/exceptions.rst:718 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1069,7 +1075,7 @@ msgstr "" "一個整數,內容為在其阻塞之前,已寫進串流的字元數。當使用 :mod:`io` 模組裡的緩" "衝 I/O 類別時這個屬性是可用的。" -#: ../../library/exceptions.rst:720 +#: ../../library/exceptions.rst:724 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." @@ -1077,11 +1083,11 @@ msgstr "" "當子行程上的操作失敗時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ECHILD`。" -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:729 msgid "A base class for connection-related issues." msgstr "連線相關問題的基礎類別。" -#: ../../library/exceptions.rst:727 +#: ../../library/exceptions.rst:731 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." @@ -1089,7 +1095,7 @@ msgstr "" "子類別有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:" "`ConnectionRefusedError` 及 :exc:`ConnectionResetError`。" -#: ../../library/exceptions.rst:732 +#: ../../library/exceptions.rst:736 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 " @@ -1100,7 +1106,7 @@ msgstr "" "會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應到 :c:data:" "`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" -#: ../../library/exceptions.rst:739 +#: ../../library/exceptions.rst:743 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1109,7 +1115,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點 (peer) 中斷時會引" "發此例外。對應到 :c:data:`errno` :py:const:`~errno.ECONNABORTED`。" -#: ../../library/exceptions.rst:745 +#: ../../library/exceptions.rst:749 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1118,7 +1124,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點拒絕時會引發此例" "外。對應到 :c:data:`errno` :py:const:`~errno.ECONNREFUSED`。" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:755 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." @@ -1126,7 +1132,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線被對等端點重置時會引發此例外。對應" "到 :c:data:`errno` :py:const:`~errno.ECONNRESET`。" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:761 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." @@ -1134,7 +1140,7 @@ msgstr "" "當嘗試建立已存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EEXIST`。" -#: ../../library/exceptions.rst:762 +#: ../../library/exceptions.rst:766 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." @@ -1142,7 +1148,7 @@ msgstr "" "當請求不存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ENOENT`。" -#: ../../library/exceptions.rst:767 +#: ../../library/exceptions.rst:771 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." @@ -1150,7 +1156,7 @@ msgstr "" "當系統呼叫被傳入的信號中斷時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EINTR`。" -#: ../../library/exceptions.rst:770 +#: ../../library/exceptions.rst:774 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " @@ -1159,7 +1165,7 @@ msgstr "" "現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引發 :exc:" "`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" -#: ../../library/exceptions.rst:777 +#: ../../library/exceptions.rst:781 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." @@ -1167,7 +1173,7 @@ msgstr "" "當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應到 :c:" "data:`errno` :py:const:`~errno.EISDIR`。" -#: ../../library/exceptions.rst:783 +#: ../../library/exceptions.rst:787 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 " @@ -1179,7 +1185,7 @@ msgstr "" "外。在大多數的 POSIX 平台上,如果嘗試操作開啟或遍歷一個當作目錄的非目錄檔案也" "會引發此例外。對應到 :c:data:`errno` :py:const:`~errno.ENOTDIR`。" -#: ../../library/exceptions.rst:791 +#: ../../library/exceptions.rst:795 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -1190,14 +1196,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` 及 :" "py:const:`~errno.ENOTCAPABLE`。" -#: ../../library/exceptions.rst:796 +#: ../../library/exceptions.rst:800 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" "WASI 的 :py:const:`~errno.ENOTCAPABLE` 現在對應到 :exc:`PermissionError`。" -#: ../../library/exceptions.rst:802 +#: ../../library/exceptions.rst:806 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." @@ -1205,7 +1211,7 @@ msgstr "" "當給定的行程不存在時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ESRCH`。" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:811 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." @@ -1213,40 +1219,40 @@ msgstr "" "當系統函式在系統層級超時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ETIMEDOUT`。" -#: ../../library/exceptions.rst:810 +#: ../../library/exceptions.rst:814 msgid "All the above :exc:`OSError` subclasses were added." msgstr "加入以上所有的 :exc:`OSError` 子類別。" -#: ../../library/exceptions.rst:816 +#: ../../library/exceptions.rst:820 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` — 改寫作業系統與 IO 例外階層" -#: ../../library/exceptions.rst:822 +#: ../../library/exceptions.rst:826 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:824 +#: ../../library/exceptions.rst:828 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" "以下的例外是當作警告的種類使用;更多細節參考 :ref:`warning-categories` 文件。" -#: ../../library/exceptions.rst:829 +#: ../../library/exceptions.rst:833 msgid "Base class for warning categories." msgstr "警告種類的基礎類別。" -#: ../../library/exceptions.rst:834 +#: ../../library/exceptions.rst:838 msgid "Base class for warnings generated by user code." msgstr "使用者程式碼產生的警告的基礎類別。" -#: ../../library/exceptions.rst:839 +#: ../../library/exceptions.rst:843 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "關於已棄用功能的警告的基礎類別,且當那些警告是針對其他 Python 開發者。" -#: ../../library/exceptions.rst:842 +#: ../../library/exceptions.rst:846 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode <devmode>` shows this " @@ -1255,17 +1261,17 @@ msgstr "" "會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟用 :ref:" "`Python 開發模式 <devmode>`\\ 會顯示此警告。" -#: ../../library/exceptions.rst:846 ../../library/exceptions.rst:862 +#: ../../library/exceptions.rst:850 ../../library/exceptions.rst:866 msgid "The deprecation policy is described in :pep:`387`." msgstr "棄用原則描述在 :pep:`387` 裡。" -#: ../../library/exceptions.rst:851 +#: ../../library/exceptions.rst:855 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "關於過時且預期未來要被棄用,但目前尚未被棄用的功能的警告的基礎類別。" -#: ../../library/exceptions.rst:855 +#: ../../library/exceptions.rst:859 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1274,8 +1280,8 @@ msgstr "" "因為發出關於可能即將被棄用的警告是不尋常的,此類別很少被使用,而對已經被棄用" "的情況會優先使用 :exc:`DeprecationWarning`。" -#: ../../library/exceptions.rst:859 ../../library/exceptions.rst:885 -#: ../../library/exceptions.rst:912 +#: ../../library/exceptions.rst:863 ../../library/exceptions.rst:889 +#: ../../library/exceptions.rst:916 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode <devmode>` shows this warning." @@ -1283,15 +1289,15 @@ msgstr "" "會被預設的警告過濾器忽略。啟用 :ref:`Python 開發模式 <devmode>`\\ 會顯示此警" "告。" -#: ../../library/exceptions.rst:867 +#: ../../library/exceptions.rst:871 msgid "Base class for warnings about dubious syntax." msgstr "關於可疑語法的警告的基礎類別。" -#: ../../library/exceptions.rst:872 +#: ../../library/exceptions.rst:876 msgid "Base class for warnings about dubious runtime behavior." msgstr "關於可疑執行環境行為的警告的基礎類別。" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:881 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1299,36 +1305,36 @@ msgstr "" "關於已棄用功能的警告的基礎類別,且當那些警告是針對以 Python 寫的應用程式的終" "端使用者。" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:887 msgid "Base class for warnings about probable mistakes in module imports." msgstr "關於在模組引入的可能錯誤的警告的基礎類別。" -#: ../../library/exceptions.rst:891 +#: ../../library/exceptions.rst:895 msgid "Base class for warnings related to Unicode." msgstr "Unicode 相關警告的基礎類別。" -#: ../../library/exceptions.rst:896 +#: ../../library/exceptions.rst:900 msgid "Base class for warnings related to encodings." msgstr "編碼相關警告的基礎類別。" -#: ../../library/exceptions.rst:898 +#: ../../library/exceptions.rst:902 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節參考\\ :ref:`io-encoding-warning`。" -#: ../../library/exceptions.rst:905 +#: ../../library/exceptions.rst:909 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` 及 :class:`bytearray` 相關警告的基礎類別。" -#: ../../library/exceptions.rst:910 +#: ../../library/exceptions.rst:914 msgid "Base class for warnings related to resource usage." msgstr "資源用法相關警告的基礎類別。" -#: ../../library/exceptions.rst:921 +#: ../../library/exceptions.rst:925 msgid "Exception groups" msgstr "例外群組" -#: ../../library/exceptions.rst:923 +#: ../../library/exceptions.rst:927 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 " @@ -1340,7 +1346,7 @@ msgstr "" "所有其他例外一樣使用 :keyword:`except` 來處理。此外,它們會以包含的例外類型為" "基礎來比對其子群組而被 :keyword:`except*<except_star>` 辨認出來。" -#: ../../library/exceptions.rst:932 +#: ../../library/exceptions.rst:936 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 " @@ -1356,7 +1362,7 @@ msgstr "" "`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕捉 :exc:" "`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" -#: ../../library/exceptions.rst:940 +#: ../../library/exceptions.rst:944 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1369,17 +1375,17 @@ msgstr "" "使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不是 :exc:" "`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引發 :exc:`TypeError`。" -#: ../../library/exceptions.rst:949 +#: ../../library/exceptions.rst:953 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "建構函式的 ``msg`` 引數。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:953 +#: ../../library/exceptions.rst:957 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "指定給建構函式 ``excs`` 序列中的例外組成的元組。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:958 +#: ../../library/exceptions.rst:962 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." @@ -1387,7 +1393,7 @@ msgstr "" "回傳只包含從現有群組比對到 *condition* 的例外的例外群組,或者當結果為空時回" "傳 ``None``。" -#: ../../library/exceptions.rst:961 +#: ../../library/exceptions.rst:965 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1396,7 +1402,7 @@ msgid "" "true for the exceptions that should be in the subgroup." msgstr "" -#: ../../library/exceptions.rst:967 +#: ../../library/exceptions.rst:971 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1409,7 +1415,7 @@ msgstr "" "__context__` 及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組" "會從結果裡排除。" -#: ../../library/exceptions.rst:974 +#: ../../library/exceptions.rst:978 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 " @@ -1418,11 +1424,11 @@ msgstr "" "條件會對巢狀例外群組裡的所有例外做檢查,包括頂層及任何巢狀的例外群組。如果條" "件對這樣的例外群組為 true,它會被完整包含在結果裡。" -#: ../../library/exceptions.rst:978 +#: ../../library/exceptions.rst:982 msgid "``condition`` can be any callable which is not a type object." msgstr "" -#: ../../library/exceptions.rst:983 +#: ../../library/exceptions.rst:987 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" @@ -1431,13 +1437,13 @@ msgstr "" "像 :meth:`subgroup` 一樣,但回傳一對 ``(match, rest)``,其中 ``match`` 是 " "``subgroup(condition)`` 而 ``rest`` 是剩下沒有比對到的部分。" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:993 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "回傳有相同 :attr:`message` 但將例外包裝在 ``excs`` 的例外群組。" -#: ../../library/exceptions.rst:992 +#: ../../library/exceptions.rst:996 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1448,7 +1454,7 @@ msgstr "" "組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不是 :" "exc:`ExceptionGroup` 的實例。" -#: ../../library/exceptions.rst:998 +#: ../../library/exceptions.rst:1002 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1461,7 +1467,7 @@ msgstr "" "`~BaseException.__context__` 和 :attr:`~BaseException.__notes__` 欄位到 :" "meth:`derive` 所回傳的例外群組上,因此這些欄位不需要被 :meth:`derive` 更新。" -#: ../../library/exceptions.rst:1005 +#: ../../library/exceptions.rst:1009 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1515,7 +1521,7 @@ msgstr "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" -#: ../../library/exceptions.rst:1031 +#: ../../library/exceptions.rst:1035 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1527,7 +1533,7 @@ msgstr "" "建構函式簽名的子類別需要覆寫它而不是 :meth:`~object.__init__`。例如下面定義了" "一個例外群組子類別接受 exit_code 並從中建構群組的訊息。: ::" -#: ../../library/exceptions.rst:1037 +#: ../../library/exceptions.rst:1041 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1547,7 +1553,7 @@ msgstr "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1046 +#: ../../library/exceptions.rst:1050 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" @@ -1556,15 +1562,15 @@ msgstr "" "像 :exc:`ExceptionGroup` 一樣,任何 :exc:`BaseExceptionGroup` 的子類別且也" "是 :exc:`Exception` 的子類別只能包裝 :exc:`Exception` 的實例。" -#: ../../library/exceptions.rst:1054 +#: ../../library/exceptions.rst:1058 msgid "Exception hierarchy" msgstr "例外階層" -#: ../../library/exceptions.rst:1056 +#: ../../library/exceptions.rst:1060 msgid "The class hierarchy for built-in exceptions is:" msgstr "內建例外的類別階層如下:" -#: ../../library/exceptions.rst:1058 +#: ../../library/exceptions.rst:1062 #, fuzzy msgid "" "BaseException\n" diff --git a/library/fnmatch.po b/library/fnmatch.po index 345fd99a0a..09b141490a 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,12 +90,20 @@ msgstr "" #: ../../library/fnmatch.rst:49 msgid "" -"Also note that :func:`functools.lru_cache` with the *maxsize* of 32768 is " -"used to cache the compiled regex patterns in the following functions: :func:" -"`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." +"Unless stated otherwise, \"filename string\" and \"pattern string\" either " +"refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note " +"that the functions documented below do not allow to mix a :class:`!bytes` " +"pattern with a :class:`!str` filename, and vice-versa." msgstr "" -#: ../../library/fnmatch.rst:55 +#: ../../library/fnmatch.rst:54 +msgid "" +"Finally, note that :func:`functools.lru_cache` with a *maxsize* of 32768 is " +"used to cache the (typed) compiled regex patterns in the following " +"functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." +msgstr "" + +#: ../../library/fnmatch.rst:61 msgid "" "Test whether the filename string *name* matches the pattern string *pat*, " "returning ``True`` or ``False``. Both parameters are case-normalized using :" @@ -104,13 +112,13 @@ msgid "" "operating system." msgstr "" -#: ../../library/fnmatch.rst:61 +#: ../../library/fnmatch.rst:67 msgid "" "This example will print all file names in the current directory with the " "extension ``.txt``::" msgstr "" -#: ../../library/fnmatch.rst:64 +#: ../../library/fnmatch.rst:70 msgid "" "import fnmatch\n" "import os\n" @@ -126,35 +134,35 @@ msgstr "" " if fnmatch.fnmatch(file, '*.txt'):\n" " print(file)" -#: ../../library/fnmatch.rst:74 +#: ../../library/fnmatch.rst:80 msgid "" "Test whether the filename string *name* matches the pattern string *pat*, " "returning ``True`` or ``False``; the comparison is case-sensitive and does " "not apply :func:`os.path.normcase`." msgstr "" -#: ../../library/fnmatch.rst:81 +#: ../../library/fnmatch.rst:87 msgid "" -"Construct a list from those elements of the :term:`iterable` *names* that " -"match pattern *pat*. It is the same as ``[n for n in names if fnmatch(n, " -"pat)]``, but implemented more efficiently." +"Construct a list from those elements of the :term:`iterable` of filename " +"strings *names* that match the pattern string *pat*. It is the same as ``[n " +"for n in names if fnmatch(n, pat)]``, but implemented more efficiently." msgstr "" -#: ../../library/fnmatch.rst:89 +#: ../../library/fnmatch.rst:95 msgid "" "Return the shell-style pattern *pat* converted to a regular expression for " -"using with :func:`re.match`." +"using with :func:`re.match`. The pattern is expected to be a :class:`str`." msgstr "" -#: ../../library/fnmatch.rst:92 +#: ../../library/fnmatch.rst:98 msgid "Example:" msgstr "範例:" -#: ../../library/fnmatch.rst:106 +#: ../../library/fnmatch.rst:112 msgid "Module :mod:`glob`" msgstr ":mod:`glob` 模組" -#: ../../library/fnmatch.rst:107 +#: ../../library/fnmatch.rst:113 msgid "Unix shell-style path expansion." msgstr "" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index cf0519c105..ee1707329b 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -595,7 +595,7 @@ msgstr "" #: ../../library/importlib.metadata.rst:377 msgid "" "Return a mapping from the top level module and import package names found " -"via :attr:`sys.meta_path` to the names of the distribution packages (if any) " +"via :data:`sys.meta_path` to the names of the distribution packages (if any) " "that provide the corresponding files." msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 8d69ebe9cb..18cc51f2ad 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -580,19 +580,23 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:383 +#: ../../library/importlib.rst:383 ../../library/importlib.rst:631 +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:385 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loading arbitrary resources from the storage back-end." msgstr "" -#: ../../library/importlib.rst:387 +#: ../../library/importlib.rst:389 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" -"class:`importlib.resources.abc.ResourceReader`." +"class:`importlib.resources.abc.TraversableResources`." msgstr "" -#: ../../library/importlib.rst:393 +#: ../../library/importlib.rst:395 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " @@ -602,34 +606,34 @@ msgid "" "__file__` attribute or an item from a package's :attr:`~module.__path__`." msgstr "" -#: ../../library/importlib.rst:402 +#: ../../library/importlib.rst:404 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:408 +#: ../../library/importlib.rst:410 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:413 +#: ../../library/importlib.rst:415 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:419 +#: ../../library/importlib.rst:421 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:425 +#: ../../library/importlib.rst:427 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:430 +#: ../../library/importlib.rst:432 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -638,23 +642,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:436 ../../library/importlib.rst:445 -#: ../../library/importlib.rst:495 +#: ../../library/importlib.rst:438 ../../library/importlib.rst:447 +#: ../../library/importlib.rst:497 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:441 +#: ../../library/importlib.rst:443 msgid "" "An optional method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:450 +#: ../../library/importlib.rst:452 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:452 +#: ../../library/importlib.rst:454 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -662,107 +666,107 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:457 +#: ../../library/importlib.rst:459 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:462 +#: ../../library/importlib.rst:464 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:467 +#: ../../library/importlib.rst:469 msgid "Implementation of :meth:`Loader.exec_module`." msgstr ":meth:`Loader.exec_module` 的實作。" -#: ../../library/importlib.rst:473 +#: ../../library/importlib.rst:475 msgid "Implementation of :meth:`Loader.load_module`." msgstr ":meth:`Loader.load_module` 的實作。" -#: ../../library/importlib.rst:475 +#: ../../library/importlib.rst:477 msgid "use :meth:`exec_module` instead." msgstr "請改用 :meth:`exec_module`。" -#: ../../library/importlib.rst:481 +#: ../../library/importlib.rst:483 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:487 +#: ../../library/importlib.rst:489 msgid "" "An abstract method that is to return the value of :attr:`~module.__file__` " "for the specified module. If no path is available, :exc:`ImportError` is " "raised." msgstr "" -#: ../../library/importlib.rst:491 +#: ../../library/importlib.rst:493 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:501 +#: ../../library/importlib.rst:503 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:505 +#: ../../library/importlib.rst:507 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:512 +#: ../../library/importlib.rst:514 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:516 +#: ../../library/importlib.rst:518 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:520 +#: ../../library/importlib.rst:522 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:524 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:527 ../../library/importlib.rst:1122 +#: ../../library/importlib.rst:529 ../../library/importlib.rst:1124 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:531 +#: ../../library/importlib.rst:533 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:536 +#: ../../library/importlib.rst:538 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:540 +#: ../../library/importlib.rst:542 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:541 +#: ../../library/importlib.rst:543 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:542 +#: ../../library/importlib.rst:544 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:545 +#: ../../library/importlib.rst:547 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -774,83 +778,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:556 +#: ../../library/importlib.rst:558 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:559 +#: ../../library/importlib.rst:561 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:561 +#: ../../library/importlib.rst:563 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:565 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:568 ../../library/importlib.rst:581 +#: ../../library/importlib.rst:570 ../../library/importlib.rst:583 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:573 +#: ../../library/importlib.rst:575 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:576 +#: ../../library/importlib.rst:578 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:586 +#: ../../library/importlib.rst:588 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:590 +#: ../../library/importlib.rst:592 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:594 +#: ../../library/importlib.rst:596 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:599 +#: ../../library/importlib.rst:601 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:603 +#: ../../library/importlib.rst:605 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:609 +#: ../../library/importlib.rst:611 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:611 +#: ../../library/importlib.rst:613 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:616 +#: ../../library/importlib.rst:618 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:620 +#: ../../library/importlib.rst:622 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -859,16 +863,12 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:629 -msgid "*Superseded by TraversableResources*" -msgstr "" - -#: ../../library/importlib.rst:631 +#: ../../library/importlib.rst:633 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:634 +#: ../../library/importlib.rst:636 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -878,7 +878,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:642 +#: ../../library/importlib.rst:644 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -890,7 +890,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:653 +#: ../../library/importlib.rst:655 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -899,37 +899,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:662 ../../library/importlib.rst:772 +#: ../../library/importlib.rst:664 ../../library/importlib.rst:774 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.rst:667 +#: ../../library/importlib.rst:669 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:670 +#: ../../library/importlib.rst:672 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:675 +#: ../../library/importlib.rst:677 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:677 +#: ../../library/importlib.rst:679 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:682 +#: ../../library/importlib.rst:684 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:687 +#: ../../library/importlib.rst:689 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -937,7 +937,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:693 +#: ../../library/importlib.rst:695 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -946,71 +946,71 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:703 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:706 +#: ../../library/importlib.rst:708 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.rst:709 +#: ../../library/importlib.rst:711 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.rst:714 +#: ../../library/importlib.rst:716 msgid "Use :class:`importlib.resources.abc.Traversable` instead." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:721 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:723 +#: ../../library/importlib.rst:725 msgid "Yield ``Traversable`` objects in ``self``." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:729 msgid "Return ``True`` if ``self`` is a directory." msgstr "" -#: ../../library/importlib.rst:731 +#: ../../library/importlib.rst:733 msgid "Return ``True`` if ``self`` is a file." msgstr "" -#: ../../library/importlib.rst:735 +#: ../../library/importlib.rst:737 msgid "Return Traversable child in ``self``." msgstr "" -#: ../../library/importlib.rst:739 +#: ../../library/importlib.rst:741 msgid "Return ``Traversable`` child in ``self``." msgstr "" -#: ../../library/importlib.rst:743 +#: ../../library/importlib.rst:745 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.rst:746 +#: ../../library/importlib.rst:748 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" -"attr:`io.TextIOWrapper`." +"class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:751 +#: ../../library/importlib.rst:753 msgid "Read contents of ``self`` as bytes." msgstr "" -#: ../../library/importlib.rst:755 +#: ../../library/importlib.rst:757 msgid "Read contents of ``self`` as text." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:762 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -1020,71 +1020,71 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:767 +#: ../../library/importlib.rst:769 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:777 +#: ../../library/importlib.rst:779 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." msgstr "" -#: ../../library/importlib.rst:783 +#: ../../library/importlib.rst:785 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:788 +#: ../../library/importlib.rst:790 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:792 +#: ../../library/importlib.rst:794 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:797 +#: ../../library/importlib.rst:799 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:806 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:809 ../../library/importlib.rst:819 -msgid "Use :attr:`BYTECODE_SUFFIXES` instead." +#: ../../library/importlib.rst:811 ../../library/importlib.rst:821 +msgid "Use :const:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:814 +#: ../../library/importlib.rst:816 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:824 +#: ../../library/importlib.rst:826 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:829 +#: ../../library/importlib.rst:831 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:834 +#: ../../library/importlib.rst:836 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:841 +#: ../../library/importlib.rst:843 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1093,57 +1093,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:852 +#: ../../library/importlib.rst:854 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:857 ../../library/importlib.rst:871 -#: ../../library/importlib.rst:884 ../../library/importlib.rst:899 +#: ../../library/importlib.rst:859 ../../library/importlib.rst:873 +#: ../../library/importlib.rst:886 ../../library/importlib.rst:901 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:860 +#: ../../library/importlib.rst:862 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:867 +#: ../../library/importlib.rst:869 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:874 +#: ../../library/importlib.rst:876 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:883 msgid "" ":term:`Finder <finder>` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:889 +#: ../../library/importlib.rst:891 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:896 +#: ../../library/importlib.rst:898 msgid "" "A :term:`Finder <finder>` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:904 +#: ../../library/importlib.rst:906 msgid "" "Class method that attempts to find a :term:`spec <module spec>` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1157,43 +1157,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:918 +#: ../../library/importlib.rst:920 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:927 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:930 +#: ../../library/importlib.rst:932 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:933 +#: ../../library/importlib.rst:935 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:940 +#: ../../library/importlib.rst:942 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:943 +#: ../../library/importlib.rst:945 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:946 +#: ../../library/importlib.rst:948 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1201,7 +1201,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:953 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1214,166 +1214,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:965 +#: ../../library/importlib.rst:967 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:969 +#: ../../library/importlib.rst:971 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:975 +#: ../../library/importlib.rst:977 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:979 +#: ../../library/importlib.rst:981 msgid "" "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 "" -#: ../../library/importlib.rst:984 +#: ../../library/importlib.rst:986 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:990 +#: ../../library/importlib.rst:992 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:998 +#: ../../library/importlib.rst:1000 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1002 +#: ../../library/importlib.rst:1004 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1006 +#: ../../library/importlib.rst:1008 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1010 +#: ../../library/importlib.rst:1012 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1016 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1018 ../../library/importlib.rst:1061 +#: ../../library/importlib.rst:1020 ../../library/importlib.rst:1063 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1023 ../../library/importlib.rst:1066 +#: ../../library/importlib.rst:1025 ../../library/importlib.rst:1068 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1030 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1031 +#: ../../library/importlib.rst:1033 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1040 +#: ../../library/importlib.rst:1042 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1046 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1048 +#: ../../library/importlib.rst:1050 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1054 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1056 +#: ../../library/importlib.rst:1058 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1073 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1074 +#: ../../library/importlib.rst:1076 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1079 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1083 +#: ../../library/importlib.rst:1085 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1088 ../../library/importlib.rst:1274 +#: ../../library/importlib.rst:1090 ../../library/importlib.rst:1276 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1092 +#: ../../library/importlib.rst:1094 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1096 +#: ../../library/importlib.rst:1098 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1103 +#: ../../library/importlib.rst:1105 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1109 +#: ../../library/importlib.rst:1111 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " -"based on :attr:`EXTENSION_SUFFIXES`." +"based on :const:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1114 +#: ../../library/importlib.rst:1116 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1118 +#: ../../library/importlib.rst:1120 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1129 +#: ../../library/importlib.rst:1131 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1134 +#: ../../library/importlib.rst:1136 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1391,7 +1391,7 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1147 +#: ../../library/importlib.rst:1149 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`~module.__spec__` attribute. Many " @@ -1404,19 +1404,19 @@ msgid "" "origin>`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1161 +#: ../../library/importlib.rst:1163 msgid "" "The module's fully qualified name (see :attr:`module.__name__`). The :term:" "`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1166 +#: ../../library/importlib.rst:1168 msgid "" "The :term:`loader` used to load the module (see :attr:`module.__loader__`). " "The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1173 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" "`module.__file__`). For example, for modules loaded from a ``.py`` file this " @@ -1425,14 +1425,14 @@ msgid "" "there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1180 +#: ../../library/importlib.rst:1182 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations in " "which a package's submodules will be found (see :attr:`module.__path__`). " "Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1185 +#: ../../library/importlib.rst:1187 msgid "" "The :term:`finder` should set this attribute to a sequence, even an empty " "one, to indicate to the import system that the module is a package. It " @@ -1440,41 +1440,41 @@ msgid "" "later to a special object for namespace packages." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1195 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1199 +#: ../../library/importlib.rst:1201 msgid "" "The filename of a compiled version of the module's code (see :attr:`module." "__cached__`). The :term:`finder` should always set this attribute but it may " "be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1206 +#: ../../library/importlib.rst:1208 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). See :attr:`module.__package__`. If the " "module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1213 +#: ../../library/importlib.rst:1215 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " "``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " "and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1220 +#: ../../library/importlib.rst:1222 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1223 +#: ../../library/importlib.rst:1225 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1483,7 +1483,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1229 +#: ../../library/importlib.rst:1231 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1497,7 +1497,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1242 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1513,7 +1513,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1254 +#: ../../library/importlib.rst:1256 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1522,7 +1522,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1262 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1533,35 +1533,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1270 +#: ../../library/importlib.rst:1272 msgid "Availability" msgstr "" -#: ../../library/importlib.rst:1278 +#: ../../library/importlib.rst:1280 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1282 +#: ../../library/importlib.rst:1284 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1288 +#: ../../library/importlib.rst:1290 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1292 +#: ../../library/importlib.rst:1294 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1297 +#: ../../library/importlib.rst:1299 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1304 +#: ../../library/importlib.rst:1306 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1571,7 +1571,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1311 +#: ../../library/importlib.rst:1313 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1584,7 +1584,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1321 +#: ../../library/importlib.rst:1323 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1593,18 +1593,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1331 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1333 ../../library/importlib.rst:1349 -#: ../../library/importlib.rst:1438 +#: ../../library/importlib.rst:1335 ../../library/importlib.rst:1351 +#: ../../library/importlib.rst:1440 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1339 +#: ../../library/importlib.rst:1341 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1614,25 +1614,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1354 +#: ../../library/importlib.rst:1356 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1362 +#: ../../library/importlib.rst:1364 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1364 +#: ../../library/importlib.rst:1366 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1369 +#: ../../library/importlib.rst:1371 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1640,13 +1640,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1377 +#: ../../library/importlib.rst:1379 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1384 +#: ../../library/importlib.rst:1386 msgid "" "Find the :term:`spec <module spec>` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1656,30 +1656,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1391 +#: ../../library/importlib.rst:1393 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1394 +#: ../../library/importlib.rst:1396 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1398 +#: ../../library/importlib.rst:1400 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1405 +#: ../../library/importlib.rst:1407 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "<importlib.abc.Loader.create_module>`." msgstr "" -#: ../../library/importlib.rst:1408 +#: ../../library/importlib.rst:1410 msgid "" "If :meth:`spec.loader.create_module <importlib.abc.Loader.create_module>` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1687,14 +1687,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1415 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1421 +#: ../../library/importlib.rst:1423 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1703,7 +1703,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1431 +#: ../../library/importlib.rst:1433 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1711,14 +1711,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1443 +#: ../../library/importlib.rst:1445 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1451 +#: ../../library/importlib.rst:1453 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1727,33 +1727,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1458 +#: ../../library/importlib.rst:1460 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1462 +#: ../../library/importlib.rst:1464 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1467 +#: ../../library/importlib.rst:1469 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1475 +#: ../../library/importlib.rst:1477 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1478 +#: ../../library/importlib.rst:1480 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1766,7 +1766,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1489 +#: ../../library/importlib.rst:1491 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1775,21 +1775,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1497 +#: ../../library/importlib.rst:1499 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1504 +#: ../../library/importlib.rst:1506 msgid "" "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 "" -#: ../../library/importlib.rst:1509 +#: ../../library/importlib.rst:1511 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1801,20 +1801,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1517 +#: ../../library/importlib.rst:1519 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1520 +#: ../../library/importlib.rst:1522 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1522 +#: ../../library/importlib.rst:1524 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1525 +#: ../../library/importlib.rst:1527 msgid "" "import importlib\n" "\n" @@ -1824,23 +1824,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1531 +#: ../../library/importlib.rst:1533 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1533 +#: ../../library/importlib.rst:1535 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1536 +#: ../../library/importlib.rst:1538 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1540 +#: ../../library/importlib.rst:1542 msgid "" "import importlib.util\n" "import sys\n" @@ -1860,11 +1860,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1559 +#: ../../library/importlib.rst:1561 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1561 +#: ../../library/importlib.rst:1563 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1874,13 +1874,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1568 +#: ../../library/importlib.rst:1570 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1570 +#: ../../library/importlib.rst:1572 msgid "" "import importlib.util\n" "import sys\n" @@ -1903,15 +1903,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1592 +#: ../../library/importlib.rst:1594 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1596 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1596 +#: ../../library/importlib.rst:1598 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1931,11 +1931,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1615 +#: ../../library/importlib.rst:1617 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1617 +#: ../../library/importlib.rst:1619 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1949,7 +1949,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1628 +#: ../../library/importlib.rst:1630 msgid "" "import importlib.machinery\n" "import sys\n" @@ -1973,11 +1973,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1649 +#: ../../library/importlib.rst:1651 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1651 +#: ../../library/importlib.rst:1653 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -1985,7 +1985,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1657 +#: ../../library/importlib.rst:1659 msgid "" "import importlib.util\n" "import sys\n" @@ -2018,11 +2018,11 @@ msgid "" " return module" msgstr "" -#: ../../library/importlib.rst:422 +#: ../../library/importlib.rst:424 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:422 +#: ../../library/importlib.rst:424 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" diff --git a/library/itertools.po b/library/itertools.po index 9dab9f209a..a7eb698d39 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1680,10 +1680,10 @@ msgstr "" #: ../../library/itertools.rst:839 msgid "" -"from collections import deque\n" +"from collections import Counter, deque\n" "from contextlib import suppress\n" "from functools import reduce\n" -"from math import sumprod, isqrt\n" +"from math import comb, prod, sumprod, isqrt\n" "from operator import itemgetter, getitem, mul, neg\n" "\n" "def take(n, iterable):\n" @@ -1973,7 +1973,13 @@ msgid "" " # totient(12) → 4 because len([1, 5, 7, 11]) == 4\n" " for prime in set(factor(n)):\n" " n -= n // prime\n" -" return n" +" return n\n" +"\n" +"def multinomial(*counts):\n" +" \"Number of distinct arrangements of a multiset.\"\n" +" # Counter('abracadabra').values() -> 5 2 1 1 2\n" +" # multinomial(5, 2, 1, 1, 2) → 83160\n" +" return prod(map(comb, accumulate(counts), counts))" msgstr "" #~ msgid "" diff --git a/library/json.po b/library/json.po index a7e1e63e67..70f2e1a62e 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-08-05 15:25+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -281,146 +281,155 @@ msgid "Basic Usage" msgstr "基本用法" #: ../../library/json.rst:153 +#, fuzzy msgid "" "Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-" -"supporting :term:`file-like object`) using this :ref:`conversion table <py-" -"to-json-table>`." +"supporting :term:`file-like object`) using this :ref:`Python-to-JSON " +"conversion table <py-to-json-table>`." msgstr "" "參考這個\\ :ref:`轉換表 <py-to-json-table>`\\ 將 *obj* 序列化為符合 JSON 格式" "的串流,並寫入到 *fp* (一個支援 ``.write()`` 方法的 :term:`file-like " "object`)" -#: ../../library/json.rst:157 +# SkyLull: 我想這裡的 "framed protocol" 指的是 +# https://peps.python.org/pep-3154/#framing +#: ../../library/json.rst:159 msgid "" -"If *skipkeys* is true (default: ``False``), then dict keys that are not of a " -"basic type (:class:`str`, :class:`int`, :class:`float`, :class:`bool`, " -"``None``) will be skipped instead of raising a :exc:`TypeError`." +"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " +"trying to serialize multiple objects with repeated calls to :func:`dump` " +"using the same *fp* will result in an invalid JSON file." msgstr "" -"如果 *skipkeys* 被設為 true(預設值:``False``),那麼非基本型別(:class:" -"`str`、:class:`int`、:class:`float`、:class:`bool`、``None``)的 dictionary" -"(字典)鍵值將被略過而不會引發 :exc:`TypeError`。" +"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不具有二進位分框(binary " +"framed)的協定,因此嘗試重複呼叫 :func:`dump` 來序列化多個物件到同一個 *fp* " +"裡將導致無效的 JSON 檔案。" -#: ../../library/json.rst:161 +#: ../../library/json.rst:0 +msgid "Parameters" +msgstr "" + +#: ../../library/json.rst:163 +msgid "The Python object to be serialized." +msgstr "" + +#: ../../library/json.rst:166 +#, fuzzy msgid "" -"The :mod:`json` module always produces :class:`str` objects, not :class:" -"`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` input." +"The file-like object *obj* will be serialized to. The :mod:`!json` module " +"always produces :class:`str` objects, not :class:`bytes` objects, therefore " +"``fp.write()`` must support :class:`str` input." msgstr "" ":mod:`json` 模組總是產生 :class:`str` 物件,而非 :class:`bytes` 物件。因此," "``fp.write()`` 必須支援 :class:`str` 輸入。" -#: ../../library/json.rst:165 ../../library/json.rst:442 +#: ../../library/json.rst:173 +#, fuzzy msgid "" -"If *ensure_ascii* is true (the default), the output is guaranteed to have " -"all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " -"these characters will be output as-is." +"If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :" +"class:`float`, :class:`bool`, ``None``) will be skipped instead of raising " +"a :exc:`TypeError`. Default ``False``." +msgstr "" +"如果 *skipkeys* 被設為 true(預設值:``False``),那麼非基本型別(:class:" +"`str`、:class:`int`、:class:`float`、:class:`bool`、``None``)的 dictionary" +"(字典)鍵值將被略過而不會引發 :exc:`TypeError`。" + +#: ../../library/json.rst:179 +#, fuzzy +msgid "" +"If ``True`` (the default), the output is guaranteed to have all incoming non-" +"ASCII characters escaped. If ``False``, these characters will be outputted " +"as-is." msgstr "" "如果 *ensure_ascii* 被設為 true(預設值),則輸出時將確保所有輸入的非 ASCII " "字元都會被轉義。若 *ensure_ascii* 為 false,則這些字元將照原樣輸出。" -#: ../../library/json.rst:169 +#: ../../library/json.rst:184 +#, fuzzy msgid "" -"If *check_circular* is false (default: ``True``), then the circular " -"reference check for container types will be skipped and a circular reference " -"will result in a :exc:`RecursionError` (or worse)." +"If ``False``, the circular reference check for container types is skipped " +"and a circular reference will result in a :exc:`RecursionError` (or worse). " +"Default ``True``." msgstr "" "如果 *check_circular* 設為 false(預設是 ``True``),則針對不同容器型別的循環" "參照 (circular reference) 檢查將會被跳過,若有循環參照則最後將引發 :exc:" "`RecursionError` (或其他更糟的錯誤)。" -#: ../../library/json.rst:173 +#: ../../library/json.rst:189 +#, fuzzy msgid "" -"If *allow_nan* is false (default: ``True``), then it will be a :exc:" -"`ValueError` to serialize out of range :class:`float` values (``nan``, " -"``inf``, ``-inf``) in strict compliance of the JSON specification. If " -"*allow_nan* is true, their JavaScript equivalents (``NaN``, ``Infinity``, ``-" -"Infinity``) will be used." +"If ``False``, serialization of out-of-range :class:`float` values (``nan``, " +"``inf``, ``-inf``) will result in a :exc:`ValueError`, in strict compliance " +"with the JSON specification. If ``True`` (the default), their JavaScript " +"equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used." msgstr "" "如果 *allow_nan* 為 false(預設值:``True``\\ ),則序列化不符合嚴格 JSON 規" "範的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:" "`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效表示 " "(``NaN``, ``Infinity``, ``-Infinity``)。" -#: ../../library/json.rst:179 ../../library/json.rst:461 +#: ../../library/json.rst:196 +#, fuzzy msgid "" -"If *indent* is a non-negative integer or string, then JSON array elements " -"and object members will be pretty-printed with that indent level. An indent " -"level of 0, negative, or ``\"\"`` will only insert newlines. ``None`` (the " -"default) selects the most compact 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." +"If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method " +"overridden, for serializing into custom datatypes. If ``None`` (the " +"default), :class:`!JSONEncoder` is used." msgstr "" -"如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進" -"行格式美化。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設" -"值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如" -"果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。" +"若要使用繼承自 :class:`JSONEncoder` 的自訂子類別(例如覆寫 :meth:" +"`~JSONEncoder.default` 方法來序列化其他型別的一個子類別物件),請使用關鍵字引" +"數 *cls* 指定該類別物件;否則預設使用 :class:`JSONEncoder`。" -#: ../../library/json.rst:186 ../../library/json.rst:468 -msgid "Allow strings for *indent* in addition to integers." -msgstr "除了整數之外,*indent* 還允許使用字串作為輸入。" +#: ../../library/json.rst:203 +msgid "" +"If a positive integer or string, JSON array elements and object members will " +"be pretty-printed with that indent level. A positive integer indents that " +"many spaces per level; a string (such as ``\"\\t\"``) is used to indent each " +"level. If zero, negative, or ``\"\"`` (the empty string), only newlines are " +"inserted. If ``None`` (the default), the most compact representation is used." +msgstr "" -#: ../../library/json.rst:189 ../../library/json.rst:471 +#: ../../library/json.rst:213 +#, fuzzy msgid "" -"If specified, *separators* should be an ``(item_separator, key_separator)`` " -"tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " -"': ')`` otherwise. To get the most compact JSON representation, you should " -"specify ``(',', ':')`` to eliminate whitespace." +"A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), " +"*separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, and " +"``(',', ': ')`` otherwise. For the most compact JSON, specify ``(',', ':')`` " +"to eliminate whitespace." msgstr "" "如果有指定本引數內容,*separators* 應該是一個 ``(item_separator, " "key_separator)`` 二元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': " "')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成" "指定 ``(',', ':')`` 來消除空格。" -#: ../../library/json.rst:194 ../../library/json.rst:476 -msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." -msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值" - -#: ../../library/json.rst:197 ../../library/json.rst:479 +#: ../../library/json.rst:222 +#, fuzzy msgid "" -"If specified, *default* should be a function that gets called for objects " -"that can't otherwise be serialized. It should return a JSON encodable " -"version of the object or raise a :exc:`TypeError`. If not specified, :exc:" -"`TypeError` is raised." +"A function that is called for objects that can't otherwise be serialized. It " +"should return a JSON encodable version of the object or raise a :exc:" +"`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised." msgstr "" "如果有指定本參數,*default* 會是一個遭遇無法序列化的物件時會被呼叫的函式。它" "應該回傳該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接" "引發 :exc:`TypeError`。" -#: ../../library/json.rst:202 +#: ../../library/json.rst:229 msgid "" -"If *sort_keys* is true (default: ``False``), then the output of dictionaries " -"will be sorted by key." +"If ``True``, dictionaries will be outputted sorted by key. Default ``False``." msgstr "" -"如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵值排序。" -#: ../../library/json.rst:205 -msgid "" -"To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :" -"meth:`~JSONEncoder.default` method to serialize additional types), specify " -"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used." -msgstr "" -"若要使用繼承自 :class:`JSONEncoder` 的自訂子類別(例如覆寫 :meth:" -"`~JSONEncoder.default` 方法來序列化其他型別的一個子類別物件),請使用關鍵字引" -"數 *cls* 指定該類別物件;否則預設使用 :class:`JSONEncoder`。" +#: ../../library/json.rst:233 ../../library/json.rst:518 +msgid "Allow strings for *indent* in addition to integers." +msgstr "除了整數之外,*indent* 還允許使用字串作為輸入。" -#: ../../library/json.rst:209 ../../library/json.rst:287 +#: ../../library/json.rst:236 ../../library/json.rst:526 +msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." +msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值" + +#: ../../library/json.rst:239 ../../library/json.rst:338 msgid "" "All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`." msgstr "" "所有可選參數現在都是\\ :ref:`僅限關鍵字 <keyword-only_parameter>`\\ 參數了。" -# SkyLull: 我想這裡的 "framed protocol" 指的是 -# https://peps.python.org/pep-3154/#framing -#: ../../library/json.rst:214 -msgid "" -"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " -"trying to serialize multiple objects with repeated calls to :func:`dump` " -"using the same *fp* will result in an invalid JSON file." -msgstr "" -"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不具有二進位分框(binary " -"framed)的協定,因此嘗試重複呼叫 :func:`dump` 來序列化多個物件到同一個 *fp* " -"裡將導致無效的 JSON 檔案。" - -#: ../../library/json.rst:223 +#: ../../library/json.rst:248 msgid "" "Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion " "table <py-to-json-table>`. The arguments have the same meaning as in :func:" @@ -429,7 +438,7 @@ msgstr "" "使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *obj* 序列化為 JSON 格式 :" "class:`str`。這個引數的作用與 :func:`dump` 中的同名引數意義相同。" -#: ../../library/json.rst:229 +#: ../../library/json.rst:254 msgid "" "Keys in key/value pairs of JSON are always of the type :class:`str`. When a " "dictionary is converted into JSON, all the keys of the dictionary are " @@ -442,113 +451,124 @@ msgstr "" "轉換回字典,則該字典可能不等於原始字典。也就是說,如果字典 x 含有非字串鍵值," "則 ``loads(dumps(x)) != x``。" -#: ../../library/json.rst:238 +#: ../../library/json.rst:265 +#, fuzzy msgid "" -"Deserialize *fp* (a ``.read()``-supporting :term:`text file` or :term:" -"`binary file` containing a JSON document) to a Python object using this :ref:" -"`conversion table <json-to-py-table>`." +"Deserialize *fp* to a Python object using the :ref:`JSON-to-Python " +"conversion table <json-to-py-table>`." msgstr "" "使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *fp*\\ (一個支援 ``." "read()``、包含 JSON 文件的\\ :term:`文字檔案 <text file>`\\ 或\\ :term:`二進" "位檔案 <binary file>`\\ )去序列化為 Python 物件。" -#: ../../library/json.rst:242 +#: ../../library/json.rst:268 +#, fuzzy msgid "" -"*object_hook* is an optional function that will be called with the result of " -"any object literal decoded (a :class:`dict`). The return value of " -"*object_hook* will be used instead of the :class:`dict`. This feature can " -"be used to implement custom decoders (e.g. `JSON-RPC <https://www.jsonrpc." -"org>`_ class hinting)." +"A ``.read()``-supporting :term:`text file` or :term:`binary file` containing " +"the JSON document to be deserialized." +msgstr "" +"使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *fp*\\ (一個支援 ``." +"read()``、包含 JSON 文件的\\ :term:`文字檔案 <text file>`\\ 或\\ :term:`二進" +"位檔案 <binary file>`\\ )去序列化為 Python 物件。" + +#: ../../library/json.rst:273 +msgid "" +"If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` " +"will be passed to the constructor of *cls*. If ``None`` (the default), :" +"class:`!JSONDecoder` is used." +msgstr "" + +#: ../../library/json.rst:280 +#, fuzzy +msgid "" +"If set, a function that is called with the result of any object literal " +"decoded (a :class:`dict`). The return value of this function will be used " +"instead of the :class:`dict`. This feature can be used to implement custom " +"decoders, for example `JSON-RPC <https://www.jsonrpc.org>`_ class hinting. " +"Default ``None``." msgstr "" "*object_hook* 是一個可選引數,其接受一個函式作為輸入。原始的字串解碼結果(一" "個 :class:`dict`\\ )將被傳入這個函式、並使用 *object_hook* 的回傳值來取代原" "先的 :class:`dict` 輸出。此功能可用於實作自訂解碼器(例如 `JSON-RPC <https://" "www.jsonrpc.org>`_ 類別提示)。" -#: ../../library/json.rst:248 +#: ../../library/json.rst:290 +#, fuzzy msgid "" -"*object_pairs_hook* is an optional function that will be called with the " -"result of any object literal decoded with an ordered list of pairs. The " -"return value of *object_pairs_hook* will be used instead of the :class:" -"`dict`. This feature can be used to implement custom decoders. If " -"*object_hook* is also defined, the *object_pairs_hook* takes priority." +"If set, a function that is called with the result of any object literal " +"decoded with an ordered list of pairs. The return value of this function " +"will be used instead of the :class:`dict`. This feature can be used to " +"implement custom decoders. If *object_hook* is also set, *object_pairs_hook* " +"takes priority. Default ``None``." msgstr "" "*object_pairs_hook* 是一個可選引數,其接受一個函式作為輸入。原始的有序對串列" "(ordered list of pairs)解碼結果將被傳入這個函式、並使用 " "*object_pairs_hook* 的回傳值來取代原先的 :class:`dict` 輸出。此功能可用於實作" "自訂解碼器。如果也同時給定了 *object_hook*,則 *object_pairs_hook* 優先。" -#: ../../library/json.rst:254 ../../library/json.rst:358 -msgid "Added support for *object_pairs_hook*." -msgstr "新增對於 *object_pairs_hook* 的支援。" - -#: ../../library/json.rst:257 ../../library/json.rst:361 +#: ../../library/json.rst:300 +#, fuzzy msgid "" -"*parse_float* is an optional function that will be called with the string of " -"every JSON float to be decoded. By default, this is equivalent to " -"``float(num_str)``. This can be used to use another datatype or parser for " -"JSON floats (e.g. :class:`decimal.Decimal`)." +"If set, a function that is called with the string of every JSON float to be " +"decoded. If ``None`` (the default), it is equivalent to ``float(num_str)``. " +"This can be used to parse JSON floats into custom datatypes, for example :" +"class:`decimal.Decimal`." msgstr "" "*parse_float* 為可選函式,每個要被解碼的 JSON 浮點數字串都會改用這個參數給定" "的函式來進行解碼。預設情況這等效於 ``float(num_str)``。這個參數可用於將 JSON " "中的浮點數解碼或剖析為另一種資料型別(例如 :class:`decimal.Decimal`\\ )。" -#: ../../library/json.rst:262 ../../library/json.rst:366 +#: ../../library/json.rst:308 +#, fuzzy msgid "" -"*parse_int* is an optional function that will be called with the string of " -"every JSON int to be decoded. By default, this is equivalent to " -"``int(num_str)``. This can be used to use another datatype or parser for " -"JSON integers (e.g. :class:`float`)." +"If set, a function that is called with the string of every JSON int to be " +"decoded. If ``None`` (the default), it is equivalent to ``int(num_str)``. " +"This can be used to parse JSON integers into custom datatypes, for example :" +"class:`float`." msgstr "" "*parse_int* 為可選函式,當解碼 JSON 整數字串時會被呼叫。預設情況等效於 " "``int(num_str)``。這個參數可用於將 JSON 中的整數解碼或剖析為另一種資料型別" "(例如 :class:`float`)。" -#: ../../library/json.rst:267 -msgid "" -"The default *parse_int* of :func:`int` now limits the maximum length of the " -"integer string via the interpreter's :ref:`integer string conversion length " -"limitation <int_max_str_digits>` to help avoid denial of service attacks." -msgstr "" -"預設 *parse_int* 使用的 :func:`int` 函式現在有限制整數字串的長度上限了,限制" -"由直譯器的\\ :ref:`整數字串轉換長度限制 <int_max_str_digits>`\\ 機制來達成," -"這能防止阻斷服務攻擊 (Denial of Service attacks)。" - -#: ../../library/json.rst:273 ../../library/json.rst:371 +#: ../../library/json.rst:316 +#, fuzzy msgid "" -"*parse_constant* is an optional function that will be called with one of the " -"following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " -"used to raise an exception if invalid JSON numbers are encountered." +"If set, a function that is called with one of the following strings: ``'-" +"Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an " +"exception if invalid JSON numbers are encountered. Default ``None``." msgstr "" "*parse_constant* 為可選函式,在解碼時若遭遇字串 ``'-Infinity'``、" "``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函式來進行解碼。這" "也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。" -#: ../../library/json.rst:277 -msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." +#: ../../library/json.rst:0 +msgid "Raises" msgstr "" -"遭遇 'null'、'true' 或 'false' 時不再以 *parse_constant* 給定的函式來處理了。" -#: ../../library/json.rst:280 -msgid "" -"To use a custom :class:`JSONDecoder` subclass, specify it with the ``cls`` " -"kwarg; otherwise :class:`JSONDecoder` is used. Additional keyword arguments " -"will be passed to the constructor of the class." +#: ../../library/json.rst:324 +#, fuzzy +msgid "When the data being deserialized is not a valid JSON document." msgstr "" -"若想要使用自訂的 :class:`JSONDecoder` 子類別物件,請以 ``cls`` 關鍵字引數指定" -"之,否則將使用預設的 :class:`JSONDecoder`。其他未使用到的關鍵字引數將繼續傳入" -"給 JSONDecoder 的建構函式使用。" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:" +"`JSONDecodeError` 例外。" -#: ../../library/json.rst:284 ../../library/json.rst:302 -#: ../../library/json.rst:380 +#: ../../library/json.rst:327 msgid "" -"If the data being deserialized is not a valid JSON document, a :exc:" -"`JSONDecodeError` will be raised." +"When the data being deserialized does not contain UTF-8, UTF-16 or UTF-32 " +"encoded data." msgstr "" -"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:" -"`JSONDecodeError` 例外。" -#: ../../library/json.rst:290 +#: ../../library/json.rst:333 +#, fuzzy +msgid "Added the optional *object_pairs_hook* parameter." +msgstr "新增對於 *object_pairs_hook* 的支援。" + +#: ../../library/json.rst:334 +msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." +msgstr "" +"遭遇 'null'、'true' 或 'false' 時不再以 *parse_constant* 給定的函式來處理了。" + +#: ../../library/json.rst:339 msgid "" "*fp* can now be a :term:`binary file`. The input encoding should be UTF-8, " "UTF-16 or UTF-32." @@ -556,21 +576,29 @@ msgstr "" "現在,*fp* 可以是一個\\ :term:`二進位檔案 <binary file>`,前提是其編碼格式為 " "UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:296 +#: ../../library/json.rst:342 +msgid "" +"The default *parse_int* of :func:`int` now limits the maximum length of the " +"integer string via the interpreter's :ref:`integer string conversion length " +"limitation <int_max_str_digits>` to help avoid denial of service attacks." +msgstr "" +"預設 *parse_int* 使用的 :func:`int` 函式現在有限制整數字串的長度上限了,限制" +"由直譯器的\\ :ref:`整數字串轉換長度限制 <int_max_str_digits>`\\ 機制來達成," +"這能防止阻斷服務攻擊 (Denial of Service attacks)。" + +#: ../../library/json.rst:350 +#, fuzzy msgid "" -"Deserialize *s* (a :class:`str`, :class:`bytes` or :class:`bytearray` " -"instance containing a JSON document) to a Python object using this :ref:" -"`conversion table <json-to-py-table>`." +"Identical to :func:`load`, but instead of a file-like object, deserialize " +"*s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance " +"containing a JSON document) to a Python object using this :ref:`conversion " +"table <json-to-py-table>`." msgstr "" "使用\\ :ref:`轉換表 <json-to-py-table>`\\ 將 *s* (一個含有 JSON 文件的 :" "class:`str`、:class:`bytes` 或 :class:`bytearray` 的實例(instance))去序列" "化(deserialize)為一個 Python 物件" -#: ../../library/json.rst:300 -msgid "The other arguments have the same meaning as in :func:`load`." -msgstr "其餘引數的使用方式與意義和 :func:`load` 的相同。" - -#: ../../library/json.rst:305 +#: ../../library/json.rst:355 msgid "" "*s* can now be of type :class:`bytes` or :class:`bytearray`. The input " "encoding should be UTF-8, UTF-16 or UTF-32." @@ -578,95 +606,95 @@ msgstr "" "現在,*s* 可以是一個二進位檔案如 :class:`bytes` 或 :class:`bytearray`,前提是" "其編碼格式為 UTF-8、UTF-16 或 UTF-32。" -#: ../../library/json.rst:309 +#: ../../library/json.rst:359 msgid "The keyword argument *encoding* has been removed." msgstr "刪除關鍵字引數 *encoding*。" -#: ../../library/json.rst:314 +#: ../../library/json.rst:364 msgid "Encoders and Decoders" msgstr "編碼器與解碼器" -#: ../../library/json.rst:318 +#: ../../library/json.rst:368 msgid "Simple JSON decoder." msgstr "簡易 JSON 解碼器" -#: ../../library/json.rst:320 +#: ../../library/json.rst:370 msgid "Performs the following translations in decoding by default:" msgstr "預設將執行下列資料型別轉換:" -#: ../../library/json.rst:325 ../../library/json.rst:413 +#: ../../library/json.rst:375 ../../library/json.rst:463 msgid "JSON" msgstr "JSON" -#: ../../library/json.rst:325 ../../library/json.rst:413 +#: ../../library/json.rst:375 ../../library/json.rst:463 msgid "Python" msgstr "Python" -#: ../../library/json.rst:327 ../../library/json.rst:415 +#: ../../library/json.rst:377 ../../library/json.rst:465 msgid "object" msgstr "object" -#: ../../library/json.rst:327 ../../library/json.rst:415 +#: ../../library/json.rst:377 ../../library/json.rst:465 msgid "dict" msgstr "dict" -#: ../../library/json.rst:329 ../../library/json.rst:417 +#: ../../library/json.rst:379 ../../library/json.rst:467 msgid "array" msgstr "array" -#: ../../library/json.rst:329 +#: ../../library/json.rst:379 msgid "list" msgstr "list" -#: ../../library/json.rst:331 ../../library/json.rst:419 +#: ../../library/json.rst:381 ../../library/json.rst:469 msgid "string" msgstr "string" -#: ../../library/json.rst:331 ../../library/json.rst:419 +#: ../../library/json.rst:381 ../../library/json.rst:469 msgid "str" msgstr "str" -#: ../../library/json.rst:333 +#: ../../library/json.rst:383 msgid "number (int)" msgstr "number (整數)" -#: ../../library/json.rst:333 +#: ../../library/json.rst:383 msgid "int" msgstr "int" -#: ../../library/json.rst:335 +#: ../../library/json.rst:385 msgid "number (real)" msgstr "number (實數)" -#: ../../library/json.rst:335 +#: ../../library/json.rst:385 msgid "float" msgstr "float" -#: ../../library/json.rst:337 ../../library/json.rst:423 +#: ../../library/json.rst:387 ../../library/json.rst:473 msgid "true" msgstr "true" -#: ../../library/json.rst:337 ../../library/json.rst:423 +#: ../../library/json.rst:387 ../../library/json.rst:473 msgid "True" msgstr "True" -#: ../../library/json.rst:339 ../../library/json.rst:425 +#: ../../library/json.rst:389 ../../library/json.rst:475 msgid "false" msgstr "false" -#: ../../library/json.rst:339 ../../library/json.rst:425 +#: ../../library/json.rst:389 ../../library/json.rst:475 msgid "False" msgstr "False" -#: ../../library/json.rst:341 ../../library/json.rst:427 +#: ../../library/json.rst:391 ../../library/json.rst:477 msgid "null" msgstr "null" -#: ../../library/json.rst:341 ../../library/json.rst:427 +#: ../../library/json.rst:391 ../../library/json.rst:477 msgid "None" msgstr "None" -#: ../../library/json.rst:344 +#: ../../library/json.rst:394 msgid "" "It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their " "corresponding ``float`` values, which is outside the JSON spec." @@ -674,7 +702,7 @@ msgstr "" "雖然 ``NaN``、``Infinity`` 和 ``-Infinity`` 並不符合 JSON 規範,但解碼器依然" "能正確地將其轉換到相應的 Python ``float`` 值。" -#: ../../library/json.rst:347 +#: ../../library/json.rst:397 msgid "" "*object_hook* is an optional function that will be called with the result of " "every JSON object decoded and its return value will be used in place of the " @@ -685,7 +713,7 @@ msgstr "" "回傳值來取代原先的 :class:`dict`。這個功能可用於提供自訂的去序列化(例如支援 " "`JSON-RPC <https://www.jsonrpc.org>`_ 類別提示)。" -#: ../../library/json.rst:352 +#: ../../library/json.rst:402 msgid "" "*object_pairs_hook* is an optional function that will be called with the " "result of every JSON object decoded with an ordered list of pairs. The " @@ -694,7 +722,43 @@ msgid "" "*object_hook* is also defined, the *object_pairs_hook* takes priority." msgstr "" -#: ../../library/json.rst:375 +#: ../../library/json.rst:408 +msgid "Added support for *object_pairs_hook*." +msgstr "新增對於 *object_pairs_hook* 的支援。" + +#: ../../library/json.rst:411 +msgid "" +"*parse_float* is an optional function that will be called with the string of " +"every JSON float to be decoded. By default, this is equivalent to " +"``float(num_str)``. This can be used to use another datatype or parser for " +"JSON floats (e.g. :class:`decimal.Decimal`)." +msgstr "" +"*parse_float* 為可選函式,每個要被解碼的 JSON 浮點數字串都會改用這個參數給定" +"的函式來進行解碼。預設情況這等效於 ``float(num_str)``。這個參數可用於將 JSON " +"中的浮點數解碼或剖析為另一種資料型別(例如 :class:`decimal.Decimal`\\ )。" + +#: ../../library/json.rst:416 +msgid "" +"*parse_int* is an optional function that will be called with the string of " +"every JSON int to be decoded. By default, this is equivalent to " +"``int(num_str)``. This can be used to use another datatype or parser for " +"JSON integers (e.g. :class:`float`)." +msgstr "" +"*parse_int* 為可選函式,當解碼 JSON 整數字串時會被呼叫。預設情況等效於 " +"``int(num_str)``。這個參數可用於將 JSON 中的整數解碼或剖析為另一種資料型別" +"(例如 :class:`float`)。" + +#: ../../library/json.rst:421 +msgid "" +"*parse_constant* is an optional function that will be called with one of the " +"following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " +"used to raise an exception if invalid JSON numbers are encountered." +msgstr "" +"*parse_constant* 為可選函式,在解碼時若遭遇字串 ``'-Infinity'``、" +"``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函式來進行解碼。這" +"也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。" + +#: ../../library/json.rst:425 msgid "" "If *strict* is false (``True`` is the default), then control characters will " "be allowed inside strings. Control characters in this context are those " @@ -705,25 +769,33 @@ msgstr "" "語境中的控制字元指的是 ASCII 字元編碼在 0~31 範圍內的字元,包括 ``'\\t'``" "(tab)、``'\\n'``、``'\\r'`` 和 ``'\\0'``。" -#: ../../library/json.rst:383 ../../library/json.rst:484 +#: ../../library/json.rst:430 +msgid "" +"If the data being deserialized is not a valid JSON document, a :exc:" +"`JSONDecodeError` will be raised." +msgstr "" +"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:" +"`JSONDecodeError` 例外。" + +#: ../../library/json.rst:433 ../../library/json.rst:534 msgid "All parameters are now :ref:`keyword-only <keyword-only_parameter>`." msgstr "" "所有參數現在都是\\ :ref:`僅限關鍵字參數 <keyword-only_parameter>`\\ 了。" -#: ../../library/json.rst:388 +#: ../../library/json.rst:438 msgid "" "Return the Python representation of *s* (a :class:`str` instance containing " "a JSON document)." msgstr "" "回傳用 Python 型式表達的 *s* (一個含有 JSON 文件的 :class:`str` 實例)。" -#: ../../library/json.rst:391 +#: ../../library/json.rst:441 msgid "" ":exc:`JSONDecodeError` will be raised if the given JSON document is not " "valid." msgstr "若給定的輸入不符合 JSON 格式會引發 :exc:`JSONDecodeError` 例外。" -#: ../../library/json.rst:396 +#: ../../library/json.rst:446 msgid "" "Decode a JSON document from *s* (a :class:`str` beginning with a JSON " "document) and return a 2-tuple of the Python representation and the index in " @@ -732,40 +804,40 @@ msgstr "" "將 *s* (一個開頭部分含有合格 JSON 文件的 :class:`str`) 解碼,並將 JSON 文件" "結束點的索引值(index)和解碼結果合併為一個二元組(2-tuple)後回傳。" -#: ../../library/json.rst:400 +#: ../../library/json.rst:450 msgid "" "This can be used to decode a JSON document from a string that may have " "extraneous data at the end." msgstr "這個方法可以用來解碼尾段可能帶有 JSON 以外資料的文字。" -#: ../../library/json.rst:406 +#: ../../library/json.rst:456 msgid "Extensible JSON encoder for Python data structures." msgstr "可擴充的 Python 資料結構 JSON 編碼器。" -#: ../../library/json.rst:408 +#: ../../library/json.rst:458 msgid "Supports the following objects and types by default:" msgstr "預設可支援下列物件及型別:" -#: ../../library/json.rst:417 +#: ../../library/json.rst:467 msgid "list, tuple" msgstr "list, tuple" -#: ../../library/json.rst:421 +#: ../../library/json.rst:471 msgid "int, float, int- & float-derived Enums" msgstr "" "int、float 或可作為整數或浮點數運算的衍生列舉(int- or float-derived Enums)" -#: ../../library/json.rst:421 +#: ../../library/json.rst:471 msgid "number" msgstr "number" -#: ../../library/json.rst:430 +#: ../../library/json.rst:480 msgid "Added support for int- and float-derived Enum classes." msgstr "" "增加對整數(int)、浮點數(float)或可作為整數或浮點數運算的衍生列舉(int- " "or float-derived Enums)類別的支援性。" -#: ../../library/json.rst:433 +#: ../../library/json.rst:483 msgid "" "To extend this to recognize other objects, subclass and implement a :meth:" "`~JSONEncoder.default` method with another method that returns a " @@ -776,7 +848,7 @@ msgstr "" "方法。此方法應回傳一個可序列化的 ``o`` 物件,否則此方法應呼叫父類別的 " "JSONEncoder.default 方法(以引發 :exc:`TypeError` 例外)。" -#: ../../library/json.rst:438 +#: ../../library/json.rst:488 msgid "" "If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when " "trying to encode keys that are not :class:`str`, :class:`int`, :class:" @@ -786,7 +858,16 @@ msgstr "" "`int`、:class:`float` 或 ``None`` 的鍵值時,將引發 :exc:`TypeError`。如果 " "*skipkeys* 為 true,這些項目將直接被跳過。" -#: ../../library/json.rst:446 +#: ../../library/json.rst:492 +msgid "" +"If *ensure_ascii* is true (the default), the output is guaranteed to have " +"all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " +"these characters will be output as-is." +msgstr "" +"如果 *ensure_ascii* 被設為 true(預設值),則輸出時將確保所有輸入的非 ASCII " +"字元都會被轉義。若 *ensure_ascii* 為 false,則這些字元將照原樣輸出。" + +#: ../../library/json.rst:496 msgid "" "If *check_circular* is true (the default), then lists, dicts, and custom " "encoded objects will be checked for circular references during encoding to " @@ -797,7 +878,7 @@ msgstr "" "(dict)和自訂編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:" "`RecursionError` 例外的問題)。否則不會進行此類檢查。" -#: ../../library/json.rst:451 +#: ../../library/json.rst:501 msgid "" "If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-" "Infinity`` will be encoded as such. This behavior is not JSON specification " @@ -809,7 +890,7 @@ msgstr "" "數基於 JavaScript 的編碼器和解碼器一致。否則若設為 false,嘗試對這些浮點數進" "行編碼將引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:457 +#: ../../library/json.rst:507 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key; this is useful for regression tests to ensure that " @@ -819,7 +900,44 @@ msgstr "" "按鍵值排序。這項功能可確保 JSON 序列化的結果能被互相比較,能讓日常的回歸測試" "檢查變得方便一些。" -#: ../../library/json.rst:490 +#: ../../library/json.rst:511 +msgid "" +"If *indent* is a non-negative integer or string, then JSON array elements " +"and object members will be pretty-printed with that indent level. An indent " +"level of 0, negative, or ``\"\"`` will only insert newlines. ``None`` (the " +"default) selects the most compact 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 "" +"如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進" +"行格式美化。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設" +"值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如" +"果 *indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。" + +#: ../../library/json.rst:521 +msgid "" +"If specified, *separators* should be an ``(item_separator, key_separator)`` " +"tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " +"': ')`` otherwise. To get the most compact JSON representation, you should " +"specify ``(',', ':')`` to eliminate whitespace." +msgstr "" +"如果有指定本引數內容,*separators* 應該是一個 ``(item_separator, " +"key_separator)`` 二元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': " +"')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成" +"指定 ``(',', ':')`` 來消除空格。" + +#: ../../library/json.rst:529 +msgid "" +"If specified, *default* should be a function that gets called for objects " +"that can't otherwise be serialized. It should return a JSON encodable " +"version of the object or raise a :exc:`TypeError`. If not specified, :exc:" +"`TypeError` is raised." +msgstr "" +"如果有指定本參數,*default* 會是一個遭遇無法序列化的物件時會被呼叫的函式。它" +"應該回傳該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接" +"引發 :exc:`TypeError`。" + +#: ../../library/json.rst:540 msgid "" "Implement this method in a subclass such that it returns a serializable " "object for *o*, or calls the base implementation (to raise a :exc:" @@ -828,7 +946,7 @@ msgstr "" "在任意一個子類別裡實作這個方法時須讓其回傳一個可序列化的物件 *o* ,或呼叫原始" "的實作以引發 :exc:`TypeError` 例外。" -#: ../../library/json.rst:494 +#: ../../library/json.rst:544 msgid "" "For example, to support arbitrary iterators, you could implement :meth:" "`~JSONEncoder.default` like this::" @@ -836,7 +954,7 @@ msgstr "" "舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子的 :meth:" "`~JSONEncoder.default`: ::" -#: ../../library/json.rst:497 +#: ../../library/json.rst:547 msgid "" "def default(self, o):\n" " try:\n" @@ -849,13 +967,13 @@ msgid "" " return super().default(o)" msgstr "" -#: ../../library/json.rst:510 +#: ../../library/json.rst:560 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如: ::" -#: ../../library/json.rst:513 +#: ../../library/json.rst:563 msgid "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" @@ -863,7 +981,7 @@ msgstr "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" -#: ../../library/json.rst:519 +#: ../../library/json.rst:569 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" @@ -871,7 +989,7 @@ msgstr "" "將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的物件。如下" "例: ::" -#: ../../library/json.rst:522 +#: ../../library/json.rst:572 msgid "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" @@ -879,39 +997,39 @@ msgstr "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" -#: ../../library/json.rst:527 +#: ../../library/json.rst:577 msgid "Exceptions" msgstr "例外" -#: ../../library/json.rst:531 +#: ../../library/json.rst:581 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr ":exc:`ValueError` 的子類別具有下列額外屬性:" -#: ../../library/json.rst:535 +#: ../../library/json.rst:585 msgid "The unformatted error message." msgstr "未受格式化的錯誤訊息。" -#: ../../library/json.rst:539 +#: ../../library/json.rst:589 msgid "The JSON document being parsed." msgstr "正在被剖析的 JSON 文件。" -#: ../../library/json.rst:543 +#: ../../library/json.rst:593 msgid "The start index of *doc* where parsing failed." msgstr "*doc* 剖析失敗處的起始點的索引值。" -#: ../../library/json.rst:547 +#: ../../library/json.rst:597 msgid "The line corresponding to *pos*." msgstr "*pos* 所在的列(line)數。" -#: ../../library/json.rst:551 +#: ../../library/json.rst:601 msgid "The column corresponding to *pos*." msgstr "*pos* 所在的行(column)數。" -#: ../../library/json.rst:557 +#: ../../library/json.rst:607 msgid "Standard Compliance and Interoperability" msgstr "合規性與互通性(Interoperability)" -#: ../../library/json.rst:559 +#: ../../library/json.rst:609 #, fuzzy msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 <https://ecma-" @@ -925,7 +1043,7 @@ msgstr "" "組對 RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` " "子類別以及未明確提及的參數將不予討論。" -#: ../../library/json.rst:565 +#: ../../library/json.rst:615 msgid "" "This module does not comply with the RFC in a strict fashion, implementing " "some extensions that are valid JavaScript but not valid JSON. In particular:" @@ -933,17 +1051,17 @@ msgstr "" "這個模組的部份實作並未非常嚴格地遵循 RFC 規範。準確來說,下列實際實作符合 " "JavaScript 語法格式,但並不符合 JSON 格式:" -#: ../../library/json.rst:568 +#: ../../library/json.rst:618 msgid "Infinite and NaN number values are accepted and output;" msgstr "無限(Infinite)和非數字(NaN)值會被接受。" -#: ../../library/json.rst:569 +#: ../../library/json.rst:619 msgid "" "Repeated names within an object are accepted, and only the value of the last " "name-value pair is used." msgstr "同一個物件內可以有重複的名稱,但只有最後一個同名物件是有效的。" -#: ../../library/json.rst:572 +#: ../../library/json.rst:622 msgid "" "Since the RFC permits RFC-compliant parsers to accept input texts that are " "not RFC-compliant, this module's deserializer is technically RFC-compliant " @@ -952,11 +1070,11 @@ msgstr "" "不過 RFC 准許遵循 RFC 的剖析器接受不合規的文字輸入,所以技術上來說若以預設設" "定運作,本模組的去序列化器(deserializer)是符合 RFC 規範的。" -#: ../../library/json.rst:577 +#: ../../library/json.rst:627 msgid "Character Encodings" msgstr "字元編碼格式" -#: ../../library/json.rst:579 +#: ../../library/json.rst:629 msgid "" "The RFC requires that JSON be represented using either UTF-8, UTF-16, or " "UTF-32, with UTF-8 being the recommended default for maximum " @@ -965,7 +1083,7 @@ msgstr "" "RFC 要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編碼以" "達成最佳的互通性。" -#: ../../library/json.rst:582 +#: ../../library/json.rst:632 msgid "" "As permitted, though not required, by the RFC, this module's serializer sets " "*ensure_ascii=True* by default, thus escaping the output so that the " @@ -974,7 +1092,7 @@ msgstr "" "RFC 准許但並不強制編碼器的 *ensure_ascii=True* 行為是預設值,但本模組依然實作" "了此一選項作為預設,因此本模組預設會轉義所有非 ASCII 字元。" -#: ../../library/json.rst:586 +#: ../../library/json.rst:636 msgid "" "Other than the *ensure_ascii* parameter, this module is defined strictly in " "terms of conversion between Python objects and :class:`Unicode strings " @@ -984,7 +1102,7 @@ msgstr "" "除了 *ensure_ascii* 選項參數之外,本模組嚴格遵循 Python 物件與 :class:" "`Unicode strings <str>` 之間的轉換規範,因此並不另外處理字元編碼的問題。" -#: ../../library/json.rst:591 +#: ../../library/json.rst:641 msgid "" "The RFC prohibits adding a byte order mark (BOM) to the start of a JSON " "text, and this module's serializer does not add a BOM to its output. The RFC " @@ -997,7 +1115,7 @@ msgstr "" "(deserializer)忽略文件初始的端序記號,因此本模組的去序列化器將在遭遇位於文" "件開頭的端序記號時引發 :exc:`ValueError` 例外。" -#: ../../library/json.rst:597 +#: ../../library/json.rst:647 msgid "" "The RFC does not explicitly forbid JSON strings which contain byte sequences " "that don't correspond to valid Unicode characters (e.g. unpaired UTF-16 " @@ -1010,11 +1128,11 @@ msgstr "" "預設情況下,當原始輸入的 :class:`str` 中存在此類序列時,該模組將接受並輸出這" "些序列的編碼位置(code points)。" -#: ../../library/json.rst:605 +#: ../../library/json.rst:655 msgid "Infinite and NaN Number Values" msgstr "正負無限與非數值" -#: ../../library/json.rst:607 +#: ../../library/json.rst:657 msgid "" "The RFC does not permit the representation of infinite or NaN number values. " "Despite that, by default, this module accepts and outputs ``Infinity``, ``-" @@ -1023,7 +1141,7 @@ msgstr "" "RFC 不允許表現無限大或非數值(NaN)。但預設情況下,這個模組仍接受並輸出 " "``Infinity``、``-Infinity`` 和 ``NaN``,如同它們是有效的 JSON 數值字面值: ::" -#: ../../library/json.rst:611 +#: ../../library/json.rst:661 msgid "" ">>> # Neither of these calls raises an exception, but the results are not " "valid JSON\n" @@ -1038,7 +1156,7 @@ msgid "" "nan" msgstr "" -#: ../../library/json.rst:622 +#: ../../library/json.rst:672 msgid "" "In the serializer, the *allow_nan* parameter can be used to alter this " "behavior. In the deserializer, the *parse_constant* parameter can be used " @@ -1047,11 +1165,11 @@ msgstr "" "在序列化器中,*allow_nan* 參數可以改變這個行為。在去序列化器中," "*parse_constant* 參數可以改變這個行為。" -#: ../../library/json.rst:628 +#: ../../library/json.rst:678 msgid "Repeated Names Within an Object" msgstr "物件內重複的名稱" -#: ../../library/json.rst:630 +#: ../../library/json.rst:680 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -1062,22 +1180,22 @@ msgstr "" "字。預設情況下,本模組不會因此引發例外;相反的,它會忽略該名字的所有重複鍵值" "對,並只保留最後一個: ::" -#: ../../library/json.rst:635 +#: ../../library/json.rst:685 msgid "" ">>> weird_json = '{\"x\": 1, \"x\": 2, \"x\": 3}'\n" ">>> json.loads(weird_json)\n" "{'x': 3}" msgstr "" -#: ../../library/json.rst:639 +#: ../../library/json.rst:689 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "*object_parts_hook* 參數可以改變這個行為。" -#: ../../library/json.rst:643 +#: ../../library/json.rst:693 msgid "Top-level Non-Object, Non-Array Values" msgstr "位於頂層的非物件及非列表值" -#: ../../library/json.rst:645 +#: ../../library/json.rst:695 msgid "" "The old version of JSON specified by the obsolete :rfc:`4627` required that " "the top-level value of a JSON text must be either a JSON object or array " @@ -1091,37 +1209,37 @@ msgstr "" "boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而本模組的序列化器或去串" "列化器中未曾實施過該限制。" -#: ../../library/json.rst:652 +#: ../../library/json.rst:702 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "如果想要最大限度地保留互通性,你可能還是會想要自行施加這個限制。" -#: ../../library/json.rst:657 +#: ../../library/json.rst:707 msgid "Implementation Limitations" msgstr "實作限制" -#: ../../library/json.rst:659 +#: ../../library/json.rst:709 msgid "Some JSON deserializer implementations may set limits on:" msgstr "某些 JSON 去序列化器的實作可能會造成下列限制:" -#: ../../library/json.rst:661 +#: ../../library/json.rst:711 msgid "the size of accepted JSON texts" msgstr "JSON 文件長度上限" -#: ../../library/json.rst:662 +#: ../../library/json.rst:712 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "JSON 物件或陣列的最大巢狀層數(level of nesting)限制" -#: ../../library/json.rst:663 +#: ../../library/json.rst:713 msgid "the range and precision of JSON numbers" msgstr "數字的精準度或範圍" -#: ../../library/json.rst:664 +#: ../../library/json.rst:714 msgid "the content and maximum length of JSON strings" msgstr "JSON 字串長度上限" -#: ../../library/json.rst:666 +#: ../../library/json.rst:716 msgid "" "This module does not impose any such limits beyond those of the relevant " "Python datatypes themselves or the Python interpreter itself." @@ -1129,7 +1247,7 @@ msgstr "" "本模組除了 Python 資料型態本身或 Python 直譯器本身的限制以外,不會設定任何此" "類限制。" -#: ../../library/json.rst:669 +#: ../../library/json.rst:719 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -1144,22 +1262,22 @@ msgstr "" "因而受到其表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` 數" "值、或是序列化特殊數字型別的實例時(例如 :class:`decimal.Decimal`)尤其重要。" -#: ../../library/json.rst:682 +#: ../../library/json.rst:732 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/json.rst:687 +#: ../../library/json.rst:737 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "**原始碼:**\\ :source:`Lib/json/tool.py`" -#: ../../library/json.rst:691 +#: ../../library/json.rst:741 msgid "" "The :mod:`json.tool` module provides a simple command line interface to " "validate and pretty-print JSON objects." msgstr "" ":mod:`json.tool` 模組提供了一個簡易的命令列界面以供校驗與美化呈現 JSON 物件。" -#: ../../library/json.rst:694 +#: ../../library/json.rst:744 msgid "" "If the optional ``infile`` and ``outfile`` arguments are not specified, :" "data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" @@ -1167,7 +1285,7 @@ msgstr "" "如果沒有指定可選引數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` 和 :" "data:`sys.stdout` 將各自做為輸入和輸出的預設值。" -#: ../../library/json.rst:697 +#: ../../library/json.rst:747 msgid "" "$ echo '{\"json\": \"obj\"}' | python -m json.tool\n" "{\n" @@ -1177,7 +1295,7 @@ msgid "" "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)" msgstr "" -#: ../../library/json.rst:706 +#: ../../library/json.rst:756 msgid "" "The output is now in the same order as the input. Use the :option:`--sort-" "keys` option to sort the output of dictionaries alphabetically by key." @@ -1185,15 +1303,15 @@ msgstr "" "現在開始輸出和輸入的資料順序會是相同的。傳入 :option:`--sort-keys` 引數以按照" "鍵值的字母順序對輸出進行排序。" -#: ../../library/json.rst:713 +#: ../../library/json.rst:763 msgid "Command line options" msgstr "命令列選項" -#: ../../library/json.rst:717 +#: ../../library/json.rst:767 msgid "The JSON file to be validated or pretty-printed:" msgstr "將被用於校驗或美化呈現的 JSON 文件:" -#: ../../library/json.rst:719 +#: ../../library/json.rst:769 msgid "" "$ python -m json.tool mp_films.json\n" "[\n" @@ -1219,11 +1337,11 @@ msgstr "" " }\n" "]" -#: ../../library/json.rst:733 +#: ../../library/json.rst:783 msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "如果沒有指定 *infile* 則會從 :data:`sys.stdin` 讀取輸入。" -#: ../../library/json.rst:737 +#: ../../library/json.rst:787 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " "to :data:`sys.stdout`." @@ -1231,33 +1349,33 @@ msgstr "" "將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到 :data:`sys." "stdout`。" -#: ../../library/json.rst:742 +#: ../../library/json.rst:792 msgid "Sort the output of dictionaries alphabetically by key." msgstr "按照鍵值的字母順序對輸出字典進行排序。" -#: ../../library/json.rst:748 +#: ../../library/json.rst:798 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "關閉非 ASCII 字元的自動轉義功能。詳情請參照 :func:`json.dumps`。" -#: ../../library/json.rst:754 +#: ../../library/json.rst:804 msgid "Parse every input line as separate JSON object." msgstr "將每一行輸入都單獨輸出為一個 JSON 物件。" -#: ../../library/json.rst:760 +#: ../../library/json.rst:810 msgid "Mutually exclusive options for whitespace control." msgstr "互斥的空白字元控制選項。" -#: ../../library/json.rst:766 +#: ../../library/json.rst:816 msgid "Show the help message." msgstr "顯示說明訊息。" -#: ../../library/json.rst:770 +#: ../../library/json.rst:820 msgid "Footnotes" msgstr "註解" -#: ../../library/json.rst:771 +#: ../../library/json.rst:821 msgid "" "As noted in `the errata for RFC 7159 <https://www.rfc-editor.org/" "errata_search.php?rfc=7159>`_, JSON permits literal U+2028 (LINE SEPARATOR) " @@ -1268,6 +1386,24 @@ msgstr "" "所述,JSON 允許字串中出現 U+2028(列分隔符)和 U+2029(段落分隔符)字元,而 " "JavaScript(截至 ECMAScript 5.1 版)則不允許。" +#~ msgid "" +#~ "If *sort_keys* is true (default: ``False``), then the output of " +#~ "dictionaries will be sorted by key." +#~ msgstr "" +#~ "如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵值排序。" + +#~ msgid "" +#~ "To use a custom :class:`JSONDecoder` subclass, specify it with the " +#~ "``cls`` kwarg; otherwise :class:`JSONDecoder` is used. Additional " +#~ "keyword arguments will be passed to the constructor of the class." +#~ msgstr "" +#~ "若想要使用自訂的 :class:`JSONDecoder` 子類別物件,請以 ``cls`` 關鍵字引數" +#~ "指定之,否則將使用預設的 :class:`JSONDecoder`。其他未使用到的關鍵字引數將" +#~ "繼續傳入給 JSONDecoder 的建構函式使用。" + +#~ msgid "The other arguments have the same meaning as in :func:`load`." +#~ msgstr "其餘引數的使用方式與意義和 :func:`load` 的相同。" + #~ msgid "" #~ "*object_pairs_hook*, if specified will be called with the result of every " #~ "JSON object decoded with an ordered list of pairs. The return value of " diff --git a/library/logging.po b/library/logging.po index 7084312e2d..9d2b92d6f3 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon <therockleona@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -527,7 +527,7 @@ msgstr "" msgid "" "If no handler is attached to this logger (or any of its ancestors, taking " "into account the relevant :attr:`Logger.propagate` attributes), the message " -"will be sent to the handler set on :attr:`lastResort`." +"will be sent to the handler set on :data:`lastResort`." msgstr "" #: ../../library/logging.rst:347 diff --git a/library/math.po b/library/math.po index af930c8ef7..71e552e1d8 100644 --- a/library/math.po +++ b/library/math.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-04-26 15:15+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -764,19 +764,20 @@ msgid "" msgstr "" #: ../../library/math.rst:251 +#, fuzzy msgid "" -"Return ``fmod(x, y)``, as defined by the platform C library. Note that the " -"Python expression ``x % y`` may not return the same result. The intent of " -"the C standard is that ``fmod(x, y)`` be exactly (mathematically; to " -"infinite precision) equal to ``x - n*y`` for some integer *n* such that the " -"result has the same sign as *x* and magnitude less than ``abs(y)``. " -"Python's ``x % y`` returns a result with the sign of *y* instead, and may " -"not be exactly computable for float arguments. For example, ``fmod(-1e-100, " -"1e100)`` is ``-1e-100``, but the result of Python's ``-1e-100 % 1e100`` is " -"``1e100-1e-100``, which cannot be represented exactly as a float, and rounds " -"to the surprising ``1e100``. For this reason, function :func:`fmod` is " -"generally preferred when working with floats, while Python's ``x % y`` is " -"preferred when working with integers." +"Return the floating-point remainder of ``x / y``, as defined by the platform " +"C library function ``fmod(x, y)``. Note that the Python expression ``x % y`` " +"may not return the same result. The intent of the C standard is that " +"``fmod(x, y)`` be exactly (mathematically; to infinite precision) equal to " +"``x - n*y`` for some integer *n* such that the result has the same sign as " +"*x* and magnitude less than ``abs(y)``. Python's ``x % y`` returns a result " +"with the sign of *y* instead, and may not be exactly computable for float " +"arguments. For example, ``fmod(-1e-100, 1e100)`` is ``-1e-100``, but the " +"result of Python's ``-1e-100 % 1e100`` is ``1e100-1e-100``, which cannot be " +"represented exactly as a float, and rounds to the surprising ``1e100``. For " +"this reason, function :func:`fmod` is generally preferred when working with " +"floats, while Python's ``x % y`` is preferred when working with integers." msgstr "" "回傳 C 函式庫所定義的 ``fmod(x, y)`` 函式值。請注意此函式與 Python 運算式 " "``x % y`` 可能會回傳不同結果。C 標準要求 ``fmod(x, y)`` 的回傳值完全等同(數" @@ -787,13 +788,13 @@ msgstr "" "示成浮點數,並會四捨五入為出乎意料的 ``1e100``。因此,處理浮點數時通常會選擇" "函式 :func:`fmod`,而處理整數時會選擇 Python 運算式 ``x % y``。" -#: ../../library/math.rst:266 +#: ../../library/math.rst:267 msgid "" "Return the fractional and integer parts of *x*. Both results carry the sign " "of *x* and are floats." msgstr "" -#: ../../library/math.rst:269 +#: ../../library/math.rst:270 msgid "" "Note that :func:`modf` has a different call/return pattern than its C " "equivalents: it takes a single argument and return a pair of values, rather " @@ -801,7 +802,7 @@ msgid "" "is no such thing in Python)." msgstr "" -#: ../../library/math.rst:277 +#: ../../library/math.rst:278 msgid "" "Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " "*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " @@ -811,7 +812,7 @@ msgid "" "thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -#: ../../library/math.rst:284 +#: ../../library/math.rst:285 msgid "" "Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " "*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " @@ -819,13 +820,13 @@ msgid "" "remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -#: ../../library/math.rst:290 +#: ../../library/math.rst:291 msgid "" "On platforms using IEEE 754 binary floating point, the result of this " "operation is always exactly representable: no rounding error is introduced." msgstr "" -#: ../../library/math.rst:298 +#: ../../library/math.rst:299 msgid "" "Return *x* with the fractional part removed, leaving the integer part. This " "rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " @@ -834,7 +835,7 @@ msgid "" "class:`~numbers.Integral` value." msgstr "" -#: ../../library/math.rst:305 +#: ../../library/math.rst:306 msgid "" "For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " "*all* floating-point numbers of sufficiently large magnitude are exact " @@ -843,11 +844,11 @@ msgid "" "``abs(x) >= 2**52`` necessarily has no fractional bits." msgstr "" -#: ../../library/math.rst:313 +#: ../../library/math.rst:314 msgid "Floating point manipulation functions" msgstr "" -#: ../../library/math.rst:317 +#: ../../library/math.rst:318 msgid "" "Return a float with the magnitude (absolute value) of *x* but the sign of " "*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " @@ -856,7 +857,7 @@ msgstr "" "回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," "``copysign(1.0, -0.0)`` 回傳 *-1.0*。" -#: ../../library/math.rst:324 +#: ../../library/math.rst:325 msgid "" "Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " "float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " @@ -867,7 +868,7 @@ msgstr "" "數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " "``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" -#: ../../library/math.rst:329 +#: ../../library/math.rst:330 msgid "" "Note that :func:`frexp` has a different call/return pattern than its C " "equivalents: it takes a single argument and return a pair of values, rather " @@ -875,13 +876,13 @@ msgid "" "is no such thing in Python)." msgstr "" -#: ../../library/math.rst:336 +#: ../../library/math.rst:337 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:339 +#: ../../library/math.rst:340 #, fuzzy msgid "" "Whether or not two values are considered close is determined according to " @@ -889,7 +890,7 @@ msgid "" "be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "兩數是否足夠接近取決於給定的絕對及相對容許偏差(tolerance)。" -#: ../../library/math.rst:343 +#: ../../library/math.rst:344 #, fuzzy msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " @@ -904,7 +905,7 @@ msgstr "" "設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須大於 " "``0``。" -#: ../../library/math.rst:350 +#: ../../library/math.rst:351 msgid "" "*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " "nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " @@ -913,7 +914,7 @@ msgid "" "to the call." msgstr "" -#: ../../library/math.rst:356 +#: ../../library/math.rst:357 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -924,11 +925,11 @@ msgstr "" "處理。更明確地說,``NaN`` 不會與包含自身在內的任何數字足夠接近,而 ``inf`` " "及 ``-inf`` 皆只與自身接近。" -#: ../../library/math.rst:365 +#: ../../library/math.rst:366 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` ── 用於測試近似相等的函式" -#: ../../library/math.rst:370 +#: ../../library/math.rst:371 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" @@ -936,128 +937,128 @@ msgstr "" "若 *x* 不是無限值或 ``NaN`` 便回傳 ``True``,否則回傳 ``False``。(注意 " "``0.0`` 被視為有限數。)" -#: ../../library/math.rst:378 +#: ../../library/math.rst:379 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:384 +#: ../../library/math.rst:385 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" "若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" "傳 ``False``。" -#: ../../library/math.rst:389 +#: ../../library/math.rst:390 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" -#: ../../library/math.rst:395 +#: ../../library/math.rst:396 msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: ../../library/math.rst:397 +#: ../../library/math.rst:398 msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: ../../library/math.rst:399 +#: ../../library/math.rst:400 msgid "Examples:" msgstr "範例:" -#: ../../library/math.rst:401 +#: ../../library/math.rst:402 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: ../../library/math.rst:402 +#: ../../library/math.rst:403 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: ../../library/math.rst:403 +#: ../../library/math.rst:404 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: ../../library/math.rst:404 +#: ../../library/math.rst:405 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: ../../library/math.rst:406 +#: ../../library/math.rst:407 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/math.rst:410 +#: ../../library/math.rst:411 msgid "Added the *steps* argument." msgstr "新增 *steps* 引數。" -#: ../../library/math.rst:416 +#: ../../library/math.rst:417 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: ../../library/math.rst:418 +#: ../../library/math.rst:419 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: ../../library/math.rst:419 +#: ../../library/math.rst:420 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "" -#: ../../library/math.rst:420 +#: ../../library/math.rst:421 msgid "If *x* is a positive infinity, return *x*." msgstr "" -#: ../../library/math.rst:421 +#: ../../library/math.rst:422 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" "data:`sys.float_info.min <sys.float_info>`)." msgstr "" -#: ../../library/math.rst:424 +#: ../../library/math.rst:425 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: ../../library/math.rst:427 +#: ../../library/math.rst:428 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: ../../library/math.rst:431 +#: ../../library/math.rst:432 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: ../../library/math.rst:433 +#: ../../library/math.rst:434 msgid "" "See also :func:`math.nextafter` and :data:`sys.float_info.epsilon <sys." "float_info>`." msgstr "" -#: ../../library/math.rst:440 +#: ../../library/math.rst:441 msgid "Power, exponential and logarithmic functions" msgstr "" -#: ../../library/math.rst:444 +#: ../../library/math.rst:445 msgid "Return the cube root of *x*." msgstr "" -#: ../../library/math.rst:451 +#: ../../library/math.rst:452 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: ../../library/math.rst:458 +#: ../../library/math.rst:459 msgid "Return *2* raised to the power *x*." msgstr "" -#: ../../library/math.rst:465 +#: ../../library/math.rst:466 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " @@ -1066,41 +1067,41 @@ msgid "" "compute this quantity to full precision:" msgstr "" -#: ../../library/math.rst:482 +#: ../../library/math.rst:483 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: ../../library/math.rst:484 +#: ../../library/math.rst:485 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: ../../library/math.rst:490 +#: ../../library/math.rst:491 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: ../../library/math.rst:496 +#: ../../library/math.rst:497 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: ../../library/math.rst:503 +#: ../../library/math.rst:504 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: ../../library/math.rst:509 +#: ../../library/math.rst:510 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: ../../library/math.rst:515 +#: ../../library/math.rst:516 msgid "" "Return *x* raised to the power *y*. Exceptional cases follow the IEEE 754 " "standard as far as possible. In particular, ``pow(1.0, x)`` and ``pow(x, " @@ -1109,44 +1110,44 @@ msgid "" "y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: ../../library/math.rst:522 +#: ../../library/math.rst:523 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: ../../library/math.rst:526 +#: ../../library/math.rst:527 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: ../../library/math.rst:534 +#: ../../library/math.rst:535 msgid "Return the square root of *x*." msgstr "" -#: ../../library/math.rst:538 +#: ../../library/math.rst:539 msgid "Summation and product functions" msgstr "" -#: ../../library/math.rst:542 +#: ../../library/math.rst:543 msgid "" "Return the Euclidean distance between two points *p* and *q*, each given as " "a sequence (or iterable) of coordinates. The two points must have the same " "dimension." msgstr "" -#: ../../library/math.rst:546 ../../library/math.rst:607 +#: ../../library/math.rst:547 ../../library/math.rst:608 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/math.rst:548 +#: ../../library/math.rst:549 msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -#: ../../library/math.rst:555 +#: ../../library/math.rst:556 msgid "" "Return an accurate floating-point sum of values in the iterable. Avoids " "loss of precision by tracking multiple intermediate partial sums." @@ -1154,7 +1155,7 @@ msgstr "" "回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" "(partial sum)以避免精確度損失。" -#: ../../library/math.rst:558 +#: ../../library/math.rst:559 msgid "" "The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " "typical case where the rounding mode is half-even. On some non-Windows " @@ -1166,7 +1167,7 @@ msgstr "" "有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" "程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:564 +#: ../../library/math.rst:565 msgid "" "For further discussion and two alternative approaches, see the `ASPN " "cookbook recipes for accurate floating-point summation <https://code." @@ -1176,99 +1177,99 @@ msgstr "" "更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " "<https://code.activestate.com/recipes/393090/>`_。" -#: ../../library/math.rst:571 +#: ../../library/math.rst:572 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: ../../library/math.rst:575 +#: ../../library/math.rst:576 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: ../../library/math.rst:579 +#: ../../library/math.rst:580 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: ../../library/math.rst:583 +#: ../../library/math.rst:584 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: ../../library/math.rst:591 +#: ../../library/math.rst:592 msgid "" "Calculate the product of all the elements in the input *iterable*. The " "default *start* value for the product is ``1``." msgstr "" -#: ../../library/math.rst:594 +#: ../../library/math.rst:595 msgid "" "When the iterable is empty, return the start value. This function is " "intended specifically for use with numeric values and may reject non-numeric " "types." msgstr "" -#: ../../library/math.rst:603 +#: ../../library/math.rst:604 msgid "Return the sum of products of values from two iterables *p* and *q*." msgstr "" -#: ../../library/math.rst:605 +#: ../../library/math.rst:606 msgid "Raises :exc:`ValueError` if the inputs do not have the same length." msgstr "" -#: ../../library/math.rst:609 +#: ../../library/math.rst:610 msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" -#: ../../library/math.rst:611 +#: ../../library/math.rst:612 msgid "" "For float and mixed int/float inputs, the intermediate products and sums are " "computed with extended precision." msgstr "" -#: ../../library/math.rst:618 +#: ../../library/math.rst:619 msgid "Angular conversion" msgstr "" -#: ../../library/math.rst:622 +#: ../../library/math.rst:623 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: ../../library/math.rst:627 +#: ../../library/math.rst:628 msgid "Convert angle *x* from degrees to radians." msgstr "" -#: ../../library/math.rst:631 +#: ../../library/math.rst:632 msgid "Trigonometric functions" msgstr "" -#: ../../library/math.rst:635 +#: ../../library/math.rst:636 msgid "" "Return the arc cosine of *x*, in radians. The result is between ``0`` and " "``pi``." msgstr "" -#: ../../library/math.rst:641 +#: ../../library/math.rst:642 msgid "" "Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " "``pi/2``." msgstr "" -#: ../../library/math.rst:647 +#: ../../library/math.rst:648 msgid "" "Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " "and ``pi/2``." msgstr "" -#: ../../library/math.rst:653 +#: ../../library/math.rst:654 msgid "" "Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " "``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " @@ -1278,78 +1279,78 @@ msgid "" "``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." msgstr "" -#: ../../library/math.rst:663 +#: ../../library/math.rst:664 msgid "Return the cosine of *x* radians." msgstr "" -#: ../../library/math.rst:668 +#: ../../library/math.rst:669 msgid "Return the sine of *x* radians." msgstr "" -#: ../../library/math.rst:673 +#: ../../library/math.rst:674 msgid "Return the tangent of *x* radians." msgstr "" -#: ../../library/math.rst:677 +#: ../../library/math.rst:678 msgid "Hyperbolic functions" msgstr "" -#: ../../library/math.rst:679 +#: ../../library/math.rst:680 msgid "" "`Hyperbolic functions <https://en.wikipedia.org/wiki/Hyperbolic_functions>`_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: ../../library/math.rst:685 +#: ../../library/math.rst:686 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:690 +#: ../../library/math.rst:691 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:695 +#: ../../library/math.rst:696 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:700 +#: ../../library/math.rst:701 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:705 +#: ../../library/math.rst:706 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:710 +#: ../../library/math.rst:711 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:714 +#: ../../library/math.rst:715 msgid "Special functions" msgstr "" -#: ../../library/math.rst:718 +#: ../../library/math.rst:719 msgid "" "Return the `error function <https://en.wikipedia.org/wiki/Error_function>`_ " "at *x*." msgstr "" -#: ../../library/math.rst:721 +#: ../../library/math.rst:722 msgid "" "The :func:`erf` function can be used to compute traditional statistical " "functions such as the `cumulative standard normal distribution <https://en." "wikipedia.org/wiki/Cumulative_distribution_function>`_::" msgstr "" -#: ../../library/math.rst:725 +#: ../../library/math.rst:726 msgid "" "def phi(x):\n" " 'Cumulative distribution function for the standard normal distribution'\n" " return (1.0 + erf(x / sqrt(2.0))) / 2.0" msgstr "" -#: ../../library/math.rst:734 +#: ../../library/math.rst:735 msgid "" "Return the complementary error function at *x*. The `complementary error " "function <https://en.wikipedia.org/wiki/Error_function>`_ is defined as " @@ -1358,31 +1359,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: ../../library/math.rst:745 +#: ../../library/math.rst:746 msgid "" "Return the `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_ " "at *x*." msgstr "" -#: ../../library/math.rst:753 +#: ../../library/math.rst:754 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: ../../library/math.rst:760 +#: ../../library/math.rst:761 msgid "Constants" msgstr "常數" -#: ../../library/math.rst:764 +#: ../../library/math.rst:765 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: ../../library/math.rst:769 +#: ../../library/math.rst:770 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: ../../library/math.rst:774 +#: ../../library/math.rst:775 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -1391,13 +1392,13 @@ msgid "" "celebrating `Tau day <https://tauday.com/>`_ by eating twice as much pie!" msgstr "" -#: ../../library/math.rst:785 +#: ../../library/math.rst:786 msgid "" "A floating-point positive infinity. (For negative infinity, use ``-math." "inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: ../../library/math.rst:793 +#: ../../library/math.rst:794 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard <https://" @@ -1407,11 +1408,11 @@ msgid "" "NaNs instead of ``is`` or ``==``. Example:" msgstr "" -#: ../../library/math.rst:813 +#: ../../library/math.rst:814 msgid "It is now always available." msgstr "" -#: ../../library/math.rst:819 +#: ../../library/math.rst:820 msgid "" "The :mod:`math` module consists mostly of thin wrappers around the platform " "C math library functions. Behavior in exceptional cases follows Annex F of " @@ -1426,18 +1427,18 @@ msgid "" "``hypot(float('nan'), float('inf'))``." msgstr "" -#: ../../library/math.rst:831 +#: ../../library/math.rst:832 msgid "" "Note that Python makes no effort to distinguish signaling NaNs from quiet " "NaNs, and behavior for signaling NaNs remains unspecified. Typical behavior " "is to treat all NaNs as though they were quiet." msgstr "" -#: ../../library/math.rst:838 +#: ../../library/math.rst:839 msgid "Module :mod:`cmath`" msgstr ":mod:`cmath` 模組" -#: ../../library/math.rst:839 +#: ../../library/math.rst:840 msgid "Complex number versions of many of these functions." msgstr "" diff --git a/library/os.po b/library/os.po index ee33ceb55f..06a6f2baa0 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -390,9 +390,9 @@ msgstr "" #: ../../library/os.rst:5303 ../../library/os.rst:5310 #: ../../library/os.rst:5319 ../../library/os.rst:5328 #: ../../library/os.rst:5337 ../../library/os.rst:5346 -#: ../../library/os.rst:5496 ../../library/os.rst:5505 -#: ../../library/os.rst:5529 ../../library/os.rst:5556 -#: ../../library/os.rst:5565 ../../library/os.rst:5688 +#: ../../library/os.rst:5498 ../../library/os.rst:5507 +#: ../../library/os.rst:5531 ../../library/os.rst:5558 +#: ../../library/os.rst:5567 ../../library/os.rst:5690 msgid "Availability" msgstr "" @@ -6087,129 +6087,130 @@ msgid "" "operating system." msgstr "" -#: ../../library/os.rst:5363 +#: ../../library/os.rst:5365 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5367 +#: ../../library/os.rst:5369 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5372 +#: ../../library/os.rst:5374 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5376 +#: ../../library/os.rst:5378 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5380 +#: ../../library/os.rst:5382 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5384 +#: ../../library/os.rst:5386 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5388 +#: ../../library/os.rst:5390 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:5395 +#: ../../library/os.rst:5397 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:5399 +#: ../../library/os.rst:5401 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5403 +#: ../../library/os.rst:5405 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5408 +#: ../../library/os.rst:5410 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5414 +#: ../../library/os.rst:5416 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5420 +#: ../../library/os.rst:5422 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:5427 +#: ../../library/os.rst:5429 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:5434 +#: ../../library/os.rst:5436 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:5440 +#: ../../library/os.rst:5442 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:5446 +#: ../../library/os.rst:5448 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:5452 -msgid "Voluntarily relinquish the CPU." +#: ../../library/os.rst:5454 +msgid "" +"Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: ../../library/os.rst:5457 +#: ../../library/os.rst:5459 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:5464 +#: ../../library/os.rst:5466 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5466 +#: ../../library/os.rst:5468 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5469 +#: ../../library/os.rst:5471 #, fuzzy msgid "See also the :func:`process_cpu_count` function." msgstr ":func:`~os.setns` 函式。" -#: ../../library/os.rst:5475 +#: ../../library/os.rst:5477 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5480 +#: ../../library/os.rst:5482 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 " @@ -6220,13 +6221,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5488 +#: ../../library/os.rst:5490 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5491 +#: ../../library/os.rst:5493 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 " @@ -6234,63 +6235,63 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5501 +#: ../../library/os.rst:5503 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:5510 +#: ../../library/os.rst:5512 msgid "" "Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5513 +#: ../../library/os.rst:5515 msgid "" "The :func:`process_cpu_count` function can be used to get the number of " "logical CPUs usable by the calling thread of the **current process**." msgstr "" -#: ../../library/os.rst:5518 +#: ../../library/os.rst:5520 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5525 +#: ../../library/os.rst:5527 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:5534 +#: ../../library/os.rst:5536 msgid "" "Get the number of logical CPUs usable by the calling thread of the **current " "process**. Returns ``None`` if undetermined. It can be less than :func:" "`cpu_count` depending on the CPU affinity." msgstr "" -#: ../../library/os.rst:5538 +#: ../../library/os.rst:5540 msgid "" "The :func:`cpu_count` function can be used to get the number of logical CPUs " "in the **system**." msgstr "" -#: ../../library/os.rst:5541 +#: ../../library/os.rst:5543 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`process_cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5544 +#: ../../library/os.rst:5546 #, fuzzy msgid "See also the :func:`sched_getaffinity` function." msgstr ":func:`~os.setns` 函式。" -#: ../../library/os.rst:5551 +#: ../../library/os.rst:5553 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -6299,44 +6300,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5561 +#: ../../library/os.rst:5563 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:5567 +#: ../../library/os.rst:5569 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5570 +#: ../../library/os.rst:5572 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5573 +#: ../../library/os.rst:5575 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5579 +#: ../../library/os.rst:5581 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:5587 +#: ../../library/os.rst:5589 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:5596 +#: ../../library/os.rst:5598 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -6345,7 +6346,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5606 +#: ../../library/os.rst:5608 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -6353,27 +6354,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5615 +#: ../../library/os.rst:5617 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:5623 +#: ../../library/os.rst:5625 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:5630 +#: ../../library/os.rst:5632 msgid "" "The default search path used by :func:`exec\\*p\\* <execl>` and :func:" "`spawn\\*p\\* <spawnl>` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5637 +#: ../../library/os.rst:5639 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 " @@ -6382,36 +6383,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5646 +#: ../../library/os.rst:5648 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:5657 +#: ../../library/os.rst:5659 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:5665 +#: ../../library/os.rst:5667 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5670 +#: ../../library/os.rst:5672 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5673 +#: ../../library/os.rst:5675 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5676 +#: ../../library/os.rst:5678 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -6419,32 +6420,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5681 +#: ../../library/os.rst:5683 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5685 +#: ../../library/os.rst:5687 msgid "" "See also the `Linux getrandom() manual page <https://man7.org/linux/man-" "pages/man2/getrandom.2.html>`_." msgstr "" -#: ../../library/os.rst:5694 +#: ../../library/os.rst:5696 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5696 +#: ../../library/os.rst:5698 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:5700 +#: ../../library/os.rst:5702 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -6454,63 +6455,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5707 +#: ../../library/os.rst:5709 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:5711 +#: ../../library/os.rst:5713 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5714 +#: ../../library/os.rst:5716 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:5718 +#: ../../library/os.rst:5720 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:5724 +#: ../../library/os.rst:5726 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:5728 +#: ../../library/os.rst:5730 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5732 +#: ../../library/os.rst:5734 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5738 +#: ../../library/os.rst:5740 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:5742 +#: ../../library/os.rst:5744 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:5749 +#: ../../library/os.rst:5751 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6620,41 +6621,41 @@ msgstr "" msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5576 ../../library/os.rst:5612 +#: ../../library/os.rst:5578 ../../library/os.rst:5614 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5576 ../../library/os.rst:5584 -#: ../../library/os.rst:5592 ../../library/os.rst:5603 -#: ../../library/os.rst:5612 +#: ../../library/os.rst:5578 ../../library/os.rst:5586 +#: ../../library/os.rst:5594 ../../library/os.rst:5605 +#: ../../library/os.rst:5614 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5584 +#: ../../library/os.rst:5586 msgid ".." msgstr ".." -#: ../../library/os.rst:5592 ../../library/os.rst:5603 +#: ../../library/os.rst:5594 ../../library/os.rst:5605 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5593 +#: ../../library/os.rst:5595 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5593 +#: ../../library/os.rst:5595 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5619 +#: ../../library/os.rst:5621 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pdb.po b/library/pdb.po index bd47a844d5..0189bb71e9 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,42 +253,45 @@ msgstr "" #: ../../library/pdb.rst:178 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 " -"being handled (an exception must be being handled if the default is to be " -"used)." +"Enter post-mortem debugging of the given exception or :ref:`traceback object " +"<traceback-objects>`. If no value is given, it uses the exception that is " +"currently being handled, or raises ``ValueError`` if there isn’t one." msgstr "" -#: ../../library/pdb.rst:186 +#: ../../library/pdb.rst:183 +msgid "Support for exception objects was added." +msgstr "" + +#: ../../library/pdb.rst:188 msgid "" "Enter post-mortem debugging of the exception found in :data:`sys.last_exc`." msgstr "" -#: ../../library/pdb.rst:190 +#: ../../library/pdb.rst:192 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:197 +#: ../../library/pdb.rst:199 msgid ":class:`Pdb` is the debugger class." msgstr "" -#: ../../library/pdb.rst:199 +#: ../../library/pdb.rst:201 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." msgstr "" -#: ../../library/pdb.rst:202 +#: ../../library/pdb.rst:204 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:206 +#: ../../library/pdb.rst:208 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:" @@ -297,48 +300,48 @@ msgid "" "set *nosigint* to true." msgstr "" -#: ../../library/pdb.rst:211 +#: ../../library/pdb.rst:213 msgid "" "The *readrc* argument defaults to true and controls whether Pdb will load ." "pdbrc files from the filesystem." msgstr "" -#: ../../library/pdb.rst:214 +#: ../../library/pdb.rst:216 msgid "Example call to enable tracing with *skip*::" msgstr "" -#: ../../library/pdb.rst:216 +#: ../../library/pdb.rst:218 msgid "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" msgstr "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" -#: ../../library/pdb.rst:218 +#: ../../library/pdb.rst:220 msgid "" "Raises an :ref:`auditing event <auditing>` ``pdb.Pdb`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``pdb.Pdb``。" -#: ../../library/pdb.rst:220 +#: ../../library/pdb.rst:222 msgid "Added the *skip* parameter." msgstr "" -#: ../../library/pdb.rst:223 +#: ../../library/pdb.rst:225 msgid "" "Added the *nosigint* parameter. Previously, a SIGINT handler was never set " "by Pdb." msgstr "" -#: ../../library/pdb.rst:227 +#: ../../library/pdb.rst:229 msgid "The *readrc* argument." msgstr "*readrc* 引數。" -#: ../../library/pdb.rst:235 +#: ../../library/pdb.rst:237 msgid "See the documentation for the functions explained above." msgstr "" -#: ../../library/pdb.rst:241 +#: ../../library/pdb.rst:243 msgid "Debugger Commands" msgstr "" -#: ../../library/pdb.rst:243 +#: ../../library/pdb.rst:245 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 " @@ -350,13 +353,13 @@ msgid "" "are separated by a vertical bar (``|``)." msgstr "" -#: ../../library/pdb.rst:252 +#: ../../library/pdb.rst:254 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:255 +#: ../../library/pdb.rst:257 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. " @@ -367,20 +370,20 @@ msgid "" "is not changed." msgstr "" -#: ../../library/pdb.rst:263 +#: ../../library/pdb.rst:265 msgid "" "Expressions/Statements whose prefix is a pdb command are now correctly " "identified and executed." msgstr "" -#: ../../library/pdb.rst:267 +#: ../../library/pdb.rst:269 msgid "" "The debugger supports :ref:`aliases <debugger-aliases>`. Aliases can have " "parameters which allows one a certain level of adaptability to the context " "under examination." msgstr "" -#: ../../library/pdb.rst:271 +#: ../../library/pdb.rst:273 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 " @@ -391,7 +394,7 @@ msgid "" "\"\";\"``." msgstr "" -#: ../../library/pdb.rst:278 +#: ../../library/pdb.rst:280 msgid "" "To set a temporary global variable, use a *convenience variable*. A " "*convenience variable* is a variable whose name starts with ``$``. For " @@ -401,27 +404,27 @@ msgid "" "compared to using normal variables like ``foo = 1``." msgstr "" -#: ../../library/pdb.rst:285 +#: ../../library/pdb.rst:287 msgid "There are three preset *convenience variables*:" msgstr "" -#: ../../library/pdb.rst:287 +#: ../../library/pdb.rst:289 msgid "``$_frame``: the current frame you are debugging" msgstr "" -#: ../../library/pdb.rst:288 +#: ../../library/pdb.rst:290 msgid "``$_retval``: the return value if the frame is returning" msgstr "" -#: ../../library/pdb.rst:289 +#: ../../library/pdb.rst:291 msgid "``$_exception``: the exception if the frame is raising an exception" msgstr "" -#: ../../library/pdb.rst:293 +#: ../../library/pdb.rst:295 msgid "Added the *convenience variable* feature." msgstr "" -#: ../../library/pdb.rst:299 +#: ../../library/pdb.rst:301 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 " @@ -431,20 +434,20 @@ msgid "" "read first and aliases defined there can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:306 +#: ../../library/pdb.rst:308 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:311 +#: ../../library/pdb.rst:313 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: ../../library/pdb.rst:318 +#: ../../library/pdb.rst:320 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -453,26 +456,26 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:326 +#: ../../library/pdb.rst:328 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:331 +#: ../../library/pdb.rst:333 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:336 +#: ../../library/pdb.rst:338 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:341 +#: ../../library/pdb.rst:343 msgid "" "With a *lineno* argument, set a break at line *lineno* in the current file. " "The line number may be prefixed with a *filename* and a colon, to specify a " @@ -482,46 +485,46 @@ msgid "" "module``." msgstr "" -#: ../../library/pdb.rst:348 +#: ../../library/pdb.rst:350 msgid "" "With a *function* argument, set a break at the first executable statement " "within that function. *function* can be any expression that evaluates to a " "function in the current namespace." msgstr "" -#: ../../library/pdb.rst:352 +#: ../../library/pdb.rst:354 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:355 +#: ../../library/pdb.rst:357 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:359 +#: ../../library/pdb.rst:361 msgid "" "Each breakpoint is assigned a number to which all the other breakpoint " "commands refer." msgstr "" -#: ../../library/pdb.rst:364 +#: ../../library/pdb.rst:366 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:369 +#: ../../library/pdb.rst:371 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:375 +#: ../../library/pdb.rst:377 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -529,11 +532,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:382 +#: ../../library/pdb.rst:384 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:386 +#: ../../library/pdb.rst:388 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 " @@ -542,21 +545,21 @@ msgid "" "associated condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:394 +#: ../../library/pdb.rst:396 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:400 +#: ../../library/pdb.rst:402 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:404 +#: ../../library/pdb.rst:406 msgid "" "(Pdb) commands 1\n" "(com) p some_variable\n" @@ -564,25 +567,25 @@ msgid "" "(Pdb)" msgstr "" -#: ../../library/pdb.rst:409 +#: ../../library/pdb.rst:411 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:412 +#: ../../library/pdb.rst:414 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:414 +#: ../../library/pdb.rst:416 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:418 +#: ../../library/pdb.rst:420 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -593,7 +596,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:427 +#: ../../library/pdb.rst:429 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 " @@ -602,13 +605,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:434 +#: ../../library/pdb.rst:436 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:439 +#: ../../library/pdb.rst:441 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 " @@ -617,46 +620,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:447 +#: ../../library/pdb.rst:449 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:450 +#: ../../library/pdb.rst:452 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:454 +#: ../../library/pdb.rst:456 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:459 +#: ../../library/pdb.rst:461 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:463 +#: ../../library/pdb.rst:465 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:467 +#: ../../library/pdb.rst:469 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:471 +#: ../../library/pdb.rst:473 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:477 +#: ../../library/pdb.rst:479 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -665,7 +668,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:483 +#: ../../library/pdb.rst:485 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -673,67 +676,67 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:488 +#: ../../library/pdb.rst:490 msgid "Added the ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:493 +#: ../../library/pdb.rst:495 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:500 +#: ../../library/pdb.rst:502 msgid "Print the arguments of the current function and their current values." msgstr "" -#: ../../library/pdb.rst:504 +#: ../../library/pdb.rst:506 msgid "Evaluate *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:508 +#: ../../library/pdb.rst:510 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:514 +#: ../../library/pdb.rst:516 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:519 +#: ../../library/pdb.rst:521 msgid "Print the type of *expression*." msgstr "" -#: ../../library/pdb.rst:523 +#: ../../library/pdb.rst:525 msgid "Try to get source code of *expression* and display it." msgstr "" -#: ../../library/pdb.rst:529 +#: ../../library/pdb.rst:531 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:532 +#: ../../library/pdb.rst:534 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:536 +#: ../../library/pdb.rst:538 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:540 ../../library/pdb.rst:690 +#: ../../library/pdb.rst:542 ../../library/pdb.rst:692 msgid "Example::" msgstr "範例: ::" -#: ../../library/pdb.rst:542 +#: ../../library/pdb.rst:544 msgid "" "lst = []\n" "breakpoint()\n" @@ -742,13 +745,13 @@ msgid "" "print(lst)" msgstr "" -#: ../../library/pdb.rst:548 +#: ../../library/pdb.rst:550 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:551 +#: ../../library/pdb.rst:553 msgid "" "> example.py(3)<module>()\n" "-> pass\n" @@ -763,11 +766,11 @@ msgid "" "(Pdb)" msgstr "" -#: ../../library/pdb.rst:563 +#: ../../library/pdb.rst:565 msgid "You can do some tricks with copy mechanism to make it work::" msgstr "" -#: ../../library/pdb.rst:565 +#: ../../library/pdb.rst:567 msgid "" "> example.py(3)<module>()\n" "-> pass\n" @@ -783,13 +786,13 @@ msgid "" "(Pdb)" msgstr "" -#: ../../library/pdb.rst:582 +#: ../../library/pdb.rst:584 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:589 +#: ../../library/pdb.rst:591 msgid "" "Start an interactive interpreter (using the :mod:`code` module) in a new " "global namespace initialised from the local and global namespaces for the " @@ -797,7 +800,7 @@ msgid "" "return to the debugger." msgstr "" -#: ../../library/pdb.rst:596 +#: ../../library/pdb.rst:598 msgid "" "As ``interact`` creates a new dedicated namespace for code execution, " "assignments to variables will not affect the original namespaces. However, " @@ -805,18 +808,18 @@ msgid "" "original namespaces as usual." msgstr "" -#: ../../library/pdb.rst:603 +#: ../../library/pdb.rst:605 msgid "" "``exit()`` and ``quit()`` can be used to exit the :pdbcmd:`interact` command." msgstr "" -#: ../../library/pdb.rst:607 +#: ../../library/pdb.rst:609 msgid "" ":pdbcmd:`interact` directs its output to the debugger's output channel " "rather than :data:`sys.stderr`." msgstr "" -#: ../../library/pdb.rst:615 +#: ../../library/pdb.rst:617 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " @@ -825,7 +828,7 @@ msgid "" "If no arguments are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:621 +#: ../../library/pdb.rst:623 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 " @@ -834,13 +837,13 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:627 +#: ../../library/pdb.rst:629 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:630 +#: ../../library/pdb.rst:632 msgid "" "# Print instance variables (usage \"pi classInst\")\n" "alias pi for k in %1.__dict__.keys(): print(f\"%1.{k} = {%1.__dict__[k]}\")\n" @@ -848,36 +851,36 @@ msgid "" "alias ps pi self" msgstr "" -#: ../../library/pdb.rst:637 +#: ../../library/pdb.rst:639 msgid "Delete the specified alias *name*." msgstr "" -#: ../../library/pdb.rst:641 +#: ../../library/pdb.rst:643 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 " "statement resembles a debugger command, e.g.:" msgstr "" -#: ../../library/pdb.rst:645 +#: ../../library/pdb.rst:647 msgid "" "(Pdb) ! n=42\n" "(Pdb)" msgstr "" -#: ../../library/pdb.rst:650 +#: ../../library/pdb.rst:652 msgid "" "To set a global variable, you can prefix the assignment command with a :" "keyword:`global` statement on the same line, e.g.:" msgstr "" -#: ../../library/pdb.rst:653 +#: ../../library/pdb.rst:655 msgid "" "(Pdb) global list_options; list_options = ['-l']\n" "(Pdb)" msgstr "" -#: ../../library/pdb.rst:661 +#: ../../library/pdb.rst:663 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`. " @@ -885,25 +888,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:668 +#: ../../library/pdb.rst:670 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:672 +#: ../../library/pdb.rst:674 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:678 +#: ../../library/pdb.rst:680 msgid "Print the return value for the last return of the current function." msgstr "" -#: ../../library/pdb.rst:682 +#: ../../library/pdb.rst:684 msgid "List or jump between chained exceptions." msgstr "" -#: ../../library/pdb.rst:684 +#: ../../library/pdb.rst:686 msgid "" "When using ``pdb.pm()`` or ``Pdb.post_mortem(...)`` with a chained " "exception instead of a traceback, it allows the user to move between the " @@ -911,7 +914,7 @@ msgid "" "``exception <number>`` to switch to that exception." msgstr "" -#: ../../library/pdb.rst:692 +#: ../../library/pdb.rst:694 msgid "" "def out():\n" " try:\n" @@ -931,11 +934,11 @@ msgid "" " out()" msgstr "" -#: ../../library/pdb.rst:709 +#: ../../library/pdb.rst:711 msgid "calling ``pdb.pm()`` will allow to move between exceptions::" msgstr "" -#: ../../library/pdb.rst:711 +#: ../../library/pdb.rst:713 msgid "" "> example.py(5)out()\n" "-> raise ValueError(\"reraise middle() error\") from e\n" @@ -954,11 +957,11 @@ msgid "" "-> return inner(0)" msgstr "" -#: ../../library/pdb.rst:730 +#: ../../library/pdb.rst:732 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:731 +#: ../../library/pdb.rst:733 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." @@ -984,18 +987,18 @@ msgstr "bdb" msgid "cmd" msgstr "cmd" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid ".pdbrc" msgstr ".pdbrc" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "file" msgstr "file(檔案)" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/pdb.rst:295 +#: ../../library/pdb.rst:297 msgid "configuration" msgstr "configuration(設定)" diff --git a/library/plistlib.po b/library/plistlib.po index 282baf27aa..9c760912c6 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -119,7 +119,7 @@ msgstr "" msgid "" "When *aware_datetime* is true, fields with type ``datetime.datetime`` will " "be created as :ref:`aware object <datetime-naive-aware>`, with :attr:`!" -"tzinfo` as :attr:`datetime.UTC`." +"tzinfo` as :const:`datetime.UTC`." msgstr "" #: ../../library/plistlib.rst:76 diff --git a/library/site.po b/library/site.po index 89fbfeb209..9af9231fcf 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,7 +58,7 @@ msgid "" "then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y[t]}/" "site-packages` (on Unix and macOS). (The optional suffix \"t\" indicates " "the :term:`free threading` build, and is appended if ``\"t\"`` is present in " -"the :attr:`sys.abiflags` constant.) For each of the distinct head-tail " +"the :data:`sys.abiflags` constant.) For each of the distinct head-tail " "combinations, it sees if it refers to an existing directory, and if so, adds " "it to ``sys.path`` and also inspects the newly added path for configuration " "files." diff --git a/library/socket.po b/library/socket.po index cf87851d07..22a94402e1 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,10 +63,10 @@ msgstr "" #: ../../library/socket.rst:1441 ../../library/socket.rst:1488 #: ../../library/socket.rst:1502 ../../library/socket.rst:1522 #: ../../library/socket.rst:1569 ../../library/socket.rst:1614 -#: ../../library/socket.rst:1744 ../../library/socket.rst:1788 -#: ../../library/socket.rst:1896 ../../library/socket.rst:1914 -#: ../../library/socket.rst:1998 ../../library/socket.rst:2008 -#: ../../library/socket.rst:2020 ../../includes/wasm-notavail.rst:3 +#: ../../library/socket.rst:1739 ../../library/socket.rst:1783 +#: ../../library/socket.rst:1891 ../../library/socket.rst:1909 +#: ../../library/socket.rst:1993 ../../library/socket.rst:2003 +#: ../../library/socket.rst:2015 ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" @@ -141,7 +141,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:66 ../../library/socket.rst:1189 -#: ../../library/socket.rst:1231 ../../library/socket.rst:1992 +#: ../../library/socket.rst:1231 ../../library/socket.rst:1987 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -1472,8 +1472,8 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1254 ../../library/socket.rst:1746 -#: ../../library/socket.rst:1790 ../../library/socket.rst:1898 +#: ../../library/socket.rst:1254 ../../library/socket.rst:1741 +#: ../../library/socket.rst:1785 ../../library/socket.rst:1893 msgid "Most Unix platforms." msgstr "" @@ -1635,10 +1635,10 @@ msgstr "" msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1428 ../../library/socket.rst:1659 -#: ../../library/socket.rst:1673 ../../library/socket.rst:1750 -#: ../../library/socket.rst:1823 ../../library/socket.rst:1842 -#: ../../library/socket.rst:1859 ../../library/socket.rst:1904 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1654 +#: ../../library/socket.rst:1668 ../../library/socket.rst:1745 +#: ../../library/socket.rst:1818 ../../library/socket.rst:1837 +#: ../../library/socket.rst:1854 ../../library/socket.rst:1899 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" @@ -1884,13 +1884,7 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1656 -msgid "" -"For best match with hardware and network realities, the value of *bufsize* " -"should be a relatively small power of 2, for example, 4096." -msgstr "" - -#: ../../library/socket.rst:1667 +#: ../../library/socket.rst:1662 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1900,14 +1894,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1673 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1685 +#: ../../library/socket.rst:1680 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1918,7 +1912,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1695 +#: ../../library/socket.rst:1690 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1933,7 +1927,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1709 +#: ../../library/socket.rst:1704 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1946,7 +1940,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1715 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1955,7 +1949,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1722 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1964,7 +1958,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1733 +#: ../../library/socket.rst:1728 msgid "" "import socket, array\n" "\n" @@ -1981,7 +1975,7 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1758 +#: ../../library/socket.rst:1753 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1994,7 +1988,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1769 +#: ../../library/socket.rst:1764 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -2002,11 +1996,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1774 +#: ../../library/socket.rst:1769 msgid "Example::" msgstr "範例: ::" -#: ../../library/socket.rst:1776 +#: ../../library/socket.rst:1771 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -2032,7 +2026,7 @@ msgstr "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -#: ../../library/socket.rst:1797 +#: ../../library/socket.rst:1792 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -2042,7 +2036,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1807 +#: ../../library/socket.rst:1802 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -2051,7 +2045,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1816 +#: ../../library/socket.rst:1811 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2061,7 +2055,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1831 +#: ../../library/socket.rst:1826 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2071,13 +2065,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1833 msgid "" "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:1851 +#: ../../library/socket.rst:1846 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2086,7 +2080,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1857 +#: ../../library/socket.rst:1852 msgid "" "Raises an :ref:`auditing event <auditing>` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2094,7 +2088,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 <auditing>` " "``socket.sendto``。" -#: ../../library/socket.rst:1867 +#: ../../library/socket.rst:1862 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2114,14 +2108,14 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1882 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1891 +#: ../../library/socket.rst:1886 msgid "" "import socket, array\n" "\n" @@ -2135,7 +2129,7 @@ msgstr "" " return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." "array(\"i\", fds))])" -#: ../../library/socket.rst:1900 +#: ../../library/socket.rst:1895 msgid "" "Raises an :ref:`auditing event <auditing>` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2143,14 +2137,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 <auditing>` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1906 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1915 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2164,38 +2158,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1936 +#: ../../library/socket.rst:1931 msgid "" "Set the :ref:`inheritable flag <fd_inheritance>` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1944 +#: ../../library/socket.rst:1939 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1947 +#: ../../library/socket.rst:1942 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1949 +#: ../../library/socket.rst:1944 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1946 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1953 +#: ../../library/socket.rst:1948 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1960 +#: ../../library/socket.rst:1955 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" @@ -2205,19 +2199,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1967 +#: ../../library/socket.rst:1962 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "<socket-timeouts>`." msgstr "" -#: ../../library/socket.rst:1969 +#: ../../library/socket.rst:1964 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1982 +#: ../../library/socket.rst:1977 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in this module " @@ -2230,11 +2224,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1995 +#: ../../library/socket.rst:1990 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:2003 +#: ../../library/socket.rst:1998 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2242,7 +2236,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:2013 +#: ../../library/socket.rst:2008 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2253,48 +2247,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:2025 +#: ../../library/socket.rst:2020 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2023 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:2034 +#: ../../library/socket.rst:2029 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2039 +#: ../../library/socket.rst:2034 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2039 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2051 +#: ../../library/socket.rst:2046 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2053 +#: ../../library/socket.rst:2048 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2057 +#: ../../library/socket.rst:2052 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2055 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2302,14 +2296,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2060 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2070 +#: ../../library/socket.rst:2065 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2318,11 +2312,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2077 +#: ../../library/socket.rst:2072 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2079 +#: ../../library/socket.rst:2074 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2332,24 +2326,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2087 +#: ../../library/socket.rst:2082 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2089 +#: ../../library/socket.rst:2084 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2093 +#: ../../library/socket.rst:2088 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2096 +#: ../../library/socket.rst:2091 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2357,11 +2351,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2105 +#: ../../library/socket.rst:2100 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2107 +#: ../../library/socket.rst:2102 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2374,11 +2368,11 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2117 +#: ../../library/socket.rst:2112 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2119 +#: ../../library/socket.rst:2114 msgid "" "# Echo server program\n" "import socket\n" @@ -2397,7 +2391,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2137 +#: ../../library/socket.rst:2132 msgid "" "# Echo client program\n" "import socket\n" @@ -2411,7 +2405,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2148 +#: ../../library/socket.rst:2143 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2421,7 +2415,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2155 +#: ../../library/socket.rst:2150 msgid "" "# Echo server program\n" "import socket\n" @@ -2458,7 +2452,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2191 +#: ../../library/socket.rst:2186 msgid "" "# Echo client program\n" "import socket\n" @@ -2491,14 +2485,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2215 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2224 +#: ../../library/socket.rst:2219 msgid "" "import socket\n" "\n" @@ -2522,29 +2516,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2245 +#: ../../library/socket.rst:2240 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2249 +#: ../../library/socket.rst:2244 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -#: ../../library/socket.rst:2251 +#: ../../library/socket.rst:2246 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2255 +#: ../../library/socket.rst:2250 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2257 +#: ../../library/socket.rst:2252 msgid "" "import socket\n" "import struct\n" @@ -2586,29 +2580,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2295 +#: ../../library/socket.rst:2290 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2298 +#: ../../library/socket.rst:2293 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2300 +#: ../../library/socket.rst:2295 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2303 +#: ../../library/socket.rst:2298 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2306 +#: ../../library/socket.rst:2301 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2618,30 +2612,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2310 +#: ../../library/socket.rst:2305 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2316 +#: ../../library/socket.rst:2311 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2318 +#: ../../library/socket.rst:2313 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2320 +#: ../../library/socket.rst:2315 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2323 +#: ../../library/socket.rst:2318 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2668,11 +2662,11 @@ msgstr "I/O control(I/O 控制)" msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1980 +#: ../../library/socket.rst:1975 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1980 +#: ../../library/socket.rst:1975 msgid "struct" msgstr "struct" diff --git a/library/socketserver.po b/library/socketserver.po index d572ee7494..b0b992cf06 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -565,7 +565,7 @@ msgstr "範例" msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:581 +#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:592 msgid "This is the server side::" msgstr "" @@ -584,11 +584,17 @@ msgid "" "\n" " def handle(self):\n" " # self.request is the TCP socket connected to the client\n" -" self.data = self.request.recv(1024).strip()\n" -" print(\"Received from {}:\".format(self.client_address[0]))\n" -" print(self.data)\n" +" pieces = [b'']\n" +" total = 0\n" +" while b'\\n' not in pieces[-1] and total < 10_000:\n" +" pieces.append(self.request.recv(2000))\n" +" total += len(pieces[-1])\n" +" self.data = b''.join(pieces)\n" +" print(f\"Received from {self.client_address[0]}:\")\n" +" print(self.data.decode(\"utf-8\"))\n" " # just send back the same data, but upper-cased\n" " self.request.sendall(self.data.upper())\n" +" # after we return, the socket will be closed.\n" "\n" "if __name__ == \"__main__\":\n" " HOST, PORT = \"localhost\", 9999\n" @@ -600,42 +606,46 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:511 +#: ../../library/socketserver.rst:517 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:514 +#: ../../library/socketserver.rst:520 msgid "" "class MyTCPHandler(socketserver.StreamRequestHandler):\n" "\n" " def handle(self):\n" -" # self.rfile is a file-like object created by the handler;\n" -" # we can now use e.g. readline() instead of raw recv() calls\n" -" self.data = self.rfile.readline().strip()\n" -" print(\"{} wrote:\".format(self.client_address[0]))\n" -" print(self.data)\n" +" # self.rfile is a file-like object created by the handler.\n" +" # We can now use e.g. readline() instead of raw recv() calls.\n" +" # We limit ourselves to 10000 bytes to avoid abuse by the sender.\n" +" self.data = self.rfile.readline(10000).rstrip()\n" +" print(f\"{self.client_address[0]} wrote:\")\n" +" print(self.data.decode(\"utf-8\"))\n" " # Likewise, self.wfile is a file-like object used to write back\n" " # to the client\n" " self.wfile.write(self.data.upper())" msgstr "" -#: ../../library/socketserver.rst:526 +#: ../../library/socketserver.rst:533 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " -"while the single ``recv()`` call in the first handler will just return what " -"has been received so far from the client's ``sendall()`` call (typically all " -"of it, but this is not guaranteed by the TCP protocol)." +"while the the first handler had to use a ``recv()`` loop to accumulate data " +"until a newline itself. If it had just used a single ``recv()`` without the " +"loop it would just have returned what has been received so far from the " +"client. TCP is stream based: data arrives in the order it was sent, but " +"there no correlation between client ``send()`` or ``sendall()`` calls and " +"the number of ``recv()`` calls on the server required to receive it." msgstr "" -#: ../../library/socketserver.rst:533 ../../library/socketserver.rst:605 +#: ../../library/socketserver.rst:543 ../../library/socketserver.rst:616 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:535 +#: ../../library/socketserver.rst:545 msgid "" "import socket\n" "import sys\n" @@ -647,24 +657,25 @@ msgid "" "with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:\n" " # Connect to server and send data\n" " sock.connect((HOST, PORT))\n" -" sock.sendall(bytes(data + \"\\n\", \"utf-8\"))\n" +" sock.sendall(bytes(data, \"utf-8\"))\n" +" sock.sendall(b\"\\n\")\n" "\n" " # Receive data from the server and shut down\n" " received = str(sock.recv(1024), \"utf-8\")\n" "\n" -"print(\"Sent: {}\".format(data))\n" -"print(\"Received: {}\".format(received))" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:554 ../../library/socketserver.rst:680 +#: ../../library/socketserver.rst:565 ../../library/socketserver.rst:691 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:556 +#: ../../library/socketserver.rst:567 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:558 +#: ../../library/socketserver.rst:569 msgid "" "$ python TCPServer.py\n" "127.0.0.1 wrote:\n" @@ -678,11 +689,11 @@ msgstr "" "127.0.0.1 wrote:\n" "b'python is nice'" -#: ../../library/socketserver.rst:566 +#: ../../library/socketserver.rst:577 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:568 +#: ../../library/socketserver.rst:579 msgid "" "$ python TCPClient.py hello world with TCP\n" "Sent: hello world with TCP\n" @@ -698,11 +709,11 @@ msgstr "" "Sent: python is nice\n" "Received: PYTHON IS NICE" -#: ../../library/socketserver.rst:579 +#: ../../library/socketserver.rst:590 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:583 +#: ../../library/socketserver.rst:594 msgid "" "import socketserver\n" "\n" @@ -717,7 +728,7 @@ msgid "" " def handle(self):\n" " data = self.request[0].strip()\n" " socket = self.request[1]\n" -" print(\"{} wrote:\".format(self.client_address[0]))\n" +" print(f\"{self.client_address[0]} wrote:\")\n" " print(data)\n" " socket.sendto(data.upper(), self.client_address)\n" "\n" @@ -727,7 +738,7 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:607 +#: ../../library/socketserver.rst:618 msgid "" "import socket\n" "import sys\n" @@ -743,31 +754,31 @@ msgid "" "sock.sendto(bytes(data + \"\\n\", \"utf-8\"), (HOST, PORT))\n" "received = str(sock.recv(1024), \"utf-8\")\n" "\n" -"print(\"Sent: {}\".format(data))\n" -"print(\"Received: {}\".format(received))" +"print(\"Sent: \", data)\n" +"print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:624 +#: ../../library/socketserver.rst:635 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:628 +#: ../../library/socketserver.rst:639 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:630 +#: ../../library/socketserver.rst:641 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:633 +#: ../../library/socketserver.rst:644 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:635 +#: ../../library/socketserver.rst:646 msgid "" "import socket\n" "import threading\n" @@ -815,7 +826,7 @@ msgid "" " server.shutdown()" msgstr "" -#: ../../library/socketserver.rst:682 +#: ../../library/socketserver.rst:693 msgid "" "$ python ThreadedTCPServer.py\n" "Server loop running in thread: Thread-1\n" @@ -829,7 +840,7 @@ msgstr "" "Received: Thread-3: Hello World 2\n" "Received: Thread-4: Hello World 3" -#: ../../library/socketserver.rst:691 +#: ../../library/socketserver.rst:702 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/ssl.po b/library/ssl.po index 595e262f25..836bfdab60 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2708,8 +2708,8 @@ msgstr "" msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " -"attribute is read-only for protocols other than :attr:`PROTOCOL_TLS`, :attr:" -"`PROTOCOL_TLS_CLIENT`, and :attr:`PROTOCOL_TLS_SERVER`." +"attribute is read-only for protocols other than :const:`PROTOCOL_TLS`, :" +"const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" #: ../../library/ssl.rst:1937 @@ -2730,7 +2730,7 @@ msgstr "" #: ../../library/ssl.rst:1957 msgid "" -"Control the number of TLS 1.3 session tickets of a :attr:" +"Control the number of TLS 1.3 session tickets of a :const:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" diff --git a/library/string.po b/library/string.po index b53a4fae17..171aa64c1b 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,10 +86,11 @@ msgstr "" "在 ``C`` 語言中被視為標點符號的 ASCII 字元的字串: ``!”#$%&’()*+,-./:;<=>?" "@[\\]^_`{|}~``。" -#: ../../library/string.rst:64 +#: ../../library/string.rst:65 +#, fuzzy msgid "" -"String of ASCII characters which are considered printable. This is a " -"combination of :const:`digits`, :const:`ascii_letters`, :const:" +"String of ASCII characters which are considered printable by Python. This is " +"a combination of :const:`digits`, :const:`ascii_letters`, :const:" "`punctuation`, and :const:`whitespace`." msgstr "" "ASCII 字元的字串是可被列印輸出的。 這是 :const:`digits`、:const:" @@ -97,6 +98,13 @@ msgstr "" #: ../../library/string.rst:71 msgid "" +"By design, :meth:`string.printable.isprintable() <str.isprintable>` returns :" +"const:`False`. In particular, ``string.printable`` is not printable in the " +"POSIX sense (see :manpage:`LC_CTYPE <locale(5)>`)." +msgstr "" + +#: ../../library/string.rst:78 +msgid "" "A string containing all ASCII characters that are considered whitespace. " "This includes the characters space, tab, linefeed, return, formfeed, and " "vertical tab." @@ -105,11 +113,11 @@ msgstr "" "符號 (tab)、換行符號 (linefeed)、return、換頁符號 (formfeed) 和垂直製表符號 " "(vertical tab) 這些字元。" -#: ../../library/string.rst:79 +#: ../../library/string.rst:86 msgid "Custom String Formatting" msgstr "自訂字串格式" -#: ../../library/string.rst:81 +#: ../../library/string.rst:88 msgid "" "The built-in string class provides the ability to do complex variable " "substitutions and value formatting via the :meth:`~str.format` method " @@ -123,11 +131,11 @@ msgstr "" "模組可讓你使用與內建 :meth:`~str.format` 方法相同的實作來建立和自訂你自己的字" "串格式化行為。" -#: ../../library/string.rst:90 +#: ../../library/string.rst:97 msgid "The :class:`Formatter` class has the following public methods:" msgstr ":class:`Formatter` 類別有以下的公開方法:" -#: ../../library/string.rst:94 +#: ../../library/string.rst:101 msgid "" "The primary API method. It takes a format string and an arbitrary set of " "positional and keyword arguments. It is just a wrapper that calls :meth:" @@ -136,13 +144,13 @@ msgstr "" "主要的 API 方法。它接收一個格式字串及一組任意的位置引數與關鍵字引數,是呼叫 :" "meth:`vformat` 的包裝器 (wrapper)。" -#: ../../library/string.rst:98 +#: ../../library/string.rst:105 msgid "" "A format string argument is now :ref:`positional-only <positional-" "only_parameter>`." msgstr "現在格式字串引數是\\ :ref:`僅限位置參數 <positional-only_parameter>`。" -#: ../../library/string.rst:104 +#: ../../library/string.rst:111 msgid "" "This function does the actual work of formatting. It is exposed as a " "separate function for cases where you want to pass in a predefined " @@ -152,13 +160,13 @@ msgid "" "and replacement fields. It calls the various methods described below." msgstr "" -#: ../../library/string.rst:112 +#: ../../library/string.rst:119 msgid "" "In addition, the :class:`Formatter` defines a number of methods that are " "intended to be replaced by subclasses:" msgstr "" -#: ../../library/string.rst:117 +#: ../../library/string.rst:124 msgid "" "Loop over the format_string and return an iterable of tuples " "(*literal_text*, *field_name*, *format_spec*, *conversion*). This is used " @@ -169,7 +177,7 @@ msgstr "" "*field_name*, *format_spec*, *conversion*)。這會被 :meth:`vformat` 用於將字串" "裁切為字面文本或替換欄位。" -#: ../../library/string.rst:122 +#: ../../library/string.rst:129 msgid "" "The values in the tuple conceptually represent a span of literal text " "followed by a single replacement field. If there is no literal text (which " @@ -179,7 +187,7 @@ msgid "" "be ``None``." msgstr "" -#: ../../library/string.rst:131 +#: ../../library/string.rst:138 msgid "" "Given *field_name* as returned by :meth:`parse` (see above), convert it to " "an object to be formatted. Returns a tuple (obj, used_key). The default " @@ -189,7 +197,7 @@ msgid "" "*key* parameter to :meth:`get_value`." msgstr "" -#: ../../library/string.rst:140 +#: ../../library/string.rst:147 msgid "" "Retrieve a given field value. The *key* argument will be either an integer " "or a string. If it is an integer, it represents the index of the positional " @@ -197,21 +205,21 @@ msgid "" "in *kwargs*." msgstr "" -#: ../../library/string.rst:145 +#: ../../library/string.rst:152 msgid "" "The *args* parameter is set to the list of positional arguments to :meth:" "`vformat`, and the *kwargs* parameter is set to the dictionary of keyword " "arguments." msgstr "" -#: ../../library/string.rst:149 +#: ../../library/string.rst:156 msgid "" "For compound field names, these functions are only called for the first " "component of the field name; subsequent components are handled through " "normal attribute and indexing operations." msgstr "" -#: ../../library/string.rst:153 +#: ../../library/string.rst:160 msgid "" "So for example, the field expression '0.name' would cause :meth:`get_value` " "to be called with a *key* argument of 0. The ``name`` attribute will be " @@ -219,13 +227,13 @@ msgid "" "`getattr` function." msgstr "" -#: ../../library/string.rst:158 +#: ../../library/string.rst:165 msgid "" "If the index or keyword refers to an item that does not exist, then an :exc:" "`IndexError` or :exc:`KeyError` should be raised." msgstr "" -#: ../../library/string.rst:163 +#: ../../library/string.rst:170 msgid "" "Implement checking for unused arguments if desired. The arguments to this " "function is the set of all argument keys that were actually referred to in " @@ -235,24 +243,24 @@ msgid "" "meth:`check_unused_args` is assumed to raise an exception if the check fails." msgstr "" -#: ../../library/string.rst:173 +#: ../../library/string.rst:180 msgid "" ":meth:`format_field` simply calls the global :func:`format` built-in. The " "method is provided so that subclasses can override it." msgstr "" -#: ../../library/string.rst:178 +#: ../../library/string.rst:185 msgid "" "Converts the value (returned by :meth:`get_field`) given a conversion type " "(as in the tuple returned by the :meth:`parse` method). The default version " "understands 's' (str), 'r' (repr) and 'a' (ascii) conversion types." msgstr "" -#: ../../library/string.rst:187 +#: ../../library/string.rst:194 msgid "Format String Syntax" msgstr "格式化文字語法" -#: ../../library/string.rst:189 +#: ../../library/string.rst:196 msgid "" "The :meth:`str.format` method and the :class:`Formatter` class share the " "same syntax for format strings (although in the case of :class:`Formatter`, " @@ -262,7 +270,7 @@ msgid "" "expressions." msgstr "" -#: ../../library/string.rst:202 +#: ../../library/string.rst:209 msgid "" "Format strings contain \"replacement fields\" surrounded by curly braces ``{}" "``. Anything that is not contained in braces is considered literal text, " @@ -271,11 +279,11 @@ msgid "" "``." msgstr "" -#: ../../library/string.rst:207 +#: ../../library/string.rst:214 msgid "The grammar for a replacement field is as follows:" msgstr "" -#: ../../library/string.rst:219 +#: ../../library/string.rst:226 msgid "" "In less formal terms, the replacement field can start with a *field_name* " "that specifies the object whose value is to be formatted and inserted into " @@ -285,11 +293,11 @@ msgid "" "specify a non-default format for the replacement value." msgstr "" -#: ../../library/string.rst:226 +#: ../../library/string.rst:233 msgid "See also the :ref:`formatspec` section." msgstr "另請參閱 :ref:`formatspec` 部份。" -#: ../../library/string.rst:228 +#: ../../library/string.rst:235 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 " @@ -306,22 +314,22 @@ msgid "" "lookup using :meth:`~object.__getitem__`." msgstr "" -#: ../../library/string.rst:242 +#: ../../library/string.rst:249 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:246 +#: ../../library/string.rst:253 msgid "" "The positional argument specifiers can be omitted for :class:`Formatter`." msgstr "" -#: ../../library/string.rst:249 +#: ../../library/string.rst:256 msgid "Some simple format string examples::" msgstr "" -#: ../../library/string.rst:251 +#: ../../library/string.rst:258 msgid "" "\"First, thou shalt count to {0}\" # References first positional argument\n" "\"Bring me a {}\" # Implicitly references the first " @@ -334,7 +342,7 @@ msgid "" "'players'." msgstr "" -#: ../../library/string.rst:258 +#: ../../library/string.rst:265 msgid "" "The *conversion* field causes a type coercion before formatting. Normally, " "the job of formatting a value is done by the :meth:`~object.__format__` " @@ -344,7 +352,7 @@ msgid "" "`~object.__format__`, the normal formatting logic is bypassed." msgstr "" -#: ../../library/string.rst:265 +#: ../../library/string.rst:272 msgid "" "Three conversion flags are currently supported: ``'!s'`` which calls :func:" "`str` on the value, ``'!r'`` which calls :func:`repr` and ``'!a'`` which " @@ -353,18 +361,18 @@ msgstr "" "目前支援三種轉換旗標:``'!s'`` 會對該值呼叫 :func:`str`,``'!r'`` 會對該值呼" "叫 :func:`repr`,而 ``'!a'`` 則會對該值呼叫 :func:`ascii`。" -#: ../../library/string.rst:269 +#: ../../library/string.rst:276 msgid "Some examples::" msgstr "一些範例: ::" -#: ../../library/string.rst:271 +#: ../../library/string.rst:278 msgid "" "\"Harold's a clever {0!s}\" # Calls str() on the argument first\n" "\"Bring out the holy {name!r}\" # Calls repr() on the argument first\n" "\"More {!a}\" # Calls ascii() on the argument first" msgstr "" -#: ../../library/string.rst:275 +#: ../../library/string.rst:282 msgid "" "The *format_spec* field contains a specification of how the value should be " "presented, including such details as field width, alignment, padding, " @@ -375,13 +383,13 @@ msgstr "" "數精度等細節資訊。每種值類型都可以定義自己的「格式化迷你語言 (formatting " "mini-language)」或對 *format_spec* 的解釋。" -#: ../../library/string.rst:280 +#: ../../library/string.rst:287 msgid "" "Most built-in types support a common formatting mini-language, which is " "described in the next section." msgstr "大多數內建型別都支援常見的格式化迷你語言,下一節將會詳細說明。" -#: ../../library/string.rst:283 +#: ../../library/string.rst:290 msgid "" "A *format_spec* field can also include nested replacement fields within it. " "These nested replacement fields may contain a field name, conversion flag " @@ -395,15 +403,15 @@ msgstr "" "format_spec 内部的替換欄位會在 *format_spec* 字串被直譯前被替換。這讓數值的格" "式能夠被動態地指定。" -#: ../../library/string.rst:290 +#: ../../library/string.rst:297 msgid "See the :ref:`formatexamples` section for some examples." msgstr "範例請見 :ref:`formatexamples`。" -#: ../../library/string.rst:296 +#: ../../library/string.rst:303 msgid "Format Specification Mini-Language" msgstr "格式規格 (Format Specification) 迷你語言" -#: ../../library/string.rst:298 +#: ../../library/string.rst:305 msgid "" "\"Format specifications\" are used within replacement fields contained " "within a format string to define how individual values are presented (see :" @@ -416,7 +424,7 @@ msgstr "" "接傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以" "定義格式規格如何被直譯。" -#: ../../library/string.rst:305 +#: ../../library/string.rst:312 msgid "" "Most built-in types implement the following options for format " "specifications, although some of the formatting options are only supported " @@ -424,7 +432,7 @@ msgid "" msgstr "" "大部分內建型別為了格式規格實作了下列選項,不過有些選項只被數值型別支援。" -#: ../../library/string.rst:308 +#: ../../library/string.rst:315 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 " @@ -433,11 +441,11 @@ msgstr "" "一般來說,輸入空格式規格會產生和對值呼叫 :func:`str` 函式相同的結果,非空的格" "式規格才會修改結果。" -#: ../../library/string.rst:312 +#: ../../library/string.rst:319 msgid "The general form of a *standard format specifier* is:" msgstr "*標準格式說明符號 (standard format specifier)* 的一般型式如下:" -#: ../../library/string.rst:324 +#: ../../library/string.rst:331 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 " @@ -453,45 +461,45 @@ msgstr "" "*fill* 字元的,但仍可透過巢狀替換欄位的方式插入大括號。此限制不影響 :func:" "`format` 函式。" -#: ../../library/string.rst:333 +#: ../../library/string.rst:340 msgid "The meaning of the various alignment options is as follows:" msgstr "" -#: ../../library/string.rst:342 ../../library/string.rst:374 +#: ../../library/string.rst:349 ../../library/string.rst:381 msgid "Option" msgstr "選項" -#: ../../library/string.rst:342 ../../library/string.rst:374 -#: ../../library/string.rst:459 ../../library/string.rst:470 -#: ../../library/string.rst:505 +#: ../../library/string.rst:349 ../../library/string.rst:381 +#: ../../library/string.rst:466 ../../library/string.rst:477 +#: ../../library/string.rst:512 msgid "Meaning" msgstr "含義" -#: ../../library/string.rst:344 +#: ../../library/string.rst:351 msgid "``'<'``" msgstr "``'<'``" -#: ../../library/string.rst:344 +#: ../../library/string.rst:351 msgid "" "Forces the field to be left-aligned within the available space (this is the " "default for most objects)." msgstr "強制欄位在可用空間內靠左對齊(這是大多數物件的預設值)。" -#: ../../library/string.rst:347 +#: ../../library/string.rst:354 msgid "``'>'``" msgstr "``'>'``" -#: ../../library/string.rst:347 +#: ../../library/string.rst:354 msgid "" "Forces the field to be right-aligned within the available space (this is the " "default for numbers)." msgstr "強制欄位在可用空間內靠右對齊(這是數字的預設值)。" -#: ../../library/string.rst:350 +#: ../../library/string.rst:357 msgid "``'='``" msgstr "``'='``" -#: ../../library/string.rst:350 +#: ../../library/string.rst:357 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 " @@ -500,15 +508,15 @@ msgid "" "the field width." msgstr "" -#: ../../library/string.rst:357 +#: ../../library/string.rst:364 msgid "``'^'``" msgstr "``'^'``" -#: ../../library/string.rst:357 +#: ../../library/string.rst:364 msgid "Forces the field to be centered within the available space." msgstr "強制欄位在可用空間內置中。" -#: ../../library/string.rst:361 +#: ../../library/string.rst:368 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 " @@ -517,54 +525,54 @@ msgstr "" "請注意,除非有定義了最小欄位寬度,否則欄位寬度將始終與填充它的資料大小相同," "故在該情況下的對齊選項是沒有意義的。" -#: ../../library/string.rst:365 +#: ../../library/string.rst:372 msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" msgstr "*sign* 選項只適用於數字型別,並可為以下之一:" -#: ../../library/string.rst:376 +#: ../../library/string.rst:383 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/string.rst:376 +#: ../../library/string.rst:383 msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." msgstr "表示正數與負數均需使用符號。" -#: ../../library/string.rst:379 +#: ../../library/string.rst:386 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/string.rst:379 +#: ../../library/string.rst:386 msgid "" "indicates that a sign should be used only for negative numbers (this is the " "default behavior)." msgstr "" -#: ../../library/string.rst:368 ../../library/string.rst:382 +#: ../../library/string.rst:375 ../../library/string.rst:389 msgid "space" msgstr "" -#: ../../library/string.rst:382 +#: ../../library/string.rst:389 msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." msgstr "表示正數應使用前導空格,負數應使用減號。" -#: ../../library/string.rst:389 +#: ../../library/string.rst:396 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:393 +#: ../../library/string.rst:400 msgid "Added the ``'z'`` option (see also :pep:`682`)." msgstr "新增 ``'z'`` 選項(請見 :pep:`682`\\ )。" -#: ../../library/string.rst:398 +#: ../../library/string.rst:405 msgid "" "The ``'#'`` option causes the \"alternate form\" to be used for the " "conversion. The alternate form is defined differently for different types. " @@ -578,7 +586,7 @@ msgid "" "and ``'G'`` conversions, trailing zeros are not removed from the result." msgstr "" -#: ../../library/string.rst:412 +#: ../../library/string.rst:419 #, fuzzy msgid "" "The ``','`` option signals the use of a comma for a thousands separator for " @@ -590,11 +598,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:418 +#: ../../library/string.rst:425 msgid "Added the ``','`` option (see also :pep:`378`)." msgstr "新增 ``','`` 選項(請見 :pep:`378`\\ )。" -#: ../../library/string.rst:423 +#: ../../library/string.rst:430 msgid "" "The ``'_'`` option signals the use of an underscore for a thousands " "separator for floating-point presentation types and for integer presentation " @@ -606,11 +614,11 @@ msgstr "" "號。對於整數表示型別 ``'b'``,``'o'``,``'x'`` 和 ``'X'``,每 4 位數字會插入" "底線。對於其他表示型別,指定此選項會出錯。" -#: ../../library/string.rst:430 +#: ../../library/string.rst:437 msgid "Added the ``'_'`` option (see also :pep:`515`)." msgstr "新增 ``'_'`` 選項(請見 :pep:`515`\\ )。" -#: ../../library/string.rst:433 +#: ../../library/string.rst:440 msgid "" "*width* is a decimal integer defining the minimum total field width, " "including any prefixes, separators, and other formatting characters. If not " @@ -619,7 +627,7 @@ msgstr "" "*width* 是一個十進位整數,定義了最小總欄位寬度,包括任何前綴、分隔符號和其他" "格式字元。如果未指定,則欄位寬度將由內容決定。" -#: ../../library/string.rst:437 +#: ../../library/string.rst:444 #, fuzzy msgid "" "When no explicit alignment is given, preceding the *width* field by a zero " @@ -631,13 +639,13 @@ msgstr "" "別啟用有符號察覺的零填充 (sign-aware zero-padding)。這相當於使用 ``'0'`` 為 " "*fill* 字元且對齊類型為 ``'='``。" -#: ../../library/string.rst:442 +#: ../../library/string.rst:449 msgid "" "Preceding the *width* field by ``'0'`` no longer affects the default " "alignment for strings." msgstr "在 *width* 欄位前面加上 ``'0'`` 不再影響字串的預設對齊方式。" -#: ../../library/string.rst:446 +#: ../../library/string.rst:453 msgid "" "The *precision* is a decimal integer indicating how many digits should be " "displayed after the decimal point for presentation types ``'f'`` and " @@ -652,89 +660,89 @@ msgstr "" "示類型,該欄位指定最大欄位大小 - 換言之,將使用欄位中的多少字元。整數表示類型" "不允許使用 *precision*。" -#: ../../library/string.rst:454 +#: ../../library/string.rst:461 msgid "Finally, the *type* determines how the data should be presented." msgstr "最終,型別決定了資料將會如何呈現" -#: ../../library/string.rst:456 +#: ../../library/string.rst:463 msgid "The available string presentation types are:" msgstr "可用的字串表示型別有:" -#: ../../library/string.rst:459 ../../library/string.rst:470 -#: ../../library/string.rst:505 +#: ../../library/string.rst:466 ../../library/string.rst:477 +#: ../../library/string.rst:512 msgid "Type" msgstr "型別" -#: ../../library/string.rst:461 +#: ../../library/string.rst:468 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/string.rst:461 +#: ../../library/string.rst:468 msgid "String format. This is the default type for strings and may be omitted." msgstr "" -#: ../../library/string.rst:464 ../../library/string.rst:493 -#: ../../library/string.rst:578 +#: ../../library/string.rst:471 ../../library/string.rst:500 +#: ../../library/string.rst:585 msgid "None" msgstr "None" -#: ../../library/string.rst:464 +#: ../../library/string.rst:471 msgid "The same as ``'s'``." msgstr "" -#: ../../library/string.rst:467 +#: ../../library/string.rst:474 msgid "The available integer presentation types are:" msgstr "" -#: ../../library/string.rst:472 +#: ../../library/string.rst:479 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/string.rst:472 +#: ../../library/string.rst:479 msgid "Binary format. Outputs the number in base 2." msgstr "" -#: ../../library/string.rst:474 +#: ../../library/string.rst:481 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/string.rst:474 +#: ../../library/string.rst:481 msgid "" "Character. Converts the integer to the corresponding unicode character " "before printing." msgstr "" -#: ../../library/string.rst:477 +#: ../../library/string.rst:484 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/string.rst:477 +#: ../../library/string.rst:484 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../library/string.rst:479 +#: ../../library/string.rst:486 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/string.rst:479 +#: ../../library/string.rst:486 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../library/string.rst:481 +#: ../../library/string.rst:488 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/string.rst:481 +#: ../../library/string.rst:488 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" -#: ../../library/string.rst:484 +#: ../../library/string.rst:491 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/string.rst:484 +#: ../../library/string.rst:491 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 " @@ -743,21 +751,21 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:489 ../../library/string.rst:571 +#: ../../library/string.rst:496 ../../library/string.rst:578 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/string.rst:489 +#: ../../library/string.rst:496 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:493 +#: ../../library/string.rst:500 msgid "The same as ``'d'``." msgstr "" -#: ../../library/string.rst:496 +#: ../../library/string.rst:503 msgid "" "In addition to the above presentation types, integers can be formatted with " "the floating-point presentation types listed below (except ``'n'`` and " @@ -765,17 +773,17 @@ msgid "" "floating-point number before formatting." msgstr "" -#: ../../library/string.rst:501 +#: ../../library/string.rst:508 msgid "" "The available presentation types for :class:`float` and :class:`~decimal." "Decimal` values are:" msgstr "" -#: ../../library/string.rst:507 +#: ../../library/string.rst:514 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/string.rst:507 +#: ../../library/string.rst:514 msgid "" "Scientific notation. For a given precision ``p``, formats the number in " "scientific notation with the letter 'e' separating the coefficient from the " @@ -787,21 +795,21 @@ msgid "" "is used." msgstr "" -#: ../../library/string.rst:518 +#: ../../library/string.rst:525 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:518 +#: ../../library/string.rst:525 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:521 +#: ../../library/string.rst:528 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:521 +#: ../../library/string.rst:528 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 " @@ -811,21 +819,21 @@ msgid "" "point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:530 +#: ../../library/string.rst:537 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:530 +#: ../../library/string.rst:537 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:533 +#: ../../library/string.rst:540 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:533 +#: ../../library/string.rst:540 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 " @@ -833,7 +841,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:540 +#: ../../library/string.rst:547 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -846,7 +854,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:553 +#: ../../library/string.rst:560 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -856,40 +864,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:562 +#: ../../library/string.rst:569 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:567 +#: ../../library/string.rst:574 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:567 +#: ../../library/string.rst:574 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:571 +#: ../../library/string.rst:578 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:575 +#: ../../library/string.rst:582 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:575 +#: ../../library/string.rst:582 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:578 +#: ../../library/string.rst:585 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -898,20 +906,20 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:586 +#: ../../library/string.rst:593 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:590 +#: ../../library/string.rst:597 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:594 +#: ../../library/string.rst:601 msgid "" "The result should be correctly rounded to a given precision ``p`` of digits " "after the decimal point. The rounding mode for :class:`float` matches that " @@ -919,7 +927,7 @@ msgid "" "mode of the current :ref:`context <decimal-context>` will be used." msgstr "" -#: ../../library/string.rst:599 +#: ../../library/string.rst:606 msgid "" "The available presentation types for :class:`complex` are the same as those " "for :class:`float` (``'%'`` is not allowed). Both the real and imaginary " @@ -931,17 +939,17 @@ msgid "" "surrounded by parentheses), possibly altered by other format modifiers." msgstr "" -#: ../../library/string.rst:612 +#: ../../library/string.rst:619 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:614 +#: ../../library/string.rst:621 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:617 +#: ../../library/string.rst:624 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 " @@ -950,17 +958,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:621 +#: ../../library/string.rst:628 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:624 +#: ../../library/string.rst:631 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:626 +#: ../../library/string.rst:633 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -975,11 +983,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:637 +#: ../../library/string.rst:644 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:639 +#: ../../library/string.rst:646 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -989,11 +997,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:645 +#: ../../library/string.rst:652 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:647 +#: ../../library/string.rst:654 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -1010,22 +1018,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:660 +#: ../../library/string.rst:667 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:662 +#: ../../library/string.rst:669 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:666 +#: ../../library/string.rst:673 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:668 +#: ../../library/string.rst:675 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1035,11 +1043,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:671 +#: ../../library/string.rst:678 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:673 +#: ../../library/string.rst:680 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1051,11 +1059,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:682 +#: ../../library/string.rst:689 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:684 +#: ../../library/string.rst:691 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1066,12 +1074,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:691 +#: ../../library/string.rst:698 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:693 +#: ../../library/string.rst:700 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1081,11 +1089,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:700 +#: ../../library/string.rst:707 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:702 +#: ../../library/string.rst:709 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1093,11 +1101,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:705 +#: ../../library/string.rst:712 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:707 +#: ../../library/string.rst:714 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1109,11 +1117,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:712 +#: ../../library/string.rst:719 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:714 +#: ../../library/string.rst:721 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1125,11 +1133,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:719 +#: ../../library/string.rst:726 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:721 +#: ../../library/string.rst:728 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1187,11 +1195,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:753 +#: ../../library/string.rst:760 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:755 +#: ../../library/string.rst:762 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1205,17 +1213,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "<https://flufli18n.readthedocs.io/en/latest/>`_ 套件。" -#: ../../library/string.rst:765 +#: ../../library/string.rst:772 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:767 +#: ../../library/string.rst:774 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:769 +#: ../../library/string.rst:776 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1225,30 +1233,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:776 +#: ../../library/string.rst:783 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:780 +#: ../../library/string.rst:787 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:783 +#: ../../library/string.rst:790 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:789 +#: ../../library/string.rst:796 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:794 +#: ../../library/string.rst:801 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1260,7 +1268,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:803 +#: ../../library/string.rst:810 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1273,7 +1281,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:809 +#: ../../library/string.rst:816 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 " @@ -1287,7 +1295,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:819 +#: ../../library/string.rst:826 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1295,18 +1303,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:827 +#: ../../library/string.rst:834 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:832 +#: ../../library/string.rst:839 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:836 +#: ../../library/string.rst:843 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." @@ -1314,11 +1322,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:839 +#: ../../library/string.rst:846 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:841 +#: ../../library/string.rst:848 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1352,7 +1360,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:857 +#: ../../library/string.rst:864 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1362,7 +1370,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:862 +#: ../../library/string.rst:869 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1376,7 +1384,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:869 +#: ../../library/string.rst:876 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1384,19 +1392,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:876 +#: ../../library/string.rst:883 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:880 +#: ../../library/string.rst:887 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:884 +#: ../../library/string.rst:891 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1405,7 +1413,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:892 +#: ../../library/string.rst:899 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1414,7 +1422,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:900 +#: ../../library/string.rst:907 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1423,13 +1431,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:906 +#: ../../library/string.rst:913 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:909 +#: ../../library/string.rst:916 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1437,7 +1445,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:912 +#: ../../library/string.rst:919 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1445,7 +1453,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:915 +#: ../../library/string.rst:922 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1453,7 +1461,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:918 +#: ../../library/string.rst:925 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1461,11 +1469,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:923 +#: ../../library/string.rst:930 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:927 +#: ../../library/string.rst:934 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1479,77 +1487,77 @@ msgstr "" "不存在或為 ``None``,則連續的空白字元將替換為單一空格,並且刪除前導和尾隨空" "白;在其他情況下則使用 *sep* 來分割和連接單字。" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/string.rst:195 ../../library/string.rst:335 -#: ../../library/string.rst:368 ../../library/string.rst:387 -#: ../../library/string.rst:396 ../../library/string.rst:410 -#: ../../library/string.rst:421 +#: ../../library/string.rst:202 ../../library/string.rst:342 +#: ../../library/string.rst:375 ../../library/string.rst:394 +#: ../../library/string.rst:403 ../../library/string.rst:417 +#: ../../library/string.rst:428 msgid "in string formatting" msgstr "於字串格式化" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid ". (dot)" msgstr ". (點)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "[] (square brackets)" msgstr "[] (方括號)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../library/string.rst:195 +#: ../../library/string.rst:202 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "< (less)" msgstr "< (小於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "> (greater)" msgstr "> (大於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "= (equals)" msgstr "= (等於)" -#: ../../library/string.rst:335 +#: ../../library/string.rst:342 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/string.rst:368 +#: ../../library/string.rst:375 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/string.rst:368 +#: ../../library/string.rst:375 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/string.rst:387 +#: ../../library/string.rst:394 msgid "z" msgstr "z" -#: ../../library/string.rst:396 +#: ../../library/string.rst:403 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/string.rst:410 +#: ../../library/string.rst:417 msgid ", (comma)" msgstr ", (逗號)" -#: ../../library/string.rst:421 +#: ../../library/string.rst:428 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:763 +#: ../../library/string.rst:770 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:763 +#: ../../library/string.rst:770 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/sys.po b/library/sys.po index 082123fe64..de7ddad868 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,8 @@ msgstr ":mod:`!sys` --- 系統特定的參數與函式" msgid "" "This module provides access to some variables used or maintained by the " "interpreter and to functions that interact strongly with the interpreter. It " -"is always available." +"is always available. Unless explicitly noted otherwise, all variables are " +"read-only." msgstr "" #: ../../library/sys.rst:16 diff --git a/library/sysconfig.po b/library/sysconfig.po index 7a2c3ec0df..c45650cd32 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -665,78 +665,82 @@ msgid "Windows will return one of:" msgstr "" #: ../../library/sysconfig.rst:391 -msgid "win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" +msgid "win-amd64 (64-bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" #: ../../library/sysconfig.rst:392 +msgid "win-arm64 (64-bit Windows on ARM64, aka AArch64)" +msgstr "" + +#: ../../library/sysconfig.rst:393 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:394 +#: ../../library/sysconfig.rst:395 msgid "macOS can return:" msgstr "" -#: ../../library/sysconfig.rst:396 +#: ../../library/sysconfig.rst:397 msgid "macosx-10.6-ppc" msgstr "macosx-10.6-ppc" -#: ../../library/sysconfig.rst:397 +#: ../../library/sysconfig.rst:398 msgid "macosx-10.4-ppc64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:398 +#: ../../library/sysconfig.rst:399 msgid "macosx-10.3-i386" msgstr "macosx-10.3-i386" -#: ../../library/sysconfig.rst:399 +#: ../../library/sysconfig.rst:400 msgid "macosx-10.4-fat" msgstr "macosx-10.4-fat" -#: ../../library/sysconfig.rst:401 +#: ../../library/sysconfig.rst:402 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:406 +#: ../../library/sysconfig.rst:407 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:413 +#: ../../library/sysconfig.rst:414 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:415 +#: ../../library/sysconfig.rst:416 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:417 +#: ../../library/sysconfig.rst:418 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:424 +#: ../../library/sysconfig.rst:425 msgid "Return the path of :file:`pyconfig.h`." msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:428 +#: ../../library/sysconfig.rst:429 msgid "Return the path of :file:`Makefile`." msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:433 +#: ../../library/sysconfig.rst:434 msgid "Using :mod:`sysconfig` as a script" msgstr "將 :mod:`sysconfig` 作為腳本使用" -#: ../../library/sysconfig.rst:435 +#: ../../library/sysconfig.rst:436 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:437 +#: ../../library/sysconfig.rst:438 msgid "" "$ python -m sysconfig\n" "Platform: \"macosx-10.4-i386\"\n" @@ -782,7 +786,7 @@ msgstr "" " ARFLAGS = \"rc\"\n" " ..." -#: ../../library/sysconfig.rst:461 +#: ../../library/sysconfig.rst:462 msgid "" "This call will print in the standard output the information returned by :" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" diff --git a/library/time.po b/library/time.po index c57cecb22f..5284cd04b4 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2024-08-14 16:05+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,14 +266,14 @@ msgstr "" #: ../../library/time.rst:149 ../../library/time.rst:161 #: ../../library/time.rst:174 ../../library/time.rst:183 #: ../../library/time.rst:196 ../../library/time.rst:205 -#: ../../library/time.rst:734 ../../library/time.rst:758 -#: ../../library/time.rst:854 ../../library/time.rst:865 -#: ../../library/time.rst:875 ../../library/time.rst:885 -#: ../../library/time.rst:894 ../../library/time.rst:903 -#: ../../library/time.rst:912 ../../library/time.rst:923 -#: ../../library/time.rst:931 ../../library/time.rst:942 -#: ../../library/time.rst:953 ../../library/time.rst:962 -#: ../../library/time.rst:975 +#: ../../library/time.rst:743 ../../library/time.rst:767 +#: ../../library/time.rst:863 ../../library/time.rst:874 +#: ../../library/time.rst:884 ../../library/time.rst:894 +#: ../../library/time.rst:903 ../../library/time.rst:912 +#: ../../library/time.rst:921 ../../library/time.rst:932 +#: ../../library/time.rst:940 ../../library/time.rst:951 +#: ../../library/time.rst:962 ../../library/time.rst:971 +#: ../../library/time.rst:984 msgid "Availability" msgstr "" @@ -476,7 +476,7 @@ msgstr "" "示)。該時鐘不受系統時鐘更新的影響。回傳值的參考點沒有定義,因此只有兩次呼叫" "結果之間的差異才是有效的。" -#: ../../library/time.rst:290 ../../library/time.rst:700 +#: ../../library/time.rst:290 ../../library/time.rst:709 msgid "Clock:" msgstr "" @@ -604,7 +604,12 @@ msgid "" "because of the scheduling of other activity in the system." msgstr "由於系統中其他活動的調度,暫停時間可能會比請求的時間長任意的量。" -#: ../../library/time.rst:388 +#: ../../library/time.rst:389 +#, fuzzy +msgid "Windows implementation" +msgstr "Unix 實作:" + +#: ../../library/time.rst:390 #, fuzzy msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " @@ -621,29 +626,41 @@ msgstr "" "docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-" "timers>`_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" -#: ../../library/time.rst:396 -msgid "Unix implementation:" +#: ../../library/time.rst:399 +#, fuzzy +msgid "Unix implementation" msgstr "Unix 實作:" -#: ../../library/time.rst:398 +#: ../../library/time.rst:400 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "如果可以,使用 ``clock_nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:399 +#: ../../library/time.rst:401 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "或者使用 ``nanosleep()``\\ (解析度:1 奈秒);" -#: ../../library/time.rst:400 +#: ../../library/time.rst:402 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "或使用 ``select()``\\ (解析度:1 微秒)。" -#: ../../library/time.rst:402 +#: ../../library/time.rst:406 +msgid "" +"To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." +msgstr "" + +#: ../../library/time.rst:408 +msgid "" +"To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling " +"policy <os-scheduling-policy>` and use :func:`os.sched_yield` instead." +msgstr "" + +#: ../../library/time.rst:411 msgid "" "Raises an :ref:`auditing event <auditing>` ``time.sleep`` with argument " "``secs``." msgstr "" -#: ../../library/time.rst:404 +#: ../../library/time.rst:413 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " @@ -652,7 +669,7 @@ msgstr "" "即使睡眠被訊號中斷,此函式現在至少還是會睡眠 *secs*,除非訊號處理器引發例外" "(理由請參閱 :pep:`475`)。" -#: ../../library/time.rst:409 +#: ../../library/time.rst:418 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." @@ -660,11 +677,11 @@ msgstr "" "在 Unix 上,如果可以的話現在會使用 ``clock_nanosleep()`` 和 ``nanosleep()`` " "函式。在 Windows 上,現在使用可等待的計時器。" -#: ../../library/time.rst:413 +#: ../../library/time.rst:422 msgid "Raises an auditing event." msgstr "" -#: ../../library/time.rst:421 +#: ../../library/time.rst:430 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -677,7 +694,7 @@ msgstr "" "func:`localtime` 回傳的當前時間。*format* 必須是一個字串。如果 *t* 中的任何欄" "位超出允許範圍,將會引發 :exc:`ValueError`。" -#: ../../library/time.rst:427 +#: ../../library/time.rst:436 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." @@ -685,7 +702,7 @@ msgstr "" "0 在時間元組中的任何位置都是合法引數;如果元組中出現常見的錯誤,該值將被強制" "更改為正確的值。" -#: ../../library/time.rst:430 +#: ../../library/time.rst:439 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " @@ -694,151 +711,151 @@ msgstr "" "以下指令可以嵌入在 *format* 字串中。它們顯示時不帶可選的欄位寬度和精度規範," "並在 :func:`strftime` 的結果中被標示的字元替換:" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Directive" msgstr "指令" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Meaning" msgstr "意義" -#: ../../library/time.rst:435 +#: ../../library/time.rst:444 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:437 +#: ../../library/time.rst:446 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:437 +#: ../../library/time.rst:446 msgid "Locale's abbreviated weekday name." msgstr "區域設定的週間日 (weekday) 縮寫名稱。" -#: ../../library/time.rst:440 +#: ../../library/time.rst:449 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:440 +#: ../../library/time.rst:449 msgid "Locale's full weekday name." msgstr "區域設定的完整週間日名稱。" -#: ../../library/time.rst:442 +#: ../../library/time.rst:451 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:442 +#: ../../library/time.rst:451 msgid "Locale's abbreviated month name." msgstr "區域設定的縮寫月份名稱。" -#: ../../library/time.rst:445 +#: ../../library/time.rst:454 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:445 +#: ../../library/time.rst:454 msgid "Locale's full month name." msgstr "區域設定的完整月份名稱。" -#: ../../library/time.rst:447 +#: ../../library/time.rst:456 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:456 msgid "Locale's appropriate date and time representation." msgstr "區域設定的合適的日期和時間的表示法。" -#: ../../library/time.rst:450 +#: ../../library/time.rst:459 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:459 msgid "Day of the month as a decimal number [01,31]." msgstr "月份中的日期,表示為十進位數 [01,31]。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "``%f``" msgstr "``%f``" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "Microseconds as a decimal number" msgstr "微秒,表示為十進位數" -#: ../../library/time.rst:454 +#: ../../library/time.rst:463 msgid "[000000,999999]." msgstr "[000000,999999]。" -#: ../../library/time.rst:453 +#: ../../library/time.rst:462 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:457 +#: ../../library/time.rst:466 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:457 +#: ../../library/time.rst:466 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "小時(24 小時制),表示為十進位數 [00,23]。" -#: ../../library/time.rst:460 +#: ../../library/time.rst:469 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:460 +#: ../../library/time.rst:469 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "小時(12 小時制),表示為十進位數 [01,12]。" -#: ../../library/time.rst:463 +#: ../../library/time.rst:472 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:463 +#: ../../library/time.rst:472 msgid "Day of the year as a decimal number [001,366]." msgstr "一年中的第幾天,表示為十進位數 [001,366]。" -#: ../../library/time.rst:466 +#: ../../library/time.rst:475 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:466 +#: ../../library/time.rst:475 msgid "Month as a decimal number [01,12]." msgstr "月份,表示為十進位數 [01,12]。" -#: ../../library/time.rst:469 +#: ../../library/time.rst:478 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:469 +#: ../../library/time.rst:478 msgid "Minute as a decimal number [00,59]." msgstr "分鐘,表示為十進位數 [00,59]。" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "Locale's equivalent of either AM or PM." msgstr "區域設定中相當於 AM 或 PM 的表示。" -#: ../../library/time.rst:472 +#: ../../library/time.rst:481 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "Second as a decimal number [00,61]." msgstr "秒,表示為十進位數 [00,61]。" -#: ../../library/time.rst:475 +#: ../../library/time.rst:484 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:478 +#: ../../library/time.rst:487 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:487 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " @@ -847,32 +864,32 @@ msgstr "" "一年中的週數(星期天作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期天之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:478 ../../library/time.rst:492 +#: ../../library/time.rst:487 ../../library/time.rst:501 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/time.rst:486 +#: ../../library/time.rst:495 msgid "``%u``" msgstr "" -#: ../../library/time.rst:486 +#: ../../library/time.rst:495 #, fuzzy msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." msgstr "月份中的日期,表示為十進位數 [01,31]。" -#: ../../library/time.rst:489 +#: ../../library/time.rst:498 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:489 +#: ../../library/time.rst:498 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "週間日,表示為十進位數 [0(星期天),6]。" -#: ../../library/time.rst:492 +#: ../../library/time.rst:501 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:492 +#: ../../library/time.rst:501 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " @@ -881,43 +898,43 @@ msgstr "" "一年中的週數(星期一作為一週的第一天),表示為十進位數 [00,53]。新的一年中," "在第一個星期一之前的所有日子都被認定為第 0 週。" -#: ../../library/time.rst:500 +#: ../../library/time.rst:509 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:500 +#: ../../library/time.rst:509 msgid "Locale's appropriate date representation." msgstr "區域設定的合適的日期表示法。" -#: ../../library/time.rst:503 +#: ../../library/time.rst:512 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:503 +#: ../../library/time.rst:512 msgid "Locale's appropriate time representation." msgstr "區域設定的合適的時間表示法。" -#: ../../library/time.rst:506 +#: ../../library/time.rst:515 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:506 +#: ../../library/time.rst:515 msgid "Year without century as a decimal number [00,99]." msgstr "去掉世紀的年份,表示為十進位數 [00,99]。" -#: ../../library/time.rst:509 +#: ../../library/time.rst:518 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:509 +#: ../../library/time.rst:518 msgid "Year with century as a decimal number." msgstr "帶世紀的年份,表示為十進位數。" -#: ../../library/time.rst:512 +#: ../../library/time.rst:521 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:512 +#: ../../library/time.rst:521 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " @@ -926,49 +943,49 @@ msgstr "" "時區偏移量,表示與 UTC/GMT 的正或負時間差,形式為 +HHMM 或 -HHMM,其中 H 代表" "十進位的小時數碼 (digits),M 代表十進位的分鐘數碼 [-23:59, +23:59]。 [1]_" -#: ../../library/time.rst:518 +#: ../../library/time.rst:527 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:518 +#: ../../library/time.rst:527 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "時區名稱(如果不存在時區,則無字元)。已被棄用。 [1]_" -#: ../../library/time.rst:521 +#: ../../library/time.rst:530 msgid "``%G``" msgstr "" -#: ../../library/time.rst:521 +#: ../../library/time.rst:530 msgid "" "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " "calendar year). The year starts with the week that contains the first " "Thursday of the calendar year." msgstr "" -#: ../../library/time.rst:526 +#: ../../library/time.rst:535 msgid "``%V``" msgstr "" -#: ../../library/time.rst:526 +#: ../../library/time.rst:535 msgid "" "ISO 8601 week number (as a decimal number [01,53]). The first week of the " "year is the one that contains the first Thursday of the year. Weeks start on " "Monday." msgstr "" -#: ../../library/time.rst:531 +#: ../../library/time.rst:540 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:531 +#: ../../library/time.rst:540 msgid "A literal ``'%'`` character." msgstr "字面意義上的 ``'%'`` 字元。" -#: ../../library/time.rst:534 +#: ../../library/time.rst:543 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:537 +#: ../../library/time.rst:546 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -979,7 +996,7 @@ msgstr "" "在 :meth:`datetime.datetime.strptime` 和 :meth:`datetime.datetime.strftime` " "其中的 ``%f`` 格式的指令\\ :ref:`適用於微秒 <format-codes>`。" -#: ../../library/time.rst:543 +#: ../../library/time.rst:552 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " @@ -988,7 +1005,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%p`` 指令僅在使用 ``%I`` 指令剖析小時" "時影響輸出小時的欄位。" -#: ../../library/time.rst:549 +#: ../../library/time.rst:558 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " @@ -997,7 +1014,7 @@ msgstr "" "範圍確實是從 ``0`` 到 ``61``;數值 ``60`` 在表示 `leap seconds`_ 的時間戳中是" "有效的,而數值 ``61`` 是出於歷史因素而被支援。" -#: ../../library/time.rst:554 +#: ../../library/time.rst:563 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." @@ -1005,7 +1022,7 @@ msgstr "" "當與 :func:`strptime` 函式一起使用時,``%U`` 和 ``%W`` 僅在指定週間的某天和年" "份時用於計算中。" -#: ../../library/time.rst:557 +#: ../../library/time.rst:566 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" @@ -1013,7 +1030,7 @@ msgstr "" "以下是一個範例,其為一種與 :rfc:`2822` 網際網路電子郵件標準中指定的日期格式兼" "容的格式。 [1]_: ::" -#: ../../library/time.rst:560 +#: ../../library/time.rst:569 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" @@ -1023,7 +1040,7 @@ msgstr "" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" -#: ../../library/time.rst:564 +#: ../../library/time.rst:573 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -1033,7 +1050,7 @@ msgstr "" "某些平台可能支援額外的指令,但只有這裡列出的指令具有 ANSI C 標準化的意義。要" "查看你的平台上支援的完整格式碼集,請參閱 :manpage:`strftime(3)` 文件。" -#: ../../library/time.rst:569 +#: ../../library/time.rst:578 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -1043,7 +1060,7 @@ msgstr "" "在某些平台上,可選的欄位寬度和精度規範可以以此順序緊跟在指令初始的 ``'%'`` 之" "後;這也是不可攜 (portable) 的。欄位寬度通常為 2,除了 ``%j`` 為 3。" -#: ../../library/time.rst:580 +#: ../../library/time.rst:589 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." @@ -1051,7 +1068,7 @@ msgstr "" "根據格式剖析表示時間的字串。回傳值是 :class:`struct_time`,如同由 :func:" "`gmtime` 或 :func:`localtime` 回傳的一樣。" -#: ../../library/time.rst:584 +#: ../../library/time.rst:593 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -1067,11 +1084,11 @@ msgstr "" "時,用來填充任何缺失資料的預設值為 ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``。" "*string* 和 *format* 都必須是字串。" -#: ../../library/time.rst:592 +#: ../../library/time.rst:601 msgid "For example:" msgstr "例如:" -#: ../../library/time.rst:599 +#: ../../library/time.rst:608 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -1082,7 +1099,7 @@ msgstr "" "因此,除了識別始終已知的 UTC 和 GMT(且被考慮為非日光節約時區)外,這是特定於" "平台的。" -#: ../../library/time.rst:604 +#: ../../library/time.rst:613 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -1094,7 +1111,7 @@ msgstr "" "提供比列出的還要更多的指令。但是 ``strptime()`` 與任何平台無關,因此不一定支" "援所有未記載為支援的指令。" -#: ../../library/time.rst:613 +#: ../../library/time.rst:622 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -1105,110 +1122,110 @@ msgstr "" "別。它是一個具有 :term:`named tuple` 介面的物件:值可以通過索引和屬性名稱存" "取。包含以下值:" -#: ../../library/time.rst:620 +#: ../../library/time.rst:629 msgid "Index" msgstr "索引" -#: ../../library/time.rst:621 +#: ../../library/time.rst:630 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:622 +#: ../../library/time.rst:631 msgid "Values" msgstr "值" -#: ../../library/time.rst:624 +#: ../../library/time.rst:633 msgid "0" msgstr "0" -#: ../../library/time.rst:626 +#: ../../library/time.rst:635 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:628 +#: ../../library/time.rst:637 msgid "1" msgstr "1" -#: ../../library/time.rst:630 +#: ../../library/time.rst:639 msgid "range [1, 12]" msgstr "範圍 [1, 12]" -#: ../../library/time.rst:632 +#: ../../library/time.rst:641 msgid "2" msgstr "2" -#: ../../library/time.rst:634 +#: ../../library/time.rst:643 msgid "range [1, 31]" msgstr "範圍 [1, 31]" -#: ../../library/time.rst:636 +#: ../../library/time.rst:645 msgid "3" msgstr "3" -#: ../../library/time.rst:638 +#: ../../library/time.rst:647 msgid "range [0, 23]" msgstr "範圍 [0, 23]" -#: ../../library/time.rst:640 +#: ../../library/time.rst:649 msgid "4" msgstr "4" -#: ../../library/time.rst:642 +#: ../../library/time.rst:651 msgid "range [0, 59]" msgstr "範圍 [0, 59]" -#: ../../library/time.rst:644 +#: ../../library/time.rst:653 msgid "5" msgstr "5" -#: ../../library/time.rst:646 +#: ../../library/time.rst:655 msgid "range [0, 61]; see :ref:`Note (2) <leap-second>` in :func:`strftime`" msgstr "" "範圍 [0, 61];參見 :func:`strftime` 中的\\ :ref:`註釋 (2) <leap-second>`" -#: ../../library/time.rst:648 +#: ../../library/time.rst:657 msgid "6" msgstr "6" -#: ../../library/time.rst:650 +#: ../../library/time.rst:659 msgid "range [0, 6]; Monday is 0" msgstr "範圍 [0, 6];星期一是 0" -#: ../../library/time.rst:652 +#: ../../library/time.rst:661 msgid "7" msgstr "7" -#: ../../library/time.rst:654 +#: ../../library/time.rst:663 msgid "range [1, 366]" msgstr "範圍 [1, 366]" -#: ../../library/time.rst:656 +#: ../../library/time.rst:665 msgid "8" msgstr "8" -#: ../../library/time.rst:658 +#: ../../library/time.rst:667 msgid "0, 1 or -1; see below" msgstr "0、1 或 -1;見下文" -#: ../../library/time.rst:660 ../../library/time.rst:664 +#: ../../library/time.rst:669 ../../library/time.rst:673 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:662 +#: ../../library/time.rst:671 msgid "abbreviation of timezone name" msgstr "時區名稱的縮寫" -#: ../../library/time.rst:666 +#: ../../library/time.rst:675 msgid "offset east of UTC in seconds" msgstr "UTC 向東的偏移量(以秒為單位)" -#: ../../library/time.rst:668 +#: ../../library/time.rst:677 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "請注意,與 C 結構不同,月份值的範圍是 [1, 12],而不是 [0, 11]。" -#: ../../library/time.rst:671 +#: ../../library/time.rst:680 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1218,7 +1235,7 @@ msgstr "" "在呼叫 :func:`mktime` 時,當日光節約時間生效的時候,:attr:`tm_isdst` 可以設定" "為 1,不生效時設定為 0。值 -1 表示未知是否生效,通常結果會填入正確的狀態。" -#: ../../library/time.rst:675 +#: ../../library/time.rst:684 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" @@ -1227,7 +1244,7 @@ msgstr "" "當一個長度不正確的元組被傳遞給預期得到 :class:`struct_time` 的函式時,或者其" "中有元素型別錯誤時,將引發 :exc:`TypeError`。" -#: ../../library/time.rst:681 +#: ../../library/time.rst:690 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1239,7 +1256,7 @@ msgstr "" "關的。在 Windows 和大多數 Unix 系統上,閏秒不計入自 epoch_ 起的秒數中。這通常" "被稱為 `Unix 時間 <https://en.wikipedia.org/wiki/Unix_time>`_。" -#: ../../library/time.rst:687 +#: ../../library/time.rst:696 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1251,7 +1268,7 @@ msgstr "" "間。雖然此函式通常回傳非遞減的值,但如果在兩次呼叫之間系統時鐘被回調,則它可" "能回傳比之前呼叫更小的值。" -#: ../../library/time.rst:693 +#: ../../library/time.rst:702 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1265,31 +1282,31 @@ msgstr "" "為當地時間。在這兩種情況下都會回傳一個 :class:`struct_time` 物件,從中可以作" "為屬性存取日曆日期的組成部分。" -#: ../../library/time.rst:702 +#: ../../library/time.rst:711 msgid "On Windows, call ``GetSystemTimeAsFileTime()``." msgstr "" -#: ../../library/time.rst:703 +#: ../../library/time.rst:712 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." msgstr "" -#: ../../library/time.rst:704 +#: ../../library/time.rst:713 msgid "Otherwise, call ``gettimeofday()``." msgstr "" -#: ../../library/time.rst:706 +#: ../../library/time.rst:715 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "使用 :func:`time_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:712 +#: ../../library/time.rst:721 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "類似於 :func:`~time.time`,但回傳自 epoch_ 起的以奈秒為單位的整數。" -#: ../../library/time.rst:725 +#: ../../library/time.rst:734 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1298,21 +1315,21 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:731 +#: ../../library/time.rst:740 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:736 +#: ../../library/time.rst:745 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:743 +#: ../../library/time.rst:752 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:750 +#: ../../library/time.rst:759 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1323,46 +1340,46 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:762 +#: ../../library/time.rst:771 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: ../../library/time.rst:766 +#: ../../library/time.rst:775 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:768 +#: ../../library/time.rst:777 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:771 +#: ../../library/time.rst:780 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" -#: ../../library/time.rst:773 +#: ../../library/time.rst:782 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:775 +#: ../../library/time.rst:784 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:776 +#: ../../library/time.rst:785 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:779 +#: ../../library/time.rst:788 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:780 +#: ../../library/time.rst:789 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1370,41 +1387,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:785 +#: ../../library/time.rst:794 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:786 +#: ../../library/time.rst:795 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: ../../library/time.rst:789 +#: ../../library/time.rst:798 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:790 +#: ../../library/time.rst:799 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: ../../library/time.rst:793 +#: ../../library/time.rst:802 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:794 +#: ../../library/time.rst:803 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:797 +#: ../../library/time.rst:806 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:798 +#: ../../library/time.rst:807 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 " @@ -1412,13 +1429,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:804 +#: ../../library/time.rst:813 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: ../../library/time.rst:809 +#: ../../library/time.rst:818 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1438,7 +1455,7 @@ msgstr "" ">>> time.strftime('%X %x %Z')\n" "'16:08:12 05/08/03 AEST'" -#: ../../library/time.rst:818 +#: ../../library/time.rst:827 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1449,7 +1466,7 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:826 +#: ../../library/time.rst:835 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1461,23 +1478,23 @@ msgid "" "('EET', 'EEST')" msgstr "" -#: ../../library/time.rst:839 +#: ../../library/time.rst:848 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:841 +#: ../../library/time.rst:850 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:846 +#: ../../library/time.rst:855 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:849 +#: ../../library/time.rst:858 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1485,87 +1502,87 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:861 +#: ../../library/time.rst:870 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:872 +#: ../../library/time.rst:881 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:882 +#: ../../library/time.rst:891 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:891 +#: ../../library/time.rst:900 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." msgstr "" -#: ../../library/time.rst:901 ../../library/time.rst:910 +#: ../../library/time.rst:910 ../../library/time.rst:919 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:918 +#: ../../library/time.rst:927 msgid "" "`International Atomic Time <https://www.nist.gov/pml/time-and-frequency-" "division/nist-time-frequently-asked-questions-faq#tai>`_" msgstr "" -#: ../../library/time.rst:920 +#: ../../library/time.rst:929 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:929 +#: ../../library/time.rst:938 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:938 +#: ../../library/time.rst:947 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:949 +#: ../../library/time.rst:958 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:959 +#: ../../library/time.rst:968 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." msgstr "" -#: ../../library/time.rst:966 +#: ../../library/time.rst:975 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:972 +#: ../../library/time.rst:981 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:983 +#: ../../library/time.rst:992 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:987 +#: ../../library/time.rst:996 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1573,25 +1590,25 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:993 +#: ../../library/time.rst:1002 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:997 +#: ../../library/time.rst:1006 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: ../../library/time.rst:1002 +#: ../../library/time.rst:1011 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:1008 +#: ../../library/time.rst:1017 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1601,40 +1618,40 @@ msgid "" "func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:1017 +#: ../../library/time.rst:1026 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:1018 +#: ../../library/time.rst:1027 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:1020 +#: ../../library/time.rst:1029 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:1021 +#: ../../library/time.rst:1030 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:1024 +#: ../../library/time.rst:1033 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:1025 +#: ../../library/time.rst:1034 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:1029 +#: ../../library/time.rst:1038 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:1030 +#: ../../library/time.rst:1039 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1674,23 +1691,23 @@ msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" #: ../../library/time.rst:319 ../../library/time.rst:354 -#: ../../library/time.rst:720 +#: ../../library/time.rst:729 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:354 ../../library/time.rst:720 +#: ../../library/time.rst:354 ../../library/time.rst:729 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:354 ../../library/time.rst:720 +#: ../../library/time.rst:354 ../../library/time.rst:729 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:416 ../../library/time.rst:575 +#: ../../library/time.rst:425 ../../library/time.rst:584 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:416 ../../library/time.rst:575 +#: ../../library/time.rst:425 ../../library/time.rst:584 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/tokenize.po b/library/tokenize.po index 32d1dd0754..ce24b289ca 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,40 +140,39 @@ msgstr "" #: ../../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 " -"lossless and round-trips are assured. The guarantee applies only to the " -"token type and token string as the spacing between tokens (column positions) " -"may change." +"The result is guaranteed to tokenize back to match the input so that the " +"conversion is lossless and round-trips are assured. The guarantee applies " +"only to the token type and token string as the spacing between tokens " +"(column positions) may change." msgstr "" -#: ../../library/tokenize.rst:100 +#: ../../library/tokenize.rst:99 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:105 +#: ../../library/tokenize.rst:104 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:110 +#: ../../library/tokenize.rst:109 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:114 +#: ../../library/tokenize.rst:113 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:118 +#: ../../library/tokenize.rst:117 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, " @@ -181,31 +180,31 @@ msgid "" "found, ``'utf-8-sig'`` will be returned as an encoding." msgstr "" -#: ../../library/tokenize.rst:123 +#: ../../library/tokenize.rst:122 msgid "" "If no encoding is specified, then the default of ``'utf-8'`` will be " "returned." msgstr "" -#: ../../library/tokenize.rst:126 +#: ../../library/tokenize.rst:125 msgid "" "Use :func:`.open` to open Python source files: it uses :func:" "`detect_encoding` to detect the file encoding." msgstr "" -#: ../../library/tokenize.rst:132 +#: ../../library/tokenize.rst:131 msgid "" "Open a file in read only mode using the encoding detected by :func:" "`detect_encoding`." msgstr "" -#: ../../library/tokenize.rst:139 +#: ../../library/tokenize.rst:138 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:142 +#: ../../library/tokenize.rst:141 msgid "" "\"\"\"Beginning of\n" "docstring" @@ -213,11 +212,11 @@ msgstr "" "\"\"\"Beginning of\n" "docstring" -#: ../../library/tokenize.rst:145 +#: ../../library/tokenize.rst:144 msgid "or::" msgstr "或是: ::" -#: ../../library/tokenize.rst:147 +#: ../../library/tokenize.rst:146 msgid "" "[1,\n" " 2,\n" @@ -227,49 +226,49 @@ msgstr "" " 2,\n" " 3" -#: ../../library/tokenize.rst:154 +#: ../../library/tokenize.rst:153 msgid "Command-Line Usage" msgstr "" -#: ../../library/tokenize.rst:158 +#: ../../library/tokenize.rst:157 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:160 msgid "python -m tokenize [-e] [filename.py]" msgstr "python -m tokenize [-e] [filename.py]" -#: ../../library/tokenize.rst:165 +#: ../../library/tokenize.rst:164 msgid "The following options are accepted:" msgstr "" -#: ../../library/tokenize.rst:171 +#: ../../library/tokenize.rst:170 msgid "show this help message and exit" msgstr "" -#: ../../library/tokenize.rst:175 +#: ../../library/tokenize.rst:174 msgid "display token names using the exact type" msgstr "" -#: ../../library/tokenize.rst:177 +#: ../../library/tokenize.rst:176 msgid "" "If :file:`filename.py` is specified its contents are tokenized to stdout. " "Otherwise, tokenization is performed on stdin." msgstr "" -#: ../../library/tokenize.rst:181 +#: ../../library/tokenize.rst:180 msgid "Examples" msgstr "範例" -#: ../../library/tokenize.rst:183 +#: ../../library/tokenize.rst:182 msgid "" "Example of a script rewriter that transforms float literals into Decimal " "objects::" msgstr "" -#: ../../library/tokenize.rst:186 +#: ../../library/tokenize.rst:185 msgid "" "from tokenize import tokenize, untokenize, NUMBER, STRING, NAME, OP\n" "from io import BytesIO\n" @@ -312,11 +311,11 @@ msgid "" " return untokenize(result).decode('utf-8')" msgstr "" -#: ../../library/tokenize.rst:225 +#: ../../library/tokenize.rst:224 msgid "Example of tokenizing from the command line. The script::" msgstr "" -#: ../../library/tokenize.rst:227 +#: ../../library/tokenize.rst:226 msgid "" "def say_hello():\n" " print(\"Hello, World!\")\n" @@ -328,7 +327,7 @@ msgstr "" "\n" "say_hello()" -#: ../../library/tokenize.rst:232 +#: ../../library/tokenize.rst:231 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 " @@ -336,7 +335,7 @@ msgid "" "token (if any)" msgstr "" -#: ../../library/tokenize.rst:236 +#: ../../library/tokenize.rst:235 msgid "" "$ python -m tokenize hello.py\n" "0,0-0,0: ENCODING 'utf-8'\n" @@ -382,12 +381,12 @@ msgstr "" "4,11-4,12: NEWLINE '\\n'\n" "5,0-5,0: ENDMARKER ''" -#: ../../library/tokenize.rst:260 +#: ../../library/tokenize.rst:259 msgid "" "The exact token type names can be displayed using the :option:`-e` option:" msgstr "" -#: ../../library/tokenize.rst:262 +#: ../../library/tokenize.rst:261 msgid "" "$ python -m tokenize -e hello.py\n" "0,0-0,0: ENCODING 'utf-8'\n" @@ -433,13 +432,13 @@ msgstr "" "4,11-4,12: NEWLINE '\\n'\n" "5,0-5,0: ENDMARKER ''" -#: ../../library/tokenize.rst:286 +#: ../../library/tokenize.rst:285 msgid "" "Example of tokenizing a file programmatically, reading unicode strings " "instead of bytes with :func:`generate_tokens`::" msgstr "" -#: ../../library/tokenize.rst:289 +#: ../../library/tokenize.rst:288 msgid "" "import tokenize\n" "\n" @@ -455,11 +454,11 @@ msgstr "" " for token in tokens:\n" " print(token)" -#: ../../library/tokenize.rst:296 +#: ../../library/tokenize.rst:295 msgid "Or reading bytes directly with :func:`.tokenize`::" msgstr "" -#: ../../library/tokenize.rst:298 +#: ../../library/tokenize.rst:297 msgid "" "import tokenize\n" "\n" diff --git a/library/turtle.po b/library/turtle.po index 3a6d1eb7aa..553482e6f8 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1644,8 +1644,8 @@ msgid "" ">>> turtle.heading()\n" "90.0\n" "\n" -"Change angle measurement unit to grad (also known as gon,\n" -"grade, or gradian and equals 1/100-th of the right angle.)\n" +">>> # Change angle measurement unit to grad (also known as gon,\n" +">>> # grade, or gradian and equals 1/100-th of the right angle.)\n" ">>> turtle.degrees(400.0)\n" ">>> turtle.heading()\n" "100.0\n" diff --git a/license.po b/license.po index de6467b90f..092c17651a 100644 --- a/license.po +++ b/license.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,9 +29,10 @@ msgid "History of the software" msgstr "軟體沿革" #: ../../license.rst:13 +#, fuzzy msgid "" "Python was created in the early 1990s by Guido van Rossum at Stichting " -"Mathematisch Centrum (CWI, see https://www.cwi.nl/) in the Netherlands as a " +"Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands as a " "successor of a language called ABC. Guido remains Python's principal " "author, although it includes many contributions from others." msgstr "" @@ -40,23 +41,25 @@ msgstr "" "者。儘管 Python 包含了許多來自其他人的貢獻,Guido 仍是其主要作者。" #: ../../license.rst:18 +#, fuzzy msgid "" "In 1995, Guido continued his work on Python at the Corporation for National " -"Research Initiatives (CNRI, see https://www.cnri.reston.va.us/) in Reston, " +"Research Initiatives (CNRI, see https://www.cnri.reston.va.us) in Reston, " "Virginia where he released several versions of the software." msgstr "" "1995 年,Guido 在維吉尼亞州雷斯頓的國家創新研究公司(CNRI,見 https://www." "cnri.reston.va.us/)繼續他在 Python 的工作,並在那裡發佈了該軟體的多個版本。" #: ../../license.rst:22 +#, fuzzy msgid "" "In May 2000, Guido and the Python core development team moved to BeOpen.com " "to form the BeOpen PythonLabs team. In October of the same year, the " -"PythonLabs team moved to Digital Creations (now Zope Corporation; see " -"https://www.zope.org/). In 2001, the Python Software Foundation (PSF, see " -"https://www.python.org/psf/) was formed, a non-profit organization created " -"specifically to own Python-related Intellectual Property. Zope Corporation " -"is a sponsoring member of the PSF." +"PythonLabs team moved to Digital Creations, which became Zope Corporation. " +"In 2001, the Python Software Foundation (PSF, see https://www.python.org/" +"psf/) was formed, a non-profit organization created specifically to own " +"Python-related Intellectual Property. Zope Corporation was a sponsoring " +"member of the PSF." msgstr "" "2000 年五月,Guido 和 Python 核心開發團隊轉移到 BeOpen.com 並成立了 BeOpen " "PythonLabs 團隊。同年十月,PythonLabs 團隊轉移到 Digital Creations(現為 " @@ -65,11 +68,11 @@ msgstr "" "慧財產權而創立的非營利組織。Zope Corporation 是 PSF 的一個贊助會員。" #: ../../license.rst:30 +#, fuzzy msgid "" -"All Python releases are Open Source (see https://opensource.org/ for the " -"Open Source Definition). Historically, most, but not all, Python releases " -"have also been GPL-compatible; the table below summarizes the various " -"releases." +"All Python releases are Open Source (see https://opensource.org for the Open " +"Source Definition). Historically, most, but not all, Python releases have " +"also been GPL-compatible; the table below summarizes the various releases." msgstr "" "所有的 Python 版本都是開源的(有關開源的定義,參閱 https://opensource." "org/)。歷史上,大多數但非全部的 Python 版本,也是 GPL 相容的;以下表格總結各" @@ -92,7 +95,8 @@ msgid "Owner" msgstr "擁有者" #: ../../license.rst:35 -msgid "GPL compatible?" +#, fuzzy +msgid "GPL-compatible? (1)" msgstr "GPL 相容性?" #: ../../license.rst:37 @@ -145,8 +149,7 @@ msgstr "1.5.2" msgid "2000" msgstr "2000" -#: ../../license.rst:41 ../../license.rst:43 ../../license.rst:45 -#: ../../license.rst:47 +#: ../../license.rst:41 ../../license.rst:43 ../../license.rst:47 msgid "no" msgstr "否" @@ -167,6 +170,10 @@ msgstr "1.6.1" msgid "2001" msgstr "2001" +#: ../../license.rst:45 +msgid "yes (2)" +msgstr "" + #: ../../license.rst:47 msgid "2.1" msgstr "2.1" @@ -213,8 +220,9 @@ msgid "2001-now" msgstr "2001 至今" #: ../../license.rst:62 +#, fuzzy msgid "" -"GPL-compatible doesn't mean that we're distributing Python under the GPL. " +"GPL-compatible doesn't mean that we're distributing Python under the GPL. " "All Python licenses, unlike the GPL, let you distribute a modified version " "without making your changes open source. The GPL-compatible licenses make it " "possible to combine Python with other software that is released under the " @@ -226,31 +234,41 @@ msgstr "" #: ../../license.rst:68 msgid "" +"According to Richard Stallman, 1.6.1 is not GPL-compatible, because its " +"license has a choice of law clause. According to CNRI, however, Stallman's " +"lawyer has told CNRI's lawyer that 1.6.1 is \"not incompatible\" with the " +"GPL." +msgstr "" + +#: ../../license.rst:72 +msgid "" "Thanks to the many outside volunteers who have worked under Guido's " "direction to make these releases possible." msgstr "" "感謝許多的外部志工,在 Guido 指導下的付出,使得這些版本的發佈成為可能。" -#: ../../license.rst:73 +#: ../../license.rst:77 msgid "Terms and conditions for accessing or otherwise using Python" msgstr "關於存取或以其他方式使用 Python 的合約條款" -#: ../../license.rst:75 +#: ../../license.rst:79 +#, fuzzy msgid "" -"Python software and documentation are licensed under the :ref:`PSF License " -"Agreement <PSF-license>`." +"Python software and documentation are licensed under the Python Software " +"Foundation License Version 2." msgstr "Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 <PSF-license>`。" -#: ../../license.rst:78 +#: ../../license.rst:82 +#, fuzzy msgid "" "Starting with Python 3.8.6, examples, recipes, and other code in the " -"documentation are dual licensed under the PSF License Agreement and the :ref:" +"documentation are dual licensed under the PSF License Version 2 and the :ref:" "`Zero-Clause BSD license <BSD0>`." msgstr "" "從 Python 3.8.6 開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " "(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 <BSD0>`。" -#: ../../license.rst:82 +#: ../../license.rst:86 msgid "" "Some software incorporated into Python is under different licenses. The " "licenses are listed with code falling under that license. See :ref:" @@ -259,18 +277,18 @@ msgstr "" "有些被納入 Python 中的軟體是基於不同的授權。這些授權將會與其授權之程式碼一起" "被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`。" -#: ../../license.rst:90 -msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" -msgstr "用於 PYTHON |release| 的 PSF 授權合約" - #: ../../license.rst:94 +msgid "PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2" +msgstr "" + +#: ../../license.rst:98 #, fuzzy msgid "" "1. This LICENSE AGREEMENT is between the Python Software Foundation " "(\"PSF\"), and\n" " the Individual or Organization (\"Licensee\") accessing and otherwise " -"using Python\n" -" |release| software in source or binary form and its associated " +"using this\n" +" software (\"Python\") in source or binary form and its associated " "documentation.\n" "\n" "2. Subject to the terms and conditions of this License Agreement, PSF " @@ -279,40 +297,34 @@ msgid "" "reproduce,\n" " analyze, test, perform and/or display publicly, prepare derivative " "works,\n" -" distribute, and otherwise use Python |release| alone or in any " -"derivative\n" +" distribute, and otherwise use Python alone or in any derivative\n" " version, provided, however, that PSF's License Agreement and PSF's notice " "of\n" " copyright, i.e., \"Copyright © 2001-2024 Python Software Foundation; All " "Rights\n" -" Reserved\" are retained in Python |release| alone or in any derivative " -"version\n" +" Reserved\" are retained in Python alone or in any derivative version\n" " prepared by Licensee.\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" -" incorporates Python |release| or any part thereof, and wants to make the\n" +" incorporates Python or any part thereof, and wants to make the\n" " derivative work available to others as provided herein, then Licensee " "hereby\n" " agrees to include in any such work a brief summary of the changes made to " -"Python\n" -" |release|.\n" +"Python.\n" "\n" -"4. PSF is making Python |release| available to Licensee on an \"AS IS\" " -"basis.\n" +"4. PSF is making Python available to Licensee on an \"AS IS\" basis.\n" " PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY " "OF\n" " EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY " "REPRESENTATION OR\n" " WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT " "THE\n" -" USE OF PYTHON |release| WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" +" USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.\n" "\n" -"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |" -"release|\n" +"5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\n" " FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT " "OF\n" -" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON |release|, OR ANY " -"DERIVATIVE\n" +" MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE\n" " THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\n" "\n" "6. This License Agreement will automatically terminate upon a material " @@ -329,8 +341,7 @@ msgid "" "or any\n" " third party.\n" "\n" -"8. By copying, installing or otherwise using Python |release|, Licensee " -"agrees\n" +"8. By copying, installing or otherwise using Python, Licensee agrees\n" " to be bound by the terms and conditions of this License Agreement." msgstr "" "1. This LICENSE AGREEMENT is between the Python Software Foundation " @@ -400,15 +411,15 @@ msgstr "" "agrees\n" " to be bound by the terms and conditions of this License Agreement." -#: ../../license.rst:138 +#: ../../license.rst:141 msgid "BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0" msgstr "用於 PYTHON 2.0 的 BEOPEN.COM 授權合約" -#: ../../license.rst:140 +#: ../../license.rst:143 msgid "BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1" msgstr "BEOPEN PYTHON 開源授權合約第 1 版" -#: ../../license.rst:144 +#: ../../license.rst:147 msgid "" "1. This LICENSE AGREEMENT is between BeOpen.com (\"BeOpen\"), having an " "office at\n" @@ -536,11 +547,12 @@ msgstr "" "to be\n" " bound by the terms and conditions of this License Agreement." -#: ../../license.rst:185 +#: ../../license.rst:188 msgid "CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1" msgstr "用於 PYTHON 1.6.1 的 CNRI 授權合約" -#: ../../license.rst:189 +#: ../../license.rst:192 +#, fuzzy msgid "" "1. This LICENSE AGREEMENT is between the Corporation for National Research\n" " Initiatives, having an office at 1895 Preston White Drive, Reston, VA " @@ -574,7 +586,7 @@ msgid "" "handle):\n" " 1895.22/1013. This Agreement may also be obtained from a proxy server on " "the\n" -" internet using the following URL: http://hdl.handle.net/1895.22/1013.\"\n" +" internet using the following URL: http://hdl.handle.net/1895.22/1013\".\n" "\n" "3. In the event Licensee prepares a derivative work that is based on or\n" " incorporates Python 1.6.1 or any part thereof, and wants to make the " @@ -736,11 +748,11 @@ msgstr "" "and\n" " conditions of this License Agreement." -#: ../../license.rst:250 +#: ../../license.rst:253 msgid "CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2" msgstr "用於 PYTHON 0.9.0 至 1.2 的 CWI 授權合約" -#: ../../license.rst:254 +#: ../../license.rst:257 msgid "" "Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The\n" "Netherlands. All rights reserved.\n" @@ -798,11 +810,12 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n" "SOFTWARE." -#: ../../license.rst:277 -msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON |release| DOCUMENTATION" +#: ../../license.rst:280 +#, fuzzy +msgid "ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION" msgstr "用於 PYTHON |release| 說明文件內程式碼的 ZERO-CLAUSE BSD 授權" -#: ../../license.rst:281 +#: ../../license.rst:284 msgid "" "Permission to use, copy, modify, and/or distribute this software for any\n" "purpose with or without fee is hereby granted.\n" @@ -832,11 +845,11 @@ msgstr "" "OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:296 +#: ../../license.rst:299 msgid "Licenses and Acknowledgements for Incorporated Software" msgstr "被收錄軟體的授權與致謝" -#: ../../license.rst:298 +#: ../../license.rst:301 msgid "" "This section is an incomplete, but growing list of licenses and " "acknowledgements for third-party software incorporated in the Python " @@ -845,11 +858,11 @@ msgstr "" "本節是一個不完整但持續增加的授權與致謝清單,對象是在 Python 發佈版本中所收錄" "的第三方軟體。" -#: ../../license.rst:303 +#: ../../license.rst:306 msgid "Mersenne Twister" msgstr "Mersenne Twister" -#: ../../license.rst:305 +#: ../../license.rst:308 msgid "" "The :mod:`!_random` C extension underlying the :mod:`random` module includes " "code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/" @@ -860,7 +873,7 @@ msgstr "" "sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html 的下載內容為基礎的程式" "碼。以下是原始程式碼的完整聲明: ::" -#: ../../license.rst:310 +#: ../../license.rst:313 msgid "" "A C-program for MT19937, with initialization improved 2002/1/26.\n" "Coded by Takuji Nishimura and Makoto Matsumoto.\n" @@ -946,11 +959,11 @@ msgstr "" "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n" "email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)" -#: ../../license.rst:353 +#: ../../license.rst:356 msgid "Sockets" msgstr "Sockets" -#: ../../license.rst:355 +#: ../../license.rst:358 msgid "" "The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, and :c:" "func:`!getnameinfo`, which are coded in separate source files from the WIDE " @@ -960,7 +973,8 @@ msgstr "" "式,它們在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編" "碼: ::" -#: ../../license.rst:359 +#: ../../license.rst:362 +#, fuzzy msgid "" "Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\n" "All rights reserved.\n" @@ -977,7 +991,7 @@ msgid "" " may be used to endorse or promote products derived from this software\n" " without specific prior written permission.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\n" @@ -1016,11 +1030,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:388 +#: ../../license.rst:391 msgid "Asynchronous socket services" msgstr "非同步 socket 服務" -#: ../../license.rst:390 +#: ../../license.rst:393 msgid "" "The :mod:`!test.support.asynchat` and :mod:`!test.support.asyncore` modules " "contain the following notice::" @@ -1028,7 +1042,7 @@ msgstr "" ":mod:`!test.support.asynchat` 和 :mod:`!test.support.asyncore` 模組包含以下聲" "明: ::" -#: ../../license.rst:393 +#: ../../license.rst:396 msgid "" "Copyright 1996 by Sam Rushing\n" "\n" @@ -1072,15 +1086,15 @@ msgstr "" "NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n" "CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:416 +#: ../../license.rst:419 msgid "Cookie management" msgstr "Cookie 管理" -#: ../../license.rst:418 +#: ../../license.rst:421 msgid "The :mod:`http.cookies` module contains the following notice::" msgstr ":mod:`http.cookies` 模組包含以下聲明: ::" -#: ../../license.rst:420 +#: ../../license.rst:423 msgid "" "Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>\n" "\n" @@ -1126,15 +1140,15 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE." -#: ../../license.rst:444 +#: ../../license.rst:447 msgid "Execution tracing" msgstr "執行追蹤" -#: ../../license.rst:446 +#: ../../license.rst:449 msgid "The :mod:`trace` module contains the following notice::" msgstr ":mod:`trace` 模組包含以下聲明: ::" -#: ../../license.rst:448 +#: ../../license.rst:451 msgid "" "portions copyright 2001, Autonomous Zones Industries, Inc., all rights...\n" "err... reserved and offered to the public under the terms of the\n" @@ -1190,16 +1204,16 @@ msgstr "" "Bioreason or Mojam Media be used in advertising or publicity pertaining to\n" "distribution of the software without specific, written prior permission." -#: ../../license.rst:477 +#: ../../license.rst:480 msgid "UUencode and UUdecode functions" msgstr "UUencode 與 UUdecode 函式" -#: ../../license.rst:479 +#: ../../license.rst:482 #, fuzzy msgid "The ``uu`` codec contains the following notice::" msgstr ":mod:`uu` 模組包含以下聲明: ::" -#: ../../license.rst:481 +#: ../../license.rst:484 msgid "" "Copyright 1994 by Lance Ellinghouse\n" "Cathedral City, California Republic, United States of America.\n" @@ -1249,15 +1263,15 @@ msgstr "" " version is still 5 times faster, though.\n" "- Arguments more compliant with Python standard" -#: ../../license.rst:507 +#: ../../license.rst:510 msgid "XML Remote Procedure Calls" msgstr "XML 遠端程序呼叫" -#: ../../license.rst:509 +#: ../../license.rst:512 msgid "The :mod:`xmlrpc.client` module contains the following notice::" msgstr ":mod:`xmlrpc.client` 模組包含以下聲明: ::" -#: ../../license.rst:511 +#: ../../license.rst:514 msgid "" " The XML-RPC client interface is\n" "\n" @@ -1313,15 +1327,15 @@ msgstr "" "ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n" "OF THIS SOFTWARE." -#: ../../license.rst:540 +#: ../../license.rst:543 msgid "test_epoll" msgstr "test_epoll" -#: ../../license.rst:542 +#: ../../license.rst:545 msgid "The :mod:`!test.test_epoll` module contains the following notice::" msgstr ":mod:`!test.test_epoll` 模組包含以下聲明: ::" -#: ../../license.rst:544 +#: ../../license.rst:547 msgid "" "Copyright (c) 2001-2006 Twisted Matrix Laboratories.\n" "\n" @@ -1365,17 +1379,18 @@ msgstr "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:566 +#: ../../license.rst:569 msgid "Select kqueue" msgstr "Select kqueue" -#: ../../license.rst:568 +#: ../../license.rst:571 msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" msgstr ":mod:`select` 模組對於 kqueue 介面包含以下聲明: ::" -#: ../../license.rst:571 +#: ../../license.rst:574 +#, fuzzy msgid "" "Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes\n" "All rights reserved.\n" @@ -1389,7 +1404,7 @@ msgid "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS \"AS IS\" AND\n" "ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n" "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n" @@ -1425,11 +1440,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:597 +#: ../../license.rst:600 msgid "SipHash24" msgstr "SipHash24" -#: ../../license.rst:599 +#: ../../license.rst:602 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" @@ -1437,7 +1452,7 @@ msgstr "" ":file:`Python/pyhash.c` 檔案包含 Marek Majkowski' 基於 Dan Bernstein 的 " "SipHash24 演算法的實作。它包含以下聲明: ::" -#: ../../license.rst:602 +#: ../../license.rst:605 msgid "" "<MIT License>\n" "Copyright (c) 2013 Marek Majkowski <marek@popcount.org>\n" @@ -1489,11 +1504,11 @@ msgstr "" " djb (supercop/crypto_auth/siphash24/little2)\n" " Jean-Philippe Aumasson (https://131002.net/siphash/siphash24.c)" -#: ../../license.rst:626 +#: ../../license.rst:629 msgid "strtod and dtoa" msgstr "strtod 與 dtoa" -#: ../../license.rst:628 +#: ../../license.rst:631 msgid "" "The file :file:`Python/dtoa.c`, which supplies C functions dtoa and strtod " "for conversion of C doubles to and from strings, is derived from the file of " @@ -1507,7 +1522,7 @@ msgstr "" "以從 https://web.archive.org/web/20220517033456/http://www.netlib.org/fp/" "dtoa.c 下載。於 2009 年 3 月 16 日所檢索的原始檔案包含以下版權與授權聲明: ::" -#: ../../license.rst:635 +#: ../../license.rst:638 msgid "" "/****************************************************************\n" " *\n" @@ -1549,11 +1564,11 @@ msgstr "" " *\n" " ***************************************************************/" -#: ../../license.rst:656 +#: ../../license.rst:659 msgid "OpenSSL" msgstr "OpenSSL" -#: ../../license.rst:658 +#: ../../license.rst:661 #, fuzzy msgid "" "The modules :mod:`hashlib`, :mod:`posix` and :mod:`ssl` use the OpenSSL " @@ -1569,7 +1584,7 @@ msgstr "" "的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則適用 Apache 許可證 " "v2: ::" -#: ../../license.rst:666 +#: ../../license.rst:669 msgid "" " Apache License\n" " Version 2.0, January 2004\n" @@ -1925,11 +1940,11 @@ msgstr "" "\n" "END OF TERMS AND CONDITIONS" -#: ../../license.rst:845 +#: ../../license.rst:848 msgid "expat" msgstr "expat" -#: ../../license.rst:847 +#: ../../license.rst:850 msgid "" "The :mod:`pyexpat <xml.parsers.expat>` extension is built using an included " "copy of the expat sources unless the build is configured ``--with-system-" @@ -1938,7 +1953,7 @@ msgstr "" "除非在建置 :mod:`pyexpat <xml.parsers.expat>` 擴充時設定為 ``--with-system-" "expat``,否則該擴充會用一個內含 expat 原始碼的副本來建置: ::" -#: ../../license.rst:850 +#: ../../license.rst:853 msgid "" "Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd\n" " and Clark Cooper\n" @@ -1984,11 +1999,11 @@ msgstr "" "TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n" "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:874 +#: ../../license.rst:877 msgid "libffi" msgstr "libffi" -#: ../../license.rst:876 +#: ../../license.rst:879 msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " @@ -1997,13 +2012,14 @@ msgstr "" "除非在建置 :mod:`_ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" "system-libffi``,否則該擴充會用一個內含 libffi 原始碼的副本來建置: ::" -#: ../../license.rst:880 +#: ../../license.rst:883 +#, fuzzy msgid "" "Copyright (c) 1996-2008 Red Hat, Inc and others.\n" "\n" "Permission is hereby granted, free of charge, to any person obtaining\n" "a copy of this software and associated documentation files (the\n" -"``Software''), to deal in the Software without restriction, including\n" +"\"Software\"), to deal in the Software without restriction, including\n" "without limitation the rights to use, copy, modify, merge, publish,\n" "distribute, sublicense, and/or sell copies of the Software, and to\n" "permit persons to whom the Software is furnished to do so, subject to\n" @@ -2012,7 +2028,7 @@ msgid "" "The above copyright notice and this permission notice shall be included\n" "in all copies or substantial portions of the Software.\n" "\n" -"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,\n" +"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n" "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n" "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n" @@ -2043,11 +2059,11 @@ msgstr "" "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n" "DEALINGS IN THE SOFTWARE." -#: ../../license.rst:904 +#: ../../license.rst:907 msgid "zlib" msgstr "zlib" -#: ../../license.rst:906 +#: ../../license.rst:909 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " @@ -2056,7 +2072,7 @@ msgstr "" "如果在系統上找到的 zlib 版本太舊以致於無法用於建置 :mod:`zlib` 擴充,則該擴充" "會用一個內含 zlib 原始碼的副本來建置: ::" -#: ../../license.rst:910 +#: ../../license.rst:913 msgid "" "Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler\n" "\n" @@ -2104,11 +2120,11 @@ msgstr "" "Jean-loup Gailly Mark Adler\n" "jloup@gzip.org madler@alumni.caltech.edu" -#: ../../license.rst:935 +#: ../../license.rst:938 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:937 +#: ../../license.rst:940 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" @@ -2116,7 +2132,7 @@ msgstr "" ":mod:`tracemalloc` 使用的雜湊表 (hash table) 實作,是以 cfuhash 專案為基" "礎: ::" -#: ../../license.rst:940 +#: ../../license.rst:943 msgid "" "Copyright (c) 2005 Don Owens\n" "All rights reserved.\n" @@ -2186,11 +2202,11 @@ msgstr "" "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n" "OF THE POSSIBILITY OF SUCH DAMAGE." -#: ../../license.rst:976 +#: ../../license.rst:979 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:978 +#: ../../license.rst:981 msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " @@ -2200,7 +2216,7 @@ msgstr "" "with-system-libmpdec``,否則該模組會用一個內含 libmpdec 函式庫的副本來建" "置: ::" -#: ../../license.rst:982 +#: ../../license.rst:985 msgid "" "Copyright (c) 2008-2020 Stefan Krah. All rights reserved.\n" "\n" @@ -2252,11 +2268,11 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." -#: ../../license.rst:1009 +#: ../../license.rst:1012 msgid "W3C C14N test suite" msgstr "W3C C14N 測試套件" -#: ../../license.rst:1011 +#: ../../license.rst:1014 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" @@ -2266,7 +2282,7 @@ msgstr "" "是從 W3C 網站 https://www.w3.org/TR/xml-c14n2-testcases/ 被檢索,且是基於 3-" "clause BSD 授權被發佈: ::" -#: ../../license.rst:1016 +#: ../../license.rst:1019 msgid "" "Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang),\n" "All Rights Reserved.\n" @@ -2324,15 +2340,15 @@ msgstr "" "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -#: ../../license.rst:1048 +#: ../../license.rst:1051 msgid "mimalloc" msgstr "" -#: ../../license.rst:1050 +#: ../../license.rst:1053 msgid "MIT License::" msgstr "" -#: ../../license.rst:1052 +#: ../../license.rst:1055 #, fuzzy msgid "" "Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen\n" @@ -2383,11 +2399,11 @@ msgstr "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:1074 +#: ../../license.rst:1077 msgid "asyncio" msgstr "asyncio" -#: ../../license.rst:1076 +#: ../../license.rst:1079 msgid "" "Parts of the :mod:`asyncio` module are incorporated from `uvloop 0.16 " "<https://github.com/MagicStack/uvloop/tree/v0.16.0>`_, which is distributed " @@ -2396,7 +2412,7 @@ msgstr "" ":mod:`asyncio` 模組的部分內容是從 `uvloop 0.16 <https://github.com/" "MagicStack/uvloop/tree/v0.16.0>`_ 中收錄過來,其基於 MIT 授權來發佈: ::" -#: ../../license.rst:1080 +#: ../../license.rst:1083 msgid "" "Copyright (c) 2015-2021 MagicStack Inc. http://magic.io\n" "\n" @@ -2440,11 +2456,11 @@ msgstr "" "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n" "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." -#: ../../license.rst:1103 +#: ../../license.rst:1106 msgid "Global Unbounded Sequences (GUS)" msgstr "" -#: ../../license.rst:1105 +#: ../../license.rst:1108 msgid "" "The file :file:`Python/qsbr.c` is adapted from FreeBSD's \"Global Unbounded " "Sequences\" safe memory reclamation scheme in `subr_smr.c <https://github." @@ -2452,7 +2468,7 @@ msgid "" "distributed under the 2-Clause BSD License::" msgstr "" -#: ../../license.rst:1110 +#: ../../license.rst:1113 #, fuzzy msgid "" "Copyright (c) 2019,2020 Jeffrey Roberson <jeff@FreeBSD.org>\n" @@ -2467,7 +2483,7 @@ msgid "" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" "\n" -"THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n" +"THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR\n" "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n" "OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n" "IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n" @@ -2503,6 +2519,9 @@ msgstr "" "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n" "SUCH DAMAGE." +#~ msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" +#~ msgstr "用於 PYTHON |release| 的 PSF 授權合約" + #~ msgid "Audioop" #~ msgstr "Audioop" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 8730b76362..3f3ad9f9f4 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -610,8 +610,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1547 -#: ../../reference/compound_stmts.rst:1588 +#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1590 msgid "The following code::" msgstr "" @@ -625,7 +625,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:531 #: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:1595 msgid "is semantically equivalent to::" msgstr "" @@ -1544,7 +1544,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1878 +#: ../../reference/compound_stmts.rst:1880 msgid ":class:`list`" msgstr ":class:`list`" @@ -1557,7 +1557,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1881 +#: ../../reference/compound_stmts.rst:1883 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1607,7 +1607,7 @@ msgid "" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1228 +#: ../../reference/compound_stmts.rst:1230 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 " @@ -1616,13 +1616,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1236 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1240 +#: ../../reference/compound_stmts.rst:1242 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1633,7 +1633,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 +#: ../../reference/compound_stmts.rst:1249 msgid "" "@f1(arg)\n" "@f2\n" @@ -1643,12 +1643,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1251 -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1448 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1255 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1656,20 +1656,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1258 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1258 +#: ../../reference/compound_stmts.rst:1260 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:1263 +#: ../../reference/compound_stmts.rst:1265 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1679,12 +1679,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1270 -#: ../../reference/compound_stmts.rst:1465 +#: ../../reference/compound_stmts.rst:1272 +#: ../../reference/compound_stmts.rst:1467 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1278 +#: ../../reference/compound_stmts.rst:1280 msgid "" "When one or more :term:`parameters <parameter>` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1695,7 +1695,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1286 +#: ../../reference/compound_stmts.rst:1288 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1708,7 +1708,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1296 +#: ../../reference/compound_stmts.rst:1298 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1717,7 +1717,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1309 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1733,13 +1733,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1319 +#: ../../reference/compound_stmts.rst:1321 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1328 +#: ../../reference/compound_stmts.rst:1330 msgid "" "Parameters may have an :term:`annotation <function annotation>` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1758,13 +1758,13 @@ msgid "" "in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1342 +#: ../../reference/compound_stmts.rst:1344 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1350 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1776,7 +1776,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1356 +#: ../../reference/compound_stmts.rst:1358 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1785,61 +1785,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1366 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1369 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1370 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1370 +#: ../../reference/compound_stmts.rst:1372 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1371 +#: ../../reference/compound_stmts.rst:1373 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1377 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:1378 +#: ../../reference/compound_stmts.rst:1380 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1381 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1385 +#: ../../reference/compound_stmts.rst:1387 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1402 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1407 +#: ../../reference/compound_stmts.rst:1409 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1848,7 +1848,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1413 +#: ../../reference/compound_stmts.rst:1415 msgid "" "class Foo:\n" " pass" @@ -1856,11 +1856,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1416 +#: ../../reference/compound_stmts.rst:1418 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1420 msgid "" "class Foo(object):\n" " pass" @@ -1868,7 +1868,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1421 +#: ../../reference/compound_stmts.rst:1423 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 " @@ -1880,7 +1880,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1432 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's :attr:`~type.__dict__`. Note that this is reliable only " @@ -1888,17 +1888,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1437 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "<metaclasses>`." msgstr "" -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1442 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1444 msgid "" "@f1(arg)\n" "@f2\n" @@ -1908,7 +1908,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1450 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1916,20 +1916,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1453 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:1454 +#: ../../reference/compound_stmts.rst:1456 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:1459 +#: ../../reference/compound_stmts.rst:1461 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1938,7 +1938,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1470 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1951,35 +1951,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1482 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1483 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:1485 +#: ../../reference/compound_stmts.rst:1487 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1488 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1493 +#: ../../reference/compound_stmts.rst:1495 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1503 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1513 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1987,23 +1987,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1517 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:1518 +#: ../../reference/compound_stmts.rst:1520 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1523 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1523 +#: ../../reference/compound_stmts.rst:1525 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2013,30 +2013,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1529 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:1535 +#: ../../reference/compound_stmts.rst:1537 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1542 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:1544 +#: ../../reference/compound_stmts.rst:1546 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1551 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2048,11 +2048,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1554 +#: ../../reference/compound_stmts.rst:1556 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1558 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2082,28 +2082,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1572 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1574 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1582 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1587 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:1590 +#: ../../reference/compound_stmts.rst:1592 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2111,7 +2111,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1597 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2147,44 +2147,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1614 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1616 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1621 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1622 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1628 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1632 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1643 +#: ../../reference/compound_stmts.rst:1645 msgid "" ":ref:`Functions <def>` (including :ref:`coroutines <async def>`), :ref:" "`classes <class>` and :ref:`type aliases <type>` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1647 +#: ../../reference/compound_stmts.rst:1649 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2216,7 +2216,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1662 +#: ../../reference/compound_stmts.rst:1664 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2224,7 +2224,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1669 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2236,36 +2236,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1678 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1679 +#: ../../reference/compound_stmts.rst:1681 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1681 +#: ../../reference/compound_stmts.rst:1683 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1683 +#: ../../reference/compound_stmts.rst:1685 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1686 +#: ../../reference/compound_stmts.rst:1688 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1689 +#: ../../reference/compound_stmts.rst:1691 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2277,7 +2277,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1698 +#: ../../reference/compound_stmts.rst:1700 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2287,13 +2287,13 @@ msgid "" "<annotation-scopes>`." msgstr "" -#: ../../reference/compound_stmts.rst:1704 +#: ../../reference/compound_stmts.rst:1706 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1707 +#: ../../reference/compound_stmts.rst:1709 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2306,13 +2306,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1719 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1719 +#: ../../reference/compound_stmts.rst:1721 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2344,24 +2344,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1737 +#: ../../reference/compound_stmts.rst:1739 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1739 +#: ../../reference/compound_stmts.rst:1741 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1743 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1743 -#: ../../reference/compound_stmts.rst:1803 +#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1805 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1747 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2377,7 +2377,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1752 +#: ../../reference/compound_stmts.rst:1754 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope <annotation-" "scopes>`, which is not actually bound to any name at runtime. (One other " @@ -2386,20 +2386,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1758 +#: ../../reference/compound_stmts.rst:1760 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1762 +#: ../../reference/compound_stmts.rst:1764 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1765 +#: ../../reference/compound_stmts.rst:1767 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2409,13 +2409,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1771 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1772 +#: ../../reference/compound_stmts.rst:1774 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2437,25 +2437,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1791 +#: ../../reference/compound_stmts.rst:1793 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1797 +#: ../../reference/compound_stmts.rst:1799 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1799 +#: ../../reference/compound_stmts.rst:1801 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1801 +#: ../../reference/compound_stmts.rst:1803 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1805 +#: ../../reference/compound_stmts.rst:1807 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2473,14 +2473,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1815 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope <annotation-scopes>`, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1819 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2488,7 +2488,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1823 +#: ../../reference/compound_stmts.rst:1825 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2496,11 +2496,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1826 +#: ../../reference/compound_stmts.rst:1828 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1828 +#: ../../reference/compound_stmts.rst:1830 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2518,27 +2518,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1841 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1843 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1845 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1847 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1850 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2551,105 +2551,105 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1857 +#: ../../reference/compound_stmts.rst:1859 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope <annotation-scopes>`. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1864 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1865 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:1867 +#: ../../reference/compound_stmts.rst:1869 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1871 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1870 +#: ../../reference/compound_stmts.rst:1872 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1873 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1872 -#: ../../reference/compound_stmts.rst:1891 +#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1893 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1876 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1876 +#: ../../reference/compound_stmts.rst:1878 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1879 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1879 +#: ../../reference/compound_stmts.rst:1881 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1882 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1885 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1886 +#: ../../reference/compound_stmts.rst:1888 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1888 +#: ../../reference/compound_stmts.rst:1890 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1889 +#: ../../reference/compound_stmts.rst:1891 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1892 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1893 +#: ../../reference/compound_stmts.rst:1895 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1896 +#: ../../reference/compound_stmts.rst:1898 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1900 +#: ../../reference/compound_stmts.rst:1902 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's :attr:`~type.__doc__` item and therefore " @@ -2671,10 +2671,10 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1497 -#: ../../reference/compound_stmts.rst:1531 -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1389 +#: ../../reference/compound_stmts.rst:1499 +#: ../../reference/compound_stmts.rst:1533 +#: ../../reference/compound_stmts.rst:1578 msgid "statement" msgstr "statement(陳述式)" @@ -2722,7 +2722,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2736,8 +2736,8 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1325 +#: ../../reference/compound_stmts.rst:1389 msgid ": (colon)" msgstr ": (冒號)" @@ -2747,7 +2747,7 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:588 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2793,7 +2793,7 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "object" msgstr "object(物件)" @@ -2864,7 +2864,7 @@ msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid ", (comma)" msgstr ", (逗號)" @@ -2905,15 +2905,15 @@ msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" #: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "parameter" msgstr "parameter(參數)" #: ../../reference/compound_stmts.rst:1186 #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1273 -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1275 +#: ../../reference/compound_stmts.rst:1304 msgid "function definition" msgstr "function definition(函式定義)" @@ -2922,22 +2922,22 @@ msgid "def" msgstr "def" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "function" msgstr "function (函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "definition" msgstr "definition(定義)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "name" msgstr "name(名稱)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "binding" msgstr "binding(綁定)" @@ -2946,7 +2946,7 @@ msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" #: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2954,109 +2954,109 @@ msgstr "() (圓括號)" msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1439 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1389 +#: ../../reference/compound_stmts.rst:1439 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1499 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1509 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1533 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1578 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1635 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/sphinx.po b/sphinx.po index 624ab422c9..f07d80f0dc 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,87 +212,91 @@ msgstr "" "docs@python.org\">docs@python.org</a>。" #: ../../tools/templates/dummy.html:6 -msgid "CPython implementation detail:" -msgstr "CPython 實作細節:" - -#: ../../tools/templates/dummy.html:7 -msgid "" -"Deprecated since version {deprecated}, will be removed in version {removed}" -msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" - -#: ../../tools/templates/dummy.html:8 -msgid "Deprecated since version {deprecated}, removed in version {removed}" -msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" +msgid "Availability" +msgstr "" -#: ../../tools/templates/dummy.html:12 +#: ../../tools/templates/dummy.html:10 msgid "Part of the" msgstr "為" -#: ../../tools/templates/dummy.html:13 +#: ../../tools/templates/dummy.html:11 msgid "Limited API" msgstr "受限 API 的一部分" -#: ../../tools/templates/dummy.html:14 +#: ../../tools/templates/dummy.html:12 msgid "Stable ABI" msgstr "穩定 ABI 的一部分" -#: ../../tools/templates/dummy.html:15 +#: ../../tools/templates/dummy.html:13 msgid "(as an opaque struct)" msgstr "(做為一個不透明結構 (opaque struct))" -#: ../../tools/templates/dummy.html:16 +#: ../../tools/templates/dummy.html:14 msgid "(including all members)" msgstr "(包含所有成員)" -#: ../../tools/templates/dummy.html:17 +#: ../../tools/templates/dummy.html:15 msgid "since version %s" msgstr "自 %s 版本開始" -#: ../../tools/templates/dummy.html:18 +#: ../../tools/templates/dummy.html:16 msgid "(Only some members are part of the stable ABI.)" msgstr "(只有部分成員是穩定 ABI 的一部分。)" -#: ../../tools/templates/dummy.html:19 +#: ../../tools/templates/dummy.html:17 msgid "This is" msgstr "這是" -#: ../../tools/templates/dummy.html:20 +#: ../../tools/templates/dummy.html:18 msgid "Unstable API" msgstr "不穩定 API" -#: ../../tools/templates/dummy.html:21 +#: ../../tools/templates/dummy.html:19 msgid ". It may change without warning in minor releases." msgstr ",它可能在小版本發布中沒有任何警告地被變更。" -#: ../../tools/templates/dummy.html:22 +#: ../../tools/templates/dummy.html:20 msgid "Return value: Always NULL." msgstr "回傳值:總是為 NULL。" -#: ../../tools/templates/dummy.html:23 +#: ../../tools/templates/dummy.html:21 msgid "Return value: New reference." msgstr "回傳值:新的參照。" -#: ../../tools/templates/dummy.html:24 +#: ../../tools/templates/dummy.html:22 msgid "Return value: Borrowed reference." msgstr "回傳值:借用參照。" -#: ../../tools/templates/dummy.html:28 +#: ../../tools/templates/dummy.html:26 +msgid "CPython implementation detail:" +msgstr "CPython 實作細節:" + +#: ../../tools/templates/dummy.html:30 +msgid "" +"Deprecated since version {deprecated}, will be removed in version {removed}" +msgstr "自從版本 {deprecated} 後不推薦使用,將會自版本 {removed} 中移除。" + +#: ../../tools/templates/dummy.html:31 +msgid "Deprecated since version {deprecated}, removed in version {removed}" +msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" + +#: ../../tools/templates/dummy.html:35 msgid "in development" msgstr "開發中" -#: ../../tools/templates/dummy.html:29 +#: ../../tools/templates/dummy.html:36 msgid "pre-release" msgstr "預發行" -#: ../../tools/templates/dummy.html:30 +#: ../../tools/templates/dummy.html:37 msgid "stable" msgstr "穩定版本" -#: ../../tools/templates/dummy.html:31 +#: ../../tools/templates/dummy.html:38 msgid "security-fixes" msgstr "安全性修護" -#: ../../tools/templates/dummy.html:32 +#: ../../tools/templates/dummy.html:39 msgid "EOL" msgstr "停止維護" diff --git a/using/cmdline.po b/using/cmdline.po index 7c044379bf..59f963b458 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1494,8 +1494,8 @@ msgstr "" #: ../../using/cmdline.rst:1200 msgid "" -"If this variable is set to ``1``, the interpreter will not attempt to load " -"the Python-based :term:`REPL` that requires :mod:`curses` and :mod:" +"If this variable is set to any value, the interpreter will not attempt to " +"load the Python-based :term:`REPL` that requires :mod:`curses` and :mod:" "`readline`, and will instead use the traditional parser-based :term:`REPL`." msgstr "" diff --git a/using/configure.po b/using/configure.po index 4eec4e6b28..3c2f276e05 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -379,7 +379,7 @@ msgid "" "cleared." msgstr "" -#: ../../using/configure.rst:236 ../../using/configure.rst:721 +#: ../../using/configure.rst:236 ../../using/configure.rst:725 msgid "Effects:" msgstr "效果:" @@ -584,218 +584,224 @@ msgid "" "experimental-jit=yes``." msgstr "" -#: ../../using/configure.rst:321 +#: ../../using/configure.rst:319 +msgid "" +"When building CPython with JIT enabled, ensure that your system has Python " +"3.11 or later installed." +msgstr "" + +#: ../../using/configure.rst:325 msgid "Path to ``pkg-config`` utility." msgstr "" -#: ../../using/configure.rst:326 +#: ../../using/configure.rst:330 #, fuzzy msgid "``pkg-config`` options." msgstr "設定選項" -#: ../../using/configure.rst:330 +#: ../../using/configure.rst:334 #, fuzzy msgid "C compiler options" msgstr "C 編譯器指令。" -#: ../../using/configure.rst:334 ../../using/configure.rst:1241 +#: ../../using/configure.rst:338 ../../using/configure.rst:1245 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:338 ../../using/configure.rst:1253 +#: ../../using/configure.rst:342 ../../using/configure.rst:1257 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:342 +#: ../../using/configure.rst:346 #, fuzzy msgid "C preprocessor command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:350 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." msgstr "" -#: ../../using/configure.rst:350 ../../using/configure.rst:792 +#: ../../using/configure.rst:354 ../../using/configure.rst:796 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:358 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:358 +#: ../../using/configure.rst:362 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:362 +#: ../../using/configure.rst:366 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:370 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:377 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:379 +#: ../../using/configure.rst:383 msgid "" "C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" "mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:385 +#: ../../using/configure.rst:389 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:394 msgid "" "C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 <hashlib-blake2>`), " "used by :mod:`hashlib` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:400 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:406 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:408 +#: ../../using/configure.rst:412 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:413 +#: ../../using/configure.rst:417 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:419 +#: ../../using/configure.rst:423 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:425 +#: ../../using/configure.rst:429 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:435 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:441 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:447 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:445 +#: ../../using/configure.rst:449 msgid "" "C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" "`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:451 +#: ../../using/configure.rst:455 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:456 +#: ../../using/configure.rst:460 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:461 +#: ../../using/configure.rst:465 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:465 +#: ../../using/configure.rst:469 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:467 +#: ../../using/configure.rst:471 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:468 +#: ../../using/configure.rst:472 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:474 +#: ../../using/configure.rst:478 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:480 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:487 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:489 +#: ../../using/configure.rst:493 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:493 +#: ../../using/configure.rst:497 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:500 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:498 +#: ../../using/configure.rst:502 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:507 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:505 +#: ../../using/configure.rst:509 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:509 +#: ../../using/configure.rst:513 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:516 +#: ../../using/configure.rst:520 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:518 +#: ../../using/configure.rst:522 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -803,45 +809,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:520 +#: ../../using/configure.rst:524 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:525 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:531 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:529 +#: ../../using/configure.rst:533 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:539 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:538 +#: ../../using/configure.rst:542 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:541 +#: ../../using/configure.rst:545 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:547 +#: ../../using/configure.rst:551 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -850,58 +856,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:560 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:561 +#: ../../using/configure.rst:565 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:568 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:568 +#: ../../using/configure.rst:572 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:577 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:579 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:580 +#: ../../using/configure.rst:584 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:587 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:592 msgid "" "Enable usage of the `BOLT post-link binary optimizer <https://github.com/" "llvm/llvm-project/tree/main/bolt>`_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:592 +#: ../../using/configure.rst:596 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:596 +#: ../../using/configure.rst:600 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -912,7 +918,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:604 +#: ../../using/configure.rst:608 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -920,116 +926,116 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:617 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary <https://" "github.com/facebookarchive/BOLT>`_." msgstr "" -#: ../../using/configure.rst:620 +#: ../../using/configure.rst:624 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:630 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:631 +#: ../../using/configure.rst:635 msgid "" "Disable the fast :ref:`mimalloc <mimalloc>` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:634 ../../using/configure.rst:641 +#: ../../using/configure.rst:638 ../../using/configure.rst:645 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:638 +#: ../../using/configure.rst:642 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc <pymalloc>` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:645 +#: ../../using/configure.rst:649 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:648 +#: ../../using/configure.rst:652 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:654 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:658 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:658 +#: ../../using/configure.rst:662 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:665 +#: ../../using/configure.rst:669 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:667 +#: ../../using/configure.rst:671 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:674 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:672 +#: ../../using/configure.rst:676 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:674 +#: ../../using/configure.rst:678 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:675 +#: ../../using/configure.rst:679 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:680 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:677 +#: ../../using/configure.rst:681 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:683 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:681 +#: ../../using/configure.rst:685 msgid "" "Install :ref:`debug hooks on memory allocators <default-memory-allocators>` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:683 +#: ../../using/configure.rst:687 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:688 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1037,388 +1043,388 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:689 +#: ../../using/configure.rst:693 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:690 +#: ../../using/configure.rst:694 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:692 +#: ../../using/configure.rst:696 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:698 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:699 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:701 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:700 +#: ../../using/configure.rst:704 msgid "" "See also the :ref:`Python Development Mode <devmode>` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:707 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 :" "option:`--with-trace-refs` option)." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:714 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:718 msgid "" ":ref:`Build Python in debug mode <debug-build>`: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:723 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:727 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:724 +#: ../../using/configure.rst:728 #, fuzzy msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`!sys.getobjects` 函式。" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:729 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:731 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:734 msgid ":ref:`Statically allocated objects <static-types>` are not traced." msgstr "" -#: ../../using/configure.rst:734 +#: ../../using/configure.rst:738 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "<debug-build>`." msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:744 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:747 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:750 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build <debug-" "build>`) which also enables assertions." msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:757 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:757 +#: ../../using/configure.rst:761 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:763 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap <instrumentation>`." msgstr "" -#: ../../using/configure.rst:766 +#: ../../using/configure.rst:770 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:776 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:782 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:785 +#: ../../using/configure.rst:789 #, fuzzy msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:796 +#: ../../using/configure.rst:800 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:804 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:811 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:811 +#: ../../using/configure.rst:815 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:819 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:820 +#: ../../using/configure.rst:824 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" -#: ../../using/configure.rst:825 +#: ../../using/configure.rst:829 msgid "Default to using the installed ``mpdecimal`` library." msgstr "" -#: ../../using/configure.rst:828 +#: ../../using/configure.rst:832 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.15." msgstr "" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:836 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." msgstr "" -#: ../../using/configure.rst:836 +#: ../../using/configure.rst:840 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:838 +#: ../../using/configure.rst:842 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:839 +#: ../../using/configure.rst:843 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:845 +#: ../../using/configure.rst:849 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:847 +#: ../../using/configure.rst:851 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:853 +#: ../../using/configure.rst:857 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:857 +#: ../../using/configure.rst:861 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:861 +#: ../../using/configure.rst:865 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:871 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:869 +#: ../../using/configure.rst:873 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:874 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:872 +#: ../../using/configure.rst:876 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:882 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:886 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:888 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:889 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:890 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:890 +#: ../../using/configure.rst:894 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:895 +#: ../../using/configure.rst:899 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:897 +#: ../../using/configure.rst:901 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:902 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:903 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:900 +#: ../../using/configure.rst:904 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:905 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:902 +#: ../../using/configure.rst:906 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:912 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:910 +#: ../../using/configure.rst:914 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:911 +#: ../../using/configure.rst:915 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:916 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:918 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:920 +#: ../../using/configure.rst:924 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:928 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:926 +#: ../../using/configure.rst:930 #, fuzzy msgid "See :source:`Mac/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:931 +#: ../../using/configure.rst:935 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:937 +#: ../../using/configure.rst:941 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:942 +#: ../../using/configure.rst:946 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:945 +#: ../../using/configure.rst:949 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:947 +#: ../../using/configure.rst:951 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:948 +#: ../../using/configure.rst:952 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:949 +#: ../../using/configure.rst:953 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:950 +#: ../../using/configure.rst:954 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:955 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:956 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:953 +#: ../../using/configure.rst:957 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:958 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:958 +#: ../../using/configure.rst:962 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:964 +#: ../../using/configure.rst:968 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1427,31 +1433,31 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:973 +#: ../../using/configure.rst:977 #, fuzzy msgid "iOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:975 +#: ../../using/configure.rst:979 #, fuzzy msgid "See :source:`iOS/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:979 +#: ../../using/configure.rst:983 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:988 msgid "Specify the name for the framework (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:992 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:994 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 " @@ -1459,28 +1465,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:997 +#: ../../using/configure.rst:1001 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:1005 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1009 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1015 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1013 +#: ../../using/configure.rst:1017 msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:1015 +#: ../../using/configure.rst:1019 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1492,15 +1498,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1024 +#: ../../using/configure.rst:1028 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1029 +#: ../../using/configure.rst:1033 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1031 +#: ../../using/configure.rst:1035 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1512,64 +1518,64 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1038 +#: ../../using/configure.rst:1042 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:1041 +#: ../../using/configure.rst:1045 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:1043 +#: ../../using/configure.rst:1047 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:1044 +#: ../../using/configure.rst:1048 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:1045 +#: ../../using/configure.rst:1049 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:1046 +#: ../../using/configure.rst:1050 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1050 +#: ../../using/configure.rst:1054 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1052 +#: ../../using/configure.rst:1056 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:1053 +#: ../../using/configure.rst:1057 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1054 +#: ../../using/configure.rst:1058 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1056 +#: ../../using/configure.rst:1060 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1059 +#: ../../using/configure.rst:1063 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1062 +#: ../../using/configure.rst:1066 msgid "make" msgstr "" -#: ../../using/configure.rst:1064 +#: ../../using/configure.rst:1068 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1580,20 +1586,20 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1073 +#: ../../using/configure.rst:1077 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "" -#: ../../using/configure.rst:1074 +#: ../../using/configure.rst:1078 msgid "``build_wasm`` (configured with ``--with-emscripten-target``)" msgstr "" -#: ../../using/configure.rst:1075 +#: ../../using/configure.rst:1079 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "" -#: ../../using/configure.rst:1077 +#: ../../using/configure.rst:1081 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1606,11 +1612,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1090 +#: ../../using/configure.rst:1094 msgid "make platform" msgstr "" -#: ../../using/configure.rst:1092 +#: ../../using/configure.rst:1096 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1618,82 +1624,82 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1099 +#: ../../using/configure.rst:1103 msgid "make profile-opt" msgstr "" -#: ../../using/configure.rst:1101 +#: ../../using/configure.rst:1105 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1109 +#: ../../using/configure.rst:1113 msgid "make clean" msgstr "" -#: ../../using/configure.rst:1111 +#: ../../using/configure.rst:1115 msgid "Remove built files." msgstr "" -#: ../../using/configure.rst:1115 +#: ../../using/configure.rst:1119 msgid "make distclean" msgstr "" -#: ../../using/configure.rst:1117 +#: ../../using/configure.rst:1121 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1123 +#: ../../using/configure.rst:1127 msgid "make install" msgstr "" -#: ../../using/configure.rst:1125 +#: ../../using/configure.rst:1129 msgid "Build the ``all`` target and install Python." msgstr "" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1133 msgid "make test" msgstr "" -#: ../../using/configure.rst:1131 +#: ../../using/configure.rst:1135 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option. Variables:" msgstr "" -#: ../../using/configure.rst:1134 +#: ../../using/configure.rst:1138 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "" -#: ../../using/configure.rst:1135 +#: ../../using/configure.rst:1139 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "" -#: ../../using/configure.rst:1136 +#: ../../using/configure.rst:1140 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "" -#: ../../using/configure.rst:1140 +#: ../../using/configure.rst:1144 #, fuzzy msgid "make buildbottest" msgstr "主要建置步驟" -#: ../../using/configure.rst:1142 +#: ../../using/configure.rst:1146 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1147 +#: ../../using/configure.rst:1151 msgid "make regen-all" msgstr "" -#: ../../using/configure.rst:1149 +#: ../../using/configure.rst:1153 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1701,18 +1707,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1156 +#: ../../using/configure.rst:1160 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1158 +#: ../../using/configure.rst:1162 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:1162 +#: ../../using/configure.rst:1166 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1723,14 +1729,14 @@ msgid "" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" -#: ../../using/configure.rst:1172 +#: ../../using/configure.rst:1176 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:1176 +#: ../../using/configure.rst:1180 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -1746,7 +1752,7 @@ msgstr "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1184 +#: ../../using/configure.rst:1188 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-" @@ -1754,304 +1760,304 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1188 +#: ../../using/configure.rst:1192 msgid "" "The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:1192 +#: ../../using/configure.rst:1196 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1193 +#: ../../using/configure.rst:1197 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1195 +#: ../../using/configure.rst:1199 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1201 +#: ../../using/configure.rst:1205 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1203 +#: ../../using/configure.rst:1207 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1207 +#: ../../using/configure.rst:1211 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:1211 +#: ../../using/configure.rst:1215 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1217 +#: ../../using/configure.rst:1221 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1220 ../../using/configure.rst:1410 +#: ../../using/configure.rst:1224 ../../using/configure.rst:1414 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1234 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1232 +#: ../../using/configure.rst:1236 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1237 +#: ../../using/configure.rst:1241 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1243 +#: ../../using/configure.rst:1247 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:1247 +#: ../../using/configure.rst:1251 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1249 +#: ../../using/configure.rst:1253 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1257 +#: ../../using/configure.rst:1261 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 :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1261 +#: ../../using/configure.rst:1265 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1263 +#: ../../using/configure.rst:1267 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:1268 +#: ../../using/configure.rst:1272 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1276 +#: ../../using/configure.rst:1280 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1283 +#: ../../using/configure.rst:1287 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1287 +#: ../../using/configure.rst:1291 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1294 +#: ../../using/configure.rst:1298 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1301 +#: ../../using/configure.rst:1305 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1305 +#: ../../using/configure.rst:1309 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1309 +#: ../../using/configure.rst:1313 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1315 +#: ../../using/configure.rst:1319 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:1317 +#: ../../using/configure.rst:1321 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1321 +#: ../../using/configure.rst:1325 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1323 +#: ../../using/configure.rst:1327 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:1328 +#: ../../using/configure.rst:1332 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:1332 +#: ../../using/configure.rst:1336 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:1338 +#: ../../using/configure.rst:1342 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1340 +#: ../../using/configure.rst:1344 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:1346 +#: ../../using/configure.rst:1350 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:1352 +#: ../../using/configure.rst:1356 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1355 +#: ../../using/configure.rst:1359 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:1361 +#: ../../using/configure.rst:1365 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1363 +#: ../../using/configure.rst:1367 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:1367 +#: ../../using/configure.rst:1371 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1371 +#: ../../using/configure.rst:1375 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1373 +#: ../../using/configure.rst:1377 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:1377 +#: ../../using/configure.rst:1381 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1379 +#: ../../using/configure.rst:1383 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:1387 +#: ../../using/configure.rst:1391 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 :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1391 +#: ../../using/configure.rst:1395 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1393 +#: ../../using/configure.rst:1397 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:1400 +#: ../../using/configure.rst:1404 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1407 +#: ../../using/configure.rst:1411 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1416 +#: ../../using/configure.rst:1420 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1419 +#: ../../using/configure.rst:1423 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1423 +#: ../../using/configure.rst:1427 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1425 +#: ../../using/configure.rst:1429 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1429 +#: ../../using/configure.rst:1433 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1431 +#: ../../using/configure.rst:1435 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1435 +#: ../../using/configure.rst:1439 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1439 +#: ../../using/configure.rst:1443 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1445 +#: ../../using/configure.rst:1449 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1451 +#: ../../using/configure.rst:1455 msgid "Footnotes" msgstr "" -#: ../../using/configure.rst:1452 +#: ../../using/configure.rst:1456 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index c46877f1e0..cdbc170737 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -501,7 +501,7 @@ msgid "" "Other systems also allow Unicode strings as file names but convert them to " "byte strings before passing them to the system, which can cause a :exc:" "`UnicodeError` to be raised. Applications can test whether arbitrary Unicode " -"strings are supported as file names by checking :attr:`os.path." +"strings are supported as file names by checking :const:`os.path." "supports_unicode_filenames`, a Boolean value." msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 8eaa5f46cd..11cffbb96a 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2211,7 +2211,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1605 msgid "" -"The :attr:`sys.version_info` value is now a named tuple, with attributes " +"The :data:`sys.version_info` value is now a named tuple, with attributes " "named :attr:`!major`, :attr:`!minor`, :attr:`!micro`, :attr:`!releaselevel`, " "and :attr:`!serial`. (Contributed by Ross Light; :issue:`4285`.)" msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 8e5ee538ea..67eb9397d1 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3272,7 +3272,8 @@ msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" #: ../../whatsnew/3.12.rst:1470 -msgid ":attr:`importlib.util.MAGIC_NUMBER`" +#, fuzzy +msgid ":const:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" #: ../../whatsnew/3.12.rst:1471 @@ -3281,8 +3282,8 @@ msgstr "``imp.get_suffixes()``" #: ../../whatsnew/3.12.rst:1471 msgid "" -":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." -"EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery." +"EXTENSION_SUFFIXES`, and :const:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" #: ../../whatsnew/3.12.rst:1472 diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index a149ab838e..dc825be00b 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -339,7 +339,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2037 msgid "New Features" msgstr "" @@ -515,7 +515,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:336 msgid "" "To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :attr:`sys.version` contain \"experimental free-threading " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " "build\". The new :func:`!sys._is_gil_enabled` function can be used to check " "whether the GIL is actually disabled in the running process." msgstr "" @@ -1137,7 +1137,7 @@ msgstr "" msgid "concurrent.futures" msgstr "" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1621 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1673 msgid "configparser" msgstr "" @@ -1576,7 +1576,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:1074 msgid "" -":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " +":func:`~os.posix_spawn` can now use the :const:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" "`!posix_spawn_file_actions_addclosefrom_np`. (Contributed by Jakub Kulik in :" "gh:`113117`.)" @@ -1606,7 +1606,7 @@ msgid "" "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1098 ../../whatsnew/3.13.rst:1677 +#: ../../whatsnew/3.13.rst:1098 ../../whatsnew/3.13.rst:1729 msgid "pathlib" msgstr "" @@ -1720,7 +1720,7 @@ msgid "" "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1175 ../../whatsnew/3.13.rst:1685 +#: ../../whatsnew/3.13.rst:1175 ../../whatsnew/3.13.rst:1737 msgid "re" msgstr "" @@ -1847,7 +1847,7 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1271 ../../whatsnew/3.13.rst:2732 +#: ../../whatsnew/3.13.rst:1271 ../../whatsnew/3.13.rst:2811 msgid "sys" msgstr "" @@ -1997,7 +1997,7 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1382 ../../whatsnew/3.13.rst:1710 +#: ../../whatsnew/3.13.rst:1382 ../../whatsnew/3.13.rst:1762 msgid "typing" msgstr "" @@ -2178,19 +2178,34 @@ msgstr "" msgid ":mod:`!aifc`" msgstr "" -#: ../../whatsnew/3.13.rst:1511 +#: ../../whatsnew/3.13.rst:1512 +msgid "" +":pypi:`standard-aifc`: Use the redistribution of ``aifc`` library from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1515 msgid ":mod:`!audioop`" msgstr "" -#: ../../whatsnew/3.13.rst:1512 +#: ../../whatsnew/3.13.rst:1517 +msgid ":pypi:`audioop-lts`: Use ``audioop-lts`` library from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1520 msgid ":mod:`!chunk`" msgstr "" -#: ../../whatsnew/3.13.rst:1513 +#: ../../whatsnew/3.13.rst:1522 +msgid "" +":pypi:`standard-chunk`: Use the redistribution of ``chunk`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1525 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr "" -#: ../../whatsnew/3.13.rst:1515 +#: ../../whatsnew/3.13.rst:1527 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2198,7 +2213,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1520 +#: ../../whatsnew/3.13.rst:1532 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2206,14 +2221,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1525 +#: ../../whatsnew/3.13.rst:1537 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1529 +#: ../../whatsnew/3.13.rst:1541 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2222,7 +2237,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1537 +#: ../../whatsnew/3.13.rst:1549 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2230,41 +2245,54 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1555 +msgid "" +":pypi:`standard-cgi`: and :pypi:`standard-cgitb`: Use the redistribution of " +"``cgi`` and ``cgitb`` library from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1558 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1548 +#: ../../whatsnew/3.13.rst:1563 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1550 +#: ../../whatsnew/3.13.rst:1565 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1552 +#: ../../whatsnew/3.13.rst:1567 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1554 +#: ../../whatsnew/3.13.rst:1569 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1557 +#: ../../whatsnew/3.13.rst:1572 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1562 +#: ../../whatsnew/3.13.rst:1576 +msgid "" +":pypi:`standard-crypt` and :pypi:`deprecated-crypt-alternative`: Use the " +"redistribution of ``crypt`` and reimplementation of ``_crypt`` libraries " +"from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2272,85 +2300,138 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1568 +#: ../../whatsnew/3.13.rst:1586 +msgid "" +":pypi:`standard-imghdr`: Use the redistribution of ``imghdr`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1589 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1570 +#: ../../whatsnew/3.13.rst:1592 +msgid "" +":pypi:`standard-mailcap`: Use the redistribution of ``mailcap`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1595 msgid ":mod:`!msilib`" msgstr "" -#: ../../whatsnew/3.13.rst:1571 +#: ../../whatsnew/3.13.rst:1596 msgid ":mod:`!nis`" msgstr "" -#: ../../whatsnew/3.13.rst:1572 +#: ../../whatsnew/3.13.rst:1597 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1574 +#: ../../whatsnew/3.13.rst:1600 +msgid "" +":pypi:`standard-nntplib`: Use the redistribution of ``nntplib`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1603 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1605 msgid "" ":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." "quote` to replace the undocumented ``pipes.quote`` function." msgstr "" -#: ../../whatsnew/3.13.rst:1580 +#: ../../whatsnew/3.13.rst:1610 +msgid "" +":pypi:`standard-pipes`: Use the redistribution of ``pipes`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1613 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1617 +msgid "" +":pypi:`standard-sndhdr`: Use the redistribution of ``sndhdr`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1620 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1622 msgid ":mod:`!sunau`" msgstr "" -#: ../../whatsnew/3.13.rst:1586 +#: ../../whatsnew/3.13.rst:1624 +msgid "" +":pypi:`standard-sunau`: Use the redistribution of ``sunau`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1627 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1588 +#: ../../whatsnew/3.13.rst:1630 +msgid "" +":pypi:`standard-telnetlib`: Use the redistribution of ``telnetlib`` library " +"from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1633 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1590 +#: ../../whatsnew/3.13.rst:1636 +msgid "" +":pypi:`standard-uu`: Use the redistribution of ``uu`` library from PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1639 msgid ":mod:`!xdrlib`" msgstr "" -#: ../../whatsnew/3.13.rst:1592 +#: ../../whatsnew/3.13.rst:1641 +msgid "" +":pypi:`standard-xdrlib`: Use the redistribution of ``xdrlib`` library from " +"PyPI." +msgstr "" + +#: ../../whatsnew/3.13.rst:1644 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1596 +#: ../../whatsnew/3.13.rst:1648 msgid "2to3" msgstr "" -#: ../../whatsnew/3.13.rst:1598 +#: ../../whatsnew/3.13.rst:1650 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1604 +#: ../../whatsnew/3.13.rst:1656 msgid "builtins" msgstr "" -#: ../../whatsnew/3.13.rst:1606 +#: ../../whatsnew/3.13.rst:1658 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2360,47 +2441,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1615 +#: ../../whatsnew/3.13.rst:1667 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1623 +#: ../../whatsnew/3.13.rst:1675 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1630 +#: ../../whatsnew/3.13.rst:1682 msgid "importlib.metadata" msgstr "" -#: ../../whatsnew/3.13.rst:1632 +#: ../../whatsnew/3.13.rst:1684 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint <entry-points>` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1638 +#: ../../whatsnew/3.13.rst:1690 msgid "locale" msgstr "" -#: ../../whatsnew/3.13.rst:1640 +#: ../../whatsnew/3.13.rst:1692 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1646 +#: ../../whatsnew/3.13.rst:1698 msgid "opcode" msgstr "" -#: ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1700 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2408,7 +2489,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1653 +#: ../../whatsnew/3.13.rst:1705 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2416,11 +2497,11 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1661 +#: ../../whatsnew/3.13.rst:1713 msgid "optparse" msgstr "" -#: ../../whatsnew/3.13.rst:1663 +#: ../../whatsnew/3.13.rst:1715 msgid "" "This module is no longer considered :term:`soft deprecated`. While :mod:" "`argparse` remains preferred for new projects that aren't using a third " @@ -2433,43 +2514,43 @@ msgid "" "(Contributed by Alyssa Coghlan and Serhiy Storchaka in :gh:`126180`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1679 +#: ../../whatsnew/3.13.rst:1731 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1687 +#: ../../whatsnew/3.13.rst:1739 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1693 +#: ../../whatsnew/3.13.rst:1745 msgid "tkinter.tix" msgstr "" -#: ../../whatsnew/3.13.rst:1695 +#: ../../whatsnew/3.13.rst:1747 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1753 msgid "turtle" msgstr "" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1755 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1712 +#: ../../whatsnew/3.13.rst:1764 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2477,66 +2558,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1718 +#: ../../whatsnew/3.13.rst:1770 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1724 +#: ../../whatsnew/3.13.rst:1776 msgid "unittest" msgstr "" -#: ../../whatsnew/3.13.rst:1726 +#: ../../whatsnew/3.13.rst:1778 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1728 +#: ../../whatsnew/3.13.rst:1780 msgid ":func:`!unittest.findTestCases`" msgstr "" -#: ../../whatsnew/3.13.rst:1729 +#: ../../whatsnew/3.13.rst:1781 msgid ":func:`!unittest.makeSuite`" msgstr "" -#: ../../whatsnew/3.13.rst:1730 +#: ../../whatsnew/3.13.rst:1782 msgid ":func:`!unittest.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1732 +#: ../../whatsnew/3.13.rst:1784 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1734 +#: ../../whatsnew/3.13.rst:1786 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr "" -#: ../../whatsnew/3.13.rst:1735 +#: ../../whatsnew/3.13.rst:1787 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr "" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1788 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr "" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1790 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1740 +#: ../../whatsnew/3.13.rst:1792 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1798 msgid "urllib" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1800 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2547,33 +2628,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1759 +#: ../../whatsnew/3.13.rst:1811 msgid "webbrowser" msgstr "" -#: ../../whatsnew/3.13.rst:1761 +#: ../../whatsnew/3.13.rst:1813 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1766 +#: ../../whatsnew/3.13.rst:1818 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name <webbrowser.controller.name>` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1825 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1827 msgid ":ref:`User-defined functions <user-defined-funcs>`:" msgstr "" -#: ../../whatsnew/3.13.rst:1777 +#: ../../whatsnew/3.13.rst:1829 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2581,12 +2662,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1783 +#: ../../whatsnew/3.13.rst:1835 #: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr "" -#: ../../whatsnew/3.13.rst:1785 +#: ../../whatsnew/3.13.rst:1837 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2595,61 +2676,61 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1792 +#: ../../whatsnew/3.13.rst:1844 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1794 +#: ../../whatsnew/3.13.rst:1846 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1798 +#: ../../whatsnew/3.13.rst:1850 msgid "" ":term:`Soft-deprecate <soft deprecated>` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1802 +#: ../../whatsnew/3.13.rst:1854 msgid ":mod:`decimal`:" msgstr "" -#: ../../whatsnew/3.13.rst:1804 +#: ../../whatsnew/3.13.rst:1856 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1809 +#: ../../whatsnew/3.13.rst:1861 msgid ":mod:`dis`:" msgstr "" -#: ../../whatsnew/3.13.rst:1811 +#: ../../whatsnew/3.13.rst:1863 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1815 +#: ../../whatsnew/3.13.rst:1867 msgid ":mod:`gettext`:" msgstr "" -#: ../../whatsnew/3.13.rst:1817 +#: ../../whatsnew/3.13.rst:1869 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1822 +#: ../../whatsnew/3.13.rst:1874 msgid ":mod:`glob`:" msgstr "" -#: ../../whatsnew/3.13.rst:1824 +#: ../../whatsnew/3.13.rst:1876 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2657,12 +2738,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1829 +#: ../../whatsnew/3.13.rst:1881 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr "" -#: ../../whatsnew/3.13.rst:1831 +#: ../../whatsnew/3.13.rst:1883 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2671,29 +2752,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1838 +#: ../../whatsnew/3.13.rst:1890 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1843 +#: ../../whatsnew/3.13.rst:1895 msgid ":mod:`mimetypes`:" msgstr "" -#: ../../whatsnew/3.13.rst:1845 +#: ../../whatsnew/3.13.rst:1897 msgid "" ":term:`Soft-deprecate <soft deprecated>` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1850 +#: ../../whatsnew/3.13.rst:1902 msgid ":mod:`re`:" msgstr "" -#: ../../whatsnew/3.13.rst:1852 +#: ../../whatsnew/3.13.rst:1904 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2702,46 +2783,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1859 +#: ../../whatsnew/3.13.rst:1911 #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr "" -#: ../../whatsnew/3.13.rst:1861 +#: ../../whatsnew/3.13.rst:1913 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1918 #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr "" -#: ../../whatsnew/3.13.rst:1868 +#: ../../whatsnew/3.13.rst:1920 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1874 +#: ../../whatsnew/3.13.rst:1926 msgid ":mod:`pydoc`:" msgstr "" -#: ../../whatsnew/3.13.rst:1876 +#: ../../whatsnew/3.13.rst:1928 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1879 +#: ../../whatsnew/3.13.rst:1931 #: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.13.rst:1881 +#: ../../whatsnew/3.13.rst:1933 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2749,7 +2830,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1887 +#: ../../whatsnew/3.13.rst:1939 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2757,7 +2838,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1945 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2767,46 +2848,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1953 #: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr "" -#: ../../whatsnew/3.13.rst:1903 +#: ../../whatsnew/3.13.rst:1955 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1908 +#: ../../whatsnew/3.13.rst:1960 #: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr "" -#: ../../whatsnew/3.13.rst:1910 +#: ../../whatsnew/3.13.rst:1962 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1914 +#: ../../whatsnew/3.13.rst:1966 msgid ":mod:`traceback`:" msgstr "" -#: ../../whatsnew/3.13.rst:1916 +#: ../../whatsnew/3.13.rst:1968 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1920 +#: ../../whatsnew/3.13.rst:1972 #: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.13.rst:1922 +#: ../../whatsnew/3.13.rst:1974 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2814,7 +2895,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1929 +#: ../../whatsnew/3.13.rst:1981 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2826,7 +2907,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1939 +#: ../../whatsnew/3.13.rst:1991 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2834,7 +2915,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1945 +#: ../../whatsnew/3.13.rst:1997 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2843,12 +2924,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1953 +#: ../../whatsnew/3.13.rst:2005 #: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr "" -#: ../../whatsnew/3.13.rst:1955 +#: ../../whatsnew/3.13.rst:2007 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -3595,11 +3676,11 @@ msgid "" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: ../../whatsnew/3.13.rst:1972 +#: ../../whatsnew/3.13.rst:2024 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:2026 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3608,97 +3689,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:2034 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:2039 msgid "" "Add the :ref:`PyMonitoring C API <c-api-monitoring>` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1990 +#: ../../whatsnew/3.13.rst:2042 msgid ":c:type:`PyMonitoringState`" msgstr "" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:2043 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1992 +#: ../../whatsnew/3.13.rst:2044 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1993 +#: ../../whatsnew/3.13.rst:2045 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1994 +#: ../../whatsnew/3.13.rst:2046 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1995 +#: ../../whatsnew/3.13.rst:2047 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1996 +#: ../../whatsnew/3.13.rst:2048 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1997 +#: ../../whatsnew/3.13.rst:2049 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1998 +#: ../../whatsnew/3.13.rst:2050 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:1999 +#: ../../whatsnew/3.13.rst:2051 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2000 +#: ../../whatsnew/3.13.rst:2052 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2053 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:2054 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2055 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2056 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2057 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2058 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr "" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2059 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2008 +#: ../../whatsnew/3.13.rst:2060 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr "" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2062 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:2064 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3706,52 +3787,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2018 +#: ../../whatsnew/3.13.rst:2070 msgid "" "Add the :ref:`PyTime C API <c-api-time>` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2020 +#: ../../whatsnew/3.13.rst:2072 msgid ":c:type:`PyTime_t`." msgstr "" -#: ../../whatsnew/3.13.rst:2021 +#: ../../whatsnew/3.13.rst:2073 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2022 +#: ../../whatsnew/3.13.rst:2074 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr "" -#: ../../whatsnew/3.13.rst:2023 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyTime_Monotonic`." msgstr "" -#: ../../whatsnew/3.13.rst:2024 +#: ../../whatsnew/3.13.rst:2076 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2025 +#: ../../whatsnew/3.13.rst:2077 msgid ":c:func:`PyTime_PerfCounter`." msgstr "" -#: ../../whatsnew/3.13.rst:2026 +#: ../../whatsnew/3.13.rst:2078 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2027 +#: ../../whatsnew/3.13.rst:2079 msgid ":c:func:`PyTime_Time`." msgstr "" -#: ../../whatsnew/3.13.rst:2028 +#: ../../whatsnew/3.13.rst:2080 msgid ":c:func:`PyTime_TimeRaw`." msgstr "" -#: ../../whatsnew/3.13.rst:2030 +#: ../../whatsnew/3.13.rst:2082 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2032 +#: ../../whatsnew/3.13.rst:2084 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3759,7 +3840,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2038 +#: ../../whatsnew/3.13.rst:2090 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3769,7 +3850,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:2098 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3778,7 +3859,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2106 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3787,7 +3868,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2061 +#: ../../whatsnew/3.13.rst:2113 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3798,7 +3879,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2123 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3809,37 +3890,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2133 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2138 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 <whatsnew313-locals-semantics>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2090 +#: ../../whatsnew/3.13.rst:2142 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr "" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2143 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr "" -#: ../../whatsnew/3.13.rst:2092 +#: ../../whatsnew/3.13.rst:2144 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr "" -#: ../../whatsnew/3.13.rst:2094 +#: ../../whatsnew/3.13.rst:2146 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2096 +#: ../../whatsnew/3.13.rst:2148 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong <strong reference>` or :term:`borrowed " @@ -3848,7 +3929,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2103 +#: ../../whatsnew/3.13.rst:2155 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3856,35 +3937,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2108 +#: ../../whatsnew/3.13.rst:2160 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down <interpreter shutdown>`. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2113 +#: ../../whatsnew/3.13.rst:2165 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2118 +#: ../../whatsnew/3.13.rst:2170 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2122 +#: ../../whatsnew/3.13.rst:2174 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2127 +#: ../../whatsnew/3.13.rst:2179 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -3892,27 +3973,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2133 +#: ../../whatsnew/3.13.rst:2185 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2190 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2194 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2145 +#: ../../whatsnew/3.13.rst:2197 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -3921,7 +4002,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2205 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -3929,14 +4010,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2159 +#: ../../whatsnew/3.13.rst:2211 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2164 +#: ../../whatsnew/3.13.rst:2216 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -3944,7 +4025,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2170 +#: ../../whatsnew/3.13.rst:2222 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -3952,14 +4033,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2176 +#: ../../whatsnew/3.13.rst:2228 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2181 +#: ../../whatsnew/3.13.rst:2233 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -3968,7 +4049,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2188 +#: ../../whatsnew/3.13.rst:2240 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -3976,47 +4057,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2194 +#: ../../whatsnew/3.13.rst:2246 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2196 +#: ../../whatsnew/3.13.rst:2248 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2197 +#: ../../whatsnew/3.13.rst:2249 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2199 +#: ../../whatsnew/3.13.rst:2251 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2200 +#: ../../whatsnew/3.13.rst:2252 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2203 +#: ../../whatsnew/3.13.rst:2255 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2206 +#: ../../whatsnew/3.13.rst:2258 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2210 +#: ../../whatsnew/3.13.rst:2262 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2212 +#: ../../whatsnew/3.13.rst:2264 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4029,20 +4110,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2276 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2280 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2284 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4053,35 +4134,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2241 +#: ../../whatsnew/3.13.rst:2293 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2244 +#: ../../whatsnew/3.13.rst:2296 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2245 +#: ../../whatsnew/3.13.rst:2297 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2246 +#: ../../whatsnew/3.13.rst:2298 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2299 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2301 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2252 +#: ../../whatsnew/3.13.rst:2304 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4090,7 +4171,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2310 msgid "" "If Python is built in :ref:`debug mode <debug-build>` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4098,60 +4179,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2266 +#: ../../whatsnew/3.13.rst:2318 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2268 +#: ../../whatsnew/3.13.rst:2320 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2270 +#: ../../whatsnew/3.13.rst:2322 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2323 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2272 +#: ../../whatsnew/3.13.rst:2324 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: ../../whatsnew/3.13.rst:2273 +#: ../../whatsnew/3.13.rst:2325 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: ../../whatsnew/3.13.rst:2274 +#: ../../whatsnew/3.13.rst:2326 msgid ":c:func:`PySys_Audit`" msgstr "" -#: ../../whatsnew/3.13.rst:2275 +#: ../../whatsnew/3.13.rst:2327 msgid ":c:func:`PySys_AuditTuple`" msgstr "" -#: ../../whatsnew/3.13.rst:2276 +#: ../../whatsnew/3.13.rst:2328 msgid ":c:func:`PyType_GetModuleByDef`" msgstr "" -#: ../../whatsnew/3.13.rst:2278 +#: ../../whatsnew/3.13.rst:2330 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2280 +#: ../../whatsnew/3.13.rst:2332 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API <limited-c-api>`. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2286 +#: ../../whatsnew/3.13.rst:2338 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2288 +#: ../../whatsnew/3.13.rst:2340 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4161,13 +4242,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2296 +#: ../../whatsnew/3.13.rst:2348 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2299 +#: ../../whatsnew/3.13.rst:2351 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4176,13 +4257,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2307 +#: ../../whatsnew/3.13.rst:2359 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2310 +#: ../../whatsnew/3.13.rst:2362 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4193,13 +4274,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2320 +#: ../../whatsnew/3.13.rst:2372 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2323 +#: ../../whatsnew/3.13.rst:2375 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4209,21 +4290,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2384 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2386 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2388 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2341 +#: ../../whatsnew/3.13.rst:2393 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4234,106 +4315,106 @@ msgid "" "`PyTuple_New(0) <PyTuple_New>`." msgstr "" -#: ../../whatsnew/3.13.rst:2351 +#: ../../whatsnew/3.13.rst:2403 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2353 +#: ../../whatsnew/3.13.rst:2405 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2355 +#: ../../whatsnew/3.13.rst:2407 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2358 +#: ../../whatsnew/3.13.rst:2410 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2412 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2363 +#: ../../whatsnew/3.13.rst:2415 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2365 +#: ../../whatsnew/3.13.rst:2417 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2367 +#: ../../whatsnew/3.13.rst:2419 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2369 +#: ../../whatsnew/3.13.rst:2421 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2423 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2425 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2427 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2378 +#: ../../whatsnew/3.13.rst:2430 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2381 +#: ../../whatsnew/3.13.rst:2433 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration <init-config>` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2385 +#: ../../whatsnew/3.13.rst:2437 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2390 +#: ../../whatsnew/3.13.rst:2442 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2391 +#: ../../whatsnew/3.13.rst:2443 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" -#: ../../whatsnew/3.13.rst:2392 +#: ../../whatsnew/3.13.rst:2444 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "" -#: ../../whatsnew/3.13.rst:2394 +#: ../../whatsnew/3.13.rst:2446 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2396 +#: ../../whatsnew/3.13.rst:2448 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4342,7 +4423,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2403 +#: ../../whatsnew/3.13.rst:2455 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4351,26 +4432,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2462 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2415 +#: ../../whatsnew/3.13.rst:2467 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2419 +#: ../../whatsnew/3.13.rst:2471 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2474 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4378,77 +4459,77 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2429 +#: ../../whatsnew/3.13.rst:2481 msgid "Deprecated C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2431 +#: ../../whatsnew/3.13.rst:2483 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2433 +#: ../../whatsnew/3.13.rst:2485 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2435 +#: ../../whatsnew/3.13.rst:2487 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2437 +#: ../../whatsnew/3.13.rst:2489 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2439 +#: ../../whatsnew/3.13.rst:2491 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2441 +#: ../../whatsnew/3.13.rst:2493 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2443 +#: ../../whatsnew/3.13.rst:2495 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2445 +#: ../../whatsnew/3.13.rst:2497 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." msgstr "" -#: ../../whatsnew/3.13.rst:2449 +#: ../../whatsnew/3.13.rst:2501 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2503 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2509 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2461 +#: ../../whatsnew/3.13.rst:2513 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2467 +#: ../../whatsnew/3.13.rst:2519 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4457,7 +4538,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2474 +#: ../../whatsnew/3.13.rst:2526 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4780,56 +4861,56 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr "" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2546 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2496 +#: ../../whatsnew/3.13.rst:2548 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 <whatsnew313-platform-support>` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2501 +#: ../../whatsnew/3.13.rst:2553 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 <whatsnew313-platform-support>` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2506 +#: ../../whatsnew/3.13.rst:2558 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2509 +#: ../../whatsnew/3.13.rst:2561 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2512 +#: ../../whatsnew/3.13.rst:2564 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2515 +#: ../../whatsnew/3.13.rst:2567 msgid "" "Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " "Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2519 +#: ../../whatsnew/3.13.rst:2571 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2575 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license <mimalloc-license>`. The bundled " @@ -4837,28 +4918,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2531 +#: ../../whatsnew/3.13.rst:2583 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2535 +#: ../../whatsnew/3.13.rst:2587 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build <debug-build>`. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2540 +#: ../../whatsnew/3.13.rst:2592 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2544 +#: ../../whatsnew/3.13.rst:2596 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -4868,27 +4949,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2553 +#: ../../whatsnew/3.13.rst:2605 msgid "Porting to Python 3.13" msgstr "" -#: ../../whatsnew/3.13.rst:2555 +#: ../../whatsnew/3.13.rst:2607 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2559 +#: ../../whatsnew/3.13.rst:2611 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.13.rst:2563 +#: ../../whatsnew/3.13.rst:2615 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals <frame.f_locals>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2566 +#: ../../whatsnew/3.13.rst:2618 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -4900,7 +4981,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2575 +#: ../../whatsnew/3.13.rst:2627 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -4910,7 +4991,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2582 +#: ../../whatsnew/3.13.rst:2634 msgid "" "Accessing :attr:`FrameType.f_locals <frame.f_locals>` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -4919,7 +5000,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2588 +#: ../../whatsnew/3.13.rst:2640 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -4927,14 +5008,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2594 +#: ../../whatsnew/3.13.rst:2646 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2599 +#: ../../whatsnew/3.13.rst:2651 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -4943,13 +5024,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2605 +#: ../../whatsnew/3.13.rst:2657 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2608 +#: ../../whatsnew/3.13.rst:2660 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -4957,25 +5038,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2613 +#: ../../whatsnew/3.13.rst:2665 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2618 +#: ../../whatsnew/3.13.rst:2670 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2625 +#: ../../whatsnew/3.13.rst:2677 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.13.rst:2627 +#: ../../whatsnew/3.13.rst:2679 msgid "" "``Python.h`` no longer includes the ``<ieeefp.h>`` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -4984,7 +5065,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2633 +#: ../../whatsnew/3.13.rst:2685 msgid "" "``Python.h`` no longer includes these standard header files: ``<time.h>``, " "``<sys/select.h>`` and ``<sys/time.h>``. If needed, they should now be " @@ -4995,7 +5076,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2641 +#: ../../whatsnew/3.13.rst:2693 msgid "" "On Windows, ``Python.h`` no longer includes the ``<stddef.h>`` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5005,7 +5086,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2648 +#: ../../whatsnew/3.13.rst:2700 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5013,18 +5094,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2705 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2657 +#: ../../whatsnew/3.13.rst:2709 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2659 +#: ../../whatsnew/3.13.rst:2711 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5036,11 +5117,11 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2720 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2670 +#: ../../whatsnew/3.13.rst:2722 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5052,7 +5133,7 @@ msgid "" "}" msgstr "" -#: ../../whatsnew/3.13.rst:2679 +#: ../../whatsnew/3.13.rst:2731 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5060,13 +5141,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2686 +#: ../../whatsnew/3.13.rst:2738 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2689 +#: ../../whatsnew/3.13.rst:2741 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5080,7 +5161,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2702 +#: ../../whatsnew/3.13.rst:2754 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5089,25 +5170,126 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2709 +#: ../../whatsnew/3.13.rst:2761 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2714 +#: ../../whatsnew/3.13.rst:2766 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes <optimized scope>`." msgstr "" -#: ../../whatsnew/3.13.rst:2719 +#: ../../whatsnew/3.13.rst:2770 +msgid "" +"Python 3.13 removed many private functions. Some of them can be replaced " +"using these alternatives:" +msgstr "" + +#: ../../whatsnew/3.13.rst:2773 +msgid "``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2774 +msgid "``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2775 +msgid "``_PyErr_WriteUnraisableMsg()``: :c:func:`PyErr_FormatUnraisable`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2776 +msgid "" +"``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or :c:func:" +"`PyEval_SetTraceAllThreads`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2777 +msgid "``_PyList_Extend()``: :c:func:`PyList_Extend`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2778 +msgid "``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2779 +msgid "``_PyMem_RawStrdup()``: ``strdup()``;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2780 +msgid "``_PyMem_Strdup()``: ``strdup()``;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2781 +msgid "``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2782 +msgid "``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2783 +msgid "" +"``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2784 +msgid "``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2785 +msgid "" +"``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or :c:func:" +"`PyTime_MonotonicRaw`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2786 +msgid "" +"``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or :c:func:" +"`PyTime_PerfCounterRaw`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2787 +msgid "" +"``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or :c:func:" +"`PyTime_TimeRaw`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2788 +msgid "``_PyTime_MAX``: :c:var:`PyTime_MAX`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2789 +msgid "``_PyTime_MIN``: :c:var:`PyTime_MIN`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2790 +msgid "``_PyTime_t``: :c:type:`PyTime_t`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2791 +msgid "``_Py_HashPointer()``: :c:func:`Py_HashPointer`;" +msgstr "" + +#: ../../whatsnew/3.13.rst:2792 +msgid "``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`." +msgstr "" + +#: ../../whatsnew/3.13.rst:2794 +msgid "" +"The `pythoncapi-compat project`_ can be used to get most of these new " +"functions on Python 3.12 and older." +msgstr "" + +#: ../../whatsnew/3.13.rst:2798 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2721 +#: ../../whatsnew/3.13.rst:2800 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " @@ -5116,11 +5298,11 @@ msgid "" "in :gh:`110769`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2729 +#: ../../whatsnew/3.13.rst:2808 msgid "Notable changes in 3.13.1" msgstr "" -#: ../../whatsnew/3.13.rst:2734 +#: ../../whatsnew/3.13.rst:2813 msgid "" "The previously undocumented special function :func:`sys.getobjects`, which " "only exists in specialized builds of Python, may now return objects from " diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 82c60a3dce..d4bd70267f 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1939,8 +1939,8 @@ msgstr "``-999999999999999999``" #: ../../whatsnew/3.3.rst:1150 msgid "" -"In the context templates (:class:`~decimal.DefaultContext`, :class:`~decimal." -"BasicContext` and :class:`~decimal.ExtendedContext`) the magnitude of :attr:" +"In the context templates (:const:`~decimal.DefaultContext`, :const:`~decimal." +"BasicContext` and :const:`~decimal.ExtendedContext`) the magnitude of :attr:" "`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to " "``999999``." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 84f2f50a74..5b61ee496c 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1458,7 +1458,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:997 msgid "" -":mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` " +":mod:`importlib.util` now has a :const:`~importlib.util.MAGIC_NUMBER` " "attribute providing access to the bytecode version number. This replaces " "the :func:`!get_magic` function in the deprecated :mod:`!imp` module. " "(Contributed by Brett Cannon in :issue:`18192`.)" diff --git a/whatsnew/changelog.po b/whatsnew/changelog.po index 62347d8849..1562c188a0 100644 --- a/whatsnew/changelog.po +++ b/whatsnew/changelog.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2025-02-07 08:41+0000\n" "PO-Revision-Date: 2018-05-23 16:21+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,6 +20,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../whatsnew/changelog.rst:5 +#: ../../whatsnew/changelog.rst:7 msgid "Changelog" msgstr "Changelog(更動日誌)" From 1c51439c2dae638bdf267e1195edc9709e245964 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2025 08:34:51 +0000 Subject: [PATCH 13/14] sync with cpython 1a7b8c0f --- c-api/init.po | 4 +- c-api/typeobj.po | 6 +- c-api/unicode.po | 86 ++-- deprecations/index.po | 145 +++--- deprecations/pending-removal-in-3.15.po | 38 +- deprecations/pending-removal-in-future.po | 107 ++-- glossary.po | 290 +++++------ library/asyncio-eventloop.po | 9 +- library/dbm.po | 4 +- library/idle.po | 579 +++++++++++----------- library/logging.po | 499 ++++++++++--------- library/plistlib.po | 4 +- library/smtplib.po | 12 +- library/socketserver.po | 121 ++--- library/unittest.mock.po | 5 +- reference/import.po | 360 +++++++------- using/editors.po | 30 +- using/unix.po | 125 +++-- whatsnew/3.12.po | 145 +++--- whatsnew/3.13.po | 145 +++--- 20 files changed, 1412 insertions(+), 1302 deletions(-) diff --git a/c-api/init.po b/c-api/init.po index cf4a4109c7..320de68f9a 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -859,7 +859,7 @@ msgstr "" #: ../../c-api/init.rst:900 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" -"`wchar_*` string." +"`wchar_t*` string." msgstr "" #: ../../c-api/init.rst:604 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 50edef5ce0..3031b1b0c4 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2976,8 +2976,8 @@ msgstr "" #: ../../c-api/typeobj.rst:1832 msgid "" -"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " -"and :c:member:`~PyTypeObject.tp_dictoffset`." +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:" +"member:`~PyTypeObject.tp_dictoffset`." msgstr "" #: ../../c-api/typeobj.rst:1837 diff --git a/c-api/unicode.po b/c-api/unicode.po index 40ca2f04d7..f67e7fc848 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1649,44 +1649,50 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1357 +#: ../../c-api/unicode.rst:1358 +msgid "" +"Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " +"specified by *code_page*." +msgstr "" + +#: ../../c-api/unicode.rst:1364 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1364 +#: ../../c-api/unicode.rst:1371 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:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1372 +#: ../../c-api/unicode.rst:1379 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1378 +#: ../../c-api/unicode.rst:1385 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1380 +#: ../../c-api/unicode.rst:1387 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1384 +#: ../../c-api/unicode.rst:1391 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1389 +#: ../../c-api/unicode.rst:1396 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1394 +#: ../../c-api/unicode.rst:1401 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1695,27 +1701,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1402 +#: ../../c-api/unicode.rst:1409 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1409 +#: ../../c-api/unicode.rst:1416 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1416 +#: ../../c-api/unicode.rst:1423 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1424 +#: ../../c-api/unicode.rst:1431 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1724,7 +1730,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1434 +#: ../../c-api/unicode.rst:1441 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1734,37 +1740,37 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1442 +#: ../../c-api/unicode.rst:1449 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1449 +#: ../../c-api/unicode.rst:1456 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1456 +#: ../../c-api/unicode.rst:1463 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1463 +#: ../../c-api/unicode.rst:1470 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1466 +#: ../../c-api/unicode.rst:1473 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1472 +#: ../../c-api/unicode.rst:1479 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " @@ -1773,18 +1779,18 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/unicode.rst:1479 ../../c-api/unicode.rst:1500 +#: ../../c-api/unicode.rst:1486 ../../c-api/unicode.rst:1507 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1486 +#: ../../c-api/unicode.rst:1493 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1495 +#: ../../c-api/unicode.rst:1502 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1792,47 +1798,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1505 +#: ../../c-api/unicode.rst:1512 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1507 +#: ../../c-api/unicode.rst:1514 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1508 +#: ../../c-api/unicode.rst:1515 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1509 +#: ../../c-api/unicode.rst:1516 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1511 +#: ../../c-api/unicode.rst:1518 msgid "" "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:1517 +#: ../../c-api/unicode.rst:1524 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1523 +#: ../../c-api/unicode.rst:1530 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1526 +#: ../../c-api/unicode.rst:1533 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1532 +#: ../../c-api/unicode.rst:1539 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -1843,7 +1849,7 @@ msgid "" "interns it." msgstr "" -#: ../../c-api/unicode.rst:1539 +#: ../../c-api/unicode.rst:1546 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1851,39 +1857,39 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1544 +#: ../../c-api/unicode.rst:1551 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1547 +#: ../../c-api/unicode.rst:1554 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1551 +#: ../../c-api/unicode.rst:1558 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1557 +#: ../../c-api/unicode.rst:1564 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: ../../c-api/unicode.rst:1560 +#: ../../c-api/unicode.rst:1567 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1564 +#: ../../c-api/unicode.rst:1571 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " @@ -1892,6 +1898,6 @@ msgid "" "`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1572 +#: ../../c-api/unicode.rst:1579 msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/deprecations/index.po b/deprecations/index.po index f2e0f900b0..8b14f7e98e 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -316,11 +316,20 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-future.rst:58 +msgid ":mod:`importlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "``load_module()`` method:請改用 ``exec_module()``。" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:34 +#: ../../deprecations/pending-removal-in-3.15.rst:38 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -334,12 +343,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:46 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -348,24 +357,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:52 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:58 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:56 +#: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -373,12 +382,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../deprecations/pending-removal-in-3.15.rst:66 #, fuzzy msgid ":mod:`types`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:64 +#: ../../deprecations/pending-removal-in-3.15.rst:68 #, fuzzy msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " @@ -391,12 +400,12 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:75 #, fuzzy msgid ":mod:`typing`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -408,19 +417,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:79 +#: ../../deprecations/pending-removal-in-3.15.rst:83 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:84 +#: ../../deprecations/pending-removal-in-3.15.rst:88 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:86 +#: ../../deprecations/pending-removal-in-3.15.rst:90 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -657,15 +666,7 @@ msgstr "" msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:58 -msgid ":mod:`importlib`:" -msgstr ":mod:`importlib`:" - #: ../../deprecations/pending-removal-in-future.rst:60 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "``load_module()`` method:請改用 ``exec_module()``。" - -#: ../../deprecations/pending-removal-in-future.rst:61 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -673,37 +674,37 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:67 +#: ../../deprecations/pending-removal-in-future.rst:66 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:75 +#: ../../deprecations/pending-removal-in-future.rst:74 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -711,7 +712,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -723,12 +724,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:87 +#: ../../deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:89 +#: ../../deprecations/pending-removal-in-future.rst:88 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -736,15 +737,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:95 +#: ../../deprecations/pending-removal-in-future.rst:94 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -752,58 +753,58 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:98 +#: ../../deprecations/pending-removal-in-future.rst:97 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:101 +#: ../../deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:102 +#: ../../deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "" ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " "ignored." msgstr "" ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -811,11 +812,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -823,7 +824,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -831,20 +832,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:121 +#: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -852,58 +853,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:128 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -913,13 +914,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -930,7 +931,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:154 +#: ../../deprecations/pending-removal-in-future.rst:153 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 9b28c4aad5..191a6801c3 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -72,11 +72,19 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:32 +msgid ":mod:`importlib`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`typing.NamedTuple`:" -#: ../../deprecations/pending-removal-in-3.15.rst:34 +#: ../../deprecations/pending-removal-in-3.15.rst:38 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -90,11 +98,11 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -103,22 +111,22 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:58 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:56 +#: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -126,11 +134,11 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../deprecations/pending-removal-in-3.15.rst:66 msgid ":mod:`types`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:64 +#: ../../deprecations/pending-removal-in-3.15.rst:68 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -138,11 +146,11 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`typing`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -154,18 +162,18 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:79 +#: ../../deprecations/pending-removal-in-3.15.rst:83 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:84 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid ":mod:`wave`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:86 +#: ../../deprecations/pending-removal-in-3.15.rst:90 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index c46ed6f7d3..bc9a4ada1f 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -157,10 +157,6 @@ msgid ":mod:`importlib`:" msgstr ":mod:`importlib`:" #: ../../deprecations/pending-removal-in-future.rst:60 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "``load_module()`` method:請改用 ``exec_module()``。" - -#: ../../deprecations/pending-removal-in-future.rst:61 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -168,37 +164,37 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:67 +#: ../../deprecations/pending-removal-in-future.rst:66 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:75 +#: ../../deprecations/pending-removal-in-future.rst:74 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -206,7 +202,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -218,12 +214,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:87 +#: ../../deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:89 +#: ../../deprecations/pending-removal-in-future.rst:88 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -231,15 +227,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:95 +#: ../../deprecations/pending-removal-in-future.rst:94 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -247,58 +243,58 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:98 +#: ../../deprecations/pending-removal-in-future.rst:97 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:101 +#: ../../deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:102 +#: ../../deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "" ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " "ignored." msgstr "" ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -306,11 +302,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -318,7 +314,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -326,20 +322,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:121 +#: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -347,58 +343,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:128 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -408,13 +404,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -425,10 +421,13 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:154 +#: ../../deprecations/pending-removal-in-future.rst:153 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" + +#~ msgid "``load_module()`` method: use ``exec_module()`` instead." +#~ msgstr "``load_module()`` method:請改用 ``exec_module()``。" diff --git a/glossary.po b/glossary.po index 16ce516d25..863636b3ae 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1723,7 +1723,7 @@ msgstr "" msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:771 ../../glossary.rst:1077 +#: ../../glossary.rst:771 ../../glossary.rst:1082 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" @@ -1937,7 +1937,7 @@ msgstr "" msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:827 ../../glossary.rst:859 ../../glossary.rst:1222 +#: ../../glossary.rst:827 ../../glossary.rst:859 ../../glossary.rst:1227 msgid "method" msgstr "method(方法)" @@ -2100,25 +2100,37 @@ msgid "namespace package" msgstr "namespace package(命名空間套件)" #: ../../glossary.rst:929 +#, fuzzy msgid "" -"A :pep:`420` :term:`package` which serves only as a container for " -"subpackages. Namespace packages may have no physical representation, and " -"specifically are not like a :term:`regular package` because they have no " -"``__init__.py`` file." +"A :term:`package` which serves only as a container for subpackages. " +"Namespace packages may have no physical representation, and specifically are " +"not like a :term:`regular package` because they have no ``__init__.py`` file." msgstr "" "一個 :pep:`420` :term:`package`\\ (套件),它只能作為子套件 (subpackage) 的" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" #: ../../glossary.rst:934 +msgid "" +"Namespace packages allow several individually installable packages to have a " +"common parent package. Otherwise, it is recommended to use a :term:`regular " +"package`." +msgstr "" + +#: ../../glossary.rst:937 +msgid "" +"For more information, see :pep:`420` and :ref:`reference-namespace-package`." +msgstr "" + +#: ../../glossary.rst:939 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:935 +#: ../../glossary.rst:940 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:937 +#: ../../glossary.rst:942 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2133,11 +2145,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:944 +#: ../../glossary.rst:949 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:946 +#: ../../glossary.rst:951 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2149,11 +2161,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:951 +#: ../../glossary.rst:956 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:953 +#: ../../glossary.rst:958 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2161,11 +2173,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:956 +#: ../../glossary.rst:961 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:958 +#: ../../glossary.rst:963 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2176,11 +2188,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:965 +#: ../../glossary.rst:970 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:967 +#: ../../glossary.rst:972 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2190,17 +2202,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:971 +#: ../../glossary.rst:976 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:972 +#: ../../glossary.rst:977 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:974 +#: ../../glossary.rst:979 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2210,7 +2222,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:978 +#: ../../glossary.rst:983 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally <argument>` or as a :term:`keyword argument " @@ -2221,11 +2233,11 @@ msgstr "" "置 <argument>`\\ 或是作為\\ :term:`關鍵字引數 <argument>`\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:983 +#: ../../glossary.rst:988 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:987 +#: ../../glossary.rst:992 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2236,11 +2248,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:992 +#: ../../glossary.rst:997 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:996 +#: ../../glossary.rst:1001 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2253,11 +2265,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1002 +#: ../../glossary.rst:1007 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1004 +#: ../../glossary.rst:1009 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2269,11 +2281,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1015 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1012 +#: ../../glossary.rst:1017 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2284,14 +2296,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1023 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1026 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters <faq-argument-vs-parameter>`, " @@ -2302,11 +2314,11 @@ msgstr "" "參數之間的差異 <faq-argument-vs-parameter>`、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1030 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1032 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2314,11 +2326,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1029 +#: ../../glossary.rst:1034 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1036 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2328,7 +2340,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:1035 +#: ../../glossary.rst:1040 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2336,11 +2348,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:1037 +#: ../../glossary.rst:1042 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1039 +#: ../../glossary.rst:1044 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2350,11 +2362,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1042 +#: ../../glossary.rst:1047 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1044 +#: ../../glossary.rst:1049 msgid "" "One of the default :term:`meta path finders <meta path finder>` which " "searches an :term:`import path` for modules." @@ -2362,11 +2374,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) <meta path finder>` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1051 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1048 +#: ../../glossary.rst:1053 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2384,11 +2396,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1061 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1058 +#: ../../glossary.rst:1063 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2399,7 +2411,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1069 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2411,15 +2423,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1070 +#: ../../glossary.rst:1075 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1076 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1078 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2427,15 +2439,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1075 +#: ../../glossary.rst:1080 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1083 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1085 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2451,7 +2463,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1094 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2460,7 +2472,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1093 +#: ../../glossary.rst:1098 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2469,19 +2481,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1101 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1103 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1104 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1101 +#: ../../glossary.rst:1106 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2490,11 +2502,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1109 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1111 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2508,7 +2520,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1113 +#: ../../glossary.rst:1118 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2516,11 +2528,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1116 +#: ../../glossary.rst:1121 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1123 msgid "" "for piece in food:\n" " print(piece)" @@ -2528,11 +2540,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1125 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1127 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2543,7 +2555,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1127 +#: ../../glossary.rst:1132 msgid "" ">>> class C:\n" "... class D:\n" @@ -2569,7 +2581,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1139 +#: ../../glossary.rst:1144 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2578,7 +2590,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1148 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2588,11 +2600,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1151 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1148 +#: ../../glossary.rst:1153 #, fuzzy msgid "" "The number of references to an object. When the reference count of an " @@ -2609,11 +2621,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1161 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1163 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2621,25 +2633,25 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1161 +#: ../../glossary.rst:1166 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1167 msgid "REPL" msgstr "" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1169 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." msgstr "" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1171 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1173 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2652,11 +2664,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1178 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1180 #, fuzzy msgid "" "An :term:`iterable` which supports efficient element access using integer " @@ -2676,7 +2688,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` " "鍵,而不是整數。" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1189 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2693,11 +2705,11 @@ msgstr "" "用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" "\\ :ref:`常見序列操作 <typesseq-common>`。" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1198 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1195 +#: ../../glossary.rst:1200 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2708,11 +2720,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1204 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1206 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2720,11 +2732,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1208 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1210 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2736,34 +2748,34 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1214 msgid "soft deprecated" msgstr "" -#: ../../glossary.rst:1211 +#: ../../glossary.rst:1216 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " "will not be enhanced further." msgstr "" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1220 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "" -#: ../../glossary.rst:1218 +#: ../../glossary.rst:1223 msgid "" "See `PEP 387: Soft Deprecation <https://peps.python.org/pep-0387/#soft-" "deprecation>`_." msgstr "" -#: ../../glossary.rst:1220 +#: ../../glossary.rst:1225 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1224 +#: ../../glossary.rst:1229 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2774,11 +2786,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1233 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1235 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2788,11 +2800,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1238 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1240 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints <type hint>` and the :" @@ -2802,11 +2814,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) <type hint>` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1243 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1245 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2817,7 +2829,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1246 +#: ../../glossary.rst:1251 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2827,15 +2839,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1256 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1257 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1254 +#: ../../glossary.rst:1259 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 " @@ -2844,7 +2856,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1258 +#: ../../glossary.rst:1263 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2852,7 +2864,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1266 msgid "" "There are a variety of different text serialization :ref:`codecs <standard-" "encodings>`, which are collectively referred to as \"text encodings\"." @@ -2860,11 +2872,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs <standard-encodings>`),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1269 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1266 +#: ../../glossary.rst:1271 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2878,7 +2890,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1273 +#: ../../glossary.rst:1278 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects <bytes-like object>`." @@ -2886,11 +2898,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) <bytes-like object>` 的檔案物件。" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1280 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1282 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2905,11 +2917,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1289 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1286 +#: ../../glossary.rst:1291 #, fuzzy msgid "" "The type of a Python object determines what kind of object it is; every " @@ -2920,22 +2932,22 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1295 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1292 +#: ../../glossary.rst:1297 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1294 +#: ../../glossary.rst:1299 msgid "" "Type aliases are useful for simplifying :term:`type hints <type hint>`. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) <type hint>` 很有用。例如: ::" -#: ../../glossary.rst:1297 +#: ../../glossary.rst:1302 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2945,11 +2957,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1301 +#: ../../glossary.rst:1306 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1303 +#: ../../glossary.rst:1308 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2961,15 +2973,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1308 ../../glossary.rst:1322 +#: ../../glossary.rst:1313 ../../glossary.rst:1327 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1314 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1311 +#: ../../glossary.rst:1316 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2977,7 +2989,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1314 +#: ../../glossary.rst:1319 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers <static type checker>`. They can also aid " @@ -2987,7 +2999,7 @@ msgstr "" "(static type checkers) <static type checker>`\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1318 +#: ../../glossary.rst:1323 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2995,11 +3007,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1323 +#: ../../glossary.rst:1328 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1325 +#: ../../glossary.rst:1330 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3012,20 +3024,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1330 +#: ../../glossary.rst:1335 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1332 +#: ../../glossary.rst:1337 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1339 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1336 +#: ../../glossary.rst:1341 msgid "" "class C:\n" " field: 'annotation'" @@ -3033,7 +3045,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1339 +#: ../../glossary.rst:1344 msgid "" "Variable annotations are usually used for :term:`type hints <type hint>`: " "for example this variable is expected to take :class:`int` values::" @@ -3041,15 +3053,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) <type hint>`:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1348 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1345 +#: ../../glossary.rst:1350 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1347 +#: ../../glossary.rst:1352 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3058,11 +3070,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1356 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1353 +#: ../../glossary.rst:1358 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3073,15 +3085,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1358 +#: ../../glossary.rst:1363 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1359 +#: ../../glossary.rst:1364 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1361 +#: ../../glossary.rst:1366 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3089,11 +3101,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1368 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1365 +#: ../../glossary.rst:1370 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3114,7 +3126,7 @@ msgstr "Fortran contiguous(Fortran 連續的)" msgid "magic" msgstr "magic" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1227 msgid "special" msgstr "special" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 922e40650d..eb6060100f 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -614,12 +614,13 @@ msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "設置將由 :meth:`loop.create_task` 使用的任務工廠。" #: ../../library/asyncio-eventloop.rst:383 +#, fuzzy msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " -"context=None)``, where *loop* is a reference to the active event loop, and " -"*coro* is a coroutine object. The callable must return a :class:`asyncio." -"Future`-compatible object." +"**kwargs)``, where *loop* is a reference to the active event loop, and " +"*coro* is a coroutine object. The callable must pass on all *kwargs*, and " +"return a :class:`asyncio.Task`-compatible object." msgstr "" "如果 *factory* 為 ``None``,將設置預設的任務工廠。否則,*factory* 必須是一個" "具有匹配簽名 ``(loop, coro, context=None)`` 的 *callable*,其中 *loop* 是有效" diff --git a/library/dbm.po b/library/dbm.po index 537944f975..3072192a9d 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -600,7 +600,7 @@ msgstr "" #: ../../library/dbm.rst:457 msgid "" "Synchronize the on-disk directory and data files. This method is called by " -"the :meth:`Shelve.sync` method." +"the :meth:`shelve.Shelf.sync` method." msgstr "" #: ../../library/dbm.rst:462 diff --git a/library/idle.po b/library/idle.po index 66d6e0817f..7342a0c8ae 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -18,59 +18,59 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/idle.rst:4 ../../library/idle.rst:10 -msgid "IDLE" -msgstr "IDLE" +#: ../../library/idle.rst:4 +msgid "IDLE --- Python editor and shell" +msgstr "" #: ../../library/idle.rst:8 msgid "**Source code:** :source:`Lib/idlelib/`" msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" -#: ../../library/idle.rst:17 +#: ../../library/idle.rst:20 msgid "IDLE is Python's Integrated Development and Learning Environment." msgstr "" -#: ../../library/idle.rst:19 +#: ../../library/idle.rst:22 msgid "IDLE has the following features:" msgstr "" -#: ../../library/idle.rst:21 +#: ../../library/idle.rst:24 msgid "cross-platform: works mostly the same on Windows, Unix, and macOS" msgstr "" -#: ../../library/idle.rst:23 +#: ../../library/idle.rst:26 msgid "" "Python shell window (interactive interpreter) with colorizing of code input, " "output, and error messages" msgstr "" -#: ../../library/idle.rst:26 +#: ../../library/idle.rst:29 msgid "" "multi-window text editor with multiple undo, Python colorizing, smart " "indent, call tips, auto completion, and other features" msgstr "" -#: ../../library/idle.rst:29 +#: ../../library/idle.rst:32 msgid "" "search within any window, replace within editor windows, and search through " "multiple files (grep)" msgstr "" -#: ../../library/idle.rst:32 +#: ../../library/idle.rst:35 msgid "" "debugger with persistent breakpoints, stepping, and viewing of global and " "local namespaces" msgstr "" -#: ../../library/idle.rst:35 +#: ../../library/idle.rst:38 msgid "configuration, browsers, and other dialogs" msgstr "" -#: ../../library/idle.rst:38 +#: ../../library/idle.rst:41 msgid "Menus" msgstr "目錄" -#: ../../library/idle.rst:40 +#: ../../library/idle.rst:43 msgid "" "IDLE has two main window types, the Shell window and the Editor window. It " "is possible to have multiple editor windows simultaneously. On Windows and " @@ -78,81 +78,81 @@ msgid "" "which window type it is associated with." msgstr "" -#: ../../library/idle.rst:45 +#: ../../library/idle.rst:48 msgid "" "Output windows, such as used for Edit => Find in Files, are a subtype of " "editor window. They currently have the same top menu but a different " "default title and context menu." msgstr "" -#: ../../library/idle.rst:49 +#: ../../library/idle.rst:52 msgid "" "On macOS, there is one application menu. It dynamically changes according " "to the window currently selected. It has an IDLE menu, and some entries " "described below are moved around to conform to Apple guidelines." msgstr "" -#: ../../library/idle.rst:54 +#: ../../library/idle.rst:57 msgid "File menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:56 +#: ../../library/idle.rst:59 msgid "New File" msgstr "新增檔案" -#: ../../library/idle.rst:57 +#: ../../library/idle.rst:60 msgid "Create a new file editing window." msgstr "" -#: ../../library/idle.rst:59 +#: ../../library/idle.rst:62 msgid "Open..." msgstr "" -#: ../../library/idle.rst:60 +#: ../../library/idle.rst:63 msgid "Open an existing file with an Open dialog." msgstr "" -#: ../../library/idle.rst:62 +#: ../../library/idle.rst:65 msgid "Open Module..." msgstr "" -#: ../../library/idle.rst:63 +#: ../../library/idle.rst:66 msgid "Open an existing module (searches sys.path)." msgstr "" -#: ../../library/idle.rst:65 +#: ../../library/idle.rst:68 msgid "Recent Files" msgstr "" -#: ../../library/idle.rst:66 +#: ../../library/idle.rst:69 msgid "Open a list of recent files. Click one to open it." msgstr "" -#: ../../library/idle.rst:72 +#: ../../library/idle.rst:75 msgid "Module Browser" msgstr "" -#: ../../library/idle.rst:73 +#: ../../library/idle.rst:76 msgid "" "Show functions, classes, and methods in the current Editor file in a tree " "structure. In the shell, open a module first." msgstr "" -#: ../../library/idle.rst:76 +#: ../../library/idle.rst:79 msgid "Path Browser" msgstr "" -#: ../../library/idle.rst:77 +#: ../../library/idle.rst:80 msgid "" "Show sys.path directories, modules, functions, classes and methods in a tree " "structure." msgstr "" -#: ../../library/idle.rst:80 +#: ../../library/idle.rst:83 msgid "Save" msgstr "" -#: ../../library/idle.rst:81 +#: ../../library/idle.rst:84 msgid "" "Save the current window to the associated file, if there is one. Windows " "that have been changed since being opened or last saved have a \\* before " @@ -160,11 +160,11 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:86 +#: ../../library/idle.rst:89 msgid "Save As..." msgstr "" -#: ../../library/idle.rst:87 +#: ../../library/idle.rst:90 msgid "" "Save the current window with a Save As dialog. The file saved becomes the " "new associated file for the window. (If your file namager is set to hide " @@ -173,283 +173,283 @@ msgid "" "text files, except that on macOS Aqua,'.py' is added for all files.)" msgstr "" -#: ../../library/idle.rst:93 +#: ../../library/idle.rst:96 msgid "Save Copy As..." msgstr "" -#: ../../library/idle.rst:94 +#: ../../library/idle.rst:97 msgid "" "Save the current window to different file without changing the associated " "file. (See Save As note above about filename extensions.)" msgstr "" -#: ../../library/idle.rst:97 +#: ../../library/idle.rst:100 msgid "Print Window" msgstr "" -#: ../../library/idle.rst:98 +#: ../../library/idle.rst:101 msgid "Print the current window to the default printer." msgstr "" -#: ../../library/idle.rst:100 +#: ../../library/idle.rst:103 msgid "Close Window" msgstr "" -#: ../../library/idle.rst:101 +#: ../../library/idle.rst:104 msgid "" "Close the current window (if an unsaved editor, ask to save; if an unsaved " "Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the " "Shell window also closes Shell. If this is the only window, also exit IDLE." msgstr "" -#: ../../library/idle.rst:105 +#: ../../library/idle.rst:108 msgid "Exit IDLE" msgstr "離開 IDLE" -#: ../../library/idle.rst:106 +#: ../../library/idle.rst:109 msgid "Close all windows and quit IDLE (ask to save unsaved edit windows)." msgstr "" -#: ../../library/idle.rst:109 +#: ../../library/idle.rst:112 msgid "Edit menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:111 +#: ../../library/idle.rst:114 msgid "Undo" msgstr "" -#: ../../library/idle.rst:112 +#: ../../library/idle.rst:115 msgid "" "Undo the last change to the current window. A maximum of 1000 changes may " "be undone." msgstr "" -#: ../../library/idle.rst:115 +#: ../../library/idle.rst:118 msgid "Redo" msgstr "" -#: ../../library/idle.rst:116 +#: ../../library/idle.rst:119 msgid "Redo the last undone change to the current window." msgstr "" -#: ../../library/idle.rst:118 +#: ../../library/idle.rst:121 msgid "Select All" msgstr "Select All(選擇全部)" -#: ../../library/idle.rst:119 +#: ../../library/idle.rst:122 msgid "Select the entire contents of the current window." msgstr "" -#: ../../library/idle.rst:121 ../../library/idle.rst:353 -#: ../../library/idle.rst:367 +#: ../../library/idle.rst:124 ../../library/idle.rst:356 +#: ../../library/idle.rst:370 msgid "Cut" msgstr "Cut(剪下)" -#: ../../library/idle.rst:122 ../../library/idle.rst:368 +#: ../../library/idle.rst:125 ../../library/idle.rst:371 msgid "" "Copy selection into the system-wide clipboard; then delete the selection." msgstr "" -#: ../../library/idle.rst:124 ../../library/idle.rst:353 -#: ../../library/idle.rst:370 +#: ../../library/idle.rst:127 ../../library/idle.rst:356 +#: ../../library/idle.rst:373 msgid "Copy" msgstr "Copy(複製)" -#: ../../library/idle.rst:125 ../../library/idle.rst:371 +#: ../../library/idle.rst:128 ../../library/idle.rst:374 msgid "Copy selection into the system-wide clipboard." msgstr "" -#: ../../library/idle.rst:127 ../../library/idle.rst:353 -#: ../../library/idle.rst:373 +#: ../../library/idle.rst:130 ../../library/idle.rst:356 +#: ../../library/idle.rst:376 msgid "Paste" msgstr "Paste(貼上)" -#: ../../library/idle.rst:128 ../../library/idle.rst:374 +#: ../../library/idle.rst:131 ../../library/idle.rst:377 msgid "Insert contents of the system-wide clipboard into the current window." msgstr "" -#: ../../library/idle.rst:130 +#: ../../library/idle.rst:133 msgid "The clipboard functions are also available in context menus." msgstr "" -#: ../../library/idle.rst:132 +#: ../../library/idle.rst:135 msgid "Find..." msgstr "" -#: ../../library/idle.rst:133 +#: ../../library/idle.rst:136 msgid "Open a search dialog with many options" msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:138 msgid "Find Again" msgstr "" -#: ../../library/idle.rst:136 +#: ../../library/idle.rst:139 msgid "Repeat the last search, if there is one." msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:141 msgid "Find Selection" msgstr "" -#: ../../library/idle.rst:139 +#: ../../library/idle.rst:142 msgid "Search for the currently selected string, if there is one." msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:144 msgid "Find in Files..." msgstr "" -#: ../../library/idle.rst:142 +#: ../../library/idle.rst:145 msgid "Open a file search dialog. Put results in a new output window." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:147 msgid "Replace..." msgstr "" -#: ../../library/idle.rst:145 +#: ../../library/idle.rst:148 msgid "Open a search-and-replace dialog." msgstr "" -#: ../../library/idle.rst:147 +#: ../../library/idle.rst:150 msgid "Go to Line" msgstr "" -#: ../../library/idle.rst:148 +#: ../../library/idle.rst:151 msgid "" "Move the cursor to the beginning of the line requested and make that line " "visible. A request past the end of the file goes to the end. Clear any " "selection and update the line and column status." msgstr "" -#: ../../library/idle.rst:152 +#: ../../library/idle.rst:155 msgid "Show Completions" msgstr "" -#: ../../library/idle.rst:153 +#: ../../library/idle.rst:156 msgid "" "Open a scrollable list allowing selection of existing names. See :ref:" "`Completions <completions>` in the Editing and navigation section below." msgstr "" -#: ../../library/idle.rst:156 +#: ../../library/idle.rst:159 msgid "Expand Word" msgstr "" -#: ../../library/idle.rst:157 +#: ../../library/idle.rst:160 msgid "" "Expand a prefix you have typed to match a full word in the same window; " "repeat to get a different expansion." msgstr "" -#: ../../library/idle.rst:160 +#: ../../library/idle.rst:163 msgid "Show Call Tip" msgstr "" -#: ../../library/idle.rst:161 +#: ../../library/idle.rst:164 msgid "" "After an unclosed parenthesis for a function, open a small window with " "function parameter hints. See :ref:`Calltips <calltips>` in the Editing and " "navigation section below." msgstr "" -#: ../../library/idle.rst:165 +#: ../../library/idle.rst:168 msgid "Show Surrounding Parens" msgstr "" -#: ../../library/idle.rst:166 +#: ../../library/idle.rst:169 msgid "Highlight the surrounding parenthesis." msgstr "" -#: ../../library/idle.rst:171 +#: ../../library/idle.rst:174 msgid "Format menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:173 +#: ../../library/idle.rst:176 msgid "Format Paragraph" msgstr "" -#: ../../library/idle.rst:174 +#: ../../library/idle.rst:177 msgid "" "Reformat the current blank-line-delimited paragraph in comment block or " "multiline string or selected line in a string. All lines in the paragraph " "will be formatted to less than N columns, where N defaults to 72." msgstr "" -#: ../../library/idle.rst:178 +#: ../../library/idle.rst:181 msgid "Indent Region" msgstr "" -#: ../../library/idle.rst:179 +#: ../../library/idle.rst:182 msgid "Shift selected lines right by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:181 +#: ../../library/idle.rst:184 msgid "Dedent Region" msgstr "" -#: ../../library/idle.rst:182 +#: ../../library/idle.rst:185 msgid "Shift selected lines left by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:184 +#: ../../library/idle.rst:187 msgid "Comment Out Region" msgstr "" -#: ../../library/idle.rst:185 +#: ../../library/idle.rst:188 msgid "Insert ## in front of selected lines." msgstr "" -#: ../../library/idle.rst:187 +#: ../../library/idle.rst:190 msgid "Uncomment Region" msgstr "" -#: ../../library/idle.rst:188 +#: ../../library/idle.rst:191 msgid "Remove leading # or ## from selected lines." msgstr "" -#: ../../library/idle.rst:190 +#: ../../library/idle.rst:193 msgid "Tabify Region" msgstr "" -#: ../../library/idle.rst:191 +#: ../../library/idle.rst:194 msgid "" "Turn *leading* stretches of spaces into tabs. (Note: We recommend using 4 " "space blocks to indent Python code.)" msgstr "" -#: ../../library/idle.rst:194 +#: ../../library/idle.rst:197 msgid "Untabify Region" msgstr "" -#: ../../library/idle.rst:195 +#: ../../library/idle.rst:198 msgid "Turn *all* tabs into the correct number of spaces." msgstr "" -#: ../../library/idle.rst:197 +#: ../../library/idle.rst:200 msgid "Toggle Tabs" msgstr "" -#: ../../library/idle.rst:198 +#: ../../library/idle.rst:201 msgid "Open a dialog to switch between indenting with spaces and tabs." msgstr "" -#: ../../library/idle.rst:200 +#: ../../library/idle.rst:203 msgid "New Indent Width" msgstr "" -#: ../../library/idle.rst:201 +#: ../../library/idle.rst:204 msgid "" "Open a dialog to change indent width. The accepted default by the Python " "community is 4 spaces." msgstr "" -#: ../../library/idle.rst:204 +#: ../../library/idle.rst:207 msgid "Strip Trailing Chitespace" msgstr "" -#: ../../library/idle.rst:205 +#: ../../library/idle.rst:208 msgid "" "Remove trailing space and other whitespace characters after the last non-" "whitespace character of a line by applying str.rstrip to each line, " @@ -457,15 +457,15 @@ msgid "" "extra newlines at the end of the file." msgstr "" -#: ../../library/idle.rst:214 +#: ../../library/idle.rst:217 msgid "Run menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:218 +#: ../../library/idle.rst:221 msgid "Run Module" msgstr "" -#: ../../library/idle.rst:219 +#: ../../library/idle.rst:222 msgid "" "Do :ref:`Check Module <check-module>`. If no error, restart the shell to " "clean the environment, then execute the module. Output is displayed in the " @@ -475,22 +475,22 @@ msgid "" "similar to executing a file with ``python -i file`` at a command line." msgstr "" -#: ../../library/idle.rst:229 +#: ../../library/idle.rst:232 msgid "Run... Customized" msgstr "" -#: ../../library/idle.rst:230 +#: ../../library/idle.rst:233 msgid "" "Same as :ref:`Run Module <run-module>`, but run the module with customized " "settings. *Command Line Arguments* extend :data:`sys.argv` as if passed on " "a command line. The module can be run in the Shell without restarting." msgstr "" -#: ../../library/idle.rst:236 +#: ../../library/idle.rst:239 msgid "Check Module" msgstr "" -#: ../../library/idle.rst:237 +#: ../../library/idle.rst:240 msgid "" "Check the syntax of the module currently open in the Editor window. If the " "module has not been saved IDLE will either prompt the user to save or " @@ -499,70 +499,70 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:245 +#: ../../library/idle.rst:248 msgid "Python Shell" msgstr "" -#: ../../library/idle.rst:246 +#: ../../library/idle.rst:249 msgid "Open or wake up the Python Shell window." msgstr "" -#: ../../library/idle.rst:250 +#: ../../library/idle.rst:253 msgid "Shell menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:252 +#: ../../library/idle.rst:255 msgid "View Last Restart" msgstr "" -#: ../../library/idle.rst:253 +#: ../../library/idle.rst:256 msgid "Scroll the shell window to the last Shell restart." msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:258 msgid "Restart Shell" msgstr "" -#: ../../library/idle.rst:256 +#: ../../library/idle.rst:259 msgid "" "Restart the shell to clean the environment and reset display and exception " "handling." msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:261 msgid "Previous History" msgstr "" -#: ../../library/idle.rst:259 +#: ../../library/idle.rst:262 msgid "" "Cycle through earlier commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:264 msgid "Next History" msgstr "" -#: ../../library/idle.rst:262 +#: ../../library/idle.rst:265 msgid "Cycle through later commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:267 msgid "Interrupt Execution" msgstr "" -#: ../../library/idle.rst:265 +#: ../../library/idle.rst:268 msgid "Stop a running program." msgstr "" -#: ../../library/idle.rst:268 +#: ../../library/idle.rst:271 msgid "Debug menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:270 +#: ../../library/idle.rst:273 msgid "Go to File/Line" msgstr "" -#: ../../library/idle.rst:271 +#: ../../library/idle.rst:274 msgid "" "Look on the current line. with the cursor, and the line above for a filename " "and line number. If found, open the file if not already open, and show the " @@ -571,45 +571,45 @@ msgid "" "Shell window and Output windows." msgstr "" -#: ../../library/idle.rst:281 +#: ../../library/idle.rst:284 msgid "Debugger (toggle)" msgstr "" -#: ../../library/idle.rst:282 +#: ../../library/idle.rst:285 msgid "" "When activated, code entered in the Shell or run from an Editor will run " "under the debugger. In the Editor, breakpoints can be set with the context " "menu. This feature is still incomplete and somewhat experimental." msgstr "" -#: ../../library/idle.rst:286 +#: ../../library/idle.rst:289 msgid "Stack Viewer" msgstr "" -#: ../../library/idle.rst:287 +#: ../../library/idle.rst:290 msgid "" "Show the stack traceback of the last exception in a tree widget, with access " "to locals and globals." msgstr "" -#: ../../library/idle.rst:290 +#: ../../library/idle.rst:293 msgid "Auto-open Stack Viewer" msgstr "" -#: ../../library/idle.rst:291 +#: ../../library/idle.rst:294 msgid "" "Toggle automatically opening the stack viewer on an unhandled exception." msgstr "" -#: ../../library/idle.rst:294 +#: ../../library/idle.rst:297 msgid "Options menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:296 +#: ../../library/idle.rst:299 msgid "Configure IDLE" msgstr "" -#: ../../library/idle.rst:297 +#: ../../library/idle.rst:300 msgid "" "Open a configuration dialog and change preferences for the following: fonts, " "indentation, keybindings, text color themes, startup windows and size, " @@ -618,39 +618,39 @@ msgid "" "see :ref:`Setting preferences <preferences>` under Help and preferences." msgstr "" -#: ../../library/idle.rst:304 +#: ../../library/idle.rst:307 msgid "" "Most configuration options apply to all windows or all future windows. The " "option items below only apply to the active window." msgstr "" -#: ../../library/idle.rst:307 +#: ../../library/idle.rst:310 msgid "Show/Hide Code Context (Editor Window only)" msgstr "" -#: ../../library/idle.rst:308 +#: ../../library/idle.rst:311 msgid "" "Open a pane at the top of the edit window which shows the block context of " "the code which has scrolled above the top of the window. See :ref:`Code " "Context <code-context>` in the Editing and Navigation section below." msgstr "" -#: ../../library/idle.rst:313 +#: ../../library/idle.rst:316 msgid "Show/Hide Line Numbers (Editor Window only)" msgstr "" -#: ../../library/idle.rst:314 +#: ../../library/idle.rst:317 msgid "" "Open a column to the left of the edit window which shows the number of each " "line of text. The default is off, which may be changed in the preferences " "(see :ref:`Setting preferences <preferences>`)." msgstr "" -#: ../../library/idle.rst:318 +#: ../../library/idle.rst:321 msgid "Zoom/Restore Height" msgstr "" -#: ../../library/idle.rst:319 +#: ../../library/idle.rst:322 msgid "" "Toggles the window between normal size and maximum height. The initial size " "defaults to 40 lines by 80 chars unless changed on the General tab of the " @@ -660,74 +660,74 @@ msgid "" "no effect when a window is maximized." msgstr "" -#: ../../library/idle.rst:327 +#: ../../library/idle.rst:330 msgid "Window menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:329 +#: ../../library/idle.rst:332 msgid "" "Lists the names of all open windows; select one to bring it to the " "foreground (deiconifying it if necessary)." msgstr "" -#: ../../library/idle.rst:333 +#: ../../library/idle.rst:336 msgid "Help menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:335 +#: ../../library/idle.rst:338 msgid "About IDLE" msgstr "" -#: ../../library/idle.rst:336 +#: ../../library/idle.rst:339 msgid "Display version, copyright, license, credits, and more." msgstr "" -#: ../../library/idle.rst:338 +#: ../../library/idle.rst:341 msgid "IDLE Help" msgstr "" -#: ../../library/idle.rst:339 +#: ../../library/idle.rst:342 msgid "" "Display this IDLE document, detailing the menu options, basic editing and " "navigation, and other tips." msgstr "" -#: ../../library/idle.rst:342 +#: ../../library/idle.rst:345 msgid "Python Docs" msgstr "" -#: ../../library/idle.rst:343 +#: ../../library/idle.rst:346 msgid "" "Access local Python documentation, if installed, or start a web browser and " "open docs.python.org showing the latest Python documentation." msgstr "" -#: ../../library/idle.rst:346 +#: ../../library/idle.rst:349 msgid "Turtle Demo" msgstr "" -#: ../../library/idle.rst:347 +#: ../../library/idle.rst:350 msgid "Run the turtledemo module with example Python code and turtle drawings." msgstr "" -#: ../../library/idle.rst:349 +#: ../../library/idle.rst:352 msgid "" "Additional help sources may be added here with the Configure IDLE dialog " "under the General tab. See the :ref:`Help sources <help-sources>` subsection " "below for more on Help menu choices." msgstr "" -#: ../../library/idle.rst:362 +#: ../../library/idle.rst:365 msgid "Context menus" msgstr "" -#: ../../library/idle.rst:364 +#: ../../library/idle.rst:367 msgid "" "Open a context menu by right-clicking in a window (Control-click on macOS). " "Context menus have the standard clipboard functions also on the Edit menu." msgstr "" -#: ../../library/idle.rst:376 +#: ../../library/idle.rst:379 msgid "" "Editor windows also have breakpoint functions. Lines with a breakpoint set " "are specially marked. Breakpoints only have an effect when running under " @@ -735,66 +735,66 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:353 ../../library/idle.rst:381 +#: ../../library/idle.rst:356 ../../library/idle.rst:384 msgid "Set Breakpoint" msgstr "" -#: ../../library/idle.rst:382 +#: ../../library/idle.rst:385 msgid "Set a breakpoint on the current line." msgstr "" -#: ../../library/idle.rst:353 ../../library/idle.rst:384 +#: ../../library/idle.rst:356 ../../library/idle.rst:387 msgid "Clear Breakpoint" msgstr "" -#: ../../library/idle.rst:385 +#: ../../library/idle.rst:388 msgid "Clear the breakpoint on that line." msgstr "" -#: ../../library/idle.rst:387 +#: ../../library/idle.rst:390 msgid "Shell and Output windows also have the following." msgstr "" -#: ../../library/idle.rst:389 +#: ../../library/idle.rst:392 msgid "Go to file/line" msgstr "" -#: ../../library/idle.rst:390 +#: ../../library/idle.rst:393 msgid "Same as in Debug menu." msgstr "" -#: ../../library/idle.rst:392 +#: ../../library/idle.rst:395 msgid "" "The Shell window also has an output squeezing facility explained in the " "*Python Shell window* subsection below." msgstr "" -#: ../../library/idle.rst:395 +#: ../../library/idle.rst:398 msgid "Squeeze" msgstr "" -#: ../../library/idle.rst:396 +#: ../../library/idle.rst:399 msgid "" "If the cursor is over an output line, squeeze all the output between the " "code above and the prompt below down to a 'Squeezed text' label." msgstr "" -#: ../../library/idle.rst:403 +#: ../../library/idle.rst:406 msgid "Editing and Navigation" msgstr "" -#: ../../library/idle.rst:406 +#: ../../library/idle.rst:409 msgid "Editor windows" msgstr "" -#: ../../library/idle.rst:408 +#: ../../library/idle.rst:411 msgid "" "IDLE may open editor windows when it starts, depending on settings and how " "you start IDLE. Thereafter, use the File menu. There can be only one open " "editor window for a given file." msgstr "" -#: ../../library/idle.rst:412 +#: ../../library/idle.rst:415 msgid "" "The title bar contains the name of the file, the full path, and the version " "of Python and IDLE running the window. The status bar contains the line " @@ -802,17 +802,17 @@ msgid "" "numbers with 0." msgstr "" -#: ../../library/idle.rst:417 +#: ../../library/idle.rst:420 msgid "" "IDLE assumes that files with a known .py* extension contain Python code and " "that other files do not. Run Python code with the Run menu." msgstr "" -#: ../../library/idle.rst:421 +#: ../../library/idle.rst:424 msgid "Key bindings" msgstr "" -#: ../../library/idle.rst:423 +#: ../../library/idle.rst:426 msgid "" "The IDLE insertion cursor is a thin vertical bar between character " "positions. When characters are entered, the insertion cursor and everything " @@ -820,7 +820,7 @@ msgid "" "the new space." msgstr "" -#: ../../library/idle.rst:428 +#: ../../library/idle.rst:431 msgid "" "Several non-character keys move the cursor and possibly delete characters. " "Deletion does not puts text on the clipboard, but IDLE has an undo list. " @@ -829,52 +829,52 @@ msgid "" "discussions assume that the keys have not been re-bound to something else.)" msgstr "" -#: ../../library/idle.rst:435 +#: ../../library/idle.rst:438 msgid "Arrow keys move the cursor one character or line." msgstr "" -#: ../../library/idle.rst:437 +#: ../../library/idle.rst:440 msgid "" ":kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves left or right one word." msgstr "" -#: ../../library/idle.rst:439 +#: ../../library/idle.rst:442 msgid ":kbd:`Home` and :kbd:`End` go to the beginning or end of the line." msgstr "" -#: ../../library/idle.rst:441 +#: ../../library/idle.rst:444 msgid ":kbd:`Page Up` and :kbd:`Page Down` go up or down one screen." msgstr "" -#: ../../library/idle.rst:443 +#: ../../library/idle.rst:446 msgid ":kbd:`C-Home` and :kbd:`C-End` go to beginning or end of the file." msgstr "" -#: ../../library/idle.rst:445 +#: ../../library/idle.rst:448 msgid "" ":kbd:`Backspace` and :kbd:`Del` (or :kbd:`C-d`) delete the previous or next " "character." msgstr "" -#: ../../library/idle.rst:448 +#: ../../library/idle.rst:451 msgid ":kbd:`C-Backspace` and :kbd:`C-Del` delete one word left or right." msgstr "" -#: ../../library/idle.rst:450 +#: ../../library/idle.rst:453 msgid ":kbd:`C-k` deletes ('kills') everything to the right." msgstr "" -#: ../../library/idle.rst:452 +#: ../../library/idle.rst:455 msgid "" "Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may " "work. Keybindings are selected in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:456 +#: ../../library/idle.rst:459 msgid "Automatic indentation" msgstr "" -#: ../../library/idle.rst:458 +#: ../../library/idle.rst:461 msgid "" "After a block-opening statement, the next line is indented by 4 spaces (in " "the Python Shell window by one tab). After certain keywords (break, return " @@ -884,17 +884,17 @@ msgid "" "tabs are restricted to four spaces due to Tcl/Tk limitations." msgstr "" -#: ../../library/idle.rst:465 +#: ../../library/idle.rst:468 msgid "" "See also the indent/dedent region commands on the :ref:`Format menu <format-" "menu>`." msgstr "" -#: ../../library/idle.rst:469 +#: ../../library/idle.rst:472 msgid "Search and Replace" msgstr "" -#: ../../library/idle.rst:471 +#: ../../library/idle.rst:474 msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " @@ -902,11 +902,11 @@ msgid "" "interpreted according to the Python re module." msgstr "" -#: ../../library/idle.rst:479 +#: ../../library/idle.rst:482 msgid "Completions" msgstr "" -#: ../../library/idle.rst:481 +#: ../../library/idle.rst:484 msgid "" "Completions are supplied, when requested and available, for module names, " "attributes of classes or functions, or filenames. Each request method " @@ -919,7 +919,7 @@ msgid "" "box. A double click within the box selects and closes." msgstr "" -#: ../../library/idle.rst:492 +#: ../../library/idle.rst:495 msgid "" "One way to open a box is to type a key character and wait for a predefined " "interval. This defaults to 2 seconds; customize it in the settings dialog. " @@ -931,7 +931,7 @@ msgid "" "directory name and a separator." msgstr "" -#: ../../library/idle.rst:502 +#: ../../library/idle.rst:505 msgid "" "Instead of waiting, or after a box is closed, open a completion box " "immediately with Show Completions on the Edit menu. The default hot key is :" @@ -942,7 +942,7 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:510 +#: ../../library/idle.rst:513 msgid "" "Hitting :kbd:`Tab` after a prefix usually has the same effect as Show " "Completions. (With no prefix, it indents.) However, if there is only one " @@ -950,14 +950,14 @@ msgid "" "without opening a box." msgstr "" -#: ../../library/idle.rst:515 +#: ../../library/idle.rst:518 msgid "" "Invoking 'Show Completions', or hitting :kbd:`Tab` after a prefix, outside " "of a string and without a preceding '.' opens a box with keywords, builtin " "names, and available module-level names." msgstr "" -#: ../../library/idle.rst:519 +#: ../../library/idle.rst:522 msgid "" "When editing code in an editor (as oppose to Shell), increase the available " "module-level names by running your code and not restarting the Shell " @@ -965,18 +965,18 @@ msgid "" "file. This also increases possible attribute completions." msgstr "" -#: ../../library/idle.rst:525 +#: ../../library/idle.rst:528 msgid "" "Completion boxes initially exclude names beginning with '_' or, for modules, " "not included in '__all__'. The hidden names can be accessed by typing '_' " "after '.', either before or after the box is opened." msgstr "" -#: ../../library/idle.rst:532 +#: ../../library/idle.rst:535 msgid "Calltips" msgstr "" -#: ../../library/idle.rst:534 +#: ../../library/idle.rst:537 msgid "" "A calltip is shown automatically when one types :kbd:`(` after the name of " "an *accessible* function. A function name expression may include dots and " @@ -986,7 +986,7 @@ msgid "" "or enter its shortcut to display a calltip." msgstr "" -#: ../../library/idle.rst:541 +#: ../../library/idle.rst:544 msgid "" "The calltip consists of the function's signature and docstring up to the " "latter's first blank line or the fifth non-blank line. (Some builtin " @@ -995,14 +995,14 @@ msgid "" "or name (keyword) only. Details are subject to change." msgstr "" -#: ../../library/idle.rst:547 +#: ../../library/idle.rst:550 msgid "" "In Shell, the accessible functions depends on what modules have been " "imported into the user process, including those imported by Idle itself, and " "which definitions have been run, all since the last restart." msgstr "" -#: ../../library/idle.rst:551 +#: ../../library/idle.rst:554 msgid "" "For example, restart the Shell and enter ``itertools.count(``. A calltip " "appears because Idle imports itertools into the user process for its own " @@ -1012,18 +1012,18 @@ msgid "" "display a calltip." msgstr "" -#: ../../library/idle.rst:558 +#: ../../library/idle.rst:561 msgid "" "In an editor, import statements have no effect until one runs the file. One " "might want to run a file after writing import statements, after adding " "function definitions, or after opening an existing file." msgstr "" -#: ../../library/idle.rst:565 +#: ../../library/idle.rst:568 msgid "Code Context" msgstr "" -#: ../../library/idle.rst:567 +#: ../../library/idle.rst:570 msgid "" "Within an editor window containing Python code, code context can be toggled " "in order to show or hide a pane at the top of the window. When shown, this " @@ -1037,23 +1037,23 @@ msgid "" "the top of the editor." msgstr "" -#: ../../library/idle.rst:578 +#: ../../library/idle.rst:581 msgid "" "The text and background colors for the context pane can be configured under " "the Highlights tab in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:582 +#: ../../library/idle.rst:585 msgid "Shell window" msgstr "" -#: ../../library/idle.rst:584 +#: ../../library/idle.rst:587 msgid "" "In IDLE's Shell, enter, edit, and recall complete statements. (Most consoles " "and terminals only work with a single physical line at a time)." msgstr "" -#: ../../library/idle.rst:587 +#: ../../library/idle.rst:590 msgid "" "Submit a single-line statement for execution by hitting :kbd:`Return` with " "the cursor anywhere on the line. If a line is extended with Backslash (:kbd:" @@ -1061,7 +1061,7 @@ msgid "" "compound statement by entering a blank line after the statement." msgstr "" -#: ../../library/idle.rst:593 +#: ../../library/idle.rst:596 msgid "" "When one pastes code into Shell, it is not compiled and possibly executed " "until one hits :kbd:`Return`, as specified above. One may edit pasted code " @@ -1070,7 +1070,7 @@ msgid "" "one." msgstr "" -#: ../../library/idle.rst:599 +#: ../../library/idle.rst:602 msgid "" "Lines containing ``RESTART`` mean that the user execution process has been " "re-started. This occurs when the user execution process has crashed, when " @@ -1078,38 +1078,38 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:604 +#: ../../library/idle.rst:607 msgid "" "The editing features described in previous subsections work when entering " "code interactively. IDLE's Shell window also responds to the following:" msgstr "" -#: ../../library/idle.rst:607 +#: ../../library/idle.rst:610 msgid ":kbd:`C-c` attempts to interrupt statement execution (but may fail)." msgstr "" -#: ../../library/idle.rst:609 +#: ../../library/idle.rst:612 msgid ":kbd:`C-d` closes Shell if typed at a ``>>>`` prompt." msgstr "" -#: ../../library/idle.rst:611 +#: ../../library/idle.rst:614 msgid "" ":kbd:`Alt-p` and :kbd:`Alt-n` (:kbd:`C-p` and :kbd:`C-n` on macOS) retrieve " "to the current prompt the previous or next previously entered statement that " "matches anything already typed." msgstr "" -#: ../../library/idle.rst:615 +#: ../../library/idle.rst:618 msgid "" ":kbd:`Return` while the cursor is on any previous statement appends the " "latter to anything already typed at the prompt." msgstr "" -#: ../../library/idle.rst:619 +#: ../../library/idle.rst:622 msgid "Text colors" msgstr "" -#: ../../library/idle.rst:621 +#: ../../library/idle.rst:624 msgid "" "Idle defaults to black on white text, but colors text with special meanings. " "For the shell, these are shell output, shell error, user output, and user " @@ -1119,7 +1119,7 @@ msgid "" "(when present), found text (when possible), and selected text." msgstr "" -#: ../../library/idle.rst:628 +#: ../../library/idle.rst:631 msgid "" "IDLE also highlights the :ref:`soft keywords <soft-keywords>` :keyword:" "`match`, :keyword:`case <match>`, and :keyword:`_ <wildcard-patterns>` in " @@ -1128,7 +1128,7 @@ msgid "" "patterns." msgstr "" -#: ../../library/idle.rst:634 +#: ../../library/idle.rst:637 msgid "" "Text coloring is done in the background, so uncolorized text is occasionally " "visible. To change the color scheme, use the Configure IDLE dialog " @@ -1136,11 +1136,11 @@ msgid "" "and text in popups and dialogs is not user-configurable." msgstr "" -#: ../../library/idle.rst:641 +#: ../../library/idle.rst:644 msgid "Startup and Code Execution" msgstr "" -#: ../../library/idle.rst:643 +#: ../../library/idle.rst:646 msgid "" "Upon startup with the ``-s`` option, IDLE will execute the file referenced " "by the environment variables :envvar:`IDLESTARTUP` or :envvar:" @@ -1152,7 +1152,7 @@ msgid "" "modules." msgstr "" -#: ../../library/idle.rst:651 +#: ../../library/idle.rst:654 msgid "" "In addition, ``Tk`` also loads a startup file if it is present. Note that " "the Tk file is loaded unconditionally. This additional file is ``.Idle.py`` " @@ -1161,11 +1161,11 @@ msgid "" "importing functions to be used from IDLE's Python shell." msgstr "" -#: ../../library/idle.rst:658 +#: ../../library/idle.rst:661 msgid "Command line usage" msgstr "命令列用法" -#: ../../library/idle.rst:660 +#: ../../library/idle.rst:663 msgid "" "idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] " "[arg] ...\n" @@ -1193,11 +1193,11 @@ msgstr "" "-t title set title of shell window\n" "- run stdin in shell (- must be last option before args)" -#: ../../library/idle.rst:674 +#: ../../library/idle.rst:677 msgid "If there are arguments:" msgstr "" -#: ../../library/idle.rst:676 +#: ../../library/idle.rst:679 msgid "" "If ``-``, ``-c``, or ``r`` is used, all arguments are placed in ``sys." "argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'``. " @@ -1205,17 +1205,17 @@ msgid "" "dialog." msgstr "" -#: ../../library/idle.rst:681 +#: ../../library/idle.rst:684 msgid "" "Otherwise, arguments are files opened for editing and ``sys.argv`` reflects " "the arguments passed to IDLE itself." msgstr "" -#: ../../library/idle.rst:685 +#: ../../library/idle.rst:688 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:687 +#: ../../library/idle.rst:690 msgid "" "IDLE uses a socket to communicate between the IDLE GUI process and the user " "code execution process. A connection must be established whenever the Shell " @@ -1225,7 +1225,7 @@ msgid "" "directs the user here. It then exits." msgstr "" -#: ../../library/idle.rst:694 +#: ../../library/idle.rst:697 msgid "" "One specific connection failure on Unix systems results from misconfigured " "masquerading rules somewhere in a system's network setup. When IDLE is " @@ -1235,7 +1235,7 @@ msgid "" "``tcplisten <same args>`` in another." msgstr "" -#: ../../library/idle.rst:702 +#: ../../library/idle.rst:705 msgid "" "A common cause of failure is a user-written file with the same name as a " "standard library module, such as *random.py* and *tkinter.py*. When such a " @@ -1244,7 +1244,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:708 +#: ../../library/idle.rst:711 msgid "" "Though less common than in the past, an antivirus or firewall program may " "stop the connection. If the program cannot be taught to allow the " @@ -1254,7 +1254,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:715 +#: ../../library/idle.rst:718 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1262,7 +1262,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:720 +#: ../../library/idle.rst:723 msgid "" "A zombie pythonw.exe process could be a problem. On Windows, use Task " "Manager to check for one and stop it if there is. Sometimes a restart " @@ -1271,7 +1271,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:726 +#: ../../library/idle.rst:729 msgid "" "When IDLE first starts, it attempts to read user configuration files in ``~/." "idlerc/`` (~ is one's home directory). If there is a problem, an error " @@ -1282,14 +1282,14 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:734 +#: ../../library/idle.rst:737 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:738 +#: ../../library/idle.rst:741 msgid "" "On Unix-based systems with tcl/tk older than ``8.6.11`` (see ``About IDLE``) " "certain characters of certain fonts can cause a tk failure with a message to " @@ -1298,11 +1298,11 @@ msgid "" "upgrade tcl/tk, then re-configure IDLE to use a font that works better." msgstr "" -#: ../../library/idle.rst:746 +#: ../../library/idle.rst:749 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:748 +#: ../../library/idle.rst:751 msgid "" "With rare exceptions, the result of executing Python code with IDLE is " "intended to be the same as executing the same code by the default method, " @@ -1312,7 +1312,7 @@ msgid "" "``threading.active_count()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:755 +#: ../../library/idle.rst:758 msgid "" "By default, IDLE runs user code in a separate OS process rather than in the " "user interface process that runs the shell and editor. In the execution " @@ -1322,7 +1322,7 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:762 +#: ../../library/idle.rst:765 msgid "" "Sending print output from one process to a text widget in another is slower " "than printing to a system terminal in the same process. This has the most " @@ -1334,7 +1334,7 @@ msgid "" "fields and lines." msgstr "" -#: ../../library/idle.rst:771 +#: ../../library/idle.rst:774 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1345,14 +1345,14 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:780 +#: ../../library/idle.rst:783 msgid "" "If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " "IDLE's changes are lost and input from the keyboard and output to the screen " "will not work correctly." msgstr "" -#: ../../library/idle.rst:784 +#: ../../library/idle.rst:787 msgid "" "When Shell has the focus, it controls the keyboard and screen. This is " "normally transparent, but functions that directly access the keyboard and " @@ -1360,7 +1360,7 @@ msgid "" "determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:789 +#: ../../library/idle.rst:792 msgid "" "The IDLE code running in the execution process adds frames to the call stack " "that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and " @@ -1368,17 +1368,17 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:794 +#: ../../library/idle.rst:797 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:798 +#: ../../library/idle.rst:801 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:800 +#: ../../library/idle.rst:803 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1388,7 +1388,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:807 +#: ../../library/idle.rst:810 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1397,7 +1397,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:813 +#: ../../library/idle.rst:816 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1411,7 +1411,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:823 +#: ../../library/idle.rst:826 msgid "" ">>> s = 'a\\tb\\a<\\x02><\\r>\\bc\\nd' # Enter 22 chars.\n" ">>> len(s)\n" @@ -1422,7 +1422,7 @@ msgid "" "# Result varies by OS and font. Try it." msgstr "" -#: ../../library/idle.rst:831 +#: ../../library/idle.rst:834 msgid "" "The ``repr`` function is used for interactive echo of expression values. It " "returns an altered version of the input string in which control codes, some " @@ -1431,13 +1431,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:837 +#: ../../library/idle.rst:840 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:840 +#: ../../library/idle.rst:843 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1446,7 +1446,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:846 +#: ../../library/idle.rst:849 msgid "" "Shell has a special facility for squeezing output lines down to a 'Squeezed " "text' label. This is done automatically for output over N lines (N = 50 by " @@ -1455,18 +1455,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:854 +#: ../../library/idle.rst:857 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:859 +#: ../../library/idle.rst:862 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:861 +#: ../../library/idle.rst:864 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1478,7 +1478,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:870 +#: ../../library/idle.rst:873 msgid "" "Most tkinter programs run ``root.mainloop()``, which usually does not return " "until the tk app is destroyed. If the program is run with ``python -i`` or " @@ -1486,7 +1486,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:876 +#: ../../library/idle.rst:879 msgid "" "When running a tkinter program from an IDLE editor, one can comment out the " "mainloop call. One then gets a shell prompt immediately and can interact " @@ -1494,11 +1494,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:882 +#: ../../library/idle.rst:885 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:884 +#: ../../library/idle.rst:887 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1506,7 +1506,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:889 +#: ../../library/idle.rst:892 msgid "" "If the attempt to make the socket connection fails, Idle will notify you. " "Such failures are sometimes transient, but if persistent, the problem may be " @@ -1515,7 +1515,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:895 +#: ../../library/idle.rst:898 msgid "" "If IDLE is started with the -n command line switch it will run in a single " "process and will not create the subprocess which runs the RPC Python " @@ -1529,15 +1529,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:910 +#: ../../library/idle.rst:913 msgid "Help and Preferences" msgstr "" -#: ../../library/idle.rst:915 +#: ../../library/idle.rst:918 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:917 +#: ../../library/idle.rst:920 msgid "" "Help menu entry \"IDLE Help\" displays a formatted html version of the IDLE " "chapter of the Library Reference. The result, in a read-only tkinter text " @@ -1547,7 +1547,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:925 +#: ../../library/idle.rst:928 msgid "" "Help menu entry \"Python Docs\" opens the extensive sources of help, " "including tutorials, available at ``docs.python.org/x.y``, where 'x.y' is " @@ -1556,17 +1556,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:931 +#: ../../library/idle.rst:934 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:937 +#: ../../library/idle.rst:940 msgid "Setting preferences" msgstr "" -#: ../../library/idle.rst:939 +#: ../../library/idle.rst:942 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1575,7 +1575,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:945 +#: ../../library/idle.rst:948 msgid "" "On the Font tab, see the text sample for the effect of font face and size on " "multiple characters in multiple languages. Edit the sample to add other " @@ -1584,7 +1584,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:952 +#: ../../library/idle.rst:955 msgid "" "On the Highlights and Keys tab, select a built-in or custom color theme and " "key set. To use a newer built-in color theme or key set with older IDLEs, " @@ -1592,22 +1592,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:958 +#: ../../library/idle.rst:961 msgid "IDLE on macOS" msgstr "" -#: ../../library/idle.rst:960 +#: ../../library/idle.rst:963 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:965 +#: ../../library/idle.rst:968 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:967 +#: ../../library/idle.rst:970 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " @@ -1616,21 +1616,21 @@ msgid "" "testing." msgstr "" -#: ../../library/idle.rst:975 -msgid "idlelib" -msgstr "idlelib" +#: ../../library/idle.rst:978 +msgid "idlelib --- implementation of IDLE application" +msgstr "" -#: ../../library/idle.rst:980 +#: ../../library/idle.rst:983 msgid "**Source code:** :source:`Lib/idlelib`" msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" -#: ../../library/idle.rst:984 +#: ../../library/idle.rst:987 msgid "" "The Lib/idlelib package implements the IDLE application. See the rest of " "this page for how to use IDLE." msgstr "" -#: ../../library/idle.rst:987 +#: ../../library/idle.rst:990 msgid "" "The files in idlelib are described in idlelib/README.txt. Access it either " "in idlelib or click Help => About IDLE on the IDLE menu. This file also " @@ -1639,6 +1639,10 @@ msgid "" "changes can be backported (see :pep:`434`)." msgstr "" +#: ../../library/idle.rst:10 +msgid "IDLE" +msgstr "IDLE" + #: ../../library/idle.rst:10 msgid "Python Editor" msgstr "Python Editor(Python 編輯器)" @@ -1647,26 +1651,29 @@ msgstr "Python Editor(Python 編輯器)" msgid "Integrated Development Environment" msgstr "Integrated Development Environment(整合開發環境)" -#: ../../library/idle.rst:68 +#: ../../library/idle.rst:71 msgid "Module browser" msgstr "Module browser(模組瀏覽器)" -#: ../../library/idle.rst:68 +#: ../../library/idle.rst:71 msgid "Path browser" msgstr "Path browser(路徑瀏覽器)" -#: ../../library/idle.rst:210 +#: ../../library/idle.rst:213 msgid "Run script" msgstr "Run script(執行腳本)" -#: ../../library/idle.rst:277 +#: ../../library/idle.rst:280 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/idle.rst:277 +#: ../../library/idle.rst:280 msgid "stack viewer" msgstr "stack viewer(堆疊檢視器)" -#: ../../library/idle.rst:353 +#: ../../library/idle.rst:356 msgid "breakpoints" msgstr "breakpoints(中斷點)" + +#~ msgid "idlelib" +#~ msgstr "idlelib" diff --git a/library/logging.po b/library/logging.po index 9d2b92d6f3..a06518e492 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon <therockleona@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -820,19 +820,24 @@ msgstr "" #: ../../library/logging.rst:595 msgid "" "Tidy up any resources used by the handler. This version does no output but " -"removes the handler from an internal list of handlers which is closed when :" -"func:`shutdown` is called. Subclasses should ensure that this gets called " -"from overridden :meth:`close` methods." +"removes the handler from an internal map of handlers, which is used for " +"handler lookup by name." msgstr "" -#: ../../library/logging.rst:603 +#: ../../library/logging.rst:599 +msgid "" +"Subclasses should ensure that this gets called from overridden :meth:`close` " +"methods." +msgstr "" + +#: ../../library/logging.rst:605 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:610 +#: ../../library/logging.rst:612 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute :data:" @@ -845,20 +850,20 @@ msgid "" "is more useful during development)." msgstr "" -#: ../../library/logging.rst:623 +#: ../../library/logging.rst:625 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:629 +#: ../../library/logging.rst:631 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:633 +#: ../../library/logging.rst:635 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -867,13 +872,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:639 +#: ../../library/logging.rst:641 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:642 +#: ../../library/logging.rst:644 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -883,16 +888,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:649 +#: ../../library/logging.rst:651 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:654 +#: ../../library/logging.rst:656 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:660 +#: ../../library/logging.rst:662 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -902,7 +907,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:663 +#: ../../library/logging.rst:665 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -910,14 +915,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:671 +#: ../../library/logging.rst:673 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:676 +#: ../../library/logging.rst:678 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -928,32 +933,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:686 +#: ../../library/logging.rst:688 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:691 +#: ../../library/logging.rst:693 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:696 +#: ../../library/logging.rst:698 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:699 +#: ../../library/logging.rst:701 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:702 +#: ../../library/logging.rst:704 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:708 +#: ../../library/logging.rst:710 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -972,13 +977,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:724 +#: ../../library/logging.rst:726 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:730 +#: ../../library/logging.rst:732 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -991,7 +996,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:740 +#: ../../library/logging.rst:742 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -1001,7 +1006,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:748 +#: ../../library/logging.rst:750 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -1016,11 +1021,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:761 +#: ../../library/logging.rst:763 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:766 +#: ../../library/logging.rst:768 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -1028,14 +1033,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:773 +#: ../../library/logging.rst:775 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:779 +#: ../../library/logging.rst:781 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -1044,7 +1049,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:787 +#: ../../library/logging.rst:789 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -1052,14 +1057,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:794 +#: ../../library/logging.rst:796 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:801 +#: ../../library/logging.rst:803 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -1067,11 +1072,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:809 +#: ../../library/logging.rst:811 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:813 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -1081,7 +1086,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:821 +#: ../../library/logging.rst:823 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -1089,7 +1094,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:828 +#: ../../library/logging.rst:830 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -1097,7 +1102,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:833 +#: ../../library/logging.rst:835 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -1107,13 +1112,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:842 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:845 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -1124,7 +1129,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:855 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -1132,7 +1137,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:859 +#: ../../library/logging.rst:861 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -1144,11 +1149,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:872 +#: ../../library/logging.rst:874 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:874 +#: ../../library/logging.rst:876 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -1156,17 +1161,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:882 +#: ../../library/logging.rst:884 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:886 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:888 +#: ../../library/logging.rst:890 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1174,7 +1179,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:896 +#: ../../library/logging.rst:898 msgid "" "The :ref:`numeric level <levels>` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -1182,46 +1187,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:903 +#: ../../library/logging.rst:905 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:909 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:913 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:918 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:922 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:925 +#: ../../library/logging.rst:927 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:931 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:936 +#: ../../library/logging.rst:938 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1230,7 +1235,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:943 +#: ../../library/logging.rst:945 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 " @@ -1238,13 +1243,13 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:951 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:952 +#: ../../library/logging.rst:954 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -1264,18 +1269,18 @@ msgstr "" "\n" "logging.setLogRecordFactory(record_factory)" -#: ../../library/logging.rst:961 +#: ../../library/logging.rst:963 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:970 +#: ../../library/logging.rst:972 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:974 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 " @@ -1286,7 +1291,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:980 +#: ../../library/logging.rst:982 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 (:" @@ -1294,7 +1299,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:986 +#: ../../library/logging.rst:988 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: " @@ -1303,318 +1308,318 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:993 +#: ../../library/logging.rst:995 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:993 ../../library/logging.rst:1363 +#: ../../library/logging.rst:995 ../../library/logging.rst:1365 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:993 ../../library/logging.rst:1363 +#: ../../library/logging.rst:995 ../../library/logging.rst:1365 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:995 +#: ../../library/logging.rst:0 ../../library/logging.rst:997 msgid "args" msgstr "" -#: ../../library/logging.rst:995 ../../library/logging.rst:1009 -#: ../../library/logging.rst:1037 ../../library/logging.rst:1055 +#: ../../library/logging.rst:997 ../../library/logging.rst:1011 +#: ../../library/logging.rst:1039 ../../library/logging.rst:1057 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" -#: ../../library/logging.rst:995 +#: ../../library/logging.rst:997 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:1000 +#: ../../library/logging.rst:1002 msgid "asctime" msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1002 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1002 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:1006 +#: ../../library/logging.rst:1008 msgid "created" msgstr "" -#: ../../library/logging.rst:1006 +#: ../../library/logging.rst:1008 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:1006 +#: ../../library/logging.rst:1008 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time_ns` / 1e9)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1009 +#: ../../library/logging.rst:0 ../../library/logging.rst:1011 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1011 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1014 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1014 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1014 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1016 msgid "funcName" msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1016 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1016 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1018 msgid "levelname" msgstr "" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1018 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1018 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1022 msgid "levelno" msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1022 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1022 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1025 +#: ../../library/logging.rst:1027 msgid "lineno" msgstr "" -#: ../../library/logging.rst:1025 +#: ../../library/logging.rst:1027 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1025 +#: ../../library/logging.rst:1027 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1030 msgid "message" msgstr "" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1030 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1030 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1034 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1034 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1034 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1036 msgid "msecs" msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1036 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1036 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1037 +#: ../../library/logging.rst:0 ../../library/logging.rst:1039 msgid "msg" msgstr "" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1039 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:1042 +#: ../../library/logging.rst:0 ../../library/logging.rst:1044 msgid "name" msgstr "name" -#: ../../library/logging.rst:1042 +#: ../../library/logging.rst:1044 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1042 +#: ../../library/logging.rst:1044 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1046 msgid "pathname" msgstr "" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1046 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1046 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1049 msgid "process" msgstr "" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1049 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1049 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1051 msgid "processName" msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1051 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1051 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1053 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1053 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1053 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1057 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1057 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:1061 +#: ../../library/logging.rst:1063 msgid "thread" msgstr "" -#: ../../library/logging.rst:1061 +#: ../../library/logging.rst:1063 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1061 +#: ../../library/logging.rst:1063 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1065 msgid "threadName" msgstr "" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1065 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1065 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1067 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1067 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1067 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1070 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1071 +#: ../../library/logging.rst:1073 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1077 +#: ../../library/logging.rst:1079 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1081 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 <context-info>`." msgstr "" -#: ../../library/logging.rst:1085 +#: ../../library/logging.rst:1087 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, a dict-like object (*extra*), and a " @@ -1624,7 +1629,7 @@ msgid "" "calls and only use the one of the :class:`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1094 +#: ../../library/logging.rst:1096 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1633,15 +1638,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1102 +#: ../../library/logging.rst:1104 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1106 +#: ../../library/logging.rst:1108 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1110 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1653,29 +1658,29 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1119 +#: ../../library/logging.rst:1121 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:1125 +#: ../../library/logging.rst:1127 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:1130 +#: ../../library/logging.rst:1132 #, fuzzy msgid "The *merge_extra* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1134 +#: ../../library/logging.rst:1136 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1138 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 " @@ -1684,7 +1689,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1141 +#: ../../library/logging.rst:1143 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 " @@ -1692,17 +1697,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1148 +#: ../../library/logging.rst:1150 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1150 +#: ../../library/logging.rst:1152 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1156 +#: ../../library/logging.rst:1158 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1712,14 +1717,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1163 +#: ../../library/logging.rst:1165 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:1170 +#: ../../library/logging.rst:1172 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 " @@ -1728,43 +1733,43 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1175 +#: ../../library/logging.rst:1177 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" msgstr "" -#: ../../library/logging.rst:1181 +#: ../../library/logging.rst:1183 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1183 +#: ../../library/logging.rst:1185 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:1188 +#: ../../library/logging.rst:1190 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1193 +#: ../../library/logging.rst:1195 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1197 +#: ../../library/logging.rst:1199 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1202 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1774,38 +1779,38 @@ msgid "" "described at the beginnning of this documentation." msgstr "" -#: ../../library/logging.rst:1210 +#: ../../library/logging.rst:1212 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1216 +#: ../../library/logging.rst:1218 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1219 +#: ../../library/logging.rst:1221 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:1226 +#: ../../library/logging.rst:1228 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1234 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1240 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1813,13 +1818,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1244 +#: ../../library/logging.rst:1246 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1251 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 " @@ -1833,7 +1838,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1260 +#: ../../library/logging.rst:1262 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 " @@ -1841,13 +1846,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1265 +#: ../../library/logging.rst:1267 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1271 +#: ../../library/logging.rst:1273 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1857,24 +1862,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1278 +#: ../../library/logging.rst:1280 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1283 +#: ../../library/logging.rst:1285 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:1291 +#: ../../library/logging.rst:1293 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1295 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1884,20 +1889,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1302 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:1304 +#: ../../library/logging.rst:1306 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1309 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 " @@ -1906,7 +1911,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1313 +#: ../../library/logging.rst:1315 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. " @@ -1914,17 +1919,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1323 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1328 +#: ../../library/logging.rst:1330 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1336 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1932,7 +1937,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1342 +#: ../../library/logging.rst:1344 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1941,13 +1946,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1350 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:1351 +#: ../../library/logging.rst:1353 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 " @@ -1956,54 +1961,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1358 +#: ../../library/logging.rst:1360 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1367 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1367 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1369 +#: ../../library/logging.rst:1371 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1369 +#: ../../library/logging.rst:1371 msgid "" "If *filename* is specified, open the file in this :ref:`mode <filemodes>`. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1375 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1375 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1380 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1380 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1381 +#: ../../library/logging.rst:1383 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1381 +#: ../../library/logging.rst:1383 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style <old-string-" @@ -2011,30 +2016,30 @@ msgid "" "Defaults to ``'%'``." msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1391 msgid "*level*" msgstr "*level*" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1391 msgid "Set the root logger level to the specified :ref:`level <levels>`." msgstr "" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1394 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1394 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:1398 +#: ../../library/logging.rst:1400 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1400 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 " @@ -2043,33 +2048,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1407 +#: ../../library/logging.rst:1409 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1407 +#: ../../library/logging.rst:1409 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:1413 +#: ../../library/logging.rst:1415 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1413 +#: ../../library/logging.rst:1415 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:1418 +#: ../../library/logging.rst:1420 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1418 +#: ../../library/logging.rst:1420 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 " @@ -2078,39 +2083,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1429 +#: ../../library/logging.rst:1431 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1434 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:1438 +#: ../../library/logging.rst:1440 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1443 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1446 +#: ../../library/logging.rst:1448 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:1450 +#: ../../library/logging.rst:1452 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:1457 +#: ../../library/logging.rst:1459 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 " @@ -2122,32 +2127,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1468 +#: ../../library/logging.rst:1470 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1470 +#: ../../library/logging.rst:1472 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1472 +#: ../../library/logging.rst:1474 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:1477 +#: ../../library/logging.rst:1479 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1481 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1483 msgid "The logger name." msgstr "" @@ -2155,7 +2160,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1484 msgid "The logging level (numeric)." msgstr "" @@ -2163,7 +2168,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1485 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2171,19 +2176,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1486 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1487 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1488 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1489 msgid "An exception tuple, or ``None``." msgstr "" @@ -2191,7 +2196,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1490 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2199,7 +2204,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1492 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2209,15 +2214,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1494 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1496 +#: ../../library/logging.rst:1498 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1500 +#: ../../library/logging.rst:1502 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``, " @@ -2228,15 +2233,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1512 +#: ../../library/logging.rst:1514 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1514 +#: ../../library/logging.rst:1516 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1516 +#: ../../library/logging.rst:1518 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2244,22 +2249,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1523 +#: ../../library/logging.rst:1525 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1525 +#: ../../library/logging.rst:1527 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1530 +#: ../../library/logging.rst:1532 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1533 +#: ../../library/logging.rst:1535 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2268,46 +2273,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1538 +#: ../../library/logging.rst:1540 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:1545 +#: ../../library/logging.rst:1547 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1546 +#: ../../library/logging.rst:1548 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1548 +#: ../../library/logging.rst:1550 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1549 +#: ../../library/logging.rst:1551 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1551 +#: ../../library/logging.rst:1553 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1554 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1557 msgid "" "`Original Python logging package <https://old.red-dove.com/python_logging." "html>`_" msgstr "" -#: ../../library/logging.rst:1556 +#: ../../library/logging.rst:1558 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/plistlib.po b/library/plistlib.po index 9c760912c6..ee3df97701 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -152,7 +152,7 @@ msgstr "" #: ../../library/plistlib.rst:102 msgid "" -"Write *value* to a plist file. *Fp* should be a writable, binary file object." +"Write *value* to a plist file. *fp* should be a writable, binary file object." msgstr "" #: ../../library/plistlib.rst:105 diff --git a/library/smtplib.po b/library/smtplib.po index 8dc73d5d15..98686beb26 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -707,11 +707,11 @@ msgid "" "and *to_addrs*, ``send_message`` does not transmit any :mailheader:`Bcc` or :" "mailheader:`Resent-Bcc` headers that may appear in *msg*. If any of the " "addresses in *from_addr* and *to_addrs* contain non-ASCII characters and the " -"server does not advertise ``SMTPUTF8`` support, an :exc:`SMTPNotSupported` " -"error is raised. Otherwise the ``Message`` is serialized with a clone of " -"its :mod:`~email.policy` with the :attr:`~email.policy.EmailPolicy.utf8` " -"attribute set to ``True``, and ``SMTPUTF8`` and ``BODY=8BITMIME`` are added " -"to *mail_options*." +"server does not advertise ``SMTPUTF8`` support, an :exc:" +"`SMTPNotSupportedError` is raised. Otherwise the ``Message`` is serialized " +"with a clone of its :mod:`~email.policy` with the :attr:`~email.policy." +"EmailPolicy.utf8` attribute set to ``True``, and ``SMTPUTF8`` and " +"``BODY=8BITMIME`` are added to *mail_options*." msgstr "" #: ../../library/smtplib.rst:534 diff --git a/library/socketserver.po b/library/socketserver.po index b0b992cf06..465223fa1c 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -345,17 +345,20 @@ msgstr "" #: ../../library/socketserver.rst:263 msgid "" -"The family of protocols to which the server's socket belongs. Common " -"examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." +"The family of protocols to which the server's socket belongs. Common " +"examples are :const:`socket.AF_INET`, :const:`socket.AF_INET6`, and :const:" +"`socket.AF_UNIX`. Subclass the TCP or UDP server classes in this module " +"with class attribute ``address_family = AF_INET6`` set if you want IPv6 " +"server classes." msgstr "" -#: ../../library/socketserver.rst:269 +#: ../../library/socketserver.rst:272 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:275 +#: ../../library/socketserver.rst:278 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -364,22 +367,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:284 +#: ../../library/socketserver.rst:287 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:287 +#: ../../library/socketserver.rst:290 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:293 +#: ../../library/socketserver.rst:296 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:299 +#: ../../library/socketserver.rst:302 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -388,40 +391,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:308 +#: ../../library/socketserver.rst:311 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:314 +#: ../../library/socketserver.rst:317 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:319 +#: ../../library/socketserver.rst:322 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:328 +#: ../../library/socketserver.rst:331 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:334 +#: ../../library/socketserver.rst:337 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:341 +#: ../../library/socketserver.rst:344 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -429,11 +432,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:346 +#: ../../library/socketserver.rst:349 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:353 +#: ../../library/socketserver.rst:356 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -442,7 +445,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:362 +#: ../../library/socketserver.rst:365 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -450,20 +453,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:374 +#: ../../library/socketserver.rst:377 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:381 +#: ../../library/socketserver.rst:384 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:387 +#: ../../library/socketserver.rst:390 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -471,17 +474,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:393 +#: ../../library/socketserver.rst:396 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:399 +#: ../../library/socketserver.rst:402 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:403 +#: ../../library/socketserver.rst:406 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -489,13 +492,13 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:412 +#: ../../library/socketserver.rst:415 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:418 +#: ../../library/socketserver.rst:421 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " @@ -504,72 +507,72 @@ msgid "" "`server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:424 +#: ../../library/socketserver.rst:427 msgid "" "The type of :attr:`request` is different for datagram or stream services. " "For stream services, :attr:`request` is a socket object; for datagram " "services, :attr:`request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:431 +#: ../../library/socketserver.rst:434 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:438 +#: ../../library/socketserver.rst:441 msgid "" "The *new* :class:`socket.socket` object to be used to communicate with the " "client." msgstr "" -#: ../../library/socketserver.rst:444 +#: ../../library/socketserver.rst:447 msgid "Client address returned by :meth:`BaseServer.get_request`." msgstr "" -#: ../../library/socketserver.rst:449 +#: ../../library/socketserver.rst:452 msgid ":class:`BaseServer` object used for handling the request." msgstr "" -#: ../../library/socketserver.rst:455 +#: ../../library/socketserver.rst:458 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " "and provide :attr:`rfile` and :attr:`wfile` attributes." msgstr "" -#: ../../library/socketserver.rst:461 +#: ../../library/socketserver.rst:464 msgid "" "A file object from which receives the request is read. Support the :class:" "`io.BufferedIOBase` readable interface." msgstr "" -#: ../../library/socketserver.rst:466 +#: ../../library/socketserver.rst:469 msgid "" "A file object to which the reply is written. Support the :class:`io." "BufferedIOBase` writable interface" msgstr "" -#: ../../library/socketserver.rst:470 +#: ../../library/socketserver.rst:473 msgid "" ":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable " "interface." msgstr "" -#: ../../library/socketserver.rst:476 +#: ../../library/socketserver.rst:479 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:479 +#: ../../library/socketserver.rst:482 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:592 +#: ../../library/socketserver.rst:484 ../../library/socketserver.rst:595 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:483 +#: ../../library/socketserver.rst:486 msgid "" "import socketserver\n" "\n" @@ -606,14 +609,14 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:517 +#: ../../library/socketserver.rst:520 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:520 +#: ../../library/socketserver.rst:523 msgid "" "class MyTCPHandler(socketserver.StreamRequestHandler):\n" "\n" @@ -629,7 +632,7 @@ msgid "" " self.wfile.write(self.data.upper())" msgstr "" -#: ../../library/socketserver.rst:533 +#: ../../library/socketserver.rst:536 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -641,11 +644,11 @@ msgid "" "the number of ``recv()`` calls on the server required to receive it." msgstr "" -#: ../../library/socketserver.rst:543 ../../library/socketserver.rst:616 +#: ../../library/socketserver.rst:546 ../../library/socketserver.rst:619 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:545 +#: ../../library/socketserver.rst:548 msgid "" "import socket\n" "import sys\n" @@ -667,15 +670,15 @@ msgid "" "print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:565 ../../library/socketserver.rst:691 +#: ../../library/socketserver.rst:568 ../../library/socketserver.rst:694 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:567 +#: ../../library/socketserver.rst:570 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:569 +#: ../../library/socketserver.rst:572 msgid "" "$ python TCPServer.py\n" "127.0.0.1 wrote:\n" @@ -689,11 +692,11 @@ msgstr "" "127.0.0.1 wrote:\n" "b'python is nice'" -#: ../../library/socketserver.rst:577 +#: ../../library/socketserver.rst:580 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:579 +#: ../../library/socketserver.rst:582 msgid "" "$ python TCPClient.py hello world with TCP\n" "Sent: hello world with TCP\n" @@ -709,11 +712,11 @@ msgstr "" "Sent: python is nice\n" "Received: PYTHON IS NICE" -#: ../../library/socketserver.rst:590 +#: ../../library/socketserver.rst:593 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:594 +#: ../../library/socketserver.rst:597 msgid "" "import socketserver\n" "\n" @@ -738,7 +741,7 @@ msgid "" " server.serve_forever()" msgstr "" -#: ../../library/socketserver.rst:618 +#: ../../library/socketserver.rst:621 msgid "" "import socket\n" "import sys\n" @@ -758,27 +761,27 @@ msgid "" "print(\"Received:\", received)" msgstr "" -#: ../../library/socketserver.rst:635 +#: ../../library/socketserver.rst:638 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:639 +#: ../../library/socketserver.rst:642 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:641 +#: ../../library/socketserver.rst:644 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:644 +#: ../../library/socketserver.rst:647 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:646 +#: ../../library/socketserver.rst:649 msgid "" "import socket\n" "import threading\n" @@ -826,7 +829,7 @@ msgid "" " server.shutdown()" msgstr "" -#: ../../library/socketserver.rst:693 +#: ../../library/socketserver.rst:696 msgid "" "$ python ThreadedTCPServer.py\n" "Server loop running in thread: Thread-1\n" @@ -840,7 +843,7 @@ msgstr "" "Received: Thread-3: Hello World 2\n" "Received: Thread-4: Hello World 3" -#: ../../library/socketserver.rst:702 +#: ../../library/socketserver.rst:705 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 9489413183..24f1f26228 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2523,10 +2523,11 @@ msgid "" msgstr "" #: ../../library/unittest.mock.rst:1985 +#, fuzzy msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " "using :func:`patch`. The problem is that when we import module b, which we " -"will have to do then it imports ``SomeClass`` from module a. If we use :func:" +"will have to do when it imports ``SomeClass`` from module a. If we use :func:" "`patch` to mock out ``a.SomeClass`` then it will have no effect on our test; " "module b already has a reference to the *real* ``SomeClass`` and it looks " "like our patching had no effect." diff --git a/reference/import.po b/reference/import.po index 7bf370ce28..4fd1b4730e 100644 --- a/reference/import.po +++ b/reference/import.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -181,11 +181,11 @@ msgid "" "__init__.py`` respectively." msgstr "" -#: ../../reference/import.rst:127 +#: ../../reference/import.rst:129 msgid "Namespace packages" msgstr "" -#: ../../reference/import.rst:133 +#: ../../reference/import.rst:135 msgid "" "A namespace package is a composite of various :term:`portions <portion>`, " "where each portion contributes a subpackage to the parent package. Portions " @@ -196,7 +196,7 @@ msgid "" "concrete representation." msgstr "" -#: ../../reference/import.rst:141 +#: ../../reference/import.rst:143 msgid "" "Namespace packages do not use an ordinary list for their ``__path__`` " "attribute. They instead use a custom iterable type which will automatically " @@ -205,7 +205,7 @@ msgid "" "top level package) changes." msgstr "" -#: ../../reference/import.rst:147 +#: ../../reference/import.rst:149 msgid "" "With namespace packages, there is no ``parent/__init__.py`` file. In fact, " "there may be multiple ``parent`` directories found during import search, " @@ -215,15 +215,15 @@ msgid "" "or one of its subpackages is imported." msgstr "" -#: ../../reference/import.rst:154 +#: ../../reference/import.rst:156 msgid "See also :pep:`420` for the namespace package specification." msgstr "" -#: ../../reference/import.rst:158 +#: ../../reference/import.rst:160 msgid "Searching" msgstr "" -#: ../../reference/import.rst:160 +#: ../../reference/import.rst:162 msgid "" "To begin the search, Python needs the :term:`fully qualified <qualified " "name>` name of the module (or package, but for the purposes of this " @@ -233,7 +233,7 @@ msgid "" "functions." msgstr "" -#: ../../reference/import.rst:166 +#: ../../reference/import.rst:168 msgid "" "This name will be used in various phases of the import search, and it may be " "the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python " @@ -242,11 +242,11 @@ msgid "" "is raised." msgstr "" -#: ../../reference/import.rst:173 +#: ../../reference/import.rst:175 msgid "The module cache" msgstr "" -#: ../../reference/import.rst:178 +#: ../../reference/import.rst:180 msgid "" "The first place checked during import search is :data:`sys.modules`. This " "mapping serves as a cache of all modules that have been previously imported, " @@ -256,7 +256,7 @@ msgid "" "module object." msgstr "" -#: ../../reference/import.rst:185 +#: ../../reference/import.rst:187 msgid "" "During import, the module name is looked up in :data:`sys.modules` and if " "present, the associated value is the module satisfying the import, and the " @@ -265,7 +265,7 @@ msgid "" "continue searching for the module." msgstr "" -#: ../../reference/import.rst:191 +#: ../../reference/import.rst:193 msgid "" ":data:`sys.modules` is writable. Deleting a key may not destroy the " "associated module (as other modules may hold references to it), but it will " @@ -275,7 +275,7 @@ msgid "" "`ModuleNotFoundError`." msgstr "" -#: ../../reference/import.rst:198 +#: ../../reference/import.rst:200 msgid "" "Beware though, as if you keep a reference to the module object, invalidate " "its cache entry in :data:`sys.modules`, and then re-import the named module, " @@ -284,11 +284,11 @@ msgid "" "module contents by rerunning the module's code." msgstr "" -#: ../../reference/import.rst:208 +#: ../../reference/import.rst:210 msgid "Finders and loaders" msgstr "" -#: ../../reference/import.rst:215 +#: ../../reference/import.rst:217 msgid "" "If the named module is not found in :data:`sys.modules`, then Python's " "import protocol is invoked to find and load the module. This protocol " @@ -300,7 +300,7 @@ msgid "" "module." msgstr "" -#: ../../reference/import.rst:223 +#: ../../reference/import.rst:225 msgid "" "Python includes a number of default finders and importers. The first one " "knows how to locate built-in modules, and the second knows how to locate " @@ -310,13 +310,13 @@ msgid "" "locatable resource, such as those identified by URLs." msgstr "" -#: ../../reference/import.rst:230 +#: ../../reference/import.rst:232 msgid "" "The import machinery is extensible, so new finders can be added to extend " "the range and scope of module searching." msgstr "" -#: ../../reference/import.rst:233 +#: ../../reference/import.rst:235 msgid "" "Finders do not actually load modules. If they can find the named module, " "they return a :dfn:`module spec`, an encapsulation of the module's import-" @@ -324,32 +324,32 @@ msgid "" "module." msgstr "" -#: ../../reference/import.rst:237 +#: ../../reference/import.rst:239 msgid "" "The following sections describe the protocol for finders and loaders in more " "detail, including how you can create and register new ones to extend the " "import machinery." msgstr "" -#: ../../reference/import.rst:241 +#: ../../reference/import.rst:243 msgid "" "In previous versions of Python, finders returned :term:`loaders <loader>` " "directly, whereas now they return module specs which *contain* loaders. " "Loaders are still used during import but have fewer responsibilities." msgstr "" -#: ../../reference/import.rst:247 +#: ../../reference/import.rst:249 msgid "Import hooks" msgstr "" -#: ../../reference/import.rst:257 +#: ../../reference/import.rst:259 msgid "" "The import machinery is designed to be extensible; the primary mechanism for " "this are the *import hooks*. There are two types of import hooks: *meta " "hooks* and *import path hooks*." msgstr "" -#: ../../reference/import.rst:261 +#: ../../reference/import.rst:263 msgid "" "Meta hooks are called at the start of import processing, before any other " "import processing has occurred, other than :data:`sys.modules` cache look " @@ -358,7 +358,7 @@ msgid "" "finder objects to :data:`sys.meta_path`, as described below." msgstr "" -#: ../../reference/import.rst:267 +#: ../../reference/import.rst:269 msgid "" "Import path hooks are called as part of :data:`sys.path` (or ``package." "__path__``) processing, at the point where their associated path item is " @@ -366,11 +366,11 @@ msgid "" "data:`sys.path_hooks` as described below." msgstr "" -#: ../../reference/import.rst:274 +#: ../../reference/import.rst:276 msgid "The meta path" msgstr "" -#: ../../reference/import.rst:280 +#: ../../reference/import.rst:282 msgid "" "When the named module is not found in :data:`sys.modules`, Python next " "searches :data:`sys.meta_path`, which contains a list of meta path finder " @@ -382,7 +382,7 @@ msgid "" "named module or not." msgstr "" -#: ../../reference/import.rst:289 +#: ../../reference/import.rst:291 msgid "" "If the meta path finder knows how to handle the named module, it returns a " "spec object. If it cannot handle the named module, it returns ``None``. " @@ -391,7 +391,7 @@ msgid "" "exceptions raised are simply propagated up, aborting the import process." msgstr "" -#: ../../reference/import.rst:295 +#: ../../reference/import.rst:297 msgid "" "The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path " "finders is called with two or three arguments. The first is the fully " @@ -405,7 +405,7 @@ msgid "" "system passes in a target module only during reload." msgstr "" -#: ../../reference/import.rst:306 +#: ../../reference/import.rst:308 msgid "" "The meta path may be traversed multiple times for a single import request. " "For example, assuming none of the modules involved has already been cached, " @@ -417,14 +417,14 @@ msgid "" "will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``." msgstr "" -#: ../../reference/import.rst:316 +#: ../../reference/import.rst:318 msgid "" "Some meta path finders only support top level imports. These importers will " "always return ``None`` when anything other than ``None`` is passed as the " "second argument." msgstr "" -#: ../../reference/import.rst:320 +#: ../../reference/import.rst:322 msgid "" "Python's default :data:`sys.meta_path` has three meta path finders, one that " "knows how to import built-in modules, one that knows how to import frozen " @@ -432,7 +432,7 @@ msgid "" "path` (i.e. the :term:`path based finder`)." msgstr "" -#: ../../reference/import.rst:325 +#: ../../reference/import.rst:327 msgid "" "The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path " "finders replaced :meth:`!find_module`, which is now deprecated. While it " @@ -441,30 +441,30 @@ msgid "" "find_spec`." msgstr "" -#: ../../reference/import.rst:332 +#: ../../reference/import.rst:334 msgid "" "Use of :meth:`!find_module` by the import system now raises :exc:" "`ImportWarning`." msgstr "" -#: ../../reference/import.rst:336 +#: ../../reference/import.rst:338 msgid "" ":meth:`!find_module` has been removed. Use :meth:`~importlib.abc." "MetaPathFinder.find_spec` instead." msgstr "" -#: ../../reference/import.rst:342 +#: ../../reference/import.rst:344 msgid "Loading" msgstr "" -#: ../../reference/import.rst:344 +#: ../../reference/import.rst:346 msgid "" "If and when a module spec is found, the import machinery will use it (and " "the loader it contains) when loading the module. Here is an approximation " "of what happens during the loading portion of import::" msgstr "" -#: ../../reference/import.rst:348 +#: ../../reference/import.rst:350 msgid "" "module = None\n" "if spec.loader is not None and hasattr(spec.loader, 'create_module'):\n" @@ -496,17 +496,17 @@ msgid "" "return sys.modules[spec.name]" msgstr "" -#: ../../reference/import.rst:377 +#: ../../reference/import.rst:379 msgid "Note the following details:" msgstr "" -#: ../../reference/import.rst:379 +#: ../../reference/import.rst:381 msgid "" "If there is an existing module object with the given name in :data:`sys." "modules`, import will have already returned it." msgstr "" -#: ../../reference/import.rst:382 +#: ../../reference/import.rst:384 msgid "" "The module will exist in :data:`sys.modules` before the loader executes the " "module code. This is crucial because the module code may (directly or " @@ -515,7 +515,7 @@ msgid "" "best." msgstr "" -#: ../../reference/import.rst:388 +#: ../../reference/import.rst:390 msgid "" "If loading fails, the failing module -- and only the failing module -- gets " "removed from :data:`sys.modules`. Any module already in the :data:`sys." @@ -524,7 +524,7 @@ msgid "" "the failing module is left in :data:`sys.modules`." msgstr "" -#: ../../reference/import.rst:394 +#: ../../reference/import.rst:396 msgid "" "After the module is created but before execution, the import machinery sets " "the import-related module attributes (\"_init_module_attrs\" in the pseudo-" @@ -532,31 +532,31 @@ msgid "" "attrs>`." msgstr "" -#: ../../reference/import.rst:399 +#: ../../reference/import.rst:401 msgid "" "Module execution is the key moment of loading in which the module's " "namespace gets populated. Execution is entirely delegated to the loader, " "which gets to decide what gets populated and how." msgstr "" -#: ../../reference/import.rst:403 +#: ../../reference/import.rst:405 msgid "" "The module created during loading and passed to exec_module() may not be the " "one returned at the end of import [#fnlo]_." msgstr "" -#: ../../reference/import.rst:406 +#: ../../reference/import.rst:408 msgid "" "The import system has taken over the boilerplate responsibilities of " "loaders. These were previously performed by the :meth:`importlib.abc.Loader." "load_module` method." msgstr "" -#: ../../reference/import.rst:412 +#: ../../reference/import.rst:414 msgid "Loaders" msgstr "" -#: ../../reference/import.rst:414 +#: ../../reference/import.rst:416 msgid "" "Module loaders provide the critical function of loading: module execution. " "The import machinery calls the :meth:`importlib.abc.Loader.exec_module` " @@ -564,32 +564,32 @@ msgid "" "returned from :meth:`~importlib.abc.Loader.exec_module` is ignored." msgstr "" -#: ../../reference/import.rst:419 +#: ../../reference/import.rst:421 msgid "Loaders must satisfy the following requirements:" msgstr "" -#: ../../reference/import.rst:421 +#: ../../reference/import.rst:423 msgid "" "If the module is a Python module (as opposed to a built-in module or a " "dynamically loaded extension), the loader should execute the module's code " "in the module's global name space (``module.__dict__``)." msgstr "" -#: ../../reference/import.rst:425 +#: ../../reference/import.rst:427 msgid "" "If the loader cannot execute the module, it should raise an :exc:" "`ImportError`, although any other exception raised during :meth:`~importlib." "abc.Loader.exec_module` will be propagated." msgstr "" -#: ../../reference/import.rst:429 +#: ../../reference/import.rst:431 msgid "" "In many cases, the finder and loader can be the same object; in such cases " "the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return " "a spec with the loader set to ``self``." msgstr "" -#: ../../reference/import.rst:433 +#: ../../reference/import.rst:435 msgid "" "Module loaders may opt in to creating the module object during loading by " "implementing a :meth:`~importlib.abc.Loader.create_module` method. It takes " @@ -599,18 +599,18 @@ msgid "" "will create the new module itself." msgstr "" -#: ../../reference/import.rst:440 +#: ../../reference/import.rst:442 msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders." msgstr "" -#: ../../reference/import.rst:443 +#: ../../reference/import.rst:445 msgid "" "The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:" "`~importlib.abc.Loader.exec_module` and the import machinery assumed all the " "boilerplate responsibilities of loading." msgstr "" -#: ../../reference/import.rst:448 +#: ../../reference/import.rst:450 msgid "" "For compatibility with existing loaders, the import machinery will use the " "``load_module()`` method of loaders if it exists and the loader does not " @@ -618,14 +618,14 @@ msgid "" "deprecated and loaders should implement ``exec_module()`` instead." msgstr "" -#: ../../reference/import.rst:453 +#: ../../reference/import.rst:455 msgid "" "The ``load_module()`` method must implement all the boilerplate loading " "functionality described above in addition to executing the module. All the " "same constraints apply, with some additional clarification:" msgstr "" -#: ../../reference/import.rst:457 +#: ../../reference/import.rst:459 msgid "" "If there is an existing module object with the given name in :data:`sys." "modules`, the loader must use that existing module. (Otherwise, :func:" @@ -634,40 +634,40 @@ msgid "" "add it to :data:`sys.modules`." msgstr "" -#: ../../reference/import.rst:463 +#: ../../reference/import.rst:465 msgid "" "The module *must* exist in :data:`sys.modules` before the loader executes " "the module code, to prevent unbounded recursion or multiple loading." msgstr "" -#: ../../reference/import.rst:467 +#: ../../reference/import.rst:469 msgid "" "If loading fails, the loader must remove any modules it has inserted into :" "data:`sys.modules`, but it must remove **only** the failing module(s), and " "only if the loader itself has loaded the module(s) explicitly." msgstr "" -#: ../../reference/import.rst:472 +#: ../../reference/import.rst:474 msgid "" "A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -#: ../../reference/import.rst:476 +#: ../../reference/import.rst:478 msgid "" "An :exc:`ImportError` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -#: ../../reference/import.rst:480 +#: ../../reference/import.rst:482 msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:484 +#: ../../reference/import.rst:486 msgid "Submodules" msgstr "子模組" -#: ../../reference/import.rst:486 +#: ../../reference/import.rst:488 msgid "" "When a submodule is loaded using any mechanism (e.g. ``importlib`` APIs, the " "``import`` or ``import-from`` statements, or built-in ``__import__()``) a " @@ -677,7 +677,7 @@ msgid "" "submodule. Let's say you have the following directory structure::" msgstr "" -#: ../../reference/import.rst:493 +#: ../../reference/import.rst:495 msgid "" "spam/\n" " __init__.py\n" @@ -687,21 +687,21 @@ msgstr "" " __init__.py\n" " foo.py" -#: ../../reference/import.rst:497 +#: ../../reference/import.rst:499 msgid "and ``spam/__init__.py`` has the following line in it::" msgstr "" -#: ../../reference/import.rst:499 +#: ../../reference/import.rst:501 msgid "from .foo import Foo" msgstr "from .foo import Foo" -#: ../../reference/import.rst:501 +#: ../../reference/import.rst:503 msgid "" "then executing the following puts name bindings for ``foo`` and ``Foo`` in " "the ``spam`` module::" msgstr "" -#: ../../reference/import.rst:504 +#: ../../reference/import.rst:506 msgid "" ">>> import spam\n" ">>> spam.foo\n" @@ -715,7 +715,7 @@ msgstr "" ">>> spam.Foo\n" "<class 'spam.foo.Foo'>" -#: ../../reference/import.rst:510 +#: ../../reference/import.rst:512 msgid "" "Given Python's familiar name binding rules this might seem surprising, but " "it's actually a fundamental feature of the import system. The invariant " @@ -724,12 +724,12 @@ msgid "" "``foo`` attribute of the former." msgstr "" -#: ../../reference/import.rst:519 +#: ../../reference/import.rst:521 #, fuzzy msgid "Module specs" msgstr "module spec" -#: ../../reference/import.rst:521 +#: ../../reference/import.rst:523 msgid "" "The import machinery uses a variety of information about each module during " "import, especially before loading. Most of the information is common to all " @@ -737,7 +737,7 @@ msgid "" "related information on a per-module basis." msgstr "" -#: ../../reference/import.rst:526 +#: ../../reference/import.rst:528 msgid "" "Using a spec during import allows state to be transferred between import " "system components, e.g. between the finder that creates the module spec and " @@ -746,7 +746,7 @@ msgid "" "a module spec the loader had that responsibility." msgstr "" -#: ../../reference/import.rst:532 +#: ../../reference/import.rst:534 msgid "" "The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!" "__spec__` appropriately applies equally to :ref:`modules initialized during " @@ -754,17 +754,17 @@ msgid "" "attr:`!__spec__` is :ref:`set to None in some cases <main_spec>`." msgstr "" -#: ../../reference/import.rst:538 +#: ../../reference/import.rst:540 msgid "" "See :class:`~importlib.machinery.ModuleSpec` for details on the contents of " "the module spec." msgstr "" -#: ../../reference/import.rst:546 +#: ../../reference/import.rst:548 msgid "__path__ attributes on modules" msgstr "" -#: ../../reference/import.rst:548 +#: ../../reference/import.rst:550 msgid "" "The :attr:`~module.__path__` attribute should be a (possibly empty) :term:" "`sequence` of strings enumerating the locations where the package's " @@ -772,7 +772,7 @@ msgid "" "attribute, it is a :term:`package`." msgstr "" -#: ../../reference/import.rst:553 +#: ../../reference/import.rst:555 msgid "" "A package's :attr:`~module.__path__` attribute is used during imports of its " "subpackages. Within the import machinery, it functions much the same as :" @@ -781,14 +781,14 @@ msgid "" "than :data:`!sys.path`." msgstr "" -#: ../../reference/import.rst:560 +#: ../../reference/import.rst:562 msgid "" "The same rules used for :data:`sys.path` also apply to a package's :attr:`!" "__path__`. :data:`sys.path_hooks` (described below) are consulted when " "traversing a package's :attr:`!__path__`." msgstr "" -#: ../../reference/import.rst:564 +#: ../../reference/import.rst:566 msgid "" "A package's ``__init__.py`` file may set or alter the package's :attr:" "`~module.__path__` attribute, and this was typically the way namespace " @@ -798,18 +798,18 @@ msgid "" "automatically sets :attr:`!__path__` correctly for the namespace package." msgstr "" -#: ../../reference/import.rst:573 +#: ../../reference/import.rst:575 msgid "Module reprs" msgstr "" -#: ../../reference/import.rst:575 +#: ../../reference/import.rst:577 msgid "" "By default, all modules have a usable repr, however depending on the " "attributes set above, and in the module's spec, you can more explicitly " "control the repr of module objects." msgstr "" -#: ../../reference/import.rst:579 +#: ../../reference/import.rst:581 msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " @@ -819,45 +819,45 @@ msgid "" "for whatever information is missing." msgstr "" -#: ../../reference/import.rst:586 +#: ../../reference/import.rst:588 msgid "Here are the exact rules used:" msgstr "" -#: ../../reference/import.rst:588 +#: ../../reference/import.rst:590 msgid "" "If the module has a ``__spec__`` attribute, the information in the spec is " "used to generate the repr. The \"name\", \"loader\", \"origin\", and " "\"has_location\" attributes are consulted." msgstr "" -#: ../../reference/import.rst:592 +#: ../../reference/import.rst:594 msgid "" "If the module has a ``__file__`` attribute, this is used as part of the " "module's repr." msgstr "" -#: ../../reference/import.rst:595 +#: ../../reference/import.rst:597 msgid "" "If the module has no ``__file__`` but does have a ``__loader__`` that is not " "``None``, then the loader's repr is used as part of the module's repr." msgstr "" -#: ../../reference/import.rst:598 +#: ../../reference/import.rst:600 msgid "Otherwise, just use the module's ``__name__`` in the repr." msgstr "" -#: ../../reference/import.rst:600 +#: ../../reference/import.rst:602 msgid "" "Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was " "removed in Python 3.12 and is no longer called during the resolution of a " "module's repr." msgstr "" -#: ../../reference/import.rst:608 +#: ../../reference/import.rst:610 msgid "Cached bytecode invalidation" msgstr "" -#: ../../reference/import.rst:610 +#: ../../reference/import.rst:612 msgid "" "Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " @@ -867,7 +867,7 @@ msgid "" "source's metadata." msgstr "" -#: ../../reference/import.rst:617 +#: ../../reference/import.rst:619 msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " @@ -881,17 +881,17 @@ msgid "" "option:`--check-hash-based-pycs` flag." msgstr "" -#: ../../reference/import.rst:628 +#: ../../reference/import.rst:630 msgid "" "Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-" "based invalidation of bytecode caches." msgstr "" -#: ../../reference/import.rst:634 +#: ../../reference/import.rst:636 msgid "The Path Based Finder" msgstr "" -#: ../../reference/import.rst:639 +#: ../../reference/import.rst:641 msgid "" "As mentioned previously, Python comes with several default meta path " "finders. One of these, called the :term:`path based finder` (:class:" @@ -900,14 +900,14 @@ msgid "" "a location to search for modules." msgstr "" -#: ../../reference/import.rst:645 +#: ../../reference/import.rst:647 msgid "" "The path based finder itself doesn't know how to import anything. Instead, " "it traverses the individual path entries, associating each of them with a " "path entry finder that knows how to handle that particular kind of path." msgstr "" -#: ../../reference/import.rst:649 +#: ../../reference/import.rst:651 msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " @@ -918,14 +918,14 @@ msgid "" "from zipfiles." msgstr "" -#: ../../reference/import.rst:656 +#: ../../reference/import.rst:658 msgid "" "Path entries need not be limited to file system locations. They can refer " "to URLs, database queries, or any other location that can be specified as a " "string." msgstr "" -#: ../../reference/import.rst:660 +#: ../../reference/import.rst:662 msgid "" "The path based finder provides additional hooks and protocols so that you " "can extend and customize the types of searchable path entries. For example, " @@ -936,7 +936,7 @@ msgid "" "from the web." msgstr "" -#: ../../reference/import.rst:668 +#: ../../reference/import.rst:670 msgid "" "A word of warning: this section and the previous both use the term *finder*, " "distinguishing between them by using the terms :term:`meta path finder` and :" @@ -947,7 +947,7 @@ msgid "" "process, as keyed off the :data:`sys.meta_path` traversal." msgstr "" -#: ../../reference/import.rst:676 +#: ../../reference/import.rst:678 msgid "" "By contrast, path entry finders are in a sense an implementation detail of " "the path based finder, and in fact, if the path based finder were to be " @@ -955,11 +955,11 @@ msgid "" "would be invoked." msgstr "" -#: ../../reference/import.rst:683 +#: ../../reference/import.rst:685 msgid "Path entry finders" msgstr "" -#: ../../reference/import.rst:691 +#: ../../reference/import.rst:693 msgid "" "The :term:`path based finder` is responsible for finding and loading Python " "modules and packages whose location is specified with a string :term:`path " @@ -967,7 +967,7 @@ msgid "" "not be limited to this." msgstr "" -#: ../../reference/import.rst:696 +#: ../../reference/import.rst:698 msgid "" "As a meta path finder, the :term:`path based finder` implements the :meth:" "`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " @@ -975,7 +975,7 @@ msgid "" "modules are found and loaded from the :term:`import path`." msgstr "" -#: ../../reference/import.rst:701 +#: ../../reference/import.rst:703 msgid "" "Three variables are used by the :term:`path based finder`, :data:`sys." "path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " @@ -983,7 +983,7 @@ msgid "" "additional ways that the import machinery can be customized." msgstr "" -#: ../../reference/import.rst:706 +#: ../../reference/import.rst:708 msgid "" ":data:`sys.path` contains a list of strings providing search locations for " "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " @@ -995,7 +995,7 @@ msgid "" "other data types are ignored." msgstr "" -#: ../../reference/import.rst:715 +#: ../../reference/import.rst:717 msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " @@ -1007,7 +1007,7 @@ msgid "" "top level import and :data:`sys.path` is used." msgstr "" -#: ../../reference/import.rst:724 +#: ../../reference/import.rst:726 msgid "" "The path based finder iterates over every entry in the search path, and for " "each of these, looks for an appropriate :term:`path entry finder` (:class:" @@ -1023,7 +1023,7 @@ msgid "" "finder to perform the path entry search again." msgstr "" -#: ../../reference/import.rst:737 +#: ../../reference/import.rst:739 msgid "" "If the path entry is not present in the cache, the path based finder " "iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" @@ -1039,7 +1039,7 @@ msgid "" "decode the argument, it should raise :exc:`ImportError`." msgstr "" -#: ../../reference/import.rst:751 +#: ../../reference/import.rst:753 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " "being returned, then the path based finder's :meth:`~importlib.machinery." @@ -1049,7 +1049,7 @@ msgid "" "could not find the module." msgstr "" -#: ../../reference/import.rst:758 +#: ../../reference/import.rst:760 msgid "" "If a :term:`path entry finder` *is* returned by one of the :term:`path entry " "hook` callables on :data:`sys.path_hooks`, then the following protocol is " @@ -1057,7 +1057,7 @@ msgid "" "the module." msgstr "" -#: ../../reference/import.rst:763 +#: ../../reference/import.rst:765 msgid "" "The current working directory -- denoted by an empty string -- is handled " "slightly differently from other entries on :data:`sys.path`. First, if the " @@ -1069,18 +1069,18 @@ msgid "" "and not the empty string." msgstr "" -#: ../../reference/import.rst:773 +#: ../../reference/import.rst:775 msgid "Path entry finder protocol" msgstr "" -#: ../../reference/import.rst:775 +#: ../../reference/import.rst:777 msgid "" "In order to support imports of modules and initialized packages and also to " "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" -#: ../../reference/import.rst:779 +#: ../../reference/import.rst:781 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` takes two arguments: the " "fully qualified name of the module being imported, and the (optional) target " @@ -1088,21 +1088,21 @@ msgid "" "spec will always have \"loader\" set (with one exception)." msgstr "" -#: ../../reference/import.rst:784 +#: ../../reference/import.rst:786 msgid "" "To indicate to the import machinery that the spec represents a namespace :" "term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" -#: ../../reference/import.rst:788 +#: ../../reference/import.rst:790 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`!" "find_loader` and :meth:`!find_module`, both of which are now deprecated, but " "will be used if ``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:794 +#: ../../reference/import.rst:796 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1110,14 +1110,14 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:799 +#: ../../reference/import.rst:801 msgid "" ":meth:`!find_loader` takes one argument, the fully qualified name of the " "module being imported. ``find_loader()`` returns a 2-tuple where the first " "item is the loader and the second item is a namespace :term:`portion`." msgstr "" -#: ../../reference/import.rst:804 +#: ../../reference/import.rst:806 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1127,7 +1127,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:811 +#: ../../reference/import.rst:813 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1136,28 +1136,28 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:817 +#: ../../reference/import.rst:819 msgid "" "Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " "will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:822 +#: ../../reference/import.rst:824 msgid "``find_module()`` and ``find_loader()`` have been removed." msgstr "" -#: ../../reference/import.rst:827 +#: ../../reference/import.rst:829 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:829 +#: ../../reference/import.rst:831 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:833 +#: ../../reference/import.rst:835 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1166,7 +1166,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:839 +#: ../../reference/import.rst:841 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1176,11 +1176,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:849 +#: ../../reference/import.rst:851 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:851 +#: ../../reference/import.rst:853 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1188,7 +1188,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:856 +#: ../../reference/import.rst:858 msgid "" "package/\n" " __init__.py\n" @@ -1212,13 +1212,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:867 +#: ../../reference/import.rst:869 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:870 +#: ../../reference/import.rst:872 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1234,28 +1234,28 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:877 +#: ../../reference/import.rst:879 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:881 +#: ../../reference/import.rst:883 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:883 +#: ../../reference/import.rst:885 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:890 +#: ../../reference/import.rst:892 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:892 +#: ../../reference/import.rst:894 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere <programs>`, the ``__main__`` module is " @@ -1266,17 +1266,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:903 +#: ../../reference/import.rst:905 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:905 +#: ../../reference/import.rst:907 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:908 +#: ../../reference/import.rst:910 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1284,30 +1284,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:913 +#: ../../reference/import.rst:915 msgid "" "In :ref:`the remaining cases <using-on-interface-options>` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:917 +#: ../../reference/import.rst:919 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:918 +#: ../../reference/import.rst:920 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:919 +#: ../../reference/import.rst:921 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:920 +#: ../../reference/import.rst:922 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:922 +#: ../../reference/import.rst:924 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1315,7 +1315,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:927 +#: ../../reference/import.rst:929 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1324,11 +1324,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:935 +#: ../../reference/import.rst:937 msgid "References" msgstr "" -#: ../../reference/import.rst:937 +#: ../../reference/import.rst:939 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages <https://www.python.org/doc/essays/" @@ -1336,37 +1336,37 @@ msgid "" "since the writing of that document." msgstr "" -#: ../../reference/import.rst:942 +#: ../../reference/import.rst:944 msgid "" "The original specification for :data:`sys.meta_path` was :pep:`302`, with " "subsequent extension in :pep:`420`." msgstr "" -#: ../../reference/import.rst:945 +#: ../../reference/import.rst:947 msgid "" ":pep:`420` introduced :term:`namespace packages <namespace package>` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:949 +#: ../../reference/import.rst:951 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:952 +#: ../../reference/import.rst:954 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:956 +#: ../../reference/import.rst:958 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:958 +#: ../../reference/import.rst:960 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1375,15 +1375,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:965 +#: ../../reference/import.rst:967 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:966 +#: ../../reference/import.rst:968 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:970 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1397,7 +1397,7 @@ msgid "import machinery" msgstr "import machinery(引入機制)" #: ../../reference/import.rst:64 ../../reference/import.rst:95 -#: ../../reference/import.rst:129 +#: ../../reference/import.rst:131 msgid "package" msgstr "package(套件)" @@ -1405,83 +1405,83 @@ msgstr "package(套件)" msgid "regular" msgstr "regular(一般)" -#: ../../reference/import.rst:129 +#: ../../reference/import.rst:131 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/import.rst:129 +#: ../../reference/import.rst:131 msgid "portion" msgstr "portion(部分)" -#: ../../reference/import.rst:175 +#: ../../reference/import.rst:177 msgid "sys.modules" msgstr "sys.modules" -#: ../../reference/import.rst:210 ../../reference/import.rst:276 +#: ../../reference/import.rst:212 ../../reference/import.rst:278 msgid "finder" msgstr "finder(搜尋器)" -#: ../../reference/import.rst:210 +#: ../../reference/import.rst:212 msgid "loader" msgstr "loader(載入器)" -#: ../../reference/import.rst:210 +#: ../../reference/import.rst:212 msgid "module spec" msgstr "module spec" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "import hooks" msgstr "import hooks" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "meta hooks" msgstr "meta hooks" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "path hooks" msgstr "path hooks" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "hooks" msgstr "hooks" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "import" msgstr "import(引入)" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "meta" msgstr "meta" -#: ../../reference/import.rst:249 +#: ../../reference/import.rst:251 msgid "path" msgstr "path(路徑)" -#: ../../reference/import.rst:276 +#: ../../reference/import.rst:278 msgid "sys.meta_path" msgstr "sys.meta_path" -#: ../../reference/import.rst:276 +#: ../../reference/import.rst:278 msgid "find_spec" msgstr "find_spec" -#: ../../reference/import.rst:636 +#: ../../reference/import.rst:638 msgid "path based finder" msgstr "path based finder(基於路徑的搜尋器)" -#: ../../reference/import.rst:685 +#: ../../reference/import.rst:687 msgid "sys.path" msgstr "sys.path" -#: ../../reference/import.rst:685 +#: ../../reference/import.rst:687 msgid "sys.path_hooks" msgstr "sys.path_hooks" -#: ../../reference/import.rst:685 +#: ../../reference/import.rst:687 msgid "sys.path_importer_cache" msgstr "sys.path_importer_cache" -#: ../../reference/import.rst:685 +#: ../../reference/import.rst:687 msgid "PYTHONPATH" msgstr "PYTHONPATH" diff --git a/using/editors.po b/using/editors.po index d066d58ae3..4037b7a2aa 100644 --- a/using/editors.po +++ b/using/editors.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,9 +29,29 @@ msgid "" "checks." msgstr "" -#: ../../using/editors.rst:12 +#: ../../using/editors.rst:14 +msgid "IDLE --- Python editor and shell" +msgstr "" + +#: ../../using/editors.rst:16 +msgid "" +"IDLE is Python’s Integrated Development and Learning Environment and is " +"generally bundled with Python installs. If you are on Linux and do not have " +"IDLE installed see :ref:`Installing IDLE on Linux " +"<installing_idle_on_linux>`. For more information see the :ref:`IDLE docs " +"<idle>`." +msgstr "" + +#: ../../using/editors.rst:22 +#, fuzzy +msgid "Other Editors and IDEs" +msgstr "編輯器與 IDE" + +#: ../../using/editors.rst:24 msgid "" -"Please go to `Python Editors <https://wiki.python.org/moin/PythonEditors>`_ " -"and `Integrated Development Environments <https://wiki.python.org/moin/" -"IntegratedDevelopmentEnvironments>`_ for a comprehensive list." +"Python's community wiki has information submitted by the community on " +"Editors and IDEs. Please go to `Python Editors <https://wiki.python.org/moin/" +"PythonEditors>`_ and `Integrated Development Environments <https://wiki." +"python.org/moin/IntegratedDevelopmentEnvironments>`_ for a comprehensive " +"list." msgstr "" diff --git a/using/unix.po b/using/unix.po index e19752740c..9b8dcf6358 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-28 06:59+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,23 +89,68 @@ msgstr "https://slackbook.org/html/package-management-making-packages.html" msgid "for Slackware users" msgstr "對於 Slackware 用戶" -#: ../../using/unix.rst:40 +#: ../../using/unix.rst:41 +msgid "Installing IDLE" +msgstr "" + +#: ../../using/unix.rst:43 +msgid "In some cases, IDLE might not be included in your Python installation." +msgstr "" + +#: ../../using/unix.rst:45 +#, fuzzy +msgid "For Debian and Ubuntu users::" +msgstr "對於 Debian 用戶" + +#: ../../using/unix.rst:47 +msgid "" +"sudo apt update\n" +"sudo apt install idle" +msgstr "" + +#: ../../using/unix.rst:50 +msgid "For Fedora, RHEL, and CentOS users::" +msgstr "" + +#: ../../using/unix.rst:52 +#, fuzzy +msgid "sudo dnf install python3-idle" +msgstr "pkg install python3" + +#: ../../using/unix.rst:54 +msgid "For SUSE and OpenSUSE users::" +msgstr "" + +#: ../../using/unix.rst:56 +msgid "sudo zypper in python3-idle" +msgstr "" + +#: ../../using/unix.rst:58 +#, fuzzy +msgid "For Alpine Linux users::" +msgstr "對於 OpenSuse 用戶" + +#: ../../using/unix.rst:60 +msgid "sudo apk add python3-idle" +msgstr "" + +#: ../../using/unix.rst:65 msgid "On FreeBSD and OpenBSD" msgstr "在 FreeBSD 和 OpenBSD 上" -#: ../../using/unix.rst:42 +#: ../../using/unix.rst:67 msgid "FreeBSD users, to add the package use::" msgstr "FreeBSD 用戶應使用以下命令增加套件: ::" -#: ../../using/unix.rst:44 +#: ../../using/unix.rst:69 msgid "pkg install python3" msgstr "pkg install python3" -#: ../../using/unix.rst:46 +#: ../../using/unix.rst:71 msgid "OpenBSD users, to add the package use::" msgstr "OpenBSD 用戶應使用以下命令增加套件: ::" -#: ../../using/unix.rst:48 +#: ../../using/unix.rst:73 msgid "" "pkg_add -r python\n" "\n" @@ -117,11 +162,11 @@ msgstr "" "pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/<insert your " "architecture here>/python-<version>.tgz" -#: ../../using/unix.rst:52 +#: ../../using/unix.rst:77 msgid "For example i386 users get the 2.5.1 version of Python using::" msgstr "例如 i386 使用者要獲取 Python 2.5.1 的可用版本: ::" -#: ../../using/unix.rst:54 +#: ../../using/unix.rst:79 msgid "" "pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2." "tgz" @@ -129,11 +174,11 @@ msgstr "" "pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2." "tgz" -#: ../../using/unix.rst:60 +#: ../../using/unix.rst:85 msgid "Building Python" msgstr "建置 Python" -#: ../../using/unix.rst:62 +#: ../../using/unix.rst:87 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source <https://www.python.org/downloads/source/>`_. You can download " @@ -146,11 +191,11 @@ msgstr "" "(克隆) <https://devguide.python.org/setup/#getting-the-source-code>`_。(如" "果你想要貢獻修補程式碼,也會需要一份 clone。)" -#: ../../using/unix.rst:68 +#: ../../using/unix.rst:93 msgid "The build process consists of the usual commands::" msgstr "建置過程由幾個常用命令組成: ::" -#: ../../using/unix.rst:70 +#: ../../using/unix.rst:95 msgid "" "./configure\n" "make\n" @@ -160,7 +205,7 @@ msgstr "" "make\n" "make install" -#: ../../using/unix.rst:74 +#: ../../using/unix.rst:99 msgid "" ":ref:`Configuration options <configure-options>` and caveats for specific " "Unix platforms are extensively documented in the :source:`README.rst` file " @@ -170,7 +215,7 @@ msgstr "" "地記錄在 Python 原始碼樹 (source tree) 根目錄下的 :source:`README.rst` 檔案" "中。" -#: ../../using/unix.rst:80 +#: ../../using/unix.rst:105 msgid "" "``make install`` can overwrite or masquerade the :file:`python3` binary. " "``make altinstall`` is therefore recommended instead of ``make install`` " @@ -180,11 +225,11 @@ msgstr "" "``make altinstall`` 而不是 ``make install``,因為它只安裝 :file:" "`{exec_prefix}/bin/python{version}`。" -#: ../../using/unix.rst:86 +#: ../../using/unix.rst:111 msgid "Python-related paths and files" msgstr "與 Python 相關的路徑和檔案" -#: ../../using/unix.rst:88 +#: ../../using/unix.rst:113 msgid "" "These are subject to difference depending on local installation " "conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" @@ -194,28 +239,28 @@ msgstr "" "這取決於本地安裝慣例;:option:`prefix <--prefix>` 和 :option:`exec_prefix <--" "exec-prefix>` 相依於安裝方式,應被直譯來讓 GNU 軟體使用;它們也可能相同。" -#: ../../using/unix.rst:93 +#: ../../using/unix.rst:118 msgid "" "For example, on most Linux systems, the default for both is :file:`/usr`." msgstr "例如,在大多數 Linux 系統上,兩者的預設值皆是 :file:`/usr`。" -#: ../../using/unix.rst:96 +#: ../../using/unix.rst:121 msgid "File/directory" msgstr "檔案/目錄" -#: ../../using/unix.rst:96 +#: ../../using/unix.rst:121 msgid "Meaning" msgstr "含意" -#: ../../using/unix.rst:98 +#: ../../using/unix.rst:123 msgid ":file:`{exec_prefix}/bin/python3`" msgstr ":file:`{exec_prefix}/bin/python3`" -#: ../../using/unix.rst:98 +#: ../../using/unix.rst:123 msgid "Recommended location of the interpreter." msgstr "直譯器的推薦位置。" -#: ../../using/unix.rst:100 +#: ../../using/unix.rst:125 msgid "" ":file:`{prefix}/lib/python{version}`, :file:`{exec_prefix}/lib/" "python{version}`" @@ -223,12 +268,12 @@ msgstr "" ":file:`{prefix}/lib/python{version}`、:file:`{exec_prefix}/lib/" "python{version}`" -#: ../../using/unix.rst:100 +#: ../../using/unix.rst:125 msgid "" "Recommended locations of the directories containing the standard modules." msgstr "包含標準模組目錄的推薦位置。" -#: ../../using/unix.rst:103 +#: ../../using/unix.rst:128 msgid "" ":file:`{prefix}/include/python{version}`, :file:`{exec_prefix}/include/" "python{version}`" @@ -236,39 +281,39 @@ msgstr "" ":file:`{prefix}/include/python{version}`、:file:`{exec_prefix}/include/" "python{version}`" -#: ../../using/unix.rst:103 +#: ../../using/unix.rst:128 msgid "" "Recommended locations of the directories containing the include files needed " "for developing Python extensions and embedding the interpreter." msgstr "" "包含開發 Python 擴充套件和嵌入直譯器所需 include 檔案之目錄的推薦位置。" -#: ../../using/unix.rst:111 +#: ../../using/unix.rst:136 msgid "Miscellaneous" msgstr "雜項" -#: ../../using/unix.rst:113 +#: ../../using/unix.rst:138 msgid "" "To easily use Python scripts on Unix, you need to make them executable, e.g. " "with" msgstr "" "要在 Unix 上使用 Python 腳本,你需要讓他們是可執行的 (executable),例如用" -#: ../../using/unix.rst:116 +#: ../../using/unix.rst:141 msgid "$ chmod +x script" msgstr "$ chmod +x script" -#: ../../using/unix.rst:120 +#: ../../using/unix.rst:145 msgid "" "and put an appropriate Shebang line at the top of the script. A good choice " "is usually ::" msgstr "並在腳本的頂部放一個合適的 Shebang。以下通常是個好選擇: ::" -#: ../../using/unix.rst:123 +#: ../../using/unix.rst:148 msgid "#!/usr/bin/env python3" msgstr "#!/usr/bin/env python3" -#: ../../using/unix.rst:125 +#: ../../using/unix.rst:150 msgid "" "which searches for the Python interpreter in the whole :envvar:`PATH`. " "However, some Unices may not have the :program:`env` command, so you may " @@ -278,17 +323,17 @@ msgstr "" "program:`env` 命令,因此你可能需要將 ``/usr/bin/python3`` 寫死 (hardcode) 成" "直譯器路徑。" -#: ../../using/unix.rst:129 +#: ../../using/unix.rst:154 msgid "" "To use shell commands in your Python scripts, look at the :mod:`subprocess` " "module." msgstr "要在 Python 腳本中使用 shell 命令,請見 :mod:`subprocess` 模組。" -#: ../../using/unix.rst:134 +#: ../../using/unix.rst:159 msgid "Custom OpenSSL" msgstr "客製化 OpenSSL" -#: ../../using/unix.rst:136 +#: ../../using/unix.rst:161 msgid "" "To use your vendor's OpenSSL configuration and system trust store, locate " "the directory with ``openssl.cnf`` file or symlink in ``/etc``. On most " @@ -301,7 +346,7 @@ msgstr "" "(symlink)。在大多數發行版上,該檔案會是在 ``/etc/ssl`` 或者 ``/etc/pki/tls`` " "中。該目錄亦應包含一個 ``cert.pem`` 檔案和/或一個 ``certs`` 目錄。" -#: ../../using/unix.rst:142 +#: ../../using/unix.rst:167 msgid "" "$ find /etc/ -name openssl.cnf -printf \"%h\\n\"\n" "/etc/ssl" @@ -309,7 +354,7 @@ msgstr "" "$ find /etc/ -name openssl.cnf -printf \"%h\\n\"\n" "/etc/ssl" -#: ../../using/unix.rst:147 +#: ../../using/unix.rst:172 msgid "" "Download, build, and install OpenSSL. Make sure you use ``install_sw`` and " "not ``install``. The ``install_sw`` target does not override ``openssl.cnf``." @@ -317,7 +362,7 @@ msgstr "" "下載、建置並安裝 OpenSSL。請確保你使用 ``install_sw`` 而不是 ``install``。" "``install_sw`` 的目標不會覆蓋 ``openssl.cnf``。" -#: ../../using/unix.rst:151 +#: ../../using/unix.rst:176 msgid "" "$ curl -O https://www.openssl.org/source/openssl-VERSION.tar.gz\n" "$ tar xzf openssl-VERSION\n" @@ -343,7 +388,7 @@ msgstr "" "$ make install_sw\n" "$ popd" -#: ../../using/unix.rst:165 +#: ../../using/unix.rst:190 msgid "" "Build Python with custom OpenSSL (see the configure ``--with-openssl`` and " "``--with-openssl-rpath`` options)" @@ -351,7 +396,7 @@ msgstr "" "使用客製化 OpenSSL 建置 Python(參見配置 ``--with-openssl`` 和 ``--with-" "openssl-rpath`` 選項)" -#: ../../using/unix.rst:168 +#: ../../using/unix.rst:193 msgid "" "$ pushd python-3.x.x\n" "$ ./configure -C \\\n" @@ -369,7 +414,7 @@ msgstr "" "$ make -j8\n" "$ make altinstall" -#: ../../using/unix.rst:180 +#: ../../using/unix.rst:205 msgid "" "Patch releases of OpenSSL have a backwards compatible ABI. You don't need to " "recompile Python to update OpenSSL. It's sufficient to replace the custom " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 67eb9397d1..71d896e9f9 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1995,7 +1995,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2444,11 +2444,20 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:32 +#: ../../deprecations/pending-removal-in-future.rst:58 +msgid ":mod:`importlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "``load_module()`` method:請改用 ``exec_module()``。" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 #, fuzzy msgid ":class:`locale`:" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.15.rst:34 +#: ../../deprecations/pending-removal-in-3.15.rst:38 #, fuzzy msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " @@ -2462,12 +2471,12 @@ msgstr "" "func:`locale.setlocale`、:func:`locale.getencoding` 和 :func:`locale." "getlocale`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:46 #, fuzzy msgid ":mod:`pathlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #, fuzzy msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" @@ -2476,24 +2485,24 @@ msgstr "" ":mod:`pathlib`::meth:`pathlib.PurePath.is_reserved` 已被棄用並計劃在 Python " "3.15 中移除。請用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:52 #, fuzzy msgid ":mod:`platform`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:58 #, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:56 +#: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -2501,12 +2510,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../deprecations/pending-removal-in-3.15.rst:66 #, fuzzy msgid ":mod:`types`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:64 +#: ../../deprecations/pending-removal-in-3.15.rst:68 #, fuzzy msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " @@ -2519,7 +2528,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:77 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -2531,19 +2540,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:79 +#: ../../deprecations/pending-removal-in-3.15.rst:83 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:84 +#: ../../deprecations/pending-removal-in-3.15.rst:88 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.15.rst:86 +#: ../../deprecations/pending-removal-in-3.15.rst:90 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -2773,15 +2782,7 @@ msgstr "" msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:58 -msgid ":mod:`importlib`:" -msgstr ":mod:`importlib`:" - #: ../../deprecations/pending-removal-in-future.rst:60 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "``load_module()`` method:請改用 ``exec_module()``。" - -#: ../../deprecations/pending-removal-in-future.rst:61 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -2789,37 +2790,37 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:67 +#: ../../deprecations/pending-removal-in-future.rst:66 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:75 +#: ../../deprecations/pending-removal-in-future.rst:74 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -2827,7 +2828,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -2839,12 +2840,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:87 +#: ../../deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:89 +#: ../../deprecations/pending-removal-in-future.rst:88 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -2852,15 +2853,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:95 +#: ../../deprecations/pending-removal-in-future.rst:94 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -2868,58 +2869,58 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:98 +#: ../../deprecations/pending-removal-in-future.rst:97 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:101 +#: ../../deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:102 +#: ../../deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "" ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " "ignored." msgstr "" ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -2927,11 +2928,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -2939,7 +2940,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -2947,20 +2948,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:121 +#: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -2968,58 +2969,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:128 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -3029,13 +3030,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -3046,7 +3047,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:154 +#: ../../deprecations/pending-removal-in-future.rst:153 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index dc825be00b..f924143c7d 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-02-16 08:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2784,7 +2784,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1911 -#: ../../deprecations/pending-removal-in-3.15.rst:42 +#: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr "" @@ -2796,7 +2796,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1918 -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" msgstr "" @@ -2883,7 +2883,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1972 -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`typing`:" msgstr "" @@ -2925,7 +2925,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:2005 -#: ../../deprecations/pending-removal-in-3.15.rst:84 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid ":mod:`wave`:" msgstr "" @@ -3171,10 +3171,19 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:32 -msgid ":class:`locale`:" +#: ../../deprecations/pending-removal-in-future.rst:58 +msgid ":mod:`importlib`:" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 +msgid ":class:`locale`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -3183,24 +3192,24 @@ msgid "" "instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:44 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:50 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:58 msgid ":mod:`threading`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:56 +#: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -3208,11 +3217,11 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:62 +#: ../../deprecations/pending-removal-in-3.15.rst:66 msgid ":mod:`types`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:64 +#: ../../deprecations/pending-removal-in-3.15.rst:68 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -3220,7 +3229,7 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -3228,14 +3237,14 @@ msgid "" "functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:79 +#: ../../deprecations/pending-removal-in-3.15.rst:83 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:86 +#: ../../deprecations/pending-removal-in-3.15.rst:90 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3426,56 +3435,48 @@ msgstr "" msgid ":mod:`gettext`: Plural value must be an integer." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:58 -msgid ":mod:`importlib`:" -msgstr "" - #: ../../deprecations/pending-removal-in-future.rst:60 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:61 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib.metadata`:" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "``EntryPoints`` tuple interface." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:67 +#: ../../deprecations/pending-removal-in-future.rst:66 msgid "Implicit ``None`` on return values." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:75 +#: ../../deprecations/pending-removal-in-future.rst:74 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -3484,185 +3485,185 @@ msgid "" "underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:87 +#: ../../deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:89 +#: ../../deprecations/pending-removal-in-future.rst:88 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid ":mod:`ssl` options and protocols:" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:95 +#: ../../deprecations/pending-removal-in-future.rst:94 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:98 +#: ../../deprecations/pending-removal-in-future.rst:97 msgid "``ssl.OP_NO_SSL*`` options" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid "``ssl.OP_NO_TLS*`` options" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:101 +#: ../../deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLS``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:102 +#: ../../deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.SSLv3``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.TLSVersion.TLSv1``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "" ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " "ignored." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:121 +#: ../../deprecations/pending-removal-in-future.rst:120 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:128 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitattr()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splithost()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitnport()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splitpasswd()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splitport()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splitquery()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splittag()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splittype()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splituser()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitvalue()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``to_bytes()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " "Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -3670,7 +3671,7 @@ msgid "" "instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:154 +#: ../../deprecations/pending-removal-in-future.rst:153 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." From a788c67a2608c25faabb87aa5fe2b94eb61f092b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:40:48 +0000 Subject: [PATCH 14/14] sync with cpython 4c6318e2 --- c-api/arg.po | 4 +- c-api/dict.po | 11 +- c-api/function.po | 42 +- c-api/module.po | 4 +- c-api/slice.po | 10 +- c-api/unicode.po | 649 +++--- deprecations/index.po | 90 +- deprecations/pending-removal-in-3.15.po | 28 +- deprecations/pending-removal-in-future.po | 63 +- faq/general.po | 5 +- faq/programming.po | 5 +- glossary.po | 7 +- howto/enum.po | 12 +- howto/functional.po | 8 +- howto/ipaddress.po | 5 +- howto/logging-cookbook.po | 649 +++--- howto/regex.po | 30 +- howto/unicode.po | 8 +- howto/urllib2.po | 11 +- library/abc.po | 22 +- library/argparse.po | 4 +- library/asyncio-eventloop.po | 820 ++++---- library/asyncio-queue.po | 62 +- library/asyncio-stream.po | 196 +- library/asyncio-subprocess.po | 150 +- library/asyncio-sync.po | 172 +- library/asyncio-task.po | 390 ++-- library/collections.abc.po | 258 +-- library/collections.po | 223 ++- library/configparser.po | 4 +- library/constants.po | 33 +- library/contextlib.po | 130 +- library/ctypes.po | 68 +- library/dataclasses.po | 212 +- library/datetime.po | 22 +- library/dis.po | 784 ++++---- library/doctest.po | 6 +- library/email.errors.po | 115 +- library/email.parser.po | 5 +- library/ensurepip.po | 80 +- library/exceptions.po | 271 +-- library/filecmp.po | 7 +- library/functions.po | 7 +- library/idle.po | 236 ++- library/importlib.metadata.po | 219 +- library/importlib.po | 438 ++-- library/importlib.resources.abc.po | 58 +- library/logging.po | 504 ++--- library/numbers.po | 54 +- library/os.po | 2206 ++++++++++----------- library/profile.po | 313 +-- library/readline.po | 62 +- library/secrets.po | 11 +- library/selectors.po | 68 +- library/ssl.po | 7 +- library/statistics.po | 5 +- library/stdtypes.po | 1768 +++++++++-------- library/string.po | 5 +- library/sys.po | 8 +- library/traceback.po | 74 +- library/unittest.mock.po | 870 ++++---- library/unittest.po | 368 ++-- library/uuid.po | 87 +- library/wsgiref.po | 261 +-- library/xmlrpc.client.po | 20 +- reference/expressions.po | 826 ++++---- tutorial/introduction.po | 10 +- tutorial/modules.po | 8 +- using/configure.po | 301 +-- whatsnew/2.7.po | 4 +- whatsnew/3.12.po | 90 +- whatsnew/3.13.po | 82 +- whatsnew/3.4.po | 4 +- 73 files changed, 7520 insertions(+), 7129 deletions(-) diff --git a/c-api/arg.po b/c-api/arg.po index 565059f701..50eb5bcd97 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,7 +25,7 @@ msgstr "剖析引數與建置數值" #: ../../c-api/arg.rst:8 msgid "" -"These functions are useful when creating your own extensions functions and " +"These functions are useful when creating your own extension functions and " "methods. Additional information and examples are available in :ref:" "`extending-index`." msgstr "" diff --git a/c-api/dict.po b/c-api/dict.po index 5a9c30db1f..77e792841e 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -184,9 +184,8 @@ msgstr "" #: ../../c-api/dict.rst:159 msgid "" -"Similar than :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:" -"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:" +"`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." msgstr "" #: ../../c-api/dict.rst:168 @@ -239,8 +238,8 @@ msgstr "" #: ../../c-api/dict.rst:209 msgid "" -"This is similar to :meth:`dict.pop`, but without the default value and not " -"raising :exc:`KeyError` if the key missing." +"Similar to :meth:`dict.pop`, but without the default value and not raising :" +"exc:`KeyError` if the key missing." msgstr "" #: ../../c-api/dict.rst:217 diff --git a/c-api/function.po b/c-api/function.po index c9e9a6c79f..b197aa7c8a 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-11-12 15:45+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,18 +187,34 @@ msgid "" msgstr "" #: ../../c-api/function.rst:148 -msgid "" -"Enumeration of possible function watcher events: - " -"``PyFunction_EVENT_CREATE`` - ``PyFunction_EVENT_DESTROY`` - " -"``PyFunction_EVENT_MODIFY_CODE`` - ``PyFunction_EVENT_MODIFY_DEFAULTS`` - " -"``PyFunction_EVENT_MODIFY_KWDEFAULTS``" +msgid "Enumeration of possible function watcher events:" +msgstr "" + +#: ../../c-api/function.rst:150 +msgid "``PyFunction_EVENT_CREATE``" +msgstr "" + +#: ../../c-api/function.rst:151 +msgid "``PyFunction_EVENT_DESTROY``" +msgstr "" + +#: ../../c-api/function.rst:152 +msgid "``PyFunction_EVENT_MODIFY_CODE``" +msgstr "" + +#: ../../c-api/function.rst:153 +msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" +msgstr "" + +#: ../../c-api/function.rst:154 +msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" msgstr "" -#: ../../c-api/function.rst:160 +#: ../../c-api/function.rst:161 msgid "Type of a function watcher callback function." msgstr "" -#: ../../c-api/function.rst:162 +#: ../../c-api/function.rst:163 msgid "" "If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " "then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:" @@ -206,13 +222,13 @@ msgid "" "for the attribute that is being modified." msgstr "" -#: ../../c-api/function.rst:167 +#: ../../c-api/function.rst:168 msgid "" "The callback may inspect but must not modify *func*; doing so could have " "unpredictable effects, including infinite recursion." msgstr "" -#: ../../c-api/function.rst:170 +#: ../../c-api/function.rst:171 msgid "" "If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " "after `func` has been fully initialized. Otherwise, the callback is invoked " @@ -224,7 +240,7 @@ msgid "" "semantics of the Python code being executed." msgstr "" -#: ../../c-api/function.rst:179 +#: ../../c-api/function.rst:180 msgid "" "If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the " "callback to the about-to-be-destroyed function will resurrect it, preventing " @@ -232,14 +248,14 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/function.rst:184 +#: ../../c-api/function.rst:185 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/function.rst:188 +#: ../../c-api/function.rst:189 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " diff --git a/c-api/module.po b/c-api/module.po index da4559e834..92ccf53755 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -468,7 +468,7 @@ msgstr "" #: ../../c-api/module.rst:417 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " -"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." msgstr "" #: ../../c-api/module.rst:430 diff --git a/c-api/slice.po b/c-api/slice.po index a2b3dbc7a7..67f1bcdff8 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,10 +160,16 @@ msgstr "" #: ../../c-api/slice.rst:123 msgid "" +"The type of Python :const:`Ellipsis` object. Same as :class:`types." +"EllipsisType` in the Python layer." +msgstr "" + +#: ../../c-api/slice.rst:129 +msgid "" "The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" "`Py_None`, it is an :term:`immortal` singleton object." msgstr "" -#: ../../c-api/slice.rst:126 +#: ../../c-api/slice.rst:132 msgid ":c:data:`Py_Ellipsis` is immortal." msgstr ":c:data:`Py_Ellipsis` 為不滅的 (immortal)。" diff --git a/c-api/unicode.po b/c-api/unicode.po index f67e7fc848..27604168d2 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,66 +256,61 @@ msgstr "" #: ../../c-api/unicode.rst:259 msgid "" -"Return ``1`` or ``0`` depending on whether *ch* is a printable character. " -"Nonprintable characters are those characters defined in the Unicode " -"character database as \"Other\" or \"Separator\", excepting the ASCII space " -"(0x20) which is considered printable. (Note that printable characters in " -"this context are those which should not be escaped when :func:`repr` is " -"invoked on a string. It has no bearing on the handling of strings written " -"to :data:`sys.stdout` or :data:`sys.stderr`.)" +"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in " +"the sense of :meth:`str.isprintable`." msgstr "" -#: ../../c-api/unicode.rst:268 +#: ../../c-api/unicode.rst:263 msgid "These APIs can be used for fast direct character conversions:" msgstr "" -#: ../../c-api/unicode.rst:273 +#: ../../c-api/unicode.rst:268 msgid "Return the character *ch* converted to lower case." msgstr "" -#: ../../c-api/unicode.rst:278 +#: ../../c-api/unicode.rst:273 msgid "Return the character *ch* converted to upper case." msgstr "" -#: ../../c-api/unicode.rst:283 +#: ../../c-api/unicode.rst:278 msgid "Return the character *ch* converted to title case." msgstr "" -#: ../../c-api/unicode.rst:288 +#: ../../c-api/unicode.rst:283 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " "``-1`` if this is not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:294 +#: ../../c-api/unicode.rst:289 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " "if this is not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:300 +#: ../../c-api/unicode.rst:295 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " "not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:304 +#: ../../c-api/unicode.rst:299 msgid "These APIs can be used to work with surrogates:" msgstr "" -#: ../../c-api/unicode.rst:308 +#: ../../c-api/unicode.rst:303 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:312 +#: ../../c-api/unicode.rst:307 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" -#: ../../c-api/unicode.rst:316 +#: ../../c-api/unicode.rst:311 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:320 +#: ../../c-api/unicode.rst:315 msgid "" "Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " "*high* and *low* are respectively the leading and trailing surrogates in a " @@ -323,34 +318,34 @@ msgid "" "be in the range [0xDC00; 0xDFFF]." msgstr "" -#: ../../c-api/unicode.rst:327 +#: ../../c-api/unicode.rst:322 msgid "Creating and accessing Unicode strings" msgstr "" -#: ../../c-api/unicode.rst:329 +#: ../../c-api/unicode.rst:324 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" msgstr "" -#: ../../c-api/unicode.rst:334 +#: ../../c-api/unicode.rst:329 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " "to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" -#: ../../c-api/unicode.rst:338 +#: ../../c-api/unicode.rst:333 msgid "" "This is the recommended way to allocate a new Unicode object. Objects " "created using this function are not resizable." msgstr "" -#: ../../c-api/unicode.rst:341 +#: ../../c-api/unicode.rst:336 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:349 +#: ../../c-api/unicode.rst:344 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -358,7 +353,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: ../../c-api/unicode.rst:354 +#: ../../c-api/unicode.rst:349 msgid "" "If necessary, the input *buffer* is copied and transformed into the " "canonical representation. For example, if the *buffer* is a UCS4 string (:c:" @@ -366,7 +361,7 @@ msgid "" "range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" -#: ../../c-api/unicode.rst:365 +#: ../../c-api/unicode.rst:360 msgid "" "Create a Unicode object from the char buffer *str*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " @@ -374,29 +369,29 @@ msgid "" "data is not allowed." msgstr "" -#: ../../c-api/unicode.rst:371 +#: ../../c-api/unicode.rst:366 msgid "This function raises :exc:`SystemError` when:" msgstr "" -#: ../../c-api/unicode.rst:373 +#: ../../c-api/unicode.rst:368 msgid "*size* < 0," msgstr "" -#: ../../c-api/unicode.rst:374 +#: ../../c-api/unicode.rst:369 msgid "*str* is ``NULL`` and *size* > 0" msgstr "" -#: ../../c-api/unicode.rst:376 +#: ../../c-api/unicode.rst:371 msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." msgstr "" -#: ../../c-api/unicode.rst:382 +#: ../../c-api/unicode.rst:377 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer " "*str*." msgstr "" -#: ../../c-api/unicode.rst:388 +#: ../../c-api/unicode.rst:383 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " @@ -405,23 +400,23 @@ msgid "" "*format* ASCII-encoded string." msgstr "" -#: ../../c-api/unicode.rst:394 +#: ../../c-api/unicode.rst:389 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../c-api/unicode.rst:397 +#: ../../c-api/unicode.rst:392 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../c-api/unicode.rst:399 +#: ../../c-api/unicode.rst:394 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../c-api/unicode.rst:402 +#: ../../c-api/unicode.rst:397 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is given in the next argument, which must be of type :c:expr:" @@ -429,7 +424,7 @@ msgid "" "optional precision." msgstr "" -#: ../../c-api/unicode.rst:407 +#: ../../c-api/unicode.rst:402 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " "specified as ``'*'`` (an asterisk), the actual precision is given in the " @@ -437,317 +432,317 @@ msgid "" "comes after the precision." msgstr "" -#: ../../c-api/unicode.rst:412 +#: ../../c-api/unicode.rst:407 msgid "Length modifier (optional)." msgstr "" -#: ../../c-api/unicode.rst:414 +#: ../../c-api/unicode.rst:409 msgid "Conversion type." msgstr "" -#: ../../c-api/unicode.rst:416 +#: ../../c-api/unicode.rst:411 msgid "The conversion flag characters are:" msgstr "" -#: ../../c-api/unicode.rst:421 +#: ../../c-api/unicode.rst:416 msgid "Flag" msgstr "旗標" -#: ../../c-api/unicode.rst:421 +#: ../../c-api/unicode.rst:416 msgid "Meaning" msgstr "含義" -#: ../../c-api/unicode.rst:423 +#: ../../c-api/unicode.rst:418 msgid "``0``" msgstr "``0``" -#: ../../c-api/unicode.rst:423 +#: ../../c-api/unicode.rst:418 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../c-api/unicode.rst:425 +#: ../../c-api/unicode.rst:420 msgid "``-``" msgstr "``-``" -#: ../../c-api/unicode.rst:425 +#: ../../c-api/unicode.rst:420 msgid "" "The converted value is left adjusted (overrides the ``0`` flag if both are " "given)." msgstr "" -#: ../../c-api/unicode.rst:429 +#: ../../c-api/unicode.rst:424 msgid "" "The length modifiers for following integer conversions (``d``, ``i``, ``o``, " "``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " "default):" msgstr "" -#: ../../c-api/unicode.rst:436 +#: ../../c-api/unicode.rst:431 msgid "Modifier" msgstr "" -#: ../../c-api/unicode.rst:436 +#: ../../c-api/unicode.rst:431 msgid "Types" msgstr "" -#: ../../c-api/unicode.rst:438 +#: ../../c-api/unicode.rst:433 msgid "``l``" msgstr "``l``" -#: ../../c-api/unicode.rst:438 +#: ../../c-api/unicode.rst:433 msgid ":c:expr:`long` or :c:expr:`unsigned long`" msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`" -#: ../../c-api/unicode.rst:440 +#: ../../c-api/unicode.rst:435 msgid "``ll``" msgstr "``ll``" -#: ../../c-api/unicode.rst:440 +#: ../../c-api/unicode.rst:435 msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`" -#: ../../c-api/unicode.rst:442 +#: ../../c-api/unicode.rst:437 msgid "``j``" msgstr "``j``" -#: ../../c-api/unicode.rst:442 +#: ../../c-api/unicode.rst:437 msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:439 msgid "``z``" msgstr "``z``" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:439 msgid ":c:type:`size_t` or :c:type:`ssize_t`" msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`" -#: ../../c-api/unicode.rst:446 +#: ../../c-api/unicode.rst:441 msgid "``t``" msgstr "``t``" -#: ../../c-api/unicode.rst:446 +#: ../../c-api/unicode.rst:441 msgid ":c:type:`ptrdiff_t`" msgstr ":c:type:`ptrdiff_t`" -#: ../../c-api/unicode.rst:449 +#: ../../c-api/unicode.rst:444 msgid "" "The length modifier ``l`` for following conversions ``s`` or ``V`` specify " "that the type of the argument is :c:expr:`const wchar_t*`." msgstr "" -#: ../../c-api/unicode.rst:452 +#: ../../c-api/unicode.rst:447 msgid "The conversion specifiers are:" msgstr "" -#: ../../c-api/unicode.rst:458 +#: ../../c-api/unicode.rst:453 msgid "Conversion Specifier" msgstr "" -#: ../../c-api/unicode.rst:459 +#: ../../c-api/unicode.rst:454 msgid "Type" msgstr "" -#: ../../c-api/unicode.rst:460 +#: ../../c-api/unicode.rst:455 msgid "Comment" msgstr "" -#: ../../c-api/unicode.rst:462 +#: ../../c-api/unicode.rst:457 msgid "``%``" msgstr "``%``" -#: ../../c-api/unicode.rst:463 +#: ../../c-api/unicode.rst:458 msgid "*n/a*" msgstr "*n/a*" -#: ../../c-api/unicode.rst:464 +#: ../../c-api/unicode.rst:459 msgid "The literal ``%`` character." msgstr "" -#: ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:461 msgid "``d``, ``i``" msgstr "``d``, ``i``" -#: ../../c-api/unicode.rst:467 ../../c-api/unicode.rst:471 -#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:479 -#: ../../c-api/unicode.rst:483 +#: ../../c-api/unicode.rst:462 ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:470 ../../c-api/unicode.rst:474 +#: ../../c-api/unicode.rst:478 msgid "Specified by the length modifier" msgstr "" -#: ../../c-api/unicode.rst:468 +#: ../../c-api/unicode.rst:463 msgid "The decimal representation of a signed C integer." msgstr "" -#: ../../c-api/unicode.rst:470 +#: ../../c-api/unicode.rst:465 msgid "``u``" msgstr "``u``" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:467 msgid "The decimal representation of an unsigned C integer." msgstr "" -#: ../../c-api/unicode.rst:474 +#: ../../c-api/unicode.rst:469 msgid "``o``" msgstr "``o``" -#: ../../c-api/unicode.rst:476 +#: ../../c-api/unicode.rst:471 msgid "The octal representation of an unsigned C integer." msgstr "" -#: ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:473 msgid "``x``" msgstr "``x``" -#: ../../c-api/unicode.rst:480 +#: ../../c-api/unicode.rst:475 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." msgstr "" -#: ../../c-api/unicode.rst:482 +#: ../../c-api/unicode.rst:477 msgid "``X``" msgstr "``X``" -#: ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:479 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." msgstr "" -#: ../../c-api/unicode.rst:486 +#: ../../c-api/unicode.rst:481 msgid "``c``" msgstr "``c``" -#: ../../c-api/unicode.rst:487 +#: ../../c-api/unicode.rst:482 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/unicode.rst:488 +#: ../../c-api/unicode.rst:483 msgid "A single character." msgstr "" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:485 msgid "``s``" msgstr "``s``" -#: ../../c-api/unicode.rst:491 +#: ../../c-api/unicode.rst:486 msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:492 +#: ../../c-api/unicode.rst:487 msgid "A null-terminated C character array." msgstr "" -#: ../../c-api/unicode.rst:494 +#: ../../c-api/unicode.rst:489 msgid "``p``" msgstr "``p``" -#: ../../c-api/unicode.rst:495 +#: ../../c-api/unicode.rst:490 msgid ":c:expr:`const void*`" msgstr ":c:expr:`const void*`" -#: ../../c-api/unicode.rst:496 +#: ../../c-api/unicode.rst:491 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." msgstr "" -#: ../../c-api/unicode.rst:501 +#: ../../c-api/unicode.rst:496 msgid "``A``" msgstr "``A``" -#: ../../c-api/unicode.rst:502 ../../c-api/unicode.rst:506 -#: ../../c-api/unicode.rst:516 ../../c-api/unicode.rst:520 -#: ../../c-api/unicode.rst:524 ../../c-api/unicode.rst:529 +#: ../../c-api/unicode.rst:497 ../../c-api/unicode.rst:501 +#: ../../c-api/unicode.rst:511 ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:519 ../../c-api/unicode.rst:524 msgid ":c:expr:`PyObject*`" msgstr ":c:expr:`PyObject*`" -#: ../../c-api/unicode.rst:503 +#: ../../c-api/unicode.rst:498 msgid "The result of calling :func:`ascii`." msgstr "" -#: ../../c-api/unicode.rst:505 +#: ../../c-api/unicode.rst:500 msgid "``U``" msgstr "``U``" -#: ../../c-api/unicode.rst:507 +#: ../../c-api/unicode.rst:502 msgid "A Unicode object." msgstr "一 Unicode 物件。" -#: ../../c-api/unicode.rst:509 +#: ../../c-api/unicode.rst:504 msgid "``V``" msgstr "``V``" -#: ../../c-api/unicode.rst:510 +#: ../../c-api/unicode.rst:505 msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`PyObject*`、:c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:506 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:510 msgid "``S``" msgstr "``S``" -#: ../../c-api/unicode.rst:517 +#: ../../c-api/unicode.rst:512 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:514 msgid "``R``" msgstr "``R``" -#: ../../c-api/unicode.rst:521 +#: ../../c-api/unicode.rst:516 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "" -#: ../../c-api/unicode.rst:523 +#: ../../c-api/unicode.rst:518 msgid "``T``" msgstr "" -#: ../../c-api/unicode.rst:525 +#: ../../c-api/unicode.rst:520 msgid "" "Get the fully qualified name of an object type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:528 +#: ../../c-api/unicode.rst:523 msgid "``#T``" msgstr "" -#: ../../c-api/unicode.rst:530 +#: ../../c-api/unicode.rst:525 msgid "" "Similar to ``T`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:533 +#: ../../c-api/unicode.rst:528 msgid "``N``" msgstr "" -#: ../../c-api/unicode.rst:534 ../../c-api/unicode.rst:539 +#: ../../c-api/unicode.rst:529 ../../c-api/unicode.rst:534 #, fuzzy msgid ":c:expr:`PyTypeObject*`" msgstr ":c:expr:`PyObject*`" -#: ../../c-api/unicode.rst:535 +#: ../../c-api/unicode.rst:530 msgid "" "Get the fully qualified name of a type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:533 msgid "``#N``" msgstr "" -#: ../../c-api/unicode.rst:540 +#: ../../c-api/unicode.rst:535 msgid "" "Similar to ``N`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:544 +#: ../../c-api/unicode.rst:539 msgid "" "The width formatter unit is number of characters rather than bytes. The " "precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " @@ -757,28 +752,28 @@ msgid "" "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:552 +#: ../../c-api/unicode.rst:547 msgid "" "Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " "is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " "``X``)." msgstr "" -#: ../../c-api/unicode.rst:556 +#: ../../c-api/unicode.rst:551 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "" -#: ../../c-api/unicode.rst:559 +#: ../../c-api/unicode.rst:554 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "" -#: ../../c-api/unicode.rst:562 +#: ../../c-api/unicode.rst:557 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" -#: ../../c-api/unicode.rst:566 +#: ../../c-api/unicode.rst:561 msgid "" "Support for conversion specifiers ``o`` and ``X``. Support for length " "modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " @@ -787,40 +782,40 @@ msgid "" "flag ``-``." msgstr "" -#: ../../c-api/unicode.rst:574 +#: ../../c-api/unicode.rst:569 msgid "" "An unrecognized format character now sets a :exc:`SystemError`. In previous " "versions it caused all the rest of the format string to be copied as-is to " "the result string, and any extra arguments discarded." msgstr "" -#: ../../c-api/unicode.rst:578 +#: ../../c-api/unicode.rst:573 msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." msgstr "" -#: ../../c-api/unicode.rst:584 +#: ../../c-api/unicode.rst:579 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/unicode.rst:590 +#: ../../c-api/unicode.rst:585 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 " "a new :term:`strong reference` to the object." msgstr "" -#: ../../c-api/unicode.rst:594 +#: ../../c-api/unicode.rst:589 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: ../../c-api/unicode.rst:600 +#: ../../c-api/unicode.rst:595 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:602 +#: ../../c-api/unicode.rst:597 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "<bytes-like object>` are decoded according to the given *encoding* and using " @@ -828,27 +823,39 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:608 +#: ../../c-api/unicode.rst:603 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:611 +#: ../../c-api/unicode.rst:606 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:617 +#: ../../c-api/unicode.rst:612 +msgid "" +"Return the name of the default string encoding, ``\"utf-8\"``. See :func:" +"`sys.getdefaultencoding`." +msgstr "" + +#: ../../c-api/unicode.rst:615 +msgid "" +"The returned string does not need to be freed, and is valid until " +"interpreter shutdown." +msgstr "" + +#: ../../c-api/unicode.rst:621 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:619 +#: ../../c-api/unicode.rst:623 msgid "On error, set an exception and return ``-1``." msgstr "" -#: ../../c-api/unicode.rst:630 +#: ../../c-api/unicode.rst:634 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:`!" @@ -856,61 +863,61 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:641 +#: ../../c-api/unicode.rst:645 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:" "start+length]``." msgstr "" -#: ../../c-api/unicode.rst:644 +#: ../../c-api/unicode.rst:648 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:647 +#: ../../c-api/unicode.rst:651 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:656 +#: ../../c-api/unicode.rst:660 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:660 +#: ../../c-api/unicode.rst:664 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:664 +#: ../../c-api/unicode.rst:668 msgid "Return ``0`` on success, ``-1`` on error with an exception set." msgstr "" -#: ../../c-api/unicode.rst:671 +#: ../../c-api/unicode.rst:675 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:675 +#: ../../c-api/unicode.rst:679 msgid "Return character on success, ``-1`` on error with an exception set." msgstr "" -#: ../../c-api/unicode.rst:683 +#: ../../c-api/unicode.rst:687 msgid "" "Return a substring of *unicode*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported. On " "error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:693 +#: ../../c-api/unicode.rst:697 msgid "" "Copy the string *unicode* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -918,7 +925,7 @@ msgid "" "*unicode*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:703 +#: ../../c-api/unicode.rst:707 msgid "" "Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" "func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -926,17 +933,17 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:712 +#: ../../c-api/unicode.rst:716 msgid "Locale Encoding" msgstr "" -#: ../../c-api/unicode.rst:714 +#: ../../c-api/unicode.rst:718 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: ../../c-api/unicode.rst:721 +#: ../../c-api/unicode.rst:725 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 " @@ -945,21 +952,21 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:728 +#: ../../c-api/unicode.rst:732 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:731 ../../c-api/unicode.rst:766 +#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:770 msgid "This function ignores the :ref:`Python UTF-8 Mode <utf8-mode>`." msgstr "" -#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:851 +#: ../../c-api/unicode.rst:739 ../../c-api/unicode.rst:855 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" -#: ../../c-api/unicode.rst:739 +#: ../../c-api/unicode.rst:743 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -967,13 +974,13 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:748 +#: ../../c-api/unicode.rst:752 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`!strlen`." msgstr "" -#: ../../c-api/unicode.rst:756 +#: ../../c-api/unicode.rst:760 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 " @@ -982,17 +989,17 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:763 +#: ../../c-api/unicode.rst:767 msgid "" "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:770 ../../c-api/unicode.rst:882 +#: ../../c-api/unicode.rst:774 ../../c-api/unicode.rst:886 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" -#: ../../c-api/unicode.rst:774 +#: ../../c-api/unicode.rst:778 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1000,24 +1007,24 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:783 +#: ../../c-api/unicode.rst:787 msgid "File System Encoding" msgstr "" -#: ../../c-api/unicode.rst:785 +#: ../../c-api/unicode.rst:789 msgid "" "Functions encoding to and decoding from the :term:`filesystem encoding and " "error handler` (:pep:`383` and :pep:`529`)." msgstr "" -#: ../../c-api/unicode.rst:788 +#: ../../c-api/unicode.rst:792 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " "``\"O&\"`` converter should be used, passing :c:func:`!" "PyUnicode_FSConverter` as the conversion function:" msgstr "" -#: ../../c-api/unicode.rst:794 +#: ../../c-api/unicode.rst:798 msgid "" ":ref:`PyArg_Parse\\* converter <arg-parsing>`: encode :class:`str` objects " "-- obtained directly or through the :class:`os.PathLike` interface -- to :" @@ -1030,24 +1037,24 @@ msgid "" "not allowed in the result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:806 +#: ../../c-api/unicode.rst:810 msgid "" "If *obj* is ``NULL``, the function releases a strong reference stored in the " "variable referred by *result* and returns ``1``." msgstr "" -#: ../../c-api/unicode.rst:811 ../../c-api/unicode.rst:838 +#: ../../c-api/unicode.rst:815 ../../c-api/unicode.rst:842 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../c-api/unicode.rst:814 +#: ../../c-api/unicode.rst:818 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:820 +#: ../../c-api/unicode.rst:824 msgid "" ":ref:`PyArg_Parse\\* converter <arg-parsing>`: decode :class:`bytes` objects " "-- obtained either directly or indirectly through the :class:`os.PathLike` " @@ -1061,63 +1068,63 @@ msgid "" "result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:833 +#: ../../c-api/unicode.rst:837 msgid "" "If *obj* is ``NULL``, release the strong reference to the object referred to " "by *result* and return ``1``." msgstr "" -#: ../../c-api/unicode.rst:844 +#: ../../c-api/unicode.rst:848 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:846 +#: ../../c-api/unicode.rst:850 msgid "" "If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:853 ../../c-api/unicode.rst:866 -#: ../../c-api/unicode.rst:886 +#: ../../c-api/unicode.rst:857 ../../c-api/unicode.rst:870 +#: ../../c-api/unicode.rst:890 msgid "" "The :term:`filesystem error handler <filesystem encoding and error handler>` " "is now used." msgstr "" -#: ../../c-api/unicode.rst:860 +#: ../../c-api/unicode.rst:864 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:863 +#: ../../c-api/unicode.rst:867 msgid "" "If the string length is known, use :c:func:" "`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" -#: ../../c-api/unicode.rst:873 +#: ../../c-api/unicode.rst:877 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:877 +#: ../../c-api/unicode.rst:881 msgid "" "If you need to encode a string to the current locale encoding, use :c:func:" "`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:891 +#: ../../c-api/unicode.rst:895 msgid "wchar_t Support" msgstr "wchar_t 支援" -#: ../../c-api/unicode.rst:893 +#: ../../c-api/unicode.rst:897 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" -#: ../../c-api/unicode.rst:897 +#: ../../c-api/unicode.rst:901 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1125,7 +1132,7 @@ msgid "" "failure." msgstr "" -#: ../../c-api/unicode.rst:905 +#: ../../c-api/unicode.rst:909 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1133,13 +1140,13 @@ msgid "" "`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:910 +#: ../../c-api/unicode.rst:914 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: ../../c-api/unicode.rst:913 +#: ../../c-api/unicode.rst:917 msgid "" "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:" @@ -1149,7 +1156,7 @@ msgid "" "most C functions." msgstr "" -#: ../../c-api/unicode.rst:923 +#: ../../c-api/unicode.rst:927 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 " @@ -1160,37 +1167,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:931 +#: ../../c-api/unicode.rst:935 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (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 failed." msgstr "" -#: ../../c-api/unicode.rst:938 +#: ../../c-api/unicode.rst:942 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:946 +#: ../../c-api/unicode.rst:950 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:948 +#: ../../c-api/unicode.rst:952 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:951 +#: ../../c-api/unicode.rst:955 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:955 +#: ../../c-api/unicode.rst:959 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1198,28 +1205,28 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:960 +#: ../../c-api/unicode.rst:964 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:964 +#: ../../c-api/unicode.rst:968 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:969 +#: ../../c-api/unicode.rst:973 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:971 +#: ../../c-api/unicode.rst:975 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:977 +#: ../../c-api/unicode.rst:981 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1228,7 +1235,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:987 +#: ../../c-api/unicode.rst:991 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1237,21 +1244,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:995 +#: ../../c-api/unicode.rst:999 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:997 +#: ../../c-api/unicode.rst:1001 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1002 +#: ../../c-api/unicode.rst:1006 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1009 +#: ../../c-api/unicode.rst:1013 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1259,20 +1266,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1017 +#: ../../c-api/unicode.rst:1021 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1021 ../../c-api/unicode.rst:1036 +#: ../../c-api/unicode.rst:1025 ../../c-api/unicode.rst:1040 msgid "" "The function fails if the string contains surrogate code points (``U+D800`` " "- ``U+DFFF``)." msgstr "" -#: ../../c-api/unicode.rst:1027 +#: ../../c-api/unicode.rst:1031 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1281,13 +1288,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1033 +#: ../../c-api/unicode.rst:1037 msgid "" "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " "return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:1039 +#: ../../c-api/unicode.rst:1043 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1296,19 +1303,19 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1046 ../../c-api/unicode.rst:1068 +#: ../../c-api/unicode.rst:1050 ../../c-api/unicode.rst:1072 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1049 +#: ../../c-api/unicode.rst:1053 msgid "This function is a part of the :ref:`limited API <limited-c-api>`." msgstr "" -#: ../../c-api/unicode.rst:1055 +#: ../../c-api/unicode.rst:1059 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1059 +#: ../../c-api/unicode.rst:1063 msgid "" "This function does not have any special behavior for `null characters " "<https://en.wikipedia.org/wiki/Null_character>`_ embedded within *unicode*. " @@ -1318,35 +1325,35 @@ msgid "" "c:func:`PyUnicode_AsUTF8AndSize` instead." msgstr "" -#: ../../c-api/unicode.rst:1073 +#: ../../c-api/unicode.rst:1077 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1075 +#: ../../c-api/unicode.rst:1079 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1081 +#: ../../c-api/unicode.rst:1085 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1085 ../../c-api/unicode.rst:1135 +#: ../../c-api/unicode.rst:1089 ../../c-api/unicode.rst:1139 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1088 ../../c-api/unicode.rst:1138 +#: ../../c-api/unicode.rst:1092 ../../c-api/unicode.rst:1142 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: ../../c-api/unicode.rst:1092 +#: ../../c-api/unicode.rst:1096 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1354,21 +1361,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1097 +#: ../../c-api/unicode.rst:1101 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1100 ../../c-api/unicode.rst:1151 +#: ../../c-api/unicode.rst:1104 ../../c-api/unicode.rst:1155 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1102 ../../c-api/unicode.rst:1153 +#: ../../c-api/unicode.rst:1106 ../../c-api/unicode.rst:1157 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1108 +#: ../../c-api/unicode.rst:1112 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1377,29 +1384,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1117 +#: ../../c-api/unicode.rst:1121 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1123 +#: ../../c-api/unicode.rst:1127 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1129 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1131 +#: ../../c-api/unicode.rst:1135 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1142 +#: ../../c-api/unicode.rst:1146 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1408,13 +1415,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1148 +#: ../../c-api/unicode.rst:1152 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1159 +#: ../../c-api/unicode.rst:1163 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1424,28 +1431,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1168 +#: ../../c-api/unicode.rst:1172 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1174 +#: ../../c-api/unicode.rst:1178 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1176 +#: ../../c-api/unicode.rst:1180 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1181 +#: ../../c-api/unicode.rst:1185 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1188 +#: ../../c-api/unicode.rst:1192 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1453,101 +1460,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1195 +#: ../../c-api/unicode.rst:1199 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1197 +#: ../../c-api/unicode.rst:1201 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1203 +#: ../../c-api/unicode.rst:1207 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1213 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1215 +#: ../../c-api/unicode.rst:1219 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1217 +#: ../../c-api/unicode.rst:1221 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1223 +#: ../../c-api/unicode.rst:1227 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1229 +#: ../../c-api/unicode.rst:1233 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1235 +#: ../../c-api/unicode.rst:1239 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1237 +#: ../../c-api/unicode.rst:1241 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1243 +#: ../../c-api/unicode.rst:1247 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1249 +#: ../../c-api/unicode.rst:1253 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1255 +#: ../../c-api/unicode.rst:1259 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1257 +#: ../../c-api/unicode.rst:1261 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1263 +#: ../../c-api/unicode.rst:1267 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1269 +#: ../../c-api/unicode.rst:1273 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1275 +#: ../../c-api/unicode.rst:1279 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1277 +#: ../../c-api/unicode.rst:1281 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1557,18 +1564,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1283 +#: ../../c-api/unicode.rst:1287 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1288 +#: ../../c-api/unicode.rst:1292 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1292 +#: ../../c-api/unicode.rst:1296 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1578,14 +1585,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1303 +#: ../../c-api/unicode.rst:1307 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1307 +#: ../../c-api/unicode.rst:1311 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1593,41 +1600,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1313 +#: ../../c-api/unicode.rst:1317 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1317 +#: ../../c-api/unicode.rst:1321 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1325 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: ../../c-api/unicode.rst:1324 +#: ../../c-api/unicode.rst:1328 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1328 +#: ../../c-api/unicode.rst:1332 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: ../../c-api/unicode.rst:1333 +#: ../../c-api/unicode.rst:1337 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1335 +#: ../../c-api/unicode.rst:1339 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1635,13 +1642,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1342 +#: ../../c-api/unicode.rst:1346 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1349 +#: ../../c-api/unicode.rst:1353 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1649,50 +1656,50 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1358 +#: ../../c-api/unicode.rst:1362 msgid "" "Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " "specified by *code_page*." msgstr "" -#: ../../c-api/unicode.rst:1364 +#: ../../c-api/unicode.rst:1368 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1371 +#: ../../c-api/unicode.rst:1375 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:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1379 +#: ../../c-api/unicode.rst:1383 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1385 +#: ../../c-api/unicode.rst:1389 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1387 +#: ../../c-api/unicode.rst:1391 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1391 +#: ../../c-api/unicode.rst:1395 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1396 +#: ../../c-api/unicode.rst:1400 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1401 +#: ../../c-api/unicode.rst:1405 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1701,27 +1708,73 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1409 +#: ../../c-api/unicode.rst:1410 ../../c-api/unicode.rst:1420 +#: ../../c-api/unicode.rst:1441 ../../c-api/unicode.rst:1454 +msgid "On error, return ``NULL`` with an exception set." +msgstr "" + +#: ../../c-api/unicode.rst:1412 +msgid "Equivalent to :py:meth:`str.split`." +msgstr "" + +#: ../../c-api/unicode.rst:1417 +msgid "" +"Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " +"at the end of the string." +msgstr "" + +#: ../../c-api/unicode.rst:1422 +msgid "Equivalent to :py:meth:`str.rsplit`." +msgstr "" + +#: ../../c-api/unicode.rst:1427 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1416 +#: ../../c-api/unicode.rst:1434 +msgid "" +"Split a Unicode string at the first occurrence of *sep*, and return a 3-" +"tuple containing the part before the separator, the separator itself, and " +"the part after the separator. If the separator is not found, return a 3-" +"tuple containing the string itself, followed by two empty strings." +msgstr "" + +#: ../../c-api/unicode.rst:1439 ../../c-api/unicode.rst:1452 +msgid "*sep* must not be empty." +msgstr "" + +#: ../../c-api/unicode.rst:1443 +msgid "Equivalent to :py:meth:`str.partition`." +msgstr "" + +#: ../../c-api/unicode.rst:1448 +msgid "" +"Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " +"last occurrence of *sep*. If the separator is not found, return a 3-tuple " +"containing two empty strings, followed by the string itself." +msgstr "" + +#: ../../c-api/unicode.rst:1456 +msgid "Equivalent to :py:meth:`str.rpartition`." +msgstr "" + +#: ../../c-api/unicode.rst:1461 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1423 +#: ../../c-api/unicode.rst:1468 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1431 +#: ../../c-api/unicode.rst:1476 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1730,7 +1783,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1441 +#: ../../c-api/unicode.rst:1486 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1740,37 +1793,37 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1449 +#: ../../c-api/unicode.rst:1494 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1456 +#: ../../c-api/unicode.rst:1501 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1463 +#: ../../c-api/unicode.rst:1508 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1470 +#: ../../c-api/unicode.rst:1515 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1473 +#: ../../c-api/unicode.rst:1518 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1479 +#: ../../c-api/unicode.rst:1524 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " @@ -1779,18 +1832,18 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/unicode.rst:1486 ../../c-api/unicode.rst:1507 +#: ../../c-api/unicode.rst:1531 ../../c-api/unicode.rst:1552 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1493 +#: ../../c-api/unicode.rst:1538 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1502 +#: ../../c-api/unicode.rst:1547 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1798,47 +1851,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1512 +#: ../../c-api/unicode.rst:1557 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1514 +#: ../../c-api/unicode.rst:1559 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1515 +#: ../../c-api/unicode.rst:1560 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1516 +#: ../../c-api/unicode.rst:1561 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1518 +#: ../../c-api/unicode.rst:1563 msgid "" "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:1524 +#: ../../c-api/unicode.rst:1569 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1530 +#: ../../c-api/unicode.rst:1575 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1533 +#: ../../c-api/unicode.rst:1578 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1539 +#: ../../c-api/unicode.rst:1584 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -1849,7 +1902,7 @@ msgid "" "interns it." msgstr "" -#: ../../c-api/unicode.rst:1546 +#: ../../c-api/unicode.rst:1591 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1857,39 +1910,39 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1551 +#: ../../c-api/unicode.rst:1596 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1554 +#: ../../c-api/unicode.rst:1599 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1558 +#: ../../c-api/unicode.rst:1603 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1564 +#: ../../c-api/unicode.rst:1609 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: ../../c-api/unicode.rst:1567 +#: ../../c-api/unicode.rst:1612 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1571 +#: ../../c-api/unicode.rst:1616 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " @@ -1898,6 +1951,6 @@ msgid "" "`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1579 +#: ../../c-api/unicode.rst:1624 msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/deprecations/index.po b/deprecations/index.po index 8b14f7e98e..caf56ac84c 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -371,10 +371,21 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:58 #, fuzzy +msgid ":mod:`sysconfig`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:60 +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +#, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:60 +#: ../../deprecations/pending-removal-in-3.15.rst:65 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -382,12 +393,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:71 #, fuzzy msgid ":mod:`types`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:73 #, fuzzy msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " @@ -400,12 +411,12 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:80 #, fuzzy msgid ":mod:`typing`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:82 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -417,19 +428,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:83 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:93 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-3.15.rst:90 +#: ../../deprecations/pending-removal-in-3.15.rst:95 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -794,17 +805,10 @@ msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" #: ../../deprecations/pending-removal-in-future.rst:108 -msgid "" -":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " -"ignored." -msgstr "" -":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" - -#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:113 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -812,11 +816,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -824,7 +828,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -832,20 +836,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:119 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:124 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -853,58 +857,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:129 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:128 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -914,13 +918,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:148 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -931,7 +935,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:153 +#: ../../deprecations/pending-removal-in-future.rst:150 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." @@ -1384,6 +1388,12 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" +#~ msgid "" +#~ ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated " +#~ "and ignored." +#~ msgstr "" +#~ ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" + #~ msgid "" #~ "date and datetime adapter, date and timestamp converter: see the :mod:" #~ "`sqlite3` documentation for suggested replacement recipes." diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 191a6801c3..954b39e702 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -123,22 +123,32 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:58 -msgid ":mod:`threading`:" +msgid ":mod:`sysconfig`:" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`threading`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " "not permit any arguments, but the C version allows any number of positional " "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`types`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:73 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -146,11 +156,11 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:80 msgid ":mod:`typing`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:82 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -162,18 +172,18 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:83 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:93 msgid ":mod:`wave`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:90 +#: ../../deprecations/pending-removal-in-3.15.rst:95 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index bc9a4ada1f..f961a80c9a 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -284,17 +284,10 @@ msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" #: ../../deprecations/pending-removal-in-future.rst:108 -msgid "" -":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " -"ignored." -msgstr "" -":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" - -#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:113 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -302,11 +295,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -314,7 +307,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -322,20 +315,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:119 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:124 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -343,58 +336,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:129 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:128 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -404,13 +397,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:148 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -421,7 +414,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:153 +#: ../../deprecations/pending-removal-in-future.rst:150 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." @@ -429,5 +422,11 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" +#~ msgid "" +#~ ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated " +#~ "and ignored." +#~ msgstr "" +#~ ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" + #~ msgid "``load_module()`` method: use ``exec_module()`` instead." #~ msgstr "``load_module()`` method:請改用 ``exec_module()``。" diff --git a/faq/general.po b/faq/general.po index ac24b2276b..2cde377391 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-06-23 16:56+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -808,9 +808,10 @@ msgstr "" "(串列)的 method(方法),他們可以像這樣做: ::" #: ../../faq/general.rst:412 +#, fuzzy msgid "" ">>> L = []\n" -">>> dir(L) \n" +">>> dir(L)\n" "['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n" "'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n" "'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n" diff --git a/faq/programming.po b/faq/programming.po index a0d01fa38f..d77e28855a 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-04-25 14:17+0800\n" "Last-Translator: KNChiu <y9760210@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4165,9 +4165,10 @@ msgstr "" "用 ``compile()`` 函式: ::" #: ../../faq/programming.rst:2112 +#, fuzzy msgid "" ">>> import py_compile\n" -">>> py_compile.compile('foo.py') " +">>> py_compile.compile('foo.py')" msgstr "" ">>> import py_compile\n" ">>> py_compile.compile('foo.py') " diff --git a/glossary.po b/glossary.po index 863636b3ae..8f6061c497 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1594,13 +1594,14 @@ msgid "iterable" msgstr "iterable(可疊代物件)" #: ../../glossary.rst:705 +#, fuzzy msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects <file object>`, and objects of any classes you define with an :" -"meth:`~iterator.__iter__` method or with a :meth:`~object.__getitem__` " -"method that implements :term:`sequence` semantics." +"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " +"that implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" diff --git a/howto/enum.po b/howto/enum.po index 3393ef9576..f8f139e36a 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -202,7 +202,7 @@ msgstr "" #: ../../howto/enum.rst:108 msgid "" ">>> from datetime import date\n" -">>> Weekday.from_date(date.today()) \n" +">>> Weekday.from_date(date.today())\n" "<Weekday.TUESDAY: 2>" msgstr "" @@ -1987,11 +1987,12 @@ msgid "" msgstr "" #: ../../howto/enum.rst:1093 +#, fuzzy msgid "" -">>> dir(Planet) \n" +">>> dir(Planet)\n" "['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " "'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" -">>> dir(Planet.EARTH) \n" +">>> dir(Planet.EARTH)\n" "['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " "'surface_gravity', 'value']" msgstr "" @@ -2401,13 +2402,14 @@ msgid "Using :class:`object` would look like::" msgstr "" #: ../../howto/enum.rst:1315 +#, fuzzy msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" "... GREEN = object()\n" "... BLUE = object()\n" "...\n" -">>> Color.GREEN \n" +">>> Color.GREEN\n" "<Color.GREEN: <object object at 0x...>>" msgstr "" ">>> class Color(Enum):\n" diff --git a/howto/functional.po b/howto/functional.po index f55926dec9..a4fe16b526 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -993,11 +993,11 @@ msgid "" ">>> import random\n" ">>> # Generate 8 random numbers between [0, 10000)\n" ">>> rand_list = random.sample(range(10000), 8)\n" -">>> rand_list \n" +">>> rand_list\n" "[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" -">>> sorted(rand_list) \n" +">>> sorted(rand_list)\n" "[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" -">>> sorted(rand_list, reverse=True) \n" +">>> sorted(rand_list, reverse=True)\n" "[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" msgstr "" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 69bef65056..12a8e3d010 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-07-20 16:09+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -332,10 +332,11 @@ msgid "Iterating through the \"usable\" addresses on a network::" msgstr "" #: ../../howto/ipaddress.rst:192 +#, fuzzy msgid "" ">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" ">>> for x in net4.hosts():\n" -"... print(x) \n" +"... print(x)\n" "192.0.2.1\n" "192.0.2.2\n" "192.0.2.3\n" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 49586c6a54..89179215b2 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1102,11 +1102,32 @@ msgid "" "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:843 +#: ../../howto/logging-cookbook.rst:838 +msgid "" +"The default configuration uses a TCP socket on port 9020. You can use a Unix " +"Domain socket instead of a TCP socket by doing the following:" +msgstr "" + +#: ../../howto/logging-cookbook.rst:841 +msgid "" +"In :file:`listener.json`, add a ``socket`` key with the path to the domain " +"socket you want to use. If this key is present, the listener listens on the " +"corresponding domain socket and not on a TCP socket (the ``port`` key is " +"ignored)." +msgstr "" + +#: ../../howto/logging-cookbook.rst:846 +msgid "" +"In :file:`webapp.json`, change the socket handler configuration dictionary " +"so that the ``host`` value is the path to the domain socket, and set the " +"``port`` value to ``null``." +msgstr "" + +#: ../../howto/logging-cookbook.rst:856 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:845 +#: ../../howto/logging-cookbook.rst:858 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -1122,11 +1143,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:860 +#: ../../howto/logging-cookbook.rst:873 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:862 +#: ../../howto/logging-cookbook.rst:875 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. " @@ -1137,7 +1158,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:870 +#: ../../howto/logging-cookbook.rst:883 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 " @@ -1148,7 +1169,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:878 +#: ../../howto/logging-cookbook.rst:891 msgid "" "def debug(self, msg, /, *args, **kwargs):\n" " \"\"\"\n" @@ -1159,7 +1180,7 @@ msgid "" " self.logger.debug(msg, *args, **kwargs)" msgstr "" -#: ../../howto/logging-cookbook.rst:886 +#: ../../howto/logging-cookbook.rst:899 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -1172,7 +1193,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:895 +#: ../../howto/logging-cookbook.rst:908 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 " @@ -1183,7 +1204,7 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:903 +#: ../../howto/logging-cookbook.rst:916 msgid "" "class CustomAdapter(logging.LoggerAdapter):\n" " \"\"\"\n" @@ -1194,27 +1215,27 @@ msgid "" " return '[%s] %s' % (self.extra['connid'], msg), kwargs" msgstr "" -#: ../../howto/logging-cookbook.rst:911 +#: ../../howto/logging-cookbook.rst:924 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:913 +#: ../../howto/logging-cookbook.rst:926 msgid "" "logger = logging.getLogger(__name__)\n" "adapter = CustomAdapter(logger, {'connid': some_conn_id})" msgstr "" -#: ../../howto/logging-cookbook.rst:916 +#: ../../howto/logging-cookbook.rst:929 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:920 +#: ../../howto/logging-cookbook.rst:933 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:922 +#: ../../howto/logging-cookbook.rst:935 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 " @@ -1223,11 +1244,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:931 +#: ../../howto/logging-cookbook.rst:944 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:933 +#: ../../howto/logging-cookbook.rst:946 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -1236,7 +1257,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:938 +#: ../../howto/logging-cookbook.rst:951 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:" @@ -1248,7 +1269,7 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:947 +#: ../../howto/logging-cookbook.rst:960 msgid "" "import logging\n" "from random import choice\n" @@ -1291,11 +1312,11 @@ msgid "" "'parameters')" msgstr "" -#: ../../howto/logging-cookbook.rst:984 +#: ../../howto/logging-cookbook.rst:997 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:986 +#: ../../howto/logging-cookbook.rst:999 msgid "" "2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " "debug message\n" @@ -1323,11 +1344,11 @@ msgid "" "message at INFO level with 2 parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:1002 +#: ../../howto/logging-cookbook.rst:1015 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:1004 +#: ../../howto/logging-cookbook.rst:1017 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -1337,7 +1358,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1010 +#: ../../howto/logging-cookbook.rst:1023 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -1348,11 +1369,11 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:1017 +#: ../../howto/logging-cookbook.rst:1030 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1019 +#: ../../howto/logging-cookbook.rst:1032 msgid "" "# webapplib.py\n" "import logging\n" @@ -1367,14 +1388,14 @@ msgid "" " time.sleep(0.01)" msgstr "" -#: ../../howto/logging-cookbook.rst:1033 +#: ../../howto/logging-cookbook.rst:1046 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:1037 +#: ../../howto/logging-cookbook.rst:1050 msgid "" "# main.py\n" "import argparse\n" @@ -1529,7 +1550,7 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1177 +#: ../../howto/logging-cookbook.rst:1190 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 " @@ -1540,7 +1561,7 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:1184 +#: ../../howto/logging-cookbook.rst:1197 msgid "" "~/logging-contextual-webapp$ python main.py\n" "app1 processed 51 requests\n" @@ -1595,11 +1616,11 @@ msgid "" "147" msgstr "" -#: ../../howto/logging-cookbook.rst:1224 +#: ../../howto/logging-cookbook.rst:1237 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1226 +#: ../../howto/logging-cookbook.rst:1239 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 " @@ -1607,7 +1628,7 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:1231 +#: ../../howto/logging-cookbook.rst:1244 msgid "" "import copy\n" "import logging\n" @@ -1629,11 +1650,11 @@ msgid "" " logger.info('A log message')" msgstr "" -#: ../../howto/logging-cookbook.rst:1253 +#: ../../howto/logging-cookbook.rst:1266 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1255 +#: ../../howto/logging-cookbook.rst:1268 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 " @@ -1649,7 +1670,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1268 +#: ../../howto/logging-cookbook.rst:1281 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -1657,7 +1678,7 @@ msgid "" "`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" -#: ../../howto/logging-cookbook.rst:1275 +#: ../../howto/logging-cookbook.rst:1288 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 " @@ -1672,7 +1693,7 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1286 +#: ../../howto/logging-cookbook.rst:1299 msgid "" "# You'll need these imports in your own code\n" "import logging\n" @@ -1792,13 +1813,13 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1391 +#: ../../howto/logging-cookbook.rst:1404 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1394 +#: ../../howto/logging-cookbook.rst:1407 msgid "" "import logging\n" "import logging.config\n" @@ -1895,7 +1916,7 @@ msgid "" " lp.join()" msgstr "" -#: ../../howto/logging-cookbook.rst:1486 +#: ../../howto/logging-cookbook.rst:1499 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 " @@ -1905,36 +1926,36 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1493 +#: ../../howto/logging-cookbook.rst:1506 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1495 +#: ../../howto/logging-cookbook.rst:1508 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:1499 +#: ../../howto/logging-cookbook.rst:1512 msgid "queue = multiprocessing.Queue(-1)" msgstr "" -#: ../../howto/logging-cookbook.rst:1503 +#: ../../howto/logging-cookbook.rst:1516 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1505 +#: ../../howto/logging-cookbook.rst:1518 msgid "" "queue = multiprocessing.Manager().Queue(-1) # also works with the examples " "above" msgstr "" -#: ../../howto/logging-cookbook.rst:1509 +#: ../../howto/logging-cookbook.rst:1522 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1511 +#: ../../howto/logging-cookbook.rst:1524 msgid "" "workers = []\n" "for i in range(10):\n" @@ -1946,22 +1967,22 @@ msgid "" " w.join()" msgstr "" -#: ../../howto/logging-cookbook.rst:1520 +#: ../../howto/logging-cookbook.rst:1533 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1522 +#: ../../howto/logging-cookbook.rst:1535 msgid "" "with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" " for i in range(10):\n" " executor.submit(worker_process, queue, worker_configurer)" msgstr "" -#: ../../howto/logging-cookbook.rst:1527 +#: ../../howto/logging-cookbook.rst:1540 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1529 +#: ../../howto/logging-cookbook.rst:1542 msgid "" "When deploying Web applications using `Gunicorn <https://gunicorn.org/>`_ or " "`uWSGI <https://uwsgi-docs.readthedocs.io/en/latest/>`_ (or similar), " @@ -1973,11 +1994,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1539 +#: ../../howto/logging-cookbook.rst:1552 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1544 +#: ../../howto/logging-cookbook.rst:1557 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, " @@ -1986,7 +2007,7 @@ msgid "" "usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1550 +#: ../../howto/logging-cookbook.rst:1563 msgid "" "import glob\n" "import logging\n" @@ -2015,13 +2036,13 @@ msgid "" " print(filename)" msgstr "" -#: ../../howto/logging-cookbook.rst:1576 +#: ../../howto/logging-cookbook.rst:1589 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1579 +#: ../../howto/logging-cookbook.rst:1592 msgid "" "logging_rotatingfile_example.out\n" "logging_rotatingfile_example.out.1\n" @@ -2031,7 +2052,7 @@ msgid "" "logging_rotatingfile_example.out.5" msgstr "" -#: ../../howto/logging-cookbook.rst:1588 +#: ../../howto/logging-cookbook.rst:1601 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 " @@ -2039,17 +2060,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1593 +#: ../../howto/logging-cookbook.rst:1606 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:1601 +#: ../../howto/logging-cookbook.rst:1614 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1603 +#: ../../howto/logging-cookbook.rst:1616 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -2058,7 +2079,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1609 +#: ../../howto/logging-cookbook.rst:1622 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -2071,7 +2092,7 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1619 +#: ../../howto/logging-cookbook.rst:1632 msgid "" ">>> import logging\n" ">>> root = logging.getLogger()\n" @@ -2096,21 +2117,21 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1643 +#: ../../howto/logging-cookbook.rst:1656 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:1647 +#: ../../howto/logging-cookbook.rst:1660 msgid "" ">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" "2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1651 +#: ../../howto/logging-cookbook.rst:1664 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -2126,7 +2147,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1664 +#: ../../howto/logging-cookbook.rst:1677 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 " @@ -2135,7 +2156,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1670 ../../howto/logging-cookbook.rst:2758 +#: ../../howto/logging-cookbook.rst:1683 ../../howto/logging-cookbook.rst:2771 msgid "" "class BraceMessage:\n" " def __init__(self, fmt, /, *args, **kwargs):\n" @@ -2173,7 +2194,7 @@ msgstr "" " from string import Template\n" " return Template(self.fmt).substitute(**self.kwargs)" -#: ../../howto/logging-cookbook.rst:1688 +#: ../../howto/logging-cookbook.rst:1701 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 " @@ -2184,14 +2205,14 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1696 +#: ../../howto/logging-cookbook.rst:1709 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:1700 +#: ../../howto/logging-cookbook.rst:1713 msgid "" ">>> from wherever import BraceMessage as __\n" ">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" @@ -2210,14 +2231,14 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:1718 +#: ../../howto/logging-cookbook.rst:1731 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:1722 +#: ../../howto/logging-cookbook.rst:1735 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 " @@ -2228,13 +2249,13 @@ msgid "" "sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1730 +#: ../../howto/logging-cookbook.rst:1743 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:1733 +#: ../../howto/logging-cookbook.rst:1746 msgid "" "import logging\n" "\n" @@ -2263,17 +2284,17 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:1759 +#: ../../howto/logging-cookbook.rst:1772 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.8 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1768 +#: ../../howto/logging-cookbook.rst:1781 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1770 +#: ../../howto/logging-cookbook.rst:1783 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:" @@ -2284,13 +2305,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1777 +#: ../../howto/logging-cookbook.rst:1790 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:1780 +#: ../../howto/logging-cookbook.rst:1793 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -2299,27 +2320,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1786 +#: ../../howto/logging-cookbook.rst:1799 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:1789 +#: ../../howto/logging-cookbook.rst:1802 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:1792 +#: ../../howto/logging-cookbook.rst:1805 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:1796 +#: ../../howto/logging-cookbook.rst:1809 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -2327,7 +2348,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1801 +#: ../../howto/logging-cookbook.rst:1814 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 " @@ -2336,11 +2357,11 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1807 +#: ../../howto/logging-cookbook.rst:1820 msgid "logger = logging.getLogger(__name__)" msgstr "logger = logging.getLogger(__name__)" -#: ../../howto/logging-cookbook.rst:1809 +#: ../../howto/logging-cookbook.rst:1822 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` " @@ -2350,7 +2371,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1815 +#: ../../howto/logging-cookbook.rst:1828 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 " @@ -2360,7 +2381,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1822 +#: ../../howto/logging-cookbook.rst:1835 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 " @@ -2368,7 +2389,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1826 +#: ../../howto/logging-cookbook.rst:1839 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -2380,7 +2401,7 @@ msgid "" "logging.setLogRecordFactory(record_factory)" msgstr "" -#: ../../howto/logging-cookbook.rst:1835 +#: ../../howto/logging-cookbook.rst:1848 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -2390,22 +2411,22 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1847 +#: ../../howto/logging-cookbook.rst:1860 msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1850 ../../howto/logging-cookbook.rst:1983 +#: ../../howto/logging-cookbook.rst:1863 ../../howto/logging-cookbook.rst:1996 msgid "Subclass ``QueueHandler``" msgstr "" -#: ../../howto/logging-cookbook.rst:1852 +#: ../../howto/logging-cookbook.rst:1865 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:1856 +#: ../../howto/logging-cookbook.rst:1869 msgid "" "import zmq # using pyzmq, the Python binding for ZeroMQ\n" "import json # for serializing records portably\n" @@ -2422,13 +2443,13 @@ msgid "" "handler = ZeroMQSocketHandler(sock)" msgstr "" -#: ../../howto/logging-cookbook.rst:1871 +#: ../../howto/logging-cookbook.rst:1884 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:1874 +#: ../../howto/logging-cookbook.rst:1887 msgid "" "class ZeroMQSocketHandler(QueueHandler):\n" " def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" @@ -2444,17 +2465,17 @@ msgid "" " self.queue.close()" msgstr "" -#: ../../howto/logging-cookbook.rst:1889 ../../howto/logging-cookbook.rst:1919 +#: ../../howto/logging-cookbook.rst:1902 ../../howto/logging-cookbook.rst:1932 msgid "Subclass ``QueueListener``" msgstr "" -#: ../../howto/logging-cookbook.rst:1891 +#: ../../howto/logging-cookbook.rst:1904 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:1894 +#: ../../howto/logging-cookbook.rst:1907 msgid "" "class ZeroMQSocketListener(QueueListener):\n" " def __init__(self, uri, /, *handlers, **kwargs):\n" @@ -2470,11 +2491,11 @@ msgid "" " return logging.makeLogRecord(msg)" msgstr "" -#: ../../howto/logging-cookbook.rst:1909 +#: ../../howto/logging-cookbook.rst:1922 msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" msgstr "" -#: ../../howto/logging-cookbook.rst:1911 +#: ../../howto/logging-cookbook.rst:1924 msgid "" "In a similar way to the above section, we can implement a listener and " "handler using :pypi:`pynng`, which is a Python binding to `NNG <https://nng." @@ -2483,7 +2504,7 @@ msgid "" "``pynng`` installed. Just for variety, we present the listener first." msgstr "" -#: ../../howto/logging-cookbook.rst:1921 +#: ../../howto/logging-cookbook.rst:1934 msgid "" "# listener.py\n" "import json\n" @@ -2545,7 +2566,7 @@ msgid "" " listener.stop()" msgstr "" -#: ../../howto/logging-cookbook.rst:1987 +#: ../../howto/logging-cookbook.rst:2000 msgid "" "# sender.py\n" "import json\n" @@ -2594,14 +2615,14 @@ msgid "" " time.sleep(delay)" msgstr "" -#: ../../howto/logging-cookbook.rst:2034 +#: ../../howto/logging-cookbook.rst:2047 msgid "" "You can run the above two snippets in separate command shells. If we run the " "listener in one shell and run the sender in two separate shells, we should " "see something like the following. In the first sender shell:" msgstr "" -#: ../../howto/logging-cookbook.rst:2038 +#: ../../howto/logging-cookbook.rst:2051 msgid "" "$ python sender.py\n" "DEBUG myapp 613 Message no. 1\n" @@ -2615,11 +2636,11 @@ msgid "" "(and so on)" msgstr "" -#: ../../howto/logging-cookbook.rst:2051 +#: ../../howto/logging-cookbook.rst:2064 msgid "In the second sender shell:" msgstr "" -#: ../../howto/logging-cookbook.rst:2053 +#: ../../howto/logging-cookbook.rst:2066 msgid "" "$ python sender.py\n" "INFO myapp.lib2 657 Message no. 1\n" @@ -2633,11 +2654,11 @@ msgid "" "(and so on)" msgstr "" -#: ../../howto/logging-cookbook.rst:2066 +#: ../../howto/logging-cookbook.rst:2079 msgid "In the listener shell:" msgstr "" -#: ../../howto/logging-cookbook.rst:2068 +#: ../../howto/logging-cookbook.rst:2081 msgid "" "$ python listener.py\n" "Press Ctrl-C to stop.\n" @@ -2660,17 +2681,17 @@ msgid "" "(and so on)" msgstr "" -#: ../../howto/logging-cookbook.rst:2090 +#: ../../howto/logging-cookbook.rst:2103 msgid "" "As you can see, the logging from the two sender processes is interleaved in " "the listener's output." msgstr "" -#: ../../howto/logging-cookbook.rst:2095 +#: ../../howto/logging-cookbook.rst:2108 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2097 +#: ../../howto/logging-cookbook.rst:2110 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project <https://docs.djangoproject.com/en/" @@ -2678,7 +2699,7 @@ msgid "" "func:`~config.dictConfig` to put the configuration into effect::" msgstr "" -#: ../../howto/logging-cookbook.rst:2101 +#: ../../howto/logging-cookbook.rst:2114 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -2780,24 +2801,24 @@ msgstr "" " }\n" "}" -#: ../../howto/logging-cookbook.rst:2150 +#: ../../howto/logging-cookbook.rst:2163 msgid "" "For more information about this configuration, you can see the `relevant " "section <https://docs.djangoproject.com/en/stable/topics/logging/" "#configuring-logging>`_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:2157 +#: ../../howto/logging-cookbook.rst:2170 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:2159 +#: ../../howto/logging-cookbook.rst:2172 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:2162 +#: ../../howto/logging-cookbook.rst:2175 msgid "" "import gzip\n" "import logging\n" @@ -2857,12 +2878,12 @@ msgstr "" "for i in range(1000):\n" " root.info(f'Message no. {i + 1}')" -#: ../../howto/logging-cookbook.rst:2190 +#: ../../howto/logging-cookbook.rst:2203 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2192 +#: ../../howto/logging-cookbook.rst:2205 msgid "" "$ ls rotated.log*\n" "rotated.log rotated.log.2.gz rotated.log.4.gz\n" @@ -2880,11 +2901,11 @@ msgstr "" "2023-01-20 02:28:17,767 Message no. 997\n" "2023-01-20 02:28:17,767 Message no. 998" -#: ../../howto/logging-cookbook.rst:2203 +#: ../../howto/logging-cookbook.rst:2216 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2205 +#: ../../howto/logging-cookbook.rst:2218 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -2892,7 +2913,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2210 +#: ../../howto/logging-cookbook.rst:2223 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 " @@ -2905,13 +2926,13 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2220 +#: ../../howto/logging-cookbook.rst:2233 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2223 +#: ../../howto/logging-cookbook.rst:2236 msgid "" "import logging\n" "import logging.config\n" @@ -3134,11 +3155,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2432 +#: ../../howto/logging-cookbook.rst:2445 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2434 +#: ../../howto/logging-cookbook.rst:2447 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 " @@ -3147,7 +3168,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2440 +#: ../../howto/logging-cookbook.rst:2453 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 " @@ -3155,7 +3176,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2446 +#: ../../howto/logging-cookbook.rst:2459 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 " @@ -3164,37 +3185,37 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2452 +#: ../../howto/logging-cookbook.rst:2465 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:2456 +#: ../../howto/logging-cookbook.rst:2469 msgid "'ASCII section\\ufeffUnicode section'" msgstr "" -#: ../../howto/logging-cookbook.rst:2458 +#: ../../howto/logging-cookbook.rst:2471 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:2461 +#: ../../howto/logging-cookbook.rst:2474 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:2465 +#: ../../howto/logging-cookbook.rst:2478 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:2469 +#: ../../howto/logging-cookbook.rst:2482 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -3203,11 +3224,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2476 +#: ../../howto/logging-cookbook.rst:2489 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2478 +#: ../../howto/logging-cookbook.rst:2491 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -3219,7 +3240,7 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2486 +#: ../../howto/logging-cookbook.rst:2499 msgid "" "import json\n" "import logging\n" @@ -3238,11 +3259,11 @@ msgid "" "logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgstr "" -#: ../../howto/logging-cookbook.rst:2502 +#: ../../howto/logging-cookbook.rst:2515 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2504 +#: ../../howto/logging-cookbook.rst:2517 msgid "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" @@ -3250,19 +3271,19 @@ msgstr "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" -#: ../../howto/logging-cookbook.rst:2508 ../../howto/logging-cookbook.rst:2550 +#: ../../howto/logging-cookbook.rst:2521 ../../howto/logging-cookbook.rst:2563 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2511 +#: ../../howto/logging-cookbook.rst:2524 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:2514 +#: ../../howto/logging-cookbook.rst:2527 msgid "" "import json\n" "import logging\n" @@ -3295,19 +3316,19 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2544 +#: ../../howto/logging-cookbook.rst:2557 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2546 +#: ../../howto/logging-cookbook.rst:2559 msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" msgstr "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" -#: ../../howto/logging-cookbook.rst:2559 +#: ../../howto/logging-cookbook.rst:2572 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2561 +#: ../../howto/logging-cookbook.rst:2574 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 " @@ -3317,7 +3338,7 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2568 +#: ../../howto/logging-cookbook.rst:2581 msgid "" "def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" " if owner:\n" @@ -3333,13 +3354,13 @@ msgstr "" " shutil.chown(filename, *owner)\n" " return logging.FileHandler(filename, mode, encoding)" -#: ../../howto/logging-cookbook.rst:2575 +#: ../../howto/logging-cookbook.rst:2588 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:2578 +#: ../../howto/logging-cookbook.rst:2591 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -3372,14 +3393,14 @@ msgid "" "}" msgstr "" -#: ../../howto/logging-cookbook.rst:2608 +#: ../../howto/logging-cookbook.rst:2621 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:2612 +#: ../../howto/logging-cookbook.rst:2625 msgid "" "import logging, logging.config, os, shutil\n" "\n" @@ -3425,11 +3446,11 @@ msgid "" "logger.debug('A debug message')" msgstr "" -#: ../../howto/logging-cookbook.rst:2655 +#: ../../howto/logging-cookbook.rst:2668 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2657 +#: ../../howto/logging-cookbook.rst:2670 msgid "" "$ sudo python3.3 chowntest.py\n" "$ cat chowntest.log\n" @@ -3438,7 +3459,7 @@ msgid "" "-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" msgstr "" -#: ../../howto/logging-cookbook.rst:2665 +#: ../../howto/logging-cookbook.rst:2678 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 " @@ -3447,25 +3468,25 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2671 +#: ../../howto/logging-cookbook.rst:2684 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:2674 +#: ../../howto/logging-cookbook.rst:2687 msgid "'()': owned_file_handler," msgstr "'()': owned_file_handler," -#: ../../howto/logging-cookbook.rst:2676 +#: ../../howto/logging-cookbook.rst:2689 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2678 +#: ../../howto/logging-cookbook.rst:2691 msgid "'()': 'ext://project.util.owned_file_handler'," msgstr "'()': 'ext://project.util.owned_file_handler'," -#: ../../howto/logging-cookbook.rst:2680 +#: ../../howto/logging-cookbook.rst:2693 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://" @@ -3473,25 +3494,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2685 +#: ../../howto/logging-cookbook.rst:2698 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:2689 +#: ../../howto/logging-cookbook.rst:2702 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:2699 +#: ../../howto/logging-cookbook.rst:2712 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2701 +#: ../../howto/logging-cookbook.rst:2714 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -3502,7 +3523,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2708 +#: ../../howto/logging-cookbook.rst:2721 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -3517,7 +3538,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2720 +#: ../../howto/logging-cookbook.rst:2733 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -3525,7 +3546,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2724 +#: ../../howto/logging-cookbook.rst:2737 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 " @@ -3533,11 +3554,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2731 +#: ../../howto/logging-cookbook.rst:2744 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2733 +#: ../../howto/logging-cookbook.rst:2746 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 " @@ -3552,17 +3573,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2744 +#: ../../howto/logging-cookbook.rst:2757 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2749 +#: ../../howto/logging-cookbook.rst:2762 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2751 +#: ../../howto/logging-cookbook.rst:2764 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -3572,7 +3593,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2776 +#: ../../howto/logging-cookbook.rst:2789 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 " @@ -3583,13 +3604,13 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2784 +#: ../../howto/logging-cookbook.rst:2797 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2787 +#: ../../howto/logging-cookbook.rst:2800 msgid "" ">>> __ = BraceMessage\n" ">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" @@ -3604,11 +3625,11 @@ msgid "" "Message with coordinates: (0.50, 0.50)" msgstr "" -#: ../../howto/logging-cookbook.rst:2798 +#: ../../howto/logging-cookbook.rst:2811 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2800 +#: ../../howto/logging-cookbook.rst:2813 msgid "" ">>> __ = DollarMessage\n" ">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" @@ -3616,7 +3637,7 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:2805 +#: ../../howto/logging-cookbook.rst:2818 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 " @@ -3628,11 +3649,11 @@ msgid "" "shown above." msgstr "" -#: ../../howto/logging-cookbook.rst:2819 +#: ../../howto/logging-cookbook.rst:2832 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2821 +#: ../../howto/logging-cookbook.rst:2834 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). " @@ -3647,7 +3668,7 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2832 +#: ../../howto/logging-cookbook.rst:2845 msgid "" "import logging\n" "import logging.config\n" @@ -3733,26 +3754,26 @@ msgstr "" " logging.debug('hello')\n" " logging.debug('hello - noshow')" -#: ../../howto/logging-cookbook.rst:2874 +#: ../../howto/logging-cookbook.rst:2887 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:2878 +#: ../../howto/logging-cookbook.rst:2891 msgid "changed: hello" msgstr "changed: hello" -#: ../../howto/logging-cookbook.rst:2882 +#: ../../howto/logging-cookbook.rst:2895 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2884 +#: ../../howto/logging-cookbook.rst:2897 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2886 +#: ../../howto/logging-cookbook.rst:2899 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 " @@ -3762,7 +3783,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2893 +#: ../../howto/logging-cookbook.rst:2906 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 " @@ -3771,11 +3792,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2902 +#: ../../howto/logging-cookbook.rst:2915 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2904 +#: ../../howto/logging-cookbook.rst:2917 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, " @@ -3783,7 +3804,7 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2909 +#: ../../howto/logging-cookbook.rst:2922 msgid "" "import logging\n" "\n" @@ -3822,11 +3843,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:2945 +#: ../../howto/logging-cookbook.rst:2958 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2947 +#: ../../howto/logging-cookbook.rst:2960 msgid "" "28/01/2015 07:21:23|INFO|Sample message|\n" "28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by " @@ -3840,18 +3861,18 @@ msgstr "" "in main\\n x = 1 / 0\\nZeroDivisionError: integer division or modulo by " "zero'|" -#: ../../howto/logging-cookbook.rst:2952 +#: ../../howto/logging-cookbook.rst:2965 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:2959 +#: ../../howto/logging-cookbook.rst:2972 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2961 +#: ../../howto/logging-cookbook.rst:2974 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 " @@ -3868,7 +3889,7 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2974 +#: ../../howto/logging-cookbook.rst:2987 msgid "" "import logging\n" "import subprocess\n" @@ -3900,24 +3921,24 @@ msgid "" " sys.exit(main())" msgstr "" -#: ../../howto/logging-cookbook.rst:3003 +#: ../../howto/logging-cookbook.rst:3016 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:3005 +#: ../../howto/logging-cookbook.rst:3018 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:3013 +#: ../../howto/logging-cookbook.rst:3026 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:3015 +#: ../../howto/logging-cookbook.rst:3028 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 " @@ -3927,7 +3948,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:3022 +#: ../../howto/logging-cookbook.rst:3035 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 " @@ -3940,7 +3961,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:3032 +#: ../../howto/logging-cookbook.rst:3045 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 " @@ -3949,7 +3970,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:3038 +#: ../../howto/logging-cookbook.rst:3051 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 " @@ -3961,11 +3982,11 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:3046 +#: ../../howto/logging-cookbook.rst:3059 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:3048 +#: ../../howto/logging-cookbook.rst:3061 msgid "" "import logging\n" "from logging.handlers import MemoryHandler\n" @@ -4031,11 +4052,11 @@ msgid "" " assert decorated_foo(True)" msgstr "" -#: ../../howto/logging-cookbook.rst:3109 +#: ../../howto/logging-cookbook.rst:3122 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:3111 +#: ../../howto/logging-cookbook.rst:3124 msgid "" "Calling undecorated foo with False\n" "about to log at DEBUG ...\n" @@ -4064,29 +4085,29 @@ msgid "" "Actually logged at CRITICAL" msgstr "" -#: ../../howto/logging-cookbook.rst:3139 +#: ../../howto/logging-cookbook.rst:3152 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:3143 +#: ../../howto/logging-cookbook.rst:3156 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:3145 +#: ../../howto/logging-cookbook.rst:3158 msgid "" "@log_if_errors(logger)\n" "def foo(fail=False):\n" " ..." msgstr "" -#: ../../howto/logging-cookbook.rst:3153 +#: ../../howto/logging-cookbook.rst:3166 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:3155 +#: ../../howto/logging-cookbook.rst:3168 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." @@ -4097,7 +4118,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3163 +#: ../../howto/logging-cookbook.rst:3176 msgid "" "import logging\n" "import logging.handlers\n" @@ -4165,7 +4186,7 @@ msgid "" " h.close()" msgstr "" -#: ../../howto/logging-cookbook.rst:3227 +#: ../../howto/logging-cookbook.rst:3240 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 " @@ -4173,17 +4194,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3235 +#: ../../howto/logging-cookbook.rst:3248 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3237 +#: ../../howto/logging-cookbook.rst:3250 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:3240 +#: ../../howto/logging-cookbook.rst:3253 msgid "" "import logging\n" "import time\n" @@ -4192,7 +4213,7 @@ msgid "" " converter = time.gmtime" msgstr "" -#: ../../howto/logging-cookbook.rst:3246 +#: ../../howto/logging-cookbook.rst:3259 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 " @@ -4200,7 +4221,7 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3251 +#: ../../howto/logging-cookbook.rst:3264 msgid "" "import logging\n" "import logging.config\n" @@ -4241,27 +4262,27 @@ msgid "" " logging.warning('The local time is %s', time.asctime())" msgstr "" -#: ../../howto/logging-cookbook.rst:3289 +#: ../../howto/logging-cookbook.rst:3302 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3291 +#: ../../howto/logging-cookbook.rst:3304 msgid "" "2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" "2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgstr "" -#: ../../howto/logging-cookbook.rst:3296 +#: ../../howto/logging-cookbook.rst:3309 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3303 +#: ../../howto/logging-cookbook.rst:3316 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3305 +#: ../../howto/logging-cookbook.rst:3318 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 " @@ -4271,7 +4292,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3312 +#: ../../howto/logging-cookbook.rst:3325 msgid "" "import logging\n" "import sys\n" @@ -4300,7 +4321,7 @@ msgid "" " # implicit return of None => don't swallow exceptions" msgstr "" -#: ../../howto/logging-cookbook.rst:3338 +#: ../../howto/logging-cookbook.rst:3351 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 " @@ -4309,13 +4330,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3344 +#: ../../howto/logging-cookbook.rst:3357 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3347 +#: ../../howto/logging-cookbook.rst:3360 msgid "" "if __name__ == '__main__':\n" " logger = logging.getLogger('foo')\n" @@ -4335,7 +4356,7 @@ msgid "" " logger.debug('7. This should not appear.')" msgstr "" -#: ../../howto/logging-cookbook.rst:3362 +#: ../../howto/logging-cookbook.rst:3375 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 " @@ -4348,11 +4369,11 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3372 +#: ../../howto/logging-cookbook.rst:3385 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3374 +#: ../../howto/logging-cookbook.rst:3387 msgid "" "$ python logctx.py\n" "1. This should appear just once on stderr.\n" @@ -4362,23 +4383,23 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: ../../howto/logging-cookbook.rst:3383 +#: ../../howto/logging-cookbook.rst:3396 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:3386 +#: ../../howto/logging-cookbook.rst:3399 msgid "" "$ python logctx.py 2>/dev/null\n" "5. This should appear twice - once on stderr and once on stdout." msgstr "" -#: ../../howto/logging-cookbook.rst:3391 +#: ../../howto/logging-cookbook.rst:3404 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3393 +#: ../../howto/logging-cookbook.rst:3406 msgid "" "$ python logctx.py >/dev/null\n" "1. This should appear just once on stderr.\n" @@ -4387,42 +4408,42 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: ../../howto/logging-cookbook.rst:3401 +#: ../../howto/logging-cookbook.rst:3414 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3403 +#: ../../howto/logging-cookbook.rst:3416 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:3411 +#: ../../howto/logging-cookbook.rst:3424 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3413 +#: ../../howto/logging-cookbook.rst:3426 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3428 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3416 +#: ../../howto/logging-cookbook.rst:3429 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3418 +#: ../../howto/logging-cookbook.rst:3431 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3420 +#: ../../howto/logging-cookbook.rst:3433 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 " @@ -4433,7 +4454,7 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3428 +#: ../../howto/logging-cookbook.rst:3441 msgid "" "import argparse\n" "import importlib\n" @@ -4480,13 +4501,13 @@ msgid "" " sys.exit(main())" msgstr "" -#: ../../howto/logging-cookbook.rst:3469 +#: ../../howto/logging-cookbook.rst:3482 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3472 +#: ../../howto/logging-cookbook.rst:3485 msgid "" "# start.py\n" "import logging\n" @@ -4499,11 +4520,11 @@ msgid "" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" -#: ../../howto/logging-cookbook.rst:3482 +#: ../../howto/logging-cookbook.rst:3495 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3484 +#: ../../howto/logging-cookbook.rst:3497 msgid "" "# stop.py\n" "import logging\n" @@ -4525,11 +4546,11 @@ msgid "" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" -#: ../../howto/logging-cookbook.rst:3503 +#: ../../howto/logging-cookbook.rst:3516 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3505 +#: ../../howto/logging-cookbook.rst:3518 msgid "" "# restart.py\n" "import logging\n" @@ -4551,13 +4572,13 @@ msgid "" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" -#: ../../howto/logging-cookbook.rst:3524 +#: ../../howto/logging-cookbook.rst:3537 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3526 +#: ../../howto/logging-cookbook.rst:3539 msgid "" "$ python app.py start foo\n" "INFO start Started the 'foo' service.\n" @@ -4569,19 +4590,19 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: ../../howto/logging-cookbook.rst:3537 +#: ../../howto/logging-cookbook.rst:3550 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:3540 +#: ../../howto/logging-cookbook.rst:3553 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:3543 +#: ../../howto/logging-cookbook.rst:3556 msgid "" "$ python app.py --log-level DEBUG start foo\n" "DEBUG start About to start foo\n" @@ -4596,28 +4617,28 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: ../../howto/logging-cookbook.rst:3557 +#: ../../howto/logging-cookbook.rst:3570 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3559 +#: ../../howto/logging-cookbook.rst:3572 msgid "" "$ python app.py --log-level WARNING start foo\n" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" -#: ../../howto/logging-cookbook.rst:3565 +#: ../../howto/logging-cookbook.rst:3578 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:3571 +#: ../../howto/logging-cookbook.rst:3584 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3573 +#: ../../howto/logging-cookbook.rst:3586 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt <https://www.qt.io/>`_ framework is a popular cross-" @@ -4625,7 +4646,7 @@ msgid "" "`PyQt5` libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3578 +#: ../../howto/logging-cookbook.rst:3591 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 " @@ -4635,14 +4656,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3585 +#: ../../howto/logging-cookbook.rst:3598 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:3589 +#: ../../howto/logging-cookbook.rst:3602 msgid "" "The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " "``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " @@ -4650,7 +4671,7 @@ msgid "" "more detailed information." msgstr "" -#: ../../howto/logging-cookbook.rst:3594 +#: ../../howto/logging-cookbook.rst:3607 msgid "" "import datetime\n" "import logging\n" @@ -4901,11 +4922,11 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:3826 +#: ../../howto/logging-cookbook.rst:3839 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3828 +#: ../../howto/logging-cookbook.rst:3841 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -4915,14 +4936,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3835 +#: ../../howto/logging-cookbook.rst:3848 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:3839 +#: ../../howto/logging-cookbook.rst:3852 msgid "" "import datetime\n" "import logging.handlers\n" @@ -4992,7 +5013,7 @@ msgid "" "{sdata} {msg}'" msgstr "" -#: ../../howto/logging-cookbook.rst:3901 +#: ../../howto/logging-cookbook.rst:3914 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 " @@ -5001,7 +5022,7 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3906 +#: ../../howto/logging-cookbook.rst:3919 msgid "" "sd = {\n" " 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" @@ -5012,11 +5033,11 @@ msgid "" "logger.debug('Message %d', i, extra=extra)" msgstr "" -#: ../../howto/logging-cookbook.rst:3915 +#: ../../howto/logging-cookbook.rst:3928 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3917 +#: ../../howto/logging-cookbook.rst:3930 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 " @@ -5024,7 +5045,7 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3922 +#: ../../howto/logging-cookbook.rst:3935 msgid "" "import logging\n" "\n" @@ -5062,23 +5083,23 @@ msgid "" " main()" msgstr "" -#: ../../howto/logging-cookbook.rst:3957 +#: ../../howto/logging-cookbook.rst:3970 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3959 +#: ../../howto/logging-cookbook.rst:3972 msgid "" "INFO:demo:An INFO message\n" "DEBUG:demo:A DEBUG message" msgstr "" -#: ../../howto/logging-cookbook.rst:3964 +#: ../../howto/logging-cookbook.rst:3977 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3967 +#: ../../howto/logging-cookbook.rst:3980 msgid "" "import sys\n" "\n" @@ -5086,7 +5107,7 @@ msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)" msgstr "" -#: ../../howto/logging-cookbook.rst:3974 +#: ../../howto/logging-cookbook.rst:3987 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." @@ -5094,7 +5115,7 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3979 +#: ../../howto/logging-cookbook.rst:3992 msgid "" ">>> print('Foo')\n" "INFO:demo:Foo\n" @@ -5103,31 +5124,31 @@ msgid "" ">>>" msgstr "" -#: ../../howto/logging-cookbook.rst:3987 +#: ../../howto/logging-cookbook.rst:4000 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:3991 +#: ../../howto/logging-cookbook.rst:4004 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:3995 +#: ../../howto/logging-cookbook.rst:4008 msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" -#: ../../howto/logging-cookbook.rst:4000 +#: ../../howto/logging-cookbook.rst:4013 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:4002 +#: ../../howto/logging-cookbook.rst:4015 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "\n" @@ -5146,7 +5167,7 @@ msgid "" "WARNING:demo:division by zero" msgstr "" -#: ../../howto/logging-cookbook.rst:4018 +#: ../../howto/logging-cookbook.rst:4031 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -5156,7 +5177,7 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:4024 +#: ../../howto/logging-cookbook.rst:4037 msgid "" "class BufferingLoggerWriter(LoggerWriter):\n" " def __init__(self, logger, level):\n" @@ -5176,13 +5197,13 @@ msgid "" " self.logger.log(self.level, part)" msgstr "" -#: ../../howto/logging-cookbook.rst:4043 +#: ../../howto/logging-cookbook.rst:4056 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:4046 +#: ../../howto/logging-cookbook.rst:4059 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " @@ -5194,11 +5215,11 @@ msgid "" "WARNING:demo:ZeroDivisionError: division by zero" msgstr "" -#: ../../howto/logging-cookbook.rst:4059 +#: ../../howto/logging-cookbook.rst:4072 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:4061 +#: ../../howto/logging-cookbook.rst:4074 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 " @@ -5206,11 +5227,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:4067 +#: ../../howto/logging-cookbook.rst:4080 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:4069 +#: ../../howto/logging-cookbook.rst:4082 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. " @@ -5218,32 +5239,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:4074 +#: ../../howto/logging-cookbook.rst:4087 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:4077 +#: ../../howto/logging-cookbook.rst:4090 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:4080 +#: ../../howto/logging-cookbook.rst:4093 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:4084 +#: ../../howto/logging-cookbook.rst:4097 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:4087 +#: ../../howto/logging-cookbook.rst:4100 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 " @@ -5252,7 +5273,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:4093 +#: ../../howto/logging-cookbook.rst:4106 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 " @@ -5262,17 +5283,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:4100 +#: ../../howto/logging-cookbook.rst:4113 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:4104 +#: ../../howto/logging-cookbook.rst:4117 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:4106 +#: ../../howto/logging-cookbook.rst:4119 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 " @@ -5283,13 +5304,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:4115 +#: ../../howto/logging-cookbook.rst:4128 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: ../../howto/logging-cookbook.rst:4117 +#: ../../howto/logging-cookbook.rst:4130 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5297,11 +5318,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:4123 +#: ../../howto/logging-cookbook.rst:4136 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:4125 +#: ../../howto/logging-cookbook.rst:4138 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. " @@ -5312,38 +5333,38 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:4136 +#: ../../howto/logging-cookbook.rst:4149 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:4140 +#: ../../howto/logging-cookbook.rst:4153 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:4141 +#: ../../howto/logging-cookbook.rst:4154 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4143 +#: ../../howto/logging-cookbook.rst:4156 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:4144 +#: ../../howto/logging-cookbook.rst:4157 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4146 +#: ../../howto/logging-cookbook.rst:4159 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:4147 +#: ../../howto/logging-cookbook.rst:4160 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:4149 +#: ../../howto/logging-cookbook.rst:4162 msgid ":ref:`Basic Tutorial <logging-basic-tutorial>`" msgstr ":ref:`基礎教學 <logging-basic-tutorial>`" -#: ../../howto/logging-cookbook.rst:4151 +#: ../../howto/logging-cookbook.rst:4164 msgid ":ref:`Advanced Tutorial <logging-advanced-tutorial>`" msgstr ":ref:`進階教學 <logging-advanced-tutorial>`" diff --git a/howto/regex.po b/howto/regex.po index 825d7f2aff..44073c8f31 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -918,9 +918,10 @@ msgid "" msgstr "" #: ../../howto/regex.rst:483 +#, fuzzy msgid "" ">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" -">>> iterator \n" +">>> iterator\n" "<callable_iterator object at 0x...>\n" ">>> for match in iterator:\n" "... print(match.span())\n" @@ -954,10 +955,11 @@ msgid "" msgstr "" #: ../../howto/regex.rst:504 +#, fuzzy msgid "" ">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" "None\n" -">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998') \n" +">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" "<re.Match object; span=(0, 5), match='From '>" msgstr "" ">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" @@ -1069,13 +1071,13 @@ msgid "" "letters, too. Full Unicode matching also works unless the :const:`ASCII` " "flag is used to disable non-ASCII matches. When the Unicode patterns ``[a-" "z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, " -"they will match the 52 ASCII letters and 4 additional non-ASCII letters: 'İ' " -"(U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin small " -"letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, " -"Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, ``'spAM'``, or " -"``'ſpam'`` (the latter is matched only in Unicode mode). This lowercasing " -"doesn't take the current locale into account; it will if you also set the :" -"const:`LOCALE` flag." +"they will match the 52 ASCII letters and 4 additional non-ASCII letters: " +"'İ' (U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin " +"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and " +"'K' (U+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " +"``'spAM'``, or ``'ſpam'`` (the latter is matched only in Unicode mode). This " +"lowercasing doesn't take the current locale into account; it will if you " +"also set the :const:`LOCALE` flag." msgstr "" #: ../../howto/regex.rst:581 @@ -1257,8 +1259,9 @@ msgid "" msgstr "" #: ../../howto/regex.rst:714 +#, fuzzy msgid "" -">>> print(re.search('^From', 'From Here to Eternity')) \n" +">>> print(re.search('^From', 'From Here to Eternity'))\n" "<re.Match object; span=(0, 4), match='From'>\n" ">>> print(re.search('^From', 'Reciting From Memory'))\n" "None" @@ -1283,12 +1286,13 @@ msgid "" msgstr "" #: ../../howto/regex.rst:725 +#, fuzzy msgid "" -">>> print(re.search('}$', '{block}')) \n" +">>> print(re.search('}$', '{block}'))\n" "<re.Match object; span=(6, 7), match='}'>\n" ">>> print(re.search('}$', '{block} '))\n" "None\n" -">>> print(re.search('}$', '{block}\\n')) \n" +">>> print(re.search('}$', '{block}\\n'))\n" "<re.Match object; span=(6, 7), match='}'>" msgstr "" ">>> print(re.search('}$', '{block}')) \n" diff --git a/howto/unicode.po b/howto/unicode.po index b7b29e8cd1..3fc75e0a1f 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -405,8 +405,9 @@ msgid "" msgstr "" #: ../../howto/unicode.rst:236 +#, fuzzy msgid "" -">>> b'\\x80abc'.decode(\"utf-8\", \"strict\") \n" +">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" "Traceback (most recent call last):\n" " ...\n" "UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" @@ -487,11 +488,12 @@ msgid "The following example shows the different results::" msgstr "" #: ../../howto/unicode.rst:282 +#, fuzzy msgid "" ">>> u = chr(40960) + 'abcd' + chr(1972)\n" ">>> u.encode('utf-8')\n" "b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" -">>> u.encode('ascii') \n" +">>> u.encode('ascii')\n" "Traceback (most recent call last):\n" " ...\n" "UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" diff --git a/howto/urllib2.po b/howto/urllib2.po index 4e79e88dd9..9b78d824df 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,6 +266,7 @@ msgid "This is done as follows::" msgstr "" #: ../../howto/urllib2.rst:141 +#, fuzzy msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -274,7 +275,7 @@ msgid "" ">>> data['location'] = 'Northampton'\n" ">>> data['language'] = 'Python'\n" ">>> url_values = urllib.parse.urlencode(data)\n" -">>> print(url_values) # The order may differ from below. \n" +">>> print(url_values) # The order may differ from below.\n" "name=Somebody+Here&language=Python&location=Northampton\n" ">>> url = 'http://www.example.com/example.cgi'\n" ">>> full_url = url + '?' + url_values\n" @@ -401,11 +402,12 @@ msgid "e.g. ::" msgstr "例如: ::" #: ../../howto/urllib2.rst:216 +#, fuzzy msgid "" ">>> req = urllib.request.Request('http://www.pretend_server.org')\n" ">>> try: urllib.request.urlopen(req)\n" "... except urllib.error.URLError as e:\n" -"... print(e.reason) \n" +"... print(e.reason)\n" "...\n" "(4, 'getaddrinfo failed')" msgstr "" @@ -542,13 +544,14 @@ msgid "" msgstr "" #: ../../howto/urllib2.rst:324 +#, fuzzy msgid "" ">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" ">>> try:\n" "... urllib.request.urlopen(req)\n" "... except urllib.error.HTTPError as e:\n" "... print(e.code)\n" -"... print(e.read()) \n" +"... print(e.read())\n" "...\n" "404\n" "b'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" diff --git a/library/abc.po b/library/abc.po index b8f6fa2e7a..bc726a6c9b 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -271,12 +271,13 @@ msgstr "" "MyIterable.register(Foo)" #: ../../library/abc.rst:143 +#, fuzzy msgid "" -"The ABC ``MyIterable`` defines the standard iterable method, :meth:" -"`~iterator.__iter__`, as an abstract method. The implementation given here " -"can still be called from subclasses. The :meth:`!get_iterator` method is " -"also part of the ``MyIterable`` abstract base class, but it does not have to " -"be overridden in non-abstract derived classes." +"The ABC ``MyIterable`` defines the standard iterable method, :meth:`~object." +"__iter__`, as an abstract method. The implementation given here can still " +"be called from subclasses. The :meth:`!get_iterator` method is also part of " +"the ``MyIterable`` abstract base class, but it does not have to be " +"overridden in non-abstract derived classes." msgstr "" "ABC ``MyIterable`` 定義了作為抽象方法的一個標準疊代方法 :meth:`~iterator." "__iter__`。這裡給定的實作仍可在子類別中被呼叫。:meth:`!get_iterator` 方法也" @@ -286,18 +287,19 @@ msgstr "" #, fuzzy msgid "" "The :meth:`__subclasshook__` class method defined here says that any class " -"that has an :meth:`~iterator.__iter__` method in its :attr:`~object." -"__dict__` (or in that of one of its base classes, accessed via the :attr:" -"`~type.__mro__` list) is considered a ``MyIterable`` too." +"that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` " +"(or in that of one of its base classes, accessed via the :attr:`~type." +"__mro__` list) is considered a ``MyIterable`` too." msgstr "" "這裡定義的 :meth:`__subclasshook__` 類別方法說明任何在其 :attr:`~object." "__dict__` (或在其透過 :attr:`~class.__mro__` 列表訪問的基底類別) 中具有 :" "meth:`~iterator.__iter__` 方法的類別也都會被視為 ``MyIterable``。" #: ../../library/abc.rst:154 +#, fuzzy msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " -"even though it does not define an :meth:`~iterator.__iter__` method (it uses " +"even though it does not define an :meth:`~object.__iter__` method (it uses " "the old-style iterable protocol, defined in terms of :meth:`~object.__len__` " "and :meth:`~object.__getitem__`). Note that this will not make " "``get_iterator`` available as a method of ``Foo``, so it is provided " diff --git a/library/argparse.po b/library/argparse.po index 106376b879..d209f99f00 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-29 16:19+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2174,7 +2174,7 @@ msgid "" ">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" ">>> parser.parse_args([])\n" "Namespace(legs=0)\n" -">>> parser.parse_args(['--legs', '4']) \n" +">>> parser.parse_args(['--legs', '4'])\n" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index eb6060100f..e8aaf59025 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -278,7 +278,7 @@ msgid "" "called after the event loop is closed." msgstr "此方法是冪等且不可逆的。在事件迴圈關閉後不應呼叫其他方法。" -#: ../../library/asyncio-eventloop.rst:167 +#: ../../library/asyncio-eventloop.rst:168 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " "with an :meth:`~agen.aclose` call. After calling this method, the event " @@ -289,19 +289,19 @@ msgstr "" "用 :meth:`~agen.aclose` 呼叫來關閉。呼叫此方法後,如果疊代新的非同步產生器," "事件迴圈將發出警告。應該使用此方法可靠地完成所有已排程的非同步產生器。" -#: ../../library/asyncio-eventloop.rst:173 +#: ../../library/asyncio-eventloop.rst:174 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "請注意,使用 :func:`asyncio.run` 時不需要呼叫此函式。" -#: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1278 -#: ../../library/asyncio-eventloop.rst:1721 +#: ../../library/asyncio-eventloop.rst:177 +#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1748 msgid "Example::" msgstr "範例: ::" -#: ../../library/asyncio-eventloop.rst:178 +#: ../../library/asyncio-eventloop.rst:179 msgid "" "try:\n" " loop.run_forever()\n" @@ -315,7 +315,7 @@ msgstr "" " loop.run_until_complete(loop.shutdown_asyncgens())\n" " loop.close()" -#: ../../library/asyncio-eventloop.rst:188 +#: ../../library/asyncio-eventloop.rst:190 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " @@ -326,7 +326,7 @@ msgstr "" "ThreadPoolExecutor` 中的所有執行緒。一旦呼叫了此方法,使用預設執行器與 :meth:" "`loop.run_in_executor` 將引發 :exc:`RuntimeError`。" -#: ../../library/asyncio-eventloop.rst:194 +#: ../../library/asyncio-eventloop.rst:196 msgid "" "The *timeout* parameter specifies the amount of time (in :class:`float` " "seconds) the executor will be given to finish joining. With the default, " @@ -335,7 +335,7 @@ msgstr "" "*timeout* 參數指定執行器完成加入所需的時間(以 :class:`float` 秒為單位)。預" "設情況下為 ``None``,不會限制執行器所花費的時間。" -#: ../../library/asyncio-eventloop.rst:199 +#: ../../library/asyncio-eventloop.rst:201 msgid "" "If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " "default executor is terminated without waiting for its threads to finish " @@ -344,7 +344,7 @@ msgstr "" "如果達到 *timeout*,將發出 :exc:`RuntimeWarning` 警告,預設執行器將立即終止," "不等待其執行緒完成加入。" -#: ../../library/asyncio-eventloop.rst:205 +#: ../../library/asyncio-eventloop.rst:207 msgid "" "Do not call this method when using :func:`asyncio.run`, as the latter " "handles default executor shutdown automatically." @@ -352,34 +352,34 @@ msgstr "" "使用 :func:`asyncio.run` 時請勿呼叫此方法,因為後者會自動處理預設執行器的關" "閉。" -#: ../../library/asyncio-eventloop.rst:210 +#: ../../library/asyncio-eventloop.rst:212 msgid "Added the *timeout* parameter." msgstr "加入 *timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:214 +#: ../../library/asyncio-eventloop.rst:216 msgid "Scheduling callbacks" msgstr "排程回呼函式" -#: ../../library/asyncio-eventloop.rst:218 +#: ../../library/asyncio-eventloop.rst:220 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" "在事件迴圈的下一次疊代中排程以 *args* 引數呼叫 *callback* :term:`callback`。" -#: ../../library/asyncio-eventloop.rst:221 +#: ../../library/asyncio-eventloop.rst:223 msgid "" "Return an instance of :class:`asyncio.Handle`, which can be used later to " "cancel the callback." msgstr "回傳 :class:`asyncio.Handle` 的實例,稍後可以用於取消回呼函式。" -#: ../../library/asyncio-eventloop.rst:224 +#: ../../library/asyncio-eventloop.rst:226 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." msgstr "回呼函式按照其註冊的順序呼叫。每個回呼函式將被呼叫恰好一次。" -#: ../../library/asyncio-eventloop.rst:227 +#: ../../library/asyncio-eventloop.rst:229 msgid "" "The optional keyword-only *context* argument specifies a custom :class:" "`contextvars.Context` for the *callback* to run in. Callbacks use the " @@ -388,11 +388,11 @@ msgstr "" "選用的僅限關鍵字引數 *context* 指定了要給 *callback* 執行的自定義 :class:" "`contextvars.Context`。當未提供 *context* 時,回呼函式使用當前情境。" -#: ../../library/asyncio-eventloop.rst:231 +#: ../../library/asyncio-eventloop.rst:233 msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." msgstr "與 :meth:`call_soon_threadsafe` 不同,此方法不是執行緒安全的。" -#: ../../library/asyncio-eventloop.rst:235 +#: ../../library/asyncio-eventloop.rst:237 msgid "" "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 " @@ -401,14 +401,14 @@ msgstr "" "這是 :meth:`call_soon` 的執行緒安全變體。當從另一個執行緒排程回呼函式時,*必" "須*\\ 使用此函式,因為 :meth:`call_soon` 不是執行緒安全的。" -#: ../../library/asyncio-eventloop.rst:239 +#: ../../library/asyncio-eventloop.rst:241 msgid "" "This function is safe to be called from a reentrant context or signal " "handler, however, it is not safe or fruitful to use the returned handle in " "such contexts." msgstr "" -#: ../../library/asyncio-eventloop.rst:242 +#: ../../library/asyncio-eventloop.rst:244 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." @@ -416,21 +416,21 @@ msgstr "" "如果在已關閉的迴圈上呼叫,則引發 :exc:`RuntimeError`。在主應用程式關閉時,這" "可能發生在次要執行緒上。" -#: ../../library/asyncio-eventloop.rst:246 +#: ../../library/asyncio-eventloop.rst:248 msgid "" "See the :ref:`concurrency and multithreading <asyncio-multithreading>` " "section of the documentation." msgstr "請參閱文件的\\ :ref:`並行和多執行緒 <asyncio-multithreading>`\\ 部分。" -#: ../../library/asyncio-eventloop.rst:249 -#: ../../library/asyncio-eventloop.rst:299 -#: ../../library/asyncio-eventloop.rst:319 +#: ../../library/asyncio-eventloop.rst:251 +#: ../../library/asyncio-eventloop.rst:301 +#: ../../library/asyncio-eventloop.rst:321 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "新增了 *context* 僅限關鍵字參數。詳細資訊請參閱 :pep:`567`。" -#: ../../library/asyncio-eventloop.rst:257 +#: ../../library/asyncio-eventloop.rst:259 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" @@ -438,14 +438,14 @@ msgstr "" "大多數 :mod:`asyncio` 排程函式不允許傳遞關鍵字引數。要傳遞關鍵字引數,請使" "用 :func:`functools.partial`: ::" -#: ../../library/asyncio-eventloop.rst:260 +#: ../../library/asyncio-eventloop.rst:262 msgid "" "# will schedule \"print(\"Hello\", flush=True)\"\n" "loop.call_soon(\n" " functools.partial(print, \"Hello\", flush=True))" msgstr "" -#: ../../library/asyncio-eventloop.rst:264 +#: ../../library/asyncio-eventloop.rst:266 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." @@ -453,11 +453,11 @@ msgstr "" "通常使用 partial 物件比使用 lambda 更方便,因為 asyncio 可以在除錯和錯誤訊息" "中更好地呈現 partial 物件。" -#: ../../library/asyncio-eventloop.rst:272 +#: ../../library/asyncio-eventloop.rst:274 msgid "Scheduling delayed callbacks" msgstr "排程延遲的回呼函式" -#: ../../library/asyncio-eventloop.rst:274 +#: ../../library/asyncio-eventloop.rst:276 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." @@ -465,20 +465,20 @@ msgstr "" "事件迴圈提供為回呼函式排程在將來某個時間點才呼叫的機制。事件迴圈使用了單調時" "鐘來追蹤時間。" -#: ../../library/asyncio-eventloop.rst:281 +#: ../../library/asyncio-eventloop.rst:283 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "排程 *callback* 在給定的 *delay* 秒數後呼叫(可以是整數或浮點數)。" -#: ../../library/asyncio-eventloop.rst:284 -#: ../../library/asyncio-eventloop.rst:316 +#: ../../library/asyncio-eventloop.rst:286 +#: ../../library/asyncio-eventloop.rst:318 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "回傳 :class:`asyncio.TimerHandle` 的實例,可用於取消回呼函式。" -#: ../../library/asyncio-eventloop.rst:287 +#: ../../library/asyncio-eventloop.rst:289 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." @@ -486,7 +486,7 @@ msgstr "" "*callback* 將只被呼叫恰好一次。如果有兩個回呼函式被排程在完全相同的時間,則其" "呼叫順序是不定的。" -#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:293 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 :" @@ -495,7 +495,7 @@ msgstr "" "可選的位置引數 *args* 將在呼叫回呼函式時傳遞。如果要使用關鍵字引數呼叫回呼函" "數,請使用 :func:`functools.partial`。" -#: ../../library/asyncio-eventloop.rst:295 +#: ../../library/asyncio-eventloop.rst:297 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " @@ -504,7 +504,7 @@ msgstr "" "可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義的 :class:" "`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用當前情境。" -#: ../../library/asyncio-eventloop.rst:303 +#: ../../library/asyncio-eventloop.rst:305 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." @@ -512,7 +512,7 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*delay* 不能超過一天。這" "在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:310 +#: ../../library/asyncio-eventloop.rst:312 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`." @@ -520,11 +520,11 @@ msgstr "" "排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用與 :" "meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:314 +#: ../../library/asyncio-eventloop.rst:316 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "此方法的行為與 :meth:`call_later` 相同。" -#: ../../library/asyncio-eventloop.rst:323 +#: ../../library/asyncio-eventloop.rst:325 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. " @@ -533,13 +533,13 @@ msgstr "" "在 Python 3.7 及更早版本中,使用預設事件迴圈實作時,*when* 和當前時間之間的差" "值不能超過一天。這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:330 +#: ../../library/asyncio-eventloop.rst:332 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "根據事件迴圈的內部單調時鐘,回傳當前時間,以 :class:`float` 值表示。" -#: ../../library/asyncio-eventloop.rst:334 +#: ../../library/asyncio-eventloop.rst:336 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." @@ -547,19 +547,19 @@ msgstr "" "在 Python 3.7 及更早版本中,超時(相對 *delay* 或絕對 *when*)不應超過一天。" "這在 Python 3.8 中已經修復。" -#: ../../library/asyncio-eventloop.rst:340 +#: ../../library/asyncio-eventloop.rst:342 msgid "The :func:`asyncio.sleep` function." msgstr "函式 :func:`asyncio.sleep`。" -#: ../../library/asyncio-eventloop.rst:344 +#: ../../library/asyncio-eventloop.rst:346 msgid "Creating Futures and Tasks" msgstr "建立 Futures 和 Tasks" -#: ../../library/asyncio-eventloop.rst:348 +#: ../../library/asyncio-eventloop.rst:350 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "建立附加到事件迴圈的 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:350 +#: ../../library/asyncio-eventloop.rst:352 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " @@ -568,13 +568,13 @@ msgstr "" "這是在 asyncio 中建立 Futures 的首選方式。這允許第三方事件迴圈提供 Future 物" "件的替代實作(具有更好的性能或儀器計測表現)。" -#: ../../library/asyncio-eventloop.rst:358 +#: ../../library/asyncio-eventloop.rst:360 msgid "" "Schedule the execution of :ref:`coroutine <coroutine>` *coro*. Return a :" "class:`Task` object." msgstr "排程執行\\ :ref:`協程 <coroutine>` *coro*。回傳 :class:`Task` 物件。" -#: ../../library/asyncio-eventloop.rst:361 +#: ../../library/asyncio-eventloop.rst:363 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:" @@ -583,7 +583,7 @@ msgstr "" "第三方事件迴圈可以使用其自己的 :class:`Task` 子類別以實現互操作性" "(interoperability)。在這種情況下,結果類型是 :class:`Task` 的子類別。" -#: ../../library/asyncio-eventloop.rst:365 +#: ../../library/asyncio-eventloop.rst:367 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." @@ -591,7 +591,7 @@ msgstr "" "如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使用 :meth:" "`Task.set_name`。" -#: ../../library/asyncio-eventloop.rst:368 +#: ../../library/asyncio-eventloop.rst:370 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " @@ -601,19 +601,19 @@ msgstr "" "`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立當前情境的副" "本。" -#: ../../library/asyncio-eventloop.rst:372 +#: ../../library/asyncio-eventloop.rst:374 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:375 +#: ../../library/asyncio-eventloop.rst:377 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:380 +#: ../../library/asyncio-eventloop.rst:382 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "設置將由 :meth:`loop.create_task` 使用的任務工廠。" -#: ../../library/asyncio-eventloop.rst:383 +#: ../../library/asyncio-eventloop.rst:385 #, fuzzy msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " @@ -627,21 +627,21 @@ msgstr "" "事件迴圈的參照,*coro* 是一個協程物件。該可呼叫物件必須回傳一個與 :class:" "`asyncio.Future` 相容的物件。" -#: ../../library/asyncio-eventloop.rst:391 +#: ../../library/asyncio-eventloop.rst:393 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "回傳任務工廠,如果使用預設任務工廠則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:395 +#: ../../library/asyncio-eventloop.rst:397 msgid "Opening network connections" msgstr "打開網路連線" -#: ../../library/asyncio-eventloop.rst:406 +#: ../../library/asyncio-eventloop.rst:409 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "打開以 *host* 和 *port* 指定之給定地址的串流傳輸連線。" -#: ../../library/asyncio-eventloop.rst:409 +#: ../../library/asyncio-eventloop.rst:412 msgid "" "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 " @@ -650,13 +650,13 @@ msgstr "" "根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以是 :py:const:" "`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" -#: ../../library/asyncio-eventloop.rst:413 +#: ../../library/asyncio-eventloop.rst:416 msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_STREAM`。" -#: ../../library/asyncio-eventloop.rst:415 -#: ../../library/asyncio-eventloop.rst:1189 -#: ../../library/asyncio-eventloop.rst:1205 +#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:1211 +#: ../../library/asyncio-eventloop.rst:1228 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "<asyncio-protocol>` implementation." @@ -664,24 +664,24 @@ msgstr "" "*protocol_factory* 必須是一個回傳 :ref:`asyncio protocol <asyncio-protocol>` " "實作的可呼叫函式。" -#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:421 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" "此方法將嘗試在背景建立連線。成功時,它將回傳一對 ``(transport, protocol)``。" -#: ../../library/asyncio-eventloop.rst:421 +#: ../../library/asyncio-eventloop.rst:424 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "底層操作的時間軸簡介如下:" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:426 msgid "" "The connection is established and a :ref:`transport <asyncio-transport>` is " "created for it." msgstr "建立連線並為其建立\\ :ref:`傳輸 <asyncio-transport>`。" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:429 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol <asyncio-protocol>` instance." @@ -689,7 +689,7 @@ msgstr "" "*protocol_factory* 在無引數的情況下被呼叫,並且預計回傳一個 :ref:`協定 " "<asyncio-protocol>` 實例。" -#: ../../library/asyncio-eventloop.rst:429 +#: ../../library/asyncio-eventloop.rst:432 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." @@ -697,21 +697,21 @@ msgstr "" "通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協議實例與傳輸連線在" "一起。" -#: ../../library/asyncio-eventloop.rst:432 +#: ../../library/asyncio-eventloop.rst:435 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "成功時回傳一個 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:434 +#: ../../library/asyncio-eventloop.rst:437 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "建立的傳輸是一個依賴實作的雙向串流。" -#: ../../library/asyncio-eventloop.rst:437 -#: ../../library/asyncio-eventloop.rst:569 +#: ../../library/asyncio-eventloop.rst:440 +#: ../../library/asyncio-eventloop.rst:573 msgid "Other arguments:" msgstr "其他引數:" -#: ../../library/asyncio-eventloop.rst:439 +#: ../../library/asyncio-eventloop.rst:442 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` " @@ -723,11 +723,11 @@ msgstr "" "果 *ssl* 為 :class:`ssl.SSLContext` 物件,則使用該情境來建立傳輸;如果 *ssl* " "為 :const:`True`,則使用 :func:`ssl.create_default_context` 回傳的預設情境。" -#: ../../library/asyncio-eventloop.rst:445 +#: ../../library/asyncio-eventloop.rst:448 msgid ":ref:`SSL/TLS security considerations <ssl-security>`" msgstr ":ref:`SSL/TLS 安全考量 <ssl-security>`" -#: ../../library/asyncio-eventloop.rst:447 +#: ../../library/asyncio-eventloop.rst:450 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 " @@ -742,7 +742,7 @@ msgstr "" "預設值,必須傳遞 *server_hostname* 的值。若 *server_hostname* 為空字串,將停" "用主機名稱匹配(這是一個嚴重的安全風險,可能導致中間人攻擊)。" -#: ../../library/asyncio-eventloop.rst:455 +#: ../../library/asyncio-eventloop.rst:458 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -753,7 +753,7 @@ msgstr "" "getaddrinfo() 進行 *host* 解析。若有給定這些應該都是相應 :mod:`socket` 模組常" "數的整數。" -#: ../../library/asyncio-eventloop.rst:460 +#: ../../library/asyncio-eventloop.rst:463 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -767,7 +767,7 @@ msgstr "" "`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒(250 毫" "秒)。" -#: ../../library/asyncio-eventloop.rst:468 +#: ../../library/asyncio-eventloop.rst:471 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -783,7 +783,7 @@ msgstr "" "族計數」。如果未指定 *happy_eyeballs_delay*,則預設值為 ``0``,如果指定則為 " "``1``。" -#: ../../library/asyncio-eventloop.rst:477 +#: ../../library/asyncio-eventloop.rst:480 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 " @@ -794,9 +794,9 @@ msgstr "" "輸使用。如果提供了 *sock*,則不應指定 *host*、*port*、*family*、*proto*、" "*flags*、*happy_eyeballs_delay*、*interleave* 和 *local_addr* 中的任何一項。" -#: ../../library/asyncio-eventloop.rst:485 -#: ../../library/asyncio-eventloop.rst:600 -#: ../../library/asyncio-eventloop.rst:844 +#: ../../library/asyncio-eventloop.rst:488 +#: ../../library/asyncio-eventloop.rst:604 +#: ../../library/asyncio-eventloop.rst:852 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -805,7 +805,7 @@ msgstr "" "引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸的 :meth:" "`~asyncio.BaseTransport.close` 方法。" -#: ../../library/asyncio-eventloop.rst:489 +#: ../../library/asyncio-eventloop.rst:492 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 " @@ -815,8 +815,8 @@ msgstr "" "地綁定 socket。將使用 ``getaddrinfo()`` 查找 *local_host* 和 *local_port*,方" "式類似於 *host* 和 *port*。" -#: ../../library/asyncio-eventloop.rst:493 -#: ../../library/asyncio-eventloop.rst:938 +#: ../../library/asyncio-eventloop.rst:496 +#: ../../library/asyncio-eventloop.rst:948 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. " @@ -826,10 +826,10 @@ msgstr "" "在那之前若未完成則會中斷連線。如果為 ``None`` (預設值),則會等待 ``60.0`` " "秒。" -#: ../../library/asyncio-eventloop.rst:497 -#: ../../library/asyncio-eventloop.rst:753 -#: ../../library/asyncio-eventloop.rst:855 -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:500 +#: ../../library/asyncio-eventloop.rst:759 +#: ../../library/asyncio-eventloop.rst:863 +#: ../../library/asyncio-eventloop.rst:952 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`` " @@ -838,7 +838,7 @@ msgstr "" "*ssl_shutdown_timeout* 是等待 SSL 關閉完成以前中斷連線的時間,以秒為單位。如" "果為 ``None`` (預設值),則會等待 ``30.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:501 +#: ../../library/asyncio-eventloop.rst:504 msgid "" "*all_errors* determines what exceptions are raised when a connection cannot " "be created. By default, only a single ``Exception`` is raised: the first " @@ -852,12 +852,12 @@ msgstr "" "包含所有錯誤訊息的單一 ``OSError``。當 ``all_errors`` 為 ``True`` 時,將引發" "包含所有例外的 ``ExceptionGroup`` (即使只有一個例外)。" -#: ../../library/asyncio-eventloop.rst:511 -#: ../../library/asyncio-eventloop.rst:765 +#: ../../library/asyncio-eventloop.rst:514 +#: ../../library/asyncio-eventloop.rst:771 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" -#: ../../library/asyncio-eventloop.rst:515 +#: ../../library/asyncio-eventloop.rst:518 msgid "" "The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set " "by default for all TCP connections." @@ -865,16 +865,16 @@ msgstr "" "所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY <socket-unix-constants>` " "socket 選項。" -#: ../../library/asyncio-eventloop.rst:520 -#: ../../library/asyncio-eventloop.rst:865 +#: ../../library/asyncio-eventloop.rst:523 +#: ../../library/asyncio-eventloop.rst:873 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:524 +#: ../../library/asyncio-eventloop.rst:527 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:526 +#: ../../library/asyncio-eventloop.rst:529 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 " @@ -890,24 +890,24 @@ msgstr "" "用戶端的使用者體驗變差。本文件具體說明了減少此用戶可見延遲的演算法要求並提供" "了一種演算法。" -#: ../../library/asyncio-eventloop.rst:535 +#: ../../library/asyncio-eventloop.rst:538 msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:539 -#: ../../library/asyncio-eventloop.rst:663 -#: ../../library/asyncio-eventloop.rst:779 -#: ../../library/asyncio-eventloop.rst:818 -#: ../../library/asyncio-eventloop.rst:869 -#: ../../library/asyncio-eventloop.rst:950 +#: ../../library/asyncio-eventloop.rst:542 +#: ../../library/asyncio-eventloop.rst:668 +#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:960 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:541 +#: ../../library/asyncio-eventloop.rst:544 msgid "*all_errors* was added." msgstr "已新增 *all_errors*。" -#: ../../library/asyncio-eventloop.rst:546 +#: ../../library/asyncio-eventloop.rst:549 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " @@ -916,11 +916,11 @@ msgstr "" "函式 :func:`open_connection` 是高階的替代 API。它回傳一對 (:class:" "`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中使用。" -#: ../../library/asyncio-eventloop.rst:556 +#: ../../library/asyncio-eventloop.rst:560 msgid "Create a datagram connection." msgstr "建立一個資料報連線。" -#: ../../library/asyncio-eventloop.rst:558 +#: ../../library/asyncio-eventloop.rst:562 msgid "" "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 " @@ -930,13 +930,13 @@ msgstr "" "或 :py:const:`~socket.AF_UNIX`,視乎 *host*\\ (或提供的 *family* 引數)而" "定。" -#: ../../library/asyncio-eventloop.rst:562 +#: ../../library/asyncio-eventloop.rst:566 msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "Socket 類型將為 :py:const:`~socket.SOCK_DGRAM`。" -#: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:689 -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:568 +#: ../../library/asyncio-eventloop.rst:695 +#: ../../library/asyncio-eventloop.rst:844 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol <asyncio-" "protocol>` implementation." @@ -944,12 +944,12 @@ msgstr "" "*protocol_factory* 必須是可呼叫的函式,回傳 :ref:`protocol <asyncio-" "protocol>` 實作。" -#: ../../library/asyncio-eventloop.rst:567 -#: ../../library/asyncio-eventloop.rst:645 +#: ../../library/asyncio-eventloop.rst:571 +#: ../../library/asyncio-eventloop.rst:650 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "成功時回傳 ``(transport, protocol)`` 元組。" -#: ../../library/asyncio-eventloop.rst:571 +#: ../../library/asyncio-eventloop.rst:575 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 :" @@ -958,7 +958,7 @@ msgstr "" "*local_addr*,如果提供,是一個 ``(local_host, local_port)`` 元組,用於在本地" "綁定 socket。*local_host* 和 *local_port* 使用 :meth:`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:575 +#: ../../library/asyncio-eventloop.rst:579 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* " @@ -968,7 +968,7 @@ msgstr "" "socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使用 :meth:" "`getaddrinfo` 來查找。" -#: ../../library/asyncio-eventloop.rst:579 +#: ../../library/asyncio-eventloop.rst:583 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -979,7 +979,7 @@ msgstr "" "的可選地址家族、協定和旗標。如果提供,這些應該都是來自相應的 :mod:`socket` 模" "組常數的整數。" -#: ../../library/asyncio-eventloop.rst:584 +#: ../../library/asyncio-eventloop.rst:588 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 " @@ -991,13 +991,13 @@ msgstr "" "時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定義 :py:" "const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" -#: ../../library/asyncio-eventloop.rst:590 +#: ../../library/asyncio-eventloop.rst:594 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "*allow_broadcast* 告訴核心允許此端點向廣播位址發送訊息。" -#: ../../library/asyncio-eventloop.rst:593 +#: ../../library/asyncio-eventloop.rst:597 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 " @@ -1008,7 +1008,7 @@ msgstr "" "供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須是 :const:" "`None`\\ )。" -#: ../../library/asyncio-eventloop.rst:604 +#: ../../library/asyncio-eventloop.rst:608 msgid "" "See :ref:`UDP echo client protocol <asyncio-udp-echo-client-protocol>` and :" "ref:`UDP echo server protocol <asyncio-udp-echo-server-protocol>` examples." @@ -1016,7 +1016,7 @@ msgstr "" "請參閱 :ref:`UDP 回應用戶端協議 <asyncio-udp-echo-client-protocol>` 和 :ref:" "`UDP 回應伺服器協議 <asyncio-udp-echo-server-protocol>` 範例。" -#: ../../library/asyncio-eventloop.rst:607 +#: ../../library/asyncio-eventloop.rst:611 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." @@ -1024,11 +1024,11 @@ msgstr "" "新增 *family*、*proto*、*flags*、*reuse_address*、*reuse_port*、" "*allow_broadcast* 和 *sock* 參數。" -#: ../../library/asyncio-eventloop.rst:611 +#: ../../library/asyncio-eventloop.rst:615 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:618 msgid "" "The *reuse_address* parameter is no longer supported, as using :ref:`socket." "SO_REUSEADDR <socket-unix-constants>` poses a significant security concern " @@ -1037,7 +1037,7 @@ msgstr "" "不再支援 *reuse_address* 參數,因為使用 :py:const:`~sockets.SO_REUSEADDR` 對" "於 UDP 存有重大的安全疑慮。明確傳遞 ``reuse_address=True`` 將引發例外。" -#: ../../library/asyncio-eventloop.rst:620 +#: ../../library/asyncio-eventloop.rst:624 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " @@ -1046,7 +1046,7 @@ msgstr "" "當具有不同 UID 的多個行程使用 ``SO_REUSEADDR`` 將 socket 分配給相同的 UDP " "socket 地址時,傳入的封包可能會在 socket 之間隨機分佈。" -#: ../../library/asyncio-eventloop.rst:624 +#: ../../library/asyncio-eventloop.rst:628 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT <socket-" @@ -1057,18 +1057,18 @@ msgstr "" "*reuse_port*,將改為使用 :py:const:`~sockets.SO_REUSEPORT`,該選項明確禁止具" "有不同 UID 的行程將 socket 分配給相同的 socket 地址。" -#: ../../library/asyncio-eventloop.rst:631 +#: ../../library/asyncio-eventloop.rst:635 msgid "" "The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" "自 Python 3.9.0、3.8.1、3.7.6 和 3.6.10 起,已完全移除 *reuse_address* 參數。" -#: ../../library/asyncio-eventloop.rst:640 +#: ../../library/asyncio-eventloop.rst:645 msgid "Create a Unix connection." msgstr "建立一個 Unix 連線。" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:647 msgid "" "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" "py:const:`~socket.SOCK_STREAM`." @@ -1076,7 +1076,7 @@ msgstr "" "Socket 家族將為 :py:const:`~socket.AF_UNIX`;socket 類型將為 :py:const:" "`~socket.SOCK_STREAM`。" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:652 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:" @@ -1085,22 +1085,22 @@ msgstr "" "*path* 是 Unix 域 socket 的名稱,除非指定 *sock* 參數,否則為必填。支援抽象 " "Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路徑。" -#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:657 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" "有關此方法的引數資訊,請參閱 :meth:`loop.create_connection` 方法的文件。" -#: ../../library/asyncio-eventloop.rst:655 -#: ../../library/asyncio-eventloop.rst:809 -#: ../../library/asyncio-eventloop.rst:1258 -#: ../../library/asyncio-eventloop.rst:1791 -#: ../../library/asyncio-eventloop.rst:1798 +#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:816 +#: ../../library/asyncio-eventloop.rst:1281 +#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1826 msgid "Availability" msgstr "" -#: ../../library/asyncio-eventloop.rst:657 +#: ../../library/asyncio-eventloop.rst:662 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." @@ -1108,11 +1108,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是 :term:`path-like " "object`。" -#: ../../library/asyncio-eventloop.rst:667 +#: ../../library/asyncio-eventloop.rst:672 msgid "Creating network servers" msgstr "建立網路伺服器" -#: ../../library/asyncio-eventloop.rst:682 +#: ../../library/asyncio-eventloop.rst:688 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." @@ -1120,33 +1120,33 @@ msgstr "" "建立一個 TCP 伺服器(socket 類型 :const:`~socket.SOCK_STREAM`\\ ),監聽 " "*host* 位址的 *port*。" -#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:691 msgid "Returns a :class:`Server` object." msgstr "回傳一個 :class:`Server` 物件。" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:693 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:692 +#: ../../library/asyncio-eventloop.rst:698 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "可以將 *host* 參數設為幾種類型,以確定伺服器將監聽的位置:" -#: ../../library/asyncio-eventloop.rst:695 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "如果 *host* 是字串,則 TCP 伺服器綁定到由 *host* 指定的單個網路介面。" -#: ../../library/asyncio-eventloop.rst:698 +#: ../../library/asyncio-eventloop.rst:704 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "如果 *host* 是字串序列,則 TCP 伺服器綁定到序列指定的所有網路介面。" -#: ../../library/asyncio-eventloop.rst:701 +#: ../../library/asyncio-eventloop.rst:707 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 " @@ -1155,7 +1155,7 @@ msgstr "" "若 *host* 是空字串或 ``None``,則所有介面都被假定並回傳多個 socket 的清單(可" "能一個用於 IPv4,另一個用於 IPv6)。" -#: ../../library/asyncio-eventloop.rst:705 +#: ../../library/asyncio-eventloop.rst:711 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 " @@ -1166,7 +1166,7 @@ msgstr "" "設值),將隨機選擇一個未使用的埠(請注意,如果 *host* 解析為多個網路介面,將" "為每個介面隨機選擇不同的隨機埠)。" -#: ../../library/asyncio-eventloop.rst:710 +#: ../../library/asyncio-eventloop.rst:716 msgid "" "*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* " @@ -1176,11 +1176,11 @@ msgstr "" "制使用 IPv4 或 IPv6。如果未設定,*family* 將從主機名稱決定(預設為 :const:" "`~socket.AF_UNSPEC`\\ )。" -#: ../../library/asyncio-eventloop.rst:715 +#: ../../library/asyncio-eventloop.rst:721 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "*flags* 是 :meth:`getaddrinfo` 的位元遮罩。" -#: ../../library/asyncio-eventloop.rst:717 +#: ../../library/asyncio-eventloop.rst:723 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." @@ -1188,7 +1188,7 @@ msgstr "" "可以可選地指定 *sock* 以使用現有的 socket 物件。如果指定了,*host* 和 *port* " "不能指定。" -#: ../../library/asyncio-eventloop.rst:722 +#: ../../library/asyncio-eventloop.rst:728 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." @@ -1196,7 +1196,7 @@ msgstr "" "*sock* 引數將 socket 的所有權轉移給建立的伺服器。要關閉 socket,請呼叫伺服器" "的 :meth:`~asyncio.Server.close` 方法。" -#: ../../library/asyncio-eventloop.rst:726 +#: ../../library/asyncio-eventloop.rst:732 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." @@ -1204,14 +1204,14 @@ msgstr "" "*backlog* 是傳遞給 :meth:`~socket.socket.listen` 的最大佇列連線數(預設為 " "100)。" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:735 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" "*ssl* 可以設定為 :class:`~ssl.SSLContext` 實例以在接受的連線上啟用 TLS。" -#: ../../library/asyncio-eventloop.rst:732 +#: ../../library/asyncio-eventloop.rst:738 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 " @@ -1220,7 +1220,7 @@ msgstr "" "*reuse_address* 告訴內核重用 ``TIME_WAIT`` 狀態下的本地 socket,而不等待其自" "然超時過期。如果未指定,在 Unix 上將自動設置為 ``True``。" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:743 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 " @@ -1229,18 +1229,18 @@ msgstr "" "*reuse_port* 告訴內核允許此端點繫結到與其他現有端點繫結的相同埠,只要它們在建" "立時都設置了此旗標。此選項在旗標 Windows 上不受支援。" -#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:748 msgid "" "*keep_alive* set to ``True`` keeps connections active by enabling the " "periodic transmission of messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:753 #, fuzzy msgid "Added the *keep_alive* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:749 +#: ../../library/asyncio-eventloop.rst:755 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`` " @@ -1249,7 +1249,7 @@ msgstr "" "(對於 TLS 伺服器)\\ *ssl_handshake_timeout* 是在中斷連線之前等待 TLS 握手完" "成的時間(以秒為單位)。如果為 ``None``\\ (預設),則為 ``60.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:757 +#: ../../library/asyncio-eventloop.rst:763 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1260,11 +1260,11 @@ msgstr "" "接。當設置為 ``False`` 時,用戶應該等待 :meth:`Server.start_serving` 或 :" "meth:`Server.serve_forever` 來使伺服器開始接受連線。" -#: ../../library/asyncio-eventloop.rst:769 +#: ../../library/asyncio-eventloop.rst:775 msgid "The *host* parameter can be a sequence of strings." msgstr "*host* 參數可以是字串序列。" -#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:779 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default " @@ -1273,7 +1273,7 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" "ref:`socket.TCP_NODELAY <socket-unix-constants>` socket 選項。" -#: ../../library/asyncio-eventloop.rst:783 +#: ../../library/asyncio-eventloop.rst:789 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " @@ -1282,7 +1282,7 @@ msgstr "" ":func:`start_server` 函式是一個更高階的替代 API,它回傳一對 :class:" "`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼中使用。" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:801 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." @@ -1290,7 +1290,7 @@ msgstr "" "類似 :meth:`loop.create_server`,但適用於 :py:const:`~socket.AF_UNIX` socket " "家族。" -#: ../../library/asyncio-eventloop.rst:797 +#: ../../library/asyncio-eventloop.rst:804 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`, " @@ -1300,20 +1300,20 @@ msgstr "" "象 Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路" "徑。" -#: ../../library/asyncio-eventloop.rst:802 +#: ../../library/asyncio-eventloop.rst:809 msgid "" "If *cleanup_socket* is true then the Unix socket will automatically be " "removed from the filesystem when the server is closed, unless the socket has " "been replaced after the server has been created." msgstr "" -#: ../../library/asyncio-eventloop.rst:806 +#: ../../library/asyncio-eventloop.rst:813 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "有關此方法的引數資訊,請參閱 :meth:`loop.create_server` 方法的文件。" -#: ../../library/asyncio-eventloop.rst:813 +#: ../../library/asyncio-eventloop.rst:820 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1321,27 +1321,27 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可為一" "個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:822 +#: ../../library/asyncio-eventloop.rst:829 #, fuzzy msgid "Added the *cleanup_socket* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:837 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "將已接受的連線包裝成傳輸層/協議對。" -#: ../../library/asyncio-eventloop.rst:831 +#: ../../library/asyncio-eventloop.rst:839 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "此方法可以由在 asyncio 外接受連線但使用 asyncio 處理連線的伺服器使用。" -#: ../../library/asyncio-eventloop.rst:834 -#: ../../library/asyncio-eventloop.rst:924 +#: ../../library/asyncio-eventloop.rst:842 +#: ../../library/asyncio-eventloop.rst:934 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:839 +#: ../../library/asyncio-eventloop.rst:847 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "<socket.socket.accept>`." @@ -1349,13 +1349,13 @@ msgstr "" "*sock* 是從 :meth:`socket.accept <socket.socket.accept>` 回傳的預先存在的 " "socket 物件。" -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:856 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "*ssl* 可以設置為 :class:`~ssl.SSLContext` 以在已接受的連線上啟用 SSL。" -#: ../../library/asyncio-eventloop.rst:851 +#: ../../library/asyncio-eventloop.rst:859 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. " @@ -1364,29 +1364,29 @@ msgstr "" "(對於 SSL 連線)\\ *ssl_handshake_timeout* 是在中斷連線之前等待 SSL 握手完成" "的時間(以秒為單位)。如果為 ``None``\\ (預設),則為 ``60.0`` 秒。" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:867 msgid "Returns a ``(transport, protocol)`` pair." msgstr "回傳 ``(transport, protocol)`` 對。" -#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:881 msgid "Transferring files" msgstr "傳輸檔案" -#: ../../library/asyncio-eventloop.rst:878 +#: ../../library/asyncio-eventloop.rst:887 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "通過 *transport* 發送 *file*。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:881 +#: ../../library/asyncio-eventloop.rst:890 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "如果可用,該方法使用高性能 :meth:`os.sendfile`。" -#: ../../library/asyncio-eventloop.rst:883 +#: ../../library/asyncio-eventloop.rst:892 msgid "*file* must be a regular file object opened in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:885 -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:894 +#: ../../library/asyncio-eventloop.rst:1155 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 " @@ -1398,7 +1398,7 @@ msgstr "" "不是發送檔案直到達到 EOF。即使此方法引發錯誤時,檔案位置也始終更新,可以使" "用 :meth:`file.tell() <io.IOBase.tell>` 取得實際發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:892 +#: ../../library/asyncio-eventloop.rst:901 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 " @@ -1407,7 +1407,7 @@ msgstr "" "將 *fallback* 設置為 ``True`` 會使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:896 +#: ../../library/asyncio-eventloop.rst:905 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." @@ -1415,15 +1415,15 @@ msgstr "" "如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引發 :exc:" "`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:912 msgid "TLS Upgrade" msgstr "TLS 升級" -#: ../../library/asyncio-eventloop.rst:910 +#: ../../library/asyncio-eventloop.rst:920 msgid "Upgrade an existing transport-based connection to TLS." msgstr "將基於傳輸的現有連線升級到 TLS。" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:922 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " @@ -1432,7 +1432,7 @@ msgstr "" "建立 TLS 編解碼器實例並在 *transport* 和 *protocol* 之間插入它。編解碼器既實" "作了對於 *transport* 的協議,也實作了對於 *protocol* 的傳輸。" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:926 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1443,13 +1443,13 @@ msgstr "" "*transport*,僅與回傳的物件通信,因為編碼器快取了 *protocol* 端的資料,並且" "與 *transport* 間歇性地交換額外的 TLS session 封包。" -#: ../../library/asyncio-eventloop.rst:921 +#: ../../library/asyncio-eventloop.rst:931 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "在某些情況下(例如傳入的傳輸已經關閉),此函式可能回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:926 +#: ../../library/asyncio-eventloop.rst:936 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." @@ -1457,11 +1457,11 @@ msgstr "" "*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` 和 :meth:" "`~loop.create_connection` 等方法回傳。" -#: ../../library/asyncio-eventloop.rst:930 +#: ../../library/asyncio-eventloop.rst:940 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "*sslcontext*:配置好的 :class:`~ssl.SSLContext` 實例。" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." @@ -1469,17 +1469,17 @@ msgstr "" "當升級伺服器端連線時(像由 :meth:`~loop.create_server` 建立的那樣)傳遞 " "``True``。" -#: ../../library/asyncio-eventloop.rst:935 +#: ../../library/asyncio-eventloop.rst:945 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "*server_hostname*:設置或覆蓋將用於匹配目標伺服器憑證的主機名。" -#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:965 msgid "Watching file descriptors" msgstr "監視檔案描述器" -#: ../../library/asyncio-eventloop.rst:959 +#: ../../library/asyncio-eventloop.rst:969 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." @@ -1487,14 +1487,14 @@ msgstr "" "開始監視 *fd* 檔案描述器的讀取可用性,一但 *fd* 可讀取,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:963 -#: ../../library/asyncio-eventloop.rst:977 +#: ../../library/asyncio-eventloop.rst:973 +#: ../../library/asyncio-eventloop.rst:987 msgid "" "Any preexisting callback registered for *fd* is cancelled and replaced by " "*callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:978 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." @@ -1502,7 +1502,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的讀取可用性。如果 *fd* 之前正在監視讀取,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:973 +#: ../../library/asyncio-eventloop.rst:983 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." @@ -1510,8 +1510,8 @@ msgstr "" "開始監視 *fd* 檔案描述器的寫入可用性,一旦 *fd* 可寫入,使用指定引數呼叫 " "*callback*。" -#: ../../library/asyncio-eventloop.rst:980 -#: ../../library/asyncio-eventloop.rst:1245 +#: ../../library/asyncio-eventloop.rst:990 +#: ../../library/asyncio-eventloop.rst:1268 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-" "keywords>` to *callback*." @@ -1519,7 +1519,7 @@ msgstr "" "使用 :func:`functools.partial` 向 *callback* :ref:`傳送關鍵字引數 <asyncio-" "pass-keywords>`。" -#: ../../library/asyncio-eventloop.rst:985 +#: ../../library/asyncio-eventloop.rst:995 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." @@ -1527,7 +1527,7 @@ msgstr "" "停止監視 *fd* 檔案描述器的寫入可用性。如果 *fd* 之前正在監視寫入,則回傳 " "``True``。" -#: ../../library/asyncio-eventloop.rst:988 +#: ../../library/asyncio-eventloop.rst:998 msgid "" "See also :ref:`Platform Support <asyncio-platform-support>` section for some " "limitations of these methods." @@ -1535,11 +1535,11 @@ msgstr "" "另請參閱\\ :ref:`平台支援 <asyncio-platform-support>`\\ 部分以了解這些方法的" "一些限制。" -#: ../../library/asyncio-eventloop.rst:993 +#: ../../library/asyncio-eventloop.rst:1003 msgid "Working with socket objects directly" msgstr "直接使用 socket 物件" -#: ../../library/asyncio-eventloop.rst:995 +#: ../../library/asyncio-eventloop.rst:1005 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1551,7 +1551,7 @@ msgstr "" "`loop.create_server`\\ )的協議實作比直接使用 socket 的實作更快。然而在某些情" "況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" -#: ../../library/asyncio-eventloop.rst:1004 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() <socket.socket.recv>`." @@ -1559,23 +1559,23 @@ msgstr "" "從 *sock* 接收最多 *nbytes*。:meth:`socket.recv() <socket.socket.recv>` 的非" "同步版本。" -#: ../../library/asyncio-eventloop.rst:1007 +#: ../../library/asyncio-eventloop.rst:1018 msgid "Return the received data as a bytes object." msgstr "將接收到的資料作為 bytes 物件回傳。" -#: ../../library/asyncio-eventloop.rst:1009 -#: ../../library/asyncio-eventloop.rst:1023 -#: ../../library/asyncio-eventloop.rst:1034 -#: ../../library/asyncio-eventloop.rst:1046 -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1020 +#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1047 +#: ../../library/asyncio-eventloop.rst:1060 #: ../../library/asyncio-eventloop.rst:1076 -#: ../../library/asyncio-eventloop.rst:1086 -#: ../../library/asyncio-eventloop.rst:1112 -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1103 +#: ../../library/asyncio-eventloop.rst:1130 +#: ../../library/asyncio-eventloop.rst:1169 msgid "*sock* must be a non-blocking socket." msgstr "*sock* 必須是非阻塞 socket。" -#: ../../library/asyncio-eventloop.rst:1011 +#: ../../library/asyncio-eventloop.rst:1022 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 " @@ -1584,7 +1584,7 @@ msgstr "" "儘管此方法一直記錄為協程方法,但 Python 3.7 之前的版本回傳 :class:`Future`。" "自 Python 3.7 起,這是 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1018 +#: ../../library/asyncio-eventloop.rst:1030 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() <socket.socket.recv_into>` method." @@ -1592,11 +1592,11 @@ msgstr "" "從 *sock* 接收資料到 *buf* 緩衝區。仿照阻塞 :meth:`socket.recv_into() " "<socket.socket.recv_into>` 方法。" -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1033 msgid "Return the number of bytes written to the buffer." msgstr "回傳寫入緩衝區位元組的數目。" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1042 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() <socket.socket.recvfrom>`." @@ -1604,11 +1604,11 @@ msgstr "" "從 *sock* 接收最多 *bufsize* 大小的資料單元。:meth:`socket.recvfrom() " "<socket.socket.recvfrom>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1032 +#: ../../library/asyncio-eventloop.rst:1045 msgid "Return a tuple of (received data, remote address)." msgstr "回傳一個元組 (received data, remote address)。" -#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:1054 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() <socket.socket.recvfrom_into>`." @@ -1616,11 +1616,11 @@ msgstr "" "從 *sock* 接收最多 *nbytes* 大小的資料單元到 *buf*。:meth:`socket." "recvfrom_into() <socket.socket.recvfrom_into>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1044 +#: ../../library/asyncio-eventloop.rst:1058 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "回傳一個元組 (number of bytes received, remote address)。" -#: ../../library/asyncio-eventloop.rst:1052 +#: ../../library/asyncio-eventloop.rst:1067 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() <socket.socket.sendall>`." @@ -1628,7 +1628,7 @@ msgstr "" "將 *data* 發送到 *sock* socket。:meth:`socket.sendall() <socket.socket." "sendall>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1055 +#: ../../library/asyncio-eventloop.rst:1070 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 " @@ -1640,8 +1640,8 @@ msgstr "" "回傳 ``None``。錯誤時引發例外。此外,沒有辦法確定接收端成功處理了多少資料(如" "果有的話)。" -#: ../../library/asyncio-eventloop.rst:1063 -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1078 +#: ../../library/asyncio-eventloop.rst:1132 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 " @@ -1650,7 +1650,7 @@ msgstr "" "儘管該方法一直被記錄為協程方法,但在 Python 3.7 之前它回傳 :class:`Future`。" "從 Python 3.7 開始,這是一個 ``async def`` 方法。" -#: ../../library/asyncio-eventloop.rst:1070 +#: ../../library/asyncio-eventloop.rst:1086 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() <socket.socket.sendto>`." @@ -1658,20 +1658,20 @@ msgstr "" "從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() <socket." "socket.sendto>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1090 msgid "Return the number of bytes sent." msgstr "回傳發送的位元組數。" -#: ../../library/asyncio-eventloop.rst:1082 +#: ../../library/asyncio-eventloop.rst:1099 msgid "Connect *sock* to a remote socket at *address*." msgstr "將 *sock* 連線到位於 *address* 的遠端 socket。" -#: ../../library/asyncio-eventloop.rst:1084 +#: ../../library/asyncio-eventloop.rst:1101 msgid "" "Asynchronous version of :meth:`socket.connect() <socket.socket.connect>`." msgstr ":meth:`socket.connect() <socket.socket.connect>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1088 +#: ../../library/asyncio-eventloop.rst:1105 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1682,7 +1682,7 @@ msgstr "" "inet_pton` 檢查 *address* 是否已解析。如果沒有,將使用 :meth:`loop." "getaddrinfo` 解析 *address*。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1114 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "<open_connection>`." @@ -1690,7 +1690,7 @@ msgstr "" ":meth:`loop.create_connection` 和 :func:`asyncio.open_connection() " "<open_connection>`。" -#: ../../library/asyncio-eventloop.rst:1103 +#: ../../library/asyncio-eventloop.rst:1121 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "<socket.socket.accept>` method." @@ -1698,7 +1698,7 @@ msgstr "" "接受一個連線。模擬阻塞的 :meth:`socket.accept() <socket.socket.accept>` 方" "法。" -#: ../../library/asyncio-eventloop.rst:1106 +#: ../../library/asyncio-eventloop.rst:1124 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 " @@ -1709,34 +1709,34 @@ msgstr "" "中 *conn* 是一個 *新* socket 物件,可在連線上發送和接收資料,*address* 是連接" "另一端對應的 socket 地址。" -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:1139 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`。" -#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1145 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" "如果可行,使用高性能 :mod:`os.sendfile` 發送檔案。回傳發送的總位元組數。" -#: ../../library/asyncio-eventloop.rst:1129 +#: ../../library/asyncio-eventloop.rst:1148 msgid "" "Asynchronous version of :meth:`socket.sendfile() <socket.socket.sendfile>`." msgstr ":meth:`socket.sendfile() <socket.socket.sendfile>` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1131 +#: ../../library/asyncio-eventloop.rst:1150 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" "*sock* 必須是非阻塞的 :const:`socket.SOCK_STREAM` :class:`~socket.socket`。" -#: ../../library/asyncio-eventloop.rst:1134 +#: ../../library/asyncio-eventloop.rst:1153 msgid "*file* must be a regular file object open in binary mode." msgstr "*file* 必須是以二進位模式打開的常規檔案物件。" -#: ../../library/asyncio-eventloop.rst:1143 +#: ../../library/asyncio-eventloop.rst:1162 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 " @@ -1745,7 +1745,7 @@ msgstr "" "當設置為 ``True`` 時,*fallback* 使 asyncio 在平台不支援 sendfile 系統呼叫時" "(例如 Windows 或 Unix 上的 SSL socket)手動讀取和發送檔案。" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1166 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." @@ -1753,19 +1753,19 @@ msgstr "" "如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引發 :exc:" "`SendfileNotAvailableError`。" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1175 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1161 +#: ../../library/asyncio-eventloop.rst:1181 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr ":meth:`socket.getaddrinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1186 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr ":meth:`socket.getnameinfo` 的非同步版本。" -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1189 msgid "" "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " "versions through the loop's default thread pool executor. When this executor " @@ -1775,7 +1775,7 @@ msgid "" "executor with a larger number of workers." msgstr "" -#: ../../library/asyncio-eventloop.rst:1175 +#: ../../library/asyncio-eventloop.rst:1196 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1786,19 +1786,19 @@ msgstr "" "它們實際上回傳 :class:`asyncio.Future` 物件。從 Python 3.7 開始,兩個方法都是" "協程。" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1204 msgid "Working with pipes" msgstr "使用管道" -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:1209 msgid "Register the read end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的讀取端。" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1214 msgid "*pipe* is a :term:`file-like object <file object>`." msgstr "*pipe* 是 :term:`類檔案物件 <file object>`。" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1216 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " @@ -1807,22 +1807,22 @@ msgstr "" "回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" "`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1198 -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1220 +#: ../../library/asyncio-eventloop.rst:1237 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "使用 :class:`SelectorEventLoop` 事件迴圈時,*pipe* 設置為非阻塞模式。" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1226 msgid "Register the write end of *pipe* in the event loop." msgstr "在事件迴圈中註冊 *pipe* 的寫入端。" -#: ../../library/asyncio-eventloop.rst:1208 +#: ../../library/asyncio-eventloop.rst:1231 msgid "*pipe* is :term:`file-like object <file object>`." msgstr "*pipe* 是 :term:`file-like object <file object>`。" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1233 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " @@ -1831,7 +1831,7 @@ msgstr "" "回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" "`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" -#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:1242 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." @@ -1839,20 +1839,20 @@ msgstr "" ":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使用 :" "class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1224 +#: ../../library/asyncio-eventloop.rst:1247 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr ":meth:`loop.subprocess_exec` 和 :meth:`loop.subprocess_shell` 方法。" -#: ../../library/asyncio-eventloop.rst:1229 +#: ../../library/asyncio-eventloop.rst:1252 msgid "Unix signals" msgstr "Unix 訊號" -#: ../../library/asyncio-eventloop.rst:1235 +#: ../../library/asyncio-eventloop.rst:1258 msgid "Set *callback* as the handler for the *signum* signal." msgstr "將 *callback* 設置為 *signum* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1237 +#: ../../library/asyncio-eventloop.rst:1260 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1863,7 +1863,7 @@ msgstr "" "用 :func:`signal.signal` 註冊的訊號處理程式不同,使用此函式註冊的回呼允許與事" "件迴圈進行互動。" -#: ../../library/asyncio-eventloop.rst:1242 +#: ../../library/asyncio-eventloop.rst:1265 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." @@ -1871,16 +1871,16 @@ msgstr "" "如果訊號號無效或不可捕獲,引發 :exc:`ValueError`。如果設定處理程序有問題,拋" "出 :exc:`RuntimeError`。" -#: ../../library/asyncio-eventloop.rst:1248 +#: ../../library/asyncio-eventloop.rst:1271 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "像 :func:`signal.signal` 一樣,此函式必須在主執行緒中呼叫。" -#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1276 msgid "Remove the handler for the *sig* signal." msgstr "移除 *sig* 訊號的處理程式。" -#: ../../library/asyncio-eventloop.rst:1255 +#: ../../library/asyncio-eventloop.rst:1278 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." @@ -1888,19 +1888,19 @@ msgstr "" "如果訊號處理程式被移除,回傳 ``True``;如果給定訊號沒有設置處理程式,回傳 " "``False``。" -#: ../../library/asyncio-eventloop.rst:1262 +#: ../../library/asyncio-eventloop.rst:1285 msgid "The :mod:`signal` module." msgstr ":mod:`signal` 模組。" -#: ../../library/asyncio-eventloop.rst:1266 +#: ../../library/asyncio-eventloop.rst:1289 msgid "Executing code in thread or process pools" msgstr "在執行緒池或行程池中執行程式碼" -#: ../../library/asyncio-eventloop.rst:1270 +#: ../../library/asyncio-eventloop.rst:1293 msgid "Arrange for *func* to be called in the specified executor." msgstr "安排在指定的執行器中呼叫 *func*。" -#: ../../library/asyncio-eventloop.rst:1272 +#: ../../library/asyncio-eventloop.rst:1295 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``. The " @@ -1909,7 +1909,7 @@ msgid "" "and used by :func:`run_in_executor` if needed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1280 +#: ../../library/asyncio-eventloop.rst:1303 msgid "" "import asyncio\n" "import concurrent.futures\n" @@ -1952,7 +1952,7 @@ msgid "" " asyncio.run(main())" msgstr "" -#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1343 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1964,11 +1964,11 @@ msgstr "" "== '__main__'``\\ )。請參閱\\ :ref:`主模組的安全引入 <multiprocessing-safe-" "main-import>`。" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1348 msgid "This method returns a :class:`asyncio.Future` object." msgstr "此方法回傳 :class:`asyncio.Future` 物件。" -#: ../../library/asyncio-eventloop.rst:1327 +#: ../../library/asyncio-eventloop.rst:1350 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments <asyncio-pass-" "keywords>` to *func*." @@ -1976,7 +1976,7 @@ msgstr "" "使用 :func:`functools.partial` 將來\\ :ref:`關鍵字引數傳遞 <asyncio-pass-" "keywords>`\\ 給 *func*。" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1353 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 " @@ -1987,7 +1987,7 @@ msgstr "" "``max_workers``,而是讓執行緒池執行器(\\ :class:`~concurrent.futures." "ThreadPoolExecutor`)設定預設值。" -#: ../../library/asyncio-eventloop.rst:1339 +#: ../../library/asyncio-eventloop.rst:1362 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." @@ -1996,26 +1996,26 @@ msgstr "" "將 *executor* 設置為 :meth:`run_in_executor` 使用的預設執行器。*executor* 必" "須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1343 +#: ../../library/asyncio-eventloop.rst:1366 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" "*executor* 必須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" -#: ../../library/asyncio-eventloop.rst:1349 +#: ../../library/asyncio-eventloop.rst:1372 msgid "Error Handling API" msgstr "錯誤處理 API" -#: ../../library/asyncio-eventloop.rst:1351 +#: ../../library/asyncio-eventloop.rst:1374 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "允許自定義事件迴圈中的例外處理方式。" -#: ../../library/asyncio-eventloop.rst:1355 +#: ../../library/asyncio-eventloop.rst:1378 msgid "Set *handler* as the new event loop exception handler." msgstr "將 *handler* 設定為新的事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1357 +#: ../../library/asyncio-eventloop.rst:1380 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -2028,7 +2028,7 @@ msgstr "" "圈的,``context`` 是包含例外詳細資訊的 ``dict`` 物件(有關情境的詳細資訊,請" "參閱 :meth:`call_exception_handler` 文件)。" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1388 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " @@ -2037,7 +2037,7 @@ msgstr "" "如果代表 :class:`~asyncio.Task` 或 :class:`~asyncio.Handle` 呼叫處理程式,它" "將在該任務或回呼處理程式的 :class:`contextvars.Context` 中運行。" -#: ../../library/asyncio-eventloop.rst:1371 +#: ../../library/asyncio-eventloop.rst:1394 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." @@ -2045,18 +2045,18 @@ msgstr "" "處理程式可能在引發例外的任務或處理程式的 :class:`~contextvars.Context` 中被呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1399 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" "回傳當前的例外處理程式,如果未設置自定義例外處理程式,則回傳 ``None``。" -#: ../../library/asyncio-eventloop.rst:1383 +#: ../../library/asyncio-eventloop.rst:1406 msgid "Default exception handler." msgstr "預設例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1408 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 " @@ -2065,17 +2065,17 @@ msgstr "" "當發生例外且未設置例外處理程式時呼叫此函式。自定義例外處理程式可以呼叫此函式" "以轉由預設處理程式處理。" -#: ../../library/asyncio-eventloop.rst:1389 +#: ../../library/asyncio-eventloop.rst:1412 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "*context* 參數與 :meth:`call_exception_handler` 中的意思相同。" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1417 msgid "Call the current event loop exception handler." msgstr "呼叫當前事件迴圈例外處理程式。" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1419 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" @@ -2083,47 +2083,47 @@ msgstr "" "*context* 是一個包含以下鍵的 ``dict`` 物件(未來的 Python 版本中可能會引入新" "的鍵):" -#: ../../library/asyncio-eventloop.rst:1399 +#: ../../library/asyncio-eventloop.rst:1422 msgid "'message': Error message;" msgstr "'message':錯誤訊息;" -#: ../../library/asyncio-eventloop.rst:1400 +#: ../../library/asyncio-eventloop.rst:1423 msgid "'exception' (optional): Exception object;" msgstr "'exception'(可選):例外物件;" -#: ../../library/asyncio-eventloop.rst:1401 +#: ../../library/asyncio-eventloop.rst:1424 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future'(可選): :class:`asyncio.Future` 實例;" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1425 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "'task'(可選): :class:`asyncio.Task` 實例;" -#: ../../library/asyncio-eventloop.rst:1403 +#: ../../library/asyncio-eventloop.rst:1426 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "'handle'(可選): :class:`asyncio.Handle` 實例;" -#: ../../library/asyncio-eventloop.rst:1404 +#: ../../library/asyncio-eventloop.rst:1427 msgid "'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;" msgstr "'protocol'(可選): :ref:`Protocol <asyncio-protocol>` 實例;" -#: ../../library/asyncio-eventloop.rst:1405 +#: ../../library/asyncio-eventloop.rst:1428 msgid "'transport' (optional): :ref:`Transport <asyncio-transport>` instance;" msgstr "'transport'(可選): :ref:`Transport <asyncio-transport>` 實例;" -#: ../../library/asyncio-eventloop.rst:1406 +#: ../../library/asyncio-eventloop.rst:1429 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "'socket'(可選): :class:`socket.socket` 實例;" -#: ../../library/asyncio-eventloop.rst:1407 +#: ../../library/asyncio-eventloop.rst:1430 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "'asyncgen'(可選): 非同步產生器引發" -#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1431 msgid "the exception." msgstr "例外。" -#: ../../library/asyncio-eventloop.rst:1412 +#: ../../library/asyncio-eventloop.rst:1435 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." @@ -2131,15 +2131,15 @@ msgstr "" "此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使用 :meth:" "`set_exception_handler` 方法。" -#: ../../library/asyncio-eventloop.rst:1417 +#: ../../library/asyncio-eventloop.rst:1440 msgid "Enabling debug mode" msgstr "啟用除錯模式" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1444 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "取得事件迴圈的除錯模式(\\ :class:`bool`\\ )。" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1446 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." @@ -2147,17 +2147,17 @@ msgstr "" "如果環境變數 :envvar:`PYTHONASYNCIODEBUG` 被設定為非空字串,則預設值為 " "``True``,否則為 ``False``。" -#: ../../library/asyncio-eventloop.rst:1429 +#: ../../library/asyncio-eventloop.rst:1452 msgid "Set the debug mode of the event loop." msgstr "設定事件迴圈的除錯模式。" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1456 msgid "" "The new :ref:`Python Development Mode <devmode>` can now also be used to " "enable the debug mode." msgstr "現在也可以使用新的 :ref:`Python 開發模式 <devmode>` 啟用除錯模式。" -#: ../../library/asyncio-eventloop.rst:1438 +#: ../../library/asyncio-eventloop.rst:1461 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " @@ -2166,19 +2166,19 @@ msgstr "" "此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式" "後,\"慢\"回呼將被記錄。" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1465 msgid "Default value is 100 milliseconds." msgstr "預設值為 100 毫秒" -#: ../../library/asyncio-eventloop.rst:1446 +#: ../../library/asyncio-eventloop.rst:1469 msgid "The :ref:`debug mode of asyncio <asyncio-debug-mode>`." msgstr ":ref:`asyncio 的除錯模式 <asyncio-debug-mode>`。" -#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1473 msgid "Running Subprocesses" msgstr "運行子行程" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1475 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " @@ -2188,7 +2188,7 @@ msgstr "" "func:`asyncio.create_subprocess_shell` 和 :func:`asyncio." "create_subprocess_exec` 輔助功能而不是。" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" @@ -2198,26 +2198,26 @@ msgstr "" "`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行程的支援 " "<asyncio-windows-subprocess>`。" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1494 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "從 *args* 指定的一個或多個字串引數建立子行程。" -#: ../../library/asyncio-eventloop.rst:1473 +#: ../../library/asyncio-eventloop.rst:1497 msgid "*args* must be a list of strings represented by:" msgstr "*args* 必須是由以下項表示的字串串列:" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1499 msgid ":class:`str`;" msgstr ":class:`str`;" -#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding <filesystem-" "encoding>`." msgstr "或 :class:`bytes`,編碼為 :ref:`檔案系統編碼 <filesystem-encoding>`。" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1503 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " @@ -2226,7 +2226,7 @@ msgstr "" "第一個字串指定程序可執行檔案,其餘字串指定引數。字串引數一起組成程序的 " "``argv``。" -#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1507 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 " @@ -2237,7 +2237,7 @@ msgstr "" "字串串列作為第一個引數傳遞;然而,:class:`~subprocess.Popen` 接受單個字串串列" "引數,*subprocess_exec* 接受多個字串引數。" -#: ../../library/asyncio-eventloop.rst:1489 +#: ../../library/asyncio-eventloop.rst:1513 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." @@ -2245,67 +2245,67 @@ msgstr "" "*protocol_factory* 必須是回傳 :class:`asyncio.SubprocessProtocol` 子類別的可" "呼叫物件。" -#: ../../library/asyncio-eventloop.rst:1492 +#: ../../library/asyncio-eventloop.rst:1516 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1494 +#: ../../library/asyncio-eventloop.rst:1518 msgid "*stdin* can be any of these:" msgstr "*stdin* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1496 -#: ../../library/asyncio-eventloop.rst:1507 -#: ../../library/asyncio-eventloop.rst:1517 +#: ../../library/asyncio-eventloop.rst:1520 +#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1541 msgid "a file-like object" msgstr "類檔案物件" -#: ../../library/asyncio-eventloop.rst:1497 +#: ../../library/asyncio-eventloop.rst:1521 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe`" msgstr "現有的檔案描述器(正整數),例如用 :meth:`os.pipe` 建立的" -#: ../../library/asyncio-eventloop.rst:1498 -#: ../../library/asyncio-eventloop.rst:1508 -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1542 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr ":const:`subprocess.PIPE` 常數(預設),它將建立一個新的管道並連線," -#: ../../library/asyncio-eventloop.rst:1500 -#: ../../library/asyncio-eventloop.rst:1510 -#: ../../library/asyncio-eventloop.rst:1520 +#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1534 +#: ../../library/asyncio-eventloop.rst:1544 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "值 ``None`` 將使子行程從此行程繼承檔案描述器" -#: ../../library/asyncio-eventloop.rst:1502 -#: ../../library/asyncio-eventloop.rst:1512 -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1526 +#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1546 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" ":const:`subprocess.DEVNULL` 常數,表示將使用特殊的 :data:`os.devnull` 檔案" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1529 msgid "*stdout* can be any of these:" msgstr "*stdout* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1515 +#: ../../library/asyncio-eventloop.rst:1539 msgid "*stderr* can be any of these:" msgstr "*stderr* 可以是以下任意一個:" -#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1548 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" ":const:`subprocess.STDOUT` 常數,它將標準錯誤串流連線到行程的標準輸出串流" -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1551 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " @@ -2315,7 +2315,7 @@ msgstr "" "*bufsize*、*universal_newlines*、*shell*、*text*、*encoding* 和 *errors* 除" "外,這些不應該指定。" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1556 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 " @@ -2324,7 +2324,7 @@ msgstr "" "``asyncio`` 子行程 API 不支援將串流解碼為文本。可以使用 :func:`bytes.decode` " "將從串流回傳的位元組轉換為文本。" -#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -2335,13 +2335,13 @@ msgstr "" "端應該使用 :meth:`~loop.connect_write_pipe` 或 :meth:`~loop." "connect_read_pipe` 註冊到事件迴圈中。" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1565 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "有關其他引數的文件,請參閱 :class:`subprocess.Popen` 類別的建構函式。" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1568 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " @@ -2351,7 +2351,7 @@ msgstr "" "SubprocessTransport` 基底類別,*protocol* 是由 *protocol_factory* 實例化的物" "件。" -#: ../../library/asyncio-eventloop.rst:1552 +#: ../../library/asyncio-eventloop.rst:1577 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding <filesystem-" @@ -2360,7 +2360,7 @@ msgstr "" "使用平台的 “shell” 語法從 *cmd* 建立子行程,*cmd* 可以是 :class:`str` 或編碼" "為 :ref:`檔案系統編碼 <filesystem-encoding>` 的 :class:`bytes` 字串。" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1582 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2368,7 +2368,7 @@ msgstr "" "這類似於標準函式庫中的 :class:`subprocess.Popen` 類別,使用 ``shell=True`` 呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1560 +#: ../../library/asyncio-eventloop.rst:1585 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." @@ -2376,13 +2376,13 @@ msgstr "" "*protocol_factory* 必須是回傳 :class:`SubprocessProtocol` 子類別的可呼叫物" "件。" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1588 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "有關其餘引數的更多詳細資訊,請參閱 :meth:`~loop.subprocess_exec`。" -#: ../../library/asyncio-eventloop.rst:1566 +#: ../../library/asyncio-eventloop.rst:1591 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " @@ -2392,7 +2392,7 @@ msgstr "" "`SubprocessTransport` 基底類別,而 *protocol* 是由 *protocol_factory* 實例化" "的物件。" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2405,11 +2405,11 @@ msgstr "" "wikipedia.org/wiki/Shell_injection#Shell_injection>`_\\ 風險。可以使用 :func:" "`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊字元。" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1605 msgid "Callback Handles" msgstr "回呼處理" -#: ../../library/asyncio-eventloop.rst:1584 +#: ../../library/asyncio-eventloop.rst:1609 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." @@ -2417,46 +2417,46 @@ msgstr "" "由 :meth:`loop.call_soon` 和 :meth:`loop.call_soon_threadsafe` 回傳的回呼包裝" "器。" -#: ../../library/asyncio-eventloop.rst:1589 +#: ../../library/asyncio-eventloop.rst:1614 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "回傳與處理相關聯的 :class:`contextvars.Context` 物件。" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "取消回呼。如果回呼已被取消或執行,此方法將不起作用。" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1626 msgid "Return ``True`` if the callback was cancelled." msgstr "如果回呼已被取消,回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1632 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "由 :meth:`loop.call_later` 和 :meth:`loop.call_at` 回傳的回呼包裝器。" -#: ../../library/asyncio-eventloop.rst:1610 +#: ../../library/asyncio-eventloop.rst:1635 msgid "This class is a subclass of :class:`Handle`." msgstr "這個類別是 :class:`Handle` 的子類別。" -#: ../../library/asyncio-eventloop.rst:1614 +#: ../../library/asyncio-eventloop.rst:1639 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "回傳預定的回呼時間,以 :class:`float` 秒為單位。" -#: ../../library/asyncio-eventloop.rst:1616 +#: ../../library/asyncio-eventloop.rst:1641 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "時間是一個絕對的時間戳,使用與 :meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:1623 +#: ../../library/asyncio-eventloop.rst:1648 msgid "Server Objects" msgstr "Server 物件" -#: ../../library/asyncio-eventloop.rst:1625 +#: ../../library/asyncio-eventloop.rst:1650 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " @@ -2466,11 +2466,11 @@ msgstr "" "create_unix_server`、:func:`start_server` 和 :func:`start_unix_server` 函式所" "建立。" -#: ../../library/asyncio-eventloop.rst:1629 +#: ../../library/asyncio-eventloop.rst:1654 msgid "Do not instantiate the :class:`Server` class directly." msgstr "請勿直接實例化 :class:`Server` 類別。" -#: ../../library/asyncio-eventloop.rst:1633 +#: ../../library/asyncio-eventloop.rst:1658 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 " @@ -2479,7 +2479,7 @@ msgstr "" "*Server* 物件是非同步情境管理器。當在 ``async with`` 陳述中使用時,可以保證在" "完成 ``async with`` 陳述時,Server 物件將會關閉並停止接受新的連線: ::" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1663 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2489,30 +2489,30 @@ msgid "" "# At this point, srv is closed and no longer accepts new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1646 +#: ../../library/asyncio-eventloop.rst:1671 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "自 Python 3.7 起,Server 物件是非同步情境管理器。" -#: ../../library/asyncio-eventloop.rst:1649 +#: ../../library/asyncio-eventloop.rst:1674 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" "此類別在 Python 3.9.11、3.10.3 和 3.11 中以 ``asyncio.Server`` 的形式被公開。" -#: ../../library/asyncio-eventloop.rst:1654 +#: ../../library/asyncio-eventloop.rst:1679 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "停止服務:關閉監聽的 sockets 並將 :attr:`sockets` 屬性設為 ``None``。" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1682 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1660 +#: ../../library/asyncio-eventloop.rst:1685 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." @@ -2520,54 +2520,54 @@ msgstr "" "伺服器以非同步方式關閉;使用 :meth:`wait_close` 協程等待伺服器關閉(不再有活" "躍連線)。" -#: ../../library/asyncio-eventloop.rst:1666 +#: ../../library/asyncio-eventloop.rst:1691 #, fuzzy msgid "Close all existing incoming client connections." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1668 +#: ../../library/asyncio-eventloop.rst:1693 msgid "" "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." msgstr "" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1696 msgid "" ":meth:`close` should be called before :meth:`close_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1678 +#: ../../library/asyncio-eventloop.rst:1703 msgid "" "Close all existing incoming client connections immediately, without waiting " "for pending operations to complete." msgstr "" -#: ../../library/asyncio-eventloop.rst:1681 +#: ../../library/asyncio-eventloop.rst:1706 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." msgstr "" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1709 msgid "" ":meth:`close` should be called before :meth:`abort_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1691 +#: ../../library/asyncio-eventloop.rst:1716 msgid "Return the event loop associated with the server object." msgstr "回傳與伺服器物件關聯的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1723 msgid "Start accepting connections." msgstr "開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1699 +#: ../../library/asyncio-eventloop.rst:1725 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "此方法是幂等的,因此可以在伺服器已經運行時呼叫。" -#: ../../library/asyncio-eventloop.rst:1702 +#: ../../library/asyncio-eventloop.rst:1728 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 " @@ -2580,14 +2580,14 @@ msgstr "" "種情況下,可以使用 ``Server.start_serving()`` 或 :meth:`Server." "serve_forever` 來使 Server 開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1713 +#: ../../library/asyncio-eventloop.rst:1740 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" "開始接受連線,直到協程被取消。取消 ``serve_forever`` 任務會導致伺服器關閉。" -#: ../../library/asyncio-eventloop.rst:1717 +#: ../../library/asyncio-eventloop.rst:1744 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2595,7 +2595,7 @@ msgstr "" "如果伺服器已經接受連線,則可以呼叫此方法。每個 *Server* 物件只能存在一個 " "``serve_forever`` 任務。" -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1750 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2610,24 +2610,24 @@ msgid "" "asyncio.run(main('127.0.0.1', 0))" msgstr "" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1766 msgid "Return ``True`` if the server is accepting new connections." msgstr "如果伺服器正在接受新連線,則回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1745 +#: ../../library/asyncio-eventloop.rst:1773 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "等待 :meth:`close` 方法完成且所有活動連線都已結束。" -#: ../../library/asyncio-eventloop.rst:1750 +#: ../../library/asyncio-eventloop.rst:1778 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" "伺服器正在監聽的類似 socket 的物件串列,``asyncio.trsock.TransportSocket``。" -#: ../../library/asyncio-eventloop.rst:1753 +#: ../../library/asyncio-eventloop.rst:1781 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." @@ -2635,11 +2635,11 @@ msgstr "" "在 Python 3.7 之前,``Server.sockets`` 曾經直接回傳內部伺服器 sockets 的串" "列。在 3.7 中回傳了該串列的副本。" -#: ../../library/asyncio-eventloop.rst:1763 +#: ../../library/asyncio-eventloop.rst:1791 msgid "Event Loop Implementations" msgstr "事件迴圈實作" -#: ../../library/asyncio-eventloop.rst:1765 +#: ../../library/asyncio-eventloop.rst:1793 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." @@ -2647,21 +2647,21 @@ msgstr "" "asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` 和 :class:" "`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1768 +#: ../../library/asyncio-eventloop.rst:1796 #, fuzzy msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "" "預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " "Windows 上使用 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1773 +#: ../../library/asyncio-eventloop.rst:1801 #, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." msgstr "基於 :mod:`selectors` 模組的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1776 +#: ../../library/asyncio-eventloop.rst:1804 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2670,7 +2670,7 @@ msgstr "" "使用特定平台上最有效的 *selector*。也可以手動配置要使用的確切 selector 實" "作: ::" -#: ../../library/asyncio-eventloop.rst:1780 +#: ../../library/asyncio-eventloop.rst:1808 msgid "" "import asyncio\n" "import selectors\n" @@ -2692,14 +2692,14 @@ msgstr "" "\n" "asyncio.set_event_loop_policy(MyPolicy())" -#: ../../library/asyncio-eventloop.rst:1796 +#: ../../library/asyncio-eventloop.rst:1824 #, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" -#: ../../library/asyncio-eventloop.rst:1802 +#: ../../library/asyncio-eventloop.rst:1830 #, fuzzy msgid "" "`MSDN documentation on I/O Completion Ports <https://learn.microsoft.com/" @@ -2708,13 +2708,13 @@ msgstr "" "`I/O 完成埠(I/O Completion Ports)的 MSDN 文件 <https://docs.microsoft.com/" "zh-tw/windows/desktop/FileIO/i-o-completion-ports>`_。" -#: ../../library/asyncio-eventloop.rst:1807 +#: ../../library/asyncio-eventloop.rst:1835 msgid "" "An alias to the most efficient available subclass of :class:" "`AbstractEventLoop` for the given platform." msgstr "" -#: ../../library/asyncio-eventloop.rst:1810 +#: ../../library/asyncio-eventloop.rst:1838 #, fuzzy msgid "" "It is an alias to :class:`SelectorEventLoop` on Unix and :class:" @@ -2723,11 +2723,11 @@ msgstr "" "預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " "Windows 上使用 :class:`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1816 +#: ../../library/asyncio-eventloop.rst:1844 msgid "Abstract base class for asyncio-compliant event loops." msgstr "為符合 asyncio 標準的事件迴圈的抽象基礎類別。" -#: ../../library/asyncio-eventloop.rst:1818 +#: ../../library/asyncio-eventloop.rst:1846 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." @@ -2735,11 +2735,11 @@ msgstr "" ":ref:`asyncio-event-loop-methods` 部分列出了替代 ``AbstractEventLoop`` 實作應" "該定義的所有方法。" -#: ../../library/asyncio-eventloop.rst:1824 +#: ../../library/asyncio-eventloop.rst:1852 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1826 +#: ../../library/asyncio-eventloop.rst:1854 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." @@ -2750,11 +2750,11 @@ msgstr "" "`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式很少需要這" "種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" -#: ../../library/asyncio-eventloop.rst:1836 +#: ../../library/asyncio-eventloop.rst:1864 msgid "Hello World with call_soon()" msgstr "使用 call_soon() 的 Hello World 範例" -#: ../../library/asyncio-eventloop.rst:1838 +#: ../../library/asyncio-eventloop.rst:1866 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::" @@ -2762,7 +2762,7 @@ msgstr "" "使用 :meth:`loop.call_soon` 方法排程回呼的範例。回呼會顯示 ``\"Hello " "World\"``,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1842 +#: ../../library/asyncio-eventloop.rst:1870 msgid "" "import asyncio\n" "\n" @@ -2783,18 +2783,18 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1862 +#: ../../library/asyncio-eventloop.rst:1890 msgid "" "A similar :ref:`Hello World <coroutine>` example created with a coroutine " "and the :func:`run` function." msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`Hello World <coroutine>` 範例。" -#: ../../library/asyncio-eventloop.rst:1869 +#: ../../library/asyncio-eventloop.rst:1897 msgid "Display the current date with call_later()" msgstr "使用 call_later() 顯示目前日期" -#: ../../library/asyncio-eventloop.rst:1871 +#: ../../library/asyncio-eventloop.rst:1899 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 " @@ -2803,7 +2803,7 @@ msgstr "" "一個回呼的範例,每秒顯示目前日期。回呼使用 :meth:`loop.call_later` 方法在 5 " "秒後重新排程自己,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1875 +#: ../../library/asyncio-eventloop.rst:1903 msgid "" "import asyncio\n" "import datetime\n" @@ -2828,7 +2828,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1899 +#: ../../library/asyncio-eventloop.rst:1927 msgid "" "A similar :ref:`current date <asyncio_example_sleep>` example created with a " "coroutine and the :func:`run` function." @@ -2836,11 +2836,11 @@ msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`current date " "<asyncio_example_sleep>` 範例。" -#: ../../library/asyncio-eventloop.rst:1906 +#: ../../library/asyncio-eventloop.rst:1934 msgid "Watch a file descriptor for read events" msgstr "監聽檔案描述器以進行讀取事件" -#: ../../library/asyncio-eventloop.rst:1908 +#: ../../library/asyncio-eventloop.rst:1936 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" @@ -2848,7 +2848,7 @@ msgstr "" "使用 :meth:`loop.add_reader` 方法等待檔案描述器接收到某些資料,然後關閉事件迴" "圈: ::" -#: ../../library/asyncio-eventloop.rst:1911 +#: ../../library/asyncio-eventloop.rst:1939 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -2884,7 +2884,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1946 +#: ../../library/asyncio-eventloop.rst:1974 msgid "" "A similar :ref:`example <asyncio_example_create_connection>` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -2892,7 +2892,7 @@ msgstr "" "使用傳輸、協定和 :meth:`loop.create_connection` 方法的類似 :ref:`範例 " "<asyncio_example_create_connection>`。" -#: ../../library/asyncio-eventloop.rst:1950 +#: ../../library/asyncio-eventloop.rst:1978 msgid "" "Another similar :ref:`example <asyncio_example_create_connection-streams>` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -2900,15 +2900,15 @@ msgstr "" "另一個使用高階 :func:`asyncio.open_connection` 函式和串流的類似 :ref:`範例 " "<asyncio_example_create_connection-streams>`。" -#: ../../library/asyncio-eventloop.rst:1958 +#: ../../library/asyncio-eventloop.rst:1986 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "設定 SIGINT 和 SIGTERM 的訊號處理程式" -#: ../../library/asyncio-eventloop.rst:1960 +#: ../../library/asyncio-eventloop.rst:1988 msgid "(This ``signals`` example only works on Unix.)" msgstr "(此 ``signals`` 範例僅在 Unix 上運作。)" -#: ../../library/asyncio-eventloop.rst:1962 +#: ../../library/asyncio-eventloop.rst:1990 msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" @@ -2916,7 +2916,7 @@ msgstr "" "使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` 和 :py:" "data:`SIGTERM` 的處理程式: ::" -#: ../../library/asyncio-eventloop.rst:1965 +#: ../../library/asyncio-eventloop.rst:1993 msgid "" "import asyncio\n" "import functools\n" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index d768445817..0d75575589 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,28 +103,28 @@ msgstr "" "如果佇列用 ``maxsize=0`` (預設)初始化,則 :meth:`full` 永遠不會回傳 " "``True``。" -#: ../../library/asyncio-queue.rst:62 +#: ../../library/asyncio-queue.rst:63 msgid "" "Remove and return an item from the queue. If queue is empty, wait until an " "item is available." msgstr "從佇列中刪除並回傳一個元素。如果佇列為空,則持續等待直到佇列中有元素。" -#: ../../library/asyncio-queue.rst:65 +#: ../../library/asyncio-queue.rst:66 msgid "" "Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or " "if the queue has been shut down immediately." msgstr "" -#: ../../library/asyncio-queue.rst:70 +#: ../../library/asyncio-queue.rst:71 msgid "" "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." msgstr "如果佇列內有值則立即回傳佇列中的元素,否則引發 :exc:`QueueEmpty`。" -#: ../../library/asyncio-queue.rst:75 +#: ../../library/asyncio-queue.rst:77 msgid "Block until all items in the queue have been received and processed." msgstr "持續阻塞直到佇列中所有的元素都被接收和處理完畢。" -#: ../../library/asyncio-queue.rst:77 +#: ../../library/asyncio-queue.rst:79 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer coroutine calls :meth:" @@ -137,7 +137,7 @@ msgstr "" "成,未完成任務計數就會減少。當未完成計數降到零的時候,:meth:`join` 阻塞會被解" "除 (unblock)。" -#: ../../library/asyncio-queue.rst:85 +#: ../../library/asyncio-queue.rst:88 msgid "" "Put an item into the queue. If the queue is full, wait until a free slot is " "available before adding the item." @@ -145,36 +145,36 @@ msgstr "" "將一個元素放進佇列。如果佇列滿了,在新增元素之前,會持續等待直到有空閒插槽 " "(free slot) 能被使用。" -#: ../../library/asyncio-queue.rst:88 +#: ../../library/asyncio-queue.rst:91 msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." msgstr "" -#: ../../library/asyncio-queue.rst:92 +#: ../../library/asyncio-queue.rst:95 msgid "Put an item into the queue without blocking." msgstr "不阻塞地將一個元素放入佇列。" -#: ../../library/asyncio-queue.rst:94 +#: ../../library/asyncio-queue.rst:97 msgid "If no free slot is immediately available, raise :exc:`QueueFull`." msgstr "如果沒有立即可用的空閒插槽,引發 :exc:`QueueFull`。" -#: ../../library/asyncio-queue.rst:98 +#: ../../library/asyncio-queue.rst:101 msgid "Return the number of items in the queue." msgstr "回傳佇列中的元素數量。" -#: ../../library/asyncio-queue.rst:102 +#: ../../library/asyncio-queue.rst:105 msgid "" "Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" "exc:`QueueShutDown`." msgstr "" -#: ../../library/asyncio-queue.rst:105 +#: ../../library/asyncio-queue.rst:108 msgid "" "By default, :meth:`~Queue.get` on a shut down queue will only raise once the " "queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " "immediately instead." msgstr "" -#: ../../library/asyncio-queue.rst:109 +#: ../../library/asyncio-queue.rst:112 msgid "" "All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " "unblocked. If *immediate* is true, a task will be marked as done for each " @@ -182,12 +182,12 @@ msgid "" "join`." msgstr "" -#: ../../library/asyncio-queue.rst:118 +#: ../../library/asyncio-queue.rst:121 #, fuzzy msgid "Indicate that a formerly enqueued work item is complete." msgstr "表示前面一個排隊的任務已經完成。" -#: ../../library/asyncio-queue.rst:120 +#: ../../library/asyncio-queue.rst:123 #, fuzzy msgid "" "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " @@ -197,7 +197,7 @@ msgstr "" "由佇列消耗者使用。對於每個用於獲取一個任務的 :meth:`~Queue.get`,接續的 :" "meth:`task_done` 呼叫會告訴佇列這個任務的處理已經完成。" -#: ../../library/asyncio-queue.rst:124 +#: ../../library/asyncio-queue.rst:127 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " @@ -206,53 +206,53 @@ msgstr "" "如果 :meth:`join` 當前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個" "以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`\\ )。" -#: ../../library/asyncio-queue.rst:129 +#: ../../library/asyncio-queue.rst:132 msgid "" "``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " "in the queue." msgstr "" -#: ../../library/asyncio-queue.rst:132 +#: ../../library/asyncio-queue.rst:135 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "如果被呼叫的次數多於放入佇列中的項目數量,將引發 :exc:`ValueError`。" -#: ../../library/asyncio-queue.rst:137 +#: ../../library/asyncio-queue.rst:140 msgid "Priority Queue" msgstr "Priority Queue(優先佇列)" -#: ../../library/asyncio-queue.rst:141 +#: ../../library/asyncio-queue.rst:144 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." msgstr ":class:`Queue` 的變形;按優先順序取出條目 (最小的先取出)。" -#: ../../library/asyncio-queue.rst:144 +#: ../../library/asyncio-queue.rst:147 msgid "Entries are typically tuples of the form ``(priority_number, data)``." msgstr "條目通常是 ``(priority_number, data)`` 形式的 tuple(元組)。" -#: ../../library/asyncio-queue.rst:149 +#: ../../library/asyncio-queue.rst:152 msgid "LIFO Queue" msgstr "LIFO Queue" -#: ../../library/asyncio-queue.rst:153 +#: ../../library/asyncio-queue.rst:156 msgid "" "A variant of :class:`Queue` that retrieves most recently added entries first " "(last in, first out)." msgstr ":class:`Queue` 的變形,先取出最近新增的條目(後進先出)。" -#: ../../library/asyncio-queue.rst:158 +#: ../../library/asyncio-queue.rst:161 msgid "Exceptions" msgstr "例外" -#: ../../library/asyncio-queue.rst:162 +#: ../../library/asyncio-queue.rst:165 msgid "" "This exception is raised when the :meth:`~Queue.get_nowait` method is called " "on an empty queue." msgstr "當佇列為空的時候,呼叫 :meth:`~Queue.get_nowait` 方法會引發這個例外。" -#: ../../library/asyncio-queue.rst:168 +#: ../../library/asyncio-queue.rst:171 msgid "" "Exception raised when the :meth:`~Queue.put_nowait` method is called on a " "queue that has reached its *maxsize*." @@ -260,7 +260,7 @@ msgstr "" "當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方" "法會引發這個例外。" -#: ../../library/asyncio-queue.rst:174 +#: ../../library/asyncio-queue.rst:177 #, fuzzy msgid "" "Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " @@ -269,16 +269,16 @@ msgstr "" "當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方" "法會引發這個例外。" -#: ../../library/asyncio-queue.rst:181 +#: ../../library/asyncio-queue.rst:184 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-queue.rst:185 +#: ../../library/asyncio-queue.rst:188 msgid "" "Queues can be used to distribute workload between several concurrent tasks::" msgstr "佇列能被用於多個並行任務的工作分配:" -#: ../../library/asyncio-queue.rst:188 +#: ../../library/asyncio-queue.rst:191 msgid "" "import asyncio\n" "import random\n" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index b29a0e1e71..0650eed218 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,7 +42,7 @@ msgstr "" msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "這是一個使用 asyncio 串流編寫的 TCP echo 客戶端範例: ::" -#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:419 +#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:430 msgid "" "import asyncio\n" "\n" @@ -96,13 +96,13 @@ msgid "" "with streams:" msgstr "下面的高階 asyncio 函式可以用來建立和處理串流:" -#: ../../library/asyncio-stream.rst:58 +#: ../../library/asyncio-stream.rst:59 msgid "" "Establish a network connection and return a pair of ``(reader, writer)`` " "objects." msgstr "建立網路連線並回傳一對 ``(reader, writer)`` 物件。" -#: ../../library/asyncio-stream.rst:61 +#: ../../library/asyncio-stream.rst:62 msgid "" "The returned *reader* and *writer* objects are instances of :class:" "`StreamReader` and :class:`StreamWriter` classes." @@ -110,7 +110,7 @@ msgstr "" "回傳的 *reader* 和 *writer* 物件是 :class:`StreamReader` 和 :class:" "`StreamWriter` 類別的實例。" -#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:110 +#: ../../library/asyncio-stream.rst:65 ../../library/asyncio-stream.rst:112 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -118,43 +118,43 @@ msgstr "" "*limit* 指定了回傳的 :class:`StreamReader` 實例所使用的緩衝區 (buffer) 大小限" "制。*limit* 預設為 64 KiB。" -#: ../../library/asyncio-stream.rst:68 +#: ../../library/asyncio-stream.rst:69 msgid "" "The rest of the arguments are passed directly to :meth:`loop." "create_connection`." msgstr "其餘的引數會直接傳遞到 :meth:`loop.create_connection`。" -#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:151 +#: ../../library/asyncio-stream.rst:74 ../../library/asyncio-stream.rst:154 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." "StreamWriter.close` method." msgstr "" -#: ../../library/asyncio-stream.rst:77 +#: ../../library/asyncio-stream.rst:78 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "新增 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-stream.rst:80 +#: ../../library/asyncio-stream.rst:81 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:126 -#: ../../library/asyncio-stream.rst:161 ../../library/asyncio-stream.rst:191 +#: ../../library/asyncio-stream.rst:84 ../../library/asyncio-stream.rst:128 +#: ../../library/asyncio-stream.rst:164 ../../library/asyncio-stream.rst:195 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:129 -#: ../../library/asyncio-stream.rst:164 ../../library/asyncio-stream.rst:194 -#: ../../library/asyncio-stream.rst:387 +#: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131 +#: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:198 +#: ../../library/asyncio-stream.rst:397 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-stream.rst:99 +#: ../../library/asyncio-stream.rst:101 msgid "Start a socket server." msgstr "啟動 socket 伺服器。" -#: ../../library/asyncio-stream.rst:101 +#: ../../library/asyncio-stream.rst:103 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -165,7 +165,7 @@ msgstr "" "式會接收到一對引數 ``(reader, writer)``,分別為 :class:`StreamReader` 和 :" "class:`StreamWriter` 的實例。" -#: ../../library/asyncio-stream.rst:106 +#: ../../library/asyncio-stream.rst:108 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "<coroutine>`; if it is a coroutine function, it will be automatically " @@ -175,48 +175,48 @@ msgstr "" "ref:`協程函式 <coroutine>`;如果它是一個協程函式,它將自動作為 :class:`Task` " "來被排程。" -#: ../../library/asyncio-stream.rst:114 +#: ../../library/asyncio-stream.rst:116 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "剩下的引數將會直接傳遞給 :meth:`loop.create_server`。" -#: ../../library/asyncio-stream.rst:119 ../../library/asyncio-stream.rst:181 +#: ../../library/asyncio-stream.rst:121 ../../library/asyncio-stream.rst:185 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-stream.rst:123 +#: ../../library/asyncio-stream.rst:125 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。" -#: ../../library/asyncio-stream.rst:132 +#: ../../library/asyncio-stream.rst:134 #, fuzzy msgid "Added the *keep_alive* parameter." msgstr "新增 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-stream.rst:137 +#: ../../library/asyncio-stream.rst:139 msgid "Unix Sockets" msgstr "Unix Sockets" -#: ../../library/asyncio-stream.rst:142 +#: ../../library/asyncio-stream.rst:145 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "建立一個 Unix socket 連線並回傳一對 ``(reader, writer)``。" -#: ../../library/asyncio-stream.rst:145 +#: ../../library/asyncio-stream.rst:148 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:147 +#: ../../library/asyncio-stream.rst:150 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" -#: ../../library/asyncio-stream.rst:155 ../../library/asyncio-stream.rst:185 +#: ../../library/asyncio-stream.rst:158 ../../library/asyncio-stream.rst:189 msgid "Availability" msgstr "" -#: ../../library/asyncio-stream.rst:157 +#: ../../library/asyncio-stream.rst:160 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" @@ -224,19 +224,19 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是個 :term:`path-like " "object`" -#: ../../library/asyncio-stream.rst:173 +#: ../../library/asyncio-stream.rst:177 msgid "Start a Unix socket server." msgstr "啟動一個 Unix socket 伺服器。" -#: ../../library/asyncio-stream.rst:175 +#: ../../library/asyncio-stream.rst:179 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:177 +#: ../../library/asyncio-stream.rst:181 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:187 +#: ../../library/asyncio-stream.rst:191 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." @@ -244,11 +244,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可以是" "個 :term:`path-like object`。" -#: ../../library/asyncio-stream.rst:199 +#: ../../library/asyncio-stream.rst:203 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:203 +#: ../../library/asyncio-stream.rst:207 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" @@ -257,7 +257,7 @@ msgstr "" "表示一個有提供 API 來從 IO 串流中讀取資料的 reader 物件。作為一個 :term:" "`asynchronous iterable`,此物件支援 :keyword:`async for` 陳述式。" -#: ../../library/asyncio-stream.rst:207 +#: ../../library/asyncio-stream.rst:211 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -265,15 +265,15 @@ msgstr "" "不建議直接實例化 *StreamReader* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:213 +#: ../../library/asyncio-stream.rst:217 msgid "Acknowledge the EOF." msgstr "" -#: ../../library/asyncio-stream.rst:217 +#: ../../library/asyncio-stream.rst:222 msgid "Read up to *n* bytes from the stream." msgstr "從串流中讀取至多 *n* 個位元組的資料。" -#: ../../library/asyncio-stream.rst:219 +#: ../../library/asyncio-stream.rst:224 msgid "" "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, " @@ -283,39 +283,39 @@ msgstr "" "的 :class:`bytes`。讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物" "件。" -#: ../../library/asyncio-stream.rst:224 +#: ../../library/asyncio-stream.rst:229 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." msgstr "如果 *n* 為 ``0``,則立即回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:226 +#: ../../library/asyncio-stream.rst:231 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:233 +#: ../../library/asyncio-stream.rst:239 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:236 +#: ../../library/asyncio-stream.rst:242 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:239 +#: ../../library/asyncio-stream.rst:245 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:244 +#: ../../library/asyncio-stream.rst:251 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:253 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -325,11 +325,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:252 +#: ../../library/asyncio-stream.rst:260 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:254 +#: ../../library/asyncio-stream.rst:262 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -337,7 +337,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:258 +#: ../../library/asyncio-stream.rst:266 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 " @@ -346,7 +346,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:262 +#: ../../library/asyncio-stream.rst:270 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -357,7 +357,7 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:267 +#: ../../library/asyncio-stream.rst:275 msgid "" "The *separator* may also be a tuple of separators. In this case the return " "value will be the shortest possible that has any separator as the suffix. " @@ -365,24 +365,24 @@ msgid "" "separator is considered to be the one that matched." msgstr "" -#: ../../library/asyncio-stream.rst:277 +#: ../../library/asyncio-stream.rst:285 msgid "The *separator* parameter may now be a :class:`tuple` of separators." msgstr "" -#: ../../library/asyncio-stream.rst:282 +#: ../../library/asyncio-stream.rst:290 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:287 +#: ../../library/asyncio-stream.rst:295 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:291 +#: ../../library/asyncio-stream.rst:299 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:294 +#: ../../library/asyncio-stream.rst:302 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -390,7 +390,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:300 +#: ../../library/asyncio-stream.rst:308 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 " @@ -399,11 +399,11 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:304 ../../library/asyncio-stream.rst:316 +#: ../../library/asyncio-stream.rst:312 ../../library/asyncio-stream.rst:324 msgid "The method should be used along with the ``drain()`` method::" msgstr "此方法應當與 ``drain()`` 方法一起使用: ::" -#: ../../library/asyncio-stream.rst:306 +#: ../../library/asyncio-stream.rst:314 msgid "" "stream.write(data)\n" "await stream.drain()" @@ -411,7 +411,7 @@ msgstr "" "stream.write(data)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:311 +#: ../../library/asyncio-stream.rst:319 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 " @@ -420,7 +420,7 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:318 +#: ../../library/asyncio-stream.rst:326 msgid "" "stream.writelines(lines)\n" "await stream.drain()" @@ -428,17 +428,17 @@ msgstr "" "stream.writelines(lines)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:323 +#: ../../library/asyncio-stream.rst:331 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:325 +#: ../../library/asyncio-stream.rst:333 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "此方法應與 ``wait_closed()`` 方法一起使用,但並非強制: ::" -#: ../../library/asyncio-stream.rst:328 +#: ../../library/asyncio-stream.rst:336 msgid "" "stream.close()\n" "await stream.wait_closed()" @@ -446,7 +446,7 @@ msgstr "" "stream.close()\n" "await stream.wait_closed()" -#: ../../library/asyncio-stream.rst:333 +#: ../../library/asyncio-stream.rst:341 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -454,26 +454,26 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:338 +#: ../../library/asyncio-stream.rst:346 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:351 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:347 +#: ../../library/asyncio-stream.rst:355 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:352 +#: ../../library/asyncio-stream.rst:361 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "等待直到可以繼續寫入到串流。範例: ::" -#: ../../library/asyncio-stream.rst:355 +#: ../../library/asyncio-stream.rst:364 msgid "" "writer.write(data)\n" "await writer.drain()" @@ -481,7 +481,7 @@ msgstr "" "writer.write(data)\n" "await writer.drain()" -#: ../../library/asyncio-stream.rst:358 +#: ../../library/asyncio-stream.rst:367 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()* " @@ -493,48 +493,48 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:368 +#: ../../library/asyncio-stream.rst:378 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:370 +#: ../../library/asyncio-stream.rst:380 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-stream.rst:372 +#: ../../library/asyncio-stream.rst:382 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:374 +#: ../../library/asyncio-stream.rst:384 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:377 +#: ../../library/asyncio-stream.rst:387 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:381 +#: ../../library/asyncio-stream.rst:391 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-stream.rst:393 +#: ../../library/asyncio-stream.rst:403 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:400 +#: ../../library/asyncio-stream.rst:411 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:402 +#: ../../library/asyncio-stream.rst:413 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -543,19 +543,19 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:410 +#: ../../library/asyncio-stream.rst:421 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:415 +#: ../../library/asyncio-stream.rst:426 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:417 +#: ../../library/asyncio-stream.rst:428 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端: ::" -#: ../../library/asyncio-stream.rst:441 +#: ../../library/asyncio-stream.rst:452 msgid "" "The :ref:`TCP echo client protocol " "<asyncio_example_tcp_echo_client_protocol>` example uses the low-level :meth:" @@ -564,15 +564,15 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "<asyncio_example_tcp_echo_client_protocol>`\\ 範例。" -#: ../../library/asyncio-stream.rst:448 +#: ../../library/asyncio-stream.rst:459 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:450 +#: ../../library/asyncio-stream.rst:461 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式: ::" -#: ../../library/asyncio-stream.rst:452 +#: ../../library/asyncio-stream.rst:463 msgid "" "import asyncio\n" "\n" @@ -632,7 +632,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../library/asyncio-stream.rst:484 +#: ../../library/asyncio-stream.rst:495 msgid "" "The :ref:`TCP echo server protocol " "<asyncio_example_tcp_echo_server_protocol>` example uses the :meth:`loop." @@ -641,16 +641,16 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "<asyncio_example_tcp_echo_server_protocol>` 範例。" -#: ../../library/asyncio-stream.rst:489 +#: ../../library/asyncio-stream.rst:500 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:491 +#: ../../library/asyncio-stream.rst:502 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例: ::" -#: ../../library/asyncio-stream.rst:493 +#: ../../library/asyncio-stream.rst:504 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -689,34 +689,34 @@ msgid "" "asyncio.run(print_http_headers(url))" msgstr "" -#: ../../library/asyncio-stream.rst:530 +#: ../../library/asyncio-stream.rst:541 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-stream.rst:532 +#: ../../library/asyncio-stream.rst:543 msgid "python example.py http://example.com/path/page.html" msgstr "python example.py http://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:534 +#: ../../library/asyncio-stream.rst:545 msgid "or with HTTPS::" msgstr "或使用 HTTPS: ::" -#: ../../library/asyncio-stream.rst:536 +#: ../../library/asyncio-stream.rst:547 msgid "python example.py https://example.com/path/page.html" msgstr "python example.py https://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:542 +#: ../../library/asyncio-stream.rst:553 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:544 +#: ../../library/asyncio-stream.rst:555 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" "等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程: ::" -#: ../../library/asyncio-stream.rst:547 +#: ../../library/asyncio-stream.rst:558 msgid "" "import asyncio\n" "import socket\n" @@ -749,7 +749,7 @@ msgid "" "asyncio.run(wait_for_data())" msgstr "" -#: ../../library/asyncio-stream.rst:579 +#: ../../library/asyncio-stream.rst:590 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "<asyncio_example_create_connection>` example uses a low-level protocol and " @@ -759,7 +759,7 @@ msgstr "" "<asyncio_example_create_connection>`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:583 +#: ../../library/asyncio-stream.rst:594 msgid "" "The :ref:`watch a file descriptor for read events " "<asyncio_example_watch_fd>` example uses the low-level :meth:`loop." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index a3ffe6d7bf..5cbc701494 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -127,43 +127,43 @@ msgstr "另請參閱\\ `Examples`_。" msgid "Creating Subprocesses" msgstr "建立子行程" -#: ../../library/asyncio-subprocess.rst:67 +#: ../../library/asyncio-subprocess.rst:68 msgid "Create a subprocess." msgstr "" -#: ../../library/asyncio-subprocess.rst:69 -#: ../../library/asyncio-subprocess.rst:87 +#: ../../library/asyncio-subprocess.rst:70 +#: ../../library/asyncio-subprocess.rst:89 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " "wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :const:" "`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." msgstr "" -#: ../../library/asyncio-subprocess.rst:73 -#: ../../library/asyncio-subprocess.rst:91 +#: ../../library/asyncio-subprocess.rst:74 +#: ../../library/asyncio-subprocess.rst:93 msgid "Return a :class:`~asyncio.subprocess.Process` instance." msgstr "" -#: ../../library/asyncio-subprocess.rst:75 +#: ../../library/asyncio-subprocess.rst:76 msgid "" "See the documentation of :meth:`loop.subprocess_exec` for other parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:78 -#: ../../library/asyncio-subprocess.rst:105 +#: ../../library/asyncio-subprocess.rst:79 +#: ../../library/asyncio-subprocess.rst:107 msgid "Removed the *loop* parameter." msgstr "" -#: ../../library/asyncio-subprocess.rst:85 +#: ../../library/asyncio-subprocess.rst:87 msgid "Run the *cmd* shell command." msgstr "" -#: ../../library/asyncio-subprocess.rst:93 +#: ../../library/asyncio-subprocess.rst:95 msgid "" "See the documentation of :meth:`loop.subprocess_shell` for other parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:98 +#: ../../library/asyncio-subprocess.rst:100 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -173,14 +173,14 @@ msgid "" "be used to construct shell commands." msgstr "" -#: ../../library/asyncio-subprocess.rst:110 +#: ../../library/asyncio-subprocess.rst:112 msgid "" "Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " "used. See :ref:`Subprocess Support on Windows <asyncio-windows-subprocess>` " "for details." msgstr "" -#: ../../library/asyncio-subprocess.rst:116 +#: ../../library/asyncio-subprocess.rst:118 msgid "" "asyncio also has the following *low-level* APIs to work with subprocesses: :" "meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." @@ -189,22 +189,22 @@ msgid "" "Protocols <asyncio-subprocess-protocols>`." msgstr "" -#: ../../library/asyncio-subprocess.rst:124 +#: ../../library/asyncio-subprocess.rst:126 msgid "Constants" msgstr "常數" -#: ../../library/asyncio-subprocess.rst:129 +#: ../../library/asyncio-subprocess.rst:131 msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:131 +#: ../../library/asyncio-subprocess.rst:133 msgid "" "If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin <asyncio." "subprocess.Process.stdin>` attribute will point to a :class:`StreamWriter` " "instance." msgstr "" -#: ../../library/asyncio-subprocess.rst:135 +#: ../../library/asyncio-subprocess.rst:137 msgid "" "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." "stdout <asyncio.subprocess.Process.stdout>` and :attr:`Process.stderr " @@ -212,24 +212,24 @@ msgid "" "`StreamReader` instances." msgstr "" -#: ../../library/asyncio-subprocess.rst:143 +#: ../../library/asyncio-subprocess.rst:145 msgid "" "Special value that can be used as the *stderr* argument and indicates that " "standard error should be redirected into standard output." msgstr "" -#: ../../library/asyncio-subprocess.rst:149 +#: ../../library/asyncio-subprocess.rst:151 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to process creation functions. It indicates that the special file :data:`os." "devnull` will be used for the corresponding subprocess stream." msgstr "" -#: ../../library/asyncio-subprocess.rst:155 +#: ../../library/asyncio-subprocess.rst:157 msgid "Interacting with Subprocesses" msgstr "" -#: ../../library/asyncio-subprocess.rst:157 +#: ../../library/asyncio-subprocess.rst:159 msgid "" "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " "functions return instances of the *Process* class. *Process* is a high-" @@ -237,61 +237,61 @@ msgid "" "their completion." msgstr "" -#: ../../library/asyncio-subprocess.rst:165 +#: ../../library/asyncio-subprocess.rst:167 msgid "" "An object that wraps OS processes created by the :func:" "`create_subprocess_exec` and :func:`create_subprocess_shell` functions." msgstr "" -#: ../../library/asyncio-subprocess.rst:169 +#: ../../library/asyncio-subprocess.rst:171 msgid "" "This class is designed to have a similar API to the :class:`subprocess." "Popen` class, but there are some notable differences:" msgstr "" -#: ../../library/asyncio-subprocess.rst:173 +#: ../../library/asyncio-subprocess.rst:175 msgid "" "unlike Popen, Process instances do not have an equivalent to the :meth:" "`~subprocess.Popen.poll` method;" msgstr "" -#: ../../library/asyncio-subprocess.rst:176 +#: ../../library/asyncio-subprocess.rst:178 msgid "" "the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." "subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" "func:`~asyncio.wait_for` function;" msgstr "" -#: ../../library/asyncio-subprocess.rst:180 +#: ../../library/asyncio-subprocess.rst:182 msgid "" "the :meth:`Process.wait() <asyncio.subprocess.Process.wait>` method is " "asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as " "a blocking busy loop;" msgstr "" -#: ../../library/asyncio-subprocess.rst:184 +#: ../../library/asyncio-subprocess.rst:186 msgid "the *universal_newlines* parameter is not supported." msgstr "" -#: ../../library/asyncio-subprocess.rst:186 +#: ../../library/asyncio-subprocess.rst:188 msgid "This class is :ref:`not thread safe <asyncio-multithreading>`." msgstr "" -#: ../../library/asyncio-subprocess.rst:188 +#: ../../library/asyncio-subprocess.rst:190 msgid "" "See also the :ref:`Subprocess and Threads <asyncio-subprocess-threads>` " "section." msgstr "" -#: ../../library/asyncio-subprocess.rst:193 +#: ../../library/asyncio-subprocess.rst:196 msgid "Wait for the child process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:195 +#: ../../library/asyncio-subprocess.rst:198 msgid "Set and return the :attr:`returncode` attribute." msgstr "" -#: ../../library/asyncio-subprocess.rst:199 +#: ../../library/asyncio-subprocess.rst:202 msgid "" "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " "the child process generates so much output that it blocks waiting for the OS " @@ -299,37 +299,37 @@ msgid "" "using pipes to avoid this condition." msgstr "" -#: ../../library/asyncio-subprocess.rst:207 +#: ../../library/asyncio-subprocess.rst:211 msgid "Interact with process:" msgstr "" -#: ../../library/asyncio-subprocess.rst:209 +#: ../../library/asyncio-subprocess.rst:213 msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "" -#: ../../library/asyncio-subprocess.rst:210 +#: ../../library/asyncio-subprocess.rst:214 msgid "closes *stdin*;" msgstr "" -#: ../../library/asyncio-subprocess.rst:211 +#: ../../library/asyncio-subprocess.rst:215 msgid "read data from *stdout* and *stderr*, until EOF is reached;" msgstr "" -#: ../../library/asyncio-subprocess.rst:212 +#: ../../library/asyncio-subprocess.rst:216 msgid "wait for process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:214 +#: ../../library/asyncio-subprocess.rst:218 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:217 +#: ../../library/asyncio-subprocess.rst:221 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "" -#: ../../library/asyncio-subprocess.rst:219 +#: ../../library/asyncio-subprocess.rst:223 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -337,7 +337,7 @@ msgid "" "*stdin*." msgstr "" -#: ../../library/asyncio-subprocess.rst:224 +#: ../../library/asyncio-subprocess.rst:228 msgid "" "If it is desired to send data to the process' *stdin*, the process needs to " "be created with ``stdin=PIPE``. Similarly, to get anything other than " @@ -345,75 +345,75 @@ msgid "" "``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" -#: ../../library/asyncio-subprocess.rst:230 +#: ../../library/asyncio-subprocess.rst:234 msgid "" "Note, that the data read is buffered in memory, so do not use this method if " "the data size is large or unlimited." msgstr "" -#: ../../library/asyncio-subprocess.rst:235 -msgid "*stdin* gets closed when `input=None` too." +#: ../../library/asyncio-subprocess.rst:239 +msgid "*stdin* gets closed when ``input=None`` too." msgstr "" -#: ../../library/asyncio-subprocess.rst:239 +#: ../../library/asyncio-subprocess.rst:243 msgid "Sends the signal *signal* to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:243 +#: ../../library/asyncio-subprocess.rst:247 msgid "" "On Windows, :py:const:`~signal.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/asyncio-subprocess.rst:250 +#: ../../library/asyncio-subprocess.rst:254 msgid "Stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:252 +#: ../../library/asyncio-subprocess.rst:256 msgid "" "On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:255 +#: ../../library/asyncio-subprocess.rst:259 msgid "" "On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " "stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:260 +#: ../../library/asyncio-subprocess.rst:264 msgid "Kill the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:262 +#: ../../library/asyncio-subprocess.rst:266 msgid "" "On POSIX systems this method sends :py:data:`SIGKILL` to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:265 +#: ../../library/asyncio-subprocess.rst:269 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "" -#: ../../library/asyncio-subprocess.rst:269 +#: ../../library/asyncio-subprocess.rst:273 msgid "" "Standard input stream (:class:`StreamWriter`) or ``None`` if the process was " "created with ``stdin=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:274 +#: ../../library/asyncio-subprocess.rst:278 msgid "" "Standard output stream (:class:`StreamReader`) or ``None`` if the process " "was created with ``stdout=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:279 +#: ../../library/asyncio-subprocess.rst:283 msgid "" "Standard error stream (:class:`StreamReader`) or ``None`` if the process was " "created with ``stderr=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:284 +#: ../../library/asyncio-subprocess.rst:288 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "<stdin>`, :attr:`await process.stdout.read() <stdout>` or :attr:`await " @@ -421,93 +421,93 @@ msgid "" "pausing reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:293 +#: ../../library/asyncio-subprocess.rst:297 msgid "Process identification number (PID)." msgstr "" -#: ../../library/asyncio-subprocess.rst:295 +#: ../../library/asyncio-subprocess.rst:299 msgid "" "Note that for processes created by the :func:`create_subprocess_shell` " "function, this attribute is the PID of the spawned shell." msgstr "" -#: ../../library/asyncio-subprocess.rst:300 +#: ../../library/asyncio-subprocess.rst:304 msgid "Return code of the process when it exits." msgstr "" -#: ../../library/asyncio-subprocess.rst:302 +#: ../../library/asyncio-subprocess.rst:306 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" -#: ../../library/asyncio-subprocess.rst:304 +#: ../../library/asyncio-subprocess.rst:308 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/asyncio-subprocess.rst:311 +#: ../../library/asyncio-subprocess.rst:315 msgid "Subprocess and Threads" msgstr "子行程與線程" -#: ../../library/asyncio-subprocess.rst:313 +#: ../../library/asyncio-subprocess.rst:317 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." msgstr "" -#: ../../library/asyncio-subprocess.rst:316 +#: ../../library/asyncio-subprocess.rst:320 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" -#: ../../library/asyncio-subprocess.rst:319 +#: ../../library/asyncio-subprocess.rst:323 msgid "" "On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" "`asyncio-watchers` for more info." msgstr "" -#: ../../library/asyncio-subprocess.rst:325 +#: ../../library/asyncio-subprocess.rst:329 msgid "" "UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " "from different threads without any limitation." msgstr "" -#: ../../library/asyncio-subprocess.rst:328 +#: ../../library/asyncio-subprocess.rst:332 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-subprocess.rst:331 +#: ../../library/asyncio-subprocess.rst:335 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." msgstr "" -#: ../../library/asyncio-subprocess.rst:336 +#: ../../library/asyncio-subprocess.rst:340 msgid "" "The :ref:`Concurrency and multithreading in asyncio <asyncio-" "multithreading>` section." msgstr "" -#: ../../library/asyncio-subprocess.rst:341 +#: ../../library/asyncio-subprocess.rst:345 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-subprocess.rst:343 +#: ../../library/asyncio-subprocess.rst:347 msgid "" "An example using the :class:`~asyncio.subprocess.Process` class to control a " "subprocess and the :class:`StreamReader` class to read from its standard " "output." msgstr "" -#: ../../library/asyncio-subprocess.rst:349 +#: ../../library/asyncio-subprocess.rst:353 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "" -#: ../../library/asyncio-subprocess.rst:352 +#: ../../library/asyncio-subprocess.rst:356 msgid "" "import asyncio\n" "import sys\n" @@ -533,7 +533,7 @@ msgid "" "print(f\"Current date: {date}\")" msgstr "" -#: ../../library/asyncio-subprocess.rst:376 +#: ../../library/asyncio-subprocess.rst:380 msgid "" "See also the :ref:`same example <asyncio_example_subprocess_proto>` written " "using low-level APIs." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index cba20e1ee9..e44a92a114 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-02-09 19:27+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -108,8 +108,8 @@ msgid "" " # access shared state" msgstr "" -#: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:199 -#: ../../library/asyncio-sync.rst:304 +#: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:201 +#: ../../library/asyncio-sync.rst:309 msgid "which is equivalent to::" msgstr "這等價於: ::" @@ -125,17 +125,17 @@ msgid "" " lock.release()" msgstr "" -#: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:112 -#: ../../library/asyncio-sync.rst:187 ../../library/asyncio-sync.rst:292 -#: ../../library/asyncio-sync.rst:347 +#: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:113 +#: ../../library/asyncio-sync.rst:189 ../../library/asyncio-sync.rst:297 +#: ../../library/asyncio-sync.rst:353 msgid "Removed the *loop* parameter." msgstr "移除 ``loop`` 參數。" -#: ../../library/asyncio-sync.rst:72 +#: ../../library/asyncio-sync.rst:73 msgid "Acquire the lock." msgstr "獲得鎖。" -#: ../../library/asyncio-sync.rst:74 +#: ../../library/asyncio-sync.rst:75 msgid "" "This method waits until the lock is *unlocked*, sets it to *locked* and " "returns ``True``." @@ -143,7 +143,7 @@ msgstr "" "此方法會持續等待直到鎖的狀態成為 *unlocked*,並將其設置為 *locked* 和回傳 " "``True``。" -#: ../../library/asyncio-sync.rst:77 +#: ../../library/asyncio-sync.rst:78 msgid "" "When more than one coroutine is blocked in :meth:`acquire` waiting for the " "lock to be unlocked, only one coroutine eventually proceeds." @@ -151,45 +151,45 @@ msgstr "" "當多於一個的協程 (coroutine) 在 :meth:`acquire` 中等待解鎖而被阻塞,最終只會" "有其中的一個被處理。" -#: ../../library/asyncio-sync.rst:81 +#: ../../library/asyncio-sync.rst:82 msgid "" "Acquiring a lock is *fair*: the coroutine that proceeds will be the first " "coroutine that started waiting on the lock." msgstr "" "鎖的獲取方式是\\ *公平*\\ 的:被處理的協程會是最早開始等待解鎖的那一個。" -#: ../../library/asyncio-sync.rst:86 +#: ../../library/asyncio-sync.rst:87 msgid "Release the lock." msgstr "釋放鎖。" -#: ../../library/asyncio-sync.rst:88 +#: ../../library/asyncio-sync.rst:89 msgid "When the lock is *locked*, reset it to *unlocked* and return." msgstr "如果鎖的狀態為 *locked* 則將其重置為 *unlocked* 並回傳。" -#: ../../library/asyncio-sync.rst:90 +#: ../../library/asyncio-sync.rst:91 msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised." msgstr "如果鎖的狀態為 *unlocked* 則 :exc:`RuntimeError` 會被引發。" -#: ../../library/asyncio-sync.rst:94 +#: ../../library/asyncio-sync.rst:95 msgid "Return ``True`` if the lock is *locked*." msgstr "如果鎖的狀態為 *locked* 則回傳 ``True``。" -#: ../../library/asyncio-sync.rst:98 +#: ../../library/asyncio-sync.rst:99 msgid "Event" msgstr "Event" -#: ../../library/asyncio-sync.rst:102 +#: ../../library/asyncio-sync.rst:103 msgid "An event object. Not thread-safe." msgstr "一個事件 (event) 物件。不支援執行緒安全。" -#: ../../library/asyncio-sync.rst:104 +#: ../../library/asyncio-sync.rst:105 msgid "" "An asyncio event can be used to notify multiple asyncio tasks that some " "event has happened." msgstr "" "一個 asyncio 事件可以被用於通知多個有發生某些事件於其中的 asyncio 任務。" -#: ../../library/asyncio-sync.rst:107 +#: ../../library/asyncio-sync.rst:108 msgid "" "An Event object manages an internal flag that can be set to *true* with the :" "meth:`~Event.set` method and reset to *false* with the :meth:`clear` " @@ -201,11 +201,11 @@ msgstr "" "wait` 方法會被阻塞 (block) 直到該旗標被設為 *true*。該旗標初始設置為 " "*false*。" -#: ../../library/asyncio-sync.rst:117 ../../library/asyncio-sync.rst:371 +#: ../../library/asyncio-sync.rst:118 ../../library/asyncio-sync.rst:377 msgid "Example::" msgstr "範例: ::" -#: ../../library/asyncio-sync.rst:119 +#: ../../library/asyncio-sync.rst:120 msgid "" "async def waiter(event):\n" " print('waiting for it ...')\n" @@ -229,11 +229,11 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../library/asyncio-sync.rst:142 +#: ../../library/asyncio-sync.rst:144 msgid "Wait until the event is set." msgstr "持續等待直到事件被設置。" -#: ../../library/asyncio-sync.rst:144 +#: ../../library/asyncio-sync.rst:146 msgid "" "If the event is set, return ``True`` immediately. Otherwise block until " "another task calls :meth:`~Event.set`." @@ -241,19 +241,19 @@ msgstr "" "如果事件有被設置則立刻回傳 ``True``。否則持續阻塞直到另一個任務呼叫 :meth:" "`~Event.set`。" -#: ../../library/asyncio-sync.rst:149 +#: ../../library/asyncio-sync.rst:151 msgid "Set the event." msgstr "設置事件。" -#: ../../library/asyncio-sync.rst:151 +#: ../../library/asyncio-sync.rst:153 msgid "All tasks waiting for event to be set will be immediately awakened." msgstr "所有正在等待事件被設置的任務會立即被喚醒。" -#: ../../library/asyncio-sync.rst:156 +#: ../../library/asyncio-sync.rst:158 msgid "Clear (unset) the event." msgstr "清除(還原)事件。" -#: ../../library/asyncio-sync.rst:158 +#: ../../library/asyncio-sync.rst:160 msgid "" "Tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event." "set` method is called again." @@ -261,19 +261,19 @@ msgstr "" "正透過 :meth:`~Event.wait` 等待的 Tasks 現在會持續阻塞直到 :meth:`~Event." "set` 方法再次被呼叫。" -#: ../../library/asyncio-sync.rst:163 +#: ../../library/asyncio-sync.rst:165 msgid "Return ``True`` if the event is set." msgstr "如果事件有被設置則回傳 ``True``。" -#: ../../library/asyncio-sync.rst:167 +#: ../../library/asyncio-sync.rst:169 msgid "Condition" msgstr "Condition" -#: ../../library/asyncio-sync.rst:171 +#: ../../library/asyncio-sync.rst:173 msgid "A Condition object. Not thread-safe." msgstr "一個條件 (codition) 物件。不支援執行緒安全。" -#: ../../library/asyncio-sync.rst:173 +#: ../../library/asyncio-sync.rst:175 msgid "" "An asyncio condition primitive can be used by a task to wait for some event " "to happen and then get exclusive access to a shared resource." @@ -281,7 +281,7 @@ msgstr "" "一個 asyncio 條件原始物件可以被任務用來等待某事件發生,並獲得一個共享資源的獨" "佔存取權。" -#: ../../library/asyncio-sync.rst:177 +#: ../../library/asyncio-sync.rst:179 msgid "" "In essence, a Condition object combines the functionality of an :class:" "`Event` and a :class:`Lock`. It is possible to have multiple Condition " @@ -293,7 +293,7 @@ msgstr "" "個 Condition 物件共享一個 Lock 是有可能發生的,這能夠協調關注同一共享資源的不" "同狀態以獲取其獨佔存取權的多個任務。" -#: ../../library/asyncio-sync.rst:183 +#: ../../library/asyncio-sync.rst:185 msgid "" "The optional *lock* argument must be a :class:`Lock` object or ``None``. In " "the latter case a new Lock object is created automatically." @@ -301,12 +301,12 @@ msgstr "" "可選的 *lock* 引數必須是一個 :class:`Lock` 物件或者為 ``None``。如為後者則一" "個新的 Lock 物件會被自動建立。" -#: ../../library/asyncio-sync.rst:190 +#: ../../library/asyncio-sync.rst:192 msgid "" "The preferred way to use a Condition is an :keyword:`async with` statement::" msgstr "使用 Condition 的推薦方式是透過 :keyword:`async with` 陳述式: ::" -#: ../../library/asyncio-sync.rst:193 +#: ../../library/asyncio-sync.rst:195 msgid "" "cond = asyncio.Condition()\n" "\n" @@ -315,7 +315,7 @@ msgid "" " await cond.wait()" msgstr "" -#: ../../library/asyncio-sync.rst:201 +#: ../../library/asyncio-sync.rst:203 msgid "" "cond = asyncio.Condition()\n" "\n" @@ -327,11 +327,11 @@ msgid "" " cond.release()" msgstr "" -#: ../../library/asyncio-sync.rst:212 +#: ../../library/asyncio-sync.rst:215 msgid "Acquire the underlying lock." msgstr "獲取底層的鎖。" -#: ../../library/asyncio-sync.rst:214 +#: ../../library/asyncio-sync.rst:217 msgid "" "This method waits until the underlying lock is *unlocked*, sets it to " "*locked* and returns ``True``." @@ -339,7 +339,7 @@ msgstr "" "此方法會持續等待直到底層的鎖為 *unlocked*,並將其設為 *locked* 並回傳 " "``True``。" -#: ../../library/asyncio-sync.rst:219 +#: ../../library/asyncio-sync.rst:222 #, fuzzy msgid "" "Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " @@ -348,7 +348,7 @@ msgstr "" "喚醒至多 *n* 個正在等待此條件的任務(預設為 1),如果沒有正在等待的任務則此方" "法為空操作 (no-op)。" -#: ../../library/asyncio-sync.rst:222 ../../library/asyncio-sync.rst:237 +#: ../../library/asyncio-sync.rst:225 ../../library/asyncio-sync.rst:240 msgid "" "The lock must be acquired before this method is called and released shortly " "after. If called with an *unlocked* lock a :exc:`RuntimeError` error is " @@ -357,31 +357,31 @@ msgstr "" "在此方法被呼叫前必須先獲得鎖,並在之後立刻將其釋放。如果呼叫於一個 " "*unlocked* 的鎖則 :exc:`RuntimeError` 錯誤會被引發。" -#: ../../library/asyncio-sync.rst:228 +#: ../../library/asyncio-sync.rst:231 msgid "Return ``True`` if the underlying lock is acquired." msgstr "如果已獲取底層的鎖則回傳 ``True``。" -#: ../../library/asyncio-sync.rst:232 +#: ../../library/asyncio-sync.rst:235 msgid "Wake up all tasks waiting on this condition." msgstr "喚醒所有正在等待此條件的任務。" -#: ../../library/asyncio-sync.rst:234 +#: ../../library/asyncio-sync.rst:237 msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks." msgstr "這個方法的行為就像 :meth:`notify`,但會喚醒所有正在等待的任務。" -#: ../../library/asyncio-sync.rst:243 +#: ../../library/asyncio-sync.rst:246 msgid "Release the underlying lock." msgstr "釋放底層的鎖。" -#: ../../library/asyncio-sync.rst:245 +#: ../../library/asyncio-sync.rst:248 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "當調用於一個未被解開的鎖之上時,會引發一個 :exc:`RuntimeError`。" -#: ../../library/asyncio-sync.rst:250 +#: ../../library/asyncio-sync.rst:254 msgid "Wait until notified." msgstr "持續等待直到被通知 (notify)。" -#: ../../library/asyncio-sync.rst:252 +#: ../../library/asyncio-sync.rst:256 msgid "" "If the calling task has not acquired the lock when this method is called, a :" "exc:`RuntimeError` is raised." @@ -389,7 +389,7 @@ msgstr "" "當此方法被呼叫時,如果呼叫它的任務還沒有獲取鎖的話,:exc:`RuntimeError` 會被" "引發。" -#: ../../library/asyncio-sync.rst:255 +#: ../../library/asyncio-sync.rst:259 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the " @@ -399,7 +399,7 @@ msgstr "" "`notify_all` 的呼叫所喚醒。一但被喚醒,Condition 會重新獲取該鎖且此方法會回" "傳 ``True``。" -#: ../../library/asyncio-sync.rst:260 +#: ../../library/asyncio-sync.rst:264 msgid "" "Note that a task *may* return from this call spuriously, which is why the " "caller should always re-check the state and be prepared to :meth:`~Condition." @@ -407,11 +407,11 @@ msgid "" "wait_for` instead." msgstr "" -#: ../../library/asyncio-sync.rst:267 +#: ../../library/asyncio-sync.rst:272 msgid "Wait until a predicate becomes *true*." msgstr "持續等待直到謂語 (predicate) 成為 *true*。" -#: ../../library/asyncio-sync.rst:269 +#: ../../library/asyncio-sync.rst:274 #, fuzzy msgid "" "The predicate must be a callable which result will be interpreted as a " @@ -421,15 +421,15 @@ msgstr "" "謂語必須是一個結果可被直譯為一個 boolean 值的可呼叫物件 (callable)。最終值為" "回傳值。" -#: ../../library/asyncio-sync.rst:276 +#: ../../library/asyncio-sync.rst:281 msgid "Semaphore" msgstr "Semaphore" -#: ../../library/asyncio-sync.rst:280 +#: ../../library/asyncio-sync.rst:285 msgid "A Semaphore object. Not thread-safe." msgstr "一個旗號 (semaphore) 物件。不支援執行緒安全。" -#: ../../library/asyncio-sync.rst:282 +#: ../../library/asyncio-sync.rst:287 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`acquire` call and incremented by each :meth:`release` call. The counter can " @@ -440,7 +440,7 @@ msgstr "" "呼叫 :meth:`release` 時增加一。此計數器永遠不會少於零;當 :meth:`acquire` 發" "現它是零時,它會持續阻塞並等待某任務呼叫 :meth:`release`。" -#: ../../library/asyncio-sync.rst:288 +#: ../../library/asyncio-sync.rst:293 msgid "" "The optional *value* argument gives the initial value for the internal " "counter (``1`` by default). If the given value is less than ``0`` a :exc:" @@ -449,12 +449,12 @@ msgstr "" "可選的 *value* 引數給定了內部計數器的初始值(預設為 ``1``\\ )。如給定的值少" "於 ``0`` 則 :exc:`ValueError` 會被引發。" -#: ../../library/asyncio-sync.rst:295 +#: ../../library/asyncio-sync.rst:300 msgid "" "The preferred way to use a Semaphore is an :keyword:`async with` statement::" msgstr "使用 Semaphore 的推薦方式是透過 :keyword:`async with` 陳述式: ::" -#: ../../library/asyncio-sync.rst:298 +#: ../../library/asyncio-sync.rst:303 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -463,7 +463,7 @@ msgid "" " # work with shared resource" msgstr "" -#: ../../library/asyncio-sync.rst:306 +#: ../../library/asyncio-sync.rst:311 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -475,11 +475,11 @@ msgid "" " sem.release()" msgstr "" -#: ../../library/asyncio-sync.rst:317 +#: ../../library/asyncio-sync.rst:323 msgid "Acquire a semaphore." msgstr "獲取一個旗號。" -#: ../../library/asyncio-sync.rst:319 +#: ../../library/asyncio-sync.rst:325 msgid "" "If the internal counter is greater than zero, decrement it by one and return " "``True`` immediately. If it is zero, wait until a :meth:`release` is called " @@ -488,11 +488,11 @@ msgstr "" "如果內部計數器大於零,將其減一並立刻回傳 ``True``。如果為零,則持續等待直到 :" "meth:`release` 被呼叫,並回傳 ``True``。" -#: ../../library/asyncio-sync.rst:325 +#: ../../library/asyncio-sync.rst:331 msgid "Returns ``True`` if semaphore can not be acquired immediately." msgstr "如果旗號無法立即被取得則回傳 ``True``。" -#: ../../library/asyncio-sync.rst:329 +#: ../../library/asyncio-sync.rst:335 msgid "" "Release a semaphore, incrementing the internal counter by one. Can wake up a " "task waiting to acquire the semaphore." @@ -500,7 +500,7 @@ msgstr "" "釋放一個旗號,並為其內部的計數器數值增加一。可以把一個正在等待獲取旗號的任務" "叫醒。" -#: ../../library/asyncio-sync.rst:332 +#: ../../library/asyncio-sync.rst:338 msgid "" "Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more " "``release()`` calls than ``acquire()`` calls." @@ -508,15 +508,15 @@ msgstr "" "和 :class:`BoundedSemaphore` 不同,:class:`Semaphore` 允許 ``release()`` 的呼" "叫次數多於 ``acquire()``。" -#: ../../library/asyncio-sync.rst:337 +#: ../../library/asyncio-sync.rst:343 msgid "BoundedSemaphore" msgstr "BoundedSemaphore" -#: ../../library/asyncio-sync.rst:341 +#: ../../library/asyncio-sync.rst:347 msgid "A bounded semaphore object. Not thread-safe." msgstr "一個有界的旗號物件。不支援執行緒安全。" -#: ../../library/asyncio-sync.rst:343 +#: ../../library/asyncio-sync.rst:349 msgid "" "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:" "`ValueError` in :meth:`~Semaphore.release` if it increases the internal " @@ -526,15 +526,15 @@ msgstr "" "加至大於初始 *value* 值的話,:exc:`ValueError` 會在 :meth:`~Semaphore." "release` 時被引發。" -#: ../../library/asyncio-sync.rst:352 +#: ../../library/asyncio-sync.rst:358 msgid "Barrier" msgstr "Barrier" -#: ../../library/asyncio-sync.rst:356 +#: ../../library/asyncio-sync.rst:362 msgid "A barrier object. Not thread-safe." msgstr "一個屏障 (barrier) 物件。不支援執行緒安全。" -#: ../../library/asyncio-sync.rst:358 +#: ../../library/asyncio-sync.rst:364 msgid "" "A barrier is a simple synchronization primitive that allows to block until " "*parties* number of tasks are waiting on it. Tasks can wait on the :meth:" @@ -543,17 +543,17 @@ msgid "" "waiting tasks would unblock simultaneously." msgstr "" -#: ../../library/asyncio-sync.rst:364 +#: ../../library/asyncio-sync.rst:370 msgid "" ":keyword:`async with` can be used as an alternative to awaiting on :meth:" "`~Barrier.wait`." msgstr "" -#: ../../library/asyncio-sync.rst:367 +#: ../../library/asyncio-sync.rst:373 msgid "The barrier can be reused any number of times." msgstr "" -#: ../../library/asyncio-sync.rst:373 +#: ../../library/asyncio-sync.rst:379 msgid "" "async def example_barrier():\n" " # barrier with 3 parties\n" @@ -577,11 +577,11 @@ msgid "" "asyncio.run(example_barrier())" msgstr "" -#: ../../library/asyncio-sync.rst:394 +#: ../../library/asyncio-sync.rst:400 msgid "Result of this example is::" msgstr "" -#: ../../library/asyncio-sync.rst:396 +#: ../../library/asyncio-sync.rst:402 msgid "" "<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>\n" "<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>\n" @@ -593,27 +593,27 @@ msgstr "" "barrier passed\n" "<asyncio.locks.Barrier object at 0x... [filling, waiters:0/3]>" -#: ../../library/asyncio-sync.rst:405 +#: ../../library/asyncio-sync.rst:412 msgid "" "Pass the barrier. When all the tasks party to the barrier have called this " "function, they are all unblocked simultaneously." msgstr "" -#: ../../library/asyncio-sync.rst:408 +#: ../../library/asyncio-sync.rst:415 msgid "" "When a waiting or blocked task in the barrier is cancelled, this task exits " "the barrier which stays in the same state. If the state of the barrier is " "\"filling\", the number of waiting task decreases by 1." msgstr "" -#: ../../library/asyncio-sync.rst:413 +#: ../../library/asyncio-sync.rst:420 msgid "" "The return value is an integer in the range of 0 to ``parties-1``, different " "for each task. This can be used to select a task to do some special " "housekeeping, e.g.::" msgstr "" -#: ../../library/asyncio-sync.rst:417 +#: ../../library/asyncio-sync.rst:424 msgid "" "...\n" "async with barrier as position:\n" @@ -622,26 +622,26 @@ msgid "" " print('End of *draining phase*')" msgstr "" -#: ../../library/asyncio-sync.rst:423 +#: ../../library/asyncio-sync.rst:430 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a task is waiting. It could raise a :exc:" "`CancelledError` if a task is cancelled." msgstr "" -#: ../../library/asyncio-sync.rst:429 +#: ../../library/asyncio-sync.rst:437 msgid "" "Return the barrier to the default, empty state. Any tasks waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: ../../library/asyncio-sync.rst:432 +#: ../../library/asyncio-sync.rst:440 msgid "" "If a barrier is broken it may be better to just leave it and create a new " "one." msgstr "" -#: ../../library/asyncio-sync.rst:436 +#: ../../library/asyncio-sync.rst:445 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " @@ -649,25 +649,25 @@ msgid "" "waiting tasks." msgstr "" -#: ../../library/asyncio-sync.rst:443 +#: ../../library/asyncio-sync.rst:452 msgid "The number of tasks required to pass the barrier." msgstr "" -#: ../../library/asyncio-sync.rst:447 +#: ../../library/asyncio-sync.rst:456 msgid "The number of tasks currently waiting in the barrier while filling." msgstr "" -#: ../../library/asyncio-sync.rst:451 +#: ../../library/asyncio-sync.rst:460 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: ../../library/asyncio-sync.rst:456 +#: ../../library/asyncio-sync.rst:465 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: ../../library/asyncio-sync.rst:464 +#: ../../library/asyncio-sync.rst:473 msgid "" "Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:" "`with` statement (``with await lock``, ``with (yield from lock)``) was " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 280363e69e..6c05203c69 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -435,11 +435,11 @@ msgid "" " task.add_done_callback(background_tasks.discard)" msgstr "" -#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1188 +#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1192 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1195 +#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1199 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" @@ -502,9 +502,9 @@ msgstr "" msgid "Close the given coroutine if the task group is not active." msgstr "" -#: ../../library/asyncio-task.rst:345 ../../library/asyncio-task.rst:550 -#: ../../library/asyncio-task.rst:723 ../../library/asyncio-task.rst:781 -#: ../../library/asyncio-task.rst:807 ../../library/asyncio-task.rst:847 +#: ../../library/asyncio-task.rst:345 ../../library/asyncio-task.rst:551 +#: ../../library/asyncio-task.rst:724 ../../library/asyncio-task.rst:782 +#: ../../library/asyncio-task.rst:808 ../../library/asyncio-task.rst:849 msgid "Example::" msgstr "範例: ::" @@ -659,34 +659,34 @@ msgstr "" msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:469 +#: ../../library/asyncio-task.rst:470 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:471 +#: ../../library/asyncio-task.rst:472 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:474 +#: ../../library/asyncio-task.rst:475 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:477 +#: ../../library/asyncio-task.rst:478 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:483 +#: ../../library/asyncio-task.rst:484 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:486 +#: ../../library/asyncio-task.rst:487 msgid "" "import asyncio\n" "import datetime\n" @@ -716,40 +716,40 @@ msgstr "" "\n" "asyncio.run(display_date())" -#: ../../library/asyncio-task.rst:501 ../../library/asyncio-task.rst:599 -#: ../../library/asyncio-task.rst:698 ../../library/asyncio-task.rst:872 -#: ../../library/asyncio-task.rst:926 ../../library/asyncio-task.rst:983 +#: ../../library/asyncio-task.rst:502 ../../library/asyncio-task.rst:600 +#: ../../library/asyncio-task.rst:699 ../../library/asyncio-task.rst:874 +#: ../../library/asyncio-task.rst:929 ../../library/asyncio-task.rst:986 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:504 +#: ../../library/asyncio-task.rst:505 msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." msgstr "" -#: ../../library/asyncio-task.rst:509 +#: ../../library/asyncio-task.rst:510 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:513 +#: ../../library/asyncio-task.rst:514 msgid "" "Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:516 +#: ../../library/asyncio-task.rst:517 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:519 +#: ../../library/asyncio-task.rst:520 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:523 +#: ../../library/asyncio-task.rst:524 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -757,19 +757,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:528 +#: ../../library/asyncio-task.rst:529 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:531 +#: ../../library/asyncio-task.rst:532 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:534 +#: ../../library/asyncio-task.rst:535 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** " @@ -777,7 +777,7 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:541 +#: ../../library/asyncio-task.rst:542 msgid "" "A new alternative to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " @@ -787,7 +787,7 @@ msgid "" "tasks)." msgstr "" -#: ../../library/asyncio-task.rst:552 +#: ../../library/asyncio-task.rst:553 msgid "" "import asyncio\n" "\n" @@ -826,7 +826,7 @@ msgid "" "# [2, 6, 24]" msgstr "" -#: ../../library/asyncio-task.rst:588 +#: ../../library/asyncio-task.rst:589 msgid "" "If *return_exceptions* is false, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -835,28 +835,28 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:595 +#: ../../library/asyncio-task.rst:596 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:602 +#: ../../library/asyncio-task.rst:603 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:611 +#: ../../library/asyncio-task.rst:612 msgid "Eager Task Factory" msgstr "" -#: ../../library/asyncio-task.rst:615 +#: ../../library/asyncio-task.rst:616 msgid "A task factory for eager task execution." msgstr "" -#: ../../library/asyncio-task.rst:617 +#: ../../library/asyncio-task.rst:618 msgid "" "When using this factory (via :meth:`loop.set_task_factory(asyncio." "eager_task_factory) <loop.set_task_factory>`), coroutines begin execution " @@ -866,13 +866,13 @@ msgid "" "synchronously." msgstr "" -#: ../../library/asyncio-task.rst:623 +#: ../../library/asyncio-task.rst:624 msgid "" "A common example where this is beneficial is coroutines which employ caching " "or memoization to avoid actual I/O when possible." msgstr "" -#: ../../library/asyncio-task.rst:628 +#: ../../library/asyncio-task.rst:629 msgid "" "Immediate execution of the coroutine is a semantic change. If the coroutine " "returns or raises, the task is never scheduled to the event loop. If the " @@ -881,46 +881,46 @@ msgid "" "the application's task execution order is likely to change." msgstr "" -#: ../../library/asyncio-task.rst:639 +#: ../../library/asyncio-task.rst:640 msgid "" "Create an eager task factory, similar to :func:`eager_task_factory`, using " "the provided *custom_task_constructor* when creating a new task instead of " "the default :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:643 +#: ../../library/asyncio-task.rst:644 msgid "" "*custom_task_constructor* must be a *callable* with the signature matching " "the signature of :class:`Task.__init__ <Task>`. The callable must return a :" "class:`asyncio.Task`-compatible object." msgstr "" -#: ../../library/asyncio-task.rst:647 +#: ../../library/asyncio-task.rst:648 msgid "" "This function returns a *callable* intended to be used as a task factory of " "an event loop via :meth:`loop.set_task_factory(factory) <loop." "set_task_factory>`)." msgstr "" -#: ../../library/asyncio-task.rst:654 +#: ../../library/asyncio-task.rst:655 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:658 +#: ../../library/asyncio-task.rst:659 msgid "" "Protect an :ref:`awaitable object <asyncio-awaitables>` from being :meth:" "`cancelled <Task.cancel>`." msgstr "" -#: ../../library/asyncio-task.rst:661 ../../library/asyncio-task.rst:827 +#: ../../library/asyncio-task.rst:662 ../../library/asyncio-task.rst:829 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:663 +#: ../../library/asyncio-task.rst:664 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:665 +#: ../../library/asyncio-task.rst:666 msgid "" "task = asyncio.create_task(something())\n" "res = await shield(task)" @@ -928,15 +928,15 @@ msgstr "" "task = asyncio.create_task(something())\n" "res = await shield(task)" -#: ../../library/asyncio-task.rst:668 +#: ../../library/asyncio-task.rst:669 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:670 +#: ../../library/asyncio-task.rst:671 msgid "res = await something()" msgstr "res = await something()" -#: ../../library/asyncio-task.rst:672 +#: ../../library/asyncio-task.rst:673 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -945,20 +945,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:678 +#: ../../library/asyncio-task.rst:679 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:681 +#: ../../library/asyncio-task.rst:682 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:685 +#: ../../library/asyncio-task.rst:686 msgid "" "task = asyncio.create_task(something())\n" "try:\n" @@ -972,7 +972,7 @@ msgstr "" "except CancelledError:\n" " res = None" -#: ../../library/asyncio-task.rst:693 +#: ../../library/asyncio-task.rst:694 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 " @@ -980,36 +980,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:702 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:707 +#: ../../library/asyncio-task.rst:708 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:711 +#: ../../library/asyncio-task.rst:712 msgid "" "Return an :ref:`asynchronous context manager <async-context-managers>` that " "can be used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:715 +#: ../../library/asyncio-task.rst:716 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:720 +#: ../../library/asyncio-task.rst:721 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:725 +#: ../../library/asyncio-task.rst:726 msgid "" "async def main():\n" " async with asyncio.timeout(10):\n" @@ -1019,7 +1019,7 @@ msgstr "" " async with asyncio.timeout(10):\n" " await long_running_task()" -#: ../../library/asyncio-task.rst:729 +#: ../../library/asyncio-task.rst:730 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." @@ -1027,18 +1027,18 @@ msgid "" "can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:736 +#: ../../library/asyncio-task.rst:737 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`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:741 +#: ../../library/asyncio-task.rst:742 msgid "Example of catching :exc:`TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:743 +#: ../../library/asyncio-task.rst:744 msgid "" "async def main():\n" " try:\n" @@ -1050,48 +1050,48 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: ../../library/asyncio-task.rst:752 +#: ../../library/asyncio-task.rst:753 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:757 +#: ../../library/asyncio-task.rst:758 msgid "" "An :ref:`asynchronous context manager <async-context-managers>` for " "cancelling overdue coroutines." msgstr "" -#: ../../library/asyncio-task.rst:760 +#: ../../library/asyncio-task.rst:761 msgid "" "``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:763 +#: ../../library/asyncio-task.rst:764 msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:765 msgid "" "If ``when < loop.time()``, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: ../../library/asyncio-task.rst:769 +#: ../../library/asyncio-task.rst:770 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:774 +#: ../../library/asyncio-task.rst:775 msgid "Reschedule the timeout." msgstr "" -#: ../../library/asyncio-task.rst:778 +#: ../../library/asyncio-task.rst:779 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:784 msgid "" "async def main():\n" " try:\n" @@ -1109,17 +1109,17 @@ msgid "" " print(\"Looks like we haven't finished on time.\")" msgstr "" -#: ../../library/asyncio-task.rst:798 +#: ../../library/asyncio-task.rst:799 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:804 +#: ../../library/asyncio-task.rst:805 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:809 +#: ../../library/asyncio-task.rst:810 msgid "" "async def main():\n" " loop = get_running_loop()\n" @@ -1133,41 +1133,41 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: ../../library/asyncio-task.rst:824 +#: ../../library/asyncio-task.rst:826 msgid "" "Wait for the *aw* :ref:`awaitable <asyncio-awaitables>` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:829 +#: ../../library/asyncio-task.rst:831 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:833 +#: ../../library/asyncio-task.rst:835 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:838 msgid "" "To avoid the task :meth:`cancellation <Task.cancel>`, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:839 +#: ../../library/asyncio-task.rst:841 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:843 +#: ../../library/asyncio-task.rst:845 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:849 +#: ../../library/asyncio-task.rst:851 msgid "" "async def eternity():\n" " # Sleep for one hour\n" @@ -1188,107 +1188,107 @@ msgid "" "# timeout!" msgstr "" -#: ../../library/asyncio-task.rst:867 +#: ../../library/asyncio-task.rst:869 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:875 +#: ../../library/asyncio-task.rst:877 msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." msgstr "引發 :exc:`TimeoutError` 而不是 :exc:`asyncio.TimeoutError`。" -#: ../../library/asyncio-task.rst:880 +#: ../../library/asyncio-task.rst:882 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:884 +#: ../../library/asyncio-task.rst:887 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:888 +#: ../../library/asyncio-task.rst:891 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:890 +#: ../../library/asyncio-task.rst:893 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:892 +#: ../../library/asyncio-task.rst:895 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-task.rst:894 +#: ../../library/asyncio-task.rst:897 msgid "done, pending = await asyncio.wait(aws)" msgstr "done, pending = await asyncio.wait(aws)" -#: ../../library/asyncio-task.rst:896 +#: ../../library/asyncio-task.rst:899 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:899 +#: ../../library/asyncio-task.rst:902 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:903 +#: ../../library/asyncio-task.rst:906 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:909 +#: ../../library/asyncio-task.rst:912 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:910 +#: ../../library/asyncio-task.rst:913 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:913 +#: ../../library/asyncio-task.rst:916 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:916 +#: ../../library/asyncio-task.rst:919 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:921 +#: ../../library/asyncio-task.rst:924 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:923 +#: ../../library/asyncio-task.rst:926 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:932 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:932 ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:935 ../../library/asyncio-task.rst:993 msgid "Added support for generators yielding tasks." msgstr "" -#: ../../library/asyncio-task.rst:938 +#: ../../library/asyncio-task.rst:941 msgid "" "Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws* iterable " "concurrently. The returned object can be iterated to obtain the results of " "the awaitables as they finish." msgstr "" -#: ../../library/asyncio-task.rst:942 +#: ../../library/asyncio-task.rst:945 msgid "" "The object returned by ``as_completed()`` can be iterated as an :term:" "`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " @@ -1297,7 +1297,7 @@ msgid "" "tasks with their results. Example::" msgstr "" -#: ../../library/asyncio-task.rst:948 +#: ../../library/asyncio-task.rst:951 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1314,20 +1314,20 @@ msgid "" " print(\"IPv4 connection established.\")" msgstr "" -#: ../../library/asyncio-task.rst:962 +#: ../../library/asyncio-task.rst:965 msgid "" "During asynchronous iteration, implicitly-created tasks will be yielded for " "supplied awaitables that aren't tasks or futures." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:968 msgid "" "When used as a plain iterator, each iteration yields a new coroutine that " "returns the result or raises the exception of the next completed awaitable. " "This pattern is compatible with Python versions older than 3.13::" msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:972 msgid "" "ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" "ipv6_connect = create_task(open_connection(\"::1\", 80))\n" @@ -1340,34 +1340,34 @@ msgid "" " reader, writer = await next_connect" msgstr "" -#: ../../library/asyncio-task.rst:979 +#: ../../library/asyncio-task.rst:982 msgid "" "A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " "are done. This is raised by the ``async for`` loop during asynchronous " "iteration or by the coroutines yielded during plain iteration." msgstr "" -#: ../../library/asyncio-task.rst:986 +#: ../../library/asyncio-task.rst:989 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:993 +#: ../../library/asyncio-task.rst:996 msgid "" "The result can now be used as either an :term:`asynchronous iterator` or as " "a plain :term:`iterator` (previously it was only a plain iterator)." msgstr "" -#: ../../library/asyncio-task.rst:999 +#: ../../library/asyncio-task.rst:1002 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:1003 +#: ../../library/asyncio-task.rst:1007 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:1005 +#: ../../library/asyncio-task.rst:1009 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -1375,19 +1375,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:1014 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:1016 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:1016 +#: ../../library/asyncio-task.rst:1020 msgid "" "def blocking_io():\n" " print(f\"start blocking_io at {time.strftime('%X')}\")\n" @@ -1416,7 +1416,7 @@ msgid "" "# finished main at 19:50:54" msgstr "" -#: ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1046 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. " @@ -1424,7 +1424,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1049 +#: ../../library/asyncio-task.rst:1053 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 " @@ -1432,27 +1432,27 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:1058 +#: ../../library/asyncio-task.rst:1062 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:1062 +#: ../../library/asyncio-task.rst:1066 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1068 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:1067 +#: ../../library/asyncio-task.rst:1071 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:1070 +#: ../../library/asyncio-task.rst:1074 msgid "" "# Create a coroutine\n" "coro = asyncio.sleep(1, result=3)\n" @@ -1464,13 +1464,13 @@ msgid "" "assert future.result(timeout) == 3" msgstr "" -#: ../../library/asyncio-task.rst:1079 +#: ../../library/asyncio-task.rst:1083 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:1083 +#: ../../library/asyncio-task.rst:1087 msgid "" "try:\n" " result = future.result(timeout)\n" @@ -1483,59 +1483,59 @@ msgid "" " print(f'The coroutine returned: {result!r}')" msgstr "" -#: ../../library/asyncio-task.rst:1093 +#: ../../library/asyncio-task.rst:1097 msgid "" "See the :ref:`concurrency and multithreading <asyncio-multithreading>` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1100 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:1103 +#: ../../library/asyncio-task.rst:1107 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:1108 +#: ../../library/asyncio-task.rst:1112 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:1111 +#: ../../library/asyncio-task.rst:1115 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1119 +#: ../../library/asyncio-task.rst:1123 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1126 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1130 +#: ../../library/asyncio-task.rst:1134 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:1136 +#: ../../library/asyncio-task.rst:1140 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:1140 +#: ../../library/asyncio-task.rst:1144 msgid "" "A :class:`Future-like <Future>` object that runs a Python :ref:`coroutine " "<coroutine>`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:1143 +#: ../../library/asyncio-task.rst:1147 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 " @@ -1543,21 +1543,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:1149 +#: ../../library/asyncio-task.rst:1153 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:1154 +#: ../../library/asyncio-task.rst:1158 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:1159 +#: ../../library/asyncio-task.rst:1163 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 " @@ -1565,20 +1565,20 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1164 +#: ../../library/asyncio-task.rst:1168 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:1169 +#: ../../library/asyncio-task.rst:1173 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:1173 +#: ../../library/asyncio-task.rst:1177 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " @@ -1586,7 +1586,7 @@ msgid "" "in the copied context." msgstr "" -#: ../../library/asyncio-task.rst:1178 +#: ../../library/asyncio-task.rst:1182 msgid "" "An optional keyword-only *eager_start* argument allows eagerly starting the " "execution of the :class:`asyncio.Task` at task creation time. If set to " @@ -1596,96 +1596,96 @@ msgid "" "eagerly and will skip scheduling to the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1185 +#: ../../library/asyncio-task.rst:1189 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1191 +#: ../../library/asyncio-task.rst:1195 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1198 +#: ../../library/asyncio-task.rst:1202 msgid "Added the *eager_start* parameter." msgstr "新增 *eager_start* 參數。" -#: ../../library/asyncio-task.rst:1203 +#: ../../library/asyncio-task.rst:1207 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1205 +#: ../../library/asyncio-task.rst:1209 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:1210 +#: ../../library/asyncio-task.rst:1214 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1212 +#: ../../library/asyncio-task.rst:1216 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:1216 ../../library/asyncio-task.rst:1230 +#: ../../library/asyncio-task.rst:1220 ../../library/asyncio-task.rst:1234 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1219 +#: ../../library/asyncio-task.rst:1223 msgid "" "If the Task's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1224 +#: ../../library/asyncio-task.rst:1228 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1226 +#: ../../library/asyncio-task.rst:1230 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:1233 +#: ../../library/asyncio-task.rst:1237 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1238 +#: ../../library/asyncio-task.rst:1242 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1240 ../../library/asyncio-task.rst:1249 +#: ../../library/asyncio-task.rst:1244 ../../library/asyncio-task.rst:1253 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1242 +#: ../../library/asyncio-task.rst:1246 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1247 +#: ../../library/asyncio-task.rst:1251 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1251 +#: ../../library/asyncio-task.rst:1255 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1256 +#: ../../library/asyncio-task.rst:1260 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1258 +#: ../../library/asyncio-task.rst:1262 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, " @@ -1693,15 +1693,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1264 +#: ../../library/asyncio-task.rst:1268 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1266 +#: ../../library/asyncio-task.rst:1270 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1268 +#: ../../library/asyncio-task.rst:1272 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 " @@ -1710,81 +1710,81 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1277 +#: ../../library/asyncio-task.rst:1281 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1279 +#: ../../library/asyncio-task.rst:1283 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1282 +#: ../../library/asyncio-task.rst:1286 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1284 +#: ../../library/asyncio-task.rst:1288 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:1289 +#: ../../library/asyncio-task.rst:1293 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1293 +#: ../../library/asyncio-task.rst:1297 msgid "" "This will return ``None`` for Tasks which have already completed eagerly. " "See the :ref:`Eager Task Factory <eager-task-factory>`." msgstr "" -#: ../../library/asyncio-task.rst:1300 +#: ../../library/asyncio-task.rst:1304 msgid "Newly added eager task execution means result may be ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1304 +#: ../../library/asyncio-task.rst:1308 msgid "" "Return the :class:`contextvars.Context` object associated with the task." msgstr "" -#: ../../library/asyncio-task.rst:1311 +#: ../../library/asyncio-task.rst:1315 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1313 +#: ../../library/asyncio-task.rst:1317 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:1321 +#: ../../library/asyncio-task.rst:1325 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1323 +#: ../../library/asyncio-task.rst:1327 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1326 +#: ../../library/asyncio-task.rst:1330 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:1333 +#: ../../library/asyncio-task.rst:1337 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1335 +#: ../../library/asyncio-task.rst:1339 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:1338 +#: ../../library/asyncio-task.rst:1342 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1796,21 +1796,21 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1348 +#: ../../library/asyncio-task.rst:1352 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1351 +#: ../../library/asyncio-task.rst:1355 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1356 +#: ../../library/asyncio-task.rst:1360 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1359 +#: ../../library/asyncio-task.rst:1363 msgid "" "async def cancel_me():\n" " print('cancel_me(): before sleep')\n" @@ -1847,32 +1847,32 @@ msgid "" "# main(): cancel_me is cancelled now" msgstr "" -#: ../../library/asyncio-task.rst:1395 +#: ../../library/asyncio-task.rst:1399 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1397 +#: ../../library/asyncio-task.rst:1401 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:1403 +#: ../../library/asyncio-task.rst:1407 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1405 +#: ../../library/asyncio-task.rst:1409 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1407 +#: ../../library/asyncio-task.rst:1411 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1412 +#: ../../library/asyncio-task.rst:1416 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 " @@ -1881,7 +1881,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1419 +#: ../../library/asyncio-task.rst:1423 msgid "" "async def make_request_with_timeout():\n" " try:\n" @@ -1895,7 +1895,7 @@ msgid "" " await unrelated_code()" msgstr "" -#: ../../library/asyncio-task.rst:1430 +#: ../../library/asyncio-task.rst:1434 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1904,14 +1904,14 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1436 +#: ../../library/asyncio-task.rst:1440 msgid "" "If end-user code is, for some reason, suppressing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1440 +#: ../../library/asyncio-task.rst:1444 msgid "" "When this method decrements the cancellation count to zero, the method " "checks if a previous :meth:`cancel` call had arranged for :exc:" @@ -1920,17 +1920,17 @@ msgid "" "``_must_cancel`` flag)." msgstr "" -#: ../../library/asyncio-task.rst:1446 +#: ../../library/asyncio-task.rst:1450 msgid "Changed to rescind pending cancellation requests upon reaching zero." msgstr "" -#: ../../library/asyncio-task.rst:1451 +#: ../../library/asyncio-task.rst:1455 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:1455 +#: ../../library/asyncio-task.rst:1459 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 " @@ -1939,7 +1939,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1461 +#: ../../library/asyncio-task.rst:1465 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/collections.abc.po b/library/collections.abc.po index bb2177c5f9..f14978c0e6 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,7 +46,7 @@ msgstr "" #: ../../library/collections.abc.rst:30 msgid "" -"1) A newly written class can inherit directly from one of the abstract base " +"A newly written class can inherit directly from one of the abstract base " "classes. The class must supply the required abstract methods. The " "remaining mixin methods come from inheritance and can be overridden if " "desired. Other methods may be added as needed:" @@ -72,7 +72,7 @@ msgstr "" #: ../../library/collections.abc.rst:50 msgid "" -"2) Existing classes and built-in classes can be registered as \"virtual " +"Existing classes and built-in classes can be registered as \"virtual " "subclasses\" of the ABCs. Those classes should define the full API " "including all of the abstract methods and all of the mixin methods. This " "lets users rely on :func:`issubclass` or :func:`isinstance` tests to " @@ -112,11 +112,11 @@ msgstr "" #: ../../library/collections.abc.rst:82 msgid "" -"3) Some simple interfaces are directly recognizable by the presence of the " +"Some simple interfaces are directly recognizable by the presence of the " "required methods (unless those methods have been set to :const:`None`):" msgstr "" -#: ../../library/collections.abc.rst:86 +#: ../../library/collections.abc.rst:85 msgid "" "class E:\n" " def __iter__(self): ...\n" @@ -126,7 +126,7 @@ msgstr "" " def __iter__(self): ...\n" " def __next__(self): ..." -#: ../../library/collections.abc.rst:92 +#: ../../library/collections.abc.rst:91 msgid "" ">>> issubclass(E, Iterable)\n" "True\n" @@ -138,7 +138,7 @@ msgstr "" ">>> isinstance(E(), Iterable)\n" "True" -#: ../../library/collections.abc.rst:99 +#: ../../library/collections.abc.rst:98 msgid "" "Complex interfaces do not support this last technique because an interface " "is more than just the presence of method names. Interfaces specify " @@ -148,178 +148,178 @@ msgid "" "insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`." msgstr "" -#: ../../library/collections.abc.rst:107 +#: ../../library/collections.abc.rst:106 msgid "" "These abstract classes now support ``[]``. See :ref:`types-genericalias` " "and :pep:`585`." msgstr "" -#: ../../library/collections.abc.rst:114 +#: ../../library/collections.abc.rst:113 msgid "Collections Abstract Base Classes" msgstr "" -#: ../../library/collections.abc.rst:116 +#: ../../library/collections.abc.rst:115 msgid "" "The collections module offers the following :term:`ABCs <abstract base " "class>`:" msgstr "" -#: ../../library/collections.abc.rst:121 +#: ../../library/collections.abc.rst:120 msgid "ABC" msgstr "ABC" -#: ../../library/collections.abc.rst:121 +#: ../../library/collections.abc.rst:120 msgid "Inherits from" msgstr "" -#: ../../library/collections.abc.rst:121 +#: ../../library/collections.abc.rst:120 msgid "Abstract Methods" msgstr "" -#: ../../library/collections.abc.rst:121 +#: ../../library/collections.abc.rst:120 msgid "Mixin Methods" msgstr "" -#: ../../library/collections.abc.rst:123 +#: ../../library/collections.abc.rst:122 msgid ":class:`Container` [1]_" msgstr ":class:`Container` [1]_" -#: ../../library/collections.abc.rst:123 +#: ../../library/collections.abc.rst:122 msgid "``__contains__``" msgstr "``__contains__``" -#: ../../library/collections.abc.rst:124 +#: ../../library/collections.abc.rst:123 msgid ":class:`Hashable` [1]_" msgstr ":class:`Hashable` [1]_" -#: ../../library/collections.abc.rst:124 +#: ../../library/collections.abc.rst:123 msgid "``__hash__``" msgstr "``__hash__``" -#: ../../library/collections.abc.rst:125 +#: ../../library/collections.abc.rst:124 msgid ":class:`Iterable` [1]_ [2]_" msgstr ":class:`Iterable` [1]_ [2]_" -#: ../../library/collections.abc.rst:125 ../../library/collections.abc.rst:126 +#: ../../library/collections.abc.rst:124 ../../library/collections.abc.rst:125 msgid "``__iter__``" msgstr "``__iter__``" -#: ../../library/collections.abc.rst:126 +#: ../../library/collections.abc.rst:125 msgid ":class:`Iterator` [1]_" msgstr ":class:`Iterator` [1]_" -#: ../../library/collections.abc.rst:126 ../../library/collections.abc.rst:127 +#: ../../library/collections.abc.rst:125 ../../library/collections.abc.rst:126 msgid ":class:`Iterable`" msgstr ":class:`Iterable`" -#: ../../library/collections.abc.rst:126 +#: ../../library/collections.abc.rst:125 msgid "``__next__``" msgstr "``__next__``" -#: ../../library/collections.abc.rst:127 +#: ../../library/collections.abc.rst:126 msgid ":class:`Reversible` [1]_" msgstr ":class:`Reversible` [1]_" -#: ../../library/collections.abc.rst:127 +#: ../../library/collections.abc.rst:126 msgid "``__reversed__``" msgstr "``__reversed__``" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:127 msgid ":class:`Generator` [1]_" msgstr ":class:`Generator` [1]_" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:127 msgid ":class:`Iterator`" msgstr ":class:`Iterator`" -#: ../../library/collections.abc.rst:128 ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:127 ../../library/collections.abc.rst:176 msgid "``send``, ``throw``" msgstr "``send``、``throw``" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:127 msgid "``close``, ``__iter__``, ``__next__``" msgstr "``close``、``__iter__``、``__next__``" -#: ../../library/collections.abc.rst:129 +#: ../../library/collections.abc.rst:128 msgid ":class:`Sized` [1]_" msgstr ":class:`Sized` [1]_" -#: ../../library/collections.abc.rst:129 +#: ../../library/collections.abc.rst:128 msgid "``__len__``" msgstr "``__len__``" -#: ../../library/collections.abc.rst:130 +#: ../../library/collections.abc.rst:129 msgid ":class:`Callable` [1]_" msgstr ":class:`Callable` [1]_" -#: ../../library/collections.abc.rst:130 +#: ../../library/collections.abc.rst:129 msgid "``__call__``" msgstr "``__call__``" -#: ../../library/collections.abc.rst:131 +#: ../../library/collections.abc.rst:130 msgid ":class:`Collection` [1]_" msgstr ":class:`Collection` [1]_" -#: ../../library/collections.abc.rst:131 +#: ../../library/collections.abc.rst:130 msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgstr ":class:`Sized`、:class:`Iterable`、:class:`Container`" -#: ../../library/collections.abc.rst:131 ../../library/collections.abc.rst:147 +#: ../../library/collections.abc.rst:130 ../../library/collections.abc.rst:146 msgid "``__contains__``, ``__iter__``, ``__len__``" msgstr "``__contains__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:135 ../../library/collections.abc.rst:138 -#: ../../library/collections.abc.rst:144 +#: ../../library/collections.abc.rst:134 ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:143 msgid ":class:`Sequence`" msgstr ":class:`Sequence`" -#: ../../library/collections.abc.rst:135 +#: ../../library/collections.abc.rst:134 msgid ":class:`Reversible`, :class:`Collection`" msgstr ":class:`Reversible`, :class:`Collection`" -#: ../../library/collections.abc.rst:135 ../../library/collections.abc.rst:144 +#: ../../library/collections.abc.rst:134 ../../library/collections.abc.rst:143 msgid "``__getitem__``, ``__len__``" msgstr "``__getitem__``、``__len__``" -#: ../../library/collections.abc.rst:135 +#: ../../library/collections.abc.rst:134 msgid "" "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" msgstr "" "``__contains__``、``__iter__``、``__reversed__``、``index`` 和 ``count``" -#: ../../library/collections.abc.rst:138 +#: ../../library/collections.abc.rst:137 msgid ":class:`MutableSequence`" msgstr ":class:`MutableSequence`" -#: ../../library/collections.abc.rst:138 +#: ../../library/collections.abc.rst:137 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" msgstr "" "``__getitem__``、``__setitem__``、``__delitem__``、``__len__``、``insert``" -#: ../../library/collections.abc.rst:138 +#: ../../library/collections.abc.rst:137 msgid "" "Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, " "``extend``, ``pop``, ``remove``, and ``__iadd__``" msgstr "" -#: ../../library/collections.abc.rst:144 +#: ../../library/collections.abc.rst:143 msgid ":class:`ByteString`" msgstr ":class:`ByteString`" -#: ../../library/collections.abc.rst:144 +#: ../../library/collections.abc.rst:143 msgid "Inherited :class:`Sequence` methods" msgstr "" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:152 +#: ../../library/collections.abc.rst:146 ../../library/collections.abc.rst:151 msgid ":class:`Set`" msgstr ":class:`Set`" -#: ../../library/collections.abc.rst:147 ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:146 ../../library/collections.abc.rst:157 msgid ":class:`Collection`" msgstr ":class:`Collection`" -#: ../../library/collections.abc.rst:147 +#: ../../library/collections.abc.rst:146 #, fuzzy msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " @@ -329,29 +329,29 @@ msgstr "" "``__le__``、``__lt__``、``__eq__``、``__ne__``、``__gt__``、``__ge__``、" "``__and__``、``__or__``、``__sub__``、``__xor__`` 與 ``isdisjoint``" -#: ../../library/collections.abc.rst:152 +#: ../../library/collections.abc.rst:151 msgid ":class:`MutableSet`" msgstr ":class:`MutableSet`" -#: ../../library/collections.abc.rst:152 +#: ../../library/collections.abc.rst:151 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "``__contains__``、``__iter__``、``__len__``、``add``、``discard``" -#: ../../library/collections.abc.rst:152 +#: ../../library/collections.abc.rst:151 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:158 ../../library/collections.abc.rst:162 +#: ../../library/collections.abc.rst:157 ../../library/collections.abc.rst:161 msgid ":class:`Mapping`" msgstr ":class:`Mapping`" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:157 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "``__getitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:157 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" @@ -359,129 +359,129 @@ msgstr "" "``__contains__``、``keys``、``items``、``values``、``get``、``__eq__`` 和 " "``__ne__``" -#: ../../library/collections.abc.rst:162 +#: ../../library/collections.abc.rst:161 msgid ":class:`MutableMapping`" msgstr ":class:`MutableMapping`" -#: ../../library/collections.abc.rst:162 +#: ../../library/collections.abc.rst:161 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" "``__getitem__``、``__setitem__``、``__delitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:162 +#: ../../library/collections.abc.rst:161 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:168 msgid ":class:`MappingView`" msgstr ":class:`MappingView`" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:168 msgid ":class:`Sized`" msgstr ":class:`Sized`" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:168 #, fuzzy msgid "``__init__``, ``__len__`` and ``__repr__``" msgstr "``__getitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:169 msgid ":class:`ItemsView`" msgstr ":class:`ItemsView`" -#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 msgid ":class:`MappingView`, :class:`Set`" msgstr ":class:`MappingView`、:class:`Set`" -#: ../../library/collections.abc.rst:170 ../../library/collections.abc.rst:172 -#: ../../library/collections.abc.rst:174 +#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:173 msgid "``__contains__``, ``__iter__``" msgstr "``__contains__``、``__iter__``" -#: ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:171 msgid ":class:`KeysView`" msgstr ":class:`KeysView`" -#: ../../library/collections.abc.rst:174 +#: ../../library/collections.abc.rst:173 msgid ":class:`ValuesView`" msgstr ":class:`ValuesView`" -#: ../../library/collections.abc.rst:174 +#: ../../library/collections.abc.rst:173 msgid ":class:`MappingView`, :class:`Collection`" msgstr ":class:`MappingView`、:class:`Collection`" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:175 msgid ":class:`Awaitable` [1]_" msgstr ":class:`Awaitable` [1]_" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:175 msgid "``__await__``" msgstr "``__await__``" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:176 msgid ":class:`Coroutine` [1]_" msgstr ":class:`Coroutine` [1]_" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:176 msgid ":class:`Awaitable`" msgstr ":class:`Awaitable`" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:176 msgid "``close``" msgstr "``close``" -#: ../../library/collections.abc.rst:178 +#: ../../library/collections.abc.rst:177 msgid ":class:`AsyncIterable` [1]_" msgstr ":class:`AsyncIterable` [1]_" -#: ../../library/collections.abc.rst:178 ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:177 ../../library/collections.abc.rst:178 msgid "``__aiter__``" msgstr "``__aiter__``" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterator` [1]_" msgstr ":class:`AsyncIterator` [1]_" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterable`" msgstr ":class:`AsyncIterable`" -#: ../../library/collections.abc.rst:179 +#: ../../library/collections.abc.rst:178 msgid "``__anext__``" msgstr "``__anext__``" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncGenerator` [1]_" msgstr ":class:`AsyncGenerator` [1]_" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterator`" msgstr ":class:`AsyncIterator`" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:179 msgid "``asend``, ``athrow``" msgstr "``asend``、``athrow``" -#: ../../library/collections.abc.rst:180 +#: ../../library/collections.abc.rst:179 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``、``__aiter__``、``__anext__``" -#: ../../library/collections.abc.rst:181 +#: ../../library/collections.abc.rst:180 msgid ":class:`Buffer` [1]_" msgstr ":class:`Buffer` [1]_" -#: ../../library/collections.abc.rst:181 +#: ../../library/collections.abc.rst:180 msgid "``__buffer__``" msgstr "``__buffer__``" -#: ../../library/collections.abc.rst:186 +#: ../../library/collections.abc.rst:185 msgid "Footnotes" msgstr "註解" -#: ../../library/collections.abc.rst:187 +#: ../../library/collections.abc.rst:186 msgid "" "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " "an interface by verifying the required methods are present and have not been " @@ -489,7 +489,7 @@ msgid "" "interfaces require registration or direct subclassing." msgstr "" -#: ../../library/collections.abc.rst:193 +#: ../../library/collections.abc.rst:192 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " @@ -498,37 +498,37 @@ msgid "" "`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:201 +#: ../../library/collections.abc.rst:200 msgid "Collections Abstract Base Classes -- Detailed Descriptions" msgstr "" -#: ../../library/collections.abc.rst:206 +#: ../../library/collections.abc.rst:205 msgid "ABC for classes that provide the :meth:`~object.__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:210 +#: ../../library/collections.abc.rst:209 msgid "ABC for classes that provide the :meth:`~object.__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:214 +#: ../../library/collections.abc.rst:213 msgid "ABC for classes that provide the :meth:`~object.__len__` method." msgstr "" -#: ../../library/collections.abc.rst:218 +#: ../../library/collections.abc.rst:217 msgid "ABC for classes that provide the :meth:`~object.__call__` method." msgstr "" -#: ../../library/collections.abc.rst:220 +#: ../../library/collections.abc.rst:219 msgid "" "See :ref:`annotating-callables` for details on how to use :class:`!Callable` " "in type annotations." msgstr "" -#: ../../library/collections.abc.rst:225 +#: ../../library/collections.abc.rst:224 msgid "ABC for classes that provide the :meth:`~container.__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:227 +#: ../../library/collections.abc.rst:226 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " @@ -537,23 +537,23 @@ msgid "" "`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:236 +#: ../../library/collections.abc.rst:235 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:242 +#: ../../library/collections.abc.rst:241 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:248 +#: ../../library/collections.abc.rst:247 msgid "" "ABC for iterable classes that also provide the :meth:`~object.__reversed__` " "method." msgstr "" -#: ../../library/collections.abc.rst:255 +#: ../../library/collections.abc.rst:254 msgid "" "ABC for :term:`generator` classes that implement the protocol defined in :" "pep:`342` that extends :term:`iterators <iterator>` with the :meth:" @@ -561,17 +561,17 @@ msgid "" "methods." msgstr "" -#: ../../library/collections.abc.rst:260 +#: ../../library/collections.abc.rst:259 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Generator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:269 +#: ../../library/collections.abc.rst:268 msgid "ABCs for read-only and mutable :term:`sequences <sequence>`." msgstr "" -#: ../../library/collections.abc.rst:271 +#: ../../library/collections.abc.rst:270 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`~container." "__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make repeated " @@ -582,44 +582,44 @@ msgid "" "quadratic performance and will likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:280 +#: ../../library/collections.abc.rst:279 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:284 +#: ../../library/collections.abc.rst:283 msgid "" "The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " "use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`." msgstr "" -#: ../../library/collections.abc.rst:293 +#: ../../library/collections.abc.rst:292 msgid "ABCs for read-only and mutable :ref:`sets <types-set>`." msgstr "" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:297 msgid "ABCs for read-only and mutable :term:`mappings <mapping>`." msgstr "" -#: ../../library/collections.abc.rst:305 +#: ../../library/collections.abc.rst:304 msgid "" "ABCs for mapping, items, keys, and values :term:`views <dictionary view>`." msgstr "" -#: ../../library/collections.abc.rst:309 +#: ../../library/collections.abc.rst:308 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`~object." "__await__` method." msgstr "" -#: ../../library/collections.abc.rst:313 +#: ../../library/collections.abc.rst:312 msgid "" ":term:`Coroutine <coroutine>` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:317 +#: ../../library/collections.abc.rst:316 msgid "" "In CPython, generator-based coroutines (:term:`generators <generator>` " "decorated with :func:`@types.coroutine <types.coroutine>`) are *awaitables*, " @@ -628,7 +628,7 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:327 +#: ../../library/collections.abc.rst:326 msgid "" "ABC for :term:`coroutine` compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -637,7 +637,7 @@ msgid "" "instances are also instances of :class:`Awaitable`." msgstr "" -#: ../../library/collections.abc.rst:335 +#: ../../library/collections.abc.rst:334 msgid "" "In CPython, generator-based coroutines (:term:`generators <generator>` " "decorated with :func:`@types.coroutine <types.coroutine>`) are *awaitables*, " @@ -646,54 +646,54 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:341 +#: ../../library/collections.abc.rst:340 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Coroutine` in type annotations. The variance and order of type parameters " "correspond to those of :class:`Generator`." msgstr "" -#: ../../library/collections.abc.rst:350 +#: ../../library/collections.abc.rst:349 msgid "" "ABC for classes that provide an ``__aiter__`` method. See also the " "definition of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:357 +#: ../../library/collections.abc.rst:356 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:364 +#: ../../library/collections.abc.rst:363 msgid "" "ABC for :term:`asynchronous generator` classes that implement the protocol " "defined in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:367 +#: ../../library/collections.abc.rst:366 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!AsyncGenerator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:374 +#: ../../library/collections.abc.rst:373 msgid "" "ABC for classes that provide the :meth:`~object.__buffer__` method, " "implementing the :ref:`buffer protocol <bufferobjects>`. See :pep:`688`." msgstr "" -#: ../../library/collections.abc.rst:380 +#: ../../library/collections.abc.rst:379 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:382 +#: ../../library/collections.abc.rst:381 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:385 +#: ../../library/collections.abc.rst:384 msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" @@ -703,7 +703,7 @@ msgstr "" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" -#: ../../library/collections.abc.rst:389 +#: ../../library/collections.abc.rst:388 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -713,7 +713,7 @@ msgid "" "methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:396 +#: ../../library/collections.abc.rst:395 msgid "" "class ListBasedSet(collections.abc.Set):\n" " ''' Alternate set implementation favoring space over speed\n" @@ -739,11 +739,11 @@ msgid "" "automatically" msgstr "" -#: ../../library/collections.abc.rst:418 +#: ../../library/collections.abc.rst:417 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:421 +#: ../../library/collections.abc.rst:420 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an :term:`iterable`. The class constructor " @@ -756,14 +756,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:432 +#: ../../library/collections.abc.rst:431 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " "other operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:438 +#: ../../library/collections.abc.rst:437 msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " @@ -772,12 +772,12 @@ msgid "" "define ``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:446 +#: ../../library/collections.abc.rst:445 msgid "" "`OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:449 +#: ../../library/collections.abc.rst:448 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`。" diff --git a/library/collections.po b/library/collections.po index 022f638608..98b4c56ffb 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-01-22 21:42+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1184,10 +1184,11 @@ msgstr "" "`~object.__getitem__` 所傳遞。" #: ../../library/collections.rst:750 +#, fuzzy msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" -"meth:`~object.__getitem__`. This means that :meth:`get` will, like normal " -"dictionaries, return ``None`` as a default rather than using :attr:" +"meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like " +"normal dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" "注意,:meth:`__missing__` *不會*\\ 被 :meth:`~object.__getitem__` 以外的其他" @@ -1207,7 +1208,7 @@ msgstr "" "此屬性為 :meth:`__missing__` 方法所使用。如果有引數被傳入建構函式,則此屬性會" "被初始化成第一個引數,如未提供引數則被初始化為 ``None``。" -#: ../../library/collections.rst:765 ../../library/collections.rst:1191 +#: ../../library/collections.rst:765 ../../library/collections.rst:1192 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "新增合併 (``|``) 和更新 (``|=``) 運算子,請見 :pep:`584`。" @@ -1297,12 +1298,14 @@ msgstr "" "來存取欄位的能力。" #: ../../library/collections.rst:849 +#, fuzzy msgid "" "Returns a new tuple subclass named *typename*. The new subclass is used to " "create tuple-like objects that have fields accessible by attribute lookup as " "well as being indexable and iterable. Instances of the subclass also have a " -"helpful docstring (with typename and field_names) and a helpful :meth:" -"`__repr__` method which lists the tuple contents in a ``name=value`` format." +"helpful docstring (with *typename* and *field_names*) and a helpful :meth:" +"`~object.__repr__` method which lists the tuple contents in a ``name=value`` " +"format." msgstr "" "回傳一個名為 *typename* 的新 tuple 子類別。這個新的子類別被用於建立類似 " "tuple 的物件,可以透過屬性名稱來存取欄位,它同時也是可索引 (indexable) 和可疊" @@ -1310,7 +1313,7 @@ msgstr "" "位名 field_names)和一個好用的 :meth:`__repr__` 方法,可將 tuple 內容以 " "``name=value`` 格式列出。" -#: ../../library/collections.rst:855 +#: ../../library/collections.rst:856 msgid "" "The *field_names* are a sequence of strings such as ``['x', 'y']``. " "Alternatively, *field_names* can be a single string with each fieldname " @@ -1319,7 +1322,7 @@ msgstr "" "*field_names* 是一個像 ``['x', 'y']`` 一樣的字串序列。*field_names* 也可以是" "一個用空白或逗號分隔各個欄位名稱的字串,比如 ``'x y'`` 或者 ``'x, y'``。" -#: ../../library/collections.rst:859 +#: ../../library/collections.rst:860 msgid "" "Any valid Python identifier may be used for a fieldname except for names " "starting with an underscore. Valid identifiers consist of letters, digits, " @@ -1331,7 +1334,7 @@ msgstr "" "詞 :mod:`keyword`,例如 *class*、*for*、*return*、*global*、*pass* 或 " "*raise*。" -#: ../../library/collections.rst:865 +#: ../../library/collections.rst:866 msgid "" "If *rename* is true, invalid fieldnames are automatically replaced with " "positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " @@ -1342,7 +1345,7 @@ msgstr "" "'def', 'ghi', 'abc']`` 會被轉換成 ``['abc', '_1', 'ghi', '_3']``,移除了關鍵" "字 ``def`` 和重複欄位名 ``abc``。" -#: ../../library/collections.rst:870 +#: ../../library/collections.rst:871 msgid "" "*defaults* can be ``None`` or an :term:`iterable` of default values. Since " "fields with a default value must come after any fields without a default, " @@ -1356,7 +1359,7 @@ msgstr "" "如 fieldnames 為 ``['x', 'y', 'z']`` 且 defaults 為 ``(1, 2)``,那麼 ``x`` 就" "必須被給定一個引數,``y`` 被預設為 ``1``,``z`` 則被預設為 ``2``。" -#: ../../library/collections.rst:877 +#: ../../library/collections.rst:878 #, fuzzy msgid "" "If *module* is defined, the :attr:`~type.__module__` attribute of the named " @@ -1364,7 +1367,7 @@ msgid "" msgstr "" "如果 *module* 值有被定義,named tuple 的 ``__module__`` 屬性就被設定為該值。" -#: ../../library/collections.rst:880 +#: ../../library/collections.rst:881 msgid "" "Named tuple instances do not have per-instance dictionaries, so they are " "lightweight and require no more memory than regular tuples." @@ -1372,17 +1375,17 @@ msgstr "" "Named tuple 實例中沒有字典,所以它們更加輕量,且和一般 tuple 相比佔用更少記憶" "體。" -#: ../../library/collections.rst:883 +#: ../../library/collections.rst:884 msgid "" "To support pickling, the named tuple class should be assigned to a variable " "that matches *typename*." msgstr "要支援 pickle,應將 named tuple 類別賦值給一個符合 *typename* 的變數。" -#: ../../library/collections.rst:886 +#: ../../library/collections.rst:887 msgid "Added support for *rename*." msgstr "新增對於 *rename* 的支援。" -#: ../../library/collections.rst:889 +#: ../../library/collections.rst:890 msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "<keyword-only_parameter>`." @@ -1390,20 +1393,23 @@ msgstr "" "*verbose* 和 *rename* 參數成為\\ :ref:`僅限關鍵字引數 <keyword-" "only_parameter>`。" -#: ../../library/collections.rst:893 +#: ../../library/collections.rst:894 msgid "Added the *module* parameter." msgstr "新增 *module* 參數。" -#: ../../library/collections.rst:896 -msgid "Removed the *verbose* parameter and the :attr:`_source` attribute." +#: ../../library/collections.rst:897 +#, fuzzy +msgid "Removed the *verbose* parameter and the :attr:`!_source` attribute." msgstr "移除 *verbose* 參數和 :attr:`_source` 屬性。" -#: ../../library/collections.rst:899 +#: ../../library/collections.rst:900 +#, fuzzy msgid "" -"Added the *defaults* parameter and the :attr:`_field_defaults` attribute." +"Added the *defaults* parameter and the :attr:`~somenamedtuple." +"_field_defaults` attribute." msgstr "新增 *defaults* 參數和 :attr:`_field_defaults` 屬性。" -#: ../../library/collections.rst:903 +#: ../../library/collections.rst:904 msgid "" ">>> # Basic example\n" ">>> Point = namedtuple('Point', ['x', 'y'])\n" @@ -1420,7 +1426,7 @@ msgid "" "Point(x=11, y=22)" msgstr "" -#: ../../library/collections.rst:919 +#: ../../library/collections.rst:920 msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" @@ -1428,7 +1434,7 @@ msgstr "" "Named tuple 在賦予欄位名稱於 :mod:`csv` 或 :mod:`sqlite3` 模組回傳之 tuple 時" "相當有用: ::" -#: ../../library/collections.rst:922 +#: ../../library/collections.rst:923 msgid "" "EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, " "paygrade')\n" @@ -1462,7 +1468,7 @@ msgstr "" "for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" " print(emp.name, emp.title)" -#: ../../library/collections.rst:935 +#: ../../library/collections.rst:936 msgid "" "In addition to the methods inherited from tuples, named tuples support three " "additional methods and two attributes. To prevent conflicts with field " @@ -1471,12 +1477,12 @@ msgstr "" "除了繼承自 tuple 的方法,named tuple 還支援三個額外的方法和兩個屬性。為了防止" "欄位名稱有衝突,方法和屬性的名稱以底線開頭。" -#: ../../library/collections.rst:941 +#: ../../library/collections.rst:942 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "從已存在的序列或可疊代物件建立一個新實例的類別方法。" -#: ../../library/collections.rst:943 +#: ../../library/collections.rst:944 msgid "" ">>> t = [11, 22]\n" ">>> Point._make(t)\n" @@ -1486,13 +1492,13 @@ msgstr "" ">>> Point._make(t)\n" "Point(x=11, y=22)" -#: ../../library/collections.rst:951 +#: ../../library/collections.rst:952 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " "values:" msgstr "回傳一個將欄位名稱對映至對應值的 :class:`dict`:" -#: ../../library/collections.rst:954 +#: ../../library/collections.rst:955 msgid "" ">>> p = Point(x=11, y=22)\n" ">>> p._asdict()\n" @@ -1502,11 +1508,11 @@ msgstr "" ">>> p._asdict()\n" "{'x': 11, 'y': 22}" -#: ../../library/collections.rst:960 +#: ../../library/collections.rst:961 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "回傳一個 :class:`OrderedDict` 而非 :class:`dict`。" -#: ../../library/collections.rst:963 +#: ../../library/collections.rst:964 msgid "" "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " "Python 3.7, regular dicts are guaranteed to be ordered. If the extra " @@ -1517,13 +1523,13 @@ msgstr "" "dict 已經保證有順序性,如果需要 :class:`OrderedDict` 所專屬的特性,推薦的解法" "是將結果專換成所需的類型:``OrderedDict(nt._asdict())``。" -#: ../../library/collections.rst:972 +#: ../../library/collections.rst:973 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" msgstr "回傳一個新的 named tuple 實例,並將指定欄位替換為新的值: ::" -#: ../../library/collections.rst:975 +#: ../../library/collections.rst:976 msgid "" ">>> p = Point(x=11, y=22)\n" ">>> p._replace(x=33)\n" @@ -1541,18 +1547,18 @@ msgstr "" "... inventory[partnum] = record._replace(price=newprices[partnum], " "timestamp=time.now())" -#: ../../library/collections.rst:982 +#: ../../library/collections.rst:983 msgid "" "Named tuples are also supported by generic function :func:`copy.replace`." msgstr "" -#: ../../library/collections.rst:984 +#: ../../library/collections.rst:985 msgid "" "Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword " "arguments." msgstr "" -#: ../../library/collections.rst:990 +#: ../../library/collections.rst:991 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." @@ -1560,7 +1566,7 @@ msgstr "" "列出 tuple 欄位名稱的字串,用於自我檢查或是從現有 named tuple 建立一個新的 " "named tuple 型別。" -#: ../../library/collections.rst:993 +#: ../../library/collections.rst:994 msgid "" ">>> p._fields # view the field names\n" "('x', 'y')\n" @@ -1571,11 +1577,11 @@ msgid "" "Pixel(x=11, y=22, red=128, green=255, blue=0)" msgstr "" -#: ../../library/collections.rst:1005 +#: ../../library/collections.rst:1006 msgid "Dictionary mapping field names to default values." msgstr "將欄位名稱對映至預設值的字典。" -#: ../../library/collections.rst:1007 +#: ../../library/collections.rst:1008 msgid "" ">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" ">>> Account._field_defaults\n" @@ -1589,13 +1595,13 @@ msgstr "" ">>> Account('premium')\n" "Account(type='premium', balance=0)" -#: ../../library/collections.rst:1015 +#: ../../library/collections.rst:1016 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "要取得這個名稱存於字串的欄位,要使用 :func:`getattr` 函式:" -#: ../../library/collections.rst:1021 +#: ../../library/collections.rst:1022 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" @@ -1603,7 +1609,7 @@ msgstr "" "(如\\ :ref:`tut-unpacking-arguments`\\ 所述)將一個字典轉換成 named tuple," "要使用 \\*\\* 雙星號運算子:" -#: ../../library/collections.rst:1028 +#: ../../library/collections.rst:1029 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " @@ -1612,7 +1618,7 @@ msgstr "" "因為一個 named tuple 是一個常規的 Python 類別,我們可以很容易的透過子類別來新" "增或更改功能,以下是如何新增一個計算得到的欄位和固定寬度的輸出列印格式:" -#: ../../library/collections.rst:1032 +#: ../../library/collections.rst:1033 msgid "" ">>> class Point(namedtuple('Point', ['x', 'y'])):\n" "... __slots__ = ()\n" @@ -1642,7 +1648,7 @@ msgstr "" "Point: x= 3.000 y= 4.000 hypot= 5.000\n" "Point: x=14.000 y= 0.714 hypot=14.018" -#: ../../library/collections.rst:1047 +#: ../../library/collections.rst:1048 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " @@ -1651,7 +1657,7 @@ msgstr "" "上面的子類別將 ``__slots__`` 設定為空 tuple,這樣一來就防止了字典實例被建立," "因而保持了較低的記憶體用量。" -#: ../../library/collections.rst:1050 +#: ../../library/collections.rst:1051 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " @@ -1660,17 +1666,17 @@ msgstr "" "子類別化無法用於增加新的、已被儲存的欄位,應當透過 :attr:`~somenamedtuple." "_fields` 屬性以建立一個新的 named tuple 來實現:" -#: ../../library/collections.rst:1055 +#: ../../library/collections.rst:1056 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "透過直接賦值給 ``__doc__``,可以自訂說明文件字串:" -#: ../../library/collections.rst:1064 +#: ../../library/collections.rst:1065 msgid "Property docstrings became writeable." msgstr "文件字串屬性變成可寫入。" -#: ../../library/collections.rst:1069 +#: ../../library/collections.rst:1070 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " @@ -1679,7 +1685,7 @@ msgstr "" "關於為 named tuple 新增型別提示的方法,請參閱 :class:`typing.NamedTuple`,它" "運用 :keyword:`class` 關鍵字以提供了一個簡潔的表示法: ::" -#: ../../library/collections.rst:1073 +#: ../../library/collections.rst:1074 msgid "" "class Component(NamedTuple):\n" " part_number: int\n" @@ -1691,7 +1697,7 @@ msgstr "" " weight: float\n" " description: Optional[str] = None" -#: ../../library/collections.rst:1078 +#: ../../library/collections.rst:1079 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." @@ -1699,7 +1705,7 @@ msgstr "" "關於以 dict 而非 tuple 為底層的可變命名空間,請參考 :meth:`types." "SimpleNamespace`。" -#: ../../library/collections.rst:1081 +#: ../../library/collections.rst:1082 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." @@ -1707,11 +1713,11 @@ msgstr "" ":mod:`dataclasses` 模組提供了一個裝飾器和一些函式,用於自動將被生成的特殊方法" "新增到使用者定義的類別中。" -#: ../../library/collections.rst:1086 +#: ../../library/collections.rst:1087 msgid ":class:`OrderedDict` objects" msgstr ":class:`OrderedDict` 物件" -#: ../../library/collections.rst:1088 +#: ../../library/collections.rst:1089 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " @@ -1722,11 +1728,11 @@ msgstr "" "功能,但由於內建的 :class:`dict` 類別現在已經有記憶插入順序的能力(Python " "3.7 中確保了這種新行為),它們變得不那麼重要了。" -#: ../../library/collections.rst:1094 +#: ../../library/collections.rst:1095 msgid "Some differences from :class:`dict` still remain:" msgstr "仍存在一些與 :class:`dict` 的不同之處:" -#: ../../library/collections.rst:1096 +#: ../../library/collections.rst:1097 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." @@ -1734,7 +1740,7 @@ msgstr "" "常規的 :class:`dict` 被設計成非常擅長於對映相關操作,追蹤插入的順序為次要目" "標。" -#: ../../library/collections.rst:1099 +#: ../../library/collections.rst:1100 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " @@ -1743,7 +1749,7 @@ msgstr "" ":class:`OrderedDict` 則被設計成擅長於重新排序相關的操作,空間效率、疊代速度和" "更新操作的效能則為次要設計目標。" -#: ../../library/collections.rst:1103 +#: ../../library/collections.rst:1104 msgid "" "The :class:`OrderedDict` algorithm can handle frequent reordering operations " "better than :class:`dict`. As shown in the recipes below, this makes it " @@ -1752,12 +1758,12 @@ msgstr "" ":class:`OrderedDict` 比起 :class:`dict` 更適合處理頻繁的重新排序操作,如在下" "方用法中所示,這讓它適合用於多種 LRU cache 的實作中。" -#: ../../library/collections.rst:1107 +#: ../../library/collections.rst:1108 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr ":class:`OrderedDict` 之相等性運算會檢查順序是否相同。" -#: ../../library/collections.rst:1109 +#: ../../library/collections.rst:1110 msgid "" "A regular :class:`dict` can emulate the order sensitive equality test with " "``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." @@ -1765,15 +1771,17 @@ msgstr "" "一個一般的 :class:`dict` 可以用 ``p == q and all(k1 == k2 for k1, k2 in " "zip(p, q))`` 來效仿有檢查順序的相等性運算。" -#: ../../library/collections.rst:1112 +#: ../../library/collections.rst:1113 +#, fuzzy msgid "" -"The :meth:`popitem` method of :class:`OrderedDict` has a different " -"signature. It accepts an optional argument to specify which item is popped." +"The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a " +"different signature. It accepts an optional argument to specify which item " +"is popped." msgstr "" ":class:`OrderedDict` 類別的 :meth:`popitem` 方法有不同的函式簽名 " "(signature),它接受傳入一個選擇性引數來指定要移除哪個元素。" -#: ../../library/collections.rst:1115 +#: ../../library/collections.rst:1116 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " "with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." @@ -1781,7 +1789,7 @@ msgstr "" "一個一般的 :class:`dict` 可以用 ``d.popitem()`` 來效仿 OrderedDict 的 ``od." "popitem(last=True)``,這保證會移除最右邊(最後一個)的元素。" -#: ../../library/collections.rst:1118 +#: ../../library/collections.rst:1119 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " "with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " @@ -1791,15 +1799,16 @@ msgstr "" "OrderedDict 的 ``od.popitem(last=False)``,若最左邊(第一個)的元素存在,則將" "其回傳並移除。" -#: ../../library/collections.rst:1122 +#: ../../library/collections.rst:1123 +#, fuzzy msgid "" -":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " -"reposition an element to an endpoint." +":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " +"efficiently reposition an element to an endpoint." msgstr "" ":class:`OrderedDict` 有個 :meth:`move_to_end` 方法可有效率地將一個元素重新排" "列到任一端。" -#: ../../library/collections.rst:1125 +#: ../../library/collections.rst:1126 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " "last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " @@ -1809,7 +1818,7 @@ msgstr "" "``od.move_to_end(k, last=True)``,這會將該鍵與其對應到的值移動至最右(最後" "面)的位置。" -#: ../../library/collections.rst:1129 +#: ../../library/collections.rst:1130 msgid "" "A regular :class:`dict` does not have an efficient equivalent for " "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " @@ -1819,18 +1828,20 @@ msgstr "" "last=False)`` 等價的有效方式,這是將鍵與其對應到的值移動至最左(最前面)位置" "的方法。" -#: ../../library/collections.rst:1133 -msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." +#: ../../library/collections.rst:1134 +#, fuzzy +msgid "" +"Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." msgstr "在 Python 3.8 之前,:class:`dict` 並沒有 :meth:`__reversed__` 方法。" -#: ../../library/collections.rst:1138 +#: ../../library/collections.rst:1139 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" "回傳一個 :class:`dict` 子類別的實例,它具有專門用於重新排列字典順序的方法。" -#: ../../library/collections.rst:1145 +#: ../../library/collections.rst:1146 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" @@ -1842,7 +1853,7 @@ msgstr "" "回傳鍵值對,否則就按 :abbr:`FIFO (first-in, first-out)` 先進先出的順序回傳鍵" "值對。" -#: ../../library/collections.rst:1152 +#: ../../library/collections.rst:1153 msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " @@ -1852,7 +1863,7 @@ msgstr "" "設值)則將元素移至右端;如果 *last* 為假值則將元素移至左端。如果 *key* 不存在" "則會引發 :exc:`KeyError`:" -#: ../../library/collections.rst:1157 +#: ../../library/collections.rst:1158 msgid "" ">>> d = OrderedDict.fromkeys('abcde')\n" ">>> d.move_to_end('b')\n" @@ -1870,7 +1881,7 @@ msgstr "" ">>> ''.join(d)\n" "'bacde'" -#: ../../library/collections.rst:1169 +#: ../../library/collections.rst:1170 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." @@ -1878,13 +1889,13 @@ msgstr "" "除了普通的對映方法,ordered dictionary 還支援了透過 :func:`reversed` 來做倒序" "疊代。" -#: ../../library/collections.rst:1174 +#: ../../library/collections.rst:1175 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are roughly equivalent to ``list(od1.items())==list(od2.items())``." msgstr "" -#: ../../library/collections.rst:1177 +#: ../../library/collections.rst:1178 #, fuzzy msgid "" "Equality tests between :class:`OrderedDict` objects and other :class:" @@ -1897,7 +1908,7 @@ msgstr "" "其他 :class:`~collections.abc.Mapping` 物件間的相等性運算則像普通字典一樣不考" "慮順序性,這使得 :class:`OrderedDict` 可於任何字典可使用的時機中被替換掉。" -#: ../../library/collections.rst:1182 +#: ../../library/collections.rst:1183 msgid "" "The items, keys, and values :term:`views <dictionary view>` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." @@ -1905,19 +1916,21 @@ msgstr "" ":class:`OrderedDict` 的項 (item)、鍵與值之\\ :term:`視圖 <dictionary " "view>`\\ 現在可透過 :func:`reversed` 來倒序疊代。" -#: ../../library/collections.rst:1186 +#: ../../library/collections.rst:1187 +#, fuzzy msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " -"passed to the :class:`OrderedDict` constructor and its :meth:`update` method." +"passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` " +"method." msgstr "" "隨著 :pep:`468` 被核可,被傳入給 :class:`OrderedDict` 建構函式與其 :meth:" "`update` 方法的關鍵字引數之順序被保留了下來。" -#: ../../library/collections.rst:1196 +#: ../../library/collections.rst:1197 msgid ":class:`OrderedDict` Examples and Recipes" msgstr ":class:`OrderedDict` 範例與用法" -#: ../../library/collections.rst:1198 +#: ../../library/collections.rst:1199 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1927,7 +1940,7 @@ msgstr "" "建立一個能夠記住鍵\\ *最後*\\ 插入順序的 ordered dictionary 變體很簡單。如果" "新條目覆蓋了現有條目,則原本插入位置會被更改並移動至末端: ::" -#: ../../library/collections.rst:1203 +#: ../../library/collections.rst:1204 msgid "" "class LastUpdatedOrderedDict(OrderedDict):\n" " 'Store items in the order the keys were last added'\n" @@ -1937,7 +1950,7 @@ msgid "" " self.move_to_end(key)" msgstr "" -#: ../../library/collections.rst:1210 +#: ../../library/collections.rst:1211 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" @@ -1945,7 +1958,7 @@ msgstr "" ":class:`OrderedDict` 在實現一個 :func:`functools.lru_cache` 的變形版本時也非" "常有用:" -#: ../../library/collections.rst:1213 +#: ../../library/collections.rst:1214 msgid "" "from collections import OrderedDict\n" "from time import time\n" @@ -1972,7 +1985,7 @@ msgid "" " return result" msgstr "" -#: ../../library/collections.rst:1240 +#: ../../library/collections.rst:1241 msgid "" "class MultiHitLRUCache:\n" " \"\"\" LRU cache that defers caching a result until\n" @@ -2010,11 +2023,11 @@ msgid "" " return result" msgstr "" -#: ../../library/collections.rst:1309 +#: ../../library/collections.rst:1310 msgid ":class:`UserDict` objects" msgstr ":class:`UserDict` 物件" -#: ../../library/collections.rst:1311 +#: ../../library/collections.rst:1312 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -2025,7 +2038,7 @@ msgstr "" "`dict` 建立子類別,這個類別的需求已部分被滿足,不過這個類別使用起來更方便,因" "為被包裝的字典可以作為其屬性來存取。" -#: ../../library/collections.rst:1319 +#: ../../library/collections.rst:1320 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" @@ -2037,23 +2050,23 @@ msgstr "" "`data` 屬性來做存取。如果有提供 *initialdata*,:attr:`data` 屬性會被初始化為" "其值;要注意指到 *initialdata* 的參照不會被保留,使其可被用於其他目的。" -#: ../../library/collections.rst:1325 +#: ../../library/collections.rst:1326 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" "除了支援作為對映所需的方法與操作,:class:`UserDict` 實例提供了以下屬性:" -#: ../../library/collections.rst:1330 +#: ../../library/collections.rst:1331 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "一個真實的字典,用於儲存 :class:`UserDict` 類別的資料內容。" -#: ../../library/collections.rst:1336 +#: ../../library/collections.rst:1337 msgid ":class:`UserList` objects" msgstr ":class:`UserList` 物件" -#: ../../library/collections.rst:1338 +#: ../../library/collections.rst:1339 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -2064,7 +2077,7 @@ msgstr "" "入新方法來定義你所需的一個類似於 list 的類別。如此一來,我們可以為 list 加入" "新的特性。" -#: ../../library/collections.rst:1343 +#: ../../library/collections.rst:1344 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " @@ -2073,7 +2086,7 @@ msgstr "" "因為已經可以直接自 :class:`list` 建立子類別,這個類別的需求已部分被滿足,不過" "這個類別使用起來更方便,因為被包裝的 list 可以作為其屬性來存取。" -#: ../../library/collections.rst:1349 +#: ../../library/collections.rst:1350 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -2086,20 +2099,20 @@ msgstr "" "list ``[]``。*list* 可以是任何 iterable,例如一個真實的 Python list 或是一" "個 :class:`UserList` 物件。" -#: ../../library/collections.rst:1355 +#: ../../library/collections.rst:1356 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "除了支援可變序列的方法與操作,:class:`UserList` 實例提供了以下屬性:" -#: ../../library/collections.rst:1360 +#: ../../library/collections.rst:1361 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" "一個真實的 :class:`list` 物件,用於儲存 :class:`UserList` 類別的資料內容。" -#: ../../library/collections.rst:1363 +#: ../../library/collections.rst:1364 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -2113,7 +2126,7 @@ msgstr "" "例,為了達成上述目的,它假設建構函式可傳入單一參數來呼叫,該參數即是做為數據" "來源的一個序列物件。" -#: ../../library/collections.rst:1370 +#: ../../library/collections.rst:1371 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -2123,11 +2136,11 @@ msgstr "" "如果希望一個自此獲得的子類別不遵從上述要求,那所有該類別支援的特殊方法則必須" "被覆寫;請參考原始碼來理解在這情況下哪些方法是必須提供的。" -#: ../../library/collections.rst:1376 +#: ../../library/collections.rst:1377 msgid ":class:`UserString` objects" msgstr ":class:`UserString` 物件" -#: ../../library/collections.rst:1378 +#: ../../library/collections.rst:1379 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -2138,7 +2151,7 @@ msgstr "" "建立子類別,這個類別的需求已經部分被滿足,不過這個類別使用起來更方便,因為被" "包裝的字串可以作為其屬性來存取。" -#: ../../library/collections.rst:1386 +#: ../../library/collections.rst:1387 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -2150,21 +2163,21 @@ msgstr "" "的 :attr:`data` 屬性來做存取。實例內容被初始化為 *seq* 的複製,*seq* 引數可以" "是任何可被內建函式 :func:`str` 轉換成字串的物件。" -#: ../../library/collections.rst:1393 +#: ../../library/collections.rst:1394 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" "除了支援字串的方法和操作以外,:class:`UserString` 實例也提供了以下屬性:" -#: ../../library/collections.rst:1398 +#: ../../library/collections.rst:1399 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" "一個真實的 :class:`str` 物件,用來儲存 :class:`UserString` 類別的資料內容。" -#: ../../library/collections.rst:1401 +#: ../../library/collections.rst:1402 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/configparser.po b/library/configparser.po index ce0e346f68..9f43fe1449 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -168,7 +168,7 @@ msgid "" "'no'\n" ">>> topsecret['Port']\n" "'50022'\n" -">>> for key in config['forge.example']: \n" +">>> for key in config['forge.example']:\n" "... print(key)\n" "user\n" "compressionlevel\n" diff --git a/library/constants.po b/library/constants.po index 9fd1624475..fc6b1f3586 100644 --- a/library/constants.po +++ b/library/constants.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-07 03:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su <newjordansu1126@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -96,16 +96,17 @@ msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "請參見 :ref:`implementing-the-arithmetic-operations` 以找到更多範例。" #: ../../library/constants.rst:51 +#, fuzzy msgid "" -"``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable, " -"even though they have similar names and purposes. See :exc:" -"`NotImplementedError` for details on when to use it." +":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " +"interchangeable. This constant should only be used as described above; see :" +"exc:`NotImplementedError` for details on correct usage of the exception." msgstr "" "``NotImplementedError`` 與 :data:`!NotImplemented` 並不一樣且不可互換。即使它" "們有相似的名稱與用途。欲知更多如何使用它們的細節,請參見 :exc:" "`NotImplementedError`。" -#: ../../library/constants.rst:55 +#: ../../library/constants.rst:56 msgid "" "Evaluating :data:`!NotImplemented` in a boolean context is deprecated. While " "it currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " @@ -115,7 +116,7 @@ msgstr "" "被解讀成 true,但會發出一個 :exc:`DeprecationWarning`。在未來版本的 Python 將" "會拋出 :exc:`TypeError`。" -#: ../../library/constants.rst:64 +#: ../../library/constants.rst:65 msgid "" "The same as the ellipsis literal \"``...``\". Special value used mostly in " "conjunction with extended slicing syntax for user-defined container data " @@ -126,7 +127,7 @@ msgstr "" "伸切片語法 (extended slicing syntax)。``Ellipsis`` 是型別 :data:`types." "EllipsisType` 的唯一實例。" -#: ../../library/constants.rst:71 +#: ../../library/constants.rst:72 msgid "" "This constant is true if Python was not started with an :option:`-O` option. " "See also the :keyword:`assert` statement." @@ -134,7 +135,7 @@ msgstr "" "如果 Python 沒有被以 :option:`-O` 選項啟動,則此常數為 true。請參見 :keyword:" "`assert` 陳述式。" -#: ../../library/constants.rst:77 +#: ../../library/constants.rst:78 msgid "" "The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` " "cannot be reassigned (assignments to them, even as an attribute name, raise :" @@ -144,11 +145,11 @@ msgstr "" "重新賦值的(任何對它們的賦值,即使是屬性的名稱,也會拋出 :exc:" "`SyntaxError`)。因此,它們可以被視為”真正的”常數。" -#: ../../library/constants.rst:85 +#: ../../library/constants.rst:86 msgid "Constants added by the :mod:`site` module" msgstr "由 :mod:`site` module(模組)所添增的常數" -#: ../../library/constants.rst:87 +#: ../../library/constants.rst:88 msgid "" "The :mod:`site` module (which is imported automatically during startup, " "except if the :option:`-S` command-line option is given) adds several " @@ -159,7 +160,7 @@ msgstr "" "指令行選項)會添增一些常數到內建命名空間 (built-in namespace) 中。它們在互動" "式直譯器中是很有幫助的,但不應該在程式 (programs) 中被使用。" -#: ../../library/constants.rst:95 +#: ../../library/constants.rst:96 msgid "" "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. " "EOF) to exit\", and when called, raise :exc:`SystemExit` with the specified " @@ -168,7 +169,7 @@ msgstr "" "當印出物件時,會印出一個訊息: \"Use quit() or Ctrl-D (i.e. EOF) to exit\" 。" "當被呼叫時,則會拋出 :exc:`SystemExit` 並帶有指定的返回碼(exit code)。" -#: ../../library/constants.rst:102 +#: ../../library/constants.rst:103 msgid "" "Object that when printed, prints the message \"Type help() for interactive " "help, or help(object) for help about object.\", and when called, acts as " @@ -178,13 +179,13 @@ msgstr "" "help(object) for help about object.\",並在呼叫時按所述的方式操作 :func:" "`elsewhere <help>`。" -#: ../../library/constants.rst:109 +#: ../../library/constants.rst:110 msgid "" "Objects that when printed or called, print the text of copyright or credits, " "respectively." msgstr "當印出或是呼叫此物件時,分別會印出版權與致謝的文字。" -#: ../../library/constants.rst:114 +#: ../../library/constants.rst:115 msgid "" "Object that when printed, prints the message \"Type license() to see the " "full license text\", and when called, displays the full license text in a " @@ -193,10 +194,10 @@ msgstr "" "當印出此物件時,會印出訊息 \"Type license() to see the full license text\"," "並在呼叫時以分頁形式印出完整的許可證文字(一次一整個畫面)。" -#: ../../library/constants.rst:61 +#: ../../library/constants.rst:62 msgid "..." msgstr "..." -#: ../../library/constants.rst:61 +#: ../../library/constants.rst:62 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" diff --git a/library/contextlib.po b/library/contextlib.po index 5785f5506e..0e28078975 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -982,37 +982,37 @@ msgid "" "be used instead." msgstr "" -#: ../../library/contextlib.rst:634 +#: ../../library/contextlib.rst:635 msgid "" "Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " "context manager." msgstr "" -#: ../../library/contextlib.rst:637 +#: ../../library/contextlib.rst:638 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " "asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:643 +#: ../../library/contextlib.rst:644 msgid "" "Similar to :meth:`ExitStack.push` but expects either an asynchronous context " "manager or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:648 +#: ../../library/contextlib.rst:649 msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:652 +#: ../../library/contextlib.rst:654 msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:654 +#: ../../library/contextlib.rst:656 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:656 +#: ../../library/contextlib.rst:658 msgid "" "async with AsyncExitStack() as stack:\n" " connections = [await stack.enter_async_context(get_connection())\n" @@ -1022,21 +1022,21 @@ msgid "" " # later in the list raise an exception." msgstr "" -#: ../../library/contextlib.rst:666 +#: ../../library/contextlib.rst:668 msgid "Examples and Recipes" msgstr "" -#: ../../library/contextlib.rst:668 +#: ../../library/contextlib.rst:670 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:673 +#: ../../library/contextlib.rst:675 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:675 +#: ../../library/contextlib.rst:677 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -1046,7 +1046,7 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:682 +#: ../../library/contextlib.rst:684 msgid "" "with ExitStack() as stack:\n" " for resource in resources:\n" @@ -1057,18 +1057,18 @@ msgid "" " # Perform operations that use the acquired resources" msgstr "" -#: ../../library/contextlib.rst:690 +#: ../../library/contextlib.rst:692 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:696 +#: ../../library/contextlib.rst:698 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:698 +#: ../../library/contextlib.rst:700 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -1077,7 +1077,7 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:704 +#: ../../library/contextlib.rst:706 msgid "" "stack = ExitStack()\n" "try:\n" @@ -1089,7 +1089,7 @@ msgid "" " # Handle normal case" msgstr "" -#: ../../library/contextlib.rst:713 +#: ../../library/contextlib.rst:715 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -1100,25 +1100,25 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:723 +#: ../../library/contextlib.rst:725 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:725 +#: ../../library/contextlib.rst:727 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`~object.__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:729 +#: ../../library/contextlib.rst:731 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:733 +#: ../../library/contextlib.rst:735 msgid "" "from contextlib import contextmanager, AbstractContextManager, ExitStack\n" "\n" @@ -1156,11 +1156,11 @@ msgid "" " self.release_resource()" msgstr "" -#: ../../library/contextlib.rst:769 +#: ../../library/contextlib.rst:771 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "" -#: ../../library/contextlib.rst:771 +#: ../../library/contextlib.rst:773 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -1168,7 +1168,7 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:776 +#: ../../library/contextlib.rst:778 msgid "" "cleanup_needed = True\n" "try:\n" @@ -1188,21 +1188,21 @@ msgstr "" " if cleanup_needed:\n" " cleanup_resources()" -#: ../../library/contextlib.rst:785 +#: ../../library/contextlib.rst:787 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:789 +#: ../../library/contextlib.rst:791 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:793 +#: ../../library/contextlib.rst:795 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1220,19 +1220,19 @@ msgstr "" " if result:\n" " stack.pop_all()" -#: ../../library/contextlib.rst:801 +#: ../../library/contextlib.rst:803 msgid "" "This allows the intended cleanup behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:804 +#: ../../library/contextlib.rst:806 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:807 +#: ../../library/contextlib.rst:809 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1264,14 +1264,14 @@ msgstr "" " if result:\n" " cb.cancel()" -#: ../../library/contextlib.rst:822 +#: ../../library/contextlib.rst:824 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:827 +#: ../../library/contextlib.rst:829 msgid "" "from contextlib import ExitStack\n" "\n" @@ -1293,24 +1293,24 @@ msgstr "" " if result:\n" " stack.pop_all()" -#: ../../library/contextlib.rst:837 +#: ../../library/contextlib.rst:839 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:843 +#: ../../library/contextlib.rst:845 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:845 +#: ../../library/contextlib.rst:847 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:848 +#: ../../library/contextlib.rst:850 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -1319,7 +1319,7 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:854 +#: ../../library/contextlib.rst:856 msgid "" "from contextlib import ContextDecorator\n" "import logging\n" @@ -1351,11 +1351,11 @@ msgstr "" " def __exit__(self, exc_type, exc, exc_tb):\n" " logging.info('Exiting: %s', self.name)" -#: ../../library/contextlib.rst:869 +#: ../../library/contextlib.rst:871 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:871 +#: ../../library/contextlib.rst:873 msgid "" "with track_entry_and_exit('widget loader'):\n" " print('Some time consuming activity goes here')\n" @@ -1365,11 +1365,11 @@ msgstr "" " print('Some time consuming activity goes here')\n" " load_widget()" -#: ../../library/contextlib.rst:875 +#: ../../library/contextlib.rst:877 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:877 +#: ../../library/contextlib.rst:879 msgid "" "@track_entry_and_exit('widget loader')\n" "def activity():\n" @@ -1381,7 +1381,7 @@ msgstr "" " print('Some time consuming activity goes here')\n" " load_widget()" -#: ../../library/contextlib.rst:882 +#: ../../library/contextlib.rst:884 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -1389,21 +1389,21 @@ msgid "" "use an explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:889 +#: ../../library/contextlib.rst:891 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../library/contextlib.rst:890 +#: ../../library/contextlib.rst:892 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../library/contextlib.rst:896 +#: ../../library/contextlib.rst:898 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:898 +#: ../../library/contextlib.rst:900 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -1411,28 +1411,28 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:904 +#: ../../library/contextlib.rst:906 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:908 +#: ../../library/contextlib.rst:910 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:912 +#: ../../library/contextlib.rst:914 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:916 +#: ../../library/contextlib.rst:918 msgid "" ">>> from contextlib import contextmanager\n" ">>> @contextmanager\n" @@ -1474,11 +1474,11 @@ msgstr "" " ...\n" "RuntimeError: generator didn't yield" -#: ../../library/contextlib.rst:940 +#: ../../library/contextlib.rst:942 msgid "Reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:942 +#: ../../library/contextlib.rst:944 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -1486,14 +1486,14 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:947 +#: ../../library/contextlib.rst:949 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " "very simple example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:951 +#: ../../library/contextlib.rst:953 msgid "" ">>> from contextlib import redirect_stdout\n" ">>> from io import StringIO\n" @@ -1525,14 +1525,14 @@ msgstr "" "This is written to the stream rather than stdout\n" "This is also written to the stream" -#: ../../library/contextlib.rst:966 +#: ../../library/contextlib.rst:968 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:970 +#: ../../library/contextlib.rst:972 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -1540,11 +1540,11 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:979 +#: ../../library/contextlib.rst:981 msgid "Reusable context managers" msgstr "" -#: ../../library/contextlib.rst:981 +#: ../../library/contextlib.rst:983 msgid "" "Distinct from both single use and reentrant context managers are " "\"reusable\" context managers (or, to be completely explicit, \"reusable, " @@ -1554,21 +1554,21 @@ msgid "" "manager instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:988 +#: ../../library/contextlib.rst:990 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:992 +#: ../../library/contextlib.rst:994 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:997 +#: ../../library/contextlib.rst:999 msgid "" ">>> from contextlib import ExitStack\n" ">>> stack = ExitStack()\n" @@ -1622,7 +1622,7 @@ msgstr "" "Callback: from outer context\n" "Leaving outer context" -#: ../../library/contextlib.rst:1023 +#: ../../library/contextlib.rst:1025 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -1630,13 +1630,13 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:1028 +#: ../../library/contextlib.rst:1030 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" msgstr "" -#: ../../library/contextlib.rst:1031 +#: ../../library/contextlib.rst:1033 msgid "" ">>> from contextlib import ExitStack\n" ">>> with ExitStack() as outer_stack:\n" diff --git a/library/ctypes.po b/library/ctypes.po index 36f2184eaf..b76d8972d9 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-01 15:04+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,13 +88,14 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:57 +#, fuzzy msgid "" ">>> from ctypes import *\n" -">>> print(windll.kernel32) \n" +">>> print(windll.kernel32)\n" "<WinDLL 'kernel32', handle ... at ...>\n" -">>> print(cdll.msvcrt) \n" +">>> print(cdll.msvcrt)\n" "<CDLL 'msvcrt', handle ... at ...>\n" -">>> libc = cdll.msvcrt \n" +">>> libc = cdll.msvcrt\n" ">>>" msgstr "" ">>> from ctypes import *\n" @@ -127,11 +128,12 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:79 +#, fuzzy msgid "" -">>> cdll.LoadLibrary(\"libc.so.6\") \n" +">>> cdll.LoadLibrary(\"libc.so.6\")\n" "<CDLL 'libc.so.6', handle ... at ...>\n" -">>> libc = CDLL(\"libc.so.6\") \n" -">>> libc \n" +">>> libc = CDLL(\"libc.so.6\")\n" +">>> libc\n" "<CDLL 'libc.so.6', handle ... at ...>\n" ">>>" msgstr "" @@ -151,12 +153,13 @@ msgid "Functions are accessed as attributes of dll objects::" msgstr "" #: ../../library/ctypes.rst:96 +#, fuzzy msgid "" ">>> libc.printf\n" "<_FuncPtr object at 0x...>\n" -">>> print(windll.kernel32.GetModuleHandleA) \n" +">>> print(windll.kernel32.GetModuleHandleA)\n" "<_FuncPtr object at 0x...>\n" -">>> print(windll.kernel32.MyOwnFunction) \n" +">>> print(windll.kernel32.MyOwnFunction)\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" " File \"ctypes.py\", line 239, in __getattr__\n" @@ -214,8 +217,9 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:129 +#, fuzzy msgid "" -">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\") \n" +">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" "<_FuncPtr object at 0x...>\n" ">>>" msgstr "" @@ -231,10 +235,11 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:136 +#, fuzzy msgid "" -">>> cdll.kernel32[1] \n" +">>> cdll.kernel32[1]\n" "<_FuncPtr object at 0x...>\n" -">>> cdll.kernel32[0] \n" +">>> cdll.kernel32[0]\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" " File \"ctypes.py\", line 310, in __getitem__\n" @@ -264,8 +269,9 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:155 +#, fuzzy msgid "" -">>> print(libc.rand()) \n" +">>> print(libc.rand())\n" "1804289383" msgstr "" ">>> print(libc.rand()) \n" @@ -279,8 +285,9 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:161 +#, fuzzy msgid "" -">>> print(hex(windll.kernel32.GetModuleHandleA(None))) \n" +">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" "0x1d000000\n" ">>>" msgstr "" @@ -295,15 +302,16 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:168 +#, fuzzy msgid "" -">>> cdll.kernel32.GetModuleHandleA(None) \n" +">>> cdll.kernel32.GetModuleHandleA(None)\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" "ValueError: Procedure probably called with not enough arguments (4 bytes " "missing)\n" ">>>\n" "\n" -">>> windll.msvcrt.printf(b\"spam\") \n" +">>> windll.msvcrt.printf(b\"spam\")\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" "ValueError: Procedure probably called with too many arguments (4 bytes in " @@ -338,8 +346,9 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:187 +#, fuzzy msgid "" -">>> windll.kernel32.GetModuleHandleA(32) \n" +">>> windll.kernel32.GetModuleHandleA(32)\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" "OSError: exception: access violation reading 0x00000020\n" @@ -667,7 +676,7 @@ msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " "point to, *not the contents* of the memory block (of course not, because " -"Python bytes objects are immutable)::" +"Python string objects are immutable)::" msgstr "" #: ../../library/ctypes.rst:297 @@ -978,8 +987,9 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:494 +#, fuzzy msgid "" -">>> print(libc.time(None)) \n" +">>> print(libc.time(None))\n" "1150640792" msgstr "" ">>> print(libc.time(None)) \n" @@ -992,9 +1002,10 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:500 +#, fuzzy msgid "" ">>> strchr = libc.strchr\n" -">>> strchr(b\"abcdef\", ord(\"d\")) \n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" "8059983\n" ">>> strchr.restype = c_char_p # c_char_p is a pointer to a string\n" ">>> strchr(b\"abcdef\", ord(\"d\"))\n" @@ -1061,18 +1072,19 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:535 +#, fuzzy msgid "" -">>> GetModuleHandle = windll.kernel32.GetModuleHandleA \n" +">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" ">>> def ValidHandle(value):\n" "... if value == 0:\n" "... raise WinError()\n" "... return value\n" "...\n" ">>>\n" -">>> GetModuleHandle.restype = ValidHandle \n" -">>> GetModuleHandle(None) \n" +">>> GetModuleHandle.restype = ValidHandle\n" +">>> GetModuleHandle(None)\n" "486539264\n" -">>> GetModuleHandle(\"something silly\") \n" +">>> GetModuleHandle(\"something silly\")\n" "Traceback (most recent call last):\n" " File \"<stdin>\", line 1, in <module>\n" " File \"<stdin>\", line 3, in ValidHandle\n" @@ -1311,7 +1323,7 @@ msgid "" "the fields. This is what ``#pragma pack(n)`` also does in MSVC. It is also " "possible to set a minimum alignment for how the subclass itself is packed in " "the same way ``#pragma align(n)`` works in MSVC. This can be achieved by " -"specifying a ::attr:`~Structure._align_` class attribute in the subclass " +"specifying a :attr:`~Structure._align_` class attribute in the subclass " "definition." msgstr "" @@ -2008,8 +2020,9 @@ msgid "The result::" msgstr "結果為: ::" #: ../../library/ctypes.rst:1043 +#, fuzzy msgid "" -">>> qsort(ia, len(ia), sizeof(c_int), cmp_func) \n" +">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" "py_cmp_func 5 1\n" "py_cmp_func 33 99\n" "py_cmp_func 7 33\n" @@ -2030,13 +2043,14 @@ msgid "Now we can actually compare the two items and return a useful result::" msgstr "" #: ../../library/ctypes.rst:1053 +#, fuzzy msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" "... return a[0] - b[0]\n" "...\n" ">>>\n" -">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func)) \n" +">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func))\n" "py_cmp_func 5 1\n" "py_cmp_func 33 99\n" "py_cmp_func 7 33\n" diff --git a/library/dataclasses.po b/library/dataclasses.po index 3725bca2be..53d23b3657 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -541,17 +541,19 @@ msgstr "" #, fuzzy msgid "" "*hash*: This can be a bool or ``None``. If true, this field is included 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." +"the generated :meth:`~object.__hash__` method. If false, this field is " +"excluded from the generated :meth:`~object.__hash__`. If ``None`` (the " +"default), use the value of *compare*: this would normally be the expected " +"behavior, since a field should be included in the hash if it's used for " +"comparisons. Setting this value to anything other than ``None`` is " +"discouraged." msgstr "" "*hash*:這可以是 bool 或 ``None``。如果為真,則此欄位包含在生成的 :meth:" "`__hash__` 方法中。如果“無”(預設值),則使用“比較”的值:這通常是預期的行為。" "如果一個欄位用於比較,則應在雜湊中考慮該欄位。不鼓勵將此值設定為“無”以外的任" "何值。" -#: ../../library/dataclasses.rst:286 +#: ../../library/dataclasses.rst:287 #, fuzzy msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " @@ -564,7 +566,7 @@ msgstr "" "湊值的成本很高,則需要該欄位進行相等性測試,並且還有其他欄位有助於型別的雜湊" "值。即使一個欄位被排除在雜湊之外,它仍然會被用於比較。" -#: ../../library/dataclasses.rst:292 +#: ../../library/dataclasses.rst:293 #, fuzzy msgid "" "*compare*: If true (the default), this field is included in the generated " @@ -574,7 +576,7 @@ msgstr "" "*compare*:如果為真(預設值),則此欄位包含在生成的相等和比較方法中(:meth:" "`~object.__eq__`、:meth:`~object.__gt__` 等)。" -#: ../../library/dataclasses.rst:296 +#: ../../library/dataclasses.rst:297 #, fuzzy msgid "" "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " @@ -589,7 +591,7 @@ msgstr "" "不被資料類別使用,而是作為第三方擴充機制提供的。多個第三方可以各自擁有自己的" "密鑰,用作元資料中的命名空間。" -#: ../../library/dataclasses.rst:304 +#: ../../library/dataclasses.rst:305 #, fuzzy msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " @@ -598,7 +600,7 @@ msgstr "" "*kw_only*:如果為真,該欄位將被標記為僅限關鍵字。這在計算生成的 :meth:" "`~object.__init__` 方法的參數時使用。" -#: ../../library/dataclasses.rst:310 +#: ../../library/dataclasses.rst:311 #, fuzzy msgid "" "If the default value of a field is specified by a call to :func:`!field`, " @@ -614,7 +616,7 @@ msgstr "" "在 :func:`@dataclass <dataclass>` 裝飾器運行後,類別屬性將全部包含欄位的預設" "值,就像預設值本身已指定一樣。例如,在: ::" -#: ../../library/dataclasses.rst:319 +#: ../../library/dataclasses.rst:320 msgid "" "@dataclass\n" "class C:\n" @@ -624,7 +626,7 @@ msgid "" " t: int = 20" msgstr "" -#: ../../library/dataclasses.rst:326 +#: ../../library/dataclasses.rst:327 #, fuzzy msgid "" "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" @@ -634,7 +636,7 @@ msgstr "" "類別屬性 :attr:`!C.z` 將為 ``10``,類別屬性 :attr:`!C.t` 將為 ``20``,類別屬" "性 :attr:`!C.x` 和 :attr:`!C.y` 將不會放。" -#: ../../library/dataclasses.rst:332 +#: ../../library/dataclasses.rst:333 #, fuzzy msgid "" ":class:`!Field` objects describe each defined field. These objects are " @@ -646,15 +648,15 @@ msgstr "" "`fields` 模組級方法回傳(見下文)。使用者不應該直接實例化 :class:`!Field` 物" "件。它記錄的屬性是:" -#: ../../library/dataclasses.rst:337 +#: ../../library/dataclasses.rst:338 msgid ":attr:`!name`: The name of the field." msgstr ":attr:`!name`:欄位的名稱。" -#: ../../library/dataclasses.rst:338 +#: ../../library/dataclasses.rst:339 msgid ":attr:`!type`: The type of the field." msgstr ":attr:`!type`:欄位的型別。" -#: ../../library/dataclasses.rst:339 +#: ../../library/dataclasses.rst:340 #, fuzzy msgid "" ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" @@ -665,14 +667,14 @@ msgstr "" "attr:`!hash`、:attr:`!compare`, :attr:`!metadata` 和 :attr:`!kw_only` 有與它" "們在 :func:`field` 函式中的含義和值相同。" -#: ../../library/dataclasses.rst:343 +#: ../../library/dataclasses.rst:344 #, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴。" -#: ../../library/dataclasses.rst:348 +#: ../../library/dataclasses.rst:349 #, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " @@ -684,7 +686,7 @@ msgstr "" "實例。如果未傳遞資料類別或其中一個實例,則引發 :exc:`TypeError`。不回傳 " "``ClassVar`` 或 ``InitVar`` 的偽欄位。" -#: ../../library/dataclasses.rst:355 +#: ../../library/dataclasses.rst:356 #, fuzzy msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " @@ -696,12 +698,12 @@ msgstr "" "都被轉換為其欄位的字典,作為 ``name: value`` 對。資料類別、字典、列表和元組被" "遞迴到。其他物件使用 :func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:361 +#: ../../library/dataclasses.rst:362 #, fuzzy msgid "Example of using :func:`!asdict` on nested dataclasses::" msgstr "在嵌套資料類別上使用 :func:`!asdict` 的範例: ::" -#: ../../library/dataclasses.rst:363 +#: ../../library/dataclasses.rst:364 msgid "" "@dataclass\n" "class Point:\n" @@ -719,22 +721,22 @@ msgid "" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" msgstr "" -#: ../../library/dataclasses.rst:378 ../../library/dataclasses.rst:398 +#: ../../library/dataclasses.rst:379 ../../library/dataclasses.rst:399 #, fuzzy msgid "To create a shallow copy, the following workaround may be used::" msgstr "要建立淺複製,可以使用以下解決方法:" -#: ../../library/dataclasses.rst:380 +#: ../../library/dataclasses.rst:381 msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" msgstr "" -#: ../../library/dataclasses.rst:382 +#: ../../library/dataclasses.rst:383 #, fuzzy msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr ":func:`!asdict` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:387 +#: ../../library/dataclasses.rst:388 #, fuzzy msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " @@ -746,21 +748,21 @@ msgstr "" "都被轉換為其欄位值的元組。資料類別、字典、列表和元組被遞迴到。其他物件使用 :" "func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:393 +#: ../../library/dataclasses.rst:394 msgid "Continuing from the previous example::" msgstr "從前面的例子繼續: ::" -#: ../../library/dataclasses.rst:395 +#: ../../library/dataclasses.rst:396 msgid "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" msgstr "" -#: ../../library/dataclasses.rst:400 +#: ../../library/dataclasses.rst:401 msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" msgstr "" -#: ../../library/dataclasses.rst:402 +#: ../../library/dataclasses.rst:403 #, fuzzy msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " @@ -768,7 +770,7 @@ msgid "" msgstr "" ":func:`!astuple` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:407 +#: ../../library/dataclasses.rst:408 #, fuzzy msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " @@ -788,13 +790,13 @@ msgstr "" "``kw_only`` 的值, ``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中" "的含義相同。" -#: ../../library/dataclasses.rst:417 +#: ../../library/dataclasses.rst:418 msgid "" "If *module* is defined, the :attr:`!__module__` attribute of the dataclass " "is set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:421 +#: ../../library/dataclasses.rst:422 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -806,7 +808,7 @@ msgstr "" "制都可以應用 :func:`dataclass` 函式將該類轉換為資料類別。提供此功能是為了方" "便。例如: ::" -#: ../../library/dataclasses.rst:427 +#: ../../library/dataclasses.rst:428 msgid "" "C = make_dataclass('C',\n" " [('x', int),\n" @@ -815,11 +817,11 @@ msgid "" " namespace={'add_one': lambda self: self.x + 1})" msgstr "" -#: ../../library/dataclasses.rst:433 +#: ../../library/dataclasses.rst:434 msgid "Is equivalent to::" msgstr "相當於: ::" -#: ../../library/dataclasses.rst:435 +#: ../../library/dataclasses.rst:436 msgid "" "@dataclass\n" "class C:\n" @@ -831,7 +833,7 @@ msgid "" " return self.x + 1" msgstr "" -#: ../../library/dataclasses.rst:446 +#: ../../library/dataclasses.rst:447 #, fuzzy msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " @@ -843,7 +845,7 @@ msgstr "" "``obj`` 不是資料類別,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定" "欄位,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:451 +#: ../../library/dataclasses.rst:452 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " @@ -853,7 +855,7 @@ msgstr "" "新回傳的對像是通過呼叫資料類別的 :meth:`~object.__init__` 方法建立的。這確" "保 :meth:`__post_init__`(如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:455 +#: ../../library/dataclasses.rst:456 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " @@ -863,7 +865,7 @@ msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:459 +#: ../../library/dataclasses.rst:460 #, fuzzy msgid "" "It is an error for *changes* to contain any fields that are defined as " @@ -872,7 +874,7 @@ msgstr "" "*changes* 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將引" "發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:463 +#: ../../library/dataclasses.rst:464 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:`!" @@ -889,13 +891,13 @@ msgstr "" "造函式可能是明智的,或者可能是處理實例複製的自定義:func:`!replace` (或類似命" "名的)方法。" -#: ../../library/dataclasses.rst:472 +#: ../../library/dataclasses.rst:473 msgid "" "Dataclass instances are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/dataclasses.rst:476 +#: ../../library/dataclasses.rst:477 #, fuzzy msgid "" "Return ``True`` if its parameter is a dataclass (including subclasses of a " @@ -903,7 +905,7 @@ msgid "" msgstr "" "如果它的參數是一個資料類別或一個實例,則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/dataclasses.rst:479 +#: ../../library/dataclasses.rst:480 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -913,18 +915,18 @@ msgstr "" "如果你需要知道一個類是否是資料類別的實例(而不是資料類別本身),那麼新增一個" "進一步的檢查 ``not isinstance(obj, type)``: ::" -#: ../../library/dataclasses.rst:483 +#: ../../library/dataclasses.rst:484 msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" msgstr "" -#: ../../library/dataclasses.rst:488 +#: ../../library/dataclasses.rst:489 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少 default 或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:492 +#: ../../library/dataclasses.rst:493 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -940,14 +942,14 @@ msgstr "" "類欄位的名稱。按照慣例,名稱 ``_`` 用於 :const:`!KW_ONLY` 欄位。僅關鍵字欄位" "表示 :meth:`~object.__init__` 參數,在實例化類時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:501 +#: ../../library/dataclasses.rst:502 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位: ::" -#: ../../library/dataclasses.rst:503 +#: ../../library/dataclasses.rst:504 msgid "" "@dataclass\n" "class Point:\n" @@ -959,14 +961,14 @@ msgid "" "p = Point(0, y=1.5, z=2.0)" msgstr "" -#: ../../library/dataclasses.rst:512 +#: ../../library/dataclasses.rst:513 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "在單個資料類別中,指定多個型別為 :const:`!KW_ONLY` 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:519 +#: ../../library/dataclasses.rst:520 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -976,12 +978,12 @@ msgstr "" "當在使用 frozen=True 定義的資料類別上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:526 +#: ../../library/dataclasses.rst:527 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:530 +#: ../../library/dataclasses.rst:531 #, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." @@ -997,14 +999,14 @@ msgstr "" "按照它們在類中定義的順序傳遞給 :meth:`!__post_init__` 。如果沒有生成 :meth:`!" "__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:537 +#: ../../library/dataclasses.rst:538 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "在其他用途中,這允許初始化依賴於一個或多個其他欄位的欄位值。例如: ::" -#: ../../library/dataclasses.rst:540 +#: ../../library/dataclasses.rst:541 msgid "" "@dataclass\n" "class C:\n" @@ -1016,7 +1018,7 @@ msgid "" " self.c = self.a + self.b" msgstr "" -#: ../../library/dataclasses.rst:549 +#: ../../library/dataclasses.rst:550 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :func:`@dataclass " @@ -1028,7 +1030,7 @@ msgstr "" "類別 :meth:`!__init__` 方法。如果基底類別有一個必須呼叫的 :meth:`!__init__` " "方法,通常在 :meth:`__post_init__` 方法中呼叫此方法: ::" -#: ../../library/dataclasses.rst:554 +#: ../../library/dataclasses.rst:555 msgid "" "class Rectangle:\n" " def __init__(self, height, width):\n" @@ -1043,7 +1045,7 @@ msgid "" " super().__init__(self.side, self.side)" msgstr "" -#: ../../library/dataclasses.rst:566 +#: ../../library/dataclasses.rst:567 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " @@ -1053,7 +1055,7 @@ msgstr "" "但是請注意,通常不需要呼叫資料類別生成的 :meth:`!__init__` 方法,因為派生資料" "類別將負責初始化作為資料類別本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:570 +#: ../../library/dataclasses.rst:571 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" @@ -1063,11 +1065,11 @@ msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`!__post_init__` 的" "方法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:577 +#: ../../library/dataclasses.rst:578 msgid "Class variables" msgstr "類別變數" -#: ../../library/dataclasses.rst:579 +#: ../../library/dataclasses.rst:580 #, fuzzy msgid "" "One of the few places where :func:`@dataclass <dataclass>` actually inspects " @@ -1084,12 +1086,12 @@ msgstr "" "外,並被資料類別機制忽略。模組級 :func:`fields` 函式不會回傳此類別 " "``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:590 +#: ../../library/dataclasses.rst:591 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:592 +#: ../../library/dataclasses.rst:593 #, fuzzy msgid "" "Another place where :func:`@dataclass <dataclass>` inspects a type " @@ -1109,14 +1111,14 @@ msgstr "" "的 :meth:`~object.__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。" "它們不被資料類使用。" -#: ../../library/dataclasses.rst:602 +#: ../../library/dataclasses.rst:603 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值: ::" -#: ../../library/dataclasses.rst:605 +#: ../../library/dataclasses.rst:606 msgid "" "@dataclass\n" "class C:\n" @@ -1131,7 +1133,7 @@ msgid "" "c = C(10, database=my_database)" msgstr "" -#: ../../library/dataclasses.rst:617 +#: ../../library/dataclasses.rst:618 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" @@ -1140,11 +1142,11 @@ msgstr "" "在這種情況下,:func:`fields` 將為 :attr:`!i` 和 :attr:`!j` 回傳 :class:" "`Field` 物件,但不會為 :attr:`!database` 回傳。" -#: ../../library/dataclasses.rst:623 +#: ../../library/dataclasses.rst:624 msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:625 +#: ../../library/dataclasses.rst:626 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -1158,7 +1160,7 @@ msgstr "" "別將向類新增 :meth:`~object.__setattr__` 和 :meth:`~object.__delattr__` 方" "法。這些方法在呼叫時會引發 :exc:`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:631 +#: ../../library/dataclasses.rst:632 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -1168,11 +1170,11 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`~object.__init__` 不能使" "用簡單賦值來初始化欄位,必須使用 :meth:`!object.__setattr__`。" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:641 msgid "Inheritance" msgstr "繼承" -#: ../../library/dataclasses.rst:642 +#: ../../library/dataclasses.rst:643 #, fuzzy msgid "" "When the dataclass is being created by the :func:`@dataclass <dataclass>` " @@ -1190,7 +1192,7 @@ msgstr "" "將自己的欄位新增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄" "位映射。因為欄位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子: ::" -#: ../../library/dataclasses.rst:652 +#: ../../library/dataclasses.rst:653 msgid "" "@dataclass\n" "class Base:\n" @@ -1203,7 +1205,7 @@ msgid "" " x: int = 15" msgstr "" -#: ../../library/dataclasses.rst:662 +#: ../../library/dataclasses.rst:663 #, fuzzy msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " @@ -1213,23 +1215,23 @@ msgstr "" "最終的欄位列表按順序為 :attr:`!x`、:attr:`!y`、:attr:`!z`。:attr:`!x` 的最終" "型別是 :class:`int`,如類別 :class:`!C` 中指定的那樣。" -#: ../../library/dataclasses.rst:665 +#: ../../library/dataclasses.rst:666 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" msgstr "為 :class:`!C` 生成的 :meth:`~object.__init__` 方法將如下所示: ::" -#: ../../library/dataclasses.rst:667 +#: ../../library/dataclasses.rst:668 msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" msgstr "" -#: ../../library/dataclasses.rst:670 +#: ../../library/dataclasses.rst:671 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" msgstr ":meth:`!__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:672 +#: ../../library/dataclasses.rst:673 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1241,7 +1243,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:678 +#: ../../library/dataclasses.rst:679 #, fuzzy msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " @@ -1251,7 +1253,7 @@ msgstr "" "在此示例中,:attr:`!Base.y`、:attr:`!Base.w` 和 :attr:`!D.t` 是僅限關鍵字的欄" "位,:attr:`!Base.x` 和 :attr:`!D.z` 是常規欄位: ::" -#: ../../library/dataclasses.rst:681 +#: ../../library/dataclasses.rst:682 msgid "" "@dataclass\n" "class Base:\n" @@ -1266,18 +1268,18 @@ msgid "" " t: int = field(kw_only=True, default=0)" msgstr "" -#: ../../library/dataclasses.rst:693 +#: ../../library/dataclasses.rst:694 #, fuzzy msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "為 :class:`!D` 生成的 :meth:`!__init__` 方法將如下所示: ::" -#: ../../library/dataclasses.rst:695 +#: ../../library/dataclasses.rst:696 msgid "" "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " "int = 0):" msgstr "" -#: ../../library/dataclasses.rst:697 +#: ../../library/dataclasses.rst:698 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1287,18 +1289,18 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:701 +#: ../../library/dataclasses.rst:702 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`!__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:706 +#: ../../library/dataclasses.rst:707 msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:708 +#: ../../library/dataclasses.rst:709 #, fuzzy msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " @@ -1308,11 +1310,11 @@ msgstr "" "如果 :func:`field` 指定了 *default_factory*,當需要該欄位的預設值時,它會以零" "引數呼叫。例如,要建立列表的新實例,請使用: ::" -#: ../../library/dataclasses.rst:712 +#: ../../library/dataclasses.rst:713 msgid "mylist: list = field(default_factory=list)" msgstr "" -#: ../../library/dataclasses.rst:714 +#: ../../library/dataclasses.rst:715 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1325,11 +1327,11 @@ msgstr "" "位還指定了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:" "`__init__ 中呼叫`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:721 +#: ../../library/dataclasses.rst:722 msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:723 +#: ../../library/dataclasses.rst:724 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " @@ -1337,7 +1339,7 @@ msgid "" msgstr "" "Python 將預設成員變數值存儲在類別屬性中。考慮這個例子,不使用資料類別: ::" -#: ../../library/dataclasses.rst:726 +#: ../../library/dataclasses.rst:727 msgid "" "class C:\n" " x = []\n" @@ -1352,7 +1354,7 @@ msgid "" "assert o1.x is o2.x" msgstr "" -#: ../../library/dataclasses.rst:738 +#: ../../library/dataclasses.rst:739 #, fuzzy msgid "" "Note that the two instances of class :class:`!C` share the same class " @@ -1361,12 +1363,12 @@ msgstr "" "請注意,類別 :class:`!C` 的兩個實例共享同一個類別變數 :attr:`!x`,正如預期的" "那樣。" -#: ../../library/dataclasses.rst:741 +#: ../../library/dataclasses.rst:742 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類別,*如果*此程式碼有效: ::" -#: ../../library/dataclasses.rst:743 +#: ../../library/dataclasses.rst:744 msgid "" "@dataclass\n" "class D:\n" @@ -1375,11 +1377,11 @@ msgid "" " self.x.append(element)" msgstr "" -#: ../../library/dataclasses.rst:749 +#: ../../library/dataclasses.rst:750 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼: ::" -#: ../../library/dataclasses.rst:751 +#: ../../library/dataclasses.rst:752 msgid "" "class D:\n" " x = []\n" @@ -1391,7 +1393,7 @@ msgid "" "assert D().x is D().x" msgstr "" -#: ../../library/dataclasses.rst:760 +#: ../../library/dataclasses.rst:761 #, fuzzy msgid "" "This has the same issue as the original example using class :class:`!C`. " @@ -1411,14 +1413,14 @@ msgstr "" "到不可散列的預設參數,它將引發 :exc:`TypeError`。假設是如果一個值是不可散列" "的,那麼它就是可變的。這是一個部分解決方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:771 +#: ../../library/dataclasses.rst:772 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法: ::" -#: ../../library/dataclasses.rst:774 +#: ../../library/dataclasses.rst:775 msgid "" "@dataclass\n" "class D:\n" @@ -1427,7 +1429,7 @@ msgid "" "assert D().x is not D().x" msgstr "" -#: ../../library/dataclasses.rst:780 +#: ../../library/dataclasses.rst:781 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" @@ -1437,12 +1439,12 @@ msgstr "" "不再查找和禁止型別為 :class:`list`、:class:`dict` 或 :class:`set` 的物件,現" "在不允許使用不可散列的對像作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:787 +#: ../../library/dataclasses.rst:788 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:789 +#: ../../library/dataclasses.rst:790 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects <descriptors>` as their " @@ -1450,7 +1452,7 @@ msgid "" msgstr "" "指定為\\ :ref:`描述器物件 <descriptors>`\\ 作為預設值的欄位具有以下特殊行為:" -#: ../../library/dataclasses.rst:792 +#: ../../library/dataclasses.rst:793 #, fuzzy msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " @@ -1460,7 +1462,7 @@ msgstr "" "傳遞給資料類別的 :meth:`~object.__init__` 方法的欄位值被傳遞給描述器的 :meth:" "`~object.__set__` 方法,而不是覆蓋描述器物件。" -#: ../../library/dataclasses.rst:796 +#: ../../library/dataclasses.rst:797 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" @@ -1470,7 +1472,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的 :meth:`~object.__get__` 或 :meth:`!" "__set__` 方法,而不是回傳或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:800 +#: ../../library/dataclasses.rst:801 #, fuzzy msgid "" "To determine whether a field contains a default value, :func:`@dataclass " @@ -1486,7 +1488,7 @@ msgstr "" "面,如果描述器在這種情況下引發 :exc:`AttributeError`,則不會為該欄位提供預設" "值。" -#: ../../library/dataclasses.rst:810 +#: ../../library/dataclasses.rst:811 msgid "" "class IntConversionDescriptor:\n" " def __init__(self, *, default):\n" @@ -1515,7 +1517,7 @@ msgid "" "print(i.quantity_on_hand) # 2" msgstr "" -#: ../../library/dataclasses.rst:835 +#: ../../library/dataclasses.rst:836 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/datetime.po b/library/datetime.po index abbb5f0ab2..6b9898dc3a 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid <gridwing@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1330,7 +1330,7 @@ msgid "" "\n" ">>> # Methods for to extracting 'components' under different calendars\n" ">>> t = d.timetuple()\n" -">>> for i in t: \n" +">>> for i in t:\n" "... print(i)\n" "2002 # year\n" "3 # month\n" @@ -1342,7 +1342,7 @@ msgid "" "70 # 70th day in the year\n" "-1\n" ">>> ic = d.isocalendar()\n" -">>> for i in ic: \n" +">>> for i in ic:\n" "... print(i)\n" "2002 # ISO year\n" "11 # ISO week number\n" @@ -1644,6 +1644,7 @@ msgid "Fractional hours and minutes are not supported." msgstr "" #: ../../library/datetime.rst:1056 +#, fuzzy msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1663,7 +1664,7 @@ msgid "" ">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." "utc)\n" -">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00') \n" +">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" msgstr "" @@ -1744,7 +1745,7 @@ msgid "" ">>> date_string = \"02/29\"\n" ">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " "Avoids leap year bug.\n" -">>> when.strftime(\"%B %d\") \n" +">>> when.strftime(\"%B %d\")\n" "'February 29'" msgstr "" @@ -2307,9 +2308,10 @@ msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" #: ../../library/datetime.rst:1563 +#, fuzzy msgid "" ">>> from datetime import datetime\n" -">>> datetime.now().isoformat(timespec='minutes') \n" +">>> datetime.now().isoformat(timespec='minutes')\n" "'2002-12-25T00:00'\n" ">>> dt = datetime(2015, 1, 1, 12, 30, 59, 0)\n" ">>> dt.isoformat(timespec='microseconds')\n" @@ -2393,9 +2395,9 @@ msgid "" "datetime.datetime(2005, 7, 14, 12, 30)\n" "\n" ">>> # Using datetime.now()\n" -">>> datetime.now() \n" +">>> datetime.now()\n" "datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" -">>> datetime.now(timezone.utc) \n" +">>> datetime.now(timezone.utc)\n" "datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." "utc)\n" "\n" @@ -2406,7 +2408,7 @@ msgid "" "\n" ">>> # Using datetime.timetuple() to get tuple of all attributes\n" ">>> tt = dt.timetuple()\n" -">>> for it in tt: \n" +">>> for it in tt:\n" "... print(it)\n" "...\n" "2006 # year\n" @@ -2421,7 +2423,7 @@ msgid "" "\n" ">>> # Date in ISO format\n" ">>> ic = dt.isocalendar()\n" -">>> for it in ic: \n" +">>> for it in ic:\n" "... print(it)\n" "...\n" "2006 # ISO year\n" diff --git a/library/dis.po b/library/dis.po index 4c73671690..68960ab312 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -152,43 +152,43 @@ msgstr "" msgid "Show inline caches." msgstr "" -#: ../../library/dis.rst:104 +#: ../../library/dis.rst:106 msgid "Show offsets of instructions." msgstr "" -#: ../../library/dis.rst:106 +#: ../../library/dis.rst:110 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " "stdout. Otherwise, disassembly is performed on compiled source code received " "from stdin." msgstr "" -#: ../../library/dis.rst:110 +#: ../../library/dis.rst:114 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:114 +#: ../../library/dis.rst:118 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:121 +#: ../../library/dis.rst:125 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:125 +#: ../../library/dis.rst:129 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:129 ../../library/dis.rst:326 +#: ../../library/dis.rst:133 ../../library/dis.rst:330 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -196,73 +196,73 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:134 +#: ../../library/dis.rst:138 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:138 +#: ../../library/dis.rst:142 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:141 +#: ../../library/dis.rst:145 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:144 +#: ../../library/dis.rst:148 msgid "" "If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " "in the output." msgstr "" -#: ../../library/dis.rst:149 +#: ../../library/dis.rst:153 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:154 +#: ../../library/dis.rst:158 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:158 +#: ../../library/dis.rst:162 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:162 +#: ../../library/dis.rst:166 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:167 +#: ../../library/dis.rst:171 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:170 ../../library/dis.rst:210 -#: ../../library/dis.rst:262 +#: ../../library/dis.rst:174 ../../library/dis.rst:214 +#: ../../library/dis.rst:266 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:173 ../../library/dis.rst:265 -#: ../../library/dis.rst:282 ../../library/dis.rst:312 -#: ../../library/dis.rst:335 +#: ../../library/dis.rst:177 ../../library/dis.rst:269 +#: ../../library/dis.rst:286 ../../library/dis.rst:316 +#: ../../library/dis.rst:339 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:176 +#: ../../library/dis.rst:180 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:178 +#: ../../library/dis.rst:182 msgid "" ">>> bytecode = dis.Bytecode(myfunc)\n" ">>> for instr in bytecode:\n" @@ -284,11 +284,11 @@ msgstr "" "CALL\n" "RETURN_VALUE" -#: ../../library/dis.rst:192 +#: ../../library/dis.rst:196 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:194 +#: ../../library/dis.rst:198 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -296,39 +296,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:200 +#: ../../library/dis.rst:204 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:204 +#: ../../library/dis.rst:208 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:216 +#: ../../library/dis.rst:220 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:220 +#: ../../library/dis.rst:224 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:225 ../../library/dis.rst:256 -#: ../../library/dis.rst:279 ../../library/dis.rst:309 +#: ../../library/dis.rst:229 ../../library/dis.rst:260 +#: ../../library/dis.rst:283 ../../library/dis.rst:313 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:231 +#: ../../library/dis.rst:235 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -344,103 +344,103 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:244 ../../library/dis.rst:276 -#: ../../library/dis.rst:306 +#: ../../library/dis.rst:248 ../../library/dis.rst:280 +#: ../../library/dis.rst:310 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:251 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:250 +#: ../../library/dis.rst:254 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:253 +#: ../../library/dis.rst:257 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:259 +#: ../../library/dis.rst:263 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:272 +#: ../../library/dis.rst:276 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:285 ../../library/dis.rst:315 +#: ../../library/dis.rst:289 ../../library/dis.rst:319 msgid "Added the *show_offsets* parameter." msgstr "新增 *show_offsets* 參數。" -#: ../../library/dis.rst:292 +#: ../../library/dis.rst:296 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:295 +#: ../../library/dis.rst:299 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:296 +#: ../../library/dis.rst:300 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:297 +#: ../../library/dis.rst:301 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:298 +#: ../../library/dis.rst:302 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:299 +#: ../../library/dis.rst:303 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:300 +#: ../../library/dis.rst:304 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:301 +#: ../../library/dis.rst:305 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:303 +#: ../../library/dis.rst:307 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:320 +#: ../../library/dis.rst:324 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:323 +#: ../../library/dis.rst:327 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:331 +#: ../../library/dis.rst:335 msgid "The *adaptive* parameter works as it does in :func:`dis`." msgstr "" -#: ../../library/dis.rst:338 +#: ../../library/dis.rst:342 msgid "" "The *show_caches* parameter is deprecated and has no effect. The iterator " "generates the :class:`Instruction` instances with the *cache_info* field " @@ -448,7 +448,7 @@ msgid "" "generates separate items for the cache entries." msgstr "" -#: ../../library/dis.rst:346 +#: ../../library/dis.rst:350 msgid "" "This generator function uses the :meth:`~codeobject.co_lines` method of the :" "ref:`code object <code-objects>` *code* to find the offsets which are starts " @@ -456,33 +456,33 @@ msgid "" "pairs." msgstr "" -#: ../../library/dis.rst:351 +#: ../../library/dis.rst:355 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:354 +#: ../../library/dis.rst:358 msgid "" "The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" "attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " "attributes of the :ref:`code object <code-objects>`." msgstr "" -#: ../../library/dis.rst:359 +#: ../../library/dis.rst:363 msgid "" "Line numbers can be ``None`` for bytecode that does not map to source lines." msgstr "" -#: ../../library/dis.rst:365 +#: ../../library/dis.rst:369 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:371 +#: ../../library/dis.rst:375 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:373 +#: ../../library/dis.rst:377 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -490,11 +490,11 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:380 +#: ../../library/dis.rst:384 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:383 +#: ../../library/dis.rst:387 msgid "" "If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " "``oparg=0``. Previously this was an error for opcodes that use their arg. It " @@ -502,170 +502,170 @@ msgid "" "does not use it; the ``oparg`` in this case is ignored." msgstr "" -#: ../../library/dis.rst:393 +#: ../../library/dis.rst:397 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:395 +#: ../../library/dis.rst:399 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:404 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:404 +#: ../../library/dis.rst:408 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:410 +#: ../../library/dis.rst:414 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:415 +#: ../../library/dis.rst:419 msgid "" "numeric code for the base operation if operation is specialized; otherwise " "equal to :data:`opcode`" msgstr "" -#: ../../library/dis.rst:421 +#: ../../library/dis.rst:425 msgid "" "human readable name for the base operation if operation is specialized; " "otherwise equal to :data:`opname`" msgstr "" -#: ../../library/dis.rst:427 +#: ../../library/dis.rst:431 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:431 +#: ../../library/dis.rst:435 msgid "alias for :data:`arg`" msgstr "" -#: ../../library/dis.rst:435 +#: ../../library/dis.rst:439 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:440 +#: ../../library/dis.rst:444 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:446 +#: ../../library/dis.rst:450 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:451 +#: ../../library/dis.rst:455 msgid "" "start index of operation within bytecode sequence, including prefixed " "``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" msgstr "" -#: ../../library/dis.rst:457 +#: ../../library/dis.rst:461 msgid "start index of the cache entries following the operation" msgstr "" -#: ../../library/dis.rst:462 +#: ../../library/dis.rst:466 msgid "end index of the cache entries following the operation" msgstr "" -#: ../../library/dis.rst:467 +#: ../../library/dis.rst:471 msgid "``True`` if this opcode starts a source line, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:472 +#: ../../library/dis.rst:476 msgid "" "source line number associated with this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:477 +#: ../../library/dis.rst:481 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:482 +#: ../../library/dis.rst:486 msgid "" "bytecode index of the jump target if this is a jump operation, otherwise " "``None``" msgstr "" -#: ../../library/dis.rst:488 +#: ../../library/dis.rst:492 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:503 +#: ../../library/dis.rst:507 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:507 +#: ../../library/dis.rst:511 msgid "Changed field ``starts_line``." msgstr "" -#: ../../library/dis.rst:509 +#: ../../library/dis.rst:513 msgid "" "Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " "``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " "and ``cache_info``." msgstr "" -#: ../../library/dis.rst:516 +#: ../../library/dis.rst:520 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:526 +#: ../../library/dis.rst:530 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:529 +#: ../../library/dis.rst:533 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:531 +#: ../../library/dis.rst:535 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:537 +#: ../../library/dis.rst:541 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:543 +#: ../../library/dis.rst:547 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:545 +#: ../../library/dis.rst:549 msgid "STACK.pop()" msgstr "STACK.pop()" -#: ../../library/dis.rst:550 +#: ../../library/dis.rst:554 msgid "" "Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " "at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:559 +#: ../../library/dis.rst:563 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" -#: ../../library/dis.rst:567 +#: ../../library/dis.rst:571 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:570 +#: ../../library/dis.rst:574 msgid "" "assert i > 0\n" "STACK.append(STACK[-i])" @@ -673,15 +673,15 @@ msgstr "" "assert i > 0\n" "STACK.append(STACK[-i])" -#: ../../library/dis.rst:578 +#: ../../library/dis.rst:582 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:580 +#: ../../library/dis.rst:584 msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" msgstr "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -#: ../../library/dis.rst:587 +#: ../../library/dis.rst:591 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -689,86 +689,86 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:592 +#: ../../library/dis.rst:596 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:596 +#: ../../library/dis.rst:600 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:607 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:605 +#: ../../library/dis.rst:609 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:611 +#: ../../library/dis.rst:615 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:616 +#: ../../library/dis.rst:620 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:618 ../../library/dis.rst:1314 -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:622 ../../library/dis.rst:1318 +#: ../../library/dis.rst:1334 msgid "This instruction now requires an exact :class:`bool` operand." msgstr "" -#: ../../library/dis.rst:624 +#: ../../library/dis.rst:628 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:629 +#: ../../library/dis.rst:633 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:634 +#: ../../library/dis.rst:638 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:642 +#: ../../library/dis.rst:646 msgid "Implements ``STACK[-1] = bool(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:647 +#: ../../library/dis.rst:651 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:649 +#: ../../library/dis.rst:653 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:652 +#: ../../library/dis.rst:656 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:659 +#: ../../library/dis.rst:663 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:662 +#: ../../library/dis.rst:666 msgid "" "rhs = STACK.pop()\n" "lhs = STACK.pop()\n" @@ -778,17 +778,17 @@ msgstr "" "lhs = STACK.pop()\n" "STACK.append(lhs op rhs)" -#: ../../library/dis.rst:671 ../../library/dis.rst:680 -#: ../../library/dis.rst:690 ../../library/dis.rst:698 -#: ../../library/dis.rst:710 ../../library/dis.rst:798 -#: ../../library/dis.rst:808 ../../library/dis.rst:818 -#: ../../library/dis.rst:1042 ../../library/dis.rst:1053 -#: ../../library/dis.rst:1157 ../../library/dis.rst:1169 -#: ../../library/dis.rst:1181 +#: ../../library/dis.rst:675 ../../library/dis.rst:684 +#: ../../library/dis.rst:694 ../../library/dis.rst:702 +#: ../../library/dis.rst:714 ../../library/dis.rst:802 +#: ../../library/dis.rst:812 ../../library/dis.rst:822 +#: ../../library/dis.rst:1046 ../../library/dis.rst:1057 +#: ../../library/dis.rst:1161 ../../library/dis.rst:1173 +#: ../../library/dis.rst:1185 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:673 +#: ../../library/dis.rst:677 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -798,7 +798,7 @@ msgstr "" "container = STACK.pop()\n" "STACK.append(container[key])" -#: ../../library/dis.rst:682 +#: ../../library/dis.rst:686 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -810,7 +810,7 @@ msgstr "" "value = STACK.pop()\n" "container[key] = value" -#: ../../library/dis.rst:692 +#: ../../library/dis.rst:696 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -820,7 +820,7 @@ msgstr "" "container = STACK.pop()\n" "del container[key]" -#: ../../library/dis.rst:700 +#: ../../library/dis.rst:704 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -832,7 +832,7 @@ msgstr "" "container = STACK.pop()\n" "STACK.append(container[start:end])" -#: ../../library/dis.rst:712 +#: ../../library/dis.rst:716 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -846,11 +846,11 @@ msgstr "" "values = STACK.pop()\n" "container[start:end] = value" -#: ../../library/dis.rst:721 +#: ../../library/dis.rst:725 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:725 +#: ../../library/dis.rst:729 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -858,39 +858,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:730 +#: ../../library/dis.rst:734 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:733 +#: ../../library/dis.rst:737 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:734 +#: ../../library/dis.rst:738 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:738 +#: ../../library/dis.rst:742 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:744 +#: ../../library/dis.rst:748 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:747 +#: ../../library/dis.rst:751 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:754 +#: ../../library/dis.rst:758 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:762 +#: ../../library/dis.rst:766 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -898,13 +898,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:769 ../../library/dis.rst:877 -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:773 ../../library/dis.rst:881 +#: ../../library/dis.rst:892 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:775 +#: ../../library/dis.rst:779 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -912,21 +912,21 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:785 +#: ../../library/dis.rst:789 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:788 +#: ../../library/dis.rst:792 msgid "STACK.extend((__aexit__, __aenter__())" msgstr "STACK.extend((__aexit__, __aenter__())" -#: ../../library/dis.rst:794 +#: ../../library/dis.rst:798 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:800 +#: ../../library/dis.rst:804 msgid "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" @@ -934,11 +934,11 @@ msgstr "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:807 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:810 +#: ../../library/dis.rst:814 msgid "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" @@ -946,11 +946,11 @@ msgstr "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:817 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:824 msgid "" "value = STACK.pop()\n" "key = STACK.pop()\n" @@ -960,17 +960,17 @@ msgstr "" "key = STACK.pop()\n" "dict.__setitem__(STACK[-i], key, value)" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:828 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:827 +#: ../../library/dis.rst:831 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:831 +#: ../../library/dis.rst:835 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 " @@ -978,35 +978,35 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:839 +#: ../../library/dis.rst:843 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:844 +#: ../../library/dis.rst:848 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:851 +#: ../../library/dis.rst:855 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:853 +#: ../../library/dis.rst:857 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:856 +#: ../../library/dis.rst:860 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:859 +#: ../../library/dis.rst:863 msgid "" "oparg is ``1`` if this instruction is part of a yield-from or await, and " "``0`` otherwise." msgstr "" -#: ../../library/dis.rst:865 +#: ../../library/dis.rst:869 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 " @@ -1014,39 +1014,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:879 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:886 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 :attr:`~frame." "f_lasti` of the current frame." msgstr "" -#: ../../library/dis.rst:893 +#: ../../library/dis.rst:897 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:901 +#: ../../library/dis.rst:905 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:909 +#: ../../library/dis.rst:913 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:912 +#: ../../library/dis.rst:916 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 " @@ -1054,7 +1054,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:921 +#: ../../library/dis.rst:925 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 " @@ -1062,25 +1062,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:928 +#: ../../library/dis.rst:932 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:935 +#: ../../library/dis.rst:939 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:943 +#: ../../library/dis.rst:947 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:949 +#: ../../library/dis.rst:953 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -1089,13 +1089,13 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:960 +#: ../../library/dis.rst:964 msgid "" "Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " "statements where comparison with structure of pattern is needed." msgstr "" -#: ../../library/dis.rst:968 +#: ../../library/dis.rst:972 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -1103,7 +1103,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:978 +#: ../../library/dis.rst:982 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -1112,20 +1112,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:988 +#: ../../library/dis.rst:992 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:994 ../../library/dis.rst:1686 +#: ../../library/dis.rst:998 ../../library/dis.rst:1690 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:1001 +#: ../../library/dis.rst:1005 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object <code-" @@ -1133,19 +1133,19 @@ msgid "" "`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:1008 +#: ../../library/dis.rst:1012 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`~codeobject." "co_names` attribute of the :ref:`code object <code-objects>`." msgstr "" -#: ../../library/dis.rst:1014 +#: ../../library/dis.rst:1018 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:1017 +#: ../../library/dis.rst:1021 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" @@ -1153,7 +1153,7 @@ msgstr "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" -#: ../../library/dis.rst:1023 +#: ../../library/dis.rst:1027 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -1161,11 +1161,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:1028 +#: ../../library/dis.rst:1032 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:1030 +#: ../../library/dis.rst:1034 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -1174,13 +1174,13 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:1036 +#: ../../library/dis.rst:1040 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:1044 +#: ../../library/dis.rst:1048 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" @@ -1190,13 +1190,13 @@ msgstr "" "value = STACK.pop()\n" "obj.name = value" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1052 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object <code-objects>`." msgstr "" -#: ../../library/dis.rst:1055 +#: ../../library/dis.rst:1059 msgid "" "obj = STACK.pop()\n" "del obj.name" @@ -1204,38 +1204,38 @@ msgstr "" "obj = STACK.pop()\n" "del obj.name" -#: ../../library/dis.rst:1058 +#: ../../library/dis.rst:1062 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object <code-objects>`." msgstr "" -#: ../../library/dis.rst:1064 +#: ../../library/dis.rst:1068 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:1069 +#: ../../library/dis.rst:1073 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:1074 +#: ../../library/dis.rst:1078 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1079 +#: ../../library/dis.rst:1083 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:1085 +#: ../../library/dis.rst:1089 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:1094 +#: ../../library/dis.rst:1098 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -1244,13 +1244,13 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:1105 +#: ../../library/dis.rst:1109 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" -#: ../../library/dis.rst:1108 +#: ../../library/dis.rst:1112 msgid "" "if count == 0:\n" " value = ()\n" @@ -1268,41 +1268,41 @@ msgstr "" "\n" "STACK.append(value)" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1123 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1124 +#: ../../library/dis.rst:1128 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1129 +#: ../../library/dis.rst:1133 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1133 +#: ../../library/dis.rst:1137 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1140 +#: ../../library/dis.rst:1144 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 " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1149 +#: ../../library/dis.rst:1153 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1159 +#: ../../library/dis.rst:1163 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" @@ -1310,11 +1310,11 @@ msgstr "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" -#: ../../library/dis.rst:1162 +#: ../../library/dis.rst:1166 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1171 +#: ../../library/dis.rst:1175 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" @@ -1322,11 +1322,11 @@ msgstr "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" -#: ../../library/dis.rst:1174 +#: ../../library/dis.rst:1178 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1183 +#: ../../library/dis.rst:1187 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" @@ -1334,21 +1334,21 @@ msgstr "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1190 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1193 +#: ../../library/dis.rst:1197 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1204 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1203 +#: ../../library/dis.rst:1207 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -1360,76 +1360,76 @@ msgid "" "pushed." msgstr "" -#: ../../library/dis.rst:1212 +#: ../../library/dis.rst:1216 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1219 +#: ../../library/dis.rst:1223 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1227 msgid "It pops three values from the stack (from top of stack down):" msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1229 msgid "``self``: the first argument to the current method" msgstr "" -#: ../../library/dis.rst:1226 +#: ../../library/dis.rst:1230 msgid "``cls``: the class within which the current method was defined" msgstr "" -#: ../../library/dis.rst:1227 +#: ../../library/dis.rst:1231 msgid "the global ``super``" msgstr "" -#: ../../library/dis.rst:1229 +#: ../../library/dis.rst:1233 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1232 +#: ../../library/dis.rst:1236 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1236 +#: ../../library/dis.rst:1240 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1244 +#: ../../library/dis.rst:1248 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " "(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: ../../library/dis.rst:1248 +#: ../../library/dis.rst:1252 msgid "" "The fifth-lowest bit of the oparg now indicates a forced conversion to :" "class:`bool`." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1259 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1262 +#: ../../library/dis.rst:1266 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1269 +#: ../../library/dis.rst:1273 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1438,68 +1438,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1277 +#: ../../library/dis.rst:1281 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1284 +#: ../../library/dis.rst:1288 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1289 +#: ../../library/dis.rst:1293 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1296 +#: ../../library/dis.rst:1300 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1307 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1306 ../../library/dis.rst:1322 +#: ../../library/dis.rst:1310 ../../library/dis.rst:1326 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1311 ../../library/dis.rst:1327 -#: ../../library/dis.rst:1343 ../../library/dis.rst:1357 +#: ../../library/dis.rst:1315 ../../library/dis.rst:1331 +#: ../../library/dis.rst:1347 ../../library/dis.rst:1361 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1319 +#: ../../library/dis.rst:1323 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1339 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1338 ../../library/dis.rst:1352 +#: ../../library/dis.rst:1342 ../../library/dis.rst:1356 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1349 +#: ../../library/dis.rst:1353 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1362 +#: ../../library/dis.rst:1366 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1507,91 +1507,91 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1371 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1372 +#: ../../library/dis.rst:1376 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1374 +#: ../../library/dis.rst:1378 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:1380 +#: ../../library/dis.rst:1384 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1382 +#: ../../library/dis.rst:1386 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:1392 msgid "" "Pushes references to ``co_varnames[var_nums >> 4]`` and " "``co_varnames[var_nums & 15]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1399 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1407 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1411 +#: ../../library/dis.rst:1415 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1419 msgid "" "Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " "into ``co_varnames[var_nums & 15]``." msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1426 msgid "" "Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " "pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " "stack." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1434 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1435 +#: ../../library/dis.rst:1439 msgid "" "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:1443 +#: ../../library/dis.rst:1447 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:1446 ../../library/dis.rst:1468 -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1450 ../../library/dis.rst:1472 +#: ../../library/dis.rst:1483 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1456 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1602,112 +1602,112 @@ msgid "" "class bodies." msgstr "" -#: ../../library/dis.rst:1465 +#: ../../library/dis.rst:1469 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1478 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1485 +#: ../../library/dis.rst:1489 msgid "" "Copies the ``n`` :term:`free (closure) variables <closure variable>` from " "the closure into the frame. Removes the need for special code on the " "caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1494 +#: ../../library/dis.rst:1498 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1497 +#: ../../library/dis.rst:1501 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1502 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1499 +#: ../../library/dis.rst:1503 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1505 +#: ../../library/dis.rst:1509 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1508 ../../library/dis.rst:1532 +#: ../../library/dis.rst:1512 ../../library/dis.rst:1536 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1509 ../../library/dis.rst:1533 +#: ../../library/dis.rst:1513 ../../library/dis.rst:1537 msgid "``self`` or ``NULL``" msgstr "" -#: ../../library/dis.rst:1510 ../../library/dis.rst:1534 +#: ../../library/dis.rst:1514 ../../library/dis.rst:1538 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1512 +#: ../../library/dis.rst:1516 msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1518 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:1520 +#: ../../library/dis.rst:1524 msgid "The callable now always appears at the same position on the stack." msgstr "" -#: ../../library/dis.rst:1523 +#: ../../library/dis.rst:1527 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: ../../library/dis.rst:1529 +#: ../../library/dis.rst:1533 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1535 +#: ../../library/dis.rst:1539 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1540 msgid "A :class:`tuple` of keyword argument names" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1542 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1545 msgid "" "``CALL_KW`` pops all arguments, the keyword names, 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:1550 +#: ../../library/dis.rst:1554 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 " @@ -1719,33 +1719,33 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1569 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:1574 +#: ../../library/dis.rst:1578 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1580 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1579 +#: ../../library/dis.rst:1583 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1586 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1593 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " @@ -1753,42 +1753,42 @@ msgid "" "attribute to set:" msgstr "" -#: ../../library/dis.rst:1593 +#: ../../library/dis.rst:1597 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1599 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1596 +#: ../../library/dis.rst:1600 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1601 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1610 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1612 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1616 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1614 +#: ../../library/dis.rst:1618 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1800,11 +1800,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1623 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1624 +#: ../../library/dis.rst:1628 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 " @@ -1812,11 +1812,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1636 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1634 +#: ../../library/dis.rst:1638 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1826,28 +1826,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1638 +#: ../../library/dis.rst:1642 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1643 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1644 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1642 ../../library/dis.rst:1655 -#: ../../library/dis.rst:1668 +#: ../../library/dis.rst:1646 ../../library/dis.rst:1659 +#: ../../library/dis.rst:1672 msgid "Used for implementing formatted literal strings (f-strings)." msgstr "" -#: ../../library/dis.rst:1649 +#: ../../library/dis.rst:1653 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1655 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1857,11 +1857,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1661 +#: ../../library/dis.rst:1665 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1667 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1873,14 +1873,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1675 +#: ../../library/dis.rst:1679 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1683 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1888,219 +1888,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1697 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1695 +#: ../../library/dis.rst:1699 msgid "" "The ``context`` oparand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1702 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1700 +#: ../../library/dis.rst:1704 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1701 +#: ../../library/dis.rst:1705 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1702 +#: ../../library/dis.rst:1706 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1704 +#: ../../library/dis.rst:1708 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1709 +#: ../../library/dis.rst:1713 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1719 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1724 +#: ../../library/dis.rst:1728 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1727 +#: ../../library/dis.rst:1731 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1736 +#: ../../library/dis.rst:1740 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1740 +#: ../../library/dis.rst:1744 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1747 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:1747 +#: ../../library/dis.rst:1751 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1756 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1761 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1761 ../../library/dis.rst:1815 +#: ../../library/dis.rst:1765 ../../library/dis.rst:1819 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1764 ../../library/dis.rst:1818 +#: ../../library/dis.rst:1768 ../../library/dis.rst:1822 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1764 ../../library/dis.rst:1818 +#: ../../library/dis.rst:1768 ../../library/dis.rst:1822 msgid "Description" msgstr "" -#: ../../library/dis.rst:1766 +#: ../../library/dis.rst:1770 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1766 ../../library/dis.rst:1820 +#: ../../library/dis.rst:1770 ../../library/dis.rst:1824 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1768 +#: ../../library/dis.rst:1772 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1768 +#: ../../library/dis.rst:1772 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1775 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1775 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1774 +#: ../../library/dis.rst:1778 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1774 +#: ../../library/dis.rst:1778 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1777 +#: ../../library/dis.rst:1781 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1777 +#: ../../library/dis.rst:1781 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1779 +#: ../../library/dis.rst:1783 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1779 +#: ../../library/dis.rst:1783 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1782 +#: ../../library/dis.rst:1786 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1782 +#: ../../library/dis.rst:1786 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1784 +#: ../../library/dis.rst:1788 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1784 +#: ../../library/dis.rst:1788 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1786 +#: ../../library/dis.rst:1790 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1786 +#: ../../library/dis.rst:1790 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1789 +#: ../../library/dis.rst:1793 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1789 +#: ../../library/dis.rst:1793 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1792 +#: ../../library/dis.rst:1796 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1792 +#: ../../library/dis.rst:1796 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1795 +#: ../../library/dis.rst:1799 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1795 +#: ../../library/dis.rst:1799 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1807 +#: ../../library/dis.rst:1811 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1810 +#: ../../library/dis.rst:1814 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2112,61 +2112,61 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1820 +#: ../../library/dis.rst:1824 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1822 +#: ../../library/dis.rst:1826 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1822 +#: ../../library/dis.rst:1826 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1826 +#: ../../library/dis.rst:1830 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1826 +#: ../../library/dis.rst:1830 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1829 +#: ../../library/dis.rst:1833 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1829 +#: ../../library/dis.rst:1833 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1833 +#: ../../library/dis.rst:1837 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1833 +#: ../../library/dis.rst:1837 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1840 +#: ../../library/dis.rst:1844 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1842 +#: ../../library/dis.rst:1846 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1847 +#: ../../library/dis.rst:1851 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1854 +#: ../../library/dis.rst:1858 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -2175,91 +2175,91 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1863 +#: ../../library/dis.rst:1867 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1867 +#: ../../library/dis.rst:1871 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1874 +#: ../../library/dis.rst:1878 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1880 +#: ../../library/dis.rst:1884 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1885 +#: ../../library/dis.rst:1889 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1888 +#: ../../library/dis.rst:1892 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1890 +#: ../../library/dis.rst:1894 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1896 +#: ../../library/dis.rst:1900 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1903 +#: ../../library/dis.rst:1907 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1905 +#: ../../library/dis.rst:1909 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1908 +#: ../../library/dis.rst:1912 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1915 +#: ../../library/dis.rst:1919 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1920 +#: ../../library/dis.rst:1924 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1925 +#: ../../library/dis.rst:1929 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1930 +#: ../../library/dis.rst:1934 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1937 +#: ../../library/dis.rst:1941 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1942 +#: ../../library/dis.rst:1946 msgid "" "Sequence of bytecodes that access a :term:`free (closure) variable <closure " "variable>`. 'free' in this context refers to names in the current scope that " @@ -2268,47 +2268,47 @@ msgid "" "scopes." msgstr "" -#: ../../library/dis.rst:1950 +#: ../../library/dis.rst:1954 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1955 +#: ../../library/dis.rst:1959 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:1962 +#: ../../library/dis.rst:1966 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1967 +#: ../../library/dis.rst:1971 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1971 +#: ../../library/dis.rst:1975 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1978 +#: ../../library/dis.rst:1982 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1980 +#: ../../library/dis.rst:1984 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:1986 +#: ../../library/dis.rst:1990 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1988 +#: ../../library/dis.rst:1992 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1604 +#: ../../library/dis.rst:1608 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1604 +#: ../../library/dis.rst:1608 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index fda2f389c6..92a8447fde 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1232,10 +1232,10 @@ msgstr "" #: ../../library/doctest.rst:820 msgid "" -">>> id(1.0) # certain to fail some of the time \n" +">>> id(1.0) # certain to fail some of the time\n" "7948648\n" ">>> class C: pass\n" -">>> C() # the default repr() for instances embeds an address \n" +">>> C() # the default repr() for instances embeds an address\n" "<C object at 0x00AC18F0>" msgstr "" diff --git a/library/email.errors.po b/library/email.errors.po index 4e9e91bc1f..efdf5240fd 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-07 00:03+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,40 +64,31 @@ msgstr "" #: ../../library/email.errors.rst:48 msgid "" -"Raised when a payload is added to a :class:`~email.message.Message` object " -"using :meth:`add_payload`, but the payload is already a scalar and the " -"message's :mailheader:`Content-Type` main type is not either :mimetype:" -"`multipart` or missing. :exc:`MultipartConversionError` multiply inherits " -"from :exc:`MessageError` and the built-in :exc:`TypeError`." +"Raised if the :meth:`~email.message.Message.attach` method is called on an " +"instance of a class derived from :class:`~email.mime.nonmultipart." +"MIMENonMultipart` (e.g. :class:`~email.mime.image.MIMEImage`). :exc:" +"`MultipartConversionError` multiply inherits from :exc:`MessageError` and " +"the built-in :exc:`TypeError`." msgstr "" -#: ../../library/email.errors.rst:54 -msgid "" -"Since :meth:`Message.add_payload` is deprecated, this exception is rarely " -"raised in practice. However the exception may also be raised if the :meth:" -"`~email.message.Message.attach` method is called on an instance of a class " -"derived from :class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. :class:" -"`~email.mime.image.MIMEImage`)." -msgstr "" - -#: ../../library/email.errors.rst:64 +#: ../../library/email.errors.rst:58 msgid "" "Raised when an error occurs when the :mod:`~email.generator` outputs headers." msgstr "" -#: ../../library/email.errors.rst:70 +#: ../../library/email.errors.rst:64 msgid "" "This is the base class for all defects found when parsing email messages. It " "is derived from :exc:`ValueError`." msgstr "" -#: ../../library/email.errors.rst:75 +#: ../../library/email.errors.rst:69 msgid "" "This is the base class for all defects found when parsing email headers. It " "is derived from :exc:`MessageDefect`." msgstr "" -#: ../../library/email.errors.rst:78 +#: ../../library/email.errors.rst:72 msgid "" "Here is the list of the defects that the :class:`~email.parser.FeedParser` " "can find while parsing messages. Note that the defects are added to the " @@ -107,90 +98,84 @@ msgid "" "not." msgstr "" -#: ../../library/email.errors.rst:84 +#: ../../library/email.errors.rst:78 msgid "" "All defect classes are subclassed from :class:`email.errors.MessageDefect`." msgstr "" -#: ../../library/email.errors.rst:86 +#: ../../library/email.errors.rst:82 msgid "" -":class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart, " -"but had no :mimetype:`boundary` parameter." +"A message claimed to be a multipart, but had no :mimetype:`boundary` " +"parameter." msgstr "" -#: ../../library/email.errors.rst:89 +#: ../../library/email.errors.rst:87 msgid "" -":class:`StartBoundaryNotFoundDefect` -- The start boundary claimed in the :" -"mailheader:`Content-Type` header was never found." +"The start boundary claimed in the :mailheader:`Content-Type` header was " +"never found." msgstr "" #: ../../library/email.errors.rst:92 msgid "" -":class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but no " -"corresponding close boundary was ever found." +"A start boundary was found, but no corresponding close boundary was ever " +"found." msgstr "" -#: ../../library/email.errors.rst:97 -msgid "" -":class:`FirstHeaderLineIsContinuationDefect` -- The message had a " -"continuation line as its first header line." +#: ../../library/email.errors.rst:99 +msgid "The message had a continuation line as its first header line." msgstr "" -#: ../../library/email.errors.rst:100 -msgid "" -":class:`MisplacedEnvelopeHeaderDefect` - A \"Unix From\" header was found in " -"the middle of a header block." +#: ../../library/email.errors.rst:103 +msgid "A \"Unix From\" header was found in the middle of a header block." msgstr "" -#: ../../library/email.errors.rst:103 +#: ../../library/email.errors.rst:107 msgid "" -":class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing " -"headers that had no leading white space but contained no ':'. Parsing " -"continues assuming that the line represents the first line of the body." +"A line was found while parsing headers that had no leading white space but " +"contained no ':'. Parsing continues assuming that the line represents the " +"first line of the body." msgstr "" -#: ../../library/email.errors.rst:109 +#: ../../library/email.errors.rst:115 msgid "" -":class:`MalformedHeaderDefect` -- A header was found that was missing a " -"colon, or was otherwise malformed." +"A header was found that was missing a colon, or was otherwise malformed." msgstr "" -#: ../../library/email.errors.rst:112 +#: ../../library/email.errors.rst:117 msgid "This defect has not been used for several Python versions." msgstr "" -#: ../../library/email.errors.rst:115 +#: ../../library/email.errors.rst:122 msgid "" -":class:`MultipartInvariantViolationDefect` -- A message claimed to be a :" -"mimetype:`multipart`, but no subparts were found. Note that when a message " -"has this defect, its :meth:`~email.message.Message.is_multipart` method may " -"return ``False`` even though its content type claims to be :mimetype:" -"`multipart`." +"A message claimed to be a :mimetype:`multipart`, but no subparts were found. " +"Note that when a message has this defect, its :meth:`~email.message.Message." +"is_multipart` method may return ``False`` even though its content type " +"claims to be :mimetype:`multipart`." msgstr "" -#: ../../library/email.errors.rst:120 +#: ../../library/email.errors.rst:129 msgid "" -":class:`InvalidBase64PaddingDefect` -- When decoding a block of base64 " -"encoded bytes, the padding was not correct. Enough padding is added to " -"perform the decode, but the resulting decoded bytes may be invalid." +"When decoding a block of base64 encoded bytes, the padding was not correct. " +"Enough padding is added to perform the decode, but the resulting decoded " +"bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:124 +#: ../../library/email.errors.rst:135 msgid "" -":class:`InvalidBase64CharactersDefect` -- When decoding a block of base64 " -"encoded bytes, characters outside the base64 alphabet were encountered. The " -"characters are ignored, but the resulting decoded bytes may be invalid." +"When decoding a block of base64 encoded bytes, characters outside the base64 " +"alphabet were encountered. The characters are ignored, but the resulting " +"decoded bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:128 +#: ../../library/email.errors.rst:141 msgid "" -":class:`InvalidBase64LengthDefect` -- When decoding a block of base64 " -"encoded bytes, the number of non-padding base64 characters was invalid (1 " -"more than a multiple of 4). The encoded block was kept as-is." +"When decoding a block of base64 encoded bytes, the number of non-padding " +"base64 characters was invalid (1 more than a multiple of 4). The encoded " +"block was kept as-is." msgstr "" -#: ../../library/email.errors.rst:132 +#: ../../library/email.errors.rst:147 msgid "" -":class:`InvalidDateDefect` -- When decoding an invalid or unparsable date " -"field. The original value is kept as-is." +"When decoding an invalid or unparsable date field. The original value is " +"kept as-is." msgstr "" diff --git a/library/email.parser.po b/library/email.parser.po index 69565e928d..4c1838e5c5 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -328,9 +328,10 @@ msgid "" msgstr "" #: ../../library/email.parser.rst:286 +#, fuzzy msgid "" ">>> import email\n" -">>> msg = email.message_from_bytes(myBytes) " +">>> msg = email.message_from_bytes(myBytes)" msgstr "" ">>> import email\n" ">>> msg = email.message_from_bytes(myBytes) " diff --git a/library/ensurepip.po b/library/ensurepip.po index 54caf8f9cb..fa7e3b7eb0 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,20 +89,20 @@ msgstr "" msgid "Command line interface" msgstr "命令列介面" -#: ../../library/ensurepip.rst:46 +#: ../../library/ensurepip.rst:48 msgid "" "The command line interface is invoked using the interpreter's ``-m`` switch." msgstr "使用直譯器 (interpreter) 的 ``-m`` 來調用命令列介面" -#: ../../library/ensurepip.rst:48 +#: ../../library/ensurepip.rst:50 msgid "The simplest possible invocation is::" msgstr "最簡單可行的調用: ::" -#: ../../library/ensurepip.rst:50 +#: ../../library/ensurepip.rst:52 msgid "python -m ensurepip" msgstr "python -m ensurepip" -#: ../../library/ensurepip.rst:52 +#: ../../library/ensurepip.rst:54 msgid "" "This invocation will install ``pip`` if it is not already installed, but " "otherwise does nothing. To ensure the installed version of ``pip`` is at " @@ -113,11 +113,11 @@ msgstr "" "upgrade`` 參數來確保 ``pip`` 的安裝版本至少為當前 ``ensurepip`` 中最新可用的" "版本: ::" -#: ../../library/ensurepip.rst:57 +#: ../../library/ensurepip.rst:59 msgid "python -m ensurepip --upgrade" msgstr "python -m ensurepip --upgrade" -#: ../../library/ensurepip.rst:59 +#: ../../library/ensurepip.rst:61 msgid "" "By default, ``pip`` is installed into the current virtual environment (if " "one is active) or into the system site packages (if there is no active " @@ -127,25 +127,27 @@ msgstr "" "預設上,``pip`` 會被安裝至當前虛擬環境(若已啟動虛擬環境)或系統端的套件(若" "沒有啟動的虛擬環境)。安裝位置可透過兩個額外的命令列選項來控制:" -#: ../../library/ensurepip.rst:64 +#: ../../library/ensurepip.rst:68 +#, fuzzy msgid "" -":samp:`--root {dir}`: Installs ``pip`` relative to the given root directory " -"rather than the root of the currently active virtual environment (if any) or " -"the default root for the current Python installation." +"Installs ``pip`` relative to the given root directory rather than the root " +"of the currently active virtual environment (if any) or the default root for " +"the current Python installation." msgstr "" "``--root <dir>``:安裝 ``pip`` 到給定的根目錄 (root directory) 的相對路徑,而" "不是當前虛擬環境(若存在)的根目錄,或當前 Python 安裝版所預設的根目錄。" -#: ../../library/ensurepip.rst:67 +#: ../../library/ensurepip.rst:74 +#, fuzzy msgid "" -"``--user``: Installs ``pip`` into the user site packages directory rather " -"than globally for the current Python installation (this option is not " -"permitted inside an active virtual environment)." +"Installs ``pip`` into the user site packages directory rather than globally " +"for the current Python installation (this option is not permitted inside an " +"active virtual environment)." msgstr "" "``--user`` :安裝 ``pip`` 到使用者端的套件目錄,而不是全域安裝到當前的 " "Python 安裝版(此選項不允許在一啟動的虛擬環境中使用)。" -#: ../../library/ensurepip.rst:71 +#: ../../library/ensurepip.rst:78 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the version of Python used to invoke ``ensurepip``). The scripts " @@ -154,45 +156,47 @@ msgstr "" "預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表用來調用 ``ensurepip`` 的 " "Python 之版本)。安裝的腳本可透過兩個額外的命令列選項來控制:" -#: ../../library/ensurepip.rst:76 +#: ../../library/ensurepip.rst:85 +#, fuzzy msgid "" -"``--altinstall``: if an alternate installation is requested, the ``pipX`` " -"script will *not* be installed." +"If an alternate installation is requested, the ``pipX`` script will *not* be " +"installed." msgstr "" "``--altinstall``:若要求一個替代安裝版,則\\ *不會*\\ 安裝 ``pipX`` 腳本。" -#: ../../library/ensurepip.rst:79 +#: ../../library/ensurepip.rst:90 +#, fuzzy msgid "" -"``--default-pip``: if a \"default pip\" installation is requested, the " -"``pip`` script will be installed in addition to the two regular scripts." +"If a \"default pip\" installation is requested, the ``pip`` script will be " +"installed in addition to the two regular scripts." msgstr "" "``--default-pip``: 若要求安裝「預設 pip」,則會安裝 ``pip`` 腳本,及 2 個常" "規腳本。" -#: ../../library/ensurepip.rst:82 +#: ../../library/ensurepip.rst:93 msgid "" "Providing both of the script selection options will trigger an exception." msgstr "提供兩種指令選項將會導致例外 (exception) 。" -#: ../../library/ensurepip.rst:86 +#: ../../library/ensurepip.rst:96 msgid "Module API" msgstr "模組 API" -#: ../../library/ensurepip.rst:88 +#: ../../library/ensurepip.rst:98 msgid ":mod:`ensurepip` exposes two functions for programmatic use:" msgstr ":mod:`ensurepip` 開放了兩個用於編寫程式的函式:" -#: ../../library/ensurepip.rst:92 +#: ../../library/ensurepip.rst:102 msgid "" "Returns a string specifying the available version of pip that will be " "installed when bootstrapping an environment." msgstr "回傳一個字串,用以標明初始建置時,安裝的 pip 的可行版本號。" -#: ../../library/ensurepip.rst:99 +#: ../../library/ensurepip.rst:109 msgid "Bootstraps ``pip`` into the current or designated environment." msgstr "在當前或指定的環境之中建立 ``pip``。" -#: ../../library/ensurepip.rst:101 +#: ../../library/ensurepip.rst:111 msgid "" "*root* specifies an alternative root directory to install relative to. If " "*root* is ``None``, then installation uses the default install location for " @@ -201,47 +205,47 @@ msgstr "" "*root* 指定一個替代的根目錄,作為安裝的相對路徑。若 *root* 為 ``None``,則安" "裝使用當前環境的預設安裝位置。" -#: ../../library/ensurepip.rst:105 +#: ../../library/ensurepip.rst:115 msgid "" "*upgrade* indicates whether or not to upgrade an existing installation of an " "earlier version of ``pip`` to the available version." msgstr "*upgrade* 指出是否要將一個既有的較早版本的 ``pip`` 升級至可用的新版。" -#: ../../library/ensurepip.rst:108 +#: ../../library/ensurepip.rst:118 msgid "" "*user* indicates whether to use the user scheme rather than installing " "globally." msgstr "*user* 指出是否要使用使用者的安裝方案而不是全域安裝。" -#: ../../library/ensurepip.rst:111 +#: ../../library/ensurepip.rst:121 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the current version of Python)." msgstr "預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表 Python 的當前版本)。" -#: ../../library/ensurepip.rst:114 +#: ../../library/ensurepip.rst:124 msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." msgstr "如果啟用了 *altinstall*,則不會安裝 ``pipX``。" -#: ../../library/ensurepip.rst:116 +#: ../../library/ensurepip.rst:126 msgid "" "If *default_pip* is set, then ``pip`` will be installed in addition to the " "two regular scripts." msgstr "如果啟用了 *default_pip*,則會安裝 ``pip``,以及 2 個常規腳本。" -#: ../../library/ensurepip.rst:119 +#: ../../library/ensurepip.rst:129 msgid "" "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." msgstr "同時啟用 *altinstall* 跟 *default_pip*,將會觸發 :exc:`ValueError`。" -#: ../../library/ensurepip.rst:122 +#: ../../library/ensurepip.rst:132 msgid "" "*verbosity* controls the level of output to :data:`sys.stdout` from the " "bootstrapping operation." msgstr "" "*verbosity* 用來控制初始建置操作內,對於 :data:`sys.stdout` 的輸出等級。" -#: ../../library/ensurepip.rst:125 +#: ../../library/ensurepip.rst:135 msgid "" "Raises an :ref:`auditing event <auditing>` ``ensurepip.bootstrap`` with " "argument ``root``." @@ -249,7 +253,7 @@ msgstr "" "引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 <auditing>` ``ensurepip." "bootstrap``。" -#: ../../library/ensurepip.rst:129 +#: ../../library/ensurepip.rst:139 msgid "" "The bootstrapping process has side effects on both ``sys.path`` and ``os." "environ``. Invoking the command line interface in a subprocess instead " @@ -258,7 +262,7 @@ msgstr "" "初始建置的過程對於 ``sys.path`` 及 ``os.environ`` 均有副作用。改為在一子行程 " "(subprocess) 調用命令列介面可避免這些副作用。" -#: ../../library/ensurepip.rst:135 +#: ../../library/ensurepip.rst:145 msgid "" "The bootstrapping process may install additional modules required by " "``pip``, but other software should not assume those dependencies will always " diff --git a/library/exceptions.po b/library/exceptions.po index dda90d7665..3b806cf449 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-09-17 09:18+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -501,15 +501,16 @@ msgstr "" "子或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" #: ../../library/exceptions.rst:338 +#, fuzzy msgid "" -"``NotImplementedError`` and :data:`NotImplemented` are not interchangeable, " -"even though they have similar names and purposes. See :data:`!" -"NotImplemented` for details on when to use it." +":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " +"interchangeable. This exception should only be used as described above; see :" +"data:`NotImplemented` for details on correct usage of the built-in constant." msgstr "" "``NotImplementedError`` 和 :data:`NotImplemented` 雖然有相似的名稱和目的但並" "不是可互換的。參考 :data:`!NotImplemented` 裡關於何時使用的細節。" -#: ../../library/exceptions.rst:347 +#: ../../library/exceptions.rst:349 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " @@ -518,7 +519,7 @@ msgstr "" "當系統函式回傳系統相關錯誤,包含像\"找不到檔案\"或\"硬碟已滿\"的 I/O 失敗會引" "發此例外(而非不合法的引數或其他次要的錯誤)。" -#: ../../library/exceptions.rst:351 +#: ../../library/exceptions.rst:353 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -530,7 +531,7 @@ msgstr "" "const:`None`。為了向後相容,如果傳入三個引數,:attr:`~BaseException.args` 屬" "性只會是包含建構函式前兩個引數的雙元素元組。" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:359 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -543,11 +544,11 @@ msgstr "" "個行為只發生在直接建構 :exc:`OSError` 或透過別名,且產生子類別的時候不會被繼" "承。" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:367 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "從 C 變數 :c:data:`errno` 而來的數值錯誤代碼。" -#: ../../library/exceptions.rst:369 +#: ../../library/exceptions.rst:371 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " @@ -556,7 +557,7 @@ msgstr "" "在 Windows 下,這會提供你原生的 Windows 錯誤代碼。而 :attr:`.errno` 屬性是一" "個該原生錯誤代碼對於 POSIX 來說的近似翻譯。" -#: ../../library/exceptions.rst:373 +#: ../../library/exceptions.rst:375 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -567,7 +568,7 @@ msgstr "" "據該 Windows 錯誤代碼來決定,且 *errno* 引數會被忽略。在其他平台上," "*winerror* 引數會被忽略,而 :attr:`winerror` 屬性會不存在。" -#: ../../library/exceptions.rst:381 +#: ../../library/exceptions.rst:383 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" @@ -576,7 +577,7 @@ msgstr "" "作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`perror` 做格式" "化,而在 Windows 下會使用 :c:func:`FormatMessage`。" -#: ../../library/exceptions.rst:389 +#: ../../library/exceptions.rst:391 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -588,7 +589,7 @@ msgstr "" "`filename` 是傳入函式的檔案名稱。對於包含兩個檔案系統路徑的函式(像是 :func:" "`os.rename`),:attr:`filename2` 對應到傳入函式的第二個檔案名稱。" -#: ../../library/exceptions.rst:396 +#: ../../library/exceptions.rst:398 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" @@ -598,7 +599,7 @@ msgstr "" "error`、:exc:`select.error` 及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而" "建構函式可能會回傳子類別。" -#: ../../library/exceptions.rst:402 +#: ../../library/exceptions.rst:404 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -609,7 +610,7 @@ msgstr "" "和錯誤處理函式 <filesystem encoding and error handler>`\\ 編碼或解碼過的名" "稱。並且新增 *filename2* 建構函式引數與屬性。" -#: ../../library/exceptions.rst:411 +#: ../../library/exceptions.rst:413 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -623,7 +624,7 @@ msgstr "" "有時候會因為整數在要求範圍之外而引發。因為在 C 裡面缺乏浮點數例外處理的標準" "化,大部分的浮點數運算都沒有被檢查。" -#: ../../library/exceptions.rst:421 +#: ../../library/exceptions.rst:423 #, fuzzy msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when an " @@ -633,29 +634,29 @@ msgstr "" "此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" "func:`sys.getrecursionlimit`)時會引發此例外。" -#: ../../library/exceptions.rst:425 +#: ../../library/exceptions.rst:427 msgid "" "Examples of operations which can be blocked with a :exc:" "`PythonFinalizationError` during the Python finalization:" msgstr "" -#: ../../library/exceptions.rst:428 +#: ../../library/exceptions.rst:430 msgid "Creating a new Python thread." msgstr "" -#: ../../library/exceptions.rst:429 +#: ../../library/exceptions.rst:431 msgid ":func:`os.fork`." msgstr "" -#: ../../library/exceptions.rst:431 +#: ../../library/exceptions.rst:433 msgid "See also the :func:`sys.is_finalizing` function." msgstr "" -#: ../../library/exceptions.rst:433 ../../library/exceptions.rst:443 +#: ../../library/exceptions.rst:435 ../../library/exceptions.rst:445 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "在之前,會引發一般的 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:439 +#: ../../library/exceptions.rst:441 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." @@ -664,7 +665,7 @@ msgstr "" "此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" "func:`sys.getrecursionlimit`)時會引發此例外。" -#: ../../library/exceptions.rst:449 +#: ../../library/exceptions.rst:451 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -675,7 +676,7 @@ msgstr "" "用來存取已經被垃圾回收 (garbage collected) 的參照物屬性時會引發此例外。更多關" "於弱參照的資訊參考 :mod:`weakref` 模組。" -#: ../../library/exceptions.rst:457 +#: ../../library/exceptions.rst:459 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " @@ -684,7 +685,7 @@ msgstr "" "當偵測到一個不屬於任何其他種類的錯誤時會引發此例外。關聯值是一個表示確切什麼" "地方出錯的字串。" -#: ../../library/exceptions.rst:464 +#: ../../library/exceptions.rst:466 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " @@ -693,7 +694,7 @@ msgstr "" "會被內建函式 :func:`next` 及 :term:`iterator` 的 :meth:`~iterator.__next__` " "方法引發,用來表示疊代器沒有更多項目可以產生。" -#: ../../library/exceptions.rst:470 +#: ../../library/exceptions.rst:472 msgid "" "The exception object has a single attribute :attr:`!value`, which is given " "as an argument when constructing the exception, and defaults to :const:" @@ -702,7 +703,7 @@ msgstr "" "此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設為 :" "const:`None`。" -#: ../../library/exceptions.rst:474 +#: ../../library/exceptions.rst:476 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " @@ -712,7 +713,7 @@ msgstr "" "`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構函式的 :" "attr:`value` 參數。" -#: ../../library/exceptions.rst:479 +#: ../../library/exceptions.rst:481 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " @@ -721,13 +722,13 @@ msgstr "" "如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換成 :exc:" "`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" -#: ../../library/exceptions.rst:483 +#: ../../library/exceptions.rst:485 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "新增 ``value`` 屬性且產生器函式可以用它來回傳值。" -#: ../../library/exceptions.rst:487 +#: ../../library/exceptions.rst:489 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." @@ -735,7 +736,7 @@ msgstr "" "透過 ``from __future__ import generator_stop`` 引入 RuntimeError 的轉換,參" "考 :pep:`479`。" -#: ../../library/exceptions.rst:491 +#: ../../library/exceptions.rst:493 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." @@ -743,7 +744,7 @@ msgstr "" "預設對所有程式啟用 :pep:`479`:在產生器引發的 :exc:`StopIteration` 錯誤會轉換" "成 :exc:`RuntimeError`。" -#: ../../library/exceptions.rst:497 +#: ../../library/exceptions.rst:499 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." @@ -751,7 +752,7 @@ msgstr "" "此例外必須被 :term:`asynchronous iterator` 物件的 :meth:`~object.__anext__` " "方法引發來停止疊代。" -#: ../../library/exceptions.rst:504 +#: ../../library/exceptions.rst:506 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -762,7 +763,7 @@ msgstr "" "呼叫內建函式 :func:`compile`、:func:`exec` 或 :func:`eval` 的時候,或者在讀取" "初始腳本或標準輸入(也包含互動式)的時候。" -#: ../../library/exceptions.rst:510 +#: ../../library/exceptions.rst:512 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." @@ -770,18 +771,18 @@ msgstr "" "例外實例的 :func:`str` 只回傳錯誤訊息。Details 是個元組,其成員也能夠以分開的" "屬性取得。" -#: ../../library/exceptions.rst:515 +#: ../../library/exceptions.rst:517 msgid "The name of the file the syntax error occurred in." msgstr "發生語法錯誤所在的檔案名稱。" -#: ../../library/exceptions.rst:519 +#: ../../library/exceptions.rst:521 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" "發生錯誤所在檔案的列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 1。" -#: ../../library/exceptions.rst:524 +#: ../../library/exceptions.rst:526 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." @@ -789,11 +790,11 @@ msgstr "" "發生錯誤所在該列的欄號 (column)。這是以 1 開始的索引:該列第一個字元的 " "``offset`` 是 1。" -#: ../../library/exceptions.rst:529 +#: ../../library/exceptions.rst:531 msgid "The source code text involved in the error." msgstr "涉及該錯誤的原始程式碼文字。" -#: ../../library/exceptions.rst:533 +#: ../../library/exceptions.rst:535 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." @@ -801,7 +802,7 @@ msgstr "" "發生錯誤所在檔案的結束列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 " "1。" -#: ../../library/exceptions.rst:538 +#: ../../library/exceptions.rst:540 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." @@ -809,7 +810,7 @@ msgstr "" "發生錯誤所在該結束列的欄號。這是以 1 開始的索引:該列第一個字元的 ``offset`` " "是 1。" -#: ../../library/exceptions.rst:541 +#: ../../library/exceptions.rst:543 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -820,18 +821,18 @@ msgstr "" "(offset) 是從替代表達式建構的文字的偏移量。例如編譯 f'Bad {a b} field' 會得到" "這個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" -#: ../../library/exceptions.rst:546 +#: ../../library/exceptions.rst:548 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:551 +#: ../../library/exceptions.rst:553 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" "與不正確的縮排有關的語法錯誤的基礎類別。這是 :exc:`SyntaxError` 的子類別。" -#: ../../library/exceptions.rst:557 +#: ../../library/exceptions.rst:559 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." @@ -839,7 +840,7 @@ msgstr "" "當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這是 :exc:" "`IndentationError` 的子類別。" -#: ../../library/exceptions.rst:563 +#: ../../library/exceptions.rst:565 #, fuzzy msgid "" "Raised when the interpreter finds an internal error, but the situation does " @@ -851,7 +852,7 @@ msgstr "" "當直譯器找到一個內部錯誤,但該情況看起來沒有嚴重到要讓它放棄所有的希望時會引" "發此例外。關聯值是一個表示什麼地方出錯的字串(以低階的方式表達)。" -#: ../../library/exceptions.rst:569 +#: ../../library/exceptions.rst:571 #, fuzzy msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " @@ -866,7 +867,7 @@ msgstr "" "的版本(``sys.version``;這也會在互動式 Python 會話的開頭被印出)、確切的錯誤" "訊息(該例外的關聯值)及如果可能的話,觸發此錯誤的程式來源。" -#: ../../library/exceptions.rst:580 +#: ../../library/exceptions.rst:582 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -887,7 +888,7 @@ msgstr "" "``None``,結束狀態會是 0;如果它是其他類型(例如字串),則物件的值會被印出而" "結束狀態是 1。" -#: ../../library/exceptions.rst:591 +#: ../../library/exceptions.rst:593 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -901,13 +902,13 @@ msgstr "" "風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." "fork` 之後 )可以使用 :func:`os._exit` 函式。" -#: ../../library/exceptions.rst:600 +#: ../../library/exceptions.rst:602 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" -#: ../../library/exceptions.rst:606 +#: ../../library/exceptions.rst:608 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -916,7 +917,7 @@ msgstr "" "當一個操作或函式被用在不適合的類型的物件時會引發此例外。關聯值是一個字串,提" "供關於不相符類型的細節。" -#: ../../library/exceptions.rst:609 +#: ../../library/exceptions.rst:611 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -927,7 +928,7 @@ msgstr "" "這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" "是 :exc:`NotImplementedError`。" -#: ../../library/exceptions.rst:614 +#: ../../library/exceptions.rst:616 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -938,7 +939,7 @@ msgstr "" "導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" "導致 :exc:`ValueError`。" -#: ../../library/exceptions.rst:621 +#: ../../library/exceptions.rst:623 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" @@ -947,7 +948,7 @@ msgstr "" "當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" "外。這是 :exc:`NameError` 的子類別。" -#: ../../library/exceptions.rst:628 +#: ../../library/exceptions.rst:630 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -955,7 +956,7 @@ msgstr "" "當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" "子類別。" -#: ../../library/exceptions.rst:631 +#: ../../library/exceptions.rst:633 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -964,27 +965,27 @@ msgstr "" ":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" "err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" -#: ../../library/exceptions.rst:637 +#: ../../library/exceptions.rst:639 msgid "The name of the encoding that raised the error." msgstr "引發錯誤的編碼名稱。" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:643 msgid "A string describing the specific codec error." msgstr "描述特定編解碼器錯誤的字串。" -#: ../../library/exceptions.rst:645 +#: ../../library/exceptions.rst:647 msgid "The object the codec was attempting to encode or decode." msgstr "編解碼器嘗試編碼或解碼的物件。" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:651 msgid "The first index of invalid data in :attr:`object`." msgstr "在 :attr:`object` 中無效資料的開始索引。" -#: ../../library/exceptions.rst:653 +#: ../../library/exceptions.rst:655 msgid "The index after the last invalid data in :attr:`object`." msgstr "在 :attr:`object` 中最後的無效資料後的索引。" -#: ../../library/exceptions.rst:658 +#: ../../library/exceptions.rst:660 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -992,7 +993,7 @@ msgstr "" "在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:664 +#: ../../library/exceptions.rst:666 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1000,7 +1001,7 @@ msgstr "" "在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:672 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1008,7 +1009,7 @@ msgstr "" "在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" "類別。" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:678 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1017,7 +1018,7 @@ msgstr "" "當一個操作或函式收到引數是正確類型但是不適合的值,且該情況無法被更精確的例外" "例如 :exc:`IndexError` 所描述時會引發此例外。" -#: ../../library/exceptions.rst:683 +#: ../../library/exceptions.rst:685 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1026,7 +1027,7 @@ msgstr "" "當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" "值是一個字串,表示運算元及運算的類型。" -#: ../../library/exceptions.rst:688 +#: ../../library/exceptions.rst:690 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1034,21 +1035,21 @@ msgstr "" "以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" "`OSError` 的別名。" -#: ../../library/exceptions.rst:697 +#: ../../library/exceptions.rst:699 msgid "Only available on Windows." msgstr "僅限於在 Windows 中使用。" -#: ../../library/exceptions.rst:701 +#: ../../library/exceptions.rst:703 msgid "OS exceptions" msgstr "作業系統例外" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:705 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "以下的例外是 :exc:`OSError` 的子類別,它們根據系統錯誤代碼來引發。" -#: ../../library/exceptions.rst:708 +#: ../../library/exceptions.rst:710 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1059,14 +1060,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EAGAIN`、:py:const:`~errno.EALREADY`、:" "py:const:`~errno.EWOULDBLOCK` 及 :py:const:`~errno.EINPROGRESS`。" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:715 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" "除了 :exc:`OSError` 的那些屬性之外,:exc:`BlockingIOError` 有多一個屬性:" -#: ../../library/exceptions.rst:718 +#: ../../library/exceptions.rst:720 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1075,7 +1076,7 @@ msgstr "" "一個整數,內容為在其阻塞之前,已寫進串流的字元數。當使用 :mod:`io` 模組裡的緩" "衝 I/O 類別時這個屬性是可用的。" -#: ../../library/exceptions.rst:724 +#: ../../library/exceptions.rst:726 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." @@ -1083,11 +1084,11 @@ msgstr "" "當子行程上的操作失敗時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ECHILD`。" -#: ../../library/exceptions.rst:729 +#: ../../library/exceptions.rst:731 msgid "A base class for connection-related issues." msgstr "連線相關問題的基礎類別。" -#: ../../library/exceptions.rst:731 +#: ../../library/exceptions.rst:733 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." @@ -1095,7 +1096,7 @@ msgstr "" "子類別有 :exc:`BrokenPipeError`、:exc:`ConnectionAbortedError`、:exc:" "`ConnectionRefusedError` 及 :exc:`ConnectionResetError`。" -#: ../../library/exceptions.rst:736 +#: ../../library/exceptions.rst:738 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 " @@ -1106,7 +1107,7 @@ msgstr "" "會引發此例外,或者當嘗試寫入已關閉寫入的 socket 時也會引發。對應到 :c:data:" "`errno` :py:const:`~errno.EPIPE` 及 :py:const:`~errno.ESHUTDOWN`。" -#: ../../library/exceptions.rst:743 +#: ../../library/exceptions.rst:745 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1115,7 +1116,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點 (peer) 中斷時會引" "發此例外。對應到 :c:data:`errno` :py:const:`~errno.ECONNABORTED`。" -#: ../../library/exceptions.rst:749 +#: ../../library/exceptions.rst:751 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -1124,7 +1125,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線的嘗試被對等端點拒絕時會引發此例" "外。對應到 :c:data:`errno` :py:const:`~errno.ECONNREFUSED`。" -#: ../../library/exceptions.rst:755 +#: ../../library/exceptions.rst:757 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." @@ -1132,7 +1133,7 @@ msgstr "" ":exc:`ConnectionError` 的子類別。當一個連線被對等端點重置時會引發此例外。對應" "到 :c:data:`errno` :py:const:`~errno.ECONNRESET`。" -#: ../../library/exceptions.rst:761 +#: ../../library/exceptions.rst:763 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." @@ -1140,7 +1141,7 @@ msgstr "" "當嘗試建立已存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EEXIST`。" -#: ../../library/exceptions.rst:766 +#: ../../library/exceptions.rst:768 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." @@ -1148,7 +1149,7 @@ msgstr "" "當請求不存在的檔案或目錄時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ENOENT`。" -#: ../../library/exceptions.rst:771 +#: ../../library/exceptions.rst:773 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." @@ -1156,7 +1157,7 @@ msgstr "" "當系統呼叫被傳入的信號中斷時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.EINTR`。" -#: ../../library/exceptions.rst:774 +#: ../../library/exceptions.rst:776 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " @@ -1165,7 +1166,7 @@ msgstr "" "現在當 syscall 被信號中斷時 Python 會重試系統呼叫而不會引發 :exc:" "`InterruptedError`,除非信號處理器引發例外(理由可參考 :pep:`475`)。" -#: ../../library/exceptions.rst:781 +#: ../../library/exceptions.rst:783 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." @@ -1173,7 +1174,7 @@ msgstr "" "當在目錄上請求檔案操作(例如 :func:`os.remove`)時會引發此例外。對應到 :c:" "data:`errno` :py:const:`~errno.EISDIR`。" -#: ../../library/exceptions.rst:787 +#: ../../library/exceptions.rst:789 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 " @@ -1185,7 +1186,7 @@ msgstr "" "外。在大多數的 POSIX 平台上,如果嘗試操作開啟或遍歷一個當作目錄的非目錄檔案也" "會引發此例外。對應到 :c:data:`errno` :py:const:`~errno.ENOTDIR`。" -#: ../../library/exceptions.rst:795 +#: ../../library/exceptions.rst:797 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -1196,14 +1197,14 @@ msgstr "" "到 :c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno.EPERM` 及 :" "py:const:`~errno.ENOTCAPABLE`。" -#: ../../library/exceptions.rst:800 +#: ../../library/exceptions.rst:802 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" "WASI 的 :py:const:`~errno.ENOTCAPABLE` 現在對應到 :exc:`PermissionError`。" -#: ../../library/exceptions.rst:806 +#: ../../library/exceptions.rst:808 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." @@ -1211,7 +1212,7 @@ msgstr "" "當給定的行程不存在時會引發此例外。對應到 :c:data:`errno` :py:const:`~errno." "ESRCH`。" -#: ../../library/exceptions.rst:811 +#: ../../library/exceptions.rst:813 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." @@ -1219,40 +1220,40 @@ msgstr "" "當系統函式在系統層級超時會引發此例外。對應到 :c:data:`errno` :py:const:" "`~errno.ETIMEDOUT`。" -#: ../../library/exceptions.rst:814 +#: ../../library/exceptions.rst:816 msgid "All the above :exc:`OSError` subclasses were added." msgstr "加入以上所有的 :exc:`OSError` 子類別。" -#: ../../library/exceptions.rst:820 +#: ../../library/exceptions.rst:822 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` — 改寫作業系統與 IO 例外階層" -#: ../../library/exceptions.rst:826 +#: ../../library/exceptions.rst:828 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:830 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" "以下的例外是當作警告的種類使用;更多細節參考 :ref:`warning-categories` 文件。" -#: ../../library/exceptions.rst:833 +#: ../../library/exceptions.rst:835 msgid "Base class for warning categories." msgstr "警告種類的基礎類別。" -#: ../../library/exceptions.rst:838 +#: ../../library/exceptions.rst:840 msgid "Base class for warnings generated by user code." msgstr "使用者程式碼產生的警告的基礎類別。" -#: ../../library/exceptions.rst:843 +#: ../../library/exceptions.rst:845 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "關於已棄用功能的警告的基礎類別,且當那些警告是針對其他 Python 開發者。" -#: ../../library/exceptions.rst:846 +#: ../../library/exceptions.rst:848 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode <devmode>` shows this " @@ -1261,17 +1262,17 @@ msgstr "" "會被預設的警告過濾器忽略,在 ``__main__`` 模組裡除外 (:pep:`565`)。啟用 :ref:" "`Python 開發模式 <devmode>`\\ 會顯示此警告。" -#: ../../library/exceptions.rst:850 ../../library/exceptions.rst:866 +#: ../../library/exceptions.rst:852 ../../library/exceptions.rst:868 msgid "The deprecation policy is described in :pep:`387`." msgstr "棄用原則描述在 :pep:`387` 裡。" -#: ../../library/exceptions.rst:855 +#: ../../library/exceptions.rst:857 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "關於過時且預期未來要被棄用,但目前尚未被棄用的功能的警告的基礎類別。" -#: ../../library/exceptions.rst:859 +#: ../../library/exceptions.rst:861 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1280,8 +1281,8 @@ msgstr "" "因為發出關於可能即將被棄用的警告是不尋常的,此類別很少被使用,而對已經被棄用" "的情況會優先使用 :exc:`DeprecationWarning`。" -#: ../../library/exceptions.rst:863 ../../library/exceptions.rst:889 -#: ../../library/exceptions.rst:916 +#: ../../library/exceptions.rst:865 ../../library/exceptions.rst:891 +#: ../../library/exceptions.rst:918 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode <devmode>` shows this warning." @@ -1289,15 +1290,15 @@ msgstr "" "會被預設的警告過濾器忽略。啟用 :ref:`Python 開發模式 <devmode>`\\ 會顯示此警" "告。" -#: ../../library/exceptions.rst:871 +#: ../../library/exceptions.rst:873 msgid "Base class for warnings about dubious syntax." msgstr "關於可疑語法的警告的基礎類別。" -#: ../../library/exceptions.rst:876 +#: ../../library/exceptions.rst:878 msgid "Base class for warnings about dubious runtime behavior." msgstr "關於可疑執行環境行為的警告的基礎類別。" -#: ../../library/exceptions.rst:881 +#: ../../library/exceptions.rst:883 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1305,36 +1306,36 @@ msgstr "" "關於已棄用功能的警告的基礎類別,且當那些警告是針對以 Python 寫的應用程式的終" "端使用者。" -#: ../../library/exceptions.rst:887 +#: ../../library/exceptions.rst:889 msgid "Base class for warnings about probable mistakes in module imports." msgstr "關於在模組引入的可能錯誤的警告的基礎類別。" -#: ../../library/exceptions.rst:895 +#: ../../library/exceptions.rst:897 msgid "Base class for warnings related to Unicode." msgstr "Unicode 相關警告的基礎類別。" -#: ../../library/exceptions.rst:900 +#: ../../library/exceptions.rst:902 msgid "Base class for warnings related to encodings." msgstr "編碼相關警告的基礎類別。" -#: ../../library/exceptions.rst:902 +#: ../../library/exceptions.rst:904 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節參考\\ :ref:`io-encoding-warning`。" -#: ../../library/exceptions.rst:909 +#: ../../library/exceptions.rst:911 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` 及 :class:`bytearray` 相關警告的基礎類別。" -#: ../../library/exceptions.rst:914 +#: ../../library/exceptions.rst:916 msgid "Base class for warnings related to resource usage." msgstr "資源用法相關警告的基礎類別。" -#: ../../library/exceptions.rst:925 +#: ../../library/exceptions.rst:927 msgid "Exception groups" msgstr "例外群組" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:929 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 " @@ -1346,7 +1347,7 @@ msgstr "" "所有其他例外一樣使用 :keyword:`except` 來處理。此外,它們會以包含的例外類型為" "基礎來比對其子群組而被 :keyword:`except*<except_star>` 辨認出來。" -#: ../../library/exceptions.rst:936 +#: ../../library/exceptions.rst:938 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 " @@ -1362,7 +1363,7 @@ msgstr "" "`Exception` 的子類別。這個設計使得 ``except Exception`` 可以捕捉 :exc:" "`ExceptionGroup` 但不能捕捉 :exc:`BaseExceptionGroup`。" -#: ../../library/exceptions.rst:944 +#: ../../library/exceptions.rst:946 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1375,17 +1376,17 @@ msgstr "" "使用來讓這樣的選擇自動化。另一方面來說,如果任何包含的例外不是 :exc:" "`Exception` 的子類別,:exc:`ExceptionGroup` 建構函式會引發 :exc:`TypeError`。" -#: ../../library/exceptions.rst:953 +#: ../../library/exceptions.rst:955 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "建構函式的 ``msg`` 引數。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:957 +#: ../../library/exceptions.rst:959 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "指定給建構函式 ``excs`` 序列中的例外組成的元組。這是一個唯讀的屬性。" -#: ../../library/exceptions.rst:962 +#: ../../library/exceptions.rst:964 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." @@ -1393,7 +1394,7 @@ msgstr "" "回傳只包含從現有群組比對到 *condition* 的例外的例外群組,或者當結果為空時回" "傳 ``None``。" -#: ../../library/exceptions.rst:965 +#: ../../library/exceptions.rst:967 msgid "" "The condition can be an exception type or tuple of exception types, in which " "case each exception is checked for a match using the same check that is used " @@ -1402,7 +1403,7 @@ msgid "" "true for the exceptions that should be in the subgroup." msgstr "" -#: ../../library/exceptions.rst:971 +#: ../../library/exceptions.rst:973 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1415,7 +1416,7 @@ msgstr "" "__context__` 及 :attr:`~BaseException.__notes__` 欄位的值也一樣。空的巢狀群組" "會從結果裡排除。" -#: ../../library/exceptions.rst:978 +#: ../../library/exceptions.rst:980 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 " @@ -1424,11 +1425,11 @@ msgstr "" "條件會對巢狀例外群組裡的所有例外做檢查,包括頂層及任何巢狀的例外群組。如果條" "件對這樣的例外群組為 true,它會被完整包含在結果裡。" -#: ../../library/exceptions.rst:982 +#: ../../library/exceptions.rst:984 msgid "``condition`` can be any callable which is not a type object." msgstr "" -#: ../../library/exceptions.rst:987 +#: ../../library/exceptions.rst:989 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" @@ -1437,13 +1438,13 @@ msgstr "" "像 :meth:`subgroup` 一樣,但回傳一對 ``(match, rest)``,其中 ``match`` 是 " "``subgroup(condition)`` 而 ``rest`` 是剩下沒有比對到的部分。" -#: ../../library/exceptions.rst:993 +#: ../../library/exceptions.rst:995 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "回傳有相同 :attr:`message` 但將例外包裝在 ``excs`` 的例外群組。" -#: ../../library/exceptions.rst:996 +#: ../../library/exceptions.rst:998 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1454,7 +1455,7 @@ msgstr "" "組。子類別需要覆寫它來讓 :meth:`subgroup` 及 :meth:`split` 回傳子類別而不是 :" "exc:`ExceptionGroup` 的實例。" -#: ../../library/exceptions.rst:1002 +#: ../../library/exceptions.rst:1004 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1467,7 +1468,7 @@ msgstr "" "`~BaseException.__context__` 和 :attr:`~BaseException.__notes__` 欄位到 :" "meth:`derive` 所回傳的例外群組上,因此這些欄位不需要被 :meth:`derive` 更新。" -#: ../../library/exceptions.rst:1009 +#: ../../library/exceptions.rst:1011 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1521,7 +1522,7 @@ msgstr "" ">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" "True" -#: ../../library/exceptions.rst:1035 +#: ../../library/exceptions.rst:1037 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1533,7 +1534,7 @@ msgstr "" "建構函式簽名的子類別需要覆寫它而不是 :meth:`~object.__init__`。例如下面定義了" "一個例外群組子類別接受 exit_code 並從中建構群組的訊息。: ::" -#: ../../library/exceptions.rst:1041 +#: ../../library/exceptions.rst:1043 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1553,7 +1554,7 @@ msgstr "" " def derive(self, excs):\n" " return Errors(excs, self.exit_code)" -#: ../../library/exceptions.rst:1050 +#: ../../library/exceptions.rst:1052 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" @@ -1562,15 +1563,15 @@ msgstr "" "像 :exc:`ExceptionGroup` 一樣,任何 :exc:`BaseExceptionGroup` 的子類別且也" "是 :exc:`Exception` 的子類別只能包裝 :exc:`Exception` 的實例。" -#: ../../library/exceptions.rst:1058 +#: ../../library/exceptions.rst:1060 msgid "Exception hierarchy" msgstr "例外階層" -#: ../../library/exceptions.rst:1060 +#: ../../library/exceptions.rst:1062 msgid "The class hierarchy for built-in exceptions is:" msgstr "內建例外的類別階層如下:" -#: ../../library/exceptions.rst:1062 +#: ../../library/exceptions.rst:1064 #, fuzzy msgid "" "BaseException\n" @@ -1751,11 +1752,11 @@ msgstr "__suppress_context__(例外屬性)" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:345 +#: ../../library/exceptions.rst:347 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:345 +#: ../../library/exceptions.rst:347 msgid "errno" msgstr "errno" diff --git a/library/filecmp.po b/library/filecmp.po index ca8839f45d..ec971e6a84 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -242,6 +242,7 @@ msgid "" msgstr "" #: ../../library/filecmp.rst:202 +#, fuzzy msgid "" ">>> from filecmp import dircmp\n" ">>> def print_diff_files(dcmp):\n" @@ -251,8 +252,8 @@ msgid "" "... for sub_dcmp in dcmp.subdirs.values():\n" "... print_diff_files(sub_dcmp)\n" "...\n" -">>> dcmp = dircmp('dir1', 'dir2') \n" -">>> print_diff_files(dcmp) " +">>> dcmp = dircmp('dir1', 'dir2')\n" +">>> print_diff_files(dcmp)" msgstr "" ">>> from filecmp import dircmp\n" ">>> def print_diff_files(dcmp):\n" diff --git a/library/functions.po b/library/functions.po index 1ea494ad91..18be988f8c 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu <y9760210@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1763,10 +1763,11 @@ msgstr "" "則引發 :exc:`EOFError`。例如: ::" #: ../../library/functions.rst:973 +#, fuzzy msgid "" -">>> s = input('--> ') \n" +">>> s = input('--> ')\n" "--> Monty Python's Flying Circus\n" -">>> s \n" +">>> s\n" "\"Monty Python's Flying Circus\"" msgstr "" ">>> s = input('--> ') \n" diff --git a/library/idle.po b/library/idle.po index 7342a0c8ae..0b12e97bc4 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1165,57 +1165,86 @@ msgstr "" msgid "Command line usage" msgstr "命令列用法" -#: ../../library/idle.rst:663 +#: ../../library/idle.rst:665 msgid "" -"idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] " -"[arg] ...\n" -"\n" -"-c command run command in the shell window\n" -"-d enable debugger and open shell window\n" -"-e open editor window\n" -"-h print help message with legal combinations and exit\n" -"-i open shell window\n" -"-r file run file in shell window\n" -"-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window\n" -"-t title set title of shell window\n" -"- run stdin in shell (- must be last option before args)" +"IDLE can be invoked from the command line with various options. The general " +"syntax is:" msgstr "" -"idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] " -"[arg] ...\n" -"\n" -"-c command run command in the shell window\n" -"-d enable debugger and open shell window\n" -"-e open editor window\n" -"-h print help message with legal combinations and exit\n" -"-i open shell window\n" -"-r file run file in shell window\n" -"-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window\n" -"-t title set title of shell window\n" -"- run stdin in shell (- must be last option before args)" -#: ../../library/idle.rst:677 -msgid "If there are arguments:" +#: ../../library/idle.rst:667 +msgid "python -m idlelib [options] [file ...]" msgstr "" -#: ../../library/idle.rst:679 +#: ../../library/idle.rst:671 +msgid "The following options are available:" +msgstr "" + +#: ../../library/idle.rst:675 +msgid "" +"Run the specified Python command in the shell window. For example, pass ``-c " +"\"print('Hello, World!')\"``. On Windows, the outer quotes must be double " +"quotes as shown." +msgstr "" + +#: ../../library/idle.rst:681 +msgid "Enable the debugger and open the shell window." +msgstr "" + +#: ../../library/idle.rst:685 +msgid "Open an editor window." +msgstr "" + +#: ../../library/idle.rst:689 +msgid "Print a help message with legal combinations of options and exit." +msgstr "" + +#: ../../library/idle.rst:693 +msgid "Open a shell window." +msgstr "" + +#: ../../library/idle.rst:697 +msgid "Run the specified file in the shell window." +msgstr "" + +#: ../../library/idle.rst:701 +msgid "" +"Run the startup file (as defined by the environment variables :envvar:" +"`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`) before opening the shell window." +msgstr "" + +#: ../../library/idle.rst:705 +msgid "Set the title of the shell window." +msgstr "" + +#: ../../library/idle.rst:709 msgid "" -"If ``-``, ``-c``, or ``r`` is used, all arguments are placed in ``sys." -"argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'``. " -"No editor window is opened, even if that is the default set in the Options " -"dialog." +"Read and execute standard input in the shell window. This option must be the " +"last one before any arguments." +msgstr "" + +#: ../../library/idle.rst:711 +msgid "If arguments are provided:" msgstr "" -#: ../../library/idle.rst:684 +#: ../../library/idle.rst:713 msgid "" -"Otherwise, arguments are files opened for editing and ``sys.argv`` reflects " -"the arguments passed to IDLE itself." +"If ``-``, ``-c``, or ``-r`` is used, all arguments are placed in ``sys." +"argv[1:]``, and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'`` " +"respectively. No editor window is opened, even if that is the default set in " +"the *Options* dialog." msgstr "" -#: ../../library/idle.rst:688 +#: ../../library/idle.rst:716 +msgid "" +"Otherwise, arguments are treated as files to be opened for editing, and " +"``sys.argv`` reflects the arguments passed to IDLE itself." +msgstr "" + +#: ../../library/idle.rst:720 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:690 +#: ../../library/idle.rst:722 msgid "" "IDLE uses a socket to communicate between the IDLE GUI process and the user " "code execution process. A connection must be established whenever the Shell " @@ -1225,7 +1254,7 @@ msgid "" "directs the user here. It then exits." msgstr "" -#: ../../library/idle.rst:697 +#: ../../library/idle.rst:729 msgid "" "One specific connection failure on Unix systems results from misconfigured " "masquerading rules somewhere in a system's network setup. When IDLE is " @@ -1235,7 +1264,7 @@ msgid "" "``tcplisten <same args>`` in another." msgstr "" -#: ../../library/idle.rst:705 +#: ../../library/idle.rst:737 msgid "" "A common cause of failure is a user-written file with the same name as a " "standard library module, such as *random.py* and *tkinter.py*. When such a " @@ -1244,7 +1273,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:711 +#: ../../library/idle.rst:743 msgid "" "Though less common than in the past, an antivirus or firewall program may " "stop the connection. If the program cannot be taught to allow the " @@ -1254,7 +1283,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:718 +#: ../../library/idle.rst:750 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1262,7 +1291,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:723 +#: ../../library/idle.rst:755 msgid "" "A zombie pythonw.exe process could be a problem. On Windows, use Task " "Manager to check for one and stop it if there is. Sometimes a restart " @@ -1271,7 +1300,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:729 +#: ../../library/idle.rst:761 msgid "" "When IDLE first starts, it attempts to read user configuration files in ``~/." "idlerc/`` (~ is one's home directory). If there is a problem, an error " @@ -1282,14 +1311,14 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:737 +#: ../../library/idle.rst:769 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:741 +#: ../../library/idle.rst:773 msgid "" "On Unix-based systems with tcl/tk older than ``8.6.11`` (see ``About IDLE``) " "certain characters of certain fonts can cause a tk failure with a message to " @@ -1298,11 +1327,11 @@ msgid "" "upgrade tcl/tk, then re-configure IDLE to use a font that works better." msgstr "" -#: ../../library/idle.rst:749 +#: ../../library/idle.rst:781 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:751 +#: ../../library/idle.rst:783 msgid "" "With rare exceptions, the result of executing Python code with IDLE is " "intended to be the same as executing the same code by the default method, " @@ -1312,7 +1341,7 @@ msgid "" "``threading.active_count()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:758 +#: ../../library/idle.rst:790 msgid "" "By default, IDLE runs user code in a separate OS process rather than in the " "user interface process that runs the shell and editor. In the execution " @@ -1322,7 +1351,7 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:765 +#: ../../library/idle.rst:797 msgid "" "Sending print output from one process to a text widget in another is slower " "than printing to a system terminal in the same process. This has the most " @@ -1334,7 +1363,7 @@ msgid "" "fields and lines." msgstr "" -#: ../../library/idle.rst:774 +#: ../../library/idle.rst:806 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1345,14 +1374,14 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:783 +#: ../../library/idle.rst:815 msgid "" "If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " "IDLE's changes are lost and input from the keyboard and output to the screen " "will not work correctly." msgstr "" -#: ../../library/idle.rst:787 +#: ../../library/idle.rst:819 msgid "" "When Shell has the focus, it controls the keyboard and screen. This is " "normally transparent, but functions that directly access the keyboard and " @@ -1360,7 +1389,7 @@ msgid "" "determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:792 +#: ../../library/idle.rst:824 msgid "" "The IDLE code running in the execution process adds frames to the call stack " "that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and " @@ -1368,17 +1397,17 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:797 +#: ../../library/idle.rst:829 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:801 +#: ../../library/idle.rst:833 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:803 +#: ../../library/idle.rst:835 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1388,7 +1417,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:810 +#: ../../library/idle.rst:842 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1397,7 +1426,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:816 +#: ../../library/idle.rst:848 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1411,7 +1440,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:826 +#: ../../library/idle.rst:858 msgid "" ">>> s = 'a\\tb\\a<\\x02><\\r>\\bc\\nd' # Enter 22 chars.\n" ">>> len(s)\n" @@ -1422,7 +1451,7 @@ msgid "" "# Result varies by OS and font. Try it." msgstr "" -#: ../../library/idle.rst:834 +#: ../../library/idle.rst:866 msgid "" "The ``repr`` function is used for interactive echo of expression values. It " "returns an altered version of the input string in which control codes, some " @@ -1431,13 +1460,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:840 +#: ../../library/idle.rst:872 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:843 +#: ../../library/idle.rst:875 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1446,7 +1475,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:849 +#: ../../library/idle.rst:881 msgid "" "Shell has a special facility for squeezing output lines down to a 'Squeezed " "text' label. This is done automatically for output over N lines (N = 50 by " @@ -1455,18 +1484,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:857 +#: ../../library/idle.rst:889 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:862 +#: ../../library/idle.rst:894 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:864 +#: ../../library/idle.rst:896 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1478,7 +1507,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:873 +#: ../../library/idle.rst:905 msgid "" "Most tkinter programs run ``root.mainloop()``, which usually does not return " "until the tk app is destroyed. If the program is run with ``python -i`` or " @@ -1486,7 +1515,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:879 +#: ../../library/idle.rst:911 msgid "" "When running a tkinter program from an IDLE editor, one can comment out the " "mainloop call. One then gets a shell prompt immediately and can interact " @@ -1494,11 +1523,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:885 +#: ../../library/idle.rst:917 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:887 +#: ../../library/idle.rst:919 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1506,7 +1535,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:892 +#: ../../library/idle.rst:924 msgid "" "If the attempt to make the socket connection fails, Idle will notify you. " "Such failures are sometimes transient, but if persistent, the problem may be " @@ -1515,7 +1544,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:898 +#: ../../library/idle.rst:930 msgid "" "If IDLE is started with the -n command line switch it will run in a single " "process and will not create the subprocess which runs the RPC Python " @@ -1529,15 +1558,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:913 +#: ../../library/idle.rst:945 msgid "Help and Preferences" msgstr "" -#: ../../library/idle.rst:918 +#: ../../library/idle.rst:950 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:920 +#: ../../library/idle.rst:952 msgid "" "Help menu entry \"IDLE Help\" displays a formatted html version of the IDLE " "chapter of the Library Reference. The result, in a read-only tkinter text " @@ -1547,7 +1576,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:928 +#: ../../library/idle.rst:960 msgid "" "Help menu entry \"Python Docs\" opens the extensive sources of help, " "including tutorials, available at ``docs.python.org/x.y``, where 'x.y' is " @@ -1556,17 +1585,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:934 +#: ../../library/idle.rst:966 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:940 +#: ../../library/idle.rst:972 msgid "Setting preferences" msgstr "" -#: ../../library/idle.rst:942 +#: ../../library/idle.rst:974 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1575,7 +1604,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:948 +#: ../../library/idle.rst:980 msgid "" "On the Font tab, see the text sample for the effect of font face and size on " "multiple characters in multiple languages. Edit the sample to add other " @@ -1584,7 +1613,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:955 +#: ../../library/idle.rst:987 msgid "" "On the Highlights and Keys tab, select a built-in or custom color theme and " "key set. To use a newer built-in color theme or key set with older IDLEs, " @@ -1592,22 +1621,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:961 +#: ../../library/idle.rst:993 msgid "IDLE on macOS" msgstr "" -#: ../../library/idle.rst:963 +#: ../../library/idle.rst:995 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:968 +#: ../../library/idle.rst:1000 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:970 +#: ../../library/idle.rst:1002 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " @@ -1616,21 +1645,21 @@ msgid "" "testing." msgstr "" -#: ../../library/idle.rst:978 +#: ../../library/idle.rst:1010 msgid "idlelib --- implementation of IDLE application" msgstr "" -#: ../../library/idle.rst:983 +#: ../../library/idle.rst:1015 msgid "**Source code:** :source:`Lib/idlelib`" msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" -#: ../../library/idle.rst:987 +#: ../../library/idle.rst:1019 msgid "" "The Lib/idlelib package implements the IDLE application. See the rest of " "this page for how to use IDLE." msgstr "" -#: ../../library/idle.rst:990 +#: ../../library/idle.rst:1022 msgid "" "The files in idlelib are described in idlelib/README.txt. Access it either " "in idlelib or click Help => About IDLE on the IDLE menu. This file also " @@ -1675,5 +1704,32 @@ msgstr "stack viewer(堆疊檢視器)" msgid "breakpoints" msgstr "breakpoints(中斷點)" +#~ msgid "" +#~ "idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] " +#~ "[arg] ...\n" +#~ "\n" +#~ "-c command run command in the shell window\n" +#~ "-d enable debugger and open shell window\n" +#~ "-e open editor window\n" +#~ "-h print help message with legal combinations and exit\n" +#~ "-i open shell window\n" +#~ "-r file run file in shell window\n" +#~ "-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window\n" +#~ "-t title set title of shell window\n" +#~ "- run stdin in shell (- must be last option before args)" +#~ msgstr "" +#~ "idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] " +#~ "[arg] ...\n" +#~ "\n" +#~ "-c command run command in the shell window\n" +#~ "-d enable debugger and open shell window\n" +#~ "-e open editor window\n" +#~ "-h print help message with legal combinations and exit\n" +#~ "-i open shell window\n" +#~ "-r file run file in shell window\n" +#~ "-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window\n" +#~ "-t title set title of shell window\n" +#~ "- run stdin in shell (- must be last option before args)" + #~ msgid "idlelib" #~ msgstr "idlelib" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index ee1707329b..8653877ea5 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -111,10 +111,11 @@ msgid "You can get the version string for ``wheel`` by running the following:" msgstr "" #: ../../library/importlib.metadata.rst:82 +#, fuzzy msgid "" "(example) $ python\n" -">>> from importlib.metadata import version \n" -">>> version('wheel') \n" +">>> from importlib.metadata import version\n" +">>> version('wheel')\n" "'0.32.3'" msgstr "" "(example) $ python\n" @@ -135,8 +136,9 @@ msgid "You can get the :ref:`metadata for a distribution <metadata>`::" msgstr "" #: ../../library/importlib.metadata.rst:95 +#, fuzzy msgid "" -">>> list(metadata('wheel')) \n" +">>> list(metadata('wheel'))\n" "['Metadata-Version', 'Name', 'Version', 'Summary', 'Home-page', 'Author', " "'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Project-URL', " "'Project-URL', 'Project-URL', 'Keywords', 'Platform', 'Classifier', " @@ -225,7 +227,8 @@ msgid "Query all entry points::" msgstr "" #: ../../library/importlib.metadata.rst:152 -msgid ">>> eps = entry_points() " +#, fuzzy +msgid ">>> eps = entry_points()" msgstr ">>> eps = entry_points() " #: ../../library/importlib.metadata.rst:154 @@ -236,8 +239,9 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:158 +#, fuzzy msgid "" -">>> sorted(eps.groups) \n" +">>> sorted(eps.groups)\n" "['console_scripts', 'distutils.commands', 'distutils.setup_keywords', " "'egg_info.writers', 'setuptools.installation']" msgstr "" @@ -253,7 +257,8 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:165 -msgid ">>> scripts = eps.select(group='console_scripts') " +#, fuzzy +msgid ">>> scripts = eps.select(group='console_scripts')" msgstr ">>> scripts = eps.select(group='console_scripts') " #: ../../library/importlib.metadata.rst:167 @@ -263,7 +268,8 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:170 -msgid ">>> scripts = entry_points(group='console_scripts') " +#, fuzzy +msgid ">>> scripts = entry_points(group='console_scripts')" msgstr ">>> scripts = entry_points(group='console_scripts') " #: ../../library/importlib.metadata.rst:172 @@ -272,10 +278,11 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:174 +#, fuzzy msgid "" -">>> 'wheel' in scripts.names \n" +">>> 'wheel' in scripts.names\n" "True\n" -">>> wheel = scripts['wheel'] " +">>> wheel = scripts['wheel']" msgstr "" ">>> 'wheel' in scripts.names \n" "True\n" @@ -286,9 +293,10 @@ msgid "Equivalently, query for that entry point during selection::" msgstr "" #: ../../library/importlib.metadata.rst:180 +#, fuzzy msgid "" -">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" -">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " +">>> (wheel,) = entry_points(group='console_scripts', name='wheel')\n" +">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel')" msgstr "" ">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" ">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " @@ -298,17 +306,18 @@ msgid "Inspect the resolved entry point::" msgstr "" #: ../../library/importlib.metadata.rst:185 +#, fuzzy msgid "" -">>> wheel \n" +">>> wheel\n" "EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')\n" -">>> wheel.module \n" +">>> wheel.module\n" "'wheel.cli'\n" -">>> wheel.attr \n" +">>> wheel.attr\n" "'main'\n" -">>> wheel.extras \n" +">>> wheel.extras\n" "[]\n" -">>> main = wheel.load() \n" -">>> main \n" +">>> main = wheel.load()\n" +">>> main\n" "<function main at 0x103528488>" msgstr "" ">>> wheel \n" @@ -359,10 +368,10 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:226 -#: ../../library/importlib.metadata.rst:274 -#: ../../library/importlib.metadata.rst:295 -#: ../../library/importlib.metadata.rst:358 -#: ../../library/importlib.metadata.rst:409 +#: ../../library/importlib.metadata.rst:275 +#: ../../library/importlib.metadata.rst:296 +#: ../../library/importlib.metadata.rst:359 +#: ../../library/importlib.metadata.rst:410 msgid "" "Raises :exc:`PackageNotFoundError` if the named distribution package is not " "installed in the current Python environment." @@ -389,7 +398,8 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:240 -msgid ">>> wheel_metadata = metadata('wheel') " +#, fuzzy +msgid ">>> wheel_metadata = metadata('wheel')" msgstr ">>> wheel_metadata = metadata('wheel') " #: ../../library/importlib.metadata.rst:242 @@ -399,8 +409,9 @@ msgid "" msgstr "" #: ../../library/importlib.metadata.rst:245 +#, fuzzy msgid "" -">>> wheel_metadata['Requires-Python'] \n" +">>> wheel_metadata['Requires-Python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" msgstr "" ">>> wheel_metadata['Requires-Python'] \n" @@ -421,7 +432,7 @@ msgstr "" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" #: ../../library/importlib.metadata.rst:254 -#: ../../library/importlib.metadata.rst:452 +#: ../../library/importlib.metadata.rst:453 msgid "" "The full set of available metadata is not described here. See the PyPA `Core " "metadata specification <https://packaging.python.org/en/latest/" @@ -444,49 +455,51 @@ msgstr "" #: ../../library/importlib.metadata.rst:271 msgid "" -"Return the installed distribution package version for the named distribution " -"package." +"Return the installed distribution package `version <https://packaging.python." +"org/en/latest/specifications/core-metadata/#version>`__ for the named " +"distribution package." msgstr "" -#: ../../library/importlib.metadata.rst:277 +#: ../../library/importlib.metadata.rst:278 msgid "" "The :func:`!version` function is the quickest way to get a `Distribution " "Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-" "Package>`_'s version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:281 +#: ../../library/importlib.metadata.rst:282 +#, fuzzy msgid "" -">>> version('wheel') \n" +">>> version('wheel')\n" "'0.32.3'" msgstr "" ">>> version('wheel') \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:288 +#: ../../library/importlib.metadata.rst:289 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:292 +#: ../../library/importlib.metadata.rst:293 msgid "" "Return the full set of files contained within the named distribution package." msgstr "" -#: ../../library/importlib.metadata.rst:298 +#: ../../library/importlib.metadata.rst:299 msgid "" "Returns :const:`None` if the distribution is found but the installation " "database records reporting the files associated with the distribuion package " "are missing." msgstr "" -#: ../../library/importlib.metadata.rst:304 +#: ../../library/importlib.metadata.rst:305 msgid "" "A :class:`pathlib.PurePath` derived object with additional ``dist``, " "``size``, and ``hash`` properties corresponding to the distribution " "package's installation metadata for that file." msgstr "" -#: ../../library/importlib.metadata.rst:308 +#: ../../library/importlib.metadata.rst:309 msgid "" "The :func:`!files` function takes a `Distribution Package <https://packaging." "python.org/en/latest/glossary/#term-Distribution-Package>`_ name and returns " @@ -494,16 +507,17 @@ msgid "" "class:`PackagePath` instance. For example::" msgstr "" -#: ../../library/importlib.metadata.rst:313 +#: ../../library/importlib.metadata.rst:314 +#, fuzzy msgid "" -">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0] \n" -">>> util \n" +">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0]\n" +">>> util\n" "PackagePath('wheel/util.py')\n" -">>> util.size \n" +">>> util.size\n" "859\n" -">>> util.dist \n" +">>> util.dist\n" "<importlib.metadata._hooks.PathDistribution object at 0x101e0cef0>\n" -">>> util.hash \n" +">>> util.hash\n" "<FileHash mode: sha256 value: bYkw5oMccfazVCoYQwKkkemoVyMAFoR34mmKBx8R1NI>" msgstr "" ">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0] \n" @@ -516,13 +530,14 @@ msgstr "" ">>> util.hash \n" "<FileHash mode: sha256 value: bYkw5oMccfazVCoYQwKkkemoVyMAFoR34mmKBx8R1NI>" -#: ../../library/importlib.metadata.rst:323 +#: ../../library/importlib.metadata.rst:324 msgid "Once you have the file, you can also read its contents::" msgstr "" -#: ../../library/importlib.metadata.rst:325 +#: ../../library/importlib.metadata.rst:326 +#, fuzzy msgid "" -">>> print(util.read_text()) \n" +">>> print(util.read_text())\n" "import base64\n" "import sys\n" "...\n" @@ -540,21 +555,22 @@ msgstr "" " return s.encode('utf-8')\n" " return s" -#: ../../library/importlib.metadata.rst:334 +#: ../../library/importlib.metadata.rst:335 msgid "" "You can also use the :meth:`!locate` method to get the absolute path to the " "file::" msgstr "" -#: ../../library/importlib.metadata.rst:337 +#: ../../library/importlib.metadata.rst:338 +#, fuzzy msgid "" -">>> util.locate() \n" +">>> util.locate()\n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" msgstr "" ">>> util.locate() \n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" -#: ../../library/importlib.metadata.rst:340 +#: ../../library/importlib.metadata.rst:341 msgid "" "In the case where the metadata file listing files (``RECORD`` or ``SOURCES." "txt``) is missing, :func:`!files` will return :const:`None`. The caller may " @@ -564,49 +580,50 @@ msgid "" "distribution is not known to have the metadata present." msgstr "" -#: ../../library/importlib.metadata.rst:351 +#: ../../library/importlib.metadata.rst:352 msgid "Distribution requirements" msgstr "" -#: ../../library/importlib.metadata.rst:355 +#: ../../library/importlib.metadata.rst:356 msgid "" "Return the declared dependency specifiers for the named distribution package." msgstr "" -#: ../../library/importlib.metadata.rst:361 +#: ../../library/importlib.metadata.rst:362 msgid "" "To get the full set of requirements for a `Distribution Package <https://" "packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_, use " "the :func:`!requires` function::" msgstr "" -#: ../../library/importlib.metadata.rst:365 +#: ../../library/importlib.metadata.rst:366 +#, fuzzy msgid "" -">>> requires('wheel') \n" +">>> requires('wheel')\n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" msgstr "" ">>> requires('wheel') \n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" -#: ../../library/importlib.metadata.rst:373 +#: ../../library/importlib.metadata.rst:374 msgid "Mapping import to distribution packages" msgstr "" -#: ../../library/importlib.metadata.rst:377 +#: ../../library/importlib.metadata.rst:378 msgid "" "Return a mapping from the top level module and import package names found " "via :data:`sys.meta_path` to the names of the distribution packages (if any) " "that provide the corresponding files." msgstr "" -#: ../../library/importlib.metadata.rst:381 +#: ../../library/importlib.metadata.rst:382 msgid "" "To allow for namespace packages (which may have members provided by multiple " "distribution packages), each top level import name maps to a list of " "distribution names rather than mapping directly to a single name." msgstr "" -#: ../../library/importlib.metadata.rst:385 +#: ../../library/importlib.metadata.rst:386 msgid "" "A convenience method to resolve the `Distribution Package <https://packaging." "python.org/en/latest/glossary/#term-Distribution-Package>`_ name (or names, " @@ -615,7 +632,7 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: ../../library/importlib.metadata.rst:390 +#: ../../library/importlib.metadata.rst:391 msgid "" ">>> packages_distributions()\n" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " @@ -625,35 +642,35 @@ msgstr "" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " "['jaraco.classes', 'jaraco.functools'], ...}" -#: ../../library/importlib.metadata.rst:393 +#: ../../library/importlib.metadata.rst:394 msgid "" "Some editable installs, `do not supply top-level names <https://github.com/" "pypa/packaging-problems/issues/609>`_, and thus this function is not " "reliable with such installs." msgstr "" -#: ../../library/importlib.metadata.rst:402 +#: ../../library/importlib.metadata.rst:403 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:406 +#: ../../library/importlib.metadata.rst:407 msgid "" "Return a :class:`Distribution` instance describing the named distribution " "package." msgstr "" -#: ../../library/importlib.metadata.rst:414 +#: ../../library/importlib.metadata.rst:415 msgid "Details of an installed distribution package." msgstr "" -#: ../../library/importlib.metadata.rst:416 +#: ../../library/importlib.metadata.rst:417 msgid "" "Note: different :class:`!Distribution` instances do not currently compare " "equal, even if they relate to the same installed distribution and " "accordingly have the same attributes." msgstr "" -#: ../../library/importlib.metadata.rst:420 +#: ../../library/importlib.metadata.rst:421 msgid "" "While the module level API described above is the most common and convenient " "usage, you can get all of that information from the :class:`!Distribution` " @@ -664,42 +681,44 @@ msgid "" "package by calling the :func:`distribution` function::" msgstr "" -#: ../../library/importlib.metadata.rst:427 +#: ../../library/importlib.metadata.rst:428 #, fuzzy msgid "" -">>> from importlib.metadata import distribution \n" -">>> dist = distribution('wheel') \n" -">>> type(dist) \n" +">>> from importlib.metadata import distribution\n" +">>> dist = distribution('wheel')\n" +">>> type(dist)\n" "<class 'importlib.metadata.PathDistribution'>" msgstr "" ">>> from importlib.metadata import distribution \n" ">>> dist = distribution('wheel') " -#: ../../library/importlib.metadata.rst:432 +#: ../../library/importlib.metadata.rst:433 msgid "" "Thus, an alternative way to get the version number is through the :class:`!" "Distribution` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:435 +#: ../../library/importlib.metadata.rst:436 +#, fuzzy msgid "" -">>> dist.version \n" +">>> dist.version\n" "'0.32.3'" msgstr "" ">>> dist.version \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:438 +#: ../../library/importlib.metadata.rst:439 msgid "" "There are all kinds of additional metadata available on :class:`!" "Distribution` instances::" msgstr "" -#: ../../library/importlib.metadata.rst:441 +#: ../../library/importlib.metadata.rst:442 +#, fuzzy msgid "" -">>> dist.metadata['Requires-Python'] \n" +">>> dist.metadata['Requires-Python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'\n" -">>> dist.metadata['License'] \n" +">>> dist.metadata['License']\n" "'MIT'" msgstr "" ">>> dist.metadata['Requires-Python'] \n" @@ -707,28 +726,28 @@ msgstr "" ">>> dist.metadata['License'] \n" "'MIT'" -#: ../../library/importlib.metadata.rst:446 +#: ../../library/importlib.metadata.rst:447 msgid "" "For editable packages, an ``origin`` property may present :pep:`610` " "metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:449 +#: ../../library/importlib.metadata.rst:450 msgid "" ">>> dist.origin.url\n" "'file:///path/to/wheel-0.32.3.editable-py3-none-any.whl'" msgstr "" -#: ../../library/importlib.metadata.rst:455 +#: ../../library/importlib.metadata.rst:456 #, fuzzy msgid "The ``.origin`` property was added." msgstr "新增 ``json`` 屬性。" -#: ../../library/importlib.metadata.rst:459 +#: ../../library/importlib.metadata.rst:460 msgid "Distribution Discovery" msgstr "" -#: ../../library/importlib.metadata.rst:461 +#: ../../library/importlib.metadata.rst:462 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package <https://packaging.python." @@ -737,22 +756,22 @@ msgid "" "interprets those values from how other import machinery does. In particular:" msgstr "" -#: ../../library/importlib.metadata.rst:465 +#: ../../library/importlib.metadata.rst:466 msgid "" "``importlib.metadata`` does not honor :class:`bytes` objects on ``sys.path``." msgstr "" -#: ../../library/importlib.metadata.rst:466 +#: ../../library/importlib.metadata.rst:467 msgid "" "``importlib.metadata`` will incidentally honor :py:class:`pathlib.Path` " "objects on ``sys.path`` even though such values will be ignored for imports." msgstr "" -#: ../../library/importlib.metadata.rst:470 +#: ../../library/importlib.metadata.rst:471 msgid "Extending the search algorithm" msgstr "" -#: ../../library/importlib.metadata.rst:472 +#: ../../library/importlib.metadata.rst:473 msgid "" "Because `Distribution Package <https://packaging.python.org/en/latest/" "glossary/#term-Distribution-Package>`_ metadata is not available through :" @@ -763,14 +782,14 @@ msgid "" "on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:480 +#: ../../library/importlib.metadata.rst:481 msgid "" "By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: ../../library/importlib.metadata.rst:485 +#: ../../library/importlib.metadata.rst:486 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -780,7 +799,7 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:493 +#: ../../library/importlib.metadata.rst:494 msgid "" "@abc.abstractmethod\n" "def find_distributions(context=DistributionFinder.Context()):\n" @@ -789,14 +808,14 @@ msgid "" " \"\"\"" msgstr "" -#: ../../library/importlib.metadata.rst:499 +#: ../../library/importlib.metadata.rst:500 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:503 +#: ../../library/importlib.metadata.rst:504 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " @@ -805,17 +824,17 @@ msgid "" "method." msgstr "" -#: ../../library/importlib.metadata.rst:510 +#: ../../library/importlib.metadata.rst:511 msgid "Example" msgstr "" -#: ../../library/importlib.metadata.rst:512 +#: ../../library/importlib.metadata.rst:513 msgid "" "Consider for example a custom finder that loads Python modules from a " "database::" msgstr "" -#: ../../library/importlib.metadata.rst:515 +#: ../../library/importlib.metadata.rst:516 msgid "" "class DatabaseImporter(importlib.abc.MetaPathFinder):\n" " def __init__(self, db):\n" @@ -827,14 +846,14 @@ msgid "" "sys.meta_path.append(DatabaseImporter(connect_db(...)))" msgstr "" -#: ../../library/importlib.metadata.rst:524 +#: ../../library/importlib.metadata.rst:525 msgid "" "That importer now presumably provides importable modules from a database, " "but it provides no metadata or entry points. For this custom importer to " "provide metadata, it would also need to implement ``DistributionFinder``::" msgstr "" -#: ../../library/importlib.metadata.rst:529 +#: ../../library/importlib.metadata.rst:530 msgid "" "from importlib.metadata import DistributionFinder\n" "\n" @@ -847,7 +866,7 @@ msgid "" " yield DatabaseDistribution(dist_record)" msgstr "" -#: ../../library/importlib.metadata.rst:539 +#: ../../library/importlib.metadata.rst:540 msgid "" "In this way, ``query_distributions`` would return records for each " "distribution served by the database matching the query. For example, if " @@ -856,7 +875,7 @@ msgid "" "``Context(name=None)``." msgstr "" -#: ../../library/importlib.metadata.rst:545 +#: ../../library/importlib.metadata.rst:546 msgid "" "For the sake of simplicity, this example ignores ``context.path``\\. The " "``path`` attribute defaults to ``sys.path`` and is the set of import paths " @@ -869,11 +888,11 @@ msgid "" "``context.path`` and only yield ``Distribution``\\ s pertinent to that path." msgstr "" -#: ../../library/importlib.metadata.rst:556 +#: ../../library/importlib.metadata.rst:557 msgid "``DatabaseDistribution``, then, would look something like::" msgstr "" -#: ../../library/importlib.metadata.rst:558 +#: ../../library/importlib.metadata.rst:559 msgid "" "class DatabaseDistribution(importlib.metadata.Distribution):\n" " def __init__(self, record):\n" @@ -896,14 +915,14 @@ msgid "" " raise RuntimeError(\"This distribution has no file system\")" msgstr "" -#: ../../library/importlib.metadata.rst:578 +#: ../../library/importlib.metadata.rst:579 msgid "" "This basic implementation should provide metadata and entry points for " "packages served by the ``DatabaseImporter``, assuming that the ``record`` " "supplies suitable ``.name``, ``.version``, and ``.entry_points`` attributes." msgstr "" -#: ../../library/importlib.metadata.rst:583 +#: ../../library/importlib.metadata.rst:584 msgid "" "The ``DatabaseDistribution`` may also provide other metadata files, like " "``RECORD`` (required for ``Distribution.files``) or override the " diff --git a/library/importlib.po b/library/importlib.po index 18cc51f2ad..3509a428f7 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -580,7 +580,7 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:383 ../../library/importlib.rst:631 +#: ../../library/importlib.rst:383 ../../library/importlib.rst:636 msgid "*Superseded by TraversableResources*" msgstr "" @@ -596,7 +596,7 @@ msgid "" "class:`importlib.resources.abc.TraversableResources`." msgstr "" -#: ../../library/importlib.rst:395 +#: ../../library/importlib.rst:396 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " @@ -606,34 +606,34 @@ msgid "" "__file__` attribute or an item from a package's :attr:`~module.__path__`." msgstr "" -#: ../../library/importlib.rst:404 +#: ../../library/importlib.rst:405 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:410 +#: ../../library/importlib.rst:411 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:415 +#: ../../library/importlib.rst:416 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:421 +#: ../../library/importlib.rst:422 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:427 +#: ../../library/importlib.rst:428 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:432 +#: ../../library/importlib.rst:434 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -642,23 +642,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:438 ../../library/importlib.rst:447 -#: ../../library/importlib.rst:497 +#: ../../library/importlib.rst:440 ../../library/importlib.rst:449 +#: ../../library/importlib.rst:500 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:445 msgid "" "An optional method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:452 +#: ../../library/importlib.rst:454 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:454 +#: ../../library/importlib.rst:456 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -666,107 +666,107 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:459 +#: ../../library/importlib.rst:461 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:464 +#: ../../library/importlib.rst:466 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:469 +#: ../../library/importlib.rst:471 msgid "Implementation of :meth:`Loader.exec_module`." msgstr ":meth:`Loader.exec_module` 的實作。" -#: ../../library/importlib.rst:475 +#: ../../library/importlib.rst:477 msgid "Implementation of :meth:`Loader.load_module`." msgstr ":meth:`Loader.load_module` 的實作。" -#: ../../library/importlib.rst:477 +#: ../../library/importlib.rst:479 msgid "use :meth:`exec_module` instead." msgstr "請改用 :meth:`exec_module`。" -#: ../../library/importlib.rst:483 +#: ../../library/importlib.rst:485 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:489 +#: ../../library/importlib.rst:492 msgid "" "An abstract method that is to return the value of :attr:`~module.__file__` " "for the specified module. If no path is available, :exc:`ImportError` is " "raised." msgstr "" -#: ../../library/importlib.rst:493 +#: ../../library/importlib.rst:496 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:503 +#: ../../library/importlib.rst:506 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:507 +#: ../../library/importlib.rst:510 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:514 +#: ../../library/importlib.rst:517 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:518 +#: ../../library/importlib.rst:521 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:525 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:524 +#: ../../library/importlib.rst:527 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:529 ../../library/importlib.rst:1124 +#: ../../library/importlib.rst:533 ../../library/importlib.rst:1140 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:533 +#: ../../library/importlib.rst:538 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:538 +#: ../../library/importlib.rst:543 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:542 +#: ../../library/importlib.rst:547 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:543 +#: ../../library/importlib.rst:548 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:544 +#: ../../library/importlib.rst:549 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:547 +#: ../../library/importlib.rst:552 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -778,83 +778,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:558 +#: ../../library/importlib.rst:563 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:561 +#: ../../library/importlib.rst:566 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:568 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:565 +#: ../../library/importlib.rst:570 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:570 ../../library/importlib.rst:583 +#: ../../library/importlib.rst:575 ../../library/importlib.rst:588 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:575 +#: ../../library/importlib.rst:580 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:578 +#: ../../library/importlib.rst:583 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:588 +#: ../../library/importlib.rst:593 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:592 +#: ../../library/importlib.rst:597 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:596 +#: ../../library/importlib.rst:601 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:601 +#: ../../library/importlib.rst:606 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:605 +#: ../../library/importlib.rst:610 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:611 +#: ../../library/importlib.rst:616 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:613 +#: ../../library/importlib.rst:618 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:618 +#: ../../library/importlib.rst:623 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:622 +#: ../../library/importlib.rst:627 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -863,12 +863,12 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:633 +#: ../../library/importlib.rst:638 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:636 +#: ../../library/importlib.rst:641 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -878,7 +878,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:644 +#: ../../library/importlib.rst:649 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -890,7 +890,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:655 +#: ../../library/importlib.rst:660 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -899,37 +899,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:664 ../../library/importlib.rst:774 +#: ../../library/importlib.rst:669 ../../library/importlib.rst:789 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.rst:669 +#: ../../library/importlib.rst:675 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:672 +#: ../../library/importlib.rst:678 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:677 +#: ../../library/importlib.rst:684 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:679 +#: ../../library/importlib.rst:686 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:684 +#: ../../library/importlib.rst:692 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:689 +#: ../../library/importlib.rst:698 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -937,7 +937,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:695 +#: ../../library/importlib.rst:704 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -946,71 +946,71 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:703 +#: ../../library/importlib.rst:712 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:717 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.rst:711 +#: ../../library/importlib.rst:720 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.rst:716 +#: ../../library/importlib.rst:725 msgid "Use :class:`importlib.resources.abc.Traversable` instead." msgstr "" -#: ../../library/importlib.rst:721 +#: ../../library/importlib.rst:730 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:725 +#: ../../library/importlib.rst:735 msgid "Yield ``Traversable`` objects in ``self``." msgstr "" -#: ../../library/importlib.rst:729 +#: ../../library/importlib.rst:740 msgid "Return ``True`` if ``self`` is a directory." msgstr "" -#: ../../library/importlib.rst:733 +#: ../../library/importlib.rst:745 msgid "Return ``True`` if ``self`` is a file." msgstr "" -#: ../../library/importlib.rst:737 +#: ../../library/importlib.rst:750 msgid "Return Traversable child in ``self``." msgstr "" -#: ../../library/importlib.rst:741 +#: ../../library/importlib.rst:755 msgid "Return ``Traversable`` child in ``self``." msgstr "" -#: ../../library/importlib.rst:745 +#: ../../library/importlib.rst:760 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.rst:748 +#: ../../library/importlib.rst:763 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:753 +#: ../../library/importlib.rst:768 msgid "Read contents of ``self`` as bytes." msgstr "" -#: ../../library/importlib.rst:757 +#: ../../library/importlib.rst:772 msgid "Read contents of ``self`` as text." msgstr "" -#: ../../library/importlib.rst:762 +#: ../../library/importlib.rst:777 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -1020,71 +1020,71 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:769 +#: ../../library/importlib.rst:784 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:779 +#: ../../library/importlib.rst:795 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:801 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:790 +#: ../../library/importlib.rst:806 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:794 +#: ../../library/importlib.rst:810 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:799 +#: ../../library/importlib.rst:815 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:806 +#: ../../library/importlib.rst:822 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:811 ../../library/importlib.rst:821 +#: ../../library/importlib.rst:827 ../../library/importlib.rst:837 msgid "Use :const:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:816 +#: ../../library/importlib.rst:832 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:826 +#: ../../library/importlib.rst:842 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:831 +#: ../../library/importlib.rst:847 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:836 +#: ../../library/importlib.rst:852 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:843 +#: ../../library/importlib.rst:859 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1093,57 +1093,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:854 +#: ../../library/importlib.rst:870 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:859 ../../library/importlib.rst:873 -#: ../../library/importlib.rst:886 ../../library/importlib.rst:901 +#: ../../library/importlib.rst:875 ../../library/importlib.rst:889 +#: ../../library/importlib.rst:902 ../../library/importlib.rst:917 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:862 +#: ../../library/importlib.rst:878 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:869 +#: ../../library/importlib.rst:885 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:876 +#: ../../library/importlib.rst:892 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:883 +#: ../../library/importlib.rst:899 msgid "" ":term:`Finder <finder>` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:891 +#: ../../library/importlib.rst:907 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:898 +#: ../../library/importlib.rst:914 msgid "" "A :term:`Finder <finder>` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:906 +#: ../../library/importlib.rst:922 msgid "" "Class method that attempts to find a :term:`spec <module spec>` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1157,43 +1157,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:920 +#: ../../library/importlib.rst:936 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:927 +#: ../../library/importlib.rst:943 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:932 +#: ../../library/importlib.rst:948 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:935 +#: ../../library/importlib.rst:951 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:942 +#: ../../library/importlib.rst:958 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:945 +#: ../../library/importlib.rst:961 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:948 +#: ../../library/importlib.rst:964 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1201,7 +1201,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:953 +#: ../../library/importlib.rst:969 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1214,166 +1214,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:967 +#: ../../library/importlib.rst:983 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:971 +#: ../../library/importlib.rst:987 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:977 +#: ../../library/importlib.rst:993 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:997 msgid "" "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 "" -#: ../../library/importlib.rst:986 +#: ../../library/importlib.rst:1002 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:992 +#: ../../library/importlib.rst:1008 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1000 +#: ../../library/importlib.rst:1016 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1004 +#: ../../library/importlib.rst:1020 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1008 +#: ../../library/importlib.rst:1024 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1012 +#: ../../library/importlib.rst:1028 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1016 +#: ../../library/importlib.rst:1032 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1020 ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1036 ../../library/importlib.rst:1079 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1025 ../../library/importlib.rst:1068 +#: ../../library/importlib.rst:1041 ../../library/importlib.rst:1084 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1046 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1033 +#: ../../library/importlib.rst:1049 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1042 +#: ../../library/importlib.rst:1058 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1046 +#: ../../library/importlib.rst:1062 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1050 +#: ../../library/importlib.rst:1066 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1070 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1058 +#: ../../library/importlib.rst:1074 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1073 +#: ../../library/importlib.rst:1089 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1076 +#: ../../library/importlib.rst:1092 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1095 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1085 +#: ../../library/importlib.rst:1101 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1090 ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1106 ../../library/importlib.rst:1292 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1094 +#: ../../library/importlib.rst:1110 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1098 +#: ../../library/importlib.rst:1114 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1105 +#: ../../library/importlib.rst:1121 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1111 +#: ../../library/importlib.rst:1127 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :const:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1116 +#: ../../library/importlib.rst:1132 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:1136 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1131 +#: ../../library/importlib.rst:1147 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1136 +#: ../../library/importlib.rst:1152 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1391,7 +1391,7 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1149 +#: ../../library/importlib.rst:1165 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`~module.__spec__` attribute. Many " @@ -1404,19 +1404,19 @@ msgid "" "origin>`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1163 +#: ../../library/importlib.rst:1179 msgid "" "The module's fully qualified name (see :attr:`module.__name__`). The :term:" "`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1168 +#: ../../library/importlib.rst:1184 msgid "" "The :term:`loader` used to load the module (see :attr:`module.__loader__`). " "The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1173 +#: ../../library/importlib.rst:1189 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" "`module.__file__`). For example, for modules loaded from a ``.py`` file this " @@ -1425,14 +1425,14 @@ msgid "" "there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1182 +#: ../../library/importlib.rst:1198 msgid "" "A (possibly empty) :term:`sequence` of strings enumerating the locations in " "which a package's submodules will be found (see :attr:`module.__path__`). " "Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1187 +#: ../../library/importlib.rst:1203 msgid "" "The :term:`finder` should set this attribute to a sequence, even an empty " "one, to indicate to the import system that the module is a package. It " @@ -1440,41 +1440,41 @@ msgid "" "later to a special object for namespace packages." msgstr "" -#: ../../library/importlib.rst:1195 +#: ../../library/importlib.rst:1211 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1201 +#: ../../library/importlib.rst:1217 msgid "" "The filename of a compiled version of the module's code (see :attr:`module." "__cached__`). The :term:`finder` should always set this attribute but it may " "be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1208 +#: ../../library/importlib.rst:1224 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). See :attr:`module.__package__`. If the " "module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1215 +#: ../../library/importlib.rst:1231 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " "``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " "and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1238 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1225 +#: ../../library/importlib.rst:1241 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1483,7 +1483,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1231 +#: ../../library/importlib.rst:1247 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1497,7 +1497,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1242 +#: ../../library/importlib.rst:1258 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1513,7 +1513,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1256 +#: ../../library/importlib.rst:1272 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1522,7 +1522,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1262 +#: ../../library/importlib.rst:1278 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1533,35 +1533,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1272 +#: ../../library/importlib.rst:1288 msgid "Availability" msgstr "" -#: ../../library/importlib.rst:1280 +#: ../../library/importlib.rst:1296 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1300 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1290 +#: ../../library/importlib.rst:1306 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1294 +#: ../../library/importlib.rst:1310 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1299 +#: ../../library/importlib.rst:1315 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1322 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1571,7 +1571,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1313 +#: ../../library/importlib.rst:1329 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1584,7 +1584,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1323 +#: ../../library/importlib.rst:1339 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1593,18 +1593,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1347 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1335 ../../library/importlib.rst:1351 -#: ../../library/importlib.rst:1440 +#: ../../library/importlib.rst:1351 ../../library/importlib.rst:1367 +#: ../../library/importlib.rst:1456 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1341 +#: ../../library/importlib.rst:1357 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1614,25 +1614,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1356 +#: ../../library/importlib.rst:1372 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1364 +#: ../../library/importlib.rst:1380 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1366 +#: ../../library/importlib.rst:1382 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1371 +#: ../../library/importlib.rst:1387 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1640,13 +1640,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1379 +#: ../../library/importlib.rst:1395 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1386 +#: ../../library/importlib.rst:1402 msgid "" "Find the :term:`spec <module spec>` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1656,30 +1656,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1393 +#: ../../library/importlib.rst:1409 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1396 +#: ../../library/importlib.rst:1412 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1400 +#: ../../library/importlib.rst:1416 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1407 +#: ../../library/importlib.rst:1423 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "<importlib.abc.Loader.create_module>`." msgstr "" -#: ../../library/importlib.rst:1410 +#: ../../library/importlib.rst:1426 msgid "" "If :meth:`spec.loader.create_module <importlib.abc.Loader.create_module>` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1687,14 +1687,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1415 +#: ../../library/importlib.rst:1431 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1423 +#: ../../library/importlib.rst:1439 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1703,7 +1703,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1433 +#: ../../library/importlib.rst:1449 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1711,14 +1711,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1461 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1453 +#: ../../library/importlib.rst:1469 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1727,33 +1727,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1460 +#: ../../library/importlib.rst:1476 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1464 +#: ../../library/importlib.rst:1480 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1469 +#: ../../library/importlib.rst:1485 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1477 +#: ../../library/importlib.rst:1493 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1480 +#: ../../library/importlib.rst:1496 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1766,7 +1766,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1491 +#: ../../library/importlib.rst:1507 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1775,21 +1775,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1499 +#: ../../library/importlib.rst:1515 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1506 +#: ../../library/importlib.rst:1522 msgid "" "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 "" -#: ../../library/importlib.rst:1511 +#: ../../library/importlib.rst:1527 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1801,20 +1801,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1519 +#: ../../library/importlib.rst:1535 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1522 +#: ../../library/importlib.rst:1538 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1524 +#: ../../library/importlib.rst:1540 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1527 +#: ../../library/importlib.rst:1543 msgid "" "import importlib\n" "\n" @@ -1824,23 +1824,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1533 +#: ../../library/importlib.rst:1549 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1535 +#: ../../library/importlib.rst:1551 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1538 +#: ../../library/importlib.rst:1554 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1542 +#: ../../library/importlib.rst:1558 msgid "" "import importlib.util\n" "import sys\n" @@ -1860,11 +1860,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1561 +#: ../../library/importlib.rst:1577 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1563 +#: ../../library/importlib.rst:1579 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1874,13 +1874,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1570 +#: ../../library/importlib.rst:1586 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1572 +#: ../../library/importlib.rst:1588 msgid "" "import importlib.util\n" "import sys\n" @@ -1903,15 +1903,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1594 +#: ../../library/importlib.rst:1610 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1596 +#: ../../library/importlib.rst:1612 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1598 +#: ../../library/importlib.rst:1614 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1931,11 +1931,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1617 +#: ../../library/importlib.rst:1633 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1619 +#: ../../library/importlib.rst:1635 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1949,7 +1949,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1630 +#: ../../library/importlib.rst:1646 msgid "" "import importlib.machinery\n" "import sys\n" @@ -1973,11 +1973,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1651 +#: ../../library/importlib.rst:1667 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1653 +#: ../../library/importlib.rst:1669 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -1985,7 +1985,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1659 +#: ../../library/importlib.rst:1675 msgid "" "import importlib.util\n" "import sys\n" @@ -2018,11 +2018,11 @@ msgid "" " return module" msgstr "" -#: ../../library/importlib.rst:424 +#: ../../library/importlib.rst:425 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:424 +#: ../../library/importlib.rst:425 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 5439f00156..93f66c117e 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -69,33 +69,33 @@ msgstr "" msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.resources.abc.rst:51 +#: ../../library/importlib.resources.abc.rst:52 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:54 +#: ../../library/importlib.resources.abc.rst:55 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:59 +#: ../../library/importlib.resources.abc.rst:61 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:61 +#: ../../library/importlib.resources.abc.rst:63 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:66 +#: ../../library/importlib.resources.abc.rst:69 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:71 +#: ../../library/importlib.resources.abc.rst:75 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -103,7 +103,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:77 +#: ../../library/importlib.resources.abc.rst:81 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -112,52 +112,52 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:85 +#: ../../library/importlib.resources.abc.rst:89 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:90 +#: ../../library/importlib.resources.abc.rst:94 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:93 +#: ../../library/importlib.resources.abc.rst:97 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:98 +#: ../../library/importlib.resources.abc.rst:102 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:102 +#: ../../library/importlib.resources.abc.rst:107 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:106 +#: ../../library/importlib.resources.abc.rst:112 msgid "Return ``True`` if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:110 +#: ../../library/importlib.resources.abc.rst:117 msgid "Return ``True`` if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:114 +#: ../../library/importlib.resources.abc.rst:122 msgid "" "Traverse directories according to *pathsegments* and return the result as :" "class:`!Traversable`." msgstr "" -#: ../../library/importlib.resources.abc.rst:117 +#: ../../library/importlib.resources.abc.rst:125 msgid "" "Each *pathsegments* argument may contain multiple names separated by forward " "slashes (``/``, ``posixpath.sep`` ). For example, the following are " "equivalent::" msgstr "" -#: ../../library/importlib.resources.abc.rst:121 +#: ../../library/importlib.resources.abc.rst:129 msgid "" "files.joinpath('subdir', 'subsuddir', 'file.txt')\n" "files.joinpath('subdir/subsuddir/file.txt')" @@ -165,7 +165,7 @@ msgstr "" "files.joinpath('subdir', 'subsuddir', 'file.txt')\n" "files.joinpath('subdir/subsuddir/file.txt')" -#: ../../library/importlib.resources.abc.rst:124 +#: ../../library/importlib.resources.abc.rst:132 msgid "" "Note that some :class:`!Traversable` implementations might not be updated to " "the latest version of the protocol. For compatibility with such " @@ -173,42 +173,42 @@ msgid "" "call to ``joinpath``. For example::" msgstr "" -#: ../../library/importlib.resources.abc.rst:129 +#: ../../library/importlib.resources.abc.rst:137 msgid "files.joinpath('subdir').joinpath('subsubdir').joinpath('file.txt')" msgstr "files.joinpath('subdir').joinpath('subsubdir').joinpath('file.txt')" -#: ../../library/importlib.resources.abc.rst:133 +#: ../../library/importlib.resources.abc.rst:141 msgid "" "``joinpath`` accepts multiple *pathsegments*, and these segments may contain " "forward slashes as path separators. Previously, only a single *child* " "argument was accepted." msgstr "" -#: ../../library/importlib.resources.abc.rst:139 +#: ../../library/importlib.resources.abc.rst:148 msgid "Return Traversable child in self. Equivalent to ``joinpath(child)``." msgstr "" -#: ../../library/importlib.resources.abc.rst:144 +#: ../../library/importlib.resources.abc.rst:154 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:147 +#: ../../library/importlib.resources.abc.rst:157 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:152 +#: ../../library/importlib.resources.abc.rst:162 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:156 +#: ../../library/importlib.resources.abc.rst:166 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:161 +#: ../../library/importlib.resources.abc.rst:171 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " @@ -217,13 +217,13 @@ msgid "" "TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" -#: ../../library/importlib.resources.abc.rst:168 +#: ../../library/importlib.resources.abc.rst:178 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:173 +#: ../../library/importlib.resources.abc.rst:184 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/logging.po b/library/logging.po index a06518e492..b7a82a0f61 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon <therockleona@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -791,18 +791,20 @@ msgid "" msgstr "" #: ../../library/logging.rst:565 -msgid "Sets the :class:`Formatter` for this handler to *fmt*." +msgid "" +"Sets the formatter for this handler to *fmt*. The *fmt* argument must be a :" +"class:`Formatter` instance or ``None``." msgstr "" -#: ../../library/logging.rst:570 +#: ../../library/logging.rst:571 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:575 +#: ../../library/logging.rst:576 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:580 +#: ../../library/logging.rst:581 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -811,33 +813,33 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:589 +#: ../../library/logging.rst:590 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:595 +#: ../../library/logging.rst:596 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal map of handlers, which is used for " "handler lookup by name." msgstr "" -#: ../../library/logging.rst:599 +#: ../../library/logging.rst:600 msgid "" "Subclasses should ensure that this gets called from overridden :meth:`close` " "methods." msgstr "" -#: ../../library/logging.rst:605 +#: ../../library/logging.rst:606 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:612 +#: ../../library/logging.rst:613 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute :data:" @@ -850,20 +852,20 @@ msgid "" "is more useful during development)." msgstr "" -#: ../../library/logging.rst:625 +#: ../../library/logging.rst:626 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:631 +#: ../../library/logging.rst:632 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:635 +#: ../../library/logging.rst:636 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -872,13 +874,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:641 +#: ../../library/logging.rst:642 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:644 +#: ../../library/logging.rst:645 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -888,16 +890,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:651 +#: ../../library/logging.rst:652 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:656 +#: ../../library/logging.rst:657 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:662 +#: ../../library/logging.rst:663 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -907,7 +909,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:665 +#: ../../library/logging.rst:666 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -915,14 +917,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:673 +#: ../../library/logging.rst:674 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:678 +#: ../../library/logging.rst:679 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -933,32 +935,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:688 +#: ../../library/logging.rst:689 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:693 +#: ../../library/logging.rst:694 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:698 +#: ../../library/logging.rst:699 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:701 +#: ../../library/logging.rst:702 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:704 +#: ../../library/logging.rst:705 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:710 +#: ../../library/logging.rst:711 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -977,13 +979,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:726 +#: ../../library/logging.rst:727 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:732 +#: ../../library/logging.rst:733 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -996,7 +998,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:742 +#: ../../library/logging.rst:743 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -1006,7 +1008,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:750 +#: ../../library/logging.rst:751 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -1021,11 +1023,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:763 +#: ../../library/logging.rst:764 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:768 +#: ../../library/logging.rst:769 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -1033,14 +1035,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:775 +#: ../../library/logging.rst:776 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:781 +#: ../../library/logging.rst:782 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -1049,7 +1051,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:789 +#: ../../library/logging.rst:790 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -1057,14 +1059,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:796 +#: ../../library/logging.rst:797 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:803 +#: ../../library/logging.rst:804 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -1072,11 +1074,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:812 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:813 +#: ../../library/logging.rst:814 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -1086,7 +1088,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:823 +#: ../../library/logging.rst:824 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -1094,7 +1096,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:831 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -1102,7 +1104,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:836 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -1112,13 +1114,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:843 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:845 +#: ../../library/logging.rst:846 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -1129,7 +1131,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:856 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -1137,7 +1139,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:862 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -1149,11 +1151,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:874 +#: ../../library/logging.rst:875 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:877 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -1161,17 +1163,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:885 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:891 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1179,7 +1181,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "" "The :ref:`numeric level <levels>` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -1187,46 +1189,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:905 +#: ../../library/logging.rst:906 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:909 +#: ../../library/logging.rst:910 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:913 +#: ../../library/logging.rst:914 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:922 +#: ../../library/logging.rst:923 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:927 +#: ../../library/logging.rst:928 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:932 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:938 +#: ../../library/logging.rst:939 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1235,7 +1237,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:945 +#: ../../library/logging.rst:946 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 " @@ -1243,13 +1245,13 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:952 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:954 +#: ../../library/logging.rst:955 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -1269,18 +1271,18 @@ msgstr "" "\n" "logging.setLogRecordFactory(record_factory)" -#: ../../library/logging.rst:963 +#: ../../library/logging.rst:964 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:972 +#: ../../library/logging.rst:973 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:974 +#: ../../library/logging.rst:975 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 " @@ -1291,7 +1293,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:982 +#: ../../library/logging.rst:983 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 (:" @@ -1299,7 +1301,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:988 +#: ../../library/logging.rst:989 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: " @@ -1308,318 +1310,318 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:995 +#: ../../library/logging.rst:996 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:995 ../../library/logging.rst:1365 +#: ../../library/logging.rst:996 ../../library/logging.rst:1366 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:995 ../../library/logging.rst:1365 +#: ../../library/logging.rst:996 ../../library/logging.rst:1366 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:997 +#: ../../library/logging.rst:0 ../../library/logging.rst:998 msgid "args" msgstr "" -#: ../../library/logging.rst:997 ../../library/logging.rst:1011 -#: ../../library/logging.rst:1039 ../../library/logging.rst:1057 +#: ../../library/logging.rst:998 ../../library/logging.rst:1012 +#: ../../library/logging.rst:1040 ../../library/logging.rst:1058 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" -#: ../../library/logging.rst:997 +#: ../../library/logging.rst:998 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:1002 +#: ../../library/logging.rst:1003 msgid "asctime" msgstr "" -#: ../../library/logging.rst:1002 +#: ../../library/logging.rst:1003 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:1002 +#: ../../library/logging.rst:1003 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:1008 +#: ../../library/logging.rst:1009 msgid "created" msgstr "" -#: ../../library/logging.rst:1008 +#: ../../library/logging.rst:1009 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:1008 +#: ../../library/logging.rst:1009 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time_ns` / 1e9)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1011 +#: ../../library/logging.rst:0 ../../library/logging.rst:1012 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:1011 +#: ../../library/logging.rst:1012 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1015 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1015 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1015 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1017 msgid "funcName" msgstr "" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1017 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1017 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1019 msgid "levelname" msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1019 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1019 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1023 msgid "levelno" msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1023 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1023 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "lineno" msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1028 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1031 msgid "message" msgstr "" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1031 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1031 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1035 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1035 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1035 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1037 msgid "msecs" msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1037 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1037 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1039 +#: ../../library/logging.rst:0 ../../library/logging.rst:1040 msgid "msg" msgstr "" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1040 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:1044 +#: ../../library/logging.rst:0 ../../library/logging.rst:1045 msgid "name" msgstr "name" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1045 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1045 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "pathname" msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1047 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1050 msgid "process" msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1050 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1050 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1052 msgid "processName" msgstr "" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1052 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1052 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1054 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1054 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1054 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1058 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1058 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:1063 +#: ../../library/logging.rst:1064 msgid "thread" msgstr "" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1064 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1064 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1066 msgid "threadName" msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1066 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1066 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1068 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1068 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1068 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1071 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1073 +#: ../../library/logging.rst:1074 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1080 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1081 +#: ../../library/logging.rst:1082 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 <context-info>`." msgstr "" -#: ../../library/logging.rst:1087 +#: ../../library/logging.rst:1088 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, a dict-like object (*extra*), and a " @@ -1629,7 +1631,7 @@ msgid "" "calls and only use the one of the :class:`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1096 +#: ../../library/logging.rst:1097 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1638,15 +1640,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1104 +#: ../../library/logging.rst:1105 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1109 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1110 +#: ../../library/logging.rst:1111 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1658,29 +1660,29 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1121 +#: ../../library/logging.rst:1122 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:1127 +#: ../../library/logging.rst:1128 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:1132 +#: ../../library/logging.rst:1133 #, fuzzy msgid "The *merge_extra* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1137 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1138 +#: ../../library/logging.rst:1139 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 " @@ -1689,7 +1691,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1144 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 " @@ -1697,17 +1699,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1150 +#: ../../library/logging.rst:1151 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1153 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1159 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1717,14 +1719,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1165 +#: ../../library/logging.rst:1166 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:1172 +#: ../../library/logging.rst:1173 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 " @@ -1733,43 +1735,43 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1177 +#: ../../library/logging.rst:1178 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" msgstr "" -#: ../../library/logging.rst:1183 +#: ../../library/logging.rst:1184 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1185 +#: ../../library/logging.rst:1186 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:1190 +#: ../../library/logging.rst:1191 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1195 +#: ../../library/logging.rst:1196 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1199 +#: ../../library/logging.rst:1200 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1203 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1779,38 +1781,38 @@ msgid "" "described at the beginnning of this documentation." msgstr "" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1213 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1218 +#: ../../library/logging.rst:1219 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1222 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:1228 +#: ../../library/logging.rst:1229 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1234 +#: ../../library/logging.rst:1235 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1240 +#: ../../library/logging.rst:1241 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1818,13 +1820,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1247 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1252 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 " @@ -1838,7 +1840,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1262 +#: ../../library/logging.rst:1263 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 " @@ -1846,13 +1848,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1268 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1274 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1862,24 +1864,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1281 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1286 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:1293 +#: ../../library/logging.rst:1294 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1296 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1889,20 +1891,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1303 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:1306 +#: ../../library/logging.rst:1307 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1309 +#: ../../library/logging.rst:1310 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 " @@ -1911,7 +1913,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1316 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. " @@ -1919,17 +1921,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1324 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1330 +#: ../../library/logging.rst:1331 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1337 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1937,7 +1939,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1344 +#: ../../library/logging.rst:1345 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1946,13 +1948,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1350 +#: ../../library/logging.rst:1351 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:1353 +#: ../../library/logging.rst:1354 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 " @@ -1961,54 +1963,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1361 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1368 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1368 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1372 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1372 msgid "" "If *filename* is specified, open the file in this :ref:`mode <filemodes>`. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1376 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1376 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1381 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1381 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1384 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1384 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style <old-string-" @@ -2016,30 +2018,30 @@ msgid "" "Defaults to ``'%'``." msgstr "" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 msgid "*level*" msgstr "*level*" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 msgid "Set the root logger level to the specified :ref:`level <levels>`." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1395 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1395 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:1400 +#: ../../library/logging.rst:1401 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1400 +#: ../../library/logging.rst:1401 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 " @@ -2048,33 +2050,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1409 +#: ../../library/logging.rst:1410 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1409 +#: ../../library/logging.rst:1410 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:1415 +#: ../../library/logging.rst:1416 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1415 +#: ../../library/logging.rst:1416 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:1420 +#: ../../library/logging.rst:1421 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1421 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 " @@ -2083,39 +2085,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1431 +#: ../../library/logging.rst:1432 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1434 +#: ../../library/logging.rst:1435 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:1440 +#: ../../library/logging.rst:1441 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1443 +#: ../../library/logging.rst:1444 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1449 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:1452 +#: ../../library/logging.rst:1453 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:1459 +#: ../../library/logging.rst:1460 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 " @@ -2127,32 +2129,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1470 +#: ../../library/logging.rst:1471 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1472 +#: ../../library/logging.rst:1473 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1474 +#: ../../library/logging.rst:1475 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:1479 +#: ../../library/logging.rst:1480 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1482 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1484 msgid "The logger name." msgstr "" @@ -2160,7 +2162,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1485 msgid "The logging level (numeric)." msgstr "" @@ -2168,7 +2170,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1486 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2176,19 +2178,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1487 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1488 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1489 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1490 msgid "An exception tuple, or ``None``." msgstr "" @@ -2196,7 +2198,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1491 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2204,7 +2206,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1493 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2214,15 +2216,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1495 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1498 +#: ../../library/logging.rst:1499 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1502 +#: ../../library/logging.rst:1503 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``, " @@ -2233,15 +2235,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1514 +#: ../../library/logging.rst:1515 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1516 +#: ../../library/logging.rst:1517 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1518 +#: ../../library/logging.rst:1519 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2249,22 +2251,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1525 +#: ../../library/logging.rst:1526 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1527 +#: ../../library/logging.rst:1528 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1532 +#: ../../library/logging.rst:1533 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1535 +#: ../../library/logging.rst:1536 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2273,46 +2275,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1540 +#: ../../library/logging.rst:1541 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:1547 +#: ../../library/logging.rst:1548 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1548 +#: ../../library/logging.rst:1549 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1550 +#: ../../library/logging.rst:1551 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1551 +#: ../../library/logging.rst:1552 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1553 +#: ../../library/logging.rst:1554 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1554 +#: ../../library/logging.rst:1555 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1557 +#: ../../library/logging.rst:1558 msgid "" "`Original Python logging package <https://old.red-dove.com/python_logging." "html>`_" msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1559 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/numbers.po b/library/numbers.po index 221858c2e6..f33a798cb8 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-11-16 04:57+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,19 +72,19 @@ msgstr "為抽象的。取得該數值的實數部分。" msgid "Abstract. Retrieves the imaginary component of this number." msgstr "為抽象的。取得該數值的虛數部分。" -#: ../../library/numbers.rst:43 +#: ../../library/numbers.rst:44 msgid "" "Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() " "== (1-3j)``." msgstr "為抽象的。回傳共軛複數,例如 ``(1+3j).conjugate() == (1-3j)``。" -#: ../../library/numbers.rst:48 +#: ../../library/numbers.rst:49 msgid "" "To :class:`Complex`, :class:`!Real` adds the operations that work on real " "numbers." msgstr "相對於 :class:`Complex`,:class:`!Real` 加入了只有實數才能進行的操作。" -#: ../../library/numbers.rst:51 +#: ../../library/numbers.rst:52 msgid "" "In short, those are: a conversion to :class:`float`, :func:`math.trunc`, :" "func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, " @@ -94,7 +94,7 @@ msgstr "" "`math.floor`、:func:`math.ceil`、:func:`divmod`、``//``、``%``、 ``<``、" "``<=``、``>``、和 ``>=``。" -#: ../../library/numbers.rst:55 +#: ../../library/numbers.rst:56 msgid "" "Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :" "attr:`~Complex.imag`, and :meth:`~Complex.conjugate`." @@ -102,7 +102,7 @@ msgstr "" "實數同樣提供 :func:`complex`、:attr:`~Complex.real`、:attr:`~Complex.imag` " "和 :meth:`~Complex.conjugate` 的預設值。" -#: ../../library/numbers.rst:61 +#: ../../library/numbers.rst:62 msgid "" "Subtypes :class:`Real` and adds :attr:`~Rational.numerator` and :attr:" "`~Rational.denominator` properties. It also provides a default for :func:" @@ -111,7 +111,7 @@ msgstr "" ":class:`Real` 的子型別,並增加了 :attr:`~Rational.numerator` 和 :attr:" "`~Rational.denominator` 這兩種特性。它也會提供 :func:`float` 的預設值。" -#: ../../library/numbers.rst:65 +#: ../../library/numbers.rst:66 msgid "" "The :attr:`~Rational.numerator` and :attr:`~Rational.denominator` values " "should be instances of :class:`Integral` and should be in lowest terms with :" @@ -120,11 +120,11 @@ msgstr "" ":attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 的值必須是 :" "class:`Integral` 的實例且 :attr:`~Rational.denominator` 要是正數。" -#: ../../library/numbers.rst:71 ../../library/numbers.rst:75 +#: ../../library/numbers.rst:72 ../../library/numbers.rst:76 msgid "Abstract." msgstr "為抽象的。" -#: ../../library/numbers.rst:80 +#: ../../library/numbers.rst:81 msgid "" "Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides " "defaults for :func:`float`, :attr:`~Rational.numerator`, and :attr:" @@ -136,11 +136,11 @@ msgstr "" "預設值。為 :func:`pow` 方法增加了求餘 (modulus) 和位元字串運算 (bit-string " "operations) 的抽象方法:``<<``、``>>``、``&``、``^``、``|``、``~``。" -#: ../../library/numbers.rst:88 +#: ../../library/numbers.rst:89 msgid "Notes for type implementers" msgstr "給型別實作者的註記" -#: ../../library/numbers.rst:90 +#: ../../library/numbers.rst:91 msgid "" "Implementers should be careful to make equal numbers equal and hash them to " "the same values. This may be subtle if there are two different extensions of " @@ -151,7 +151,7 @@ msgstr "" "同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下的 :" "func:`hash` 實作如下: ::" -#: ../../library/numbers.rst:95 +#: ../../library/numbers.rst:96 msgid "" "def __hash__(self):\n" " if self.denominator == 1:\n" @@ -166,11 +166,11 @@ msgid "" " return hash((self.numerator, self.denominator))" msgstr "" -#: ../../library/numbers.rst:109 +#: ../../library/numbers.rst:110 msgid "Adding More Numeric ABCs" msgstr "加入更多數值 ABC" -#: ../../library/numbers.rst:111 +#: ../../library/numbers.rst:112 msgid "" "There are, of course, more possible ABCs for numbers, and this would be a " "poor hierarchy if it precluded the possibility of adding those. You can add " @@ -179,7 +179,7 @@ msgstr "" "當然,還有更多用於數值的 ABC,如果不加入它們就不會有健全的階層。你可以在 :" "class:`Complex` 和 :class:`Real` 中加入 ``MyFoo``,像是: ::" -#: ../../library/numbers.rst:116 +#: ../../library/numbers.rst:117 msgid "" "class MyFoo(Complex): ...\n" "MyFoo.register(Real)" @@ -187,11 +187,11 @@ msgstr "" "class MyFoo(Complex): ...\n" "MyFoo.register(Real)" -#: ../../library/numbers.rst:123 +#: ../../library/numbers.rst:124 msgid "Implementing the arithmetic operations" msgstr "實作算術操作" -#: ../../library/numbers.rst:125 +#: ../../library/numbers.rst:126 msgid "" "We want to implement the arithmetic operations so that mixed-mode operations " "either call an implementation whose author knew about the types of both " @@ -204,7 +204,7 @@ msgstr "" "子型別,這意味著 :meth:`~object.__add__` 和 :meth:`~object.__radd__` 必須用如" "下方式定義: ::" -#: ../../library/numbers.rst:132 +#: ../../library/numbers.rst:133 msgid "" "class MyIntegral(Integral):\n" "\n" @@ -254,7 +254,7 @@ msgstr "" " else:\n" " return NotImplemented" -#: ../../library/numbers.rst:157 +#: ../../library/numbers.rst:158 msgid "" "There are 5 different cases for a mixed-type operation on subclasses of :" "class:`Complex`. I'll refer to all of the above code that doesn't refer to " @@ -267,13 +267,13 @@ msgstr "" "(boilerplate)」。``a`` 是 :class:`Complex` 之子型別 ``A`` 的實例 (``a : A <: " "Complex``),同時 ``b : B <: Complex``。我將要計算 ``a + b``:" -#: ../../library/numbers.rst:164 +#: ../../library/numbers.rst:165 msgid "" "If ``A`` defines an :meth:`~object.__add__` which accepts ``b``, all is well." msgstr "" "如果 ``A`` 有定義成一個接受 ``b`` 的 :meth:`~object.__add__`,不會發生問題。" -#: ../../library/numbers.rst:166 +#: ../../library/numbers.rst:167 msgid "" "If ``A`` falls back to the boilerplate code, and it were to return a value " "from :meth:`~object.__add__`, we'd miss the possibility that ``B`` defines a " @@ -286,14 +286,14 @@ msgstr "" "回傳一個來自 :meth:`!__add__` 的 :data:`NotImplemented`。(或者 ``A`` 可能完" "全不實作 :meth:`!__add__`。)" -#: ../../library/numbers.rst:172 +#: ../../library/numbers.rst:173 msgid "" "Then ``B``'s :meth:`~object.__radd__` gets a chance. If it accepts ``a``, " "all is well." msgstr "" "接著看 ``B`` 的 :meth:`~object.__radd__`。如果它接受 ``a`` ,不會發生問題。" -#: ../../library/numbers.rst:174 +#: ../../library/numbers.rst:175 msgid "" "If it falls back to the boilerplate, there are no more possible methods to " "try, so this is where the default implementation should live." @@ -301,7 +301,7 @@ msgstr "" "如果沒有成功回退到模板,就沒有更多的方法可以去嘗試,因此這裡將使用預設的實" "作。" -#: ../../library/numbers.rst:177 +#: ../../library/numbers.rst:178 msgid "" "If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is ok, " "because it was implemented with knowledge of ``A``, so it can handle those " @@ -311,7 +311,7 @@ msgstr "" "的,因為它是透過對 ``A`` 的理解而實作的,所以這可以在交給 :class:`Complex` 之" "前處理好這些實例。" -#: ../../library/numbers.rst:182 +#: ../../library/numbers.rst:183 msgid "" "If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, " "then the appropriate shared operation is the one involving the built in :" @@ -322,7 +322,7 @@ msgstr "" "當的共享操作會涉及內建的 :class:`complex`,並且分別用到 :meth:`~object." "__radd__`,因此 ``a+b == b+a``。" -#: ../../library/numbers.rst:187 +#: ../../library/numbers.rst:188 msgid "" "Because most of the operations on any given type will be very similar, it " "can be useful to define a helper function which generates the forward and " @@ -333,7 +333,7 @@ msgstr "" "(forward) 與向後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:" "`fractions.Fraction` 使用了: ::" -#: ../../library/numbers.rst:192 +#: ../../library/numbers.rst:193 msgid "" "def _operator_fallbacks(monomorphic_operator, fallback_operator):\n" " def forward(a, b):\n" diff --git a/library/os.po b/library/os.po index 06a6f2baa0..e4fa860c4d 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -306,93 +306,93 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:181 ../../library/os.rst:322 ../../library/os.rst:337 -#: ../../library/os.rst:358 ../../library/os.rst:367 ../../library/os.rst:376 -#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:426 -#: ../../library/os.rst:434 ../../library/os.rst:442 ../../library/os.rst:462 -#: ../../library/os.rst:480 ../../library/os.rst:491 ../../library/os.rst:503 -#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:533 -#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 -#: ../../library/os.rst:593 ../../library/os.rst:602 ../../library/os.rst:639 -#: ../../library/os.rst:652 ../../library/os.rst:661 ../../library/os.rst:678 -#: ../../library/os.rst:687 ../../library/os.rst:694 ../../library/os.rst:703 -#: ../../library/os.rst:712 ../../library/os.rst:719 ../../library/os.rst:726 -#: ../../library/os.rst:735 ../../library/os.rst:792 ../../library/os.rst:831 -#: ../../library/os.rst:953 ../../library/os.rst:979 ../../library/os.rst:992 -#: ../../library/os.rst:1009 ../../library/os.rst:1027 -#: ../../library/os.rst:1038 ../../library/os.rst:1061 -#: ../../library/os.rst:1082 ../../library/os.rst:1094 -#: ../../library/os.rst:1105 ../../library/os.rst:1118 -#: ../../library/os.rst:1139 ../../library/os.rst:1160 -#: ../../library/os.rst:1172 ../../library/os.rst:1183 -#: ../../library/os.rst:1244 ../../library/os.rst:1367 -#: ../../library/os.rst:1379 ../../library/os.rst:1393 -#: ../../library/os.rst:1403 ../../library/os.rst:1418 -#: ../../library/os.rst:1433 ../../library/os.rst:1446 -#: ../../library/os.rst:1463 ../../library/os.rst:1489 -#: ../../library/os.rst:1506 ../../library/os.rst:1520 -#: ../../library/os.rst:1535 ../../library/os.rst:1547 -#: ../../library/os.rst:1574 ../../library/os.rst:1586 -#: ../../library/os.rst:1596 ../../library/os.rst:1610 -#: ../../library/os.rst:1662 ../../library/os.rst:1682 -#: ../../library/os.rst:1691 ../../library/os.rst:1703 -#: ../../library/os.rst:1738 ../../library/os.rst:1762 -#: ../../library/os.rst:1772 ../../library/os.rst:1780 -#: ../../library/os.rst:1789 ../../library/os.rst:1800 -#: ../../library/os.rst:1837 ../../library/os.rst:1864 -#: ../../library/os.rst:1915 ../../library/os.rst:1921 -#: ../../library/os.rst:2087 ../../library/os.rst:2164 -#: ../../library/os.rst:2181 ../../library/os.rst:2195 -#: ../../library/os.rst:2221 ../../library/os.rst:2239 -#: ../../library/os.rst:2255 ../../library/os.rst:2271 -#: ../../library/os.rst:2334 ../../library/os.rst:2358 -#: ../../library/os.rst:2378 ../../library/os.rst:2514 -#: ../../library/os.rst:2536 ../../library/os.rst:2580 -#: ../../library/os.rst:2592 ../../library/os.rst:2614 -#: ../../library/os.rst:3322 ../../library/os.rst:3456 -#: ../../library/os.rst:3479 ../../library/os.rst:3493 -#: ../../library/os.rst:3713 ../../library/os.rst:3738 -#: ../../library/os.rst:3763 ../../library/os.rst:3817 -#: ../../library/os.rst:3826 ../../library/os.rst:3835 -#: ../../library/os.rst:3843 ../../library/os.rst:3852 -#: ../../library/os.rst:3861 ../../library/os.rst:3933 -#: ../../library/os.rst:3996 ../../library/os.rst:4006 -#: ../../library/os.rst:4024 ../../library/os.rst:4033 -#: ../../library/os.rst:4043 ../../library/os.rst:4053 -#: ../../library/os.rst:4063 ../../library/os.rst:4074 -#: ../../library/os.rst:4219 ../../library/os.rst:4288 -#: ../../library/os.rst:4323 ../../library/os.rst:4331 -#: ../../library/os.rst:4338 ../../library/os.rst:4345 -#: ../../library/os.rst:4352 ../../library/os.rst:4359 -#: ../../library/os.rst:4366 ../../library/os.rst:4373 -#: ../../library/os.rst:4381 ../../library/os.rst:4389 -#: ../../library/os.rst:4396 ../../library/os.rst:4403 -#: ../../library/os.rst:4412 ../../library/os.rst:4420 -#: ../../library/os.rst:4428 ../../library/os.rst:4435 -#: ../../library/os.rst:4442 ../../library/os.rst:4491 -#: ../../library/os.rst:4518 ../../library/os.rst:4541 -#: ../../library/os.rst:4557 ../../library/os.rst:4564 -#: ../../library/os.rst:4575 ../../library/os.rst:4585 -#: ../../library/os.rst:4594 ../../library/os.rst:4626 -#: ../../library/os.rst:4734 ../../library/os.rst:4750 -#: ../../library/os.rst:4783 ../../library/os.rst:4852 -#: ../../library/os.rst:4871 ../../library/os.rst:4882 -#: ../../library/os.rst:4894 ../../library/os.rst:4939 -#: ../../library/os.rst:4976 ../../library/os.rst:4999 -#: ../../library/os.rst:5020 ../../library/os.rst:5054 -#: ../../library/os.rst:5095 ../../library/os.rst:5115 -#: ../../library/os.rst:5129 ../../library/os.rst:5146 -#: ../../library/os.rst:5161 ../../library/os.rst:5172 -#: ../../library/os.rst:5184 ../../library/os.rst:5197 -#: ../../library/os.rst:5206 ../../library/os.rst:5216 -#: ../../library/os.rst:5229 ../../library/os.rst:5264 -#: ../../library/os.rst:5280 ../../library/os.rst:5291 -#: ../../library/os.rst:5303 ../../library/os.rst:5310 -#: ../../library/os.rst:5319 ../../library/os.rst:5328 -#: ../../library/os.rst:5337 ../../library/os.rst:5346 -#: ../../library/os.rst:5498 ../../library/os.rst:5507 -#: ../../library/os.rst:5531 ../../library/os.rst:5558 -#: ../../library/os.rst:5567 ../../library/os.rst:5690 +#: ../../library/os.rst:181 ../../library/os.rst:323 ../../library/os.rst:338 +#: ../../library/os.rst:359 ../../library/os.rst:368 ../../library/os.rst:377 +#: ../../library/os.rst:390 ../../library/os.rst:399 ../../library/os.rst:427 +#: ../../library/os.rst:435 ../../library/os.rst:443 ../../library/os.rst:463 +#: ../../library/os.rst:481 ../../library/os.rst:492 ../../library/os.rst:504 +#: ../../library/os.rst:513 ../../library/os.rst:523 ../../library/os.rst:534 +#: ../../library/os.rst:546 ../../library/os.rst:580 ../../library/os.rst:587 +#: ../../library/os.rst:594 ../../library/os.rst:603 ../../library/os.rst:640 +#: ../../library/os.rst:653 ../../library/os.rst:662 ../../library/os.rst:679 +#: ../../library/os.rst:688 ../../library/os.rst:695 ../../library/os.rst:704 +#: ../../library/os.rst:713 ../../library/os.rst:720 ../../library/os.rst:727 +#: ../../library/os.rst:736 ../../library/os.rst:793 ../../library/os.rst:832 +#: ../../library/os.rst:954 ../../library/os.rst:980 ../../library/os.rst:993 +#: ../../library/os.rst:1010 ../../library/os.rst:1028 +#: ../../library/os.rst:1039 ../../library/os.rst:1062 +#: ../../library/os.rst:1083 ../../library/os.rst:1095 +#: ../../library/os.rst:1106 ../../library/os.rst:1119 +#: ../../library/os.rst:1140 ../../library/os.rst:1161 +#: ../../library/os.rst:1173 ../../library/os.rst:1184 +#: ../../library/os.rst:1245 ../../library/os.rst:1368 +#: ../../library/os.rst:1380 ../../library/os.rst:1394 +#: ../../library/os.rst:1404 ../../library/os.rst:1419 +#: ../../library/os.rst:1434 ../../library/os.rst:1447 +#: ../../library/os.rst:1464 ../../library/os.rst:1490 +#: ../../library/os.rst:1507 ../../library/os.rst:1521 +#: ../../library/os.rst:1536 ../../library/os.rst:1548 +#: ../../library/os.rst:1575 ../../library/os.rst:1587 +#: ../../library/os.rst:1597 ../../library/os.rst:1611 +#: ../../library/os.rst:1663 ../../library/os.rst:1683 +#: ../../library/os.rst:1692 ../../library/os.rst:1704 +#: ../../library/os.rst:1739 ../../library/os.rst:1763 +#: ../../library/os.rst:1773 ../../library/os.rst:1781 +#: ../../library/os.rst:1790 ../../library/os.rst:1801 +#: ../../library/os.rst:1838 ../../library/os.rst:1865 +#: ../../library/os.rst:1916 ../../library/os.rst:1922 +#: ../../library/os.rst:2088 ../../library/os.rst:2165 +#: ../../library/os.rst:2182 ../../library/os.rst:2196 +#: ../../library/os.rst:2222 ../../library/os.rst:2240 +#: ../../library/os.rst:2256 ../../library/os.rst:2272 +#: ../../library/os.rst:2335 ../../library/os.rst:2359 +#: ../../library/os.rst:2379 ../../library/os.rst:2515 +#: ../../library/os.rst:2537 ../../library/os.rst:2581 +#: ../../library/os.rst:2593 ../../library/os.rst:2615 +#: ../../library/os.rst:3323 ../../library/os.rst:3457 +#: ../../library/os.rst:3480 ../../library/os.rst:3494 +#: ../../library/os.rst:3714 ../../library/os.rst:3739 +#: ../../library/os.rst:3764 ../../library/os.rst:3818 +#: ../../library/os.rst:3827 ../../library/os.rst:3836 +#: ../../library/os.rst:3844 ../../library/os.rst:3853 +#: ../../library/os.rst:3862 ../../library/os.rst:3934 +#: ../../library/os.rst:3997 ../../library/os.rst:4007 +#: ../../library/os.rst:4025 ../../library/os.rst:4034 +#: ../../library/os.rst:4044 ../../library/os.rst:4054 +#: ../../library/os.rst:4064 ../../library/os.rst:4075 +#: ../../library/os.rst:4220 ../../library/os.rst:4289 +#: ../../library/os.rst:4324 ../../library/os.rst:4332 +#: ../../library/os.rst:4339 ../../library/os.rst:4346 +#: ../../library/os.rst:4353 ../../library/os.rst:4360 +#: ../../library/os.rst:4367 ../../library/os.rst:4374 +#: ../../library/os.rst:4382 ../../library/os.rst:4390 +#: ../../library/os.rst:4397 ../../library/os.rst:4404 +#: ../../library/os.rst:4413 ../../library/os.rst:4421 +#: ../../library/os.rst:4429 ../../library/os.rst:4436 +#: ../../library/os.rst:4443 ../../library/os.rst:4492 +#: ../../library/os.rst:4519 ../../library/os.rst:4542 +#: ../../library/os.rst:4558 ../../library/os.rst:4565 +#: ../../library/os.rst:4576 ../../library/os.rst:4586 +#: ../../library/os.rst:4595 ../../library/os.rst:4627 +#: ../../library/os.rst:4735 ../../library/os.rst:4751 +#: ../../library/os.rst:4784 ../../library/os.rst:4853 +#: ../../library/os.rst:4872 ../../library/os.rst:4883 +#: ../../library/os.rst:4895 ../../library/os.rst:4940 +#: ../../library/os.rst:4977 ../../library/os.rst:5000 +#: ../../library/os.rst:5021 ../../library/os.rst:5055 +#: ../../library/os.rst:5096 ../../library/os.rst:5116 +#: ../../library/os.rst:5130 ../../library/os.rst:5147 +#: ../../library/os.rst:5162 ../../library/os.rst:5173 +#: ../../library/os.rst:5185 ../../library/os.rst:5198 +#: ../../library/os.rst:5207 ../../library/os.rst:5217 +#: ../../library/os.rst:5230 ../../library/os.rst:5265 +#: ../../library/os.rst:5281 ../../library/os.rst:5292 +#: ../../library/os.rst:5304 ../../library/os.rst:5311 +#: ../../library/os.rst:5320 ../../library/os.rst:5329 +#: ../../library/os.rst:5338 ../../library/os.rst:5347 +#: ../../library/os.rst:5499 ../../library/os.rst:5508 +#: ../../library/os.rst:5532 ../../library/os.rst:5559 +#: ../../library/os.rst:5568 ../../library/os.rst:5691 msgid "Availability" msgstr "" @@ -521,17 +521,17 @@ msgid "" "e.g. :class:`pathlib.PurePath`." msgstr "" -#: ../../library/os.rst:304 +#: ../../library/os.rst:305 msgid "Return the file system path representation of the object." msgstr "" -#: ../../library/os.rst:306 +#: ../../library/os.rst:307 msgid "" "The method should only return a :class:`str` or :class:`bytes` object, with " "the preference being for :class:`str`." msgstr "" -#: ../../library/os.rst:312 +#: ../../library/os.rst:313 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:" @@ -540,14 +540,14 @@ msgid "" "changes." msgstr "" -#: ../../library/os.rst:318 +#: ../../library/os.rst:319 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:327 +#: ../../library/os.rst:328 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:" @@ -556,13 +556,13 @@ msgid "" "environment changes." msgstr "" -#: ../../library/os.rst:334 +#: ../../library/os.rst:335 msgid "" ":func:`getenvb` is only available if :const:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:344 +#: ../../library/os.rst:345 msgid "" "Returns the list of directories that will be searched for a named " "executable, similar to a shell, when launching a process. *env*, when " @@ -570,28 +570,28 @@ msgid "" "in. By default, when *env* is ``None``, :data:`environ` is used." msgstr "" -#: ../../library/os.rst:355 +#: ../../library/os.rst:356 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:365 +#: ../../library/os.rst:366 msgid "Return the current process's effective user id." msgstr "" -#: ../../library/os.rst:374 +#: ../../library/os.rst:375 msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:378 ../../library/os.rst:451 ../../library/os.rst:535 -#: ../../library/os.rst:758 +#: ../../library/os.rst:379 ../../library/os.rst:452 ../../library/os.rst:536 +#: ../../library/os.rst:759 msgid "" "The function is a stub on WASI, see :ref:`wasm-availability` for more " "information." msgstr "" -#: ../../library/os.rst:384 +#: ../../library/os.rst:385 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 " @@ -599,12 +599,12 @@ msgid "" "potentially omitted." msgstr "" -#: ../../library/os.rst:396 +#: ../../library/os.rst:397 msgid "" "Return list of supplemental group ids associated with the current process." msgstr "" -#: ../../library/os.rst:402 +#: ../../library/os.rst:403 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of " @@ -621,7 +621,7 @@ msgid "" "get_config_var`." msgstr "" -#: ../../library/os.rst:419 +#: ../../library/os.rst:420 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." @@ -630,32 +630,32 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:431 +#: ../../library/os.rst:432 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:440 +#: ../../library/os.rst:441 msgid "Return the id of the current process group." msgstr "" -#: ../../library/os.rst:449 +#: ../../library/os.rst:450 msgid "Return the current process id." msgstr "" -#: ../../library/os.rst:458 +#: ../../library/os.rst:459 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:464 +#: ../../library/os.rst:465 msgid "Added support for Windows." msgstr "新增對 Windows 的支援。" -#: ../../library/os.rst:472 +#: ../../library/os.rst:473 msgid "" "Get program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -666,42 +666,42 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:489 ../../library/os.rst:501 +#: ../../library/os.rst:490 ../../library/os.rst:502 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:509 +#: ../../library/os.rst:510 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:519 +#: ../../library/os.rst:520 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:531 +#: ../../library/os.rst:532 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:541 +#: ../../library/os.rst:542 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:554 +#: ../../library/os.rst:555 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:558 +#: ../../library/os.rst:559 msgid "" "Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " @@ -711,13 +711,13 @@ msgid "" "in their implementations." msgstr "" -#: ../../library/os.rst:566 +#: ../../library/os.rst:567 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:569 +#: ../../library/os.rst:570 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.putenv`` with arguments " "``key``, ``value``." @@ -725,23 +725,23 @@ msgstr "" "引發一個附帶引數 ``key``、``value`` 的\\ :ref:`稽核事件 <auditing>` ``os." "putenv``。" -#: ../../library/os.rst:571 +#: ../../library/os.rst:572 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:577 +#: ../../library/os.rst:578 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:584 +#: ../../library/os.rst:585 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:591 +#: ../../library/os.rst:592 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:598 +#: ../../library/os.rst:599 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 " @@ -749,7 +749,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:604 +#: ../../library/os.rst:605 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:" @@ -757,13 +757,13 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:611 +#: ../../library/os.rst:612 msgid "" "Reassociate the current thread with a Linux namespace. See the :manpage:" "`setns(2)` and :manpage:`namespaces(7)` man pages for more details." msgstr "" -#: ../../library/os.rst:615 +#: ../../library/os.rst:616 msgid "" "If *fd* refers to a :file:`/proc/{pid}/ns/` link, ``setns()`` reassociates " "the calling thread with the namespace associated with that link, and " @@ -772,7 +772,7 @@ msgid "" "constraints)." msgstr "" -#: ../../library/os.rst:622 +#: ../../library/os.rst:623 msgid "" "Since Linux 5.8, *fd* may refer to a PID file descriptor obtained from :func:" "`~os.pidfd_open`. In this case, ``setns()`` reassociates the calling thread " @@ -783,19 +783,19 @@ msgid "" "memberships in unspecified namespaces are left unchanged." msgstr "" -#: ../../library/os.rst:631 +#: ../../library/os.rst:632 msgid "" "*fd* can be any object with a :meth:`~io.IOBase.fileno` method, or a raw " "file descriptor." msgstr "" -#: ../../library/os.rst:633 +#: ../../library/os.rst:634 msgid "" "This example reassociates the thread with the ``init`` process's network " "namespace::" msgstr "" -#: ../../library/os.rst:635 +#: ../../library/os.rst:636 msgid "" "fd = os.open(\"/proc/1/ns/net\", os.O_RDONLY)\n" "os.setns(fd, os.CLONE_NEWNET)\n" @@ -805,25 +805,25 @@ msgstr "" "os.setns(fd, os.CLONE_NEWNET)\n" "os.close(fd)" -#: ../../library/os.rst:645 +#: ../../library/os.rst:646 msgid "The :func:`~os.unshare` function." msgstr ":func:`~os.unshare` 函式。" -#: ../../library/os.rst:649 +#: ../../library/os.rst:650 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:657 +#: ../../library/os.rst:658 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:668 +#: ../../library/os.rst:669 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -836,96 +836,96 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:685 +#: ../../library/os.rst:686 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:692 +#: ../../library/os.rst:693 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:701 +#: ../../library/os.rst:702 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:710 +#: ../../library/os.rst:711 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:717 +#: ../../library/os.rst:718 msgid "" "Call the system call :c:func:`!getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:724 +#: ../../library/os.rst:725 msgid "" "Call the system call :c:func:`!setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:733 +#: ../../library/os.rst:734 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:741 +#: ../../library/os.rst:742 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:748 +#: ../../library/os.rst:749 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:756 +#: ../../library/os.rst:757 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:768 +#: ../../library/os.rst:769 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:771 +#: ../../library/os.rst:772 msgid ":attr:`sysname` - operating system name" msgstr ":attr:`sysname` - 作業系統名稱" -#: ../../library/os.rst:772 +#: ../../library/os.rst:773 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:773 +#: ../../library/os.rst:774 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:774 +#: ../../library/os.rst:775 msgid ":attr:`version` - operating system version" msgstr ":attr:`version` - 作業系統版本" -#: ../../library/os.rst:775 +#: ../../library/os.rst:776 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:777 +#: ../../library/os.rst:778 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:782 +#: ../../library/os.rst:783 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:787 +#: ../../library/os.rst:788 msgid "" "On macOS, iOS and Android, this returns the *kernel* name and version (i.e., " "``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform." @@ -933,20 +933,20 @@ msgid "" "on iOS and Android." msgstr "" -#: ../../library/os.rst:794 ../../library/os.rst:5001 +#: ../../library/os.rst:795 ../../library/os.rst:5002 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:803 +#: ../../library/os.rst:804 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:807 +#: ../../library/os.rst:808 msgid "" "Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -954,18 +954,18 @@ msgid "" "items of :data:`os.environ`." msgstr "" -#: ../../library/os.rst:812 +#: ../../library/os.rst:813 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.unsetenv`` with argument " "``key``." msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 <auditing>` ``os.unsetenv``。" -#: ../../library/os.rst:814 +#: ../../library/os.rst:815 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:820 +#: ../../library/os.rst:821 msgid "" "Disassociate parts of the process execution context, and move them into a " "newly created namespace. See the :manpage:`unshare(2)` man page for more " @@ -976,28 +976,28 @@ msgid "" "are made to the calling process's execution context." msgstr "" -#: ../../library/os.rst:837 +#: ../../library/os.rst:838 msgid "The :func:`~os.setns` function." msgstr ":func:`~os.setns` 函式。" -#: ../../library/os.rst:841 +#: ../../library/os.rst:842 msgid "" "Flags to the :func:`unshare` function, if the implementation supports them. " "See :manpage:`unshare(2)` in the Linux manual for their exact effect and " "availability." msgstr "" -#: ../../library/os.rst:864 +#: ../../library/os.rst:865 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:866 +#: ../../library/os.rst:867 msgid "" "These functions create new :term:`file objects <file object>`. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:872 +#: ../../library/os.rst:873 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 " @@ -1005,16 +1005,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:881 +#: ../../library/os.rst:882 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:883 +#: ../../library/os.rst:884 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:885 +#: ../../library/os.rst:886 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 " @@ -1024,7 +1024,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:892 +#: ../../library/os.rst:893 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 " @@ -1032,11 +1032,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:900 +#: ../../library/os.rst:901 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:904 +#: ../../library/os.rst:905 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 " @@ -1044,13 +1044,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:912 +#: ../../library/os.rst:913 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:915 +#: ../../library/os.rst:916 msgid "" "for fd in range(fd_low, fd_high):\n" " try:\n" @@ -1064,7 +1064,7 @@ msgstr "" " except OSError:\n" " pass" -#: ../../library/os.rst:924 +#: ../../library/os.rst:925 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1072,14 +1072,14 @@ msgid "" "respectively for *offset_dst*." msgstr "" -#: ../../library/os.rst:929 +#: ../../library/os.rst:930 msgid "" "In Linux kernel older than 5.3, the files pointed to by *src* and *dst* must " "reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" "attr:`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:933 +#: ../../library/os.rst:934 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 " @@ -1089,19 +1089,19 @@ msgid "" "(in the case of NFS)." msgstr "" -#: ../../library/os.rst:940 +#: ../../library/os.rst:941 msgid "" "The function copies bytes between two file descriptors. Text options, like " "the encoding and the line ending, are ignored." msgstr "" -#: ../../library/os.rst:943 +#: ../../library/os.rst:944 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:948 +#: ../../library/os.rst:949 msgid "" "On Linux, :func:`os.copy_file_range` should not be used for copying a range " "of a pseudo file from a special filesystem like procfs and sysfs. It will " @@ -1109,39 +1109,39 @@ msgid "" "known Linux kernel issue." msgstr "" -#: ../../library/os.rst:960 +#: ../../library/os.rst:961 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:963 +#: ../../library/os.rst:964 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode <utf8-mode>` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:966 +#: ../../library/os.rst:967 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:972 +#: ../../library/os.rst:973 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:975 +#: ../../library/os.rst:976 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:981 ../../library/os.rst:1266 +#: ../../library/os.rst:982 ../../library/os.rst:1267 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:987 +#: ../../library/os.rst:988 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -1149,23 +1149,23 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:994 +#: ../../library/os.rst:995 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:997 +#: ../../library/os.rst:998 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:1003 +#: ../../library/os.rst:1004 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, " "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1007 ../../library/os.rst:2136 -#: ../../library/os.rst:2237 +#: ../../library/os.rst:1008 ../../library/os.rst:2137 +#: ../../library/os.rst:2238 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1173,29 +1173,29 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.chmod``。" -#: ../../library/os.rst:1011 ../../library/os.rst:1029 -#: ../../library/os.rst:1120 ../../library/os.rst:1705 -#: ../../library/os.rst:2133 ../../library/os.rst:2166 -#: ../../library/os.rst:3458 +#: ../../library/os.rst:1012 ../../library/os.rst:1030 +#: ../../library/os.rst:1121 ../../library/os.rst:1706 +#: ../../library/os.rst:2134 ../../library/os.rst:2167 +#: ../../library/os.rst:3459 msgid "" "The function is limited on WASI, see :ref:`wasm-availability` for more " "information." msgstr "" -#: ../../library/os.rst:1014 ../../library/os.rst:2244 +#: ../../library/os.rst:1015 ../../library/os.rst:2245 #, fuzzy msgid "Added support on Windows." msgstr "新增對 Windows 的支援。" -#: ../../library/os.rst:1020 +#: ../../library/os.rst:1021 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:" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1025 ../../library/os.rst:2162 -#: ../../library/os.rst:2253 +#: ../../library/os.rst:1026 ../../library/os.rst:2163 +#: ../../library/os.rst:2254 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1203,17 +1203,17 @@ msgstr "" "引發一個附帶引數 ``path``、``uid``、``gid``、``dir_fd`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.chown``。" -#: ../../library/os.rst:1035 +#: ../../library/os.rst:1036 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:1041 +#: ../../library/os.rst:1042 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:1046 +#: ../../library/os.rst:1047 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1224,7 +1224,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1054 ../../library/os.rst:2572 +#: ../../library/os.rst:1055 ../../library/os.rst:2573 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 " @@ -1232,53 +1232,53 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:1059 +#: ../../library/os.rst:1060 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:1066 +#: ../../library/os.rst:1067 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:1069 +#: ../../library/os.rst:1070 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1073 ../../library/os.rst:2400 +#: ../../library/os.rst:1074 ../../library/os.rst:2401 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:1078 +#: ../../library/os.rst:1079 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:1087 +#: ../../library/os.rst:1088 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:1090 +#: ../../library/os.rst:1091 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:1099 +#: ../../library/os.rst:1100 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." "truncate(fd, length)``." msgstr "" -#: ../../library/os.rst:1103 +#: ../../library/os.rst:1104 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.truncate`` with arguments " "``fd``, ``length``." @@ -1286,46 +1286,46 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 <auditing>` ``os." "truncate``。" -#: ../../library/os.rst:1107 ../../library/os.rst:3497 +#: ../../library/os.rst:1108 ../../library/os.rst:3498 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" -#: ../../library/os.rst:1113 +#: ../../library/os.rst:1114 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:1116 +#: ../../library/os.rst:1117 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`。" -#: ../../library/os.rst:1123 ../../library/os.rst:1708 +#: ../../library/os.rst:1124 ../../library/os.rst:1709 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1127 ../../library/os.rst:1712 +#: ../../library/os.rst:1128 ../../library/os.rst:1713 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" -#: ../../library/os.rst:1133 +#: ../../library/os.rst:1134 msgid "" "Grant access to the slave pseudo-terminal device associated with the master " "pseudo-terminal device to which the file descriptor *fd* refers. The file " "descriptor *fd* is not closed upon failure." msgstr "" -#: ../../library/os.rst:1137 +#: ../../library/os.rst:1138 msgid "Calls the C standard library function :c:func:`grantpt`." msgstr "" -#: ../../library/os.rst:1146 +#: ../../library/os.rst:1147 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:1152 +#: ../../library/os.rst:1153 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:" @@ -1333,7 +1333,7 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:1158 +#: ../../library/os.rst:1159 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." @@ -1341,119 +1341,119 @@ msgstr "" "引發一個附帶引數 ``fd``、``cmd``、``len`` 的\\ :ref:`稽核事件 <auditing>` " "``os.lockf``。" -#: ../../library/os.rst:1170 +#: ../../library/os.rst:1171 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:1179 +#: ../../library/os.rst:1180 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:1190 +#: ../../library/os.rst:1191 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *whence*, and return the new position in bytes relative to the start of " "the file. Valid values for *whence* are:" msgstr "" -#: ../../library/os.rst:1195 +#: ../../library/os.rst:1196 msgid "" ":const:`SEEK_SET` or ``0`` -- set *pos* relative to the beginning of the file" msgstr "" -#: ../../library/os.rst:1196 +#: ../../library/os.rst:1197 msgid "" ":const:`SEEK_CUR` or ``1`` -- set *pos* relative to the current file position" msgstr "" -#: ../../library/os.rst:1197 +#: ../../library/os.rst:1198 msgid ":const:`SEEK_END` or ``2`` -- set *pos* relative to the end of the file" msgstr "" -#: ../../library/os.rst:1198 +#: ../../library/os.rst:1199 msgid "" ":const:`SEEK_HOLE` -- set *pos* to the next data location, relative to *pos*" msgstr "" -#: ../../library/os.rst:1199 +#: ../../library/os.rst:1200 msgid "" ":const:`SEEK_DATA` -- set *pos* to the next data hole, relative to *pos*" msgstr "" -#: ../../library/os.rst:1203 +#: ../../library/os.rst:1204 msgid "Add support for :const:`!SEEK_HOLE` and :const:`!SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1210 +#: ../../library/os.rst:1211 msgid "" "Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " "method on :term:`file-like objects <file object>`, for whence to adjust the " "file position indicator." msgstr "" -#: ../../library/os.rst:1214 +#: ../../library/os.rst:1215 msgid ":const:`SEEK_SET`" msgstr ":const:`SEEK_SET`" -#: ../../library/os.rst:1215 +#: ../../library/os.rst:1216 msgid "Adjust the file position relative to the beginning of the file." msgstr "" -#: ../../library/os.rst:1216 +#: ../../library/os.rst:1217 msgid ":const:`SEEK_CUR`" msgstr ":const:`SEEK_CUR`" -#: ../../library/os.rst:1217 +#: ../../library/os.rst:1218 msgid "Adjust the file position relative to the current file position." msgstr "" -#: ../../library/os.rst:1218 +#: ../../library/os.rst:1219 msgid ":const:`SEEK_END`" msgstr ":const:`SEEK_END`" -#: ../../library/os.rst:1219 +#: ../../library/os.rst:1220 msgid "Adjust the file position relative to the end of the file." msgstr "" -#: ../../library/os.rst:1221 +#: ../../library/os.rst:1222 msgid "Their values are 0, 1, and 2, respectively." msgstr "" -#: ../../library/os.rst:1227 +#: ../../library/os.rst:1228 msgid "" "Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " "method on :term:`file-like objects <file object>`, for seeking file data and " "holes on sparsely allocated files." msgstr "" -#: ../../library/os.rst:1231 +#: ../../library/os.rst:1232 msgid ":data:`!SEEK_DATA`" msgstr ":data:`!SEEK_DATA`" -#: ../../library/os.rst:1232 +#: ../../library/os.rst:1233 msgid "" "Adjust the file offset to the next location containing data, relative to the " "seek position." msgstr "" -#: ../../library/os.rst:1235 +#: ../../library/os.rst:1236 msgid ":data:`!SEEK_HOLE`" msgstr ":data:`!SEEK_HOLE`" -#: ../../library/os.rst:1236 +#: ../../library/os.rst:1237 msgid "" "Adjust the file offset to the next location containing a hole, relative to " "the seek position. A hole is defined as a sequence of zeros." msgstr "" -#: ../../library/os.rst:1242 +#: ../../library/os.rst:1243 msgid "These operations only make sense for filesystems that support them." msgstr "" -#: ../../library/os.rst:1251 +#: ../../library/os.rst:1252 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 " @@ -1461,7 +1461,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:1256 +#: ../../library/os.rst:1257 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`) " @@ -1469,13 +1469,13 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1261 +#: ../../library/os.rst:1262 msgid "" "This function can support :ref:`paths relative to directory descriptors " "<dir_fd>` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1264 +#: ../../library/os.rst:1265 msgid "" "Raises an :ref:`auditing event <auditing>` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1483,7 +1483,7 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "<auditing>` ``open``。" -#: ../../library/os.rst:1271 +#: ../../library/os.rst:1272 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 :" @@ -1491,41 +1491,41 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1276 ../../library/os.rst:2405 -#: ../../library/os.rst:2445 ../../library/os.rst:2516 -#: ../../library/os.rst:2538 ../../library/os.rst:2619 -#: ../../library/os.rst:2649 ../../library/os.rst:2756 -#: ../../library/os.rst:3513 +#: ../../library/os.rst:1277 ../../library/os.rst:2406 +#: ../../library/os.rst:2446 ../../library/os.rst:2517 +#: ../../library/os.rst:2539 ../../library/os.rst:2620 +#: ../../library/os.rst:2650 ../../library/os.rst:2757 +#: ../../library/os.rst:3514 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:1279 ../../library/os.rst:1630 -#: ../../library/os.rst:1819 ../../library/os.rst:5097 +#: ../../library/os.rst:1280 ../../library/os.rst:1631 +#: ../../library/os.rst:1820 ../../library/os.rst:5098 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:1284 ../../library/os.rst:2029 -#: ../../library/os.rst:2061 ../../library/os.rst:2092 -#: ../../library/os.rst:2142 ../../library/os.rst:2183 -#: ../../library/os.rst:2223 ../../library/os.rst:2241 -#: ../../library/os.rst:2257 ../../library/os.rst:2316 -#: ../../library/os.rst:2408 ../../library/os.rst:2448 -#: ../../library/os.rst:2492 ../../library/os.rst:2519 -#: ../../library/os.rst:2541 ../../library/os.rst:2582 -#: ../../library/os.rst:2652 ../../library/os.rst:2671 -#: ../../library/os.rst:2759 ../../library/os.rst:3049 -#: ../../library/os.rst:3336 ../../library/os.rst:3500 -#: ../../library/os.rst:3516 ../../library/os.rst:3556 -#: ../../library/os.rst:3656 ../../library/os.rst:3717 -#: ../../library/os.rst:4114 ../../library/os.rst:4294 -#: ../../library/os.rst:4859 +#: ../../library/os.rst:1285 ../../library/os.rst:2030 +#: ../../library/os.rst:2062 ../../library/os.rst:2093 +#: ../../library/os.rst:2143 ../../library/os.rst:2184 +#: ../../library/os.rst:2224 ../../library/os.rst:2242 +#: ../../library/os.rst:2258 ../../library/os.rst:2317 +#: ../../library/os.rst:2409 ../../library/os.rst:2449 +#: ../../library/os.rst:2493 ../../library/os.rst:2520 +#: ../../library/os.rst:2542 ../../library/os.rst:2583 +#: ../../library/os.rst:2653 ../../library/os.rst:2672 +#: ../../library/os.rst:2760 ../../library/os.rst:3050 +#: ../../library/os.rst:3337 ../../library/os.rst:3501 +#: ../../library/os.rst:3517 ../../library/os.rst:3557 +#: ../../library/os.rst:3657 ../../library/os.rst:3718 +#: ../../library/os.rst:4115 ../../library/os.rst:4295 +#: ../../library/os.rst:4860 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1287 +#: ../../library/os.rst:1288 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 ``|" @@ -1535,45 +1535,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1302 +#: ../../library/os.rst:1303 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1313 +#: ../../library/os.rst:1314 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1315 +#: ../../library/os.rst:1316 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1326 +#: ../../library/os.rst:1327 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1333 +#: ../../library/os.rst:1334 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1335 +#: ../../library/os.rst:1336 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1349 +#: ../../library/os.rst:1350 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1352 +#: ../../library/os.rst:1353 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:1362 +#: ../../library/os.rst:1363 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 " @@ -1581,18 +1581,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1369 ../../library/os.rst:1381 +#: ../../library/os.rst:1370 ../../library/os.rst:1382 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1375 +#: ../../library/os.rst:1376 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 <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:1387 +#: ../../library/os.rst:1388 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:" @@ -1600,13 +1600,13 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1400 +#: ../../library/os.rst:1401 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:1410 +#: ../../library/os.rst:1411 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 " @@ -1617,43 +1617,43 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1430 +#: ../../library/os.rst:1431 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:1440 +#: ../../library/os.rst:1441 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1443 ../../library/os.rst:1619 +#: ../../library/os.rst:1444 ../../library/os.rst:1620 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:1453 +#: ../../library/os.rst:1454 msgid "Open and return a file descriptor for a master pseudo-terminal device." msgstr "" -#: ../../library/os.rst:1455 +#: ../../library/os.rst:1456 msgid "" "Calls the C standard library function :c:func:`posix_openpt`. The *oflag* " "argument is used to set file status flags and file access modes as specified " "in the manual page of :c:func:`posix_openpt` of your system." msgstr "" -#: ../../library/os.rst:1459 +#: ../../library/os.rst:1460 msgid "" "The returned file descriptor is :ref:`non-inheritable <fd_inheritance>`. If " "the value :data:`O_CLOEXEC` is available on the system, it is added to " "*oflag*." msgstr "" -#: ../../library/os.rst:1470 +#: ../../library/os.rst:1471 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects <bytes-like object>` *buffers*, leaving the file " @@ -1661,92 +1661,92 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1475 ../../library/os.rst:1560 +#: ../../library/os.rst:1476 ../../library/os.rst:1561 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1478 +#: ../../library/os.rst:1479 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1479 +#: ../../library/os.rst:1480 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1481 ../../library/os.rst:1756 +#: ../../library/os.rst:1482 ../../library/os.rst:1757 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:1484 ../../library/os.rst:1569 -#: ../../library/os.rst:1759 ../../library/os.rst:1834 +#: ../../library/os.rst:1485 ../../library/os.rst:1570 +#: ../../library/os.rst:1760 ../../library/os.rst:1835 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:1487 +#: ../../library/os.rst:1488 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1491 ../../library/os.rst:1576 +#: ../../library/os.rst:1492 ../../library/os.rst:1577 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1498 +#: ../../library/os.rst:1499 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:1502 +#: ../../library/os.rst:1503 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 :const:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1513 +#: ../../library/os.rst:1514 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:1517 +#: ../../library/os.rst:1518 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1527 +#: ../../library/os.rst:1528 msgid "" "Return the name of the slave pseudo-terminal device associated with the " "master pseudo-terminal device to which the file descriptor *fd* refers. The " "file descriptor *fd* is not closed upon failure." msgstr "" -#: ../../library/os.rst:1531 +#: ../../library/os.rst:1532 msgid "" "Calls the reentrant C standard library function :c:func:`ptsname_r` if it is " "available; otherwise, the C standard library function :c:func:`ptsname`, " "which is not guaranteed to be thread-safe, is called." msgstr "" -#: ../../library/os.rst:1542 +#: ../../library/os.rst:1543 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1545 ../../library/os.rst:1809 +#: ../../library/os.rst:1546 ../../library/os.rst:1810 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1554 +#: ../../library/os.rst:1555 msgid "" "Write the *buffers* contents to file descriptor *fd* at an offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1755,39 +1755,39 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1563 +#: ../../library/os.rst:1564 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1564 +#: ../../library/os.rst:1565 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1565 +#: ../../library/os.rst:1566 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1567 +#: ../../library/os.rst:1568 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1572 +#: ../../library/os.rst:1573 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1583 +#: ../../library/os.rst:1584 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:1593 +#: ../../library/os.rst:1594 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:1603 +#: ../../library/os.rst:1604 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 " @@ -1797,11 +1797,11 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1617 +#: ../../library/os.rst:1618 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1624 +#: ../../library/os.rst:1625 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 " @@ -1810,26 +1810,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1639 +#: ../../library/os.rst:1640 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:1643 +#: ../../library/os.rst:1644 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1646 +#: ../../library/os.rst:1647 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:1649 +#: ../../library/os.rst:1650 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 " @@ -1837,58 +1837,58 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1653 +#: ../../library/os.rst:1654 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:1656 +#: ../../library/os.rst:1657 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:1659 +#: ../../library/os.rst:1660 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1666 +#: ../../library/os.rst:1667 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1671 +#: ../../library/os.rst:1672 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1679 +#: ../../library/os.rst:1680 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1688 +#: ../../library/os.rst:1689 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:1698 +#: ../../library/os.rst:1699 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:1701 +#: ../../library/os.rst:1702 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`。" -#: ../../library/os.rst:1718 +#: ../../library/os.rst:1719 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1900,7 +1900,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1727 +#: ../../library/os.rst:1728 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 " @@ -1908,7 +1908,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1732 +#: ../../library/os.rst:1733 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, " @@ -1917,7 +1917,7 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1751 +#: ../../library/os.rst:1752 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects <bytes-like object>` *buffers*. Transfer data into each buffer until " @@ -1925,41 +1925,41 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1769 +#: ../../library/os.rst:1770 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:1777 +#: ../../library/os.rst:1778 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:1785 +#: ../../library/os.rst:1786 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:1794 +#: ../../library/os.rst:1795 msgid "" "Unlock the slave pseudo-terminal device associated with the master pseudo-" "terminal device to which the file descriptor *fd* refers. The file " "descriptor *fd* is not closed upon failure." msgstr "" -#: ../../library/os.rst:1798 +#: ../../library/os.rst:1799 msgid "Calls the C standard library function :c:func:`unlockpt`." msgstr "" -#: ../../library/os.rst:1807 +#: ../../library/os.rst:1808 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1813 +#: ../../library/os.rst:1814 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 " @@ -1968,7 +1968,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1827 +#: ../../library/os.rst:1828 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects <bytes-like object>`. Buffers are " @@ -1976,70 +1976,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1832 +#: ../../library/os.rst:1833 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1845 +#: ../../library/os.rst:1846 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1851 +#: ../../library/os.rst:1852 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1854 +#: ../../library/os.rst:1855 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1857 +#: ../../library/os.rst:1858 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1860 +#: ../../library/os.rst:1861 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:1868 +#: ../../library/os.rst:1869 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1872 +#: ../../library/os.rst:1873 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1876 +#: ../../library/os.rst:1877 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1882 +#: ../../library/os.rst:1883 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1886 +#: ../../library/os.rst:1887 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:1890 +#: ../../library/os.rst:1891 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:1893 +#: ../../library/os.rst:1894 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, " @@ -2050,38 +2050,38 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1901 +#: ../../library/os.rst:1902 msgid "On WebAssembly platforms, the file descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1905 +#: ../../library/os.rst:1906 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1909 +#: ../../library/os.rst:1910 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1913 +#: ../../library/os.rst:1914 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1919 +#: ../../library/os.rst:1920 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1927 +#: ../../library/os.rst:1928 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1929 +#: ../../library/os.rst:1930 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1934 +#: ../../library/os.rst:1935 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. " @@ -2092,7 +2092,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1943 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 " @@ -2100,13 +2100,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1947 +#: ../../library/os.rst:1948 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:1952 +#: ../../library/os.rst:1953 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 " @@ -2117,14 +2117,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1959 +#: ../../library/os.rst:1960 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:1965 +#: ../../library/os.rst:1966 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 " @@ -2133,14 +2133,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:1972 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:1979 +#: ../../library/os.rst:1980 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 " @@ -2152,13 +2152,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1988 +#: ../../library/os.rst:1989 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors <dir_fd>` and :ref:`not following symlinks <follow_symlinks>`." msgstr "" -#: ../../library/os.rst:1991 +#: ../../library/os.rst:1992 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2167,7 +2167,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1999 +#: ../../library/os.rst:2000 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 " @@ -2176,7 +2176,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2006 msgid "" "if os.access(\"myfile\", os.R_OK):\n" " with open(\"myfile\") as fp:\n" @@ -2188,11 +2188,11 @@ msgstr "" " return fp.read()\n" "return \"some default data\"" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2011 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2013 msgid "" "try:\n" " fp = open(\"myfile\")\n" @@ -2210,113 +2210,113 @@ msgstr "" " with fp:\n" " return fp.read()" -#: ../../library/os.rst:2022 +#: ../../library/os.rst:2023 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:2026 +#: ../../library/os.rst:2027 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*、*effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:2038 +#: ../../library/os.rst:2039 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:2047 +#: ../../library/os.rst:2048 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:2049 +#: ../../library/os.rst:2050 msgid "" "This function can support :ref:`specifying a file descriptor <path_fd>`. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:2052 +#: ../../library/os.rst:2053 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:2055 ../../library/os.rst:2193 +#: ../../library/os.rst:2056 ../../library/os.rst:2194 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 <auditing>` ``os.chdir``。" -#: ../../library/os.rst:2057 +#: ../../library/os.rst:2058 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:2067 +#: ../../library/os.rst:2068 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:2070 +#: ../../library/os.rst:2071 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:2071 +#: ../../library/os.rst:2072 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:2072 +#: ../../library/os.rst:2073 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:2073 +#: ../../library/os.rst:2074 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:2074 +#: ../../library/os.rst:2075 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:2075 +#: ../../library/os.rst:2076 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:2076 +#: ../../library/os.rst:2077 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:2077 +#: ../../library/os.rst:2078 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:2078 +#: ../../library/os.rst:2079 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:2079 +#: ../../library/os.rst:2080 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:2080 +#: ../../library/os.rst:2081 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:2081 +#: ../../library/os.rst:2082 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:2083 +#: ../../library/os.rst:2084 msgid "" "This function can support :ref:`not following symlinks <follow_symlinks>`." msgstr "" -#: ../../library/os.rst:2085 ../../library/os.rst:2219 +#: ../../library/os.rst:2086 ../../library/os.rst:2220 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2324,102 +2324,102 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 <auditing>` ``os." "chflags``。" -#: ../../library/os.rst:2089 +#: ../../library/os.rst:2090 msgid "Added the *follow_symlinks* parameter." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/os.rst:2098 +#: ../../library/os.rst:2099 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:2102 +#: ../../library/os.rst:2103 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:2103 +#: ../../library/os.rst:2104 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:2104 +#: ../../library/os.rst:2105 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:2105 +#: ../../library/os.rst:2106 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:2106 +#: ../../library/os.rst:2107 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2107 +#: ../../library/os.rst:2108 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2108 +#: ../../library/os.rst:2109 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2109 +#: ../../library/os.rst:2110 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2110 +#: ../../library/os.rst:2111 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2111 +#: ../../library/os.rst:2112 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2112 +#: ../../library/os.rst:2113 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2113 +#: ../../library/os.rst:2114 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2114 +#: ../../library/os.rst:2115 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2115 +#: ../../library/os.rst:2116 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2116 +#: ../../library/os.rst:2117 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2118 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2118 +#: ../../library/os.rst:2119 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2119 +#: ../../library/os.rst:2120 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2120 +#: ../../library/os.rst:2121 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2122 ../../library/os.rst:2155 -#: ../../library/os.rst:3546 +#: ../../library/os.rst:2123 ../../library/os.rst:2156 +#: ../../library/os.rst:3547 msgid "" "This function can support :ref:`specifying a file descriptor <path_fd>`, :" "ref:`paths relative to directory descriptors <dir_fd>` and :ref:`not " "following symlinks <follow_symlinks>`." msgstr "" -#: ../../library/os.rst:2128 +#: ../../library/os.rst:2129 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 " @@ -2427,68 +2427,68 @@ msgid "" "value of *follow_symlinks* is ``False`` on Windows." msgstr "" -#: ../../library/os.rst:2138 ../../library/os.rst:2169 +#: ../../library/os.rst:2139 ../../library/os.rst:2170 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2145 +#: ../../library/os.rst:2146 msgid "" "Added support for a file descriptor and the *follow_symlinks* argument on " "Windows." msgstr "" -#: ../../library/os.rst:2152 +#: ../../library/os.rst:2153 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:2159 +#: ../../library/os.rst:2160 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2173 +#: ../../library/os.rst:2174 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2179 +#: ../../library/os.rst:2180 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2189 +#: ../../library/os.rst:2190 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:2200 +#: ../../library/os.rst:2201 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2205 +#: ../../library/os.rst:2206 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2207 +#: ../../library/os.rst:2208 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:2215 +#: ../../library/os.rst:2216 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:2229 +#: ../../library/os.rst:2230 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` " @@ -2496,31 +2496,31 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2234 +#: ../../library/os.rst:2235 msgid "" "``lchmod()`` is not part of POSIX, but Unix implementations may have it if " "changing the mode of symbolic links is supported." msgstr "" -#: ../../library/os.rst:2249 +#: ../../library/os.rst:2250 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:2263 +#: ../../library/os.rst:2264 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2265 +#: ../../library/os.rst:2266 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors <dir_fd>`, and :ref:" "`not following symlinks <follow_symlinks>`." msgstr "" -#: ../../library/os.rst:2269 +#: ../../library/os.rst:2270 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2528,20 +2528,20 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 <auditing>` ``os.link``。" -#: ../../library/os.rst:2273 ../../library/os.rst:4543 +#: ../../library/os.rst:2274 ../../library/os.rst:4544 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2276 +#: ../../library/os.rst:2277 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* parameters." msgstr "新增 *src_dir_fd*、*dst_dir_fd* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:2279 ../../library/os.rst:2703 -#: ../../library/os.rst:2740 ../../library/os.rst:3468 +#: ../../library/os.rst:2280 ../../library/os.rst:2704 +#: ../../library/os.rst:2741 ../../library/os.rst:3469 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2285 +#: ../../library/os.rst:2286 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 " @@ -2550,7 +2550,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2291 +#: ../../library/os.rst:2292 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2558,42 +2558,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2296 ../../library/os.rst:2788 +#: ../../library/os.rst:2297 ../../library/os.rst:2789 msgid "" "This function can also support :ref:`specifying a file descriptor " "<path_fd>`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2299 +#: ../../library/os.rst:2300 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 <auditing>` ``os.listdir``。" -#: ../../library/os.rst:2302 +#: ../../library/os.rst:2303 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2306 +#: ../../library/os.rst:2307 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:2310 +#: ../../library/os.rst:2311 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2313 ../../library/os.rst:3327 +#: ../../library/os.rst:2314 ../../library/os.rst:3328 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2322 +#: ../../library/os.rst:2323 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2324 +#: ../../library/os.rst:2325 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2601,22 +2601,22 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2329 +#: ../../library/os.rst:2330 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2333 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``os.listdrives``。" -#: ../../library/os.rst:2341 +#: ../../library/os.rst:2342 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2344 +#: ../../library/os.rst:2345 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2624,19 +2624,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2350 +#: ../../library/os.rst:2351 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2353 +#: ../../library/os.rst:2354 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2356 +#: ../../library/os.rst:2357 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.listmounts`` with argument " "``volume``." @@ -2644,11 +2644,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 <auditing>` ``os." "listmounts``。" -#: ../../library/os.rst:2365 +#: ../../library/os.rst:2366 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2367 +#: ../../library/os.rst:2368 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2657,49 +2657,49 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2374 +#: ../../library/os.rst:2375 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2377 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``os.listvolumes``。" -#: ../../library/os.rst:2385 +#: ../../library/os.rst:2386 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:2389 +#: ../../library/os.rst:2390 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2392 +#: ../../library/os.rst:2393 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2395 ../../library/os.rst:2437 -#: ../../library/os.rst:2505 ../../library/os.rst:2533 -#: ../../library/os.rst:2607 +#: ../../library/os.rst:2396 ../../library/os.rst:2438 +#: ../../library/os.rst:2506 ../../library/os.rst:2534 +#: ../../library/os.rst:2608 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "<dir_fd>`." msgstr "" -#: ../../library/os.rst:2402 ../../library/os.rst:2616 -#: ../../library/os.rst:3461 +#: ../../library/os.rst:2403 ../../library/os.rst:2617 +#: ../../library/os.rst:3462 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2411 +#: ../../library/os.rst:2412 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2707,18 +2707,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2420 +#: ../../library/os.rst:2421 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2422 +#: ../../library/os.rst:2423 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:2427 +#: ../../library/os.rst:2428 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 " @@ -2727,20 +2727,20 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2433 +#: ../../library/os.rst:2434 msgid "" "On Windows, a *mode* of ``0o700`` is specifically handled to apply access " "control to the new directory such that only the current user and " "administrators have access. Other values of *mode* are ignored." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2441 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2443 ../../library/os.rst:2480 +#: ../../library/os.rst:2444 ../../library/os.rst:2481 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2748,17 +2748,17 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.mkdir``。" -#: ../../library/os.rst:2451 +#: ../../library/os.rst:2452 msgid "Windows now handles a *mode* of ``0o700``." msgstr "" -#: ../../library/os.rst:2461 +#: ../../library/os.rst:2462 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2464 +#: ../../library/os.rst:2465 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description <mkdir_modebits>` for how it is " @@ -2767,27 +2767,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2470 +#: ../../library/os.rst:2471 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2475 +#: ../../library/os.rst:2476 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2478 +#: ../../library/os.rst:2479 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2482 +#: ../../library/os.rst:2483 msgid "Added the *exist_ok* parameter." msgstr "新增 *exist_ok* 參數。" -#: ../../library/os.rst:2487 +#: ../../library/os.rst:2488 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 " @@ -2795,19 +2795,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2495 +#: ../../library/os.rst:2496 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2502 +#: ../../library/os.rst:2503 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:2508 +#: ../../library/os.rst:2509 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 " @@ -2817,7 +2817,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2526 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 " @@ -2828,23 +2828,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2547 +#: ../../library/os.rst:2548 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2553 +#: ../../library/os.rst:2554 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2559 +#: ../../library/os.rst:2560 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2564 +#: ../../library/os.rst:2565 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2855,20 +2855,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2577 ../../library/os.rst:3320 -#: ../../library/os.rst:3489 +#: ../../library/os.rst:2578 ../../library/os.rst:3321 +#: ../../library/os.rst:3490 msgid "" "This function can support :ref:`specifying a file descriptor <path_fd>`." msgstr "" -#: ../../library/os.rst:2588 +#: ../../library/os.rst:2589 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:2597 +#: ../../library/os.rst:2598 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 " @@ -2876,7 +2876,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2602 +#: ../../library/os.rst:2603 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 " @@ -2884,42 +2884,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2610 +#: ../../library/os.rst:2611 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:2622 +#: ../../library/os.rst:2623 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2626 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2628 +#: ../../library/os.rst:2629 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:2634 +#: ../../library/os.rst:2635 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:2638 ../../library/os.rst:2751 -#: ../../library/os.rst:3440 +#: ../../library/os.rst:2639 ../../library/os.rst:2752 +#: ../../library/os.rst:3441 msgid "" "This function can support :ref:`paths relative to directory descriptors " "<dir_fd>`." msgstr "" -#: ../../library/os.rst:2641 +#: ../../library/os.rst:2642 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 " @@ -2927,12 +2927,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2645 +#: ../../library/os.rst:2646 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2647 ../../library/os.rst:2669 -#: ../../library/os.rst:3511 +#: ../../library/os.rst:2648 ../../library/os.rst:2670 +#: ../../library/os.rst:3512 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2940,7 +2940,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 <auditing>` ``os." "remove``。" -#: ../../library/os.rst:2660 +#: ../../library/os.rst:2661 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2952,20 +2952,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2677 +#: ../../library/os.rst:2678 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:2680 +#: ../../library/os.rst:2681 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:2684 +#: ../../library/os.rst:2685 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 " @@ -2977,20 +2977,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2693 ../../library/os.rst:2733 +#: ../../library/os.rst:2694 ../../library/os.rst:2734 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors <dir_fd>`." msgstr "" -#: ../../library/os.rst:2696 +#: ../../library/os.rst:2697 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2698 ../../library/os.rst:2719 -#: ../../library/os.rst:2736 +#: ../../library/os.rst:2699 ../../library/os.rst:2720 +#: ../../library/os.rst:2737 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2998,11 +2998,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 <auditing>` ``os.rename``。" -#: ../../library/os.rst:2700 +#: ../../library/os.rst:2701 msgid "Added the *src_dir_fd* and *dst_dir_fd* parameters." msgstr "新增 *src_dir_fd* 與 *dst_dir_fd* 參數。" -#: ../../library/os.rst:2709 +#: ../../library/os.rst:2710 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -3011,17 +3011,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2716 +#: ../../library/os.rst:2717 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:2721 +#: ../../library/os.rst:2722 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2727 +#: ../../library/os.rst:2728 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 " @@ -3030,7 +3030,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2746 +#: ../../library/os.rst:2747 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 " @@ -3038,7 +3038,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2754 +#: ../../library/os.rst:2755 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -3046,7 +3046,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 <auditing>` ``os." "rmdir``。" -#: ../../library/os.rst:2765 +#: ../../library/os.rst:2766 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -3056,7 +3056,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2772 +#: ../../library/os.rst:2773 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -3068,7 +3068,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2783 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 " @@ -3077,31 +3077,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2791 +#: ../../library/os.rst:2792 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 <auditing>` ``os.scandir``。" -#: ../../library/os.rst:2793 +#: ../../library/os.rst:2794 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2798 +#: ../../library/os.rst:2799 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2800 +#: ../../library/os.rst:2801 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:2807 +#: ../../library/os.rst:2808 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 " @@ -3109,7 +3109,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2812 +#: ../../library/os.rst:2813 msgid "" "with os.scandir(path) as it:\n" " for entry in it:\n" @@ -3121,7 +3121,7 @@ msgstr "" " if not entry.name.startswith('.') and entry.is_file():\n" " print(entry.name)" -#: ../../library/os.rst:2819 +#: ../../library/os.rst:2820 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() <https://" "pubs.opengroup.org/onlinepubs/009695399/functions/opendir.html>`_ and " @@ -3132,7 +3132,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2831 +#: ../../library/os.rst:2832 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close` method. If a :func:`scandir` iterator is neither exhausted " @@ -3140,28 +3140,28 @@ msgid "" "destructor." msgstr "" -#: ../../library/os.rst:2837 +#: ../../library/os.rst:2838 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2839 +#: ../../library/os.rst:2840 msgid "Added support for :ref:`file descriptors <path_fd>` on Unix." msgstr "" -#: ../../library/os.rst:2845 +#: ../../library/os.rst:2846 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2848 +#: ../../library/os.rst:2849 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:2852 +#: ../../library/os.rst:2853 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 " @@ -3169,7 +3169,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2857 +#: ../../library/os.rst:2858 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 " @@ -3177,29 +3177,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2862 +#: ../../library/os.rst:2863 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2865 +#: ../../library/os.rst:2866 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2869 +#: ../../library/os.rst:2870 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2873 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:2878 +#: ../../library/os.rst:2879 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 " @@ -3209,51 +3209,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2885 +#: ../../library/os.rst:2886 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:2891 +#: ../../library/os.rst:2892 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2893 +#: ../../library/os.rst:2894 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:2897 +#: ../../library/os.rst:2898 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2902 +#: ../../library/os.rst:2903 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:2906 +#: ../../library/os.rst:2907 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:2910 +#: ../../library/os.rst:2911 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:2914 +#: ../../library/os.rst:2915 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 " @@ -3263,46 +3263,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2921 ../../library/os.rst:2951 +#: ../../library/os.rst:2922 ../../library/os.rst:2952 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2926 +#: ../../library/os.rst:2927 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:2930 +#: ../../library/os.rst:2931 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:2934 +#: ../../library/os.rst:2935 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:2939 +#: ../../library/os.rst:2940 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:2943 +#: ../../library/os.rst:2944 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:2946 +#: ../../library/os.rst:2947 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 " @@ -3310,48 +3310,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2956 +#: ../../library/os.rst:2957 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2960 +#: ../../library/os.rst:2961 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2967 +#: ../../library/os.rst:2968 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:2971 +#: ../../library/os.rst:2972 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:2976 +#: ../../library/os.rst:2977 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:2980 +#: ../../library/os.rst:2981 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:2984 +#: ../../library/os.rst:2985 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3359,13 +3359,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2992 +#: ../../library/os.rst:2993 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2996 +#: ../../library/os.rst:2997 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3373,7 +3373,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:3006 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 " @@ -3382,21 +3382,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:3011 +#: ../../library/os.rst:3012 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:3014 ../../library/os.rst:4093 -#: ../../library/os.rst:4109 ../../library/os.rst:4125 -#: ../../library/os.rst:4145 +#: ../../library/os.rst:3015 ../../library/os.rst:4094 +#: ../../library/os.rst:4110 ../../library/os.rst:4126 +#: ../../library/os.rst:4146 msgid "" "This function can support :ref:`specifying a file descriptor <path_fd>` and :" "ref:`not following symlinks <follow_symlinks>`." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3018 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3410,11 +3410,11 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:3030 ../../library/os.rst:3800 +#: ../../library/os.rst:3031 ../../library/os.rst:3801 msgid "Example::" msgstr "範例: ::" -#: ../../library/os.rst:3032 +#: ../../library/os.rst:3033 msgid "" ">>> import os\n" ">>> statinfo = os.stat('somefile.txt')\n" @@ -3434,17 +3434,17 @@ msgstr "" ">>> statinfo.st_size\n" "264" -#: ../../library/os.rst:3043 +#: ../../library/os.rst:3044 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:3045 +#: ../../library/os.rst:3046 msgid "" "Added the *dir_fd* and *follow_symlinks* parameters, specifying a file " "descriptor instead of a path." msgstr "新增 *dir_fd* 與 *follow_symlinks* 參數,指定一個檔案描述器而非路徑。" -#: ../../library/os.rst:3052 +#: ../../library/os.rst:3053 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3454,122 +3454,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:3063 +#: ../../library/os.rst:3064 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:3067 +#: ../../library/os.rst:3068 msgid "Attributes:" msgstr "屬性:" -#: ../../library/os.rst:3071 +#: ../../library/os.rst:3072 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:3075 +#: ../../library/os.rst:3076 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:3078 +#: ../../library/os.rst:3079 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:3079 +#: ../../library/os.rst:3080 msgid "" "the `file index <https://msdn.microsoft.com/en-us/library/aa363788>`_ on " "Windows" msgstr "" -#: ../../library/os.rst:3085 +#: ../../library/os.rst:3086 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3089 +#: ../../library/os.rst:3090 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3093 +#: ../../library/os.rst:3094 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3097 +#: ../../library/os.rst:3098 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3101 +#: ../../library/os.rst:3102 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:3105 +#: ../../library/os.rst:3106 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3109 +#: ../../library/os.rst:3110 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3113 +#: ../../library/os.rst:3114 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3117 +#: ../../library/os.rst:3118 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3120 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3126 +#: ../../library/os.rst:3127 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3132 +#: ../../library/os.rst:3133 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3139 +#: ../../library/os.rst:3140 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3144 +#: ../../library/os.rst:3145 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3151 +#: ../../library/os.rst:3152 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3154 +#: ../../library/os.rst:3155 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3159 +#: ../../library/os.rst:3160 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3167 +#: ../../library/os.rst:3168 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3579,7 +3579,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3175 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3592,74 +3592,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3184 +#: ../../library/os.rst:3185 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3189 +#: ../../library/os.rst:3190 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:3194 +#: ../../library/os.rst:3195 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:3199 +#: ../../library/os.rst:3200 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3203 +#: ../../library/os.rst:3204 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3205 +#: ../../library/os.rst:3206 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:3210 +#: ../../library/os.rst:3211 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3212 +#: ../../library/os.rst:3213 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3217 +#: ../../library/os.rst:3218 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3220 +#: ../../library/os.rst:3221 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3224 +#: ../../library/os.rst:3225 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3228 +#: ../../library/os.rst:3229 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3232 +#: ../../library/os.rst:3233 msgid "File type." msgstr "" -#: ../../library/os.rst:3234 +#: ../../library/os.rst:3235 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3238 +#: ../../library/os.rst:3239 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3667,7 +3667,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3249 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3675,14 +3675,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3253 +#: ../../library/os.rst:3254 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3258 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 " @@ -3694,49 +3694,49 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3266 +#: ../../library/os.rst:3267 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3270 +#: ../../library/os.rst:3271 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3274 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3276 +#: ../../library/os.rst:3277 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:3281 +#: ../../library/os.rst:3282 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3287 +#: ../../library/os.rst:3288 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3291 +#: ../../library/os.rst:3292 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3295 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "在 Windows 上新增 :attr:`st_birthtime` 成員。" -#: ../../library/os.rst:3299 +#: ../../library/os.rst:3300 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 " @@ -3746,7 +3746,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3306 +#: ../../library/os.rst:3307 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-" @@ -3754,7 +3754,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3311 +#: ../../library/os.rst:3312 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3767,11 +3767,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3324 +#: ../../library/os.rst:3325 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3330 +#: ../../library/os.rst:3331 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3779,11 +3779,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3339 +#: ../../library/os.rst:3340 msgid "Added the :attr:`f_fsid` attribute." msgstr "新增 :attr:`f_fsid` 屬性。" -#: ../../library/os.rst:3345 +#: ../../library/os.rst:3346 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3795,7 +3795,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3355 +#: ../../library/os.rst:3356 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 " @@ -3803,17 +3803,17 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3360 +#: ../../library/os.rst:3361 msgid "os.stat in os.supports_dir_fd" msgstr "os.stat in os.supports_dir_fd" -#: ../../library/os.rst:3362 +#: ../../library/os.rst:3363 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3370 +#: ../../library/os.rst:3371 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3822,23 +3822,23 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3376 +#: ../../library/os.rst:3377 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3379 +#: ../../library/os.rst:3380 msgid "os.access in os.supports_effective_ids" msgstr "os.access in os.supports_effective_ids" -#: ../../library/os.rst:3381 +#: ../../library/os.rst:3382 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3389 +#: ../../library/os.rst:3390 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 " @@ -3847,7 +3847,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3396 +#: ../../library/os.rst:3397 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3856,11 +3856,11 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3402 +#: ../../library/os.rst:3403 msgid "os.chdir in os.supports_fd" msgstr "os.chdir in os.supports_fd" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3410 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3873,7 +3873,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3419 +#: ../../library/os.rst:3420 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3882,15 +3882,15 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3425 +#: ../../library/os.rst:3426 msgid "os.stat in os.supports_follow_symlinks" msgstr "os.stat in os.supports_follow_symlinks" -#: ../../library/os.rst:3432 +#: ../../library/os.rst:3433 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3434 +#: ../../library/os.rst:3435 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 " @@ -3900,7 +3900,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3445 +#: ../../library/os.rst:3446 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3908,12 +3908,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3451 +#: ../../library/os.rst:3452 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3454 +#: ../../library/os.rst:3455 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3921,27 +3921,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.symlink``。" -#: ../../library/os.rst:3464 +#: ../../library/os.rst:3465 msgid "" "Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3471 +#: ../../library/os.rst:3472 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3477 +#: ../../library/os.rst:3478 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3486 +#: ../../library/os.rst:3487 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3491 +#: ../../library/os.rst:3492 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3949,46 +3949,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 <auditing>` ``os." "truncate``。" -#: ../../library/os.rst:3506 +#: ../../library/os.rst:3507 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:3522 +#: ../../library/os.rst:3523 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3524 +#: ../../library/os.rst:3525 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:3527 +#: ../../library/os.rst:3528 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:3530 +#: ../../library/os.rst:3531 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:3533 +#: ../../library/os.rst:3534 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:3537 +#: ../../library/os.rst:3538 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3539 +#: ../../library/os.rst:3540 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 " @@ -3998,7 +3998,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3550 +#: ../../library/os.rst:3551 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -4006,13 +4006,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.utime``。" -#: ../../library/os.rst:3552 +#: ../../library/os.rst:3553 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3566 +#: ../../library/os.rst:3567 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* " @@ -4020,7 +4020,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3571 +#: ../../library/os.rst:3572 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 " @@ -4034,7 +4034,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3582 +#: ../../library/os.rst:3583 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 " @@ -4045,7 +4045,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3590 +#: ../../library/os.rst:3591 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -4058,7 +4058,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3599 +#: ../../library/os.rst:3600 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 " @@ -4068,35 +4068,35 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3605 +#: ../../library/os.rst:3606 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:3611 +#: ../../library/os.rst:3612 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:3617 +#: ../../library/os.rst:3618 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:3621 ../../library/os.rst:3683 +#: ../../library/os.rst:3622 ../../library/os.rst:3684 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:3625 +#: ../../library/os.rst:3626 msgid "" "import os\n" "from os.path import join, getsize\n" @@ -4108,14 +4108,14 @@ msgid "" " dirs.remove('CVS') # don't visit CVS directories" msgstr "" -#: ../../library/os.rst:3634 +#: ../../library/os.rst:3635 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3638 +#: ../../library/os.rst:3639 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4130,7 +4130,7 @@ msgid "" "os.rmdir(top)" msgstr "" -#: ../../library/os.rst:3650 +#: ../../library/os.rst:3651 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -4138,25 +4138,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 <auditing>` ``os.walk``。" -#: ../../library/os.rst:3652 +#: ../../library/os.rst:3653 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:3666 +#: ../../library/os.rst:3667 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:3669 +#: ../../library/os.rst:3670 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:3672 +#: ../../library/os.rst:3673 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "<dir_fd>` and :ref:`not following symlinks <follow_symlinks>`. Note however " @@ -4164,14 +4164,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3679 +#: ../../library/os.rst:3680 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:3687 +#: ../../library/os.rst:3688 msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):\n" @@ -4183,13 +4183,13 @@ msgid "" " dirs.remove('CVS') # don't visit CVS directories" msgstr "" -#: ../../library/os.rst:3696 +#: ../../library/os.rst:3697 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::" msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3701 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -4203,7 +4203,7 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: ../../library/os.rst:3711 +#: ../../library/os.rst:3712 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4211,11 +4211,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 <auditing>` ``os.fwalk``。" -#: ../../library/os.rst:3720 +#: ../../library/os.rst:3721 msgid "Added support for :class:`bytes` paths." msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3726 +#: ../../library/os.rst:3727 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 " @@ -4223,7 +4223,7 @@ msgid "" "descriptor is :ref:`non-inheritable <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:3731 +#: ../../library/os.rst:3732 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/" @@ -4233,15 +4233,15 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3761 +#: ../../library/os.rst:3762 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3765 +#: ../../library/os.rst:3766 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3772 +#: ../../library/os.rst:3773 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." @@ -4250,7 +4250,7 @@ msgid "" "ref:`non-inheritable <fd_inheritance>`." msgstr "" -#: ../../library/os.rst:3778 +#: ../../library/os.rst:3779 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be a 32 bit unsigned integer. Please note that the initial value is limited " @@ -4258,39 +4258,39 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3783 +#: ../../library/os.rst:3784 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3786 +#: ../../library/os.rst:3787 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:3789 +#: ../../library/os.rst:3790 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:3793 +#: ../../library/os.rst:3794 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3796 +#: ../../library/os.rst:3797 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:3802 +#: ../../library/os.rst:3803 msgid "" "import os\n" "\n" @@ -4308,64 +4308,64 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3823 +#: ../../library/os.rst:3824 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:3832 +#: ../../library/os.rst:3833 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:3841 +#: ../../library/os.rst:3842 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3849 +#: ../../library/os.rst:3850 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3858 +#: ../../library/os.rst:3859 msgid "" "Provide semaphore-like semantics for reads from an :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3869 +#: ../../library/os.rst:3870 msgid "Timer File Descriptors" msgstr "" -#: ../../library/os.rst:3873 +#: ../../library/os.rst:3874 msgid "" "These functions provide support for Linux's *timer file descriptor* API. " "Naturally, they are all only available on Linux." msgstr "" -#: ../../library/os.rst:3878 +#: ../../library/os.rst:3879 msgid "Create and return a timer file descriptor (*timerfd*)." msgstr "" -#: ../../library/os.rst:3880 +#: ../../library/os.rst:3881 msgid "The file descriptor returned by :func:`timerfd_create` supports:" msgstr "" -#: ../../library/os.rst:3882 +#: ../../library/os.rst:3883 msgid ":func:`read`" msgstr "" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3884 msgid ":func:`~select.select`" msgstr "" -#: ../../library/os.rst:3884 +#: ../../library/os.rst:3885 msgid ":func:`~select.poll`" msgstr "" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:3887 msgid "" "The file descriptor's :func:`read` method can be called with a buffer size " "of 8. If the timer has already expired one or more times, :func:`read` " @@ -4374,32 +4374,32 @@ msgid "" "byteorder)``." msgstr "" -#: ../../library/os.rst:3891 +#: ../../library/os.rst:3892 msgid "" ":func:`~select.select` and :func:`~select.poll` can be used to wait until " "timer expires and the file descriptor is readable." msgstr "" -#: ../../library/os.rst:3894 +#: ../../library/os.rst:3895 msgid "" "*clockid* must be a valid :ref:`clock ID <time-clock-id-constants>`, as " "defined in the :py:mod:`time` module:" msgstr "" -#: ../../library/os.rst:3897 +#: ../../library/os.rst:3898 #, fuzzy msgid ":const:`time.CLOCK_REALTIME`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:3898 +#: ../../library/os.rst:3899 msgid ":const:`time.CLOCK_MONOTONIC`" msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:3900 msgid ":const:`time.CLOCK_BOOTTIME` (Since Linux 3.15 for timerfd_create)" msgstr "" -#: ../../library/os.rst:3901 +#: ../../library/os.rst:3902 msgid "" "If *clockid* is :const:`time.CLOCK_REALTIME`, a settable system-wide real-" "time clock is used. If system clock is changed, timer setting need to be " @@ -4407,37 +4407,37 @@ msgid "" "`TFD_TIMER_CANCEL_ON_SET`." msgstr "" -#: ../../library/os.rst:3906 +#: ../../library/os.rst:3907 msgid "" "If *clockid* is :const:`time.CLOCK_MONOTONIC`, a non-settable monotonically " "increasing clock is used. Even if the system clock is changed, the timer " "setting will not be affected." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3911 msgid "" "If *clockid* is :const:`time.CLOCK_BOOTTIME`, same as :const:`time." "CLOCK_MONOTONIC` except it includes any time that the system is suspended." msgstr "" -#: ../../library/os.rst:3913 +#: ../../library/os.rst:3914 msgid "" "The file descriptor's behaviour can be modified by specifying a *flags* " "value. Any of the following variables may used, combined using bitwise OR " "(the ``|`` operator):" msgstr "" -#: ../../library/os.rst:3917 +#: ../../library/os.rst:3918 #, fuzzy msgid ":const:`TFD_NONBLOCK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:3918 +#: ../../library/os.rst:3919 #, fuzzy msgid ":const:`TFD_CLOEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:3920 +#: ../../library/os.rst:3921 msgid "" "If :const:`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks until the " "timer expires. If it is set as a flag, :func:`read` doesn't block, but If " @@ -4445,49 +4445,49 @@ msgid "" "raises :class:`OSError` with ``errno`` is set to :const:`errno.EAGAIN`." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3927 msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." msgstr "" -#: ../../library/os.rst:3928 +#: ../../library/os.rst:3929 msgid "" "The file descriptor must be closed with :func:`os.close` when it is no " "longer needed, or else the file descriptor will be leaked." msgstr "" -#: ../../library/os.rst:3931 +#: ../../library/os.rst:3932 #, fuzzy msgid "The :manpage:`timerfd_create(2)` man page." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3940 +#: ../../library/os.rst:3941 msgid "" "Alter a timer file descriptor's internal timer. This function operates the " "same interval timer as :func:`timerfd_settime_ns`." msgstr "" -#: ../../library/os.rst:3943 +#: ../../library/os.rst:3944 msgid "*fd* must be a valid timer file descriptor." msgstr "" -#: ../../library/os.rst:3945 +#: ../../library/os.rst:3946 msgid "" "The timer's behaviour can be modified by specifying a *flags* value. Any of " "the following variables may used, combined using bitwise OR (the ``|`` " "operator):" msgstr "" -#: ../../library/os.rst:3949 +#: ../../library/os.rst:3950 #, fuzzy msgid ":const:`TFD_TIMER_ABSTIME`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:3950 +#: ../../library/os.rst:3951 #, fuzzy msgid ":const:`TFD_TIMER_CANCEL_ON_SET`" msgstr ":const:`SEEK_SET`" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3953 msgid "" "The timer is disabled by setting *initial* to zero (``0``). If *initial* is " "equal to or greater than zero, the timer is enabled. If *initial* is less " @@ -4495,20 +4495,20 @@ msgid "" "const:`errno.EINVAL`" msgstr "" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3958 msgid "" "By default the timer will fire when *initial* seconds have elapsed. (If " "*initial* is zero, timer will fire immediately.)" msgstr "" -#: ../../library/os.rst:3960 +#: ../../library/os.rst:3961 msgid "" "However, if the :const:`TFD_TIMER_ABSTIME` flag is set, the timer will fire " "when the timer's clock (set by *clockid* in :func:`timerfd_create`) reaches " "*initial* seconds." msgstr "" -#: ../../library/os.rst:3964 +#: ../../library/os.rst:3965 msgid "" "The timer's interval is set by the *interval* :py:class:`float`. If " "*interval* is zero, the timer only fires once, on the initial expiration. If " @@ -4518,7 +4518,7 @@ msgid "" "EINVAL`" msgstr "" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3972 msgid "" "If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along with :const:" "`TFD_TIMER_ABSTIME` and the clock for this timer is :const:`time." @@ -4527,86 +4527,86 @@ msgid "" "ECANCELED." msgstr "" -#: ../../library/os.rst:3977 +#: ../../library/os.rst:3978 msgid "" "Linux manages system clock as UTC. A daylight-savings time transition is " "done by changing time offset only and doesn't cause discontinuous system " "clock change." msgstr "" -#: ../../library/os.rst:3981 +#: ../../library/os.rst:3982 msgid "" "Discontinuous system clock change will be caused by the following events:" msgstr "" -#: ../../library/os.rst:3983 +#: ../../library/os.rst:3984 msgid "``settimeofday``" msgstr "" -#: ../../library/os.rst:3984 +#: ../../library/os.rst:3985 msgid "``clock_settime``" msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 msgid "set the system date and time by ``date`` command" msgstr "" -#: ../../library/os.rst:3987 +#: ../../library/os.rst:3988 msgid "" "Return a two-item tuple of (``next_expiration``, ``interval``) from the " "previous timer state, before this function executed." msgstr "" -#: ../../library/os.rst:3992 +#: ../../library/os.rst:3993 msgid "" ":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" "`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:4004 msgid "" "Similar to :func:`timerfd_settime`, but use time as nanoseconds. This " "function operates the same interval timer as :func:`timerfd_settime`." msgstr "" -#: ../../library/os.rst:4013 +#: ../../library/os.rst:4014 msgid "Return a two-item tuple of floats (``next_expiration``, ``interval``)." msgstr "" -#: ../../library/os.rst:4015 +#: ../../library/os.rst:4016 msgid "" "``next_expiration`` denotes the relative time until next the timer next " "fires, regardless of if the :const:`TFD_TIMER_ABSTIME` flag is set." msgstr "" -#: ../../library/os.rst:4018 +#: ../../library/os.rst:4019 msgid "" "``interval`` denotes the timer's interval. If zero, the timer will only fire " "once, after ``next_expiration`` seconds have elapsed." msgstr "" -#: ../../library/os.rst:4022 +#: ../../library/os.rst:4023 msgid ":manpage:`timerfd_gettime(2)`" msgstr "" -#: ../../library/os.rst:4031 +#: ../../library/os.rst:4032 msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." msgstr "" -#: ../../library/os.rst:4039 +#: ../../library/os.rst:4040 msgid "" "A flag for the :func:`timerfd_create` function, which sets the :const:" "`O_NONBLOCK` status flag for the new timer file descriptor. If :const:" "`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." msgstr "" -#: ../../library/os.rst:4049 +#: ../../library/os.rst:4050 msgid "" "A flag for the :func:`timerfd_create` function, If :const:`TFD_CLOEXEC` is " "set as a flag, set close-on-exec flag for new file descriptor." msgstr "" -#: ../../library/os.rst:4059 +#: ../../library/os.rst:4060 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions. If this flag is set, *initial* is interpreted as an absolute " @@ -4614,22 +4614,22 @@ msgid "" "Epoch)." msgstr "" -#: ../../library/os.rst:4069 +#: ../../library/os.rst:4070 msgid "" "A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " "functions along with :const:`TFD_TIMER_ABSTIME`. The timer is cancelled when " "the time of the underlying clock changes discontinuously." msgstr "" -#: ../../library/os.rst:4080 +#: ../../library/os.rst:4081 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:4084 +#: ../../library/os.rst:4085 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:4088 +#: ../../library/os.rst:4089 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4637,7 +4637,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:4096 +#: ../../library/os.rst:4097 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4645,12 +4645,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 <auditing>` " "``os.getxattr``。" -#: ../../library/os.rst:4098 ../../library/os.rst:4130 -#: ../../library/os.rst:4155 +#: ../../library/os.rst:4099 ../../library/os.rst:4131 +#: ../../library/os.rst:4156 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:4104 +#: ../../library/os.rst:4105 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4658,14 +4658,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4113 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 <auditing>` ``os.listxattr``。" -#: ../../library/os.rst:4120 +#: ../../library/os.rst:4121 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4673,7 +4673,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:4128 +#: ../../library/os.rst:4129 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4681,7 +4681,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 <auditing>` " "``os.removexattr``。" -#: ../../library/os.rst:4136 +#: ../../library/os.rst:4137 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4693,13 +4693,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:4150 +#: ../../library/os.rst:4151 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:4153 +#: ../../library/os.rst:4154 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4707,33 +4707,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 <auditing>` ``os.setxattr``。" -#: ../../library/os.rst:4161 +#: ../../library/os.rst:4162 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:4167 +#: ../../library/os.rst:4168 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:4173 +#: ../../library/os.rst:4174 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:4180 +#: ../../library/os.rst:4181 msgid "Process Management" msgstr "行程管理" -#: ../../library/os.rst:4182 +#: ../../library/os.rst:4183 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:4184 +#: ../../library/os.rst:4185 msgid "" "The various :func:`exec\\* <execl>` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4744,7 +4744,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:4195 +#: ../../library/os.rst:4196 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 " @@ -4753,31 +4753,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4205 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:4206 +#: ../../library/os.rst:4207 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:4210 +#: ../../library/os.rst:4211 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:4213 +#: ../../library/os.rst:4214 msgid "" "See the `Microsoft documentation <https://msdn.microsoft." "com/44228cf2-6306-466c-8f16-f513cd3ba8b5>`_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:4217 +#: ../../library/os.rst:4218 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.add_dll_directory`` with " "argument ``path``." @@ -4785,7 +4785,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 <auditing>` ``os." "add_dll_directory``。" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4222 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4793,14 +4793,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:4228 +#: ../../library/os.rst:4229 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 " "<bpo-36085-whatsnew>` for information on updating libraries." msgstr "" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4244 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 " @@ -4808,7 +4808,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4249 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 " @@ -4816,7 +4816,7 @@ msgid "" "fsync` before calling an :func:`exec\\* <execl>` function." msgstr "" -#: ../../library/os.rst:4254 +#: ../../library/os.rst:4255 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* <execl>` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4829,7 +4829,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:4263 +#: ../../library/os.rst:4264 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4843,7 +4843,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:4274 +#: ../../library/os.rst:4275 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 " @@ -4853,7 +4853,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:4281 +#: ../../library/os.rst:4282 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 " @@ -4862,7 +4862,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:4286 +#: ../../library/os.rst:4287 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4870,25 +4870,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 <auditing>` " "``os.exec``。" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4291 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4300 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4304 +#: ../../library/os.rst:4305 msgid "" "The standard way to exit is :func:`sys.exit(n) <sys.exit>`. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4307 +#: ../../library/os.rst:4308 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 " @@ -4896,139 +4896,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4314 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:4320 +#: ../../library/os.rst:4321 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:4328 +#: ../../library/os.rst:4329 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4336 +#: ../../library/os.rst:4337 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4343 +#: ../../library/os.rst:4344 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4351 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4358 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4365 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4371 +#: ../../library/os.rst:4372 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4379 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:4386 +#: ../../library/os.rst:4387 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:4394 +#: ../../library/os.rst:4395 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4401 +#: ../../library/os.rst:4402 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4408 +#: ../../library/os.rst:4409 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:4417 +#: ../../library/os.rst:4418 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4425 +#: ../../library/os.rst:4426 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:4433 +#: ../../library/os.rst:4434 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4440 +#: ../../library/os.rst:4441 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4447 +#: ../../library/os.rst:4448 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:4450 +#: ../../library/os.rst:4451 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4454 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``os.fork``。" -#: ../../library/os.rst:4457 +#: ../../library/os.rst:4458 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4462 ../../library/os.rst:4506 +#: ../../library/os.rst:4463 ../../library/os.rst:4507 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: ../../library/os.rst:4465 +#: ../../library/os.rst:4466 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4470 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: ../../library/os.rst:4473 +#: ../../library/os.rst:4474 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -5039,21 +5039,21 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4482 +#: ../../library/os.rst:4483 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: ../../library/os.rst:4486 +#: ../../library/os.rst:4487 msgid "" "See `this discussion on fork being incompatible with threads <https://" "discuss.python.org/t/33555>`_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4496 +#: ../../library/os.rst:4497 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, " @@ -5062,31 +5062,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4502 +#: ../../library/os.rst:4503 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``os.forkpty``。" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4510 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4513 +#: ../../library/os.rst:4514 msgid "" "If Python is able to detect that your process has multiple threads, this now " "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -#: ../../library/os.rst:4527 +#: ../../library/os.rst:4528 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:4530 +#: ../../library/os.rst:4531 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -5096,11 +5096,11 @@ msgid "" "be set to *sig*." msgstr "" -#: ../../library/os.rst:4537 +#: ../../library/os.rst:4538 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`。" -#: ../../library/os.rst:4539 +#: ../../library/os.rst:4540 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -5108,11 +5108,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 <auditing>` ``os." "kill``。" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4554 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4556 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -5120,23 +5120,23 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 <auditing>` ``os." "killpg``。" -#: ../../library/os.rst:4562 +#: ../../library/os.rst:4563 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4569 +#: ../../library/os.rst:4570 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4574 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4580 +#: ../../library/os.rst:4581 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -5144,13 +5144,13 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4591 +#: ../../library/os.rst:4592 msgid "" "Lock program segments into memory. The value of *op* (defined in ``<sys/" "lock.h>``) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4599 +#: ../../library/os.rst:4600 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 " @@ -5160,7 +5160,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4608 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -5172,57 +5172,57 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4617 +#: ../../library/os.rst:4618 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:4622 +#: ../../library/os.rst:4623 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:4629 +#: ../../library/os.rst:4630 msgid "" "The :ref:`Python UTF-8 Mode <utf8-mode>` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4632 +#: ../../library/os.rst:4633 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:4641 +#: ../../library/os.rst:4642 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4644 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4646 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`. *env* is allowed to be ``None``, in which case current process' " "environment is used." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4650 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:4653 +#: ../../library/os.rst:4654 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 " @@ -5231,40 +5231,40 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4661 +#: ../../library/os.rst:4662 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4664 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4667 +#: ../../library/os.rst:4668 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4669 +#: ../../library/os.rst:4670 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4673 +#: ../../library/os.rst:4674 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4675 +#: ../../library/os.rst:4676 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4680 #, fuzzy msgid "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4681 +#: ../../library/os.rst:4682 msgid "Performs ``os.closerange(fd, INF)``." msgstr "" -#: ../../library/os.rst:4683 +#: ../../library/os.rst:4684 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -5274,7 +5274,7 @@ msgid "" "c:func:`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 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 " @@ -5283,7 +5283,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4696 +#: ../../library/os.rst:4697 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 " @@ -5294,7 +5294,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4705 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -5302,7 +5302,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4709 +#: ../../library/os.rst:4710 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 " @@ -5310,14 +5310,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4715 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4718 +#: ../../library/os.rst:4719 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -5327,7 +5327,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4725 ../../library/os.rst:4746 +#: ../../library/os.rst:4726 ../../library/os.rst:4747 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -5335,79 +5335,79 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 <auditing>` " "``os.posix_spawn``。" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4730 msgid "" "*env* parameter accepts ``None``. ``os.POSIX_SPAWN_CLOSEFROM`` is available " "on platforms where :c:func:`!posix_spawn_file_actions_addclosefrom_np` " "exists." msgstr "" -#: ../../library/os.rst:4740 +#: ../../library/os.rst:4741 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4742 +#: ../../library/os.rst:4743 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:4752 +#: ../../library/os.rst:4753 msgid "See :func:`posix_spawn` documentation." msgstr "見 :func:`posix_spawn` 文件。" -#: ../../library/os.rst:4758 +#: ../../library/os.rst:4759 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:4763 +#: ../../library/os.rst:4764 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4764 +#: ../../library/os.rst:4765 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4766 +#: ../../library/os.rst:4767 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4768 +#: ../../library/os.rst:4769 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:4772 +#: ../../library/os.rst:4773 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:4777 +#: ../../library/os.rst:4778 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:4781 +#: ../../library/os.rst:4782 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4797 +#: ../../library/os.rst:4798 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4799 +#: ../../library/os.rst:4800 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -5415,7 +5415,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4804 +#: ../../library/os.rst:4805 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 " @@ -5424,13 +5424,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4811 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:4813 +#: ../../library/os.rst:4814 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* <spawnl>` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -5442,7 +5442,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4822 +#: ../../library/os.rst:4823 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -5455,7 +5455,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4832 +#: ../../library/os.rst:4833 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 " @@ -5467,13 +5467,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4841 +#: ../../library/os.rst:4842 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4844 +#: ../../library/os.rst:4845 msgid "" "import os\n" "os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')\n" @@ -5487,7 +5487,7 @@ msgstr "" "L = ['cp', 'index.html', '/dev/null']\n" "os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4851 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -5495,7 +5495,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "<auditing>` ``os.spawn``。" -#: ../../library/os.rst:4854 +#: ../../library/os.rst:4855 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -5503,7 +5503,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4866 +#: ../../library/os.rst:4867 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* <spawnl>` " "family of functions. If either of these values is given, the :func:" @@ -5511,7 +5511,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4876 +#: ../../library/os.rst:4877 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* <spawnl>` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -5520,7 +5520,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4888 +#: ../../library/os.rst:4889 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* <spawnl>` " "family of functions. These are less portable than those listed above. :" @@ -5530,11 +5530,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4899 +#: ../../library/os.rst:4900 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4902 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5542,7 +5542,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4906 +#: ../../library/os.rst:4907 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 " @@ -5550,28 +5550,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4911 +#: ../../library/os.rst:4912 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:4915 +#: ../../library/os.rst:4916 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:4919 +#: ../../library/os.rst:4920 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:4923 +#: ../../library/os.rst:4924 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 " @@ -5582,14 +5582,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4931 +#: ../../library/os.rst:4932 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4935 +#: ../../library/os.rst:4936 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5597,7 +5597,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 <auditing>` " "``os.startfile``。" -#: ../../library/os.rst:4937 +#: ../../library/os.rst:4938 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5605,13 +5605,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 <auditing>` ``os.startfile/2``。" -#: ../../library/os.rst:4941 +#: ../../library/os.rst:4942 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4948 +#: ../../library/os.rst:4949 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 " @@ -5622,13 +5622,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4956 +#: ../../library/os.rst:4957 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:4959 +#: ../../library/os.rst:4960 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 :" @@ -5637,7 +5637,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4965 +#: ../../library/os.rst:4966 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5645,54 +5645,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4970 +#: ../../library/os.rst:4971 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 " "code." msgstr "" -#: ../../library/os.rst:4974 +#: ../../library/os.rst:4975 msgid "" "Raises an :ref:`auditing event <auditing>` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 <auditing>` ``os.system``。" -#: ../../library/os.rst:4981 +#: ../../library/os.rst:4982 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4984 +#: ../../library/os.rst:4985 msgid ":attr:`!user` - user time" msgstr ":attr:`!user` - 使用者時間" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:4986 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4987 msgid ":attr:`!children_user` - user time of all child processes" msgstr ":attr:`!children_user` - 所有子行程的使用者時間" -#: ../../library/os.rst:4987 +#: ../../library/os.rst:4988 msgid ":attr:`!children_system` - system time of all child processes" msgstr ":attr:`!children_system` - 所有子行程的系統時間" -#: ../../library/os.rst:4988 +#: ../../library/os.rst:4989 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4990 +#: ../../library/os.rst:4991 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:4994 +#: ../../library/os.rst:4995 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) <https://man." "freebsd.org/cgi/man.cgi?time(3)>`_ manual page on Unix or `the " @@ -5702,7 +5702,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:5008 +#: ../../library/os.rst:5009 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 " @@ -5711,87 +5711,87 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:5014 +#: ../../library/os.rst:5015 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:5017 ../../library/os.rst:5092 +#: ../../library/os.rst:5018 ../../library/os.rst:5093 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:5024 +#: ../../library/os.rst:5025 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:5031 +#: ../../library/os.rst:5032 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:5033 +#: ../../library/os.rst:5034 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:5036 +#: ../../library/os.rst:5037 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:5040 +#: ../../library/os.rst:5041 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:5043 +#: ../../library/os.rst:5044 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:5044 +#: ../../library/os.rst:5045 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:5045 +#: ../../library/os.rst:5046 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:5046 +#: ../../library/os.rst:5047 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5048 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:5049 +#: ../../library/os.rst:5050 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:5058 +#: ../../library/os.rst:5059 msgid "This function is now available on macOS as well." msgstr "" -#: ../../library/os.rst:5064 +#: ../../library/os.rst:5065 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5067 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 " @@ -5800,7 +5800,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:5071 +#: ../../library/os.rst:5072 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 " @@ -5810,7 +5810,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:5078 +#: ../../library/os.rst:5079 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 " @@ -5819,7 +5819,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:5084 +#: ../../library/os.rst:5085 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 " @@ -5831,7 +5831,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:5105 +#: ../../library/os.rst:5106 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 " @@ -5840,13 +5840,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:5112 ../../library/os.rst:5126 +#: ../../library/os.rst:5113 ../../library/os.rst:5127 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:5120 +#: ../../library/os.rst:5121 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5855,118 +5855,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:5137 +#: ../../library/os.rst:5138 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:5140 +#: ../../library/os.rst:5141 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:5141 +#: ../../library/os.rst:5142 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:5142 +#: ../../library/os.rst:5143 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:5143 +#: ../../library/os.rst:5144 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:5148 +#: ../../library/os.rst:5149 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:5151 +#: ../../library/os.rst:5152 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:5157 +#: ../../library/os.rst:5158 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:5166 +#: ../../library/os.rst:5167 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5170 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:5179 +#: ../../library/os.rst:5180 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:5182 ../../library/os.rst:5214 +#: ../../library/os.rst:5183 ../../library/os.rst:5215 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:5191 +#: ../../library/os.rst:5192 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:5195 +#: ../../library/os.rst:5196 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:5202 +#: ../../library/os.rst:5203 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:5211 +#: ../../library/os.rst:5212 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:5226 +#: ../../library/os.rst:5227 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5234 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:5239 +#: ../../library/os.rst:5240 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:5241 +#: ../../library/os.rst:5242 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:5243 +#: ../../library/os.rst:5244 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:5246 +#: ../../library/os.rst:5247 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 " @@ -5974,15 +5974,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:5250 +#: ../../library/os.rst:5251 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:5252 +#: ../../library/os.rst:5253 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:5254 +#: ../../library/os.rst:5255 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 " @@ -5990,227 +5990,227 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:5261 +#: ../../library/os.rst:5262 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:5269 +#: ../../library/os.rst:5270 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:5275 +#: ../../library/os.rst:5276 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:5278 ../../library/os.rst:5344 +#: ../../library/os.rst:5279 ../../library/os.rst:5345 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:5285 +#: ../../library/os.rst:5286 msgid "" "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 "" -#: ../../library/os.rst:5289 +#: ../../library/os.rst:5290 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:5296 +#: ../../library/os.rst:5297 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5299 +#: ../../library/os.rst:5300 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:5307 +#: ../../library/os.rst:5308 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:5315 +#: ../../library/os.rst:5316 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:5324 +#: ../../library/os.rst:5325 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:5326 +#: ../../library/os.rst:5327 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:5333 +#: ../../library/os.rst:5334 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:5335 +#: ../../library/os.rst:5336 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:5342 +#: ../../library/os.rst:5343 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5350 +#: ../../library/os.rst:5351 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5352 +#: ../../library/os.rst:5353 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:5358 +#: ../../library/os.rst:5359 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5365 +#: ../../library/os.rst:5366 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5369 +#: ../../library/os.rst:5370 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5374 +#: ../../library/os.rst:5375 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5378 +#: ../../library/os.rst:5379 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5382 +#: ../../library/os.rst:5383 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5386 +#: ../../library/os.rst:5387 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5390 +#: ../../library/os.rst:5391 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:5397 +#: ../../library/os.rst:5398 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:5401 +#: ../../library/os.rst:5402 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5405 +#: ../../library/os.rst:5406 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5410 +#: ../../library/os.rst:5411 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5416 +#: ../../library/os.rst:5417 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5422 +#: ../../library/os.rst:5423 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:5429 +#: ../../library/os.rst:5430 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:5436 +#: ../../library/os.rst:5437 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:5442 +#: ../../library/os.rst:5443 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:5448 +#: ../../library/os.rst:5449 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:5454 +#: ../../library/os.rst:5455 msgid "" "Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: ../../library/os.rst:5459 +#: ../../library/os.rst:5460 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:5466 +#: ../../library/os.rst:5467 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5468 +#: ../../library/os.rst:5469 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5471 +#: ../../library/os.rst:5472 #, fuzzy msgid "See also the :func:`process_cpu_count` function." msgstr ":func:`~os.setns` 函式。" -#: ../../library/os.rst:5477 +#: ../../library/os.rst:5478 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5482 +#: ../../library/os.rst:5483 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 " @@ -6221,13 +6221,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5490 +#: ../../library/os.rst:5491 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5493 +#: ../../library/os.rst:5494 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 " @@ -6235,63 +6235,63 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5503 +#: ../../library/os.rst:5504 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:5512 +#: ../../library/os.rst:5513 msgid "" "Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5515 +#: ../../library/os.rst:5516 msgid "" "The :func:`process_cpu_count` function can be used to get the number of " "logical CPUs usable by the calling thread of the **current process**." msgstr "" -#: ../../library/os.rst:5520 +#: ../../library/os.rst:5521 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5527 +#: ../../library/os.rst:5528 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:5536 +#: ../../library/os.rst:5537 msgid "" "Get the number of logical CPUs usable by the calling thread of the **current " "process**. Returns ``None`` if undetermined. It can be less than :func:" "`cpu_count` depending on the CPU affinity." msgstr "" -#: ../../library/os.rst:5540 +#: ../../library/os.rst:5541 msgid "" "The :func:`cpu_count` function can be used to get the number of logical CPUs " "in the **system**." msgstr "" -#: ../../library/os.rst:5543 +#: ../../library/os.rst:5544 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " "set, :func:`process_cpu_count` returns the overridden value *n*." msgstr "" -#: ../../library/os.rst:5546 +#: ../../library/os.rst:5547 #, fuzzy msgid "See also the :func:`sched_getaffinity` function." msgstr ":func:`~os.setns` 函式。" -#: ../../library/os.rst:5553 +#: ../../library/os.rst:5554 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -6300,44 +6300,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5563 +#: ../../library/os.rst:5564 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:5569 +#: ../../library/os.rst:5570 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5572 +#: ../../library/os.rst:5573 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5575 +#: ../../library/os.rst:5576 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5581 +#: ../../library/os.rst:5582 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:5589 +#: ../../library/os.rst:5590 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:5598 +#: ../../library/os.rst:5599 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -6346,7 +6346,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5608 +#: ../../library/os.rst:5609 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -6354,27 +6354,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5617 +#: ../../library/os.rst:5618 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:5625 +#: ../../library/os.rst:5626 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:5632 +#: ../../library/os.rst:5633 msgid "" "The default search path used by :func:`exec\\*p\\* <execl>` and :func:" "`spawn\\*p\\* <spawnl>` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5639 +#: ../../library/os.rst:5640 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 " @@ -6383,36 +6383,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5648 +#: ../../library/os.rst:5649 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:5659 +#: ../../library/os.rst:5660 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:5667 +#: ../../library/os.rst:5668 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5672 +#: ../../library/os.rst:5673 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5675 +#: ../../library/os.rst:5676 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5678 +#: ../../library/os.rst:5679 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -6420,32 +6420,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5683 +#: ../../library/os.rst:5684 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5687 +#: ../../library/os.rst:5688 msgid "" "See also the `Linux getrandom() manual page <https://man7.org/linux/man-" "pages/man2/getrandom.2.html>`_." msgstr "" -#: ../../library/os.rst:5696 +#: ../../library/os.rst:5697 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5698 +#: ../../library/os.rst:5699 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:5702 +#: ../../library/os.rst:5703 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -6455,207 +6455,207 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5709 +#: ../../library/os.rst:5710 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:5713 +#: ../../library/os.rst:5714 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5716 +#: ../../library/os.rst:5717 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:5720 +#: ../../library/os.rst:5721 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:5726 +#: ../../library/os.rst:5727 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:5730 +#: ../../library/os.rst:5731 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5734 +#: ../../library/os.rst:5735 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5740 +#: ../../library/os.rst:5741 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:5744 +#: ../../library/os.rst:5745 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:5751 +#: ../../library/os.rst:5752 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:529 ../../library/os.rst:731 +#: ../../library/os.rst:364 ../../library/os.rst:530 ../../library/os.rst:732 msgid "user" msgstr "user(使用者)" -#: ../../library/os.rst:363 +#: ../../library/os.rst:364 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:666 -#: ../../library/os.rst:4523 ../../library/os.rst:4549 +#: ../../library/os.rst:373 ../../library/os.rst:439 ../../library/os.rst:448 +#: ../../library/os.rst:457 ../../library/os.rst:471 ../../library/os.rst:667 +#: ../../library/os.rst:4524 ../../library/os.rst:4550 msgid "process" msgstr "process" -#: ../../library/os.rst:372 ../../library/os.rst:438 +#: ../../library/os.rst:373 ../../library/os.rst:439 msgid "group" msgstr "group(群組)" -#: ../../library/os.rst:447 ../../library/os.rst:529 +#: ../../library/os.rst:448 ../../library/os.rst:530 msgid "id" msgstr "id" -#: ../../library/os.rst:456 +#: ../../library/os.rst:457 msgid "id of parent" msgstr "" -#: ../../library/os.rst:470 ../../library/os.rst:666 +#: ../../library/os.rst:471 ../../library/os.rst:667 msgid "scheduling priority" msgstr "scheduling priority(排程優先權)" -#: ../../library/os.rst:552 ../../library/os.rst:801 +#: ../../library/os.rst:553 ../../library/os.rst:802 msgid "environment variables" msgstr "environment variables(環境變數)" -#: ../../library/os.rst:552 +#: ../../library/os.rst:553 msgid "setting" msgstr "setting(設定)" -#: ../../library/os.rst:731 +#: ../../library/os.rst:732 msgid "id, setting" msgstr "id, setting(設定)" -#: ../../library/os.rst:764 +#: ../../library/os.rst:765 msgid "gethostname() (in module socket)" msgstr "gethostname()(於 socket 模組)" -#: ../../library/os.rst:764 +#: ../../library/os.rst:765 msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:801 ../../library/os.rst:2658 +#: ../../library/os.rst:802 ../../library/os.rst:2659 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1360 ../../library/os.rst:3028 +#: ../../library/os.rst:1361 ../../library/os.rst:3029 msgid "module" msgstr "module(模組)" -#: ../../library/os.rst:1360 +#: ../../library/os.rst:1361 msgid "pty" msgstr "pty" -#: ../../library/os.rst:2045 ../../library/os.rst:2457 -#: ../../library/os.rst:2658 ../../library/os.rst:3562 -#: ../../library/os.rst:3662 +#: ../../library/os.rst:2046 ../../library/os.rst:2458 +#: ../../library/os.rst:2659 ../../library/os.rst:3563 +#: ../../library/os.rst:3663 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:2045 +#: ../../library/os.rst:2046 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2457 +#: ../../library/os.rst:2458 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2457 +#: ../../library/os.rst:2458 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2457 +#: ../../library/os.rst:2458 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:3028 +#: ../../library/os.rst:3029 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3562 ../../library/os.rst:3662 +#: ../../library/os.rst:3563 ../../library/os.rst:3663 msgid "walking" msgstr "" -#: ../../library/os.rst:3562 ../../library/os.rst:3662 +#: ../../library/os.rst:3563 ../../library/os.rst:3663 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4523 ../../library/os.rst:4549 +#: ../../library/os.rst:4524 ../../library/os.rst:4550 msgid "killing" msgstr "" -#: ../../library/os.rst:4523 ../../library/os.rst:4549 +#: ../../library/os.rst:4524 ../../library/os.rst:4550 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5578 ../../library/os.rst:5614 +#: ../../library/os.rst:5579 ../../library/os.rst:5615 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5578 ../../library/os.rst:5586 -#: ../../library/os.rst:5594 ../../library/os.rst:5605 -#: ../../library/os.rst:5614 +#: ../../library/os.rst:5579 ../../library/os.rst:5587 +#: ../../library/os.rst:5595 ../../library/os.rst:5606 +#: ../../library/os.rst:5615 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5586 +#: ../../library/os.rst:5587 msgid ".." msgstr ".." -#: ../../library/os.rst:5594 ../../library/os.rst:5605 +#: ../../library/os.rst:5595 ../../library/os.rst:5606 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5595 +#: ../../library/os.rst:5596 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5595 +#: ../../library/os.rst:5596 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5621 +#: ../../library/os.rst:5622 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5621 +#: ../../library/os.rst:5622 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5621 +#: ../../library/os.rst:5622 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/profile.po b/library/profile.po index aa480c4282..c04d1044ef 100644 --- a/library/profile.po +++ b/library/profile.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,48 +223,49 @@ msgid "" "formats them in various ways." msgstr "" -#: ../../library/profile.rst:126 +#: ../../library/profile.rst:128 msgid "" "The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script " "to profile another script. For example::" msgstr "" -#: ../../library/profile.rst:129 +#: ../../library/profile.rst:131 msgid "" "python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)" msgstr "" "python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)" -#: ../../library/profile.rst:131 -msgid "``-o`` writes the profile results to a file instead of to stdout" +#: ../../library/profile.rst:135 +msgid "Writes the profile results to a file instead of to stdout." msgstr "" -#: ../../library/profile.rst:133 +#: ../../library/profile.rst:139 msgid "" -"``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to " -"sort the output by. This only applies when ``-o`` is not supplied." +"Specifies one of the :func:`~pstats.Stats.sort_stats` sort values to sort " +"the output by. This only applies when :option:`-o <cProfile -o>` is not " +"supplied." msgstr "" -#: ../../library/profile.rst:136 -msgid "``-m`` specifies that a module is being profiled instead of a script." +#: ../../library/profile.rst:145 +msgid "Specifies that a module is being profiled instead of a script." msgstr "" -#: ../../library/profile.rst:138 +#: ../../library/profile.rst:147 msgid "Added the ``-m`` option to :mod:`cProfile`." msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" -#: ../../library/profile.rst:141 +#: ../../library/profile.rst:150 msgid "Added the ``-m`` option to :mod:`profile`." msgstr "新增 ``-m`` 選項到 :mod:`profile`。" -#: ../../library/profile.rst:144 +#: ../../library/profile.rst:153 msgid "" "The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of " "methods for manipulating and printing the data saved into a profile results " "file::" msgstr "" -#: ../../library/profile.rst:147 +#: ../../library/profile.rst:156 msgid "" "import pstats\n" "from pstats import SortKey\n" @@ -276,7 +277,7 @@ msgstr "" "p = pstats.Stats('restats')\n" "p.strip_dirs().sort_stats(-1).print_stats()" -#: ../../library/profile.rst:152 +#: ../../library/profile.rst:161 msgid "" "The :meth:`~pstats.Stats.strip_dirs` method removed the extraneous path from " "all the module names. The :meth:`~pstats.Stats.sort_stats` method sorted all " @@ -285,7 +286,7 @@ msgid "" "statistics. You might try the following sort calls::" msgstr "" -#: ../../library/profile.rst:158 +#: ../../library/profile.rst:167 msgid "" "p.sort_stats(SortKey.NAME)\n" "p.print_stats()" @@ -293,60 +294,60 @@ msgstr "" "p.sort_stats(SortKey.NAME)\n" "p.print_stats()" -#: ../../library/profile.rst:161 +#: ../../library/profile.rst:170 msgid "" "The first call will actually sort the list by function name, and the second " "call will print out the statistics. The following are some interesting " "calls to experiment with::" msgstr "" -#: ../../library/profile.rst:165 +#: ../../library/profile.rst:174 msgid "p.sort_stats(SortKey.CUMULATIVE).print_stats(10)" msgstr "p.sort_stats(SortKey.CUMULATIVE).print_stats(10)" -#: ../../library/profile.rst:167 +#: ../../library/profile.rst:176 msgid "" "This sorts the profile by cumulative time in a function, and then only " "prints the ten most significant lines. If you want to understand what " "algorithms are taking time, the above line is what you would use." msgstr "" -#: ../../library/profile.rst:171 +#: ../../library/profile.rst:180 msgid "" "If you were looking to see what functions were looping a lot, and taking a " "lot of time, you would do::" msgstr "" -#: ../../library/profile.rst:174 +#: ../../library/profile.rst:183 msgid "p.sort_stats(SortKey.TIME).print_stats(10)" msgstr "p.sort_stats(SortKey.TIME).print_stats(10)" -#: ../../library/profile.rst:176 +#: ../../library/profile.rst:185 msgid "" "to sort according to time spent within each function, and then print the " "statistics for the top ten functions." msgstr "" -#: ../../library/profile.rst:179 +#: ../../library/profile.rst:188 msgid "You might also try::" msgstr "" -#: ../../library/profile.rst:181 +#: ../../library/profile.rst:190 msgid "p.sort_stats(SortKey.FILENAME).print_stats('__init__')" msgstr "p.sort_stats(SortKey.FILENAME).print_stats('__init__')" -#: ../../library/profile.rst:183 +#: ../../library/profile.rst:192 msgid "" "This will sort all the statistics by file name, and then print out " "statistics for only the class init methods (since they are spelled with " "``__init__`` in them). As one final example, you could try::" msgstr "" -#: ../../library/profile.rst:187 +#: ../../library/profile.rst:196 msgid "p.sort_stats(SortKey.TIME, SortKey.CUMULATIVE).print_stats(.5, 'init')" msgstr "p.sort_stats(SortKey.TIME, SortKey.CUMULATIVE).print_stats(.5, 'init')" -#: ../../library/profile.rst:189 +#: ../../library/profile.rst:198 msgid "" "This line sorts statistics with a primary key of time, and a secondary key " "of cumulative time, and then prints out some of the statistics. To be " @@ -355,27 +356,27 @@ msgid "" "list is printed." msgstr "" -#: ../../library/profile.rst:194 +#: ../../library/profile.rst:203 msgid "" "If you wondered what functions called the above functions, you could now " "(``p`` is still sorted according to the last criteria) do::" msgstr "" -#: ../../library/profile.rst:197 +#: ../../library/profile.rst:206 msgid "p.print_callers(.5, 'init')" msgstr "p.print_callers(.5, 'init')" -#: ../../library/profile.rst:199 +#: ../../library/profile.rst:208 msgid "and you would get a list of callers for each of the listed functions." msgstr "" -#: ../../library/profile.rst:201 +#: ../../library/profile.rst:210 msgid "" "If you want more functionality, you're going to have to read the manual, or " "guess what the following functions do::" msgstr "" -#: ../../library/profile.rst:204 +#: ../../library/profile.rst:213 msgid "" "p.print_callees()\n" "p.add('restats')" @@ -383,34 +384,34 @@ msgstr "" "p.print_callees()\n" "p.add('restats')" -#: ../../library/profile.rst:207 +#: ../../library/profile.rst:216 msgid "" "Invoked as a script, the :mod:`pstats` module is a statistics browser for " "reading and examining profile dumps. It has a simple line-oriented " "interface (implemented using :mod:`cmd`) and interactive help." msgstr "" -#: ../../library/profile.rst:212 +#: ../../library/profile.rst:221 msgid ":mod:`profile` and :mod:`cProfile` Module Reference" msgstr "" -#: ../../library/profile.rst:218 +#: ../../library/profile.rst:227 msgid "" "Both the :mod:`profile` and :mod:`cProfile` modules provide the following " "functions:" msgstr "" -#: ../../library/profile.rst:223 +#: ../../library/profile.rst:232 msgid "" "This function takes a single argument that can be passed to the :func:`exec` " "function, and an optional file name. In all cases this routine executes::" msgstr "" -#: ../../library/profile.rst:226 +#: ../../library/profile.rst:235 msgid "exec(command, __main__.__dict__, __main__.__dict__)" msgstr "exec(command, __main__.__dict__, __main__.__dict__)" -#: ../../library/profile.rst:228 +#: ../../library/profile.rst:237 msgid "" "and gathers profiling statistics from the execution. If no file name is " "present, then this function automatically creates a :class:`~pstats.Stats` " @@ -419,27 +420,27 @@ msgid "" "how the results are sorted." msgstr "" -#: ../../library/profile.rst:236 +#: ../../library/profile.rst:245 msgid "" "This function is similar to :func:`run`, with added arguments to supply the " "globals and locals mappings for the *command* string. This routine executes::" msgstr "" -#: ../../library/profile.rst:240 +#: ../../library/profile.rst:249 msgid "exec(command, globals, locals)" msgstr "exec(command, globals, locals)" -#: ../../library/profile.rst:242 +#: ../../library/profile.rst:251 msgid "and gathers profiling statistics as in the :func:`run` function above." msgstr "" -#: ../../library/profile.rst:246 +#: ../../library/profile.rst:255 msgid "" "This class is normally only used if more precise control over profiling is " "needed than what the :func:`cProfile.run` function provides." msgstr "" -#: ../../library/profile.rst:249 +#: ../../library/profile.rst:258 msgid "" "A custom timer can be supplied for measuring how long code takes to run via " "the *timer* argument. This must be a function that returns a single number " @@ -449,13 +450,13 @@ msgid "" "time unit would be ``.001``." msgstr "" -#: ../../library/profile.rst:256 +#: ../../library/profile.rst:265 msgid "" "Directly using the :class:`Profile` class allows formatting profile results " "without writing the profile data to a file::" msgstr "" -#: ../../library/profile.rst:259 +#: ../../library/profile.rst:268 msgid "" "import cProfile, pstats, io\n" "from pstats import SortKey\n" @@ -481,13 +482,13 @@ msgstr "" "ps.print_stats()\n" "print(s.getvalue())" -#: ../../library/profile.rst:271 +#: ../../library/profile.rst:280 msgid "" "The :class:`Profile` class can also be used as a context manager (supported " "only in :mod:`cProfile` module. see :ref:`typecontextmanager`)::" msgstr "" -#: ../../library/profile.rst:274 +#: ../../library/profile.rst:283 msgid "" "import cProfile\n" "\n" @@ -497,60 +498,60 @@ msgid "" " pr.print_stats()" msgstr "" -#: ../../library/profile.rst:281 +#: ../../library/profile.rst:290 msgid "Added context manager support." msgstr "新增情境管理器的支援。" -#: ../../library/profile.rst:286 +#: ../../library/profile.rst:295 msgid "Start collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:290 +#: ../../library/profile.rst:299 msgid "Stop collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:294 +#: ../../library/profile.rst:303 msgid "" "Stop collecting profiling data and record the results internally as the " "current profile." msgstr "" -#: ../../library/profile.rst:299 +#: ../../library/profile.rst:308 msgid "" "Create a :class:`~pstats.Stats` object based on the current profile and " "print the results to stdout." msgstr "" -#: ../../library/profile.rst:302 +#: ../../library/profile.rst:311 msgid "" "The *sort* parameter specifies the sorting order of the displayed " "statistics. It accepts a single key or a tuple of keys to enable multi-level " "sorting, as in :func:`Stats.sort_stats <pstats.Stats.sort_stats>`." msgstr "" -#: ../../library/profile.rst:306 +#: ../../library/profile.rst:315 msgid ":meth:`~Profile.print_stats` now accepts a tuple of keys." msgstr "" -#: ../../library/profile.rst:311 +#: ../../library/profile.rst:320 msgid "Write the results of the current profile to *filename*." msgstr "" -#: ../../library/profile.rst:315 +#: ../../library/profile.rst:324 msgid "Profile the cmd via :func:`exec`." msgstr "" -#: ../../library/profile.rst:319 +#: ../../library/profile.rst:328 msgid "" "Profile the cmd via :func:`exec` with the specified global and local " "environment." msgstr "" -#: ../../library/profile.rst:324 +#: ../../library/profile.rst:333 msgid "Profile ``func(*args, **kwargs)``" msgstr "" -#: ../../library/profile.rst:326 +#: ../../library/profile.rst:335 msgid "" "Note that profiling will only work if the called command/function actually " "returns. If the interpreter is terminated (e.g. via a :func:`sys.exit` call " @@ -558,23 +559,23 @@ msgid "" "printed." msgstr "" -#: ../../library/profile.rst:334 +#: ../../library/profile.rst:343 msgid "The :class:`Stats` Class" msgstr "" -#: ../../library/profile.rst:336 +#: ../../library/profile.rst:345 msgid "" "Analysis of the profiler data is done using the :class:`~pstats.Stats` class." msgstr "" -#: ../../library/profile.rst:343 +#: ../../library/profile.rst:352 msgid "" "This class constructor creates an instance of a \"statistics object\" from a " "*filename* (or list of filenames) or from a :class:`Profile` instance. " "Output will be printed to the stream specified by *stream*." msgstr "" -#: ../../library/profile.rst:347 +#: ../../library/profile.rst:356 msgid "" "The file selected by the above constructor must have been created by the " "corresponding version of :mod:`profile` or :mod:`cProfile`. To be specific, " @@ -588,17 +589,17 @@ msgid "" "can be used." msgstr "" -#: ../../library/profile.rst:358 +#: ../../library/profile.rst:367 msgid "" "Instead of reading the profile data from a file, a :class:`cProfile.Profile` " "or :class:`profile.Profile` object can be used as the profile data source." msgstr "" -#: ../../library/profile.rst:361 +#: ../../library/profile.rst:370 msgid ":class:`Stats` objects have the following methods:" msgstr "" -#: ../../library/profile.rst:365 +#: ../../library/profile.rst:374 msgid "" "This method for the :class:`Stats` class removes all leading path " "information from file names. It is very useful in reducing the size of the " @@ -612,7 +613,7 @@ msgid "" "single entry." msgstr "" -#: ../../library/profile.rst:379 +#: ../../library/profile.rst:388 msgid "" "This method of the :class:`Stats` class accumulates additional profiling " "information into the current profiling object. Its arguments should refer " @@ -621,7 +622,7 @@ msgid "" "functions are automatically accumulated into single function statistics." msgstr "" -#: ../../library/profile.rst:389 +#: ../../library/profile.rst:398 msgid "" "Save the data loaded into the :class:`Stats` object to a file named " "*filename*. The file is created if it does not exist, and is overwritten if " @@ -629,7 +630,7 @@ msgid "" "the :class:`profile.Profile` and :class:`cProfile.Profile` classes." msgstr "" -#: ../../library/profile.rst:397 +#: ../../library/profile.rst:406 msgid "" "This method modifies the :class:`Stats` object by sorting it according to " "the supplied criteria. The argument can be either a string or a SortKey " @@ -639,7 +640,7 @@ msgid "" "prone." msgstr "" -#: ../../library/profile.rst:404 +#: ../../library/profile.rst:413 msgid "" "When more than one key is provided, then additional keys are used as " "secondary criteria when there is equality in all keys selected before them. " @@ -648,164 +649,164 @@ msgid "" "function names) by sorting by file name." msgstr "" -#: ../../library/profile.rst:410 +#: ../../library/profile.rst:419 msgid "" "For the string argument, abbreviations can be used for any key names, as " "long as the abbreviation is unambiguous." msgstr "" -#: ../../library/profile.rst:413 +#: ../../library/profile.rst:422 msgid "The following are the valid string and SortKey:" msgstr "" -#: ../../library/profile.rst:416 +#: ../../library/profile.rst:425 msgid "Valid String Arg" msgstr "" -#: ../../library/profile.rst:416 +#: ../../library/profile.rst:425 msgid "Valid enum Arg" msgstr "" -#: ../../library/profile.rst:416 +#: ../../library/profile.rst:425 msgid "Meaning" msgstr "含義" -#: ../../library/profile.rst:418 +#: ../../library/profile.rst:427 msgid "``'calls'``" msgstr "``'calls'``" -#: ../../library/profile.rst:418 +#: ../../library/profile.rst:427 msgid "SortKey.CALLS" msgstr "SortKey.CALLS" -#: ../../library/profile.rst:418 ../../library/profile.rst:430 +#: ../../library/profile.rst:427 ../../library/profile.rst:439 msgid "call count" msgstr "" -#: ../../library/profile.rst:420 +#: ../../library/profile.rst:429 msgid "``'cumulative'``" msgstr "``'cumulative'``" -#: ../../library/profile.rst:420 +#: ../../library/profile.rst:429 msgid "SortKey.CUMULATIVE" msgstr "SortKey.CUMULATIVE" -#: ../../library/profile.rst:420 ../../library/profile.rst:422 +#: ../../library/profile.rst:429 ../../library/profile.rst:431 msgid "cumulative time" msgstr "" -#: ../../library/profile.rst:422 +#: ../../library/profile.rst:431 msgid "``'cumtime'``" msgstr "``'cumtime'``" -#: ../../library/profile.rst:422 ../../library/profile.rst:424 -#: ../../library/profile.rst:428 ../../library/profile.rst:430 -#: ../../library/profile.rst:444 +#: ../../library/profile.rst:431 ../../library/profile.rst:433 +#: ../../library/profile.rst:437 ../../library/profile.rst:439 +#: ../../library/profile.rst:453 msgid "N/A" msgstr "N/A" -#: ../../library/profile.rst:424 +#: ../../library/profile.rst:433 msgid "``'file'``" msgstr "``'file'``" -#: ../../library/profile.rst:424 ../../library/profile.rst:426 -#: ../../library/profile.rst:428 +#: ../../library/profile.rst:433 ../../library/profile.rst:435 +#: ../../library/profile.rst:437 msgid "file name" msgstr "file name(檔案名稱)" -#: ../../library/profile.rst:426 +#: ../../library/profile.rst:435 msgid "``'filename'``" msgstr "``'filename'``" -#: ../../library/profile.rst:426 +#: ../../library/profile.rst:435 msgid "SortKey.FILENAME" msgstr "SortKey.FILENAME" -#: ../../library/profile.rst:428 +#: ../../library/profile.rst:437 msgid "``'module'``" msgstr "``'module'``" -#: ../../library/profile.rst:430 +#: ../../library/profile.rst:439 msgid "``'ncalls'``" msgstr "``'ncalls'``" -#: ../../library/profile.rst:432 +#: ../../library/profile.rst:441 msgid "``'pcalls'``" msgstr "``'pcalls'``" -#: ../../library/profile.rst:432 +#: ../../library/profile.rst:441 msgid "SortKey.PCALLS" msgstr "SortKey.PCALLS" -#: ../../library/profile.rst:432 +#: ../../library/profile.rst:441 msgid "primitive call count" msgstr "" -#: ../../library/profile.rst:434 +#: ../../library/profile.rst:443 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/profile.rst:434 +#: ../../library/profile.rst:443 msgid "SortKey.LINE" msgstr "SortKey.LINE" -#: ../../library/profile.rst:434 +#: ../../library/profile.rst:443 msgid "line number" msgstr "列號" -#: ../../library/profile.rst:436 +#: ../../library/profile.rst:445 msgid "``'name'``" msgstr "``'name'``" -#: ../../library/profile.rst:436 +#: ../../library/profile.rst:445 msgid "SortKey.NAME" msgstr "SortKey.NAME" -#: ../../library/profile.rst:436 +#: ../../library/profile.rst:445 msgid "function name" msgstr "" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:447 msgid "``'nfl'``" msgstr "``'nfl'``" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:447 msgid "SortKey.NFL" msgstr "SortKey.NFL" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:447 msgid "name/file/line" msgstr "" -#: ../../library/profile.rst:440 +#: ../../library/profile.rst:449 msgid "``'stdname'``" msgstr "``'stdname'``" -#: ../../library/profile.rst:440 +#: ../../library/profile.rst:449 msgid "SortKey.STDNAME" msgstr "SortKey.STDNAME" -#: ../../library/profile.rst:440 +#: ../../library/profile.rst:449 msgid "standard name" msgstr "" -#: ../../library/profile.rst:442 +#: ../../library/profile.rst:451 msgid "``'time'``" msgstr "``'time'``" -#: ../../library/profile.rst:442 +#: ../../library/profile.rst:451 msgid "SortKey.TIME" msgstr "SortKey.TIME" -#: ../../library/profile.rst:442 ../../library/profile.rst:444 +#: ../../library/profile.rst:451 ../../library/profile.rst:453 msgid "internal time" msgstr "" -#: ../../library/profile.rst:444 +#: ../../library/profile.rst:453 msgid "``'tottime'``" msgstr "``'tottime'``" -#: ../../library/profile.rst:447 +#: ../../library/profile.rst:456 msgid "" "Note that all sorts on statistics are in descending order (placing most time " "consuming items first), where as name, file, and line number searches are in " @@ -819,7 +820,7 @@ msgid "" "SortKey.FILENAME, SortKey.LINE)``." msgstr "" -#: ../../library/profile.rst:458 +#: ../../library/profile.rst:467 msgid "" "For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, " "``1``, and ``2`` are permitted. They are interpreted as ``'stdname'``, " @@ -828,31 +829,31 @@ msgid "" "used, and additional arguments will be silently ignored." msgstr "" -#: ../../library/profile.rst:466 +#: ../../library/profile.rst:475 msgid "Added the SortKey enum." msgstr "" -#: ../../library/profile.rst:471 +#: ../../library/profile.rst:480 msgid "" "This method for the :class:`Stats` class reverses the ordering of the basic " "list within the object. Note that by default ascending vs descending order " "is properly selected based on the sort key of choice." msgstr "" -#: ../../library/profile.rst:481 +#: ../../library/profile.rst:490 msgid "" "This method for the :class:`Stats` class prints out a report as described in " "the :func:`profile.run` definition." msgstr "" -#: ../../library/profile.rst:484 +#: ../../library/profile.rst:493 msgid "" "The order of the printing is based on the last :meth:`~pstats.Stats." "sort_stats` operation done on the object (subject to caveats in :meth:" "`~pstats.Stats.add` and :meth:`~pstats.Stats.strip_dirs`)." msgstr "" -#: ../../library/profile.rst:489 +#: ../../library/profile.rst:498 msgid "" "The arguments provided (if any) can be used to limit the list down to the " "significant entries. Initially, the list is taken to be the complete set of " @@ -864,28 +865,28 @@ msgid "" "example::" msgstr "" -#: ../../library/profile.rst:498 +#: ../../library/profile.rst:507 msgid "print_stats(.1, 'foo:')" msgstr "print_stats(.1, 'foo:')" -#: ../../library/profile.rst:500 +#: ../../library/profile.rst:509 msgid "" "would first limit the printing to first 10% of list, and then only print " "functions that were part of filename :file:`.\\*foo:`. In contrast, the " "command::" msgstr "" -#: ../../library/profile.rst:504 +#: ../../library/profile.rst:513 msgid "print_stats('foo:', .1)" msgstr "print_stats('foo:', .1)" -#: ../../library/profile.rst:506 +#: ../../library/profile.rst:515 msgid "" "would limit the list to all functions having file names :file:`.\\*foo:`, " "and then proceed to only print the first 10% of them." msgstr "" -#: ../../library/profile.rst:512 +#: ../../library/profile.rst:521 msgid "" "This method for the :class:`Stats` class prints a list of all functions that " "called each function in the profiled database. The ordering is identical to " @@ -895,7 +896,7 @@ msgid "" "produced the stats:" msgstr "" -#: ../../library/profile.rst:519 +#: ../../library/profile.rst:528 msgid "" "With :mod:`profile`, a number is shown in parentheses after each caller to " "show how many times this specific call was made. For convenience, a second " @@ -903,14 +904,14 @@ msgid "" "at the right." msgstr "" -#: ../../library/profile.rst:524 +#: ../../library/profile.rst:533 msgid "" "With :mod:`cProfile`, each caller is preceded by three numbers: the number " "of times this specific call was made, and the total and cumulative times " "spent in the current function while it was invoked by this specific caller." msgstr "" -#: ../../library/profile.rst:532 +#: ../../library/profile.rst:541 msgid "" "This method for the :class:`Stats` class prints a list of all function that " "were called by the indicated function. Aside from this reversal of " @@ -918,7 +919,7 @@ msgid "" "are identical to the :meth:`~pstats.Stats.print_callers` method." msgstr "" -#: ../../library/profile.rst:540 +#: ../../library/profile.rst:549 msgid "" "This method returns an instance of StatsProfile, which contains a mapping of " "function names to instances of FunctionProfile. Each FunctionProfile " @@ -926,17 +927,17 @@ msgid "" "long the function took to run, how many times it was called, etc..." msgstr "" -#: ../../library/profile.rst:545 +#: ../../library/profile.rst:554 msgid "" "Added the following dataclasses: StatsProfile, FunctionProfile. Added the " "following function: get_stats_profile." msgstr "" -#: ../../library/profile.rst:552 +#: ../../library/profile.rst:561 msgid "What Is Deterministic Profiling?" msgstr "" -#: ../../library/profile.rst:554 +#: ../../library/profile.rst:563 msgid "" ":dfn:`Deterministic profiling` is meant to reflect the fact that all " "*function call*, *function return*, and *exception* events are monitored, " @@ -949,7 +950,7 @@ msgid "" "being spent." msgstr "" -#: ../../library/profile.rst:563 +#: ../../library/profile.rst:572 msgid "" "In Python, since there is an interpreter active during execution, the " "presence of instrumented code is not required in order to do deterministic " @@ -961,7 +962,7 @@ msgid "" "time statistics about the execution of a Python program." msgstr "" -#: ../../library/profile.rst:572 +#: ../../library/profile.rst:581 msgid "" "Call count statistics can be used to identify bugs in code (surprising " "counts), and to identify possible inline-expansion points (high call " @@ -973,11 +974,11 @@ msgid "" "compared to iterative implementations." msgstr "" -#: ../../library/profile.rst:585 +#: ../../library/profile.rst:594 msgid "Limitations" msgstr "限制" -#: ../../library/profile.rst:587 +#: ../../library/profile.rst:596 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -988,7 +989,7 @@ msgid "" "first error induces a second source of error." msgstr "" -#: ../../library/profile.rst:595 +#: ../../library/profile.rst:604 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -1001,7 +1002,7 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" -#: ../../library/profile.rst:605 +#: ../../library/profile.rst:614 msgid "" "The problem is more important with :mod:`profile` than with the lower-" "overhead :mod:`cProfile`. For this reason, :mod:`profile` provides a means " @@ -1015,11 +1016,11 @@ msgid "" "calibration." msgstr "" -#: ../../library/profile.rst:619 +#: ../../library/profile.rst:628 msgid "Calibration" msgstr "校正" -#: ../../library/profile.rst:621 +#: ../../library/profile.rst:630 msgid "" "The profiler of the :mod:`profile` module subtracts a constant from each " "event handling time to compensate for the overhead of calling the time " @@ -1028,7 +1029,7 @@ msgid "" "platform (see :ref:`profile-limitations`). ::" msgstr "" -#: ../../library/profile.rst:627 +#: ../../library/profile.rst:636 msgid "" "import profile\n" "pr = profile.Profile()\n" @@ -1040,7 +1041,7 @@ msgstr "" "for i in range(5):\n" " print(pr.calibrate(10000))" -#: ../../library/profile.rst:632 +#: ../../library/profile.rst:641 msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " @@ -1050,19 +1051,19 @@ msgid "" "4.04e-6." msgstr "" -#: ../../library/profile.rst:638 +#: ../../library/profile.rst:647 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -#: ../../library/profile.rst:642 +#: ../../library/profile.rst:651 msgid "" "When you have a consistent answer, there are three ways you can use it::" msgstr "" -#: ../../library/profile.rst:644 +#: ../../library/profile.rst:653 msgid "" "import profile\n" "\n" @@ -1077,40 +1078,40 @@ msgid "" "pr = profile.Profile(bias=your_computed_bias)" msgstr "" -#: ../../library/profile.rst:656 +#: ../../library/profile.rst:665 msgid "" "If you have a choice, you are better off choosing a smaller constant, and " "then your results will \"less often\" show up as negative in profile " "statistics." msgstr "" -#: ../../library/profile.rst:662 +#: ../../library/profile.rst:671 msgid "Using a custom timer" msgstr "" -#: ../../library/profile.rst:664 +#: ../../library/profile.rst:673 msgid "" "If you want to change how current time is determined (for example, to force " "use of wall-clock time or elapsed process time), pass the timing function " "you want to the :class:`Profile` class constructor::" msgstr "" -#: ../../library/profile.rst:668 +#: ../../library/profile.rst:677 msgid "pr = profile.Profile(your_time_func)" msgstr "pr = profile.Profile(your_time_func)" -#: ../../library/profile.rst:670 +#: ../../library/profile.rst:679 msgid "" "The resulting profiler will then call ``your_time_func``. Depending on " "whether you are using :class:`profile.Profile` or :class:`cProfile.Profile`, " "``your_time_func``'s return value will be interpreted differently:" msgstr "" -#: ../../library/profile.rst:674 +#: ../../library/profile.rst:683 msgid ":class:`profile.Profile`" msgstr ":class:`profile.Profile`" -#: ../../library/profile.rst:675 +#: ../../library/profile.rst:684 msgid "" "``your_time_func`` should return a single number, or a list of numbers whose " "sum is the current time (like what :func:`os.times` returns). If the " @@ -1119,7 +1120,7 @@ msgid "" "routine." msgstr "" -#: ../../library/profile.rst:681 +#: ../../library/profile.rst:690 msgid "" "Be warned that you should calibrate the profiler class for the timer " "function that you choose (see :ref:`profile-calibration`). For most " @@ -1131,11 +1132,11 @@ msgid "" "along with the appropriate calibration constant." msgstr "" -#: ../../library/profile.rst:690 +#: ../../library/profile.rst:699 msgid ":class:`cProfile.Profile`" msgstr ":class:`cProfile.Profile`" -#: ../../library/profile.rst:691 +#: ../../library/profile.rst:700 msgid "" "``your_time_func`` should return a single number. If it returns integers, " "you can also invoke the class constructor with a second argument specifying " @@ -1144,11 +1145,11 @@ msgid "" "you would construct the :class:`Profile` instance as follows::" msgstr "" -#: ../../library/profile.rst:697 +#: ../../library/profile.rst:706 msgid "pr = cProfile.Profile(your_integer_time_func, 0.001)" msgstr "pr = cProfile.Profile(your_integer_time_func, 0.001)" -#: ../../library/profile.rst:699 +#: ../../library/profile.rst:708 msgid "" "As the :class:`cProfile.Profile` class cannot be calibrated, custom timer " "functions should be used with care and should be as fast as possible. For " @@ -1156,7 +1157,7 @@ msgid "" "in the C source of the internal :mod:`!_lsprof` module." msgstr "" -#: ../../library/profile.rst:704 +#: ../../library/profile.rst:713 msgid "" "Python 3.3 adds several new functions in :mod:`time` that can be used to " "make precise measurements of process or wall-clock time. For example, see :" diff --git a/library/readline.po b/library/readline.po index a93627616a..f064e01df0 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -107,13 +107,13 @@ msgstr "" #: ../../library/readline.rst:67 msgid "" "Execute the init line provided in the *string* argument. This calls :c:func:" -"`rl_parse_and_bind` in the underlying library." +"`!rl_parse_and_bind` in the underlying library." msgstr "" #: ../../library/readline.rst:73 msgid "" "Execute a readline initialization file. The default filename is the last " -"filename used. This calls :c:func:`rl_read_init_file` in the underlying " +"filename used. This calls :c:func:`!rl_read_init_file` in the underlying " "library." msgstr "" @@ -127,20 +127,20 @@ msgstr "" #: ../../library/readline.rst:85 msgid "" -"Return the current contents of the line buffer (:c:data:`rl_line_buffer` in " +"Return the current contents of the line buffer (:c:data:`!rl_line_buffer` in " "the underlying library)." msgstr "" #: ../../library/readline.rst:91 msgid "" "Insert text into the line buffer at the cursor position. This calls :c:func:" -"`rl_insert_text` in the underlying library, but ignores the return value." +"`!rl_insert_text` in the underlying library, but ignores the return value." msgstr "" #: ../../library/readline.rst:98 msgid "" "Change what's displayed on the screen to reflect the current contents of the " -"line buffer. This calls :c:func:`rl_redisplay` in the underlying library." +"line buffer. This calls :c:func:`!rl_redisplay` in the underlying library." msgstr "" #: ../../library/readline.rst:103 @@ -154,22 +154,22 @@ msgstr "" #: ../../library/readline.rst:110 msgid "" "Load a readline history file, and append it to the history list. The default " -"filename is :file:`~/.history`. This calls :c:func:`read_history` in the " +"filename is :file:`~/.history`. This calls :c:func:`!read_history` in the " "underlying library." msgstr "" #: ../../library/readline.rst:117 msgid "" "Save the history list to a readline history file, overwriting any existing " -"file. The default filename is :file:`~/.history`. This calls :c:func:" -"`write_history` in the underlying library." +"file. The default filename is :file:`~/.history`. This calls :c:func:`!" +"write_history` in the underlying library." msgstr "" #: ../../library/readline.rst:124 msgid "" "Append the last *nelements* items of history to a file. The default " "filename is :file:`~/.history`. The file must already exist. This calls :c:" -"func:`append_history` in the underlying library. This function only exists " +"func:`!append_history` in the underlying library. This function only exists " "if Python was compiled for a version of the library that supports it." msgstr "" @@ -177,8 +177,8 @@ msgstr "" msgid "" "Set or return the desired number of lines to save in the history file. The :" "func:`write_history_file` function uses this value to truncate the history " -"file, by calling :c:func:`history_truncate_file` in the underlying library. " -"Negative values imply unlimited history file size." +"file, by calling :c:func:`!history_truncate_file` in the underlying " +"library. Negative values imply unlimited history file size." msgstr "" #: ../../library/readline.rst:144 @@ -191,7 +191,7 @@ msgstr "" #: ../../library/readline.rst:151 msgid "" -"Clear the current history. This calls :c:func:`clear_history` in the " +"Clear the current history. This calls :c:func:`!clear_history` in the " "underlying library. The Python function only exists if Python was compiled " "for a version of the library that supports it." msgstr "" @@ -206,32 +206,32 @@ msgstr "" #: ../../library/readline.rst:165 msgid "" "Return the current contents of history item at *index*. The item index is " -"one-based. This calls :c:func:`history_get` in the underlying library." +"one-based. This calls :c:func:`!history_get` in the underlying library." msgstr "" #: ../../library/readline.rst:171 msgid "" "Remove history item specified by its position from the history. The position " -"is zero-based. This calls :c:func:`remove_history` in the underlying " +"is zero-based. This calls :c:func:`!remove_history` in the underlying " "library." msgstr "" #: ../../library/readline.rst:178 msgid "" "Replace history item specified by its position with *line*. The position is " -"zero-based. This calls :c:func:`replace_history_entry` in the underlying " +"zero-based. This calls :c:func:`!replace_history_entry` in the underlying " "library." msgstr "" #: ../../library/readline.rst:185 msgid "" "Append *line* to the history buffer, as if it was the last line typed. This " -"calls :c:func:`add_history` in the underlying library." +"calls :c:func:`!add_history` in the underlying library." msgstr "" #: ../../library/readline.rst:191 msgid "" -"Enable or disable automatic calls to :c:func:`add_history` when reading " +"Enable or disable automatic calls to :c:func:`!add_history` when reading " "input via readline. The *enabled* argument should be a Boolean value that " "when true, enables auto history, and that when false, disables auto history." msgstr "" @@ -248,16 +248,16 @@ msgstr "" #: ../../library/readline.rst:209 msgid "" -"Set or remove the function invoked by the :c:data:`rl_startup_hook` callback " -"of the underlying library. If *function* is specified, it will be used as " -"the new hook function; if omitted or ``None``, any function already " +"Set or remove the function invoked by the :c:data:`!rl_startup_hook` " +"callback of the underlying library. If *function* is specified, it will be " +"used as the new hook function; if omitted or ``None``, any function already " "installed is removed. The hook is called with no arguments just before " "readline prints the first prompt." msgstr "" #: ../../library/readline.rst:218 msgid "" -"Set or remove the function invoked by the :c:data:`rl_pre_input_hook` " +"Set or remove the function invoked by the :c:data:`!rl_pre_input_hook` " "callback of the underlying library. If *function* is specified, it will be " "used as the new hook function; if omitted or ``None``, any function already " "installed is removed. The hook is called with no arguments after the first " @@ -293,9 +293,9 @@ msgstr "" #: ../../library/readline.rst:249 msgid "" "The installed completer function is invoked by the *entry_func* callback " -"passed to :c:func:`rl_completion_matches` in the underlying library. The " -"*text* string comes from the first parameter to the :c:data:" -"`rl_attempted_completion_function` callback of the underlying library." +"passed to :c:func:`!rl_completion_matches` in the underlying library. The " +"*text* string comes from the first parameter to the :c:data:`!" +"rl_attempted_completion_function` callback of the underlying library." msgstr "" #: ../../library/readline.rst:258 @@ -306,15 +306,15 @@ msgstr "" #: ../../library/readline.rst:263 msgid "" -"Get the type of completion being attempted. This returns the :c:data:" -"`rl_completion_type` variable in the underlying library as an integer." +"Get the type of completion being attempted. This returns the :c:data:`!" +"rl_completion_type` variable in the underlying library as an integer." msgstr "" #: ../../library/readline.rst:271 msgid "" "Get the beginning or ending index of the completion scope. These indexes are " -"the *start* and *end* arguments passed to the :c:data:" -"`rl_attempted_completion_function` callback of the underlying library. The " +"the *start* and *end* arguments passed to the :c:data:`!" +"rl_attempted_completion_function` callback of the underlying library. The " "values may be different in the same input editing scenario based on the " "underlying C readline implementation. Ex: libedit is known to behave " "differently than libreadline." @@ -324,7 +324,7 @@ msgstr "" msgid "" "Set or get the word delimiters for completion. These determine the start of " "the word to be considered for completion (the completion scope). These " -"functions access the :c:data:`rl_completer_word_break_characters` variable " +"functions access the :c:data:`!rl_completer_word_break_characters` variable " "in the underlying library." msgstr "" @@ -333,7 +333,7 @@ msgid "" "Set or remove the completion display function. If *function* is specified, " "it will be used as the new completion display function; if omitted or " "``None``, any completion display function already installed is removed. " -"This sets or clears the :c:data:`rl_completion_display_matches_hook` " +"This sets or clears the :c:data:`!rl_completion_display_matches_hook` " "callback in the underlying library. The completion display function is " "called as ``function(substitution, [matches], longest_match_length)`` once " "each time matches need to be displayed." diff --git a/library/secrets.po b/library/secrets.po index e7b27fe3f1..bfacf78c8e 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 16:20+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-11-30 13:42+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -104,8 +104,9 @@ msgstr "" "``None`` 或未提供,則會使用一合理預設值。" #: ../../library/secrets.rst:71 +#, fuzzy msgid "" -">>> token_bytes(16) \n" +">>> token_bytes(16)\n" "b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'" msgstr "" ">>> token_bytes(16) \n" @@ -122,8 +123,9 @@ msgstr "" "的預設值。" #: ../../library/secrets.rst:83 +#, fuzzy msgid "" -">>> token_hex(16) \n" +">>> token_hex(16)\n" "'f9bf78b9a18ce6d46a0cd2b0b86df9da'" msgstr "" ">>> token_hex(16) \n" @@ -141,8 +143,9 @@ msgstr "" "``None`` 或未提供,則會使用一個合理的預設值。" #: ../../library/secrets.rst:95 +#, fuzzy msgid "" -">>> token_urlsafe(16) \n" +">>> token_urlsafe(16)\n" "'Drmhze6EPcv0fN_81Bj-nA'" msgstr "" ">>> token_urlsafe(16) \n" diff --git a/library/selectors.po b/library/selectors.po index e9e2d0f99a..5933427814 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -167,35 +167,35 @@ msgid "" "implementations support the :term:`context manager` protocol." msgstr "" -#: ../../library/selectors.rst:108 +#: ../../library/selectors.rst:109 msgid "Register a file object for selection, monitoring it for I/O events." msgstr "" -#: ../../library/selectors.rst:110 +#: ../../library/selectors.rst:111 msgid "" "*fileobj* is the file object to monitor. It may either be an integer file " "descriptor or an object with a ``fileno()`` method. *events* is a bitwise " "mask of events to monitor. *data* is an opaque object." msgstr "" -#: ../../library/selectors.rst:115 +#: ../../library/selectors.rst:116 msgid "" "This returns a new :class:`SelectorKey` instance, or raises a :exc:" "`ValueError` in case of invalid event mask or file descriptor, or :exc:" "`KeyError` if the file object is already registered." msgstr "" -#: ../../library/selectors.rst:121 +#: ../../library/selectors.rst:123 msgid "" "Unregister a file object from selection, removing it from monitoring. A file " "object shall be unregistered prior to being closed." msgstr "" -#: ../../library/selectors.rst:124 +#: ../../library/selectors.rst:126 msgid "*fileobj* must be a file object previously registered." msgstr "" -#: ../../library/selectors.rst:126 +#: ../../library/selectors.rst:128 msgid "" "This returns the associated :class:`SelectorKey` instance, or raises a :exc:" "`KeyError` if *fileobj* is not registered. It will raise :exc:`ValueError` " @@ -203,30 +203,30 @@ msgid "" "``fileno()`` method has an invalid return value)." msgstr "" -#: ../../library/selectors.rst:133 +#: ../../library/selectors.rst:135 msgid "Change a registered file object's monitored events or attached data." msgstr "" -#: ../../library/selectors.rst:135 +#: ../../library/selectors.rst:137 msgid "" "This is equivalent to ``BaseSelector.unregister(fileobj)`` followed by " "``BaseSelector.register(fileobj, events, data)``, except that it can be " "implemented more efficiently." msgstr "" -#: ../../library/selectors.rst:139 +#: ../../library/selectors.rst:141 msgid "" "This returns a new :class:`SelectorKey` instance, or raises a :exc:" "`ValueError` in case of invalid event mask or file descriptor, or :exc:" "`KeyError` if the file object is not registered." msgstr "" -#: ../../library/selectors.rst:145 +#: ../../library/selectors.rst:148 msgid "" "Wait until some registered file objects become ready, or the timeout expires." msgstr "" -#: ../../library/selectors.rst:148 +#: ../../library/selectors.rst:151 msgid "" "If ``timeout > 0``, this specifies the maximum wait time, in seconds. If " "``timeout <= 0``, the call won't block, and will report the currently ready " @@ -234,26 +234,26 @@ msgid "" "monitored file object becomes ready." msgstr "" -#: ../../library/selectors.rst:154 +#: ../../library/selectors.rst:157 msgid "" "This returns a list of ``(key, events)`` tuples, one for each ready file " "object." msgstr "" -#: ../../library/selectors.rst:157 +#: ../../library/selectors.rst:160 msgid "" "*key* is the :class:`SelectorKey` instance corresponding to a ready file " "object. *events* is a bitmask of events ready on this file object." msgstr "" -#: ../../library/selectors.rst:162 +#: ../../library/selectors.rst:165 msgid "" "This method can return before any file object becomes ready or the timeout " "has elapsed if the current process receives a signal: in this case, an empty " "list will be returned." msgstr "" -#: ../../library/selectors.rst:166 +#: ../../library/selectors.rst:169 msgid "" "The selector is now retried with a recomputed timeout when interrupted by a " "signal if the signal handler did not raise an exception (see :pep:`475` for " @@ -261,90 +261,90 @@ msgid "" "timeout." msgstr "" -#: ../../library/selectors.rst:174 +#: ../../library/selectors.rst:177 msgid "Close the selector." msgstr "" -#: ../../library/selectors.rst:176 +#: ../../library/selectors.rst:179 msgid "" "This must be called to make sure that any underlying resource is freed. The " "selector shall not be used once it has been closed." msgstr "" -#: ../../library/selectors.rst:181 +#: ../../library/selectors.rst:184 msgid "Return the key associated with a registered file object." msgstr "" -#: ../../library/selectors.rst:183 +#: ../../library/selectors.rst:186 msgid "" "This returns the :class:`SelectorKey` instance associated to this file " "object, or raises :exc:`KeyError` if the file object is not registered." msgstr "" -#: ../../library/selectors.rst:188 +#: ../../library/selectors.rst:192 msgid "Return a mapping of file objects to selector keys." msgstr "" -#: ../../library/selectors.rst:190 +#: ../../library/selectors.rst:194 msgid "" "This returns a :class:`~collections.abc.Mapping` instance mapping registered " "file objects to their associated :class:`SelectorKey` instance." msgstr "" -#: ../../library/selectors.rst:197 +#: ../../library/selectors.rst:201 msgid "" "The default selector class, using the most efficient implementation " "available on the current platform. This should be the default choice for " "most users." msgstr "" -#: ../../library/selectors.rst:204 +#: ../../library/selectors.rst:208 msgid ":func:`select.select`-based selector." msgstr "" -#: ../../library/selectors.rst:209 +#: ../../library/selectors.rst:213 msgid ":func:`select.poll`-based selector." msgstr "" -#: ../../library/selectors.rst:214 +#: ../../library/selectors.rst:218 msgid ":func:`select.epoll`-based selector." msgstr "" -#: ../../library/selectors.rst:218 +#: ../../library/selectors.rst:222 msgid "" "This returns the file descriptor used by the underlying :func:`select.epoll` " "object." msgstr "" -#: ../../library/selectors.rst:223 +#: ../../library/selectors.rst:227 msgid ":func:`select.devpoll`-based selector." msgstr "" -#: ../../library/selectors.rst:227 +#: ../../library/selectors.rst:231 msgid "" "This returns the file descriptor used by the underlying :func:`select." "devpoll` object." msgstr "" -#: ../../library/selectors.rst:234 +#: ../../library/selectors.rst:238 msgid ":func:`select.kqueue`-based selector." msgstr "" -#: ../../library/selectors.rst:238 +#: ../../library/selectors.rst:242 msgid "" "This returns the file descriptor used by the underlying :func:`select." "kqueue` object." msgstr "" -#: ../../library/selectors.rst:243 +#: ../../library/selectors.rst:247 msgid "Examples" msgstr "範例" -#: ../../library/selectors.rst:245 +#: ../../library/selectors.rst:249 msgid "Here is a simple echo server implementation::" msgstr "" -#: ../../library/selectors.rst:247 +#: ../../library/selectors.rst:251 msgid "" "import selectors\n" "import socket\n" diff --git a/library/ssl.po b/library/ssl.po index 836bfdab60..9fe234bd26 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -562,13 +562,14 @@ msgid "Here's an example:" msgstr "以下是一個範例:" #: ../../library/ssl.rst:367 +#, fuzzy msgid "" ">>> import ssl\n" ">>> timestamp = ssl.cert_time_to_seconds(\"Jan 5 09:34:43 2018 GMT\")\n" -">>> timestamp \n" +">>> timestamp\n" "1515144883\n" ">>> from datetime import datetime\n" -">>> print(datetime.utcfromtimestamp(timestamp)) \n" +">>> print(datetime.utcfromtimestamp(timestamp))\n" "2018-01-05 09:34:43" msgstr "" ">>> import ssl\n" diff --git a/library/statistics.po b/library/statistics.po index 54f51c864f..46c683b346 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1896,6 +1896,7 @@ msgstr "" "Monte_Carlo_method>`_:" #: ../../library/statistics.rst:1075 +#, fuzzy msgid "" ">>> def model(x, y, z):\n" "... return (3*x + 7*x*y - 5*y) / (11 * z)\n" @@ -1904,7 +1905,7 @@ msgid "" ">>> X = NormalDist(10, 2.5).samples(n, seed=3652260728)\n" ">>> Y = NormalDist(15, 1.75).samples(n, seed=4582495471)\n" ">>> Z = NormalDist(50, 1.25).samples(n, seed=6582483453)\n" -">>> quantiles(map(model, X, Y, Z)) \n" +">>> quantiles(map(model, X, Y, Z))\n" "[1.4591308524824727, 1.8035946855390597, 2.175091447274739]" msgstr "" ">>> def model(x, y, z):\n" diff --git a/library/stdtypes.po b/library/stdtypes.po index c1709ecb21..4d704c45b0 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang <mattwang44@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,8 +135,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:86 ../../library/stdtypes.rst:276 #: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:965 -#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2432 -#: ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2438 +#: ../../library/stdtypes.rst:3657 msgid "Notes" msgstr "註解" @@ -150,7 +150,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:967 #: ../../library/stdtypes.rst:970 ../../library/stdtypes.rst:1181 -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 msgid "\\(1)" msgstr "\\(1)" @@ -164,8 +164,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:91 ../../library/stdtypes.rst:289 #: ../../library/stdtypes.rst:309 ../../library/stdtypes.rst:1209 -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:2444 -#: ../../library/stdtypes.rst:3661 ../../library/stdtypes.rst:3663 +#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:2450 +#: ../../library/stdtypes.rst:3667 ../../library/stdtypes.rst:3669 msgid "\\(2)" msgstr "\\(2)" @@ -178,18 +178,18 @@ msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" #: ../../library/stdtypes.rst:94 ../../library/stdtypes.rst:979 -#: ../../library/stdtypes.rst:1212 ../../library/stdtypes.rst:2446 -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:2450 -#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3665 -#: ../../library/stdtypes.rst:3667 ../../library/stdtypes.rst:3669 -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:1212 ../../library/stdtypes.rst:2452 +#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:2456 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3673 ../../library/stdtypes.rst:3675 +#: ../../library/stdtypes.rst:3677 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:103 ../../library/stdtypes.rst:320 #: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:1016 -#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:2478 -#: ../../library/stdtypes.rst:3701 +#: ../../library/stdtypes.rst:1221 ../../library/stdtypes.rst:2484 +#: ../../library/stdtypes.rst:3707 msgid "Notes:" msgstr "註解:" @@ -236,9 +236,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2409 -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3628 -#: ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:144 ../../library/stdtypes.rst:2415 +#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3657 msgid "Meaning" msgstr "含義" @@ -559,7 +559,7 @@ msgid "" msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" #: ../../library/stdtypes.rst:302 ../../library/stdtypes.rst:1202 -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3688 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3694 msgid "\\(6)" msgstr "\\(6)" @@ -597,9 +597,9 @@ msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:311 ../../library/stdtypes.rst:313 #: ../../library/stdtypes.rst:1191 ../../library/stdtypes.rst:1194 -#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:2468 -#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:3684 -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:2474 +#: ../../library/stdtypes.rst:2477 ../../library/stdtypes.rst:3690 +#: ../../library/stdtypes.rst:3697 msgid "\\(5)" msgstr "\\(5)" @@ -758,8 +758,8 @@ msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:418 ../../library/stdtypes.rst:421 #: ../../library/stdtypes.rst:424 ../../library/stdtypes.rst:1216 -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:2458 -#: ../../library/stdtypes.rst:3673 ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2460 ../../library/stdtypes.rst:2464 +#: ../../library/stdtypes.rst:3679 ../../library/stdtypes.rst:3683 msgid "\\(4)" msgstr "\\(4)" @@ -1530,9 +1530,9 @@ msgstr "" #: ../../library/stdtypes.rst:909 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " -"iterator protocol. If a container object's :meth:`~iterator.__iter__` " -"method is implemented as a generator, it will automatically return an " -"iterator object (technically, a generator object) supplying the :meth:`!" +"iterator protocol. If a container object's :meth:`~object.__iter__` method " +"is implemented as a generator, it will automatically return an iterator " +"object (technically, a generator object) supplying the :meth:`~iterator." "__iter__` and :meth:`~generator.__next__` methods. More information about " "generators can be found in :ref:`the documentation for the yield expression " "<yieldexpr>`." @@ -1684,7 +1684,7 @@ msgid "" "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:992 ../../library/stdtypes.rst:3665 msgid "\\(8)" msgstr "\\(8)" @@ -2619,7 +2619,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1673 ../../library/stdtypes.rst:2824 +#: ../../library/stdtypes.rst:1673 ../../library/stdtypes.rst:2830 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -2641,11 +2641,11 @@ msgid "" "ref:`debug build <debug-build>` is used." msgstr "" -#: ../../library/stdtypes.rst:1688 ../../library/stdtypes.rst:2843 +#: ../../library/stdtypes.rst:1688 ../../library/stdtypes.rst:2849 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1691 ../../library/stdtypes.rst:2846 +#: ../../library/stdtypes.rst:1691 ../../library/stdtypes.rst:2852 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode <debug-build>`." @@ -2839,29 +2839,41 @@ msgstr "" #: ../../library/stdtypes.rst:1879 msgid "" -"Return ``True`` if all characters in the string are printable or the string " -"is empty, ``False`` otherwise. Nonprintable characters are those characters " -"defined in the Unicode character database as \"Other\" or \"Separator\", " -"excepting the ASCII space (0x20) which is considered printable. (Note that " -"printable characters in this context are those which should not be escaped " -"when :func:`repr` is invoked on a string. It has no bearing on the handling " -"of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" +"Return true if all characters in the string are printable, false if it " +"contains at least one non-printable character." +msgstr "" + +#: ../../library/stdtypes.rst:1882 +msgid "" +"Here \"printable\" means the character is suitable for :func:`repr` to use " +"in its output; \"non-printable\" means that :func:`repr` on built-in types " +"will hex-escape the character. It has no bearing on the handling of strings " +"written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:1890 +#: ../../library/stdtypes.rst:1887 +msgid "" +"The printable characters are those which in the Unicode character database " +"(see :mod:`unicodedata`) have a general category in group Letter, Mark, " +"Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space " +"0x20. Nonprintable characters are those in group Separator or Other (Z or " +"C), except the ASCII space." +msgstr "" + +#: ../../library/stdtypes.rst:1896 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:1893 +#: ../../library/stdtypes.rst:1899 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:1901 +#: ../../library/stdtypes.rst:1907 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 " @@ -2869,13 +2881,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1908 +#: ../../library/stdtypes.rst:1914 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:1926 +#: ../../library/stdtypes.rst:1932 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 " @@ -2883,27 +2895,27 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1934 +#: ../../library/stdtypes.rst:1940 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:1941 +#: ../../library/stdtypes.rst:1947 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1944 +#: ../../library/stdtypes.rst:1950 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard <https://www.unicode.org/versions/" "Unicode15.1.0/ch03.pdf>`__." msgstr "" -#: ../../library/stdtypes.rst:1951 +#: ../../library/stdtypes.rst:1957 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 " @@ -2912,7 +2924,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1956 +#: ../../library/stdtypes.rst:1962 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -2924,13 +2936,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:1961 +#: ../../library/stdtypes.rst:1967 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:1964 +#: ../../library/stdtypes.rst:1970 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -2942,13 +2954,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:1972 +#: ../../library/stdtypes.rst:1978 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1974 +#: ../../library/stdtypes.rst:1980 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, " @@ -2956,7 +2968,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1979 +#: ../../library/stdtypes.rst:1985 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 " @@ -2964,7 +2976,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1987 +#: ../../library/stdtypes.rst:1993 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 " @@ -2972,13 +2984,13 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1995 +#: ../../library/stdtypes.rst:2001 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:1999 +#: ../../library/stdtypes.rst:2005 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -2990,14 +3002,14 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2009 +#: ../../library/stdtypes.rst:2015 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:2013 +#: ../../library/stdtypes.rst:2019 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3009,7 +3021,7 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2023 +#: ../../library/stdtypes.rst:2029 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " @@ -3017,32 +3029,32 @@ msgid "" "replaced." msgstr "" -#: ../../library/stdtypes.rst:2027 +#: ../../library/stdtypes.rst:2033 #, fuzzy msgid "*count* is now supported as a keyword argument." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:2033 +#: ../../library/stdtypes.rst:2039 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:2040 +#: ../../library/stdtypes.rst:2046 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:2046 +#: ../../library/stdtypes.rst:2052 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:2053 +#: ../../library/stdtypes.rst:2059 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 " @@ -3050,7 +3062,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2061 +#: ../../library/stdtypes.rst:2067 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 " @@ -3059,7 +3071,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2070 +#: ../../library/stdtypes.rst:2076 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 " @@ -3068,7 +3080,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2075 +#: ../../library/stdtypes.rst:2081 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -3080,13 +3092,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2080 +#: ../../library/stdtypes.rst:2086 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:2083 +#: ../../library/stdtypes.rst:2089 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -3098,7 +3110,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2090 +#: ../../library/stdtypes.rst:2096 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, " @@ -3107,7 +3119,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2102 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -3117,20 +3129,20 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2103 ../../library/stdtypes.rst:2121 -#: ../../library/stdtypes.rst:2173 ../../library/stdtypes.rst:2241 -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3161 -#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:3270 -#: ../../library/stdtypes.rst:3286 ../../library/stdtypes.rst:3311 -#: ../../library/stdtypes.rst:3325 ../../library/stdtypes.rst:3353 -#: ../../library/stdtypes.rst:3367 ../../library/stdtypes.rst:3385 -#: ../../library/stdtypes.rst:3412 ../../library/stdtypes.rst:3435 -#: ../../library/stdtypes.rst:3462 ../../library/stdtypes.rst:3504 -#: ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2109 ../../library/stdtypes.rst:2127 +#: ../../library/stdtypes.rst:2179 ../../library/stdtypes.rst:2247 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3167 +#: ../../library/stdtypes.rst:3185 ../../library/stdtypes.rst:3276 +#: ../../library/stdtypes.rst:3292 ../../library/stdtypes.rst:3317 +#: ../../library/stdtypes.rst:3331 ../../library/stdtypes.rst:3359 +#: ../../library/stdtypes.rst:3373 ../../library/stdtypes.rst:3391 +#: ../../library/stdtypes.rst:3418 ../../library/stdtypes.rst:3441 +#: ../../library/stdtypes.rst:3468 ../../library/stdtypes.rst:3510 +#: ../../library/stdtypes.rst:3534 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2105 +#: ../../library/stdtypes.rst:2111 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -3150,7 +3162,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2120 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, " @@ -3160,7 +3172,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2123 +#: ../../library/stdtypes.rst:2129 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -3176,120 +3188,120 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2136 +#: ../../library/stdtypes.rst:2142 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:2140 +#: ../../library/stdtypes.rst:2146 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2144 +#: ../../library/stdtypes.rst:2150 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2144 +#: ../../library/stdtypes.rst:2150 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2152 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2152 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2154 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2148 +#: ../../library/stdtypes.rst:2154 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2150 +#: ../../library/stdtypes.rst:2156 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2150 +#: ../../library/stdtypes.rst:2156 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2152 +#: ../../library/stdtypes.rst:2158 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2152 +#: ../../library/stdtypes.rst:2158 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2154 +#: ../../library/stdtypes.rst:2160 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2154 +#: ../../library/stdtypes.rst:2160 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2156 +#: ../../library/stdtypes.rst:2162 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2156 +#: ../../library/stdtypes.rst:2162 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2158 +#: ../../library/stdtypes.rst:2164 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2158 +#: ../../library/stdtypes.rst:2164 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2160 +#: ../../library/stdtypes.rst:2166 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2160 +#: ../../library/stdtypes.rst:2166 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2162 +#: ../../library/stdtypes.rst:2168 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2162 +#: ../../library/stdtypes.rst:2168 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2164 +#: ../../library/stdtypes.rst:2170 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2164 +#: ../../library/stdtypes.rst:2170 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2166 +#: ../../library/stdtypes.rst:2172 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2166 +#: ../../library/stdtypes.rst:2172 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2171 +#: ../../library/stdtypes.rst:2177 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2175 +#: ../../library/stdtypes.rst:2181 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -3301,14 +3313,14 @@ msgstr "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -#: ../../library/stdtypes.rst:2180 +#: ../../library/stdtypes.rst:2186 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:2184 +#: ../../library/stdtypes.rst:2190 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -3320,11 +3332,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2189 +#: ../../library/stdtypes.rst:2195 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2191 +#: ../../library/stdtypes.rst:2197 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -3336,7 +3348,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2199 +#: ../../library/stdtypes.rst:2205 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -3344,7 +3356,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2207 +#: ../../library/stdtypes.rst:2213 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 " @@ -3353,7 +3365,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2213 +#: ../../library/stdtypes.rst:2219 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -3365,7 +3377,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2218 +#: ../../library/stdtypes.rst:2224 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -3373,7 +3385,7 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2224 +#: ../../library/stdtypes.rst:2230 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -3383,20 +3395,20 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2231 +#: ../../library/stdtypes.rst:2237 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:2238 +#: ../../library/stdtypes.rst:2244 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:2243 +#: ../../library/stdtypes.rst:2249 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -3404,7 +3416,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2246 ../../library/stdtypes.rst:3472 +#: ../../library/stdtypes.rst:2252 ../../library/stdtypes.rst:3478 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 " @@ -3412,7 +3424,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2251 +#: ../../library/stdtypes.rst:2257 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -3420,19 +3432,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2254 +#: ../../library/stdtypes.rst:2260 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2257 +#: ../../library/stdtypes.rst:2263 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2260 +#: ../../library/stdtypes.rst:2266 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -3452,7 +3464,7 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2272 +#: ../../library/stdtypes.rst:2278 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 " @@ -3464,19 +3476,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2281 +#: ../../library/stdtypes.rst:2287 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2284 +#: ../../library/stdtypes.rst:2290 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2290 +#: ../../library/stdtypes.rst:2296 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`` " @@ -3485,14 +3497,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2296 +#: ../../library/stdtypes.rst:2302 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard <https://www.unicode.org/versions/" "Unicode15.1.0/ch03.pdf>`__." msgstr "" -#: ../../library/stdtypes.rst:2303 +#: ../../library/stdtypes.rst:2309 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 " @@ -3500,7 +3512,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2311 +#: ../../library/stdtypes.rst:2317 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -3512,11 +3524,11 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2321 +#: ../../library/stdtypes.rst:2327 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2334 +#: ../../library/stdtypes.rst:2340 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 " @@ -3527,7 +3539,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2342 +#: ../../library/stdtypes.rst:2348 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -3537,13 +3549,13 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:2349 +#: ../../library/stdtypes.rst:2355 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." msgstr "" -#: ../../library/stdtypes.rst:2354 +#: ../../library/stdtypes.rst:2360 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 " @@ -3551,36 +3563,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2364 ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3589 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3586 +#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3592 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2369 ../../library/stdtypes.rst:3588 +#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3594 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3597 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3594 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3600 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:2379 ../../library/stdtypes.rst:3598 +#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3604 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -3588,15 +3600,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3609 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3611 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2388 +#: ../../library/stdtypes.rst:2394 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 " @@ -3604,279 +3616,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2397 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3622 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3619 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3625 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3634 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:2417 ../../library/stdtypes.rst:3636 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:2417 ../../library/stdtypes.rst:3636 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3639 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3639 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3644 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:3638 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3644 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 +#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3647 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3641 +#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3647 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3645 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3651 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:2429 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2435 ../../library/stdtypes.rst:3654 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:3653 +#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3659 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:2436 -#: ../../library/stdtypes.rst:3653 ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:2442 +#: ../../library/stdtypes.rst:3659 ../../library/stdtypes.rst:3661 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3661 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3657 +#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3661 +#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3661 +#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 +#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:3669 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3663 +#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:3669 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 +#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3665 +#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2448 ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:3669 +#: ../../library/stdtypes.rst:2456 ../../library/stdtypes.rst:3675 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2450 ../../library/stdtypes.rst:2452 -#: ../../library/stdtypes.rst:3669 ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:2456 ../../library/stdtypes.rst:2458 +#: ../../library/stdtypes.rst:3675 ../../library/stdtypes.rst:3677 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3677 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:2460 ../../library/stdtypes.rst:3679 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2454 ../../library/stdtypes.rst:3673 +#: ../../library/stdtypes.rst:2460 ../../library/stdtypes.rst:3679 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:2458 ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2464 ../../library/stdtypes.rst:3683 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3677 +#: ../../library/stdtypes.rst:2464 ../../library/stdtypes.rst:3683 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:2462 ../../library/stdtypes.rst:3681 +#: ../../library/stdtypes.rst:2468 ../../library/stdtypes.rst:3687 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2462 +#: ../../library/stdtypes.rst:2468 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:3694 +#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:3700 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2471 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2468 ../../library/stdtypes.rst:3688 +#: ../../library/stdtypes.rst:2474 ../../library/stdtypes.rst:3694 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2468 +#: ../../library/stdtypes.rst:2474 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2471 ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:2477 ../../library/stdtypes.rst:3697 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2471 +#: ../../library/stdtypes.rst:2477 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2474 ../../library/stdtypes.rst:3697 +#: ../../library/stdtypes.rst:2480 ../../library/stdtypes.rst:3703 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2474 ../../library/stdtypes.rst:3697 +#: ../../library/stdtypes.rst:2480 ../../library/stdtypes.rst:3703 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2481 ../../library/stdtypes.rst:3704 +#: ../../library/stdtypes.rst:2487 ../../library/stdtypes.rst:3710 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2485 ../../library/stdtypes.rst:3708 +#: ../../library/stdtypes.rst:2491 ../../library/stdtypes.rst:3714 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:2489 ../../library/stdtypes.rst:3712 +#: ../../library/stdtypes.rst:2495 ../../library/stdtypes.rst:3718 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2492 ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:2498 ../../library/stdtypes.rst:3721 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2496 ../../library/stdtypes.rst:3719 +#: ../../library/stdtypes.rst:2502 ../../library/stdtypes.rst:3725 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:2499 ../../library/stdtypes.rst:3722 +#: ../../library/stdtypes.rst:2505 ../../library/stdtypes.rst:3728 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2503 ../../library/stdtypes.rst:3726 +#: ../../library/stdtypes.rst:2509 ../../library/stdtypes.rst:3732 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2506 ../../library/stdtypes.rst:3735 +#: ../../library/stdtypes.rst:2512 ../../library/stdtypes.rst:3741 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:2508 +#: ../../library/stdtypes.rst:2514 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:2513 +#: ../../library/stdtypes.rst:2519 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2530 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2538 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 :" @@ -3884,17 +3896,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2537 +#: ../../library/stdtypes.rst:2543 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:2543 +#: ../../library/stdtypes.rst:2549 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2547 +#: ../../library/stdtypes.rst:2553 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3902,40 +3914,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2554 +#: ../../library/stdtypes.rst:2560 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:2557 +#: ../../library/stdtypes.rst:2563 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2558 +#: ../../library/stdtypes.rst:2564 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2559 +#: ../../library/stdtypes.rst:2565 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2561 +#: ../../library/stdtypes.rst:2567 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:2565 +#: ../../library/stdtypes.rst:2571 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:2569 +#: ../../library/stdtypes.rst:2575 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3948,29 +3960,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2579 +#: ../../library/stdtypes.rst:2585 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2582 +#: ../../library/stdtypes.rst:2588 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2583 +#: ../../library/stdtypes.rst:2589 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2584 +#: ../../library/stdtypes.rst:2590 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2586 +#: ../../library/stdtypes.rst:2592 msgid "Also see the :ref:`bytes <func-bytes>` built-in." msgstr "" -#: ../../library/stdtypes.rst:2588 +#: ../../library/stdtypes.rst:2594 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3978,32 +3990,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2594 +#: ../../library/stdtypes.rst:2600 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:2601 +#: ../../library/stdtypes.rst:2607 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2611 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2610 ../../library/stdtypes.rst:2695 +#: ../../library/stdtypes.rst:2616 ../../library/stdtypes.rst:2701 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2616 +#: ../../library/stdtypes.rst:2622 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, " @@ -4012,13 +4024,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2633 +#: ../../library/stdtypes.rst:2639 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:2637 +#: ../../library/stdtypes.rst:2643 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 " @@ -4026,58 +4038,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2642 +#: ../../library/stdtypes.rst:2648 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:2650 +#: ../../library/stdtypes.rst:2656 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2654 +#: ../../library/stdtypes.rst:2660 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2659 +#: ../../library/stdtypes.rst:2665 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2662 +#: ../../library/stdtypes.rst:2668 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2669 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2664 +#: ../../library/stdtypes.rst:2670 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2665 +#: ../../library/stdtypes.rst:2671 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2667 +#: ../../library/stdtypes.rst:2673 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable <typesseq-" "mutable>` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2671 +#: ../../library/stdtypes.rst:2677 msgid "Also see the :ref:`bytearray <func-bytearray>` built-in." msgstr "" -#: ../../library/stdtypes.rst:2673 +#: ../../library/stdtypes.rst:2679 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4085,33 +4097,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2679 +#: ../../library/stdtypes.rst:2685 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:2686 +#: ../../library/stdtypes.rst:2692 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2696 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2703 +#: ../../library/stdtypes.rst:2709 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:2708 +#: ../../library/stdtypes.rst:2714 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 " @@ -4119,7 +4131,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2713 +#: ../../library/stdtypes.rst:2719 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -4127,11 +4139,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2722 +#: ../../library/stdtypes.rst:2728 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2727 +#: ../../library/stdtypes.rst:2733 msgid "" "Both bytes and bytearray objects support the :ref:`common <typesseq-common>` " "sequence operations. They interoperate not just with operands of the same " @@ -4140,14 +4152,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2735 +#: ../../library/stdtypes.rst:2741 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:2739 +#: ../../library/stdtypes.rst:2745 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -4155,11 +4167,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:2742 +#: ../../library/stdtypes.rst:2748 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:2744 +#: ../../library/stdtypes.rst:2750 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -4167,60 +4179,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:2747 +#: ../../library/stdtypes.rst:2753 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:2752 +#: ../../library/stdtypes.rst:2758 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:2755 +#: ../../library/stdtypes.rst:2761 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2761 +#: ../../library/stdtypes.rst:2767 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:2765 ../../library/stdtypes.rst:2870 -#: ../../library/stdtypes.rst:2892 ../../library/stdtypes.rst:2958 -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2771 ../../library/stdtypes.rst:2876 +#: ../../library/stdtypes.rst:2898 ../../library/stdtypes.rst:2964 +#: ../../library/stdtypes.rst:2977 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:2768 +#: ../../library/stdtypes.rst:2774 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:2771 ../../library/stdtypes.rst:2882 -#: ../../library/stdtypes.rst:2895 ../../library/stdtypes.rst:2961 -#: ../../library/stdtypes.rst:2974 +#: ../../library/stdtypes.rst:2777 ../../library/stdtypes.rst:2888 +#: ../../library/stdtypes.rst:2901 ../../library/stdtypes.rst:2967 +#: ../../library/stdtypes.rst:2980 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2778 +#: ../../library/stdtypes.rst:2784 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:2782 +#: ../../library/stdtypes.rst:2788 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -4232,32 +4244,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:2787 +#: ../../library/stdtypes.rst:2793 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2791 ../../library/stdtypes.rst:2813 -#: ../../library/stdtypes.rst:2946 ../../library/stdtypes.rst:3039 -#: ../../library/stdtypes.rst:3053 ../../library/stdtypes.rst:3084 -#: ../../library/stdtypes.rst:3098 ../../library/stdtypes.rst:3140 -#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:3229 -#: ../../library/stdtypes.rst:3257 ../../library/stdtypes.rst:3396 -#: ../../library/stdtypes.rst:3451 ../../library/stdtypes.rst:3494 -#: ../../library/stdtypes.rst:3515 ../../library/stdtypes.rst:3537 -#: ../../library/stdtypes.rst:3739 +#: ../../library/stdtypes.rst:2797 ../../library/stdtypes.rst:2819 +#: ../../library/stdtypes.rst:2952 ../../library/stdtypes.rst:3045 +#: ../../library/stdtypes.rst:3059 ../../library/stdtypes.rst:3090 +#: ../../library/stdtypes.rst:3104 ../../library/stdtypes.rst:3146 +#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:3235 +#: ../../library/stdtypes.rst:3263 ../../library/stdtypes.rst:3402 +#: ../../library/stdtypes.rst:3457 ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:3521 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:3745 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:2800 +#: ../../library/stdtypes.rst:2806 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:2804 +#: ../../library/stdtypes.rst:2810 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -4269,15 +4281,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:2809 +#: ../../library/stdtypes.rst:2815 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2822 +#: ../../library/stdtypes.rst:2828 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2827 +#: ../../library/stdtypes.rst:2833 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -4285,21 +4297,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2833 +#: ../../library/stdtypes.rst:2839 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 <debug-build>` is used." msgstr "" -#: ../../library/stdtypes.rst:2839 +#: ../../library/stdtypes.rst:2845 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:2854 +#: ../../library/stdtypes.rst:2860 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -4307,11 +4319,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2859 +#: ../../library/stdtypes.rst:2865 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2871 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 " @@ -4319,14 +4331,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2875 +#: ../../library/stdtypes.rst:2881 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:2879 +#: ../../library/stdtypes.rst:2885 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -4334,13 +4346,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:2889 +#: ../../library/stdtypes.rst:2895 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2902 +#: ../../library/stdtypes.rst:2908 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 " @@ -4350,7 +4362,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2919 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 " @@ -4358,7 +4370,7 @@ msgid "" "objects <bytes-like object>` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2924 +#: ../../library/stdtypes.rst:2930 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 " @@ -4367,24 +4379,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2931 ../../library/stdtypes.rst:2988 +#: ../../library/stdtypes.rst:2937 ../../library/stdtypes.rst:2994 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2943 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:2941 +#: ../../library/stdtypes.rst:2947 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2953 +#: ../../library/stdtypes.rst:2959 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -4392,13 +4404,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2968 +#: ../../library/stdtypes.rst:2974 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2981 +#: ../../library/stdtypes.rst:2987 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 " @@ -4407,7 +4419,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2994 +#: ../../library/stdtypes.rst:3000 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -4415,11 +4427,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3005 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3005 +#: ../../library/stdtypes.rst:3011 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 " @@ -4427,18 +4439,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3010 +#: ../../library/stdtypes.rst:3016 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3019 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3016 +#: ../../library/stdtypes.rst:3022 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -4446,11 +4458,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3019 +#: ../../library/stdtypes.rst:3025 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:3023 +#: ../../library/stdtypes.rst:3029 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 " @@ -4459,7 +4471,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3032 +#: ../../library/stdtypes.rst:3038 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). " @@ -4467,7 +4479,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3046 +#: ../../library/stdtypes.rst:3052 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). " @@ -4475,7 +4487,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3060 +#: ../../library/stdtypes.rst:3066 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 " @@ -4485,7 +4497,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3067 +#: ../../library/stdtypes.rst:3073 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -4497,14 +4509,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3072 +#: ../../library/stdtypes.rst:3078 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:3077 +#: ../../library/stdtypes.rst:3083 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -4516,7 +4528,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3091 +#: ../../library/stdtypes.rst:3097 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). " @@ -4524,7 +4536,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3105 +#: ../../library/stdtypes.rst:3111 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 " @@ -4534,7 +4546,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3116 +#: ../../library/stdtypes.rst:3122 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 " @@ -4544,7 +4556,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3123 +#: ../../library/stdtypes.rst:3129 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -4556,14 +4568,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3128 +#: ../../library/stdtypes.rst:3134 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:3133 +#: ../../library/stdtypes.rst:3139 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -4575,7 +4587,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3147 +#: ../../library/stdtypes.rst:3153 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 " @@ -4584,7 +4596,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3153 +#: ../../library/stdtypes.rst:3159 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',')`` " @@ -4595,7 +4607,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3163 +#: ../../library/stdtypes.rst:3169 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -4615,7 +4627,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3172 +#: ../../library/stdtypes.rst:3178 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 " @@ -4625,7 +4637,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3182 +#: ../../library/stdtypes.rst:3188 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -4641,7 +4653,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3193 +#: ../../library/stdtypes.rst:3199 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 " @@ -4651,7 +4663,7 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3201 +#: ../../library/stdtypes.rst:3207 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -4663,13 +4675,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3206 +#: ../../library/stdtypes.rst:3212 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3215 +#: ../../library/stdtypes.rst:3221 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 " @@ -4677,14 +4689,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3223 +#: ../../library/stdtypes.rst:3229 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:3236 +#: ../../library/stdtypes.rst:3242 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 " @@ -4700,7 +4712,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3256 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -4712,7 +4724,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:3264 +#: ../../library/stdtypes.rst:3270 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -4721,7 +4733,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3272 +#: ../../library/stdtypes.rst:3278 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -4733,7 +4745,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:3281 +#: ../../library/stdtypes.rst:3287 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -4741,7 +4753,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3294 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -4753,20 +4765,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:3297 +#: ../../library/stdtypes.rst:3303 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:3307 +#: ../../library/stdtypes.rst:3313 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:3313 +#: ../../library/stdtypes.rst:3319 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -4778,13 +4790,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:3322 +#: ../../library/stdtypes.rst:3328 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:3327 +#: ../../library/stdtypes.rst:3333 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -4796,16 +4808,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:3332 ../../library/stdtypes.rst:3374 -#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3440 -#: ../../library/stdtypes.rst:3509 +#: ../../library/stdtypes.rst:3338 ../../library/stdtypes.rst:3380 +#: ../../library/stdtypes.rst:3396 ../../library/stdtypes.rst:3446 +#: ../../library/stdtypes.rst:3515 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:3340 +#: ../../library/stdtypes.rst:3346 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -4813,14 +4825,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3349 +#: ../../library/stdtypes.rst:3355 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:3355 +#: ../../library/stdtypes.rst:3361 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -4832,14 +4844,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:3364 +#: ../../library/stdtypes.rst:3370 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:3369 +#: ../../library/stdtypes.rst:3375 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -4851,13 +4863,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:3382 +#: ../../library/stdtypes.rst:3388 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3387 +#: ../../library/stdtypes.rst:3393 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -4865,7 +4877,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:3407 +#: ../../library/stdtypes.rst:3413 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 " @@ -4873,7 +4885,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3414 +#: ../../library/stdtypes.rst:3420 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -4885,14 +4897,14 @@ msgstr "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -#: ../../library/stdtypes.rst:3419 +#: ../../library/stdtypes.rst:3425 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:3423 +#: ../../library/stdtypes.rst:3429 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -4904,13 +4916,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:3432 +#: ../../library/stdtypes.rst:3438 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:3437 +#: ../../library/stdtypes.rst:3443 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -4918,7 +4930,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3450 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -4926,14 +4938,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3458 +#: ../../library/stdtypes.rst:3464 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:3464 +#: ../../library/stdtypes.rst:3470 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -4941,7 +4953,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:3467 +#: ../../library/stdtypes.rst:3473 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -4949,7 +4961,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3477 +#: ../../library/stdtypes.rst:3483 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -4957,12 +4969,12 @@ msgstr "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:3480 +#: ../../library/stdtypes.rst:3486 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3482 +#: ../../library/stdtypes.rst:3488 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4984,13 +4996,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:3501 +#: ../../library/stdtypes.rst:3507 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:3512 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -4998,7 +5010,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:3522 +#: ../../library/stdtypes.rst:3528 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 " @@ -5007,7 +5019,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3530 +#: ../../library/stdtypes.rst:3536 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -5019,11 +5031,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:3550 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3561 +#: ../../library/stdtypes.rst:3567 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 " @@ -5031,7 +5043,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3566 +#: ../../library/stdtypes.rst:3572 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -5041,7 +5053,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:3579 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 " @@ -5049,7 +5061,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:3613 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 " @@ -5057,73 +5069,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3681 +#: ../../library/stdtypes.rst:3687 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3690 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3690 msgid "" "Bytes (any object that follows the :ref:`buffer protocol <bufferobjects>` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3688 +#: ../../library/stdtypes.rst:3694 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:3697 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3694 +#: ../../library/stdtypes.rst:3700 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3694 +#: ../../library/stdtypes.rst:3700 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3729 +#: ../../library/stdtypes.rst:3735 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3732 +#: ../../library/stdtypes.rst:3738 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3744 +#: ../../library/stdtypes.rst:3750 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3751 +#: ../../library/stdtypes.rst:3757 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3753 +#: ../../library/stdtypes.rst:3759 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol <bufferobjects>` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3759 +#: ../../library/stdtypes.rst:3765 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:3763 +#: ../../library/stdtypes.rst:3769 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 " @@ -5131,32 +5143,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3768 +#: ../../library/stdtypes.rst:3774 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " "is the nested list representation of the view. If ``view.ndim = 1``, this is " "equal to the number of elements in the view." msgstr "" -#: ../../library/stdtypes.rst:3772 +#: ../../library/stdtypes.rst:3778 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:3775 +#: ../../library/stdtypes.rst:3781 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3778 +#: ../../library/stdtypes.rst:3784 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3781 +#: ../../library/stdtypes.rst:3787 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -5178,7 +5190,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:3791 +#: ../../library/stdtypes.rst:3797 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 " @@ -5189,11 +5201,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3800 +#: ../../library/stdtypes.rst:3806 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3802 +#: ../../library/stdtypes.rst:3808 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -5215,13 +5227,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:3812 +#: ../../library/stdtypes.rst:3818 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3815 +#: ../../library/stdtypes.rst:3821 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -5261,14 +5273,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:3833 +#: ../../library/stdtypes.rst:3839 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:3837 +#: ../../library/stdtypes.rst:3843 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -5286,40 +5298,40 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:3845 +#: ../../library/stdtypes.rst:3851 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:3849 +#: ../../library/stdtypes.rst:3855 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3853 +#: ../../library/stdtypes.rst:3859 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3856 +#: ../../library/stdtypes.rst:3862 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3860 +#: ../../library/stdtypes.rst:3866 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:3864 +#: ../../library/stdtypes.rst:3870 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:3867 +#: ../../library/stdtypes.rst:3873 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -5353,14 +5365,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:3883 +#: ../../library/stdtypes.rst:3889 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:3887 +#: ../../library/stdtypes.rst:3893 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -5386,25 +5398,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:3899 +#: ../../library/stdtypes.rst:3905 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3902 +#: ../../library/stdtypes.rst:3908 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3908 +#: ../../library/stdtypes.rst:3914 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:3911 +#: ../../library/stdtypes.rst:3917 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -5418,7 +5430,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:3917 +#: ../../library/stdtypes.rst:3923 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -5426,7 +5438,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3922 +#: ../../library/stdtypes.rst:3928 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' " @@ -5435,13 +5447,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3931 +#: ../../library/stdtypes.rst:3937 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3934 +#: ../../library/stdtypes.rst:3940 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -5451,18 +5463,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:3940 +#: ../../library/stdtypes.rst:3946 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:3947 +#: ../../library/stdtypes.rst:3953 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3949 +#: ../../library/stdtypes.rst:3955 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -5480,19 +5492,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:3957 +#: ../../library/stdtypes.rst:3963 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:3964 +#: ../../library/stdtypes.rst:3970 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3967 +#: ../../library/stdtypes.rst:3973 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -5518,7 +5530,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:3983 +#: ../../library/stdtypes.rst:3989 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 :" @@ -5527,14 +5539,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3989 +#: ../../library/stdtypes.rst:3995 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:3993 +#: ../../library/stdtypes.rst:3999 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -5550,13 +5562,13 @@ msgstr "" " File \"<stdin>\", line 1, in <module>\n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4000 +#: ../../library/stdtypes.rst:4006 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4003 +#: ../../library/stdtypes.rst:4009 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -5576,7 +5588,7 @@ msgstr "" " File \"<stdin>\", line 1, in <module>\n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4016 +#: ../../library/stdtypes.rst:4022 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 " @@ -5585,7 +5597,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4022 +#: ../../library/stdtypes.rst:4028 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 " @@ -5593,11 +5605,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4028 +#: ../../library/stdtypes.rst:4034 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4030 +#: ../../library/stdtypes.rst:4036 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -5641,11 +5653,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4051 +#: ../../library/stdtypes.rst:4057 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4053 +#: ../../library/stdtypes.rst:4059 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -5669,11 +5681,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4064 +#: ../../library/stdtypes.rst:4070 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4066 +#: ../../library/stdtypes.rst:4072 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -5723,11 +5735,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4090 +#: ../../library/stdtypes.rst:4096 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4092 +#: ../../library/stdtypes.rst:4098 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -5749,19 +5761,19 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4104 +#: ../../library/stdtypes.rst:4110 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4107 +#: ../../library/stdtypes.rst:4113 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4111 +#: ../../library/stdtypes.rst:4117 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4113 +#: ../../library/stdtypes.rst:4119 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -5773,14 +5785,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:4128 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:4126 +#: ../../library/stdtypes.rst:4132 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -5812,11 +5824,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4141 +#: ../../library/stdtypes.rst:4147 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4143 +#: ../../library/stdtypes.rst:4149 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -5840,11 +5852,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4164 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4162 +#: ../../library/stdtypes.rst:4168 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 " @@ -5852,17 +5864,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4173 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:4173 +#: ../../library/stdtypes.rst:4179 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4175 +#: ../../library/stdtypes.rst:4181 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -5882,49 +5894,49 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:4186 +#: ../../library/stdtypes.rst:4192 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4197 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:4194 ../../library/stdtypes.rst:4202 +#: ../../library/stdtypes.rst:4200 ../../library/stdtypes.rst:4208 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:4205 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:4207 +#: ../../library/stdtypes.rst:4213 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4217 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:4223 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4223 +#: ../../library/stdtypes.rst:4229 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4231 +#: ../../library/stdtypes.rst:4237 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:4241 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -5934,7 +5946,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4242 +#: ../../library/stdtypes.rst:4248 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 " @@ -5942,7 +5954,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4247 +#: ../../library/stdtypes.rst:4253 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -5954,18 +5966,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4261 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:4259 +#: ../../library/stdtypes.rst:4265 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4264 +#: ../../library/stdtypes.rst:4270 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 " @@ -5973,92 +5985,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4276 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4272 +#: ../../library/stdtypes.rst:4278 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4279 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4280 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4276 +#: ../../library/stdtypes.rst:4282 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4281 +#: ../../library/stdtypes.rst:4287 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4285 +#: ../../library/stdtypes.rst:4291 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4289 +#: ../../library/stdtypes.rst:4295 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4293 +#: ../../library/stdtypes.rst:4299 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:4299 +#: ../../library/stdtypes.rst:4305 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4303 +#: ../../library/stdtypes.rst:4309 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4309 +#: ../../library/stdtypes.rst:4315 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4313 +#: ../../library/stdtypes.rst:4319 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4319 +#: ../../library/stdtypes.rst:4325 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4330 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4335 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4334 +#: ../../library/stdtypes.rst:4340 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4344 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4341 +#: ../../library/stdtypes.rst:4347 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -6068,7 +6080,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4348 +#: ../../library/stdtypes.rst:4354 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 " @@ -6078,14 +6090,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4361 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:4359 +#: ../../library/stdtypes.rst:4365 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 " @@ -6093,71 +6105,71 @@ msgid "" "``a<b``, ``a==b``, or ``a>b``." msgstr "" -#: ../../library/stdtypes.rst:4364 +#: ../../library/stdtypes.rst:4370 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:4367 +#: ../../library/stdtypes.rst:4373 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4375 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:4373 +#: ../../library/stdtypes.rst:4379 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:4385 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4390 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4389 +#: ../../library/stdtypes.rst:4395 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4394 +#: ../../library/stdtypes.rst:4400 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4404 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4408 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4407 +#: ../../library/stdtypes.rst:4413 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4411 +#: ../../library/stdtypes.rst:4417 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:4422 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4419 +#: ../../library/stdtypes.rst:4425 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -6165,18 +6177,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4424 +#: ../../library/stdtypes.rst:4430 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" "`remove`, and :meth:`discard` methods may be a set. To support searching " "for an equivalent frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4439 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4443 +#: ../../library/stdtypes.rst:4449 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -6185,7 +6197,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4455 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -6194,33 +6206,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4460 +#: ../../library/stdtypes.rst:4466 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4463 +#: ../../library/stdtypes.rst:4469 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4465 +#: ../../library/stdtypes.rst:4471 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:4467 +#: ../../library/stdtypes.rst:4473 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4468 +#: ../../library/stdtypes.rst:4474 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4471 +#: ../../library/stdtypes.rst:4477 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -6233,7 +6245,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:4487 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 " @@ -6241,13 +6253,13 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4486 +#: ../../library/stdtypes.rst:4492 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4489 +#: ../../library/stdtypes.rst:4495 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -6267,33 +6279,33 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:4498 +#: ../../library/stdtypes.rst:4504 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:4502 +#: ../../library/stdtypes.rst:4508 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4507 +#: ../../library/stdtypes.rst:4513 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4517 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4515 +#: ../../library/stdtypes.rst:4521 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4520 +#: ../../library/stdtypes.rst:4526 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 " @@ -6304,7 +6316,7 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4528 +#: ../../library/stdtypes.rst:4534 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -6328,51 +6340,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:4539 +#: ../../library/stdtypes.rst:4545 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:4545 +#: ../../library/stdtypes.rst:4551 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4549 +#: ../../library/stdtypes.rst:4555 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4554 +#: ../../library/stdtypes.rst:4560 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4558 +#: ../../library/stdtypes.rst:4564 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4562 +#: ../../library/stdtypes.rst:4568 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4567 +#: ../../library/stdtypes.rst:4573 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4571 +#: ../../library/stdtypes.rst:4577 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4575 +#: ../../library/stdtypes.rst:4581 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4583 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 " @@ -6381,70 +6393,70 @@ msgid "" "<dict>` instead." msgstr "" -#: ../../library/stdtypes.rst:4585 +#: ../../library/stdtypes.rst:4591 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:4591 +#: ../../library/stdtypes.rst:4597 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects <dict-views>`." msgstr "" -#: ../../library/stdtypes.rst:4596 +#: ../../library/stdtypes.rst:4602 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects <dict-views>`." msgstr "" -#: ../../library/stdtypes.rst:4601 +#: ../../library/stdtypes.rst:4607 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:4607 +#: ../../library/stdtypes.rst:4613 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:4610 +#: ../../library/stdtypes.rst:4616 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:4614 +#: ../../library/stdtypes.rst:4620 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4620 +#: ../../library/stdtypes.rst:4626 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4627 +#: ../../library/stdtypes.rst:4633 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:4633 +#: ../../library/stdtypes.rst:4639 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4636 +#: ../../library/stdtypes.rst:4642 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -6453,20 +6465,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4644 +#: ../../library/stdtypes.rst:4650 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects <dict-views>`." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4653 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:4651 +#: ../../library/stdtypes.rst:4657 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -6476,34 +6488,34 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:4657 +#: ../../library/stdtypes.rst:4663 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:4665 +#: ../../library/stdtypes.rst:4671 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:4671 +#: ../../library/stdtypes.rst:4677 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:4675 +#: ../../library/stdtypes.rst:4681 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:4678 +#: ../../library/stdtypes.rst:4684 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6535,17 +6547,17 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:4693 +#: ../../library/stdtypes.rst:4699 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4697 +#: ../../library/stdtypes.rst:4703 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4705 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6567,21 +6579,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:4709 +#: ../../library/stdtypes.rst:4715 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4714 +#: ../../library/stdtypes.rst:4720 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4721 +#: ../../library/stdtypes.rst:4727 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4723 +#: ../../library/stdtypes.rst:4729 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 " @@ -6589,23 +6601,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4728 +#: ../../library/stdtypes.rst:4734 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4733 +#: ../../library/stdtypes.rst:4739 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4737 +#: ../../library/stdtypes.rst:4743 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4740 +#: ../../library/stdtypes.rst:4746 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -6613,39 +6625,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4745 +#: ../../library/stdtypes.rst:4751 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:4748 +#: ../../library/stdtypes.rst:4754 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4759 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:4758 +#: ../../library/stdtypes.rst:4764 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:4761 +#: ../../library/stdtypes.rst:4767 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4766 +#: ../../library/stdtypes.rst:4772 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4777 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -6659,11 +6671,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:4783 +#: ../../library/stdtypes.rst:4789 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4791 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -6704,11 +6716,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:4827 +#: ../../library/stdtypes.rst:4833 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:4834 +#: ../../library/stdtypes.rst:4840 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 " @@ -6719,7 +6731,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:4842 +#: ../../library/stdtypes.rst:4848 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 " @@ -6730,7 +6742,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:4847 +#: ../../library/stdtypes.rst:4853 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -6739,7 +6751,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:4851 +#: ../../library/stdtypes.rst:4857 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 " @@ -6753,7 +6765,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的當前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:4861 +#: ../../library/stdtypes.rst:4867 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -6765,7 +6777,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:4866 +#: ../../library/stdtypes.rst:4872 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -6780,7 +6792,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:4873 +#: ../../library/stdtypes.rst:4879 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -6792,7 +6804,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:4879 +#: ../../library/stdtypes.rst:4885 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -6804,7 +6816,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:4885 +#: ../../library/stdtypes.rst:4891 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -6819,7 +6831,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:4892 +#: ../../library/stdtypes.rst:4898 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 " @@ -6831,7 +6843,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:4900 +#: ../../library/stdtypes.rst:4906 msgid "" "Type Annotation Types --- :ref:`Generic Alias <types-genericalias>`, :ref:" "`Union <types-union>`" @@ -6839,7 +6851,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) <types-genericalias>`、:" "ref:`聯合 (Union) <types-union>`" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4911 msgid "" "The core built-in types for :term:`type annotations <annotation>` are :ref:" "`Generic Alias <types-genericalias>` and :ref:`Union <types-union>`." @@ -6847,11 +6859,11 @@ msgstr "" ":term:`型別註釋 <annotation>` 的核心內建型別是\\ :ref:`泛型別名 <types-" "genericalias>`\\ 和\\ :ref:`聯合 <types-union>`。" -#: ../../library/stdtypes.rst:4912 +#: ../../library/stdtypes.rst:4918 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:4918 +#: ../../library/stdtypes.rst:4924 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "<subscriptions>` a class. They are most often used with :ref:`container " @@ -6866,7 +6878,7 @@ msgstr "" "物件,它是透過使用引數 :class:`int` 來下標 ``list`` 類別而建立的。" "``GenericAlias`` 物件主要會與\\ :term:`型別註釋 <annotation>` 一起使用。" -#: ../../library/stdtypes.rst:4928 +#: ../../library/stdtypes.rst:4934 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -6874,7 +6886,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:4931 +#: ../../library/stdtypes.rst:4937 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -6882,7 +6894,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4940 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "<subscriptions>` of the class may indicate the type(s) of the elements an " @@ -6894,7 +6906,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:4940 +#: ../../library/stdtypes.rst:4946 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 " @@ -6906,7 +6918,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 <re>`\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:4946 +#: ../../library/stdtypes.rst:4952 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match <match-" "objects>` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -6918,7 +6930,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4958 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." @@ -6931,7 +6943,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match <match-objects>` 物件。" -#: ../../library/stdtypes.rst:4958 +#: ../../library/stdtypes.rst:4964 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -6940,7 +6952,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:4964 +#: ../../library/stdtypes.rst:4970 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -6950,7 +6962,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4975 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -6958,7 +6970,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4978 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 " @@ -6969,7 +6981,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4983 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -6977,7 +6989,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4986 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -6985,7 +6997,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4989 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -6997,7 +7009,7 @@ msgstr "" " File \"<stdin>\", line 1, in <module>\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4994 msgid "" "The Python runtime does not enforce :term:`type annotations <annotation>`. " "This extends to generic types and their type parameters. When creating a " @@ -7009,7 +7021,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:5000 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7019,13 +7031,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5004 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5007 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7043,13 +7055,13 @@ msgstr "" ">>> type(l)\n" "<class 'list'>" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5015 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5017 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7063,7 +7075,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5023 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7071,7 +7083,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5020 +#: ../../library/stdtypes.rst:5026 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7083,7 +7095,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5025 +#: ../../library/stdtypes.rst:5031 msgid "" "However, such expressions are valid when :ref:`type variables <generics>` " "are used. The index must have as many elements as there are type variable " @@ -7093,7 +7105,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5029 +#: ../../library/stdtypes.rst:5035 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7105,245 +7117,245 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5036 +#: ../../library/stdtypes.rst:5042 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5038 +#: ../../library/stdtypes.rst:5044 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5041 +#: ../../library/stdtypes.rst:5047 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5042 +#: ../../library/stdtypes.rst:5048 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5043 +#: ../../library/stdtypes.rst:5049 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5044 +#: ../../library/stdtypes.rst:5050 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5051 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5052 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5047 +#: ../../library/stdtypes.rst:5053 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5048 +#: ../../library/stdtypes.rst:5054 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5049 +#: ../../library/stdtypes.rst:5055 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5056 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5051 +#: ../../library/stdtypes.rst:5057 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5052 +#: ../../library/stdtypes.rst:5058 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5059 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5060 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5061 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5056 +#: ../../library/stdtypes.rst:5062 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5063 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5064 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5065 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5060 +#: ../../library/stdtypes.rst:5066 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5067 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5068 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5069 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5070 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5071 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5072 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5073 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5068 +#: ../../library/stdtypes.rst:5074 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5075 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5076 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5071 +#: ../../library/stdtypes.rst:5077 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5072 +#: ../../library/stdtypes.rst:5078 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5079 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5080 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5081 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5082 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5083 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5084 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5085 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5086 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5087 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5088 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5089 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5090 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:5091 msgid ":ref:`re.Pattern <re-objects>`" msgstr ":ref:`re.Pattern <re-objects>`" -#: ../../library/stdtypes.rst:5086 +#: ../../library/stdtypes.rst:5092 msgid ":ref:`re.Match <match-objects>`" msgstr ":ref:`re.Match <match-objects>`" -#: ../../library/stdtypes.rst:5087 +#: ../../library/stdtypes.rst:5093 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5094 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5089 +#: ../../library/stdtypes.rst:5095 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5096 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5097 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5098 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5099 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5100 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5099 +#: ../../library/stdtypes.rst:5105 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5101 +#: ../../library/stdtypes.rst:5107 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5111 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5107 +#: ../../library/stdtypes.rst:5113 msgid "" ">>> list[int].__origin__\n" "<class 'list'>" @@ -7351,7 +7363,7 @@ msgstr "" ">>> list[int].__origin__\n" "<class 'list'>" -#: ../../library/stdtypes.rst:5113 +#: ../../library/stdtypes.rst:5119 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 " @@ -7360,7 +7372,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5123 msgid "" ">>> dict[str, list[int]].__args__\n" "(<class 'str'>, list[int])" @@ -7368,7 +7380,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(<class 'str'>, list[int])" -#: ../../library/stdtypes.rst:5123 +#: ../../library/stdtypes.rst:5129 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -7376,7 +7388,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5126 +#: ../../library/stdtypes.rst:5132 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -7390,7 +7402,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5134 +#: ../../library/stdtypes.rst:5140 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -7400,7 +7412,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5141 +#: ../../library/stdtypes.rst:5147 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -7408,19 +7420,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5155 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5150 +#: ../../library/stdtypes.rst:5156 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5158 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5159 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -7429,7 +7441,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:5163 msgid "" ":ref:`Generics`, :ref:`user-defined generics <user-defined-generics>` and :" "class:`typing.Generic`" @@ -7437,18 +7449,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 <user-defined-generics>`\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5158 +#: ../../library/stdtypes.rst:5164 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5173 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5173 +#: ../../library/stdtypes.rst:5179 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects <bltin-type-objects>`. These types are intended " @@ -7461,7 +7473,7 @@ msgstr "" "釋 (type annotation) <annotation>`。與 :data:`typing.Union` 相比,聯合型別運" "算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5180 +#: ../../library/stdtypes.rst:5186 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 " @@ -7472,7 +7484,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5185 +#: ../../library/stdtypes.rst:5191 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -7480,7 +7492,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5190 +#: ../../library/stdtypes.rst:5196 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 " @@ -7493,58 +7505,58 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5198 +#: ../../library/stdtypes.rst:5204 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5206 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5208 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5210 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5206 +#: ../../library/stdtypes.rst:5212 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5208 +#: ../../library/stdtypes.rst:5214 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5210 +#: ../../library/stdtypes.rst:5216 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5212 +#: ../../library/stdtypes.rst:5218 msgid "It is compatible with :data:`typing.Union`::" msgstr "它與 :data:`typing.Union` 相容: ::" -#: ../../library/stdtypes.rst:5214 +#: ../../library/stdtypes.rst:5220 msgid "int | str == typing.Union[int, str]" msgstr "int | str == typing.Union[int, str]" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5222 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5224 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5223 +#: ../../library/stdtypes.rst:5229 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5232 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -7552,14 +7564,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5229 +#: ../../library/stdtypes.rst:5235 msgid "" "However, :ref:`parameterized generics <types-genericalias>` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 <types-genericalias>`\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5232 +#: ../../library/stdtypes.rst:5238 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -7569,7 +7581,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5245 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 " @@ -7578,7 +7590,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查。物件不能以型別來實例化: ::" -#: ../../library/stdtypes.rst:5243 +#: ../../library/stdtypes.rst:5249 msgid "" ">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" @@ -7596,7 +7608,7 @@ msgstr "" " File \"<stdin>\", line 1, in <module>\n" "TypeError: cannot create 'types.UnionType' instances" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5258 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 " @@ -7605,7 +7617,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5256 +#: ../../library/stdtypes.rst:5262 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -7631,25 +7643,25 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5272 +#: ../../library/stdtypes.rst:5278 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5280 +#: ../../library/stdtypes.rst:5286 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5282 +#: ../../library/stdtypes.rst:5288 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5289 +#: ../../library/stdtypes.rst:5295 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5291 +#: ../../library/stdtypes.rst:5297 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 " @@ -7660,7 +7672,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5304 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -7671,32 +7683,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5306 +#: ../../library/stdtypes.rst:5312 msgid "" "Modules built into the interpreter are written like this: ``<module " "'sys' (built-in)>``. If loaded from a file, they are written as ``<module " "'os' from '/usr/local/lib/pythonX.Y/os.pyc'>``." msgstr "" -#: ../../library/stdtypes.rst:5314 +#: ../../library/stdtypes.rst:5320 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5322 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5322 +#: ../../library/stdtypes.rst:5328 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5330 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:5327 +#: ../../library/stdtypes.rst:5333 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -7704,15 +7716,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5337 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5337 +#: ../../library/stdtypes.rst:5343 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5341 +#: ../../library/stdtypes.rst:5347 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods <builtin-methods>` (such as :meth:" @@ -7720,7 +7732,7 @@ msgid "" "Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5346 +#: ../../library/stdtypes.rst:5352 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -7733,7 +7745,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5363 msgid "" "Like :ref:`function objects <user-defined-funcs>`, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -7744,7 +7756,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5365 +#: ../../library/stdtypes.rst:5371 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -7772,15 +7784,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5386 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5388 +#: ../../library/stdtypes.rst:5394 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5394 +#: ../../library/stdtypes.rst:5400 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -7790,7 +7802,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5401 +#: ../../library/stdtypes.rst:5407 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "<auditing>` ``object.__getattr__`` with arguments ``obj`` and " @@ -7799,21 +7811,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 <auditing>` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5408 +#: ../../library/stdtypes.rst:5414 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:5411 +#: ../../library/stdtypes.rst:5417 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5417 +#: ../../library/stdtypes.rst:5423 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5423 +#: ../../library/stdtypes.rst:5429 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 " @@ -7821,30 +7833,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5428 +#: ../../library/stdtypes.rst:5434 msgid "Types are written like this: ``<class 'int'>``." msgstr "" -#: ../../library/stdtypes.rst:5434 +#: ../../library/stdtypes.rst:5440 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5436 +#: ../../library/stdtypes.rst:5442 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:5440 +#: ../../library/stdtypes.rst:5446 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5447 +#: ../../library/stdtypes.rst:5453 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5455 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -7852,15 +7864,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5460 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5460 +#: ../../library/stdtypes.rst:5466 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5462 +#: ../../library/stdtypes.rst:5468 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 " @@ -7868,64 +7880,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5467 +#: ../../library/stdtypes.rst:5473 msgid "It is written as :code:`NotImplemented`." msgstr "" -#: ../../library/stdtypes.rst:5473 +#: ../../library/stdtypes.rst:5479 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5475 +#: ../../library/stdtypes.rst:5481 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects <frame-objects>`, :ref:`traceback objects <traceback-objects>`, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:5483 +#: ../../library/stdtypes.rst:5489 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:5485 +#: ../../library/stdtypes.rst:5491 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:5492 +#: ../../library/stdtypes.rst:5498 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5498 +#: ../../library/stdtypes.rst:5504 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5506 +#: ../../library/stdtypes.rst:5512 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5511 +#: ../../library/stdtypes.rst:5517 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5516 +#: ../../library/stdtypes.rst:5522 msgid "" "The :ref:`type parameters <type-params>` of generic classes, functions, and :" "ref:`type aliases <type-aliases>`. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:5526 +#: ../../library/stdtypes.rst:5532 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5528 +#: ../../library/stdtypes.rst:5534 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 " @@ -7933,7 +7945,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5533 +#: ../../library/stdtypes.rst:5539 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 " @@ -7943,24 +7955,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5540 +#: ../../library/stdtypes.rst:5546 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5548 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:5546 +#: ../../library/stdtypes.rst:5552 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5548 +#: ../../library/stdtypes.rst:5554 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -7984,7 +7996,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5574 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits <sys.int_info>`. The lowest limit that can be " @@ -7992,11 +8004,11 @@ msgid "" "str_digits_check_threshold <sys.int_info>`." msgstr "" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5579 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5581 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8007,84 +8019,84 @@ msgid "" "..." msgstr "" -#: ../../library/stdtypes.rst:5588 +#: ../../library/stdtypes.rst:5594 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:5590 +#: ../../library/stdtypes.rst:5596 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5599 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5600 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5601 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5596 +#: ../../library/stdtypes.rst:5602 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5597 +#: ../../library/stdtypes.rst:5603 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5606 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5608 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5603 +#: ../../library/stdtypes.rst:5609 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5610 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:5605 +#: ../../library/stdtypes.rst:5611 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5612 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5607 +#: ../../library/stdtypes.rst:5613 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5616 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:5612 +#: ../../library/stdtypes.rst:5618 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:5615 +#: ../../library/stdtypes.rst:5621 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:5618 +#: ../../library/stdtypes.rst:5624 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8092,7 +8104,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:5626 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 " @@ -8101,38 +8113,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5632 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5635 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:5633 +#: ../../library/stdtypes.rst:5639 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5635 +#: ../../library/stdtypes.rst:5641 msgid "" ":data:`sys.int_info.default_max_str_digits <sys.int_info>` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5637 +#: ../../library/stdtypes.rst:5643 msgid "" ":data:`sys.int_info.str_digits_check_threshold <sys.int_info>` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5650 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 " @@ -8144,7 +8156,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5653 +#: ../../library/stdtypes.rst:5659 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 " @@ -8152,11 +8164,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5659 +#: ../../library/stdtypes.rst:5665 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5667 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 " @@ -8164,11 +8176,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5666 +#: ../../library/stdtypes.rst:5672 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:5668 +#: ../../library/stdtypes.rst:5674 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -8181,38 +8193,38 @@ msgid "" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5684 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5688 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:5683 +#: ../../library/stdtypes.rst:5689 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5686 +#: ../../library/stdtypes.rst:5692 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5689 +#: ../../library/stdtypes.rst:5695 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5691 +#: ../../library/stdtypes.rst:5697 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:5694 +#: ../../library/stdtypes.rst:5700 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -8225,13 +8237,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:316 #: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1139 -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:5425 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1154 -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4441 msgid "statement" msgstr "statement(陳述式)" @@ -8353,11 +8365,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:1260 #: ../../library/stdtypes.rst:1339 ../../library/stdtypes.rst:1383 #: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1540 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:2545 -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:4233 -#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4914 -#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5339 -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:2532 ../../library/stdtypes.rst:2551 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:4441 ../../library/stdtypes.rst:4920 +#: ../../library/stdtypes.rst:5175 ../../library/stdtypes.rst:5345 +#: ../../library/stdtypes.rst:5389 msgid "object" msgstr "object(物件)" @@ -8449,9 +8461,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 -#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5390 ../../library/stdtypes.rst:5404 -#: ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:5396 ../../library/stdtypes.rst:5410 +#: ../../library/stdtypes.rst:5425 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -8467,8 +8479,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:3627 msgid "+ (plus)" msgstr "+ (加號)" @@ -8480,13 +8492,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:3627 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2359 -#: ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2365 +#: ../../library/stdtypes.rst:3584 msgid "* (asterisk)" msgstr "* (星號)" @@ -8498,8 +8510,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2323 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:2329 +#: ../../library/stdtypes.rst:3552 msgid "% (percent)" msgstr "% (百分號)" @@ -8509,7 +8521,7 @@ msgstr "**" #: ../../library/stdtypes.rst:316 ../../library/stdtypes.rst:393 #: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:1154 -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4441 msgid "operations on" msgstr "operations on(操作於)" @@ -8518,7 +8530,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1606 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:2532 ../../library/stdtypes.rst:5425 msgid "module" msgstr "模組" @@ -8586,7 +8598,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4835 msgid "protocol" msgstr "protocol(協定)" @@ -8612,7 +8624,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:4441 msgid "len" msgstr "len" @@ -8689,14 +8701,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2526 -#: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:2724 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2658 ../../library/stdtypes.rst:2730 +#: ../../library/stdtypes.rst:3552 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5419 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:5175 ../../library/stdtypes.rst:5425 msgid "type" msgstr "type(型別)" @@ -8704,7 +8716,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4441 msgid "del" msgstr "del" @@ -8745,7 +8757,7 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1553 -#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2323 +#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2329 msgid "string" msgstr "string(字串)" @@ -8766,17 +8778,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2524 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2526 -#: ../../library/stdtypes.rst:2545 ../../library/stdtypes.rst:2724 -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:1571 ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2730 +#: ../../library/stdtypes.rst:3552 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2724 +#: ../../library/stdtypes.rst:1598 ../../library/stdtypes.rst:2730 msgid "methods" msgstr "methods(方法)" @@ -8784,184 +8796,184 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2131 ../../library/stdtypes.rst:3400 +#: ../../library/stdtypes.rst:2137 ../../library/stdtypes.rst:3406 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2131 +#: ../../library/stdtypes.rst:2137 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2323 +#: ../../library/stdtypes.rst:2329 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2323 +#: ../../library/stdtypes.rst:2329 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2323 +#: ../../library/stdtypes.rst:2329 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2323 +#: ../../library/stdtypes.rst:2329 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3552 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2323 ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:2329 ../../library/stdtypes.rst:3552 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3584 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:2402 -#: ../../library/stdtypes.rst:3578 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:3584 ../../library/stdtypes.rst:3627 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2365 ../../library/stdtypes.rst:3584 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2408 ../../library/stdtypes.rst:3627 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2408 ../../library/stdtypes.rst:3627 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:2518 +#: ../../library/stdtypes.rst:2524 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:2526 +#: ../../library/stdtypes.rst:2532 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:2526 +#: ../../library/stdtypes.rst:2532 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3400 +#: ../../library/stdtypes.rst:3406 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3400 +#: ../../library/stdtypes.rst:3406 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3552 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3552 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3552 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3552 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4233 +#: ../../library/stdtypes.rst:4239 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4441 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4435 +#: ../../library/stdtypes.rst:4441 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4524 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4835 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4835 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4835 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4902 +#: ../../library/stdtypes.rst:4908 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4902 +#: ../../library/stdtypes.rst:4908 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:4920 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:4920 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:4920 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5169 +#: ../../library/stdtypes.rst:5175 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5169 +#: ../../library/stdtypes.rst:5175 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:5345 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5389 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5389 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5396 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5396 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5410 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5410 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5449 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5449 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" diff --git a/library/string.po b/library/string.po index 171aa64c1b..77d3f29f15 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1138,6 +1138,7 @@ msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" #: ../../library/string.rst:728 +#, fuzzy msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1153,7 +1154,7 @@ msgid "" "3232235521\n" ">>>\n" ">>> width = 5\n" -">>> for num in range(5,12): \n" +">>> for num in range(5,12):\n" "... for base in 'dXob':\n" "... print('{0:{width}{base}}'.format(num, base=base, width=width), " "end=' ')\n" diff --git a/library/sys.po b/library/sys.po index de7ddad868..c28136222d 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -996,8 +996,8 @@ msgstr "" #: ../../library/sys.rst:767 msgid "" -"Return the name of the current default string encoding used by the Unicode " -"implementation." +"Return ``'utf-8'``. This is the name of the default string encoding, used in " +"methods like :meth:`str.encode`." msgstr "" #: ../../library/sys.rst:773 @@ -1134,7 +1134,7 @@ msgstr "" #: ../../library/sys.rst:886 msgid "" -"Return the interpreter's \"thread switch interval\"; see :func:" +"Return the interpreter's \"thread switch interval\" in seconds; see :func:" "`setswitchinterval`." msgstr "" diff --git a/library/traceback.po b/library/traceback.po index 45e85e7fb2..f70bae42e2 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-15 18:10+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -161,15 +161,15 @@ msgstr "" #: ../../library/traceback.rst:114 msgid "" -"This is a shorthand for ``print_exception(sys.exception(), limit, file, " -"chain)``." +"This is a shorthand for ``print_exception(sys.exception(), limit=limit, " +"file=file, chain=chain)``." msgstr "" #: ../../library/traceback.rst:120 msgid "" -"This is a shorthand for ``print_exception(sys.last_exc, limit, file, " -"chain)``. In general it will work only after an exception has reached an " -"interactive prompt (see :data:`sys.last_exc`)." +"This is a shorthand for ``print_exception(sys.last_exc, limit=limit, " +"file=file, chain=chain)``. In general it will work only after an exception " +"has reached an interactive prompt (see :data:`sys.last_exc`)." msgstr "" #: ../../library/traceback.rst:127 @@ -564,7 +564,7 @@ msgid "" "objects>` in a :ref:`traceback <traceback-objects>`." msgstr "" -#: ../../library/traceback.rst:504 +#: ../../library/traceback.rst:506 msgid "" "Represents a single :ref:`frame <frame-objects>` in the :ref:`traceback " "<traceback-objects>` or stack that is being formatted or printed. It may " @@ -578,38 +578,60 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:515 +#: ../../library/traceback.rst:517 msgid ":class:`!FrameSummary` instances have the following attributes:" msgstr "" -#: ../../library/traceback.rst:519 +#: ../../library/traceback.rst:521 msgid "" "The filename of the source code for this frame. Equivalent to accessing :" "attr:`f.f_code.co_filename <codeobject.co_filename>` on a :ref:`frame object " "<frame-objects>` *f*." msgstr "" -#: ../../library/traceback.rst:525 +#: ../../library/traceback.rst:527 msgid "The line number of the source code for this frame." msgstr "" -#: ../../library/traceback.rst:529 +#: ../../library/traceback.rst:531 msgid "" "Equivalent to accessing :attr:`f.f_code.co_name <codeobject.co_name>` on a :" "ref:`frame object <frame-objects>` *f*." msgstr "" -#: ../../library/traceback.rst:534 +#: ../../library/traceback.rst:536 msgid "" "A string representing the source code for this frame, with leading and " "trailing whitespace stripped. If the source is not available, it is ``None``." msgstr "" -#: ../../library/traceback.rst:541 +#: ../../library/traceback.rst:542 +msgid "" +"The last line number of the source code for this frame. By default, it is " +"set to ``lineno`` and indexation starts from 1." +msgstr "" + +#: ../../library/traceback.rst:545 +msgid "The default value changed from ``None`` to ``lineno``." +msgstr "" + +#: ../../library/traceback.rst:550 +msgid "" +"The column number of the source code for this frame. By default, it is " +"``None`` and indexation starts from 0." +msgstr "" + +#: ../../library/traceback.rst:555 +msgid "" +"The last column number of the source code for this frame. By default, it is " +"``None`` and indexation starts from 0." +msgstr "" + +#: ../../library/traceback.rst:562 msgid "Examples of Using the Module-Level Functions" msgstr "" -#: ../../library/traceback.rst:543 +#: ../../library/traceback.rst:564 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 " @@ -617,7 +639,7 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:548 +#: ../../library/traceback.rst:569 msgid "" "import sys, traceback\n" "\n" @@ -636,13 +658,13 @@ msgid "" " run_user_code(envdir)" msgstr "" -#: ../../library/traceback.rst:565 +#: ../../library/traceback.rst:586 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:568 +#: ../../library/traceback.rst:589 msgid "" "import sys, traceback\n" "\n" @@ -674,11 +696,11 @@ msgid "" " print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)" msgstr "" -#: ../../library/traceback.rst:599 +#: ../../library/traceback.rst:620 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:601 +#: ../../library/traceback.rst:622 msgid "" "*** print_tb:\n" " File \"<doctest...>\", line 10, in <module>\n" @@ -728,13 +750,13 @@ msgid "" "*** tb_lineno: 10" msgstr "" -#: ../../library/traceback.rst:646 +#: ../../library/traceback.rst:667 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:648 +#: ../../library/traceback.rst:669 msgid "" ">>> import traceback\n" ">>> def another_function():\n" @@ -786,11 +808,11 @@ msgstr "" " ' File \"<doctest>\", line 8, in lumberstack\\n print(repr(traceback." "format_stack()))\\n']" -#: ../../library/traceback.rst:672 +#: ../../library/traceback.rst:693 msgid "This last example demonstrates the final few formatting functions:" msgstr "" -#: ../../library/traceback.rst:674 +#: ../../library/traceback.rst:695 msgid "" ">>> import traceback\n" ">>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),\n" @@ -802,16 +824,16 @@ msgid "" "['IndexError: tuple index out of range\\n']" msgstr "" -#: ../../library/traceback.rst:688 +#: ../../library/traceback.rst:709 #, fuzzy msgid "Examples of Using :class:`TracebackException`" msgstr ":class:`!TracebackException` 物件" -#: ../../library/traceback.rst:690 +#: ../../library/traceback.rst:711 msgid "With the helper class, we have more options::" msgstr "" -#: ../../library/traceback.rst:692 +#: ../../library/traceback.rst:713 msgid "" ">>> import sys\n" ">>> from traceback import TracebackException\n" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 24f1f26228..66dd9c8523 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -482,31 +482,71 @@ msgstr "斷言 mock 從未被呼叫。" msgid "The reset_mock method resets all the call attributes on a mock object:" msgstr "reset_mock 方法重置 mock 物件上的所有呼叫屬性:" -#: ../../library/unittest.mock.rst:412 -msgid "Added two keyword-only arguments to the reset_mock function." -msgstr "reset_mock 函式新增了兩個僅限關鍵字引數 (keyword-only arguments)。" +#: ../../library/unittest.mock.rst:404 +msgid "" +">>> mock = Mock(return_value=None)\n" +">>> mock('hello')\n" +">>> mock.called\n" +"True\n" +">>> mock.reset_mock()\n" +">>> mock.called\n" +"False" +msgstr "" -#: ../../library/unittest.mock.rst:415 +#: ../../library/unittest.mock.rst:414 msgid "" "This can be useful where you want to make a series of assertions that reuse " -"the same object. Note that :meth:`reset_mock` *doesn't* clear the :attr:" -"`return_value`, :attr:`side_effect` or any child attributes you have set " -"using normal assignment by default. In case you want to reset :attr:" -"`return_value` or :attr:`side_effect`, then pass the corresponding parameter " -"as ``True``. Child mocks and the return value mock (if any) are reset as " -"well." +"the same object." msgstr "" -"這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況下,:" -"meth:`reset_mock` *不會*\\ 清除 :attr:`return_value`、:attr:`side_effect` 或" -"使用普通賦值設定的任何子屬性。如果你想要重置 :attr:`return_value` 或 :attr:" -"`side_effect`,則將相應的參數設置為 ``True``。Child mock 和回傳值 mock(如果" -"有的話)也會被重置。" -#: ../../library/unittest.mock.rst:423 -msgid "*return_value*, and *side_effect* are keyword-only arguments." -msgstr "*return_value* 和 *side_effect* 是僅限關鍵字引數。" +#: ../../library/unittest.mock.rst:417 +msgid "" +"*return_value* parameter when set to ``True`` resets :attr:`return_value`:" +msgstr "" + +#: ../../library/unittest.mock.rst:419 +msgid "" +">>> mock = Mock(return_value=5)\n" +">>> mock('hello')\n" +"5\n" +">>> mock.reset_mock(return_value=True)\n" +">>> mock('hello')\n" +"<Mock name='mock()' id='...'>" +msgstr "" + +#: ../../library/unittest.mock.rst:428 +msgid "" +"*side_effect* parameter when set to ``True`` resets :attr:`side_effect`:" +msgstr "" + +#: ../../library/unittest.mock.rst:430 +msgid "" +">>> mock = Mock(side_effect=ValueError)\n" +">>> mock('hello')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError\n" +">>> mock.reset_mock(side_effect=True)\n" +">>> mock('hello')\n" +"<Mock name='mock()' id='...'>" +msgstr "" -#: ../../library/unittest.mock.rst:429 +#: ../../library/unittest.mock.rst:441 +msgid "" +"Note that :meth:`reset_mock` *doesn't* clear the :attr:`return_value`, :attr:" +"`side_effect` or any child attributes you have set using normal assignment " +"by default." +msgstr "" + +#: ../../library/unittest.mock.rst:445 +msgid "Child mocks are reset as well." +msgstr "" + +#: ../../library/unittest.mock.rst:447 +msgid "Added two keyword-only arguments to the reset_mock function." +msgstr "reset_mock 函式新增了兩個僅限關鍵字引數 (keyword-only arguments)。" + +#: ../../library/unittest.mock.rst:452 msgid "" "Add a spec to a mock. *spec* can either be an object or a list of strings. " "Only attributes on the *spec* can be fetched as attributes from the mock." @@ -514,11 +554,11 @@ msgstr "" "向 mock 增加一個規格 (spec)。*spec* 可以是一個物件或一個字串串列 (list of " "strings)。只有在 *spec* 上的屬性才能作為 mock 的屬性被取得。" -#: ../../library/unittest.mock.rst:433 +#: ../../library/unittest.mock.rst:456 msgid "If *spec_set* is true then only attributes on the spec can be set." msgstr "如果 *spec_set* 為 true,那麼只能設定在規格中的屬性。" -#: ../../library/unittest.mock.rst:438 +#: ../../library/unittest.mock.rst:461 msgid "" "Attach a mock as an attribute of this one, replacing its name and parent. " "Calls to the attached mock will be recorded in the :attr:`method_calls` and :" @@ -528,11 +568,11 @@ msgstr "" "mock 的呼叫將被記錄在這個 Mock 的 :attr:`method_calls` 和 :attr:`mock_calls` " "屬性中。" -#: ../../library/unittest.mock.rst:445 +#: ../../library/unittest.mock.rst:468 msgid "Set attributes on the mock through keyword arguments." msgstr "透過關鍵字引數在 mock 上設定屬性。" -#: ../../library/unittest.mock.rst:447 +#: ../../library/unittest.mock.rst:470 msgid "" "Attributes plus return values and side effects can be set on child mocks " "using standard dot notation and unpacking a dictionary in the method call:" @@ -540,18 +580,18 @@ msgstr "" "可以在使用 method(方法)呼叫時,使用標準點記法 (dot notation) 並將字典拆開," "為 child mock 設定屬性、回傳值和 side effects:" -#: ../../library/unittest.mock.rst:461 +#: ../../library/unittest.mock.rst:484 msgid "The same thing can be achieved in the constructor call to mocks:" msgstr "同樣的事情可以在 mock 的建構函式呼叫中實現:" -#: ../../library/unittest.mock.rst:474 +#: ../../library/unittest.mock.rst:497 msgid "" ":meth:`configure_mock` exists to make it easier to do configuration after " "the mock has been created." msgstr "" ":meth:`configure_mock` 的存在是為了在 mock 被建立後更容易進行組態設定。" -#: ../../library/unittest.mock.rst:480 +#: ../../library/unittest.mock.rst:503 msgid "" ":class:`Mock` objects limit the results of ``dir(some_mock)`` to useful " "results. For mocks with a *spec* this includes all the permitted attributes " @@ -560,13 +600,13 @@ msgstr "" ":class:`Mock` 物件限制了 ``dir(some_mock)`` 僅顯示有用的結果。對於具有 " "*spec* 的 mock,這包含所有被允許的 mock 屬性。" -#: ../../library/unittest.mock.rst:484 +#: ../../library/unittest.mock.rst:507 msgid "" "See :data:`FILTER_DIR` for what this filtering does, and how to switch it " "off." msgstr "請參閱 :data:`FILTER_DIR` 以了解這種過濾行為的作用,以及如何關閉它。" -#: ../../library/unittest.mock.rst:490 +#: ../../library/unittest.mock.rst:513 msgid "" "Create the child mocks for attributes and return value. By default child " "mocks will be the same type as the parent. Subclasses of Mock may want to " @@ -575,35 +615,35 @@ msgstr "" "建立為了得到屬性和回傳值的 child mock。預設情況下,child mock 將與其上代是相" "同的型別。Mock 的子類別可能會想要置換此行為,以自定義 child mock 的建立方式。" -#: ../../library/unittest.mock.rst:495 +#: ../../library/unittest.mock.rst:518 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." msgstr "對於不可呼叫的 mock,將使用可呼叫的變體,而不是任何的自定義子類別。" -#: ../../library/unittest.mock.rst:501 +#: ../../library/unittest.mock.rst:524 msgid "A boolean representing whether or not the mock object has been called:" msgstr "一個 boolean(布林),表述 mock 物件是否已經被呼叫:" -#: ../../library/unittest.mock.rst:512 +#: ../../library/unittest.mock.rst:535 msgid "An integer telling you how many times the mock object has been called:" msgstr "一個整數,告訴你 mock 物件被呼叫的次數:" -#: ../../library/unittest.mock.rst:524 +#: ../../library/unittest.mock.rst:547 msgid "Set this to configure the value returned by calling the mock:" msgstr "設定此值以配置呼叫 mock 時回傳的值:" -#: ../../library/unittest.mock.rst:531 +#: ../../library/unittest.mock.rst:554 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" msgstr "預設的回傳值是一個 mock 物件,你也可以按照正常的方式配置它:" -#: ../../library/unittest.mock.rst:540 +#: ../../library/unittest.mock.rst:563 msgid ":attr:`return_value` can also be set in the constructor:" msgstr ":attr:`return_value` 也可以在建構函式中設定:" -#: ../../library/unittest.mock.rst:551 +#: ../../library/unittest.mock.rst:574 msgid "" "This can either be a function to be called when the mock is called, an " "iterable or an exception (class or instance) to be raised." @@ -611,7 +651,7 @@ msgstr "" "這可以是一個在呼叫 mock 時要呼叫的函式、一個可疊代物件,或者要引發的例外(類" "別或實例)。" -#: ../../library/unittest.mock.rst:554 +#: ../../library/unittest.mock.rst:577 msgid "" "If you pass in a function it will be called with same arguments as the mock " "and unless the function returns the :data:`DEFAULT` singleton the call to " @@ -624,7 +664,7 @@ msgstr "" "式回傳 :data:`DEFAULT`,那麼 mock 將回傳其正常的回傳值(從 :attr:" "`return_value` 得到)。" -#: ../../library/unittest.mock.rst:560 +#: ../../library/unittest.mock.rst:583 msgid "" "If you pass in an iterable, it is used to retrieve an iterator which must " "yield a value on every call. This value can either be an exception instance " @@ -635,21 +675,21 @@ msgstr "" "產出 (yield) 一個值。這個值可以是要引發的例外實例,或者是對 mock 呼叫時要回傳" "的值(處理 :data:`DEFAULT` 的方式與函式的狀況相同)。" -#: ../../library/unittest.mock.rst:565 +#: ../../library/unittest.mock.rst:588 msgid "" "An example of a mock that raises an exception (to test exception handling of " "an API):" msgstr "以下是一個引發例外的 mock 的範例(用於測試 API 的例外處理):" -#: ../../library/unittest.mock.rst:575 +#: ../../library/unittest.mock.rst:598 msgid "Using :attr:`side_effect` to return a sequence of values:" msgstr "使用 :attr:`side_effect` 回傳一連串值的範例:" -#: ../../library/unittest.mock.rst:582 +#: ../../library/unittest.mock.rst:605 msgid "Using a callable:" msgstr "使用可被呼叫物件的範例:" -#: ../../library/unittest.mock.rst:592 +#: ../../library/unittest.mock.rst:615 msgid "" ":attr:`side_effect` can be set in the constructor. Here's an example that " "adds one to the value the mock is called with and returns it:" @@ -657,11 +697,11 @@ msgstr "" ":attr:`side_effect` 可以在建構函式中設定。以下是一個範例,它將 mock 被呼叫時" "給的值加一並回傳:" -#: ../../library/unittest.mock.rst:602 +#: ../../library/unittest.mock.rst:625 msgid "Setting :attr:`side_effect` to ``None`` clears it:" msgstr "將 :attr:`side_effect` 設定為 ``None`` 可以清除它:" -#: ../../library/unittest.mock.rst:616 +#: ../../library/unittest.mock.rst:639 msgid "" "This is either ``None`` (if the mock hasn't been called), or the arguments " "that the mock was last called with. This will be in the form of a tuple: the " @@ -675,7 +715,7 @@ msgstr "" "是 mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " "``kwargs`` 屬性訪問,是所有關鍵字引數(或一個空字典)。" -#: ../../library/unittest.mock.rst:649 +#: ../../library/unittest.mock.rst:672 msgid "" ":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" "attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " @@ -687,11 +727,11 @@ msgstr "" "獲取各個引數並進行更複雜的斷言。參見 :ref:`calls as tuples <calls-as-" "tuples>`。" -#: ../../library/unittest.mock.rst:655 +#: ../../library/unittest.mock.rst:678 msgid "Added ``args`` and ``kwargs`` properties." msgstr "新增 ``args`` 與 ``kwargs`` 特性。" -#: ../../library/unittest.mock.rst:661 +#: ../../library/unittest.mock.rst:684 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " @@ -703,7 +743,7 @@ msgstr "" "在任何呼叫發生之前,它會是一個空的串列。 :data:`call` 物件可用於方便地建構呼" "叫的串列,以便與 :attr:`call_args_list` 進行比較。" -#: ../../library/unittest.mock.rst:677 +#: ../../library/unittest.mock.rst:700 msgid "" "Members of :attr:`call_args_list` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " @@ -712,7 +752,7 @@ msgstr "" ":attr:`call_args_list` 的成員都是 :data:`call` 物件。這些物件可以被拆包為元" "組,以取得各個引數。參見 :ref:`calls as tuples <calls-as-tuples>`。" -#: ../../library/unittest.mock.rst:684 +#: ../../library/unittest.mock.rst:707 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" @@ -720,7 +760,7 @@ msgstr "" "除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼叫,以及\\ *它們(這些" "方法和屬性)*\\ 的方法和屬性:" -#: ../../library/unittest.mock.rst:695 +#: ../../library/unittest.mock.rst:718 msgid "" "Members of :attr:`method_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " @@ -729,7 +769,7 @@ msgstr "" ":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" "取得各個引數。參見 :ref:`calls as tuples <calls-as-tuples>`。" -#: ../../library/unittest.mock.rst:702 +#: ../../library/unittest.mock.rst:725 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." @@ -737,7 +777,7 @@ msgstr "" ":attr:`mock_calls` 記錄了 *所有* 對 mock 物件的呼叫,包含其方法、魔術方法以及" "回傳值 mock。" -#: ../../library/unittest.mock.rst:720 +#: ../../library/unittest.mock.rst:743 msgid "" "Members of :attr:`mock_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " @@ -746,7 +786,7 @@ msgstr "" ":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" "取得各個引數。參見 :ref:`calls as tuples <calls-as-tuples>`。" -#: ../../library/unittest.mock.rst:726 +#: ../../library/unittest.mock.rst:749 msgid "" "The way :attr:`mock_calls` are recorded means that where nested calls are " "made, the parameters of ancestor calls are not recorded and so will always " @@ -755,7 +795,7 @@ msgstr "" ":attr:`mock_calls` 記錄的方式意味著在進行巢狀呼叫時,上代 (ancestor) 呼叫的參" "數不會被記錄,因此在比較時它們將始終相等:" -#: ../../library/unittest.mock.rst:740 +#: ../../library/unittest.mock.rst:763 #, fuzzy msgid "" "Normally the :attr:`!__class__` attribute of an object will return its type. " @@ -767,7 +807,7 @@ msgstr "" "的 mock 物件,``__class__`` 會回傳 spec 的類別。這允許 mock 物件通過對它們所" "替代或偽裝的物件進行的 :func:`isinstance` 測試:" -#: ../../library/unittest.mock.rst:749 +#: ../../library/unittest.mock.rst:772 #, fuzzy msgid "" ":attr:`!__class__` is assignable to, this allows a mock to pass an :func:" @@ -776,7 +816,7 @@ msgstr "" ":attr:`__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" "需要強制使用 spec:" -#: ../../library/unittest.mock.rst:759 +#: ../../library/unittest.mock.rst:782 msgid "" "A non-callable version of :class:`Mock`. The constructor parameters have the " "same meaning of :class:`Mock`, with the exception of *return_value* and " @@ -785,7 +825,7 @@ msgstr "" ":class:`Mock` 的一個不可呼叫版本。建構函式參數的意義與 :class:`Mock` 相同,其" "例外為 *return_value* 和 *side_effect* 在不可呼叫的 mock 上無意義。" -#: ../../library/unittest.mock.rst:763 +#: ../../library/unittest.mock.rst:786 #, fuzzy msgid "" "Mock objects that use a class or an instance as a :attr:`!spec` or :attr:`!" @@ -794,7 +834,7 @@ msgstr "" "使用類別或實例作為 :attr:`spec` 或 :attr:`spec_set` 的 mock 物件能夠通過 :" "func:`isinstance` 測試:" -#: ../../library/unittest.mock.rst:773 +#: ../../library/unittest.mock.rst:796 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods <magic-methods>` for the full details." @@ -802,7 +842,7 @@ msgstr "" ":class:`Mock` 類別支援 mock 魔術方法。細節請參考\\ :ref:`魔術方法 <magic-" "methods>`。" -#: ../../library/unittest.mock.rst:776 +#: ../../library/unittest.mock.rst:799 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " "arguments for configuration. For the :func:`patch` decorators the keywords " @@ -813,7 +853,7 @@ msgstr "" "`patch` 裝飾器,這些關鍵字會傳遞給正在建立 mock 的建構函式。這些關鍵字引數用" "於配置 mock 的屬性:" -#: ../../library/unittest.mock.rst:787 +#: ../../library/unittest.mock.rst:810 msgid "" "The return value and side effect of child mocks can be set in the same way, " "using dotted notation. As you can't use dotted names directly in a call you " @@ -822,7 +862,7 @@ msgstr "" "Child mock 的回傳值和 side effect 可以使用使用點記法進行設置。由於你無法直接" "在呼叫中使用帶有點 (.) 的名稱,因此你必須建立一個字典並使用 ``**`` 解包:" -#: ../../library/unittest.mock.rst:802 +#: ../../library/unittest.mock.rst:825 msgid "" "A callable mock which was created with a *spec* (or a *spec_set*) will " "introspect the specification object's signature when matching calls to the " @@ -833,7 +873,7 @@ msgstr "" "將會內省 (introspect) 規格物件的簽名 (signature)。因此,它可以匹配實際呼叫的" "引數,無論它們是按位置傳遞還是按名稱傳遞: ::" -#: ../../library/unittest.mock.rst:807 +#: ../../library/unittest.mock.rst:830 msgid "" ">>> def f(a, b, c): pass\n" "...\n" @@ -851,7 +891,7 @@ msgstr "" ">>> mock.assert_called_with(1, 2, 3)\n" ">>> mock.assert_called_with(a=1, b=2, c=3)" -#: ../../library/unittest.mock.rst:815 +#: ../../library/unittest.mock.rst:838 msgid "" "This applies to :meth:`~Mock.assert_called_with`, :meth:`~Mock." "assert_called_once_with`, :meth:`~Mock.assert_has_calls` and :meth:`~Mock." @@ -863,13 +903,13 @@ msgstr "" "assert_any_call`。在使用 :ref:`auto-speccing` 時,它還適用於 mock 物件的方法" "呼叫。" -#: ../../library/unittest.mock.rst:820 +#: ../../library/unittest.mock.rst:843 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" "對於已經設置了規格(spec)和自動規格(autospec)的 mock 物件,新增簽名內省功" "能。" -#: ../../library/unittest.mock.rst:826 +#: ../../library/unittest.mock.rst:849 msgid "" "A mock intended to be used as a :class:`property`, or other :term:" "`descriptor`, on a class. :class:`PropertyMock` provides :meth:`~object." @@ -880,7 +920,7 @@ msgstr "" "class:`PropertyMock` 提供了 :meth:`~object.__get__` 和 :meth:`~object." "__set__` 方法,因此你可以在它被提取時指定回傳值。" -#: ../../library/unittest.mock.rst:831 +#: ../../library/unittest.mock.rst:854 msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" @@ -888,7 +928,7 @@ msgstr "" "從物件中提取 :class:`PropertyMock` 實例會不帶任何引數呼叫 mock。設定它則會用" "設定的值來呼叫 mock: ::" -#: ../../library/unittest.mock.rst:834 +#: ../../library/unittest.mock.rst:857 msgid "" ">>> class Foo:\n" "... @property\n" @@ -926,7 +966,7 @@ msgstr "" ">>> mock_foo.mock_calls\n" "[call(), call(6)]" -#: ../../library/unittest.mock.rst:852 +#: ../../library/unittest.mock.rst:875 msgid "" "Because of the way mock attributes are stored you can't directly attach a :" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " @@ -935,7 +975,7 @@ msgstr "" "由於 mock 屬性的儲存方式,你無法直接將 :class:`PropertyMock` 附加到 mock 物" "件。但是你可以將其附加到 mock 型別的物件: ::" -#: ../../library/unittest.mock.rst:856 +#: ../../library/unittest.mock.rst:879 msgid "" ">>> m = MagicMock()\n" ">>> p = PropertyMock(return_value=3)\n" @@ -951,14 +991,14 @@ msgstr "" "3\n" ">>> p.assert_called_once_with()" -#: ../../library/unittest.mock.rst:865 +#: ../../library/unittest.mock.rst:888 msgid "" "If an :exc:`AttributeError` is raised by :class:`PropertyMock`, it will be " "interpreted as a missing descriptor and :meth:`~object.__getattr__` will be " "called on the parent mock::" msgstr "" -#: ../../library/unittest.mock.rst:869 +#: ../../library/unittest.mock.rst:892 msgid "" ">>> m = MagicMock()\n" ">>> no_attribute = PropertyMock(side_effect=AttributeError)\n" @@ -972,11 +1012,11 @@ msgstr "" ">>> m.my_property\n" "<MagicMock name='mock.my_property' id='140165240345424'>" -#: ../../library/unittest.mock.rst:875 +#: ../../library/unittest.mock.rst:898 msgid "See :meth:`~object.__getattr__` for details." msgstr "詳情請見 :meth:`~object.__getattr__`。" -#: ../../library/unittest.mock.rst:880 +#: ../../library/unittest.mock.rst:903 msgid "" "An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object " "will behave so the object is recognized as an async function, and the result " @@ -985,7 +1025,7 @@ msgstr "" ":class:`MagicMock` 的非同步版本。:class:`AsyncMock` 物件的表現將被視為非同步" "函式,並且呼叫的結果是一個可等待物件。" -#: ../../library/unittest.mock.rst:890 +#: ../../library/unittest.mock.rst:913 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" @@ -993,19 +1033,19 @@ msgstr "" "``mock()`` 的結果是一個非同步函式,在它被等待後將具有 ``side_effect`` 或 " "``return_value`` 的結果:" -#: ../../library/unittest.mock.rst:893 +#: ../../library/unittest.mock.rst:916 msgid "" "if ``side_effect`` is a function, the async function will return the result " "of that function," msgstr "如果 ``side_effect`` 是一個函式,非同步函式將回傳該函式的結果," -#: ../../library/unittest.mock.rst:895 +#: ../../library/unittest.mock.rst:918 msgid "" "if ``side_effect`` is an exception, the async function will raise the " "exception," msgstr "如果 ``side_effect`` 是一個例外,則非同步函式將引發該例外," -#: ../../library/unittest.mock.rst:897 +#: ../../library/unittest.mock.rst:920 msgid "" "if ``side_effect`` is an iterable, the async function will return the next " "value of the iterable, however, if the sequence of result is exhausted, " @@ -1014,7 +1054,7 @@ msgstr "" "如果 ``side_effect`` 是一個可疊代物件,非同步函式將回傳可疊代物件的下一個值," "但如果結果序列耗盡,將立即引發 ``StopAsyncIteration``," -#: ../../library/unittest.mock.rst:900 +#: ../../library/unittest.mock.rst:923 msgid "" "if ``side_effect`` is not defined, the async function will return the value " "defined by ``return_value``, hence, by default, the async function returns a " @@ -1023,7 +1063,7 @@ msgstr "" "如果 ``side_effect`` 沒有被定義,非同步函式將回傳由 ``return_value`` 定義的" "值,因此在預設情況下,非同步函式回傳一個新的 :class:`AsyncMock` 物件。" -#: ../../library/unittest.mock.rst:905 +#: ../../library/unittest.mock.rst:928 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." @@ -1031,7 +1071,7 @@ msgstr "" "將 :class:`Mock` 或 :class:`MagicMock` 的 *spec* 設定為非同步函式將導致在呼叫" "後回傳一個協程物件。" -#: ../../library/unittest.mock.rst:917 +#: ../../library/unittest.mock.rst:940 msgid "" "Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:" "`AsyncMock` to a class with asynchronous and synchronous functions will " @@ -1046,7 +1086,7 @@ msgstr "" "`MagicMock`\\ )或 :class:`Mock`\\ (如果上代 mock 為 :class:`Mock`\\ )。所" "有非同步函式將被設定為 :class:`AsyncMock`。" -#: ../../library/unittest.mock.rst:945 +#: ../../library/unittest.mock.rst:968 msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" @@ -1054,25 +1094,25 @@ msgstr "" "斷言 mock 至少被等待過一次。請注意這與物件是否被呼叫是分開的,``await`` 關鍵" "字必須被使用:" -#: ../../library/unittest.mock.rst:964 +#: ../../library/unittest.mock.rst:987 msgid "Assert that the mock was awaited exactly once." msgstr "斷言 mock 正好被等待了一次。" -#: ../../library/unittest.mock.rst:980 +#: ../../library/unittest.mock.rst:1003 msgid "Assert that the last await was with the specified arguments." msgstr "斷言最後一次等待使用了指定的引數。" -#: ../../library/unittest.mock.rst:997 +#: ../../library/unittest.mock.rst:1020 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." msgstr "斷言 mock 只被等待了一次並使用了指定的引數。" -#: ../../library/unittest.mock.rst:1014 +#: ../../library/unittest.mock.rst:1037 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "斷言 mock 曾經被使用指定的引數等待過。" -#: ../../library/unittest.mock.rst:1030 +#: ../../library/unittest.mock.rst:1053 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." @@ -1080,7 +1120,7 @@ msgstr "" "斷言 mock 已被使用指定的呼叫進行等待。:attr:`await_args_list` 串列將被檢查以" "確認等待的內容。" -#: ../../library/unittest.mock.rst:1033 +#: ../../library/unittest.mock.rst:1056 msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." @@ -1088,7 +1128,7 @@ msgstr "" "如果 *any_order* 為 false,則等待必須按照順序。指定的等待之前或之後可以有額外" "的呼叫。" -#: ../../library/unittest.mock.rst:1037 +#: ../../library/unittest.mock.rst:1060 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." @@ -1096,11 +1136,11 @@ msgstr "" "如果 *any_order* 為 true,則等待可以以任何順序出現,但它們必須全部出現在 :" "attr:`await_args_list` 中。" -#: ../../library/unittest.mock.rst:1057 +#: ../../library/unittest.mock.rst:1080 msgid "Assert that the mock was never awaited." msgstr "斷言 mock 從未被等待。" -#: ../../library/unittest.mock.rst:1064 +#: ../../library/unittest.mock.rst:1087 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." @@ -1108,12 +1148,12 @@ msgstr "" "參見 :func:`Mock.reset_mock`。同時將 :attr:`await_count` 設定為 0,:attr:" "`await_args` 設定為 None,並清除 :attr:`await_args_list`。" -#: ../../library/unittest.mock.rst:1069 +#: ../../library/unittest.mock.rst:1092 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "一個整數,用來記錄 mock 物件已被等待的次數。" -#: ../../library/unittest.mock.rst:1084 +#: ../../library/unittest.mock.rst:1107 msgid "" "This is either ``None`` (if the mock hasn’t been awaited), or the arguments " "that the mock was last awaited with. Functions the same as :attr:`Mock." @@ -1122,7 +1162,7 @@ msgstr "" "這可能是 ``None``\\ (如果 mock 尚未被等待),或者是上次等待 mock 時使用的引" "數。與 :attr:`Mock.call_args` 的功能相同。" -#: ../../library/unittest.mock.rst:1102 +#: ../../library/unittest.mock.rst:1125 msgid "" "This is a list of all the awaits made to the mock object in sequence (so the " "length of the list is the number of times it has been awaited). Before any " @@ -1131,60 +1171,60 @@ msgstr "" "這是一個按照順序記錄 mock 物件所有等待的串列(因此串列的長度表示該物件已被等" "待的次數)。在進行任何等待之前,此串列為空。" -#: ../../library/unittest.mock.rst:1122 +#: ../../library/unittest.mock.rst:1145 msgid "" "A version of :class:`MagicMock` for multithreading tests. The :class:" "`ThreadingMock` object provides extra methods to wait for a call to be " "invoked, rather than assert on it immediately." msgstr "" -#: ../../library/unittest.mock.rst:1126 +#: ../../library/unittest.mock.rst:1149 msgid "" "The default timeout is specified by the ``timeout`` argument, or if unset by " "the :attr:`ThreadingMock.DEFAULT_TIMEOUT` attribute, which defaults to " "blocking (``None``)." msgstr "" -#: ../../library/unittest.mock.rst:1129 +#: ../../library/unittest.mock.rst:1152 msgid "" "You can configure the global default timeout by setting :attr:`ThreadingMock." "DEFAULT_TIMEOUT`." msgstr "" -#: ../../library/unittest.mock.rst:1133 +#: ../../library/unittest.mock.rst:1156 #, fuzzy msgid "Waits until the mock is called." msgstr "斷言 mock 從未被呼叫。" -#: ../../library/unittest.mock.rst:1135 +#: ../../library/unittest.mock.rst:1158 msgid "" "If a timeout was passed at the creation of the mock or if a timeout argument " "is passed to this function, the function raises an :exc:`AssertionError` if " "the call is not performed in time." msgstr "" -#: ../../library/unittest.mock.rst:1147 +#: ../../library/unittest.mock.rst:1170 #, fuzzy msgid "Waits until the mock is called with the specified arguments." msgstr "斷言 mock 已經被使用指定的引數呼叫。" -#: ../../library/unittest.mock.rst:1149 +#: ../../library/unittest.mock.rst:1172 msgid "" "If a timeout was passed at the creation of the mock the function raises an :" "exc:`AssertionError` if the call is not performed in time." msgstr "" -#: ../../library/unittest.mock.rst:1160 +#: ../../library/unittest.mock.rst:1183 msgid "" "Global default timeout in seconds to create instances of :class:" "`ThreadingMock`." msgstr "" -#: ../../library/unittest.mock.rst:1166 +#: ../../library/unittest.mock.rst:1189 msgid "Calling" msgstr "呼叫" -#: ../../library/unittest.mock.rst:1168 +#: ../../library/unittest.mock.rst:1191 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" "`~Mock.return_value` attribute. The default return value is a new Mock " @@ -1196,7 +1236,7 @@ msgstr "" "的回傳值是一個新的 Mock 物件;它會在第一次存取回傳值時(無論是顯式存取還是透" "過呼叫 Mock)被建立,但是這個回傳值會被儲存,之後每次都回傳同一個值。" -#: ../../library/unittest.mock.rst:1174 +#: ../../library/unittest.mock.rst:1197 msgid "" "Calls made to the object will be recorded in the attributes like :attr:" "`~Mock.call_args` and :attr:`~Mock.call_args_list`." @@ -1204,7 +1244,7 @@ msgstr "" "對物件的呼叫會被記錄在如 :attr:`~Mock.call_args` 和 :attr:`~Mock." "call_args_list` 等屬性中。" -#: ../../library/unittest.mock.rst:1177 +#: ../../library/unittest.mock.rst:1200 #, fuzzy msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " @@ -1214,7 +1254,7 @@ msgstr "" "如果 :attr:`~Mock.side_effect` 被設定,那麼在呼叫被記錄後它才會被呼叫,所以如" "果 :attr:`side_effect` 引發例外,呼叫仍然會被記錄。" -#: ../../library/unittest.mock.rst:1181 +#: ../../library/unittest.mock.rst:1204 msgid "" "The simplest way to make a mock raise an exception when called is to make :" "attr:`~Mock.side_effect` an exception class or instance:" @@ -1222,7 +1262,7 @@ msgstr "" "呼叫 mock 時引發例外的最簡單方式是將 :attr:`~Mock.side_effect` 設定為例外類別" "或實例:" -#: ../../library/unittest.mock.rst:1199 +#: ../../library/unittest.mock.rst:1222 #, fuzzy msgid "" "If :attr:`~Mock.side_effect` is a function then whatever that function " @@ -1234,7 +1274,7 @@ msgstr "" "傳的值。:attr:`side_effect` 函式會使用與 mock 相同的引數被呼叫。這讓你可以根" "據輸入動態地變更呼叫的回傳值:" -#: ../../library/unittest.mock.rst:1215 +#: ../../library/unittest.mock.rst:1238 #, fuzzy msgid "" "If you want the mock to still return the default return value (a new mock), " @@ -1246,7 +1286,7 @@ msgstr "" "值,有兩種方法可以實現。從 :attr:`side_effect` 內部回傳 :attr:`mock." "return_value`,或回傳 :data:`DEFAULT`:" -#: ../../library/unittest.mock.rst:1234 +#: ../../library/unittest.mock.rst:1257 #, fuzzy msgid "" "To remove a :attr:`~Mock.side_effect`, and return to the default behaviour, " @@ -1255,7 +1295,7 @@ msgstr "" "要刪除 :attr:`side_effect`,並恢復預設行為,將 :attr:`side_effect` 設為 " "``None``:" -#: ../../library/unittest.mock.rst:1248 +#: ../../library/unittest.mock.rst:1271 #, fuzzy msgid "" "The :attr:`~Mock.side_effect` can also be any iterable object. Repeated " @@ -1265,13 +1305,13 @@ msgstr "" ":attr:`side_effect` 也可以是任何可疊代的物件。對 mock 的重複呼叫將從可疊代物" "件中回傳值(直到疊代物件耗盡並引發 :exc:`StopIteration` 為止):" -#: ../../library/unittest.mock.rst:1264 +#: ../../library/unittest.mock.rst:1287 msgid "" "If any members of the iterable are exceptions they will be raised instead of " "returned::" msgstr "如果可疊代物件中的任何成員是例外,則它們將被引發而不是被回傳: ::" -#: ../../library/unittest.mock.rst:1267 +#: ../../library/unittest.mock.rst:1290 msgid "" ">>> iterable = (33, ValueError, 66)\n" ">>> m = MagicMock(side_effect=iterable)\n" @@ -1295,17 +1335,17 @@ msgstr "" ">>> m()\n" "66" -#: ../../library/unittest.mock.rst:1282 +#: ../../library/unittest.mock.rst:1305 msgid "Deleting Attributes" msgstr "刪除屬性" -#: ../../library/unittest.mock.rst:1284 +#: ../../library/unittest.mock.rst:1307 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "Mock 物件會在需要時建立屬性。這使得它們可以假裝成任何種類的物件。" -#: ../../library/unittest.mock.rst:1287 +#: ../../library/unittest.mock.rst:1310 #, fuzzy msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " @@ -1317,7 +1357,7 @@ msgstr "" "提取時引發 :exc:`AttributeError`。你可以通過將物件提供為 mock 的 :attr:" "`spec` 來實現這一點,但這並不總是那麼好用。" -#: ../../library/unittest.mock.rst:1291 +#: ../../library/unittest.mock.rst:1314 msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." @@ -1325,11 +1365,11 @@ msgstr "" "你可以通過刪除屬性來「阻擋」它們。一旦刪除,再次存取該屬性將會引發 :exc:" "`AttributeError`。" -#: ../../library/unittest.mock.rst:1308 +#: ../../library/unittest.mock.rst:1331 msgid "Mock names and the name attribute" msgstr "Mock 名稱與名稱屬性" -#: ../../library/unittest.mock.rst:1310 +#: ../../library/unittest.mock.rst:1333 msgid "" "Since \"name\" is an argument to the :class:`Mock` constructor, if you want " "your mock object to have a \"name\" attribute you can't just pass it in at " @@ -1340,7 +1380,7 @@ msgstr "" "擁有 \"name\" 屬性,你不能在建立時直接傳遞它。有兩種替代方法。其中一個選擇是" "使用 :meth:`~Mock.configure_mock`: ::" -#: ../../library/unittest.mock.rst:1315 +#: ../../library/unittest.mock.rst:1338 msgid "" ">>> mock = MagicMock()\n" ">>> mock.configure_mock(name='my_name')\n" @@ -1352,13 +1392,13 @@ msgstr "" ">>> mock.name\n" "'my_name'" -#: ../../library/unittest.mock.rst:1320 +#: ../../library/unittest.mock.rst:1343 msgid "" "A simpler option is to simply set the \"name\" attribute after mock " "creation::" msgstr "更簡單的方法是在 mock 建立後直接設定 \"name\" 屬性: ::" -#: ../../library/unittest.mock.rst:1322 +#: ../../library/unittest.mock.rst:1345 msgid "" ">>> mock = MagicMock()\n" ">>> mock.name = \"foo\"" @@ -1366,11 +1406,11 @@ msgstr "" ">>> mock = MagicMock()\n" ">>> mock.name = \"foo\"" -#: ../../library/unittest.mock.rst:1327 +#: ../../library/unittest.mock.rst:1350 msgid "Attaching Mocks as Attributes" msgstr "如同屬性一般附加 mock" -#: ../../library/unittest.mock.rst:1329 +#: ../../library/unittest.mock.rst:1352 msgid "" "When you attach a mock as an attribute of another mock (or as the return " "value) it becomes a \"child\" of that mock. Calls to the child are recorded " @@ -1386,7 +1426,7 @@ msgstr "" "mock 附加到記錄所有對子代的呼叫的上代並允許你對 mock 間的呼叫順序進行斷言非常" "有用:" -#: ../../library/unittest.mock.rst:1347 +#: ../../library/unittest.mock.rst:1370 msgid "" "The exception to this is if the mock has a name. This allows you to prevent " "the \"parenting\" if for some reason you don't want it to happen." @@ -1394,7 +1434,7 @@ msgstr "" "如果 mock 有 name 引數,則上述規則會有例外。這使你可以防止「親屬關係 " "(parenting)」的建立,假設因為某些原因你不希望這種狀況發生。" -#: ../../library/unittest.mock.rst:1358 +#: ../../library/unittest.mock.rst:1381 msgid "" "Mocks created for you by :func:`patch` are automatically given names. To " "attach mocks that have names to a parent you use the :meth:`~Mock." @@ -1403,7 +1443,7 @@ msgstr "" "由 :func:`patch` 為你建立的 mock 會自動被賦予名稱。若要將具有名稱的 mock 附加" "到上代,你可以使用 :meth:`~Mock.attach_mock` 方法: ::" -#: ../../library/unittest.mock.rst:1362 +#: ../../library/unittest.mock.rst:1385 msgid "" ">>> thing1 = object()\n" ">>> thing2 = object()\n" @@ -1431,7 +1471,7 @@ msgstr "" ">>> parent.mock_calls\n" "[call.child1('one'), call.child2('two')]" -#: ../../library/unittest.mock.rst:1376 +#: ../../library/unittest.mock.rst:1399 msgid "" "The only exceptions are magic methods and attributes (those that have " "leading and trailing double underscores). Mock doesn't create these but " @@ -1445,11 +1485,11 @@ msgstr "" "魔術方法卻獲得一個新的 Mock 物件時,會讓直譯器\\ *非常*\\ 困惑。如果你需要魔" "術方法的支援,請參閱\\ :ref:`魔術方法 <magic-methods>`。" -#: ../../library/unittest.mock.rst:1385 +#: ../../library/unittest.mock.rst:1408 msgid "The patchers" msgstr "Patchers" -#: ../../library/unittest.mock.rst:1387 +#: ../../library/unittest.mock.rst:1410 msgid "" "The patch decorators are used for patching objects only within the scope of " "the function they decorate. They automatically handle the unpatching for " @@ -1460,17 +1500,17 @@ msgstr "" "patch 的中止,即使有異常被引發也是如此。所有這些函式也可以在 with 陳述式中使" "用,或者作為類別裝飾器使用。" -#: ../../library/unittest.mock.rst:1394 +#: ../../library/unittest.mock.rst:1417 msgid "patch" msgstr "patch" -#: ../../library/unittest.mock.rst:1398 +#: ../../library/unittest.mock.rst:1421 msgid "" "The key is to do the patching in the right namespace. See the section `where " "to patch`_." msgstr "關鍵是要在正確的命名空間進行 patch。請參閱 `where to patch`_ 一節。" -#: ../../library/unittest.mock.rst:1402 +#: ../../library/unittest.mock.rst:1425 msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " @@ -1481,7 +1521,7 @@ msgstr "" "內部,*目標*\\ 會被 patch 成一個\\ *新的*\\ 物件。當函式或 with 陳述式結束" "時,patch 就會被解除。" -#: ../../library/unittest.mock.rst:1407 +#: ../../library/unittest.mock.rst:1430 msgid "" "If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " "if the patched object is an async function or a :class:`MagicMock` " @@ -1495,7 +1535,7 @@ msgstr "" "用且省略了 *new*,則所建立的 mock 會作為額外的引數傳遞給被裝飾的函式。如果 :" "func:`patch` 作為情境管理器使用,則所建立的 mock 將由情境管理器回傳。" -#: ../../library/unittest.mock.rst:1415 +#: ../../library/unittest.mock.rst:1438 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " "*target* is imported and the specified object replaced with the *new* " @@ -1508,7 +1548,7 @@ msgstr "" "`patch` 的環境中引入。target 在執行被裝飾的函式時被引入,而不是在裝飾器作用" "時 (decoration time)。" -#: ../../library/unittest.mock.rst:1421 +#: ../../library/unittest.mock.rst:1444 msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." @@ -1516,7 +1556,7 @@ msgstr "" "*spec* 和 *spec_set* 關鍵字引數會傳遞給 :class:`MagicMock`,如果 patch 正在為" "你建立一個。" -#: ../../library/unittest.mock.rst:1424 +#: ../../library/unittest.mock.rst:1447 msgid "" "In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " "patch to pass in the object being mocked as the spec/spec_set object." @@ -1524,7 +1564,7 @@ msgstr "" "此外,你還可以傳遞 ``spec=True`` 或 ``spec_set=True``,這將導致 patch 將被 " "mock 的物件作為 spec/spec_set 物件傳遞。" -#: ../../library/unittest.mock.rst:1427 +#: ../../library/unittest.mock.rst:1450 msgid "" "*new_callable* allows you to specify a different class, or callable object, " "that will be called to create the *new* object. By default :class:" @@ -1534,7 +1574,7 @@ msgstr "" "*new* 物件。預設情況下,對於非同步函式使用 :class:`AsyncMock`,而對於其他情況" "則使用 :class:`MagicMock`。" -#: ../../library/unittest.mock.rst:1431 +#: ../../library/unittest.mock.rst:1454 msgid "" "A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " "then the mock will be created with a spec from the object being replaced. " @@ -1552,7 +1592,7 @@ msgstr "" "mock,它們的回傳值(即 'instance')將具有與類別相同的規格。請參閱 :func:" "`create_autospec` 函式和 :ref:`auto-speccing`。" -#: ../../library/unittest.mock.rst:1441 +#: ../../library/unittest.mock.rst:1464 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." @@ -1560,7 +1600,7 @@ msgstr "" "你可以用 ``autospec=some_object`` 替代 ``autospec=True``,以使用任意物件作為" "規格,而不是被替換的物件。" -#: ../../library/unittest.mock.rst:1444 +#: ../../library/unittest.mock.rst:1467 msgid "" "By default :func:`patch` will fail to replace attributes that don't exist. " "If you pass in ``create=True``, and the attribute doesn't exist, patch will " @@ -1576,7 +1616,7 @@ msgstr "" "行環境建立的屬性的測試時非常有用。此功能預設為關閉,因為這可能會相當危險。開" "啟這個功能後,你可以對於實際上不存在的 API 撰寫會通過的測試!" -#: ../../library/unittest.mock.rst:1454 +#: ../../library/unittest.mock.rst:1477 msgid "" "If you are patching builtins in a module then you don't need to pass " "``create=True``, it will be added by default." @@ -1584,7 +1624,7 @@ msgstr "" "如果你正在 patch 模組中的內建函式,那麼你不需要傳遞 ``create=True``,它預設會" "被加入。" -#: ../../library/unittest.mock.rst:1458 +#: ../../library/unittest.mock.rst:1481 #, fuzzy msgid "" "Patch can be used as a :class:`~unittest.TestCase` class decorator. It works " @@ -1601,7 +1641,7 @@ msgstr "" "是 ``'test'``,這與 :mod:`unittest` 尋找測試的方式相匹配。你可以通過設定 " "``patch.TEST_PREFIX`` 來指定別的前綴。" -#: ../../library/unittest.mock.rst:1465 +#: ../../library/unittest.mock.rst:1488 msgid "" "Patch can be used as a context manager, with the with statement. Here the " "patching applies to the indented block after the with statement. If you use " @@ -1612,7 +1652,7 @@ msgstr "" "的縮排區塊。如果你使用 \"as\",則被 patch 的物件將被綁定到 \"as\" 後面的名" "稱;如果 :func:`patch` 正在為你建立一個 mock 物件,這會非常有用。" -#: ../../library/unittest.mock.rst:1470 +#: ../../library/unittest.mock.rst:1493 msgid "" ":func:`patch` takes arbitrary keyword arguments. These will be passed to :" "class:`AsyncMock` if the patched object is asynchronous, to :class:" @@ -1622,7 +1662,7 @@ msgstr "" "傳遞給 :class:`AsyncMock`,如果是同步的則會傳遞給 :class:`MagicMock`,或如果" "指定了 *new_callable*,則傳遞給它。" -#: ../../library/unittest.mock.rst:1474 +#: ../../library/unittest.mock.rst:1497 msgid "" "``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are " "available for alternate use-cases." @@ -1630,14 +1670,14 @@ msgstr "" "``patch.dict(...)``、``patch.multiple(...)`` 和 ``patch.object(...)`` 可用於" "其餘的使用情境。" -#: ../../library/unittest.mock.rst:1477 +#: ../../library/unittest.mock.rst:1500 msgid "" ":func:`patch` as function decorator, creating the mock for you and passing " "it into the decorated function::" msgstr "" ":func:`patch` 作為函式裝飾器,為你建立 mock 並將其傳遞給被裝飾的函式: ::" -#: ../../library/unittest.mock.rst:1480 +#: ../../library/unittest.mock.rst:1503 msgid "" ">>> @patch('__main__.SomeClass')\n" "... def function(normal_argument, mock_class):\n" @@ -1653,7 +1693,7 @@ msgstr "" ">>> function(None)\n" "True" -#: ../../library/unittest.mock.rst:1487 +#: ../../library/unittest.mock.rst:1510 msgid "" "Patching a class replaces the class with a :class:`MagicMock` *instance*. If " "the class is instantiated in the code under test then it will be the :attr:" @@ -1663,7 +1703,7 @@ msgstr "" "測試的程式碼中實例化,那麼它將是會被使用的 mock 的 :attr:`~Mock." "return_value`。" -#: ../../library/unittest.mock.rst:1491 +#: ../../library/unittest.mock.rst:1514 msgid "" "If the class is instantiated multiple times you could use :attr:`~Mock." "side_effect` to return a new mock each time. Alternatively you can set the " @@ -1672,7 +1712,7 @@ msgstr "" "如果該類別被實例化多次,你可以使用 :attr:`~Mock.side_effect` 來每次回傳一個新" "的 mock。 或者你可以將 *return_value* 設定成你想要的任何值。" -#: ../../library/unittest.mock.rst:1495 +#: ../../library/unittest.mock.rst:1518 #, fuzzy msgid "" "To configure return values on methods of *instances* on the patched class " @@ -1681,7 +1721,7 @@ msgstr "" "若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須在 :attr:" "`return_value` 上進行配置。 例如: ::" -#: ../../library/unittest.mock.rst:1498 +#: ../../library/unittest.mock.rst:1521 msgid "" ">>> class Class:\n" "... def method(self):\n" @@ -1705,7 +1745,7 @@ msgstr "" "... assert Class().method() == 'foo'\n" "..." -#: ../../library/unittest.mock.rst:1509 +#: ../../library/unittest.mock.rst:1532 msgid "" "If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " "then the return value of the created mock will have the same spec. ::" @@ -1713,7 +1753,7 @@ msgstr "" "如果你使用 *spec* 或 *spec_set* 且 :func:`patch` 正在取代一個\\ *類別*,那麼" "被建立的 mock 的回傳值將具有相同的規格。: ::" -#: ../../library/unittest.mock.rst:1512 +#: ../../library/unittest.mock.rst:1535 msgid "" ">>> Original = Class\n" ">>> patcher = patch('__main__.Class', spec=True)\n" @@ -1729,7 +1769,7 @@ msgstr "" ">>> assert isinstance(instance, Original)\n" ">>> patcher.stop()" -#: ../../library/unittest.mock.rst:1519 +#: ../../library/unittest.mock.rst:1542 msgid "" "The *new_callable* argument is useful where you want to use an alternative " "class to the default :class:`MagicMock` for the created mock. For example, " @@ -1739,7 +1779,7 @@ msgstr "" "*new_callable* 引數非常有用。例如,如果你想要一個 :class:`NonCallableMock` 被" "使用: ::" -#: ../../library/unittest.mock.rst:1523 +#: ../../library/unittest.mock.rst:1546 msgid "" ">>> thing = object()\n" ">>> with patch('__main__.thing', new_callable=NonCallableMock) as " @@ -1761,13 +1801,13 @@ msgstr "" " ...\n" "TypeError: 'NonCallableMock' object is not callable" -#: ../../library/unittest.mock.rst:1532 +#: ../../library/unittest.mock.rst:1555 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "另一個用法是用一個 :class:`io.StringIO` 實例替換一個物件: ::" -#: ../../library/unittest.mock.rst:1534 +#: ../../library/unittest.mock.rst:1557 msgid "" ">>> from io import StringIO\n" ">>> def foo():\n" @@ -1791,7 +1831,7 @@ msgstr "" "...\n" ">>> test()" -#: ../../library/unittest.mock.rst:1545 +#: ../../library/unittest.mock.rst:1568 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " "thing you need to do is to configure the mock. Some of that configuration " @@ -1802,7 +1842,7 @@ msgstr "" "一些配置可以在對 patch 的呼叫中完成。你傳遞到呼叫中的任何關鍵字都將用於在被建" "立的 mock 上設定屬性: ::" -#: ../../library/unittest.mock.rst:1550 +#: ../../library/unittest.mock.rst:1573 msgid "" ">>> patcher = patch('__main__.thing', first='one', second='two')\n" ">>> mock_thing = patcher.start()\n" @@ -1818,7 +1858,7 @@ msgstr "" ">>> mock_thing.second\n" "'two'" -#: ../../library/unittest.mock.rst:1557 +#: ../../library/unittest.mock.rst:1580 msgid "" "As well as attributes on the created mock attributes, like the :attr:`~Mock." "return_value` and :attr:`~Mock.side_effect`, of child mocks can also be " @@ -1831,7 +1871,7 @@ msgstr "" "數傳入,但是以它們作為鍵的字典仍然可以使用 ``**`` 擴充為一個 :func:`patch` 呼" "叫: ::" -#: ../../library/unittest.mock.rst:1563 +#: ../../library/unittest.mock.rst:1586 msgid "" ">>> config = {'method.return_value': 3, 'other.side_effect': KeyError}\n" ">>> patcher = patch('__main__.thing', **config)\n" @@ -1853,7 +1893,7 @@ msgstr "" " ...\n" "KeyError" -#: ../../library/unittest.mock.rst:1573 +#: ../../library/unittest.mock.rst:1596 msgid "" "By default, attempting to patch a function in a module (or a method or an " "attribute in a class) that does not exist will fail with :exc:" @@ -1862,7 +1902,7 @@ msgstr "" "預設情況下,嘗試 patch 模組中不存在的函式(或類別中的方法或屬性)將會失敗,並" "引發 :exc:`AttributeError`: ::" -#: ../../library/unittest.mock.rst:1576 +#: ../../library/unittest.mock.rst:1599 msgid "" ">>> @patch('sys.non_existing_attribute', 42)\n" "... def test():\n" @@ -1884,7 +1924,7 @@ msgstr "" "AttributeError: <module 'sys' (built-in)> does not have the attribute " "'non_existing_attribute'" -#: ../../library/unittest.mock.rst:1585 +#: ../../library/unittest.mock.rst:1608 msgid "" "but adding ``create=True`` in the call to :func:`patch` will make the " "previous example work as expected::" @@ -1892,7 +1932,7 @@ msgstr "" "但是在對 :func:`patch` 的呼叫中增加 ``create=True`` 將使前面的範例按照預期運" "作: ::" -#: ../../library/unittest.mock.rst:1588 +#: ../../library/unittest.mock.rst:1611 msgid "" ">>> @patch('sys.non_existing_attribute', 42, create=True)\n" "... def test(mock_stdout):\n" @@ -1906,18 +1946,18 @@ msgstr "" "...\n" ">>> test()" -#: ../../library/unittest.mock.rst:1596 +#: ../../library/unittest.mock.rst:1619 msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" "如果目標是一個非同步函式,:func:`patch` 現在會回傳一個 :class:`AsyncMock`。" -#: ../../library/unittest.mock.rst:1600 +#: ../../library/unittest.mock.rst:1623 msgid "patch.object" msgstr "patch.object" -#: ../../library/unittest.mock.rst:1604 +#: ../../library/unittest.mock.rst:1627 msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." @@ -1925,7 +1965,7 @@ msgstr "" "使用一個 mock 物件 patch 一個物件(\\ *目標*\\ )上的命名成員(\\ *屬性" "*\\ )。" -#: ../../library/unittest.mock.rst:1607 +#: ../../library/unittest.mock.rst:1630 msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a " "context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " @@ -1938,7 +1978,7 @@ msgstr "" "`patch` 中的引數具有相同的意義。與 :func:`patch` 一樣,:func:`patch.object` " "接受任意關鍵字引數來配置它所建立的 mock 物件。" -#: ../../library/unittest.mock.rst:1613 +#: ../../library/unittest.mock.rst:1636 msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." @@ -1946,7 +1986,7 @@ msgstr "" "當作為類別裝飾器使用時,:func:`patch.object` 會遵循 ``patch.TEST_PREFIX`` 來" "選擇要包裝的方法。" -#: ../../library/unittest.mock.rst:1616 +#: ../../library/unittest.mock.rst:1639 msgid "" "You can either call :func:`patch.object` with three arguments or two " "arguments. The three argument form takes the object to be patched, the " @@ -1955,7 +1995,7 @@ msgstr "" "你可以使用三個引數或兩個引數來呼叫 :func:`patch.object`。三個引數的形式接受要" "被 patch 的物件、屬性名稱和要替換掉屬性的物件。" -#: ../../library/unittest.mock.rst:1620 +#: ../../library/unittest.mock.rst:1643 msgid "" "When calling with the two argument form you omit the replacement object, and " "a mock is created for you and passed in as an extra argument to the " @@ -1964,7 +2004,7 @@ msgstr "" "當使用兩個引數的形式呼叫時,你會省略要替換的物件,一個 mock 會為你建立並將其" "作為額外的引數傳遞給被裝飾的函式:" -#: ../../library/unittest.mock.rst:1631 +#: ../../library/unittest.mock.rst:1654 msgid "" "*spec*, *create* and the other arguments to :func:`patch.object` have the " "same meaning as they do for :func:`patch`." @@ -1972,17 +2012,17 @@ msgstr "" "*spec*、*create* 和 :func:`patch.object` 的其他引數與在 :func:`patch` 中的引" "數具有相同的意義。" -#: ../../library/unittest.mock.rst:1636 +#: ../../library/unittest.mock.rst:1659 msgid "patch.dict" msgstr "patch.dict" -#: ../../library/unittest.mock.rst:1640 +#: ../../library/unittest.mock.rst:1663 msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "Patch 字典或類字典的物件,並在測試後將字典回復到其原本的狀態。" -#: ../../library/unittest.mock.rst:1643 +#: ../../library/unittest.mock.rst:1666 msgid "" "*in_dict* can be a dictionary or a mapping like container. If it is a " "mapping then it must at least support getting, setting and deleting items " @@ -1991,13 +2031,13 @@ msgstr "" "*in_dict* 可以是一個字典或一個類對映的容器。如果它是一個對映,那麼它至少必須" "支援獲取、設定、刪除項目以及對鍵的疊代。" -#: ../../library/unittest.mock.rst:1647 +#: ../../library/unittest.mock.rst:1670 msgid "" "*in_dict* can also be a string specifying the name of the dictionary, which " "will then be fetched by importing it." msgstr "*in_dict* 也可以是指定字典名稱的字串,然後透過 import 來取得該字典。" -#: ../../library/unittest.mock.rst:1650 +#: ../../library/unittest.mock.rst:1673 msgid "" "*values* can be a dictionary of values to set in the dictionary. *values* " "can also be an iterable of ``(key, value)`` pairs." @@ -2005,31 +2045,31 @@ msgstr "" "*values* 可以是要設定的值的字典。*values* 也可以是 ``(key, value)`` 對 " "(pairs) 的可疊代物件。" -#: ../../library/unittest.mock.rst:1653 +#: ../../library/unittest.mock.rst:1676 msgid "" "If *clear* is true then the dictionary will be cleared before the new values " "are set." msgstr "如果 *clear* 為 true,則在設定新值之前字典將被清除。" -#: ../../library/unittest.mock.rst:1656 +#: ../../library/unittest.mock.rst:1679 msgid "" ":func:`patch.dict` can also be called with arbitrary keyword arguments to " "set values in the dictionary." msgstr "也可以使用任意關鍵字引數呼叫 :func:`patch.dict` 以在字典中設定值。" -#: ../../library/unittest.mock.rst:1661 +#: ../../library/unittest.mock.rst:1684 msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr ":func:`patch.dict` 現在在做為情境管理器使用時回傳被 patch 的字典。" -#: ../../library/unittest.mock.rst:1664 +#: ../../library/unittest.mock.rst:1687 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr ":func:`patch.dict` 可以做為情境管理器、裝飾器或類別裝飾器使用:" -#: ../../library/unittest.mock.rst:1675 +#: ../../library/unittest.mock.rst:1698 msgid "" "When used as a class decorator :func:`patch.dict` honours ``patch." "TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" @@ -2037,7 +2077,7 @@ msgstr "" "當作為類別裝飾器使用時,:func:`patch.dict` 會遵循 ``patch.TEST_PREFIX``\\ " "(預設為 ``'test'``\\ )來選擇要包裝的方法:" -#: ../../library/unittest.mock.rst:1686 +#: ../../library/unittest.mock.rst:1709 msgid "" "If you want to use a different prefix for your test, you can inform the " "patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more " @@ -2047,7 +2087,7 @@ msgstr "" "patcher 使用不同的前綴。請參閱 :ref:`test-prefix` 以得知如何修改前綴的更多內" "容。" -#: ../../library/unittest.mock.rst:1690 +#: ../../library/unittest.mock.rst:1713 msgid "" ":func:`patch.dict` can be used to add members to a dictionary, or simply let " "a test change a dictionary, and ensure the dictionary is restored when the " @@ -2056,13 +2096,13 @@ msgstr "" ":func:`patch.dict` 可用於在字典中新增成員,或單純地讓測試更改字典,並確保在測" "試結束時將字典回復原狀。" -#: ../../library/unittest.mock.rst:1711 +#: ../../library/unittest.mock.rst:1734 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "可以在 :func:`patch.dict` 呼叫中使用關鍵字來設定字典中的值:" -#: ../../library/unittest.mock.rst:1721 +#: ../../library/unittest.mock.rst:1744 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " @@ -2077,11 +2117,11 @@ msgstr "" "__delitem__` 以及 :meth:`~container.__iter__` 或 :meth:`~object." "__contains__`。" -#: ../../library/unittest.mock.rst:1751 +#: ../../library/unittest.mock.rst:1774 msgid "patch.multiple" msgstr "patch.multiple" -#: ../../library/unittest.mock.rst:1755 +#: ../../library/unittest.mock.rst:1778 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " "(either as an object or a string to fetch the object by importing) and " @@ -2090,7 +2130,7 @@ msgstr "" "在一次呼叫中執行多個 patch。它接受被 patch 的物件(作為物件或透過 import 取得" "物件的字串)和 patch 的關鍵字引數: ::" -#: ../../library/unittest.mock.rst:1759 +#: ../../library/unittest.mock.rst:1782 msgid "" "with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):\n" " ..." @@ -2098,7 +2138,7 @@ msgstr "" "with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):\n" " ..." -#: ../../library/unittest.mock.rst:1762 +#: ../../library/unittest.mock.rst:1785 msgid "" "Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " "create mocks for you. In this case the created mocks are passed into a " @@ -2109,7 +2149,7 @@ msgstr "" "值。在這種情況下,被建立的 mock 會透過關鍵字傳遞到被裝飾的函式中,並且當 :" "func:`patch.multiple` 作為情境管理器時會回傳字典。" -#: ../../library/unittest.mock.rst:1767 +#: ../../library/unittest.mock.rst:1790 msgid "" ":func:`patch.multiple` can be used as a decorator, class decorator or a " "context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " @@ -2121,7 +2161,7 @@ msgstr "" "`patch` 中的引數具有相同的意義。這些引數將應用於由 :func:`patch.multiple` 完" "成的\\ *所有* patch。" -#: ../../library/unittest.mock.rst:1772 +#: ../../library/unittest.mock.rst:1795 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." @@ -2129,7 +2169,7 @@ msgstr "" "當作為類別裝飾器使用時,:func:`patch.multiple` 遵循 ``patch.TEST_PREFIX`` 來" "選擇要包裝的方法。" -#: ../../library/unittest.mock.rst:1775 +#: ../../library/unittest.mock.rst:1798 msgid "" "If you want :func:`patch.multiple` to create mocks for you, then you can " "use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " @@ -2140,7 +2180,7 @@ msgstr "" "`DEFAULT` 作為值。如果你使用 :func:`patch.multiple` 作為裝飾器,那麼被建立的 " "mock 將透過關鍵字傳遞到被裝飾的函式中。: ::" -#: ../../library/unittest.mock.rst:1779 +#: ../../library/unittest.mock.rst:1802 msgid "" ">>> thing = object()\n" ">>> other = object()\n" @@ -2162,7 +2202,7 @@ msgstr "" "...\n" ">>> test_function()" -#: ../../library/unittest.mock.rst:1789 +#: ../../library/unittest.mock.rst:1812 msgid "" ":func:`patch.multiple` can be nested with other ``patch`` decorators, but " "put arguments passed by keyword *after* any of the standard arguments " @@ -2171,7 +2211,7 @@ msgstr "" ":func:`patch.multiple` 可以與其他 ``patch`` 裝飾器巢狀使用,但需要將透過關鍵" "字傳遞的引數放在 :func:`patch` 建立的任何標準引數\\ *之後*: ::" -#: ../../library/unittest.mock.rst:1792 +#: ../../library/unittest.mock.rst:1815 msgid "" ">>> @patch('sys.exit')\n" "... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT)\n" @@ -2191,7 +2231,7 @@ msgstr "" "...\n" ">>> test_function()" -#: ../../library/unittest.mock.rst:1801 +#: ../../library/unittest.mock.rst:1824 msgid "" "If :func:`patch.multiple` is used as a context manager, the value returned " "by the context manager is a dictionary where created mocks are keyed by " @@ -2200,7 +2240,7 @@ msgstr "" "如果 :func:`patch.multiple` 作為情境管理器使用,則情境管理器回傳的值是一個字" "典,其中被建立的 mock 會按名稱作為其鍵值: ::" -#: ../../library/unittest.mock.rst:1804 +#: ../../library/unittest.mock.rst:1827 msgid "" ">>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as " "values:\n" @@ -2218,11 +2258,11 @@ msgstr "" "... assert values['other'] is other\n" "..." -#: ../../library/unittest.mock.rst:1815 +#: ../../library/unittest.mock.rst:1838 msgid "patch methods: start and stop" msgstr "patch 方法:啟動與停止" -#: ../../library/unittest.mock.rst:1817 +#: ../../library/unittest.mock.rst:1840 #, fuzzy msgid "" "All the patchers have :meth:`!start` and :meth:`!stop` methods. These make " @@ -2233,7 +2273,7 @@ msgstr "" "法中進行 patch 或在你想要在沒有巢狀使用裝飾器或 with 陳述式的情況下進行多個 " "patch 時變得更簡單。" -#: ../../library/unittest.mock.rst:1821 +#: ../../library/unittest.mock.rst:1844 #, fuzzy msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " @@ -2245,7 +2285,7 @@ msgstr "" "`patch.dict` ,並保留對回傳的 ``patcher`` 物件的參照。之後你就可以呼叫 :meth:" "`start` 將 patch 準備就緒,並呼叫 :meth:`stop` 來取消 patch。" -#: ../../library/unittest.mock.rst:1825 +#: ../../library/unittest.mock.rst:1848 msgid "" "If you are using :func:`patch` to create a mock for you then it will be " "returned by the call to ``patcher.start``. ::" @@ -2253,7 +2293,7 @@ msgstr "" "如果你使用 :func:`patch` 為你建立 mock,那麼它將透過呼叫 ``patcher.start`` 回" "傳。: ::" -#: ../../library/unittest.mock.rst:1828 +#: ../../library/unittest.mock.rst:1851 msgid "" ">>> patcher = patch('package.module.ClassName')\n" ">>> from package import module\n" @@ -2275,7 +2315,7 @@ msgstr "" ">>> assert module.ClassName is original\n" ">>> assert module.ClassName is not new_mock" -#: ../../library/unittest.mock.rst:1839 +#: ../../library/unittest.mock.rst:1862 #, fuzzy msgid "" "A typical use case for this might be for doing multiple patches in the " @@ -2284,7 +2324,7 @@ msgstr "" "一個典型的用法是在一個 :class:`TestCase` 的 ``setUp`` 方法中執行多個 " "patch: ::" -#: ../../library/unittest.mock.rst:1842 +#: ../../library/unittest.mock.rst:1865 msgid "" ">>> class MyTest(unittest.TestCase):\n" "... def setUp(self):\n" @@ -2320,7 +2360,7 @@ msgstr "" "...\n" ">>> MyTest('test_something').run()" -#: ../../library/unittest.mock.rst:1861 +#: ../../library/unittest.mock.rst:1884 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -2331,7 +2371,7 @@ msgstr "" "你想像的還要複雜一點,因為如果有例外在 ``setUp`` 中被引發,則 ``tearDown`` 就" "不會被呼叫。:meth:`unittest.TestCase.addCleanup` 會讓這稍微簡單一點: ::" -#: ../../library/unittest.mock.rst:1866 +#: ../../library/unittest.mock.rst:1889 msgid "" ">>> class MyTest(unittest.TestCase):\n" "... def setUp(self):\n" @@ -2353,34 +2393,34 @@ msgstr "" "... assert package.module.Class is self.MockClass\n" "..." -#: ../../library/unittest.mock.rst:1876 +#: ../../library/unittest.mock.rst:1899 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "作為額外的好處,你不再需要保留對 ``patcher`` 物件的參照。" -#: ../../library/unittest.mock.rst:1879 +#: ../../library/unittest.mock.rst:1902 msgid "" "It is also possible to stop all patches which have been started by using :" "func:`patch.stopall`." msgstr "也可以使用 :func:`patch.stopall` 來停止所有已啟動的 patch。" -#: ../../library/unittest.mock.rst:1884 +#: ../../library/unittest.mock.rst:1907 msgid "Stop all active patches. Only stops patches started with ``start``." msgstr "停止所有運作的 patch。只停止以 ``start`` 啟動的 patch。" -#: ../../library/unittest.mock.rst:1890 +#: ../../library/unittest.mock.rst:1913 msgid "patch builtins" msgstr "patch 內建函式" -#: ../../library/unittest.mock.rst:1891 +#: ../../library/unittest.mock.rst:1914 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" "你可以 patch 模組內的任何內建函式。以下範例 patch 內建函式 :func:`ord`: ::" -#: ../../library/unittest.mock.rst:1894 +#: ../../library/unittest.mock.rst:1917 msgid "" ">>> @patch('__main__.ord')\n" "... def test(mock_ord):\n" @@ -2398,11 +2438,11 @@ msgstr "" ">>> test()\n" "101" -#: ../../library/unittest.mock.rst:1906 +#: ../../library/unittest.mock.rst:1929 msgid "TEST_PREFIX" msgstr "TEST_PREFIX" -#: ../../library/unittest.mock.rst:1908 +#: ../../library/unittest.mock.rst:1931 msgid "" "All of the patchers can be used as class decorators. When used in this way " "they wrap every test method on the class. The patchers recognise methods " @@ -2413,7 +2453,7 @@ msgstr "" "個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。這與 :class:" "`unittest.TestLoader` 預設尋找測試方法的方式相同。" -#: ../../library/unittest.mock.rst:1913 +#: ../../library/unittest.mock.rst:1936 msgid "" "It is possible that you want to use a different prefix for your tests. You " "can inform the patchers of the different prefix by setting ``patch." @@ -2422,7 +2462,7 @@ msgstr "" "你可能會想為你的測試使用不同的前綴。你可以透過設定 ``patch.TEST_PREFIX`` 來告" "知 patcher 使用不同的前綴: ::" -#: ../../library/unittest.mock.rst:1916 +#: ../../library/unittest.mock.rst:1939 msgid "" ">>> patch.TEST_PREFIX = 'foo'\n" ">>> value = 3\n" @@ -2460,21 +2500,21 @@ msgstr "" ">>> value\n" "3" -#: ../../library/unittest.mock.rst:1936 +#: ../../library/unittest.mock.rst:1959 msgid "Nesting Patch Decorators" msgstr "巢狀使用 Patch 裝飾器" -#: ../../library/unittest.mock.rst:1938 +#: ../../library/unittest.mock.rst:1961 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." msgstr "如果你想執行多個 patch,那麼你可以簡單地堆疊裝飾器。" -#: ../../library/unittest.mock.rst:1941 +#: ../../library/unittest.mock.rst:1964 msgid "You can stack up multiple patch decorators using this pattern:" msgstr "你可以使用這個模式來堆疊多個 patch 裝飾器:" -#: ../../library/unittest.mock.rst:1957 +#: ../../library/unittest.mock.rst:1980 msgid "" "Note that the decorators are applied from the bottom upwards. This is the " "standard way that Python applies decorators. The order of the created mocks " @@ -2483,11 +2523,11 @@ msgstr "" "請注意,裝飾器是從底部向上應用的。這是 Python 應用裝飾器的標準方式。被建立的 " "mock 傳遞到測試函式中的順序與此順序相同。" -#: ../../library/unittest.mock.rst:1965 +#: ../../library/unittest.mock.rst:1988 msgid "Where to patch" msgstr "該 patch 何處" -#: ../../library/unittest.mock.rst:1967 +#: ../../library/unittest.mock.rst:1990 msgid "" ":func:`patch` works by (temporarily) changing the object that a *name* " "points to with another one. There can be many names pointing to any " @@ -2498,7 +2538,7 @@ msgstr "" "有許多 name 指向任何單一物件,因此為了使 patch 起作用,你必須確保你 patch 了" "被測試系統使用的 name。" -#: ../../library/unittest.mock.rst:1972 +#: ../../library/unittest.mock.rst:1995 msgid "" "The basic principle is that you patch where an object is *looked up*, which " "is not necessarily the same place as where it is defined. A couple of " @@ -2507,12 +2547,12 @@ msgstr "" "基本原則是在物件\\ *被查找*\\ 的位置進行 patch,該位置不一定與其被定義的位置" "相同。幾個範例將有助於闡明這一點。" -#: ../../library/unittest.mock.rst:1976 +#: ../../library/unittest.mock.rst:1999 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "想像一下,我們想要測試一個專案,其結構如下: ::" -#: ../../library/unittest.mock.rst:1978 +#: ../../library/unittest.mock.rst:2001 msgid "" "a.py\n" " -> Defines SomeClass\n" @@ -2522,7 +2562,7 @@ msgid "" " -> some_function instantiates SomeClass" msgstr "" -#: ../../library/unittest.mock.rst:1985 +#: ../../library/unittest.mock.rst:2008 #, fuzzy msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " @@ -2538,7 +2578,7 @@ msgstr "" "那麼它對我們的測試就不會有任何影響;模組 b 已經有了一個\\ *真實的*\\ " "``SomeClass`` 的參照 ,看起來我們的 patch 並沒有任何效果。" -#: ../../library/unittest.mock.rst:1992 +#: ../../library/unittest.mock.rst:2015 msgid "" "The key is to patch out ``SomeClass`` where it is used (or where it is " "looked up). In this case ``some_function`` will actually look up " @@ -2549,11 +2589,11 @@ msgstr "" "``some_function`` 實際上會在我們 import 它的模組 b 中查找 ``SomeClass``。這裡" "的 patch 應該長得像這樣: ::" -#: ../../library/unittest.mock.rst:1996 +#: ../../library/unittest.mock.rst:2019 msgid "@patch('b.SomeClass')" msgstr "@patch('b.SomeClass')" -#: ../../library/unittest.mock.rst:1998 +#: ../../library/unittest.mock.rst:2021 msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." @@ -2566,15 +2606,15 @@ msgstr "" "形式都很常見。在這種情況下,我們想要 patch 的類別正在其模組中被查找,因此我們" "必須 patch ``a.SomeClass``: ::" -#: ../../library/unittest.mock.rst:2003 +#: ../../library/unittest.mock.rst:2026 msgid "@patch('a.SomeClass')" msgstr "@patch('a.SomeClass')" -#: ../../library/unittest.mock.rst:2007 +#: ../../library/unittest.mock.rst:2030 msgid "Patching Descriptors and Proxy Objects" msgstr "Patch 描述器與代理物件 (Proxy Objects)" -#: ../../library/unittest.mock.rst:2009 +#: ../../library/unittest.mock.rst:2032 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the " @@ -2589,15 +2629,15 @@ msgstr "" "web/20200603181648/http://www.voidspace.org.uk/python/weblog/ " "arch_d7_2010_12_04.shtml#e1198>`_。" -#: ../../library/unittest.mock.rst:2017 +#: ../../library/unittest.mock.rst:2040 msgid "MagicMock and magic method support" msgstr "MagicMock 以及魔術方法支援" -#: ../../library/unittest.mock.rst:2022 +#: ../../library/unittest.mock.rst:2045 msgid "Mocking Magic Methods" msgstr "Mock 魔術方法" -#: ../../library/unittest.mock.rst:2024 +#: ../../library/unittest.mock.rst:2047 msgid "" ":class:`Mock` supports mocking the Python protocol methods, also known as :" "term:`\"magic methods\" <magic method>`. This allows mock objects to replace " @@ -2606,7 +2646,7 @@ msgstr "" ":class:`Mock` 支援 mock Python 協定方法,其也被稱作 :term:`\"魔術方法\" " "<magic method>`。這允許 mock 物件替換容器或實作 Python 協定的其他物件。" -#: ../../library/unittest.mock.rst:2028 +#: ../../library/unittest.mock.rst:2051 msgid "" "Because magic methods are looked up differently from normal methods [#]_, " "this support has been specially implemented. This means that only specific " @@ -2617,7 +2657,7 @@ msgstr "" "代表著僅有特定的魔術方法被此方式支援。現在已支援清單中已經\\ *幾乎*\\ 包含了" "所有魔術方法。如果你需要 mock 任何魔術方法而其尚未被支援,請讓我們知道。" -#: ../../library/unittest.mock.rst:2033 +#: ../../library/unittest.mock.rst:2056 msgid "" "You mock magic methods by setting the method you are interested in to a " "function or a mock instance. If you are using a function then it *must* take " @@ -2626,13 +2666,13 @@ msgstr "" "你可以透過將你感興趣的方法設定為函式或 mock 實例來 mock 魔術方法。如果你使用" "函式,那麼它\\ *必須*\\ 將 ``self`` 作為第一個引數 [#]_。" -#: ../../library/unittest.mock.rst:2056 +#: ../../library/unittest.mock.rst:2079 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "一個用法是在 :keyword:`with` 陳述式中 mock 作為情境管理器使用的物件:" -#: ../../library/unittest.mock.rst:2068 +#: ../../library/unittest.mock.rst:2091 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." @@ -2640,7 +2680,7 @@ msgstr "" "對魔術方法的呼叫並不會出現在 :attr:`~Mock.method_calls` 中,它們會被記錄在 :" "attr:`~Mock.mock_calls` 內。" -#: ../../library/unittest.mock.rst:2073 +#: ../../library/unittest.mock.rst:2096 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " "set a magic method that isn't in the spec will raise an :exc:" @@ -2649,23 +2689,23 @@ msgstr "" "如果你使用\\ *spec*\\ 關鍵字引數來建立一個 mock,則嘗試設定規格中未包含的魔術" "方法將引發一個 :exc:`AttributeError`。" -#: ../../library/unittest.mock.rst:2076 +#: ../../library/unittest.mock.rst:2099 msgid "The full list of supported magic methods is:" msgstr "已支援的魔術方法的完整列表是:" -#: ../../library/unittest.mock.rst:2078 +#: ../../library/unittest.mock.rst:2101 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" msgstr "``__hash__``、``__sizeof__``、 ``__repr__`` 和 ``__str__``" -#: ../../library/unittest.mock.rst:2079 +#: ../../library/unittest.mock.rst:2102 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" msgstr "``__dir__``、 ``__format__`` 和 ``__subclasses__``" -#: ../../library/unittest.mock.rst:2080 +#: ../../library/unittest.mock.rst:2103 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" msgstr "``__round__``、``__floor__``、``__trunc__`` 和 ``__ceil__``" -#: ../../library/unittest.mock.rst:2081 +#: ../../library/unittest.mock.rst:2104 msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" @@ -2673,7 +2713,7 @@ msgstr "" "比較方法:``__lt__``、``__gt__``、``__le__``、``__ge__``、``__eq__`` 和 " "``__ne__``" -#: ../../library/unittest.mock.rst:2083 +#: ../../library/unittest.mock.rst:2106 msgid "" "Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, " "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " @@ -2683,18 +2723,18 @@ msgstr "" "``__contains__``、``__len__``、``__iter__``、``__reversed__`` 和 " "``__missing__``" -#: ../../library/unittest.mock.rst:2086 +#: ../../library/unittest.mock.rst:2109 msgid "" "Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " "``__aexit__``" msgstr "" "情境管理器:``__enter__``、``__exit__``、``__aenter__`` 和 ``__aexit__``" -#: ../../library/unittest.mock.rst:2087 +#: ../../library/unittest.mock.rst:2110 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" msgstr "一元數值方法:``__neg__``、``__pos__`` 和 ``__invert__``" -#: ../../library/unittest.mock.rst:2088 +#: ../../library/unittest.mock.rst:2111 msgid "" "The numeric methods (including right hand and in-place variants): " "``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__truediv__``, " @@ -2706,18 +2746,18 @@ msgstr "" "``__mod__``、``__divmod__``、``__lshift__``、``__rshift__``、``__and__``、" "``__xor__``、``__or__`` 和 ``__pow__``" -#: ../../library/unittest.mock.rst:2092 +#: ../../library/unittest.mock.rst:2115 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" "數值轉換方法:``__complex__``、``__int__``、``__float__`` 和 ``__index__``" -#: ../../library/unittest.mock.rst:2094 +#: ../../library/unittest.mock.rst:2117 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" msgstr "描述器方法:``__get__``、``__set__`` 和 ``__delete__``" -#: ../../library/unittest.mock.rst:2095 +#: ../../library/unittest.mock.rst:2118 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" @@ -2725,19 +2765,19 @@ msgstr "" "Pickling:``__reduce__``、``__reduce_ex__``、``__getinitargs__``、" "``__getnewargs__``、``__getstate__`` 和 ``__setstate__``" -#: ../../library/unittest.mock.rst:2097 +#: ../../library/unittest.mock.rst:2120 msgid "File system path representation: ``__fspath__``" msgstr "檔案系統路徑表示法:``__fspath__``" -#: ../../library/unittest.mock.rst:2098 +#: ../../library/unittest.mock.rst:2121 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" msgstr "非同步疊代方法:``__aiter__`` 和 ``__anext__``" -#: ../../library/unittest.mock.rst:2100 +#: ../../library/unittest.mock.rst:2123 msgid "Added support for :func:`os.PathLike.__fspath__`." msgstr "新增對於 :func:`os.PathLike.__fspath__` 的支援。" -#: ../../library/unittest.mock.rst:2103 +#: ../../library/unittest.mock.rst:2126 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." @@ -2745,7 +2785,7 @@ msgstr "" "新增對於 ``__aenter__``、``__aexit__``、``__aiter__`` 和 ``__anext__`` 的支" "援。" -#: ../../library/unittest.mock.rst:2107 +#: ../../library/unittest.mock.rst:2130 msgid "" "The following methods exist but are *not* supported as they are either in " "use by mock, can't be set dynamically, or can cause problems:" @@ -2753,21 +2793,21 @@ msgstr "" "以下方法存在,但「不」被支援,因為它們在被 mock 使用時,會無法動態設定,或可" "能導致問題:" -#: ../../library/unittest.mock.rst:2110 +#: ../../library/unittest.mock.rst:2133 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" msgstr "``__getattr__``、``__setattr__``、``__init__`` 和 ``__new__``" -#: ../../library/unittest.mock.rst:2111 +#: ../../library/unittest.mock.rst:2134 msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" "``__prepare__``、``__instancecheck__``、``__subclasscheck__``、``__del__``" -#: ../../library/unittest.mock.rst:2116 +#: ../../library/unittest.mock.rst:2139 msgid "Magic Mock" msgstr "Magic Mock" -#: ../../library/unittest.mock.rst:2118 +#: ../../library/unittest.mock.rst:2141 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." @@ -2775,7 +2815,7 @@ msgstr "" "``MagicMock`` 有兩個變體::class:`MagicMock` 和 :class:" "`NonCallableMagicMock`。" -#: ../../library/unittest.mock.rst:2123 +#: ../../library/unittest.mock.rst:2146 msgid "" "``MagicMock`` is a subclass of :class:`Mock` with default implementations of " "most of the :term:`magic methods <magic method>`. You can use ``MagicMock`` " @@ -2784,11 +2824,11 @@ msgstr "" "``MagicMock`` 是 :class:`Mock` 的子類別,其預設具有大多數\\ :term:`魔術方法 " "<magic method>`\\ 的實作。你可以使用 ``MagicMock``,而無需自行配置魔術方法。" -#: ../../library/unittest.mock.rst:2127 +#: ../../library/unittest.mock.rst:2150 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "建構函式參數的意義與 :class:`Mock` 中的參數相同。" -#: ../../library/unittest.mock.rst:2129 +#: ../../library/unittest.mock.rst:2152 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." @@ -2796,11 +2836,11 @@ msgstr "" "如果你使用 *spec* 或 *spec_set* 引數,那麼\\ *只有*\\ 規格中存在的魔術方法會" "被建立。" -#: ../../library/unittest.mock.rst:2135 +#: ../../library/unittest.mock.rst:2158 msgid "A non-callable version of :class:`MagicMock`." msgstr ":class:`MagicMock` 的不可呼叫版本。" -#: ../../library/unittest.mock.rst:2137 +#: ../../library/unittest.mock.rst:2160 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " "with the exception of *return_value* and *side_effect* which have no meaning " @@ -2809,7 +2849,7 @@ msgstr "" "建構函式參數的意義與 :class:`MagicMock` 中的參數相同,但 *return_value* 和 " "*side_effect* 除外,它們對不可呼叫的 mock 來說沒有任何意義。" -#: ../../library/unittest.mock.rst:2141 +#: ../../library/unittest.mock.rst:2164 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" @@ -2817,7 +2857,7 @@ msgstr "" "魔術方法是使用 :class:`MagicMock` 物件設定的,因此你可以配置它們並以一般的方" "法來使用它們:" -#: ../../library/unittest.mock.rst:2151 +#: ../../library/unittest.mock.rst:2174 msgid "" "By default many of the protocol methods are required to return objects of a " "specific type. These methods are preconfigured with a default return value, " @@ -2829,83 +2869,83 @@ msgstr "" "值,因此如果你對回傳值不感興趣,則無需執行任何操作即可使用它們。如果你想更改" "預設值,你仍然可以手動\\ *設定*\\ 回傳值。" -#: ../../library/unittest.mock.rst:2157 +#: ../../library/unittest.mock.rst:2180 msgid "Methods and their defaults:" msgstr "方法及其預設值:" -#: ../../library/unittest.mock.rst:2159 +#: ../../library/unittest.mock.rst:2182 msgid "``__lt__``: :data:`NotImplemented`" msgstr "``__lt__``::data:`NotImplemented`" -#: ../../library/unittest.mock.rst:2160 +#: ../../library/unittest.mock.rst:2183 msgid "``__gt__``: :data:`!NotImplemented`" msgstr "``__gt__``::data:`!NotImplemented`" -#: ../../library/unittest.mock.rst:2161 +#: ../../library/unittest.mock.rst:2184 msgid "``__le__``: :data:`!NotImplemented`" msgstr "``__le__``::data:`!NotImplemented`" -#: ../../library/unittest.mock.rst:2162 +#: ../../library/unittest.mock.rst:2185 msgid "``__ge__``: :data:`!NotImplemented`" msgstr "``__ge__``::data:`!NotImplemented`" -#: ../../library/unittest.mock.rst:2163 +#: ../../library/unittest.mock.rst:2186 msgid "``__int__``: ``1``" msgstr "``__int__``:``1``" -#: ../../library/unittest.mock.rst:2164 +#: ../../library/unittest.mock.rst:2187 msgid "``__contains__``: ``False``" msgstr "``__contains__``:``False``" -#: ../../library/unittest.mock.rst:2165 +#: ../../library/unittest.mock.rst:2188 msgid "``__len__``: ``0``" msgstr "``__len__``:``0``" -#: ../../library/unittest.mock.rst:2166 +#: ../../library/unittest.mock.rst:2189 msgid "``__iter__``: ``iter([])``" msgstr "``__iter__``:``iter([])``" -#: ../../library/unittest.mock.rst:2167 +#: ../../library/unittest.mock.rst:2190 msgid "``__exit__``: ``False``" msgstr "``__exit__``:``False``" -#: ../../library/unittest.mock.rst:2168 +#: ../../library/unittest.mock.rst:2191 msgid "``__aexit__``: ``False``" msgstr "``__aexit__``:``False``" -#: ../../library/unittest.mock.rst:2169 +#: ../../library/unittest.mock.rst:2192 msgid "``__complex__``: ``1j``" msgstr "``__complex__``:``1j``" -#: ../../library/unittest.mock.rst:2170 +#: ../../library/unittest.mock.rst:2193 msgid "``__float__``: ``1.0``" msgstr "``__float__``:``1.0``" -#: ../../library/unittest.mock.rst:2171 +#: ../../library/unittest.mock.rst:2194 msgid "``__bool__``: ``True``" msgstr "``__bool__``:``True``" -#: ../../library/unittest.mock.rst:2172 +#: ../../library/unittest.mock.rst:2195 msgid "``__index__``: ``1``" msgstr "``__index__``:``1``" -#: ../../library/unittest.mock.rst:2173 +#: ../../library/unittest.mock.rst:2196 msgid "``__hash__``: default hash for the mock" msgstr "``__hash__``:mock 的預設雜湊" -#: ../../library/unittest.mock.rst:2174 +#: ../../library/unittest.mock.rst:2197 msgid "``__str__``: default str for the mock" msgstr "``__str__``:mock 的預設字串" -#: ../../library/unittest.mock.rst:2175 +#: ../../library/unittest.mock.rst:2198 msgid "``__sizeof__``: default sizeof for the mock" msgstr "``__sizeof__``:mock 的預設 sizeof" -#: ../../library/unittest.mock.rst:2177 +#: ../../library/unittest.mock.rst:2200 msgid "For example:" msgstr "舉例來說:" -#: ../../library/unittest.mock.rst:2189 +#: ../../library/unittest.mock.rst:2212 msgid "" "The two equality methods, :meth:`!__eq__` and :meth:`!__ne__`, are special. " "They do the default equality comparison on identity, using the :attr:`~Mock." @@ -2916,7 +2956,7 @@ msgstr "" "`~Mock.side_effect` 屬性對識別性 (identity) 進行預設的相等比較,除非你變更它" "們的回傳值以回傳其他內容: ::" -#: ../../library/unittest.mock.rst:2194 +#: ../../library/unittest.mock.rst:2217 msgid "" ">>> MagicMock() == 3\n" "False\n" @@ -2936,14 +2976,14 @@ msgstr "" ">>> mock == 3\n" "True" -#: ../../library/unittest.mock.rst:2203 +#: ../../library/unittest.mock.rst:2226 msgid "" "The return value of :meth:`MagicMock.__iter__` can be any iterable object " "and isn't required to be an iterator:" msgstr "" ":meth:`MagicMock.__iter__` 的回傳值可以是任何可疊代物件,且不需是一個疊代器:" -#: ../../library/unittest.mock.rst:2213 +#: ../../library/unittest.mock.rst:2236 msgid "" "If the return value *is* an iterator, then iterating over it once will " "consume it and subsequent iterations will result in an empty list:" @@ -2951,7 +2991,7 @@ msgstr "" "如果回傳值\\ *是*\\ 一個疊代器,那麼對其進行一次疊代將消耗它,並且後續疊代將" "產生一個空串列:" -#: ../../library/unittest.mock.rst:2222 +#: ../../library/unittest.mock.rst:2245 msgid "" "``MagicMock`` has all of the supported magic methods configured except for " "some of the obscure and obsolete ones. You can still set these up if you " @@ -2960,33 +3000,33 @@ msgstr "" "``MagicMock`` 配置了所有支援的魔術方法,除了一些少見和過時的方法。如果你想" "要,你仍然可以設定這些魔術方法。" -#: ../../library/unittest.mock.rst:2225 +#: ../../library/unittest.mock.rst:2248 msgid "" "Magic methods that are supported but not setup by default in ``MagicMock`` " "are:" msgstr "``MagicMock`` 中支援但預設未設置的魔術方法包含:" -#: ../../library/unittest.mock.rst:2227 +#: ../../library/unittest.mock.rst:2250 msgid "``__subclasses__``" msgstr "``__subclasses__``" -#: ../../library/unittest.mock.rst:2228 +#: ../../library/unittest.mock.rst:2251 msgid "``__dir__``" msgstr "``__dir__``" -#: ../../library/unittest.mock.rst:2229 +#: ../../library/unittest.mock.rst:2252 msgid "``__format__``" msgstr "``__format__``" -#: ../../library/unittest.mock.rst:2230 +#: ../../library/unittest.mock.rst:2253 msgid "``__get__``, ``__set__`` and ``__delete__``" msgstr "``__get__``、``__set__`` 和 ``__delete__``" -#: ../../library/unittest.mock.rst:2231 +#: ../../library/unittest.mock.rst:2254 msgid "``__reversed__`` and ``__missing__``" msgstr "``__reversed__`` 和 ``__missing__``" -#: ../../library/unittest.mock.rst:2232 +#: ../../library/unittest.mock.rst:2255 msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" @@ -2994,11 +3034,11 @@ msgstr "" "``__reduce__``、``__reduce_ex__``、``__getinitargs__``、``__getnewargs__``、" "``__getstate__`` 和 ``__setstate__``" -#: ../../library/unittest.mock.rst:2234 +#: ../../library/unittest.mock.rst:2257 msgid "``__getformat__``" msgstr "``__getformat__``" -#: ../../library/unittest.mock.rst:2238 +#: ../../library/unittest.mock.rst:2261 msgid "" "Magic methods *should* be looked up on the class rather than the instance. " "Different versions of Python are inconsistent about applying this rule. The " @@ -3007,27 +3047,27 @@ msgstr "" "魔術方法\\ *應該*\\ 在類別而不是實例上被查找。不同版本的 Python 對於這條規則" "的適用並不一致。支援的協定方法應適用於所有支援的 Python 版本。" -#: ../../library/unittest.mock.rst:2242 +#: ../../library/unittest.mock.rst:2265 msgid "" "The function is basically hooked up to the class, but each ``Mock`` instance " "is kept isolated from the others." msgstr "該函式基本上與類別掛鉤,但每個 ``Mock`` 實例都與其他實例保持隔離。" -#: ../../library/unittest.mock.rst:2247 +#: ../../library/unittest.mock.rst:2270 msgid "Helpers" msgstr "輔助函式" -#: ../../library/unittest.mock.rst:2250 +#: ../../library/unittest.mock.rst:2273 msgid "sentinel" msgstr "sentinel(哨兵)" -#: ../../library/unittest.mock.rst:2254 +#: ../../library/unittest.mock.rst:2277 msgid "" "The ``sentinel`` object provides a convenient way of providing unique " "objects for your tests." msgstr "``哨兵``\\ 物件提供了一種為你的測試提供獨特物件的便利方式。" -#: ../../library/unittest.mock.rst:2257 +#: ../../library/unittest.mock.rst:2280 msgid "" "Attributes are created on demand when you access them by name. Accessing the " "same attribute will always return the same object. The objects returned have " @@ -3036,7 +3076,7 @@ msgstr "" "當你使用名稱存取屬性時,屬性會根據需要被建立。存取相同的屬性將始終回傳相同的" "物件。回傳的物件會具有合適的 repr,讓測試失敗的訊息是可閱讀的。" -#: ../../library/unittest.mock.rst:2261 +#: ../../library/unittest.mock.rst:2284 msgid "" "The ``sentinel`` attributes now preserve their identity when they are :mod:" "`copied <copy>` or :mod:`pickled <pickle>`." @@ -3044,7 +3084,7 @@ msgstr "" "``哨兵``\\ 屬性現在當被\\ :mod:`複製 <copy>`\\ 或\\ :mod:`序列化 <pickle>`\\ " "時會保留其識別性。" -#: ../../library/unittest.mock.rst:2265 +#: ../../library/unittest.mock.rst:2288 msgid "" "Sometimes when testing you need to test that a specific object is passed as " "an argument to another method, or returned. It can be common to create named " @@ -3055,18 +3095,18 @@ msgstr "" "名的哨兵物件來測試這一點是常見的。:data:`sentinel` 提供了一種此類建立和測試物" "件識別性的便利方式。" -#: ../../library/unittest.mock.rst:2270 +#: ../../library/unittest.mock.rst:2293 msgid "" "In this example we monkey patch ``method`` to return ``sentinel." "some_object``:" msgstr "" "在這個例子中,我們 monkey patch ``method`` 以回傳 ``sentinel.some_object``:" -#: ../../library/unittest.mock.rst:2282 +#: ../../library/unittest.mock.rst:2305 msgid "DEFAULT" msgstr "DEFAULT" -#: ../../library/unittest.mock.rst:2287 +#: ../../library/unittest.mock.rst:2310 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." "DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " @@ -3076,11 +3116,11 @@ msgstr "" "DEFAULT``\\ )。它可以被 :attr:`~Mock.side_effect` 函式使用來表示正常的回傳值" "應該被使用。" -#: ../../library/unittest.mock.rst:2293 +#: ../../library/unittest.mock.rst:2316 msgid "call" msgstr "call" -#: ../../library/unittest.mock.rst:2297 +#: ../../library/unittest.mock.rst:2320 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." @@ -3092,7 +3132,7 @@ msgstr "" "簡單的斷言的輔助物件。:func:`call` 也可以與 :meth:`~Mock.assert_has_calls` 一" "起使用。" -#: ../../library/unittest.mock.rst:2310 +#: ../../library/unittest.mock.rst:2333 msgid "" "For a call object that represents multiple calls, :meth:`call_list` returns " "a list of all the intermediate calls as well as the final call." @@ -3100,7 +3140,7 @@ msgstr "" "對於表示多個呼叫的 call 物件,:meth:`call_list` 回傳所有中間呼叫以及最終呼叫" "的串列。" -#: ../../library/unittest.mock.rst:2314 +#: ../../library/unittest.mock.rst:2337 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 " @@ -3111,13 +3151,13 @@ msgstr "" "在單行程式碼進行的多次呼叫。這會導致 mock 上的 :attr:`~Mock.mock_calls` 中出" "現多個項目。手動建構呼叫序列會相當單調乏味。" -#: ../../library/unittest.mock.rst:2319 +#: ../../library/unittest.mock.rst:2342 msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr ":meth:`~call.call_list` 可以從同一個鍊接呼叫建構呼叫序列:" -#: ../../library/unittest.mock.rst:2336 +#: ../../library/unittest.mock.rst:2359 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " @@ -3131,7 +3171,7 @@ msgstr "" "趣,但是 :attr:`Mock.call_args`、:attr:`Mock.call_args_list` 和 :attr:`Mock." "mock_calls` 屬性中的 ``call`` 物件可以被內省以取得它們包含的各個引數。" -#: ../../library/unittest.mock.rst:2343 +#: ../../library/unittest.mock.rst:2366 msgid "" "The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." "call_args_list` are two-tuples of (positional args, keyword args) whereas " @@ -3143,7 +3183,7 @@ msgstr "" "(位置引數, 關鍵字引數)的二元組,而 :attr:`Mock.mock_calls` 中的 ``call`` 物" "件以及你自己建立的 ``call`` 物件是(名稱, 位置引數, 關鍵字引數)的三元組。" -#: ../../library/unittest.mock.rst:2348 +#: ../../library/unittest.mock.rst:2371 msgid "" "You can use their \"tupleness\" to pull out the individual arguments for " "more complex introspection and assertions. The positional arguments are a " @@ -3153,11 +3193,11 @@ msgstr "" "你可以利用它們作為元組的特性來提取單個引數,以進行更複雜的內省和斷言。位置引" "數是一個元組(如果沒有位置引數則為空元組),關鍵字引數是一個字典:" -#: ../../library/unittest.mock.rst:2381 +#: ../../library/unittest.mock.rst:2404 msgid "create_autospec" msgstr "create_autospec" -#: ../../library/unittest.mock.rst:2385 +#: ../../library/unittest.mock.rst:2408 msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." @@ -3165,13 +3205,13 @@ msgstr "" "使用另一個物件作為規格建立一個 mock 物件。Mock 上的屬性將使用 *spec* 物件上的" "對應屬性作為其規格。" -#: ../../library/unittest.mock.rst:2389 +#: ../../library/unittest.mock.rst:2412 msgid "" "Functions or methods being mocked will have their arguments checked to " "ensure that they are called with the correct signature." msgstr "被 mock 的函式或方法將檢查其引數,以確保他們被使用正確的簽名來呼叫。" -#: ../../library/unittest.mock.rst:2392 +#: ../../library/unittest.mock.rst:2415 msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." @@ -3179,7 +3219,7 @@ msgstr "" "如果 *spec_set* 為 ``True``,則嘗試設定規格物件上不存在的屬性將引發 :exc:" "`AttributeError`。" -#: ../../library/unittest.mock.rst:2395 +#: ../../library/unittest.mock.rst:2418 msgid "" "If a class is used as a spec then the return value of the mock (the instance " "of the class) will have the same spec. You can use a class as the spec for " @@ -3190,7 +3230,7 @@ msgstr "" "可以透過傳遞 ``instance=True`` 來使用一個類別作為一個實例物件的規格。只有當 " "mock 的實例是可呼叫物件時,回傳的 mock 才會是可呼叫物件。" -#: ../../library/unittest.mock.rst:2400 +#: ../../library/unittest.mock.rst:2423 msgid "" ":func:`create_autospec` also takes arbitrary keyword arguments that are " "passed to the constructor of the created mock." @@ -3198,7 +3238,7 @@ msgstr "" ":func:`create_autospec` 也接受任意的關鍵字引數,這些引數會傳遞給已建立的 " "mock 的建構函式。" -#: ../../library/unittest.mock.rst:2403 +#: ../../library/unittest.mock.rst:2426 msgid "" "See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" "`create_autospec` and the *autospec* argument to :func:`patch`." @@ -3206,7 +3246,7 @@ msgstr "" "請參閱 :ref:`auto-speccing` 以得知如何以 :func:`create_autospec` 使用自動規格" "以及如何在 :func:`patch` 中使用 *autospec* 引數的範例。" -#: ../../library/unittest.mock.rst:2409 +#: ../../library/unittest.mock.rst:2432 msgid "" ":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " "an async function." @@ -3214,11 +3254,11 @@ msgstr "" "如果目標是一個非同步函式,:func:`create_autospec` 現在會回傳一個 :class:" "`AsyncMock`。" -#: ../../library/unittest.mock.rst:2414 +#: ../../library/unittest.mock.rst:2437 msgid "ANY" msgstr "ANY" -#: ../../library/unittest.mock.rst:2418 +#: ../../library/unittest.mock.rst:2441 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " "call to mock, but either not care about some of the arguments or want to " @@ -3228,7 +3268,7 @@ msgstr "" "有時你可能需要對 mock 的呼叫中的\\ *某些*\\ 引數進行斷言,但你不在意其他的某" "些引數,或想將它們單獨從 :attr:`~Mock.call_args` 中取出並進行更加複雜的斷言。" -#: ../../library/unittest.mock.rst:2423 +#: ../../library/unittest.mock.rst:2446 msgid "" "To ignore certain arguments you can pass in objects that compare equal to " "*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." @@ -3238,20 +3278,20 @@ msgstr "" "麼內容,對 :meth:`~Mock.assert_used_with` 和 :meth:`~Mock." "assert_used_once_with` 的呼叫都會成功。" -#: ../../library/unittest.mock.rst:2432 +#: ../../library/unittest.mock.rst:2455 msgid "" ":data:`ANY` can also be used in comparisons with call lists like :attr:" "`~Mock.mock_calls`:" msgstr "" ":data:`ANY` 也可以用來與呼叫串列進行比較,例如 :attr:`~Mock.mock_calls`:" -#: ../../library/unittest.mock.rst:2442 +#: ../../library/unittest.mock.rst:2465 msgid "" ":data:`ANY` is not limited to comparisons with call objects and so can also " "be used in test assertions::" msgstr ":data:`ANY` 不只能與呼叫物件比較,其也可以在測試斷言中使用: ::" -#: ../../library/unittest.mock.rst:2445 +#: ../../library/unittest.mock.rst:2468 msgid "" "class TestStringMethods(unittest.TestCase):\n" "\n" @@ -3265,11 +3305,11 @@ msgstr "" " s = 'hello world'\n" " self.assertEqual(s.split(), ['hello', ANY])" -#: ../../library/unittest.mock.rst:2453 +#: ../../library/unittest.mock.rst:2476 msgid "FILTER_DIR" msgstr "FILTER_DIR" -#: ../../library/unittest.mock.rst:2457 +#: ../../library/unittest.mock.rst:2480 msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir`. The default is ``True``, which uses the " @@ -3282,7 +3322,7 @@ msgstr "" "你不喜歡這個過濾方式,或由於診斷意圖而需要將其關閉,請設定 ``mock.FILTER_DIR " "= False``。" -#: ../../library/unittest.mock.rst:2463 +#: ../../library/unittest.mock.rst:2486 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " "include any dynamically created attributes that wouldn't normally be shown. " @@ -3294,7 +3334,7 @@ msgstr "" "的任何動態建立的屬性。如果 mock 是使用 *spec*\\ (或 *autospec*\\ )來建立" "的,那麼源頭的所有屬性都會顯示,即使它們尚未被存取:" -#: ../../library/unittest.mock.rst:2469 +#: ../../library/unittest.mock.rst:2492 msgid "" ">>> dir(Mock())\n" "['assert_any_call',\n" @@ -3332,7 +3372,7 @@ msgstr "" " 'BaseHandler',\n" " ..." -#: ../../library/unittest.mock.rst:2490 +#: ../../library/unittest.mock.rst:2513 msgid "" "Many of the not-very-useful (private to :class:`Mock` rather than the thing " "being mocked) underscore and double underscore prefixed attributes have been " @@ -3344,7 +3384,7 @@ msgstr "" "雙底線前綴屬性已從在 :class:`Mock` 上呼叫 :func:`dir` 的結果中濾除。如果你不" "喜歡這種特性,可以透過設定模組級別開關 :data:`FILTER_DIR` 來將其關閉:" -#: ../../library/unittest.mock.rst:2496 +#: ../../library/unittest.mock.rst:2519 msgid "" ">>> from unittest import mock\n" ">>> mock.FILTER_DIR = False\n" @@ -3370,7 +3410,7 @@ msgstr "" " '__class__',\n" " ..." -#: ../../library/unittest.mock.rst:2511 +#: ../../library/unittest.mock.rst:2534 #, fuzzy msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " @@ -3381,11 +3421,11 @@ msgstr "" "``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考慮 :const:`mock." "FILTER_DIR`。" -#: ../../library/unittest.mock.rst:2517 +#: ../../library/unittest.mock.rst:2540 msgid "mock_open" msgstr "mock_open" -#: ../../library/unittest.mock.rst:2521 +#: ../../library/unittest.mock.rst:2544 msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." @@ -3393,7 +3433,7 @@ msgstr "" "用於建立取代 :func:`open` 用途的 mock 的輔助函式。它適用於直接呼叫或用作情境" "管理器的 :func:`open`。" -#: ../../library/unittest.mock.rst:2524 +#: ../../library/unittest.mock.rst:2547 msgid "" "The *mock* argument is the mock object to configure. If ``None`` (the " "default) then a :class:`MagicMock` will be created for you, with the API " @@ -3402,7 +3442,7 @@ msgstr "" "*mock* 引數是要配置的 mock 物件。如果其為 ``None``\\ (預設值),那麼就會為你" "建立一個 :class:`MagicMock`,其 API 限制在標準檔案處理上可用的方法或屬性。" -#: ../../library/unittest.mock.rst:2528 +#: ../../library/unittest.mock.rst:2551 #, fuzzy msgid "" "*read_data* is a string for the :meth:`~io.RawIOBase.read`, :meth:`~io." @@ -3423,7 +3463,7 @@ msgstr "" "org>`_ 上的其中一個記憶體內檔案系統 (in-memory filesystem) 套件可以提供用於測" "試的真實檔案系統。" -#: ../../library/unittest.mock.rst:2538 +#: ../../library/unittest.mock.rst:2561 #, fuzzy msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " @@ -3434,11 +3474,11 @@ msgstr "" "meth:`~io.IOBase.read` 的 mock 更改為消耗 *read_data* 而不是在每次呼叫時回傳" "它。" -#: ../../library/unittest.mock.rst:2543 +#: ../../library/unittest.mock.rst:2566 msgid "*read_data* is now reset on each call to the *mock*." msgstr "現在,每次呼叫 *mock* 時都會重置 *read_data*。" -#: ../../library/unittest.mock.rst:2546 +#: ../../library/unittest.mock.rst:2569 msgid "" "Added :meth:`~container.__iter__` to implementation so that iteration (such " "as in for loops) correctly consumes *read_data*." @@ -3446,7 +3486,7 @@ msgstr "" "新增 :meth:`~container.__iter__` 到實作中,以便使疊代(例如在 for 迴圈中)正" "確地消耗 *read_data*。" -#: ../../library/unittest.mock.rst:2550 +#: ../../library/unittest.mock.rst:2573 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" @@ -3454,7 +3494,7 @@ msgstr "" "使用 :func:`open` 作為情境管理器是確保檔案處理正確關閉的好方式,且這種方式正" "在變得普遍: ::" -#: ../../library/unittest.mock.rst:2553 +#: ../../library/unittest.mock.rst:2576 msgid "" "with open('/some/path', 'w') as f:\n" " f.write('something')" @@ -3462,7 +3502,7 @@ msgstr "" "with open('/some/path', 'w') as f:\n" " f.write('something')" -#: ../../library/unittest.mock.rst:2556 +#: ../../library/unittest.mock.rst:2579 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " "*returned object* that is used as a context manager (and has :meth:`~object." @@ -3472,7 +3512,7 @@ msgstr "" "回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~ object.__exit__` 已" "被呼叫)。" -#: ../../library/unittest.mock.rst:2560 +#: ../../library/unittest.mock.rst:2583 msgid "" "Mocking context managers with a :class:`MagicMock` is common enough and " "fiddly enough that a helper function is useful. ::" @@ -3480,7 +3520,7 @@ msgstr "" "使用 :class:`MagicMock` mock 情境管理器相當常見並且精細,因此輔助函式就非常有" "用: ::" -#: ../../library/unittest.mock.rst:2563 +#: ../../library/unittest.mock.rst:2586 msgid "" ">>> m = mock_open()\n" ">>> with patch('__main__.open', m):\n" @@ -3510,11 +3550,11 @@ msgstr "" ">>> handle = m()\n" ">>> handle.write.assert_called_once_with('some stuff')" -#: ../../library/unittest.mock.rst:2577 +#: ../../library/unittest.mock.rst:2600 msgid "And for reading files::" msgstr "以及讀取檔案: ::" -#: ../../library/unittest.mock.rst:2579 +#: ../../library/unittest.mock.rst:2602 msgid "" ">>> with patch('__main__.open', mock_open(read_data='bibble')) as m:\n" "... with open('foo') as h:\n" @@ -3530,11 +3570,11 @@ msgstr "" ">>> m.assert_called_once_with('foo')\n" ">>> assert result == 'bibble'" -#: ../../library/unittest.mock.rst:2590 +#: ../../library/unittest.mock.rst:2613 msgid "Autospeccing" msgstr "Autospeccing(自動規格)" -#: ../../library/unittest.mock.rst:2592 +#: ../../library/unittest.mock.rst:2615 #, fuzzy msgid "" "Autospeccing is based on the existing :attr:`!spec` feature of mock. It " @@ -3549,11 +3589,11 @@ msgstr "" "有與規格的屬性相同的 api。此外,被 mock 的函式/方法具有與原始的函式/方法相同" "的呼叫簽名,因此如果它們被不正確地呼叫,就會引發 :exc:`TypeError`。" -#: ../../library/unittest.mock.rst:2599 +#: ../../library/unittest.mock.rst:2622 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "在解釋自動規格如何運作之前,我們先解釋為什麼需要它。" -#: ../../library/unittest.mock.rst:2601 +#: ../../library/unittest.mock.rst:2624 msgid "" ":class:`Mock` is a very powerful and flexible object, but it suffers from a " "flaw which is general to mocking. If you refactor some of your code, rename " @@ -3566,7 +3606,7 @@ msgstr "" "實物件的程式碼測試仍然會通過。這意味著即使你的程式碼壞了,但測試仍可以全部通" "過。" -#: ../../library/unittest.mock.rst:2609 +#: ../../library/unittest.mock.rst:2632 msgid "" "Before 3.5, tests with a typo in the word assert would silently pass when " "they should raise an error. You can still achieve this behavior by passing " @@ -3575,7 +3615,7 @@ msgstr "" "在 3.5 之前,當測試應該引發錯誤時,斷言單字中存在拼字錯誤的測驗會默默地通過。" "你仍可以透過將 ``unsafe=True`` 傳遞給 Mock 來實作此行為。" -#: ../../library/unittest.mock.rst:2612 +#: ../../library/unittest.mock.rst:2635 msgid "" "Note that this is another reason why you need integration tests as well as " "unit tests. Testing everything in isolation is all fine and dandy, but if " @@ -3585,7 +3625,7 @@ msgstr "" "謹記這是你需要有整合測試和單元測試的另一個原因。單獨測試所有內容都很好,但如" "果你不測試你的單元是如何「連接在一起」的,那麼測試還是有機會發現很多錯誤。" -#: ../../library/unittest.mock.rst:2617 +#: ../../library/unittest.mock.rst:2640 #, fuzzy msgid "" ":mod:`unittest.mock` already provides a feature to help with this, called " @@ -3596,13 +3636,13 @@ msgstr "" "類別或實例作為 mock 的 :attr:`spec`,那麼你在 mock 上只能存取真實類別中存在的" "屬性:" -#: ../../library/unittest.mock.rst:2628 +#: ../../library/unittest.mock.rst:2651 msgid "" "The spec only applies to the mock itself, so we still have the same issue " "with any methods on the mock:" msgstr "該規格僅適用於 mock 本身,因此在 mock 上的任何方法仍然有相同的問題:" -#: ../../library/unittest.mock.rst:2631 +#: ../../library/unittest.mock.rst:2654 msgid "" ">>> mock.has_data()\n" "<mock.Mock object at 0x...>\n" @@ -3612,7 +3652,7 @@ msgstr "" "<mock.Mock object at 0x...>\n" ">>> mock.has_data.assret_called_with() # 故意的錯字!" -#: ../../library/unittest.mock.rst:2637 +#: ../../library/unittest.mock.rst:2660 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " @@ -3630,11 +3670,11 @@ msgstr "" "的),所以你可以將它與非常複雜或深度巢狀使用的物件(例如連續引用的模組)一起" "使用,而不會過於影響性能。" -#: ../../library/unittest.mock.rst:2646 +#: ../../library/unittest.mock.rst:2669 msgid "Here's an example of it in use::" msgstr "這是一個正在使用的例子: ::" -#: ../../library/unittest.mock.rst:2648 +#: ../../library/unittest.mock.rst:2671 msgid "" ">>> from urllib import request\n" ">>> patcher = patch('__main__.request', autospec=True)\n" @@ -3652,7 +3692,7 @@ msgstr "" ">>> mock_request.Request\n" "<MagicMock name='request.Request' spec='Request' id='...'>" -#: ../../library/unittest.mock.rst:2656 +#: ../../library/unittest.mock.rst:2679 #, fuzzy msgid "" "You can see that :class:`!request.Request` has a spec. :class:`!request." @@ -3663,7 +3703,7 @@ msgstr "" "構函式中接受兩個引數(其中之一是 *self*\\ )。如果我們錯誤地呼叫它,會發生以" "下情況: ::" -#: ../../library/unittest.mock.rst:2660 +#: ../../library/unittest.mock.rst:2683 msgid "" ">>> req = request.Request()\n" "Traceback (most recent call last):\n" @@ -3675,13 +3715,13 @@ msgstr "" " ...\n" "TypeError: <lambda>() takes at least 2 arguments (1 given)" -#: ../../library/unittest.mock.rst:2665 +#: ../../library/unittest.mock.rst:2688 msgid "" "The spec also applies to instantiated classes (i.e. the return value of " "specced mocks)::" msgstr "此規格也適用於實例化的類別(即有規格的 mock 的回傳值): ::" -#: ../../library/unittest.mock.rst:2668 +#: ../../library/unittest.mock.rst:2691 msgid "" ">>> req = request.Request('foo')\n" ">>> req\n" @@ -3691,7 +3731,7 @@ msgstr "" ">>> req\n" "<NonCallableMagicMock name='request.Request()' spec='Request' id='...'>" -#: ../../library/unittest.mock.rst:2672 +#: ../../library/unittest.mock.rst:2695 #, fuzzy msgid "" ":class:`!Request` objects are not callable, so the return value of " @@ -3703,7 +3743,7 @@ msgstr "" "`request.Request` 的回傳值是不可呼叫的 mock。規格到位後,斷言中的任何拼字錯誤" "都會引發正確的錯誤: ::" -#: ../../library/unittest.mock.rst:2676 +#: ../../library/unittest.mock.rst:2699 msgid "" ">>> req.add_header('spam', 'eggs')\n" "<MagicMock name='request.Request().add_header()' id='...'>\n" @@ -3721,7 +3761,7 @@ msgstr "" "AttributeError: Mock object has no attribute 'assret_called_with'\n" ">>> req.add_header.assert_called_with('spam', 'eggs')" -#: ../../library/unittest.mock.rst:2684 +#: ../../library/unittest.mock.rst:2707 msgid "" "In many cases you will just be able to add ``autospec=True`` to your " "existing :func:`patch` calls and then be protected against bugs due to typos " @@ -3730,7 +3770,7 @@ msgstr "" "在許多情況下,你只需要將 ``autospec=True`` 新增至現有的 :func:`patch` 呼叫" "中,然後就可以防止因拼字錯誤和 api 變更而導致的錯誤。" -#: ../../library/unittest.mock.rst:2688 +#: ../../library/unittest.mock.rst:2711 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" @@ -3738,7 +3778,7 @@ msgstr "" "除了透過 :func:`patch` 使用 *autospec* 之外,還有一個 :func:" "`create_autospec` 用於直接建立有自動規格的 mock:" -#: ../../library/unittest.mock.rst:2696 +#: ../../library/unittest.mock.rst:2719 msgid "" "This isn't without caveats and limitations however, which is why it is not " "the default behaviour. In order to know what attributes are available on the " @@ -3755,7 +3795,7 @@ msgstr "" "描述器,那麼你可能無法使用 autospec。換句話說,設計你的物件讓內省是安全的 " "[#]_ 會比較好。" -#: ../../library/unittest.mock.rst:2705 +#: ../../library/unittest.mock.rst:2728 msgid "" "A more serious problem is that it is common for instance attributes to be " "created in the :meth:`~object.__init__` method and not to exist on the class " @@ -3766,7 +3806,7 @@ msgstr "" "而其根本不存在於類別中。*autospec* 無法知道任何動態建立的屬性,並將 api 限制" "為可見的屬性。: ::" -#: ../../library/unittest.mock.rst:2710 +#: ../../library/unittest.mock.rst:2733 msgid "" ">>> class Something:\n" "... def __init__(self):\n" @@ -3792,7 +3832,7 @@ msgstr "" " ...\n" "AttributeError: Mock object has no attribute 'a'" -#: ../../library/unittest.mock.rst:2722 +#: ../../library/unittest.mock.rst:2745 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -3804,7 +3844,7 @@ msgstr "" "在 mock 上設定所需的屬性。因為雖然 *autospec* 不允許你取得規格中不存在的屬" "性,但是它不會阻止你設定它們: ::" -#: ../../library/unittest.mock.rst:2728 +#: ../../library/unittest.mock.rst:2751 msgid "" ">>> with patch('__main__.Something', autospec=True):\n" "... thing = Something()\n" @@ -3816,7 +3856,7 @@ msgstr "" "... thing.a = 33\n" "..." -#: ../../library/unittest.mock.rst:2733 +#: ../../library/unittest.mock.rst:2756 msgid "" "There is a more aggressive version of both *spec* and *autospec* that *does* " "prevent you setting non-existent attributes. This is useful if you want to " @@ -3827,7 +3867,7 @@ msgstr "" "屬性。如果你想確保你的程式碼僅能\\ *設定*\\ 有效的屬性,那麼這會很有用,但顯" "然它也順便阻止了這個特殊情況:" -#: ../../library/unittest.mock.rst:2746 +#: ../../library/unittest.mock.rst:2769 msgid "" "Probably the best way of solving the problem is to add class attributes as " "default values for instance members initialised in :meth:`~object.__init__`. " @@ -3839,7 +3879,7 @@ msgstr "" "的實例成員的預設值。請注意,如果你僅在 :meth:`!__init__` 中設定預設屬性,那麼" "透過類別屬性(當然在實例之間共用)提供它們也會更快。例如:" -#: ../../library/unittest.mock.rst:2752 +#: ../../library/unittest.mock.rst:2775 msgid "" "class Something:\n" " a = 33" @@ -3847,7 +3887,7 @@ msgstr "" "class Something:\n" " a = 33" -#: ../../library/unittest.mock.rst:2757 +#: ../../library/unittest.mock.rst:2780 msgid "" "This brings up another issue. It is relatively common to provide a default " "value of ``None`` for members that will later be an object of a different " @@ -3863,7 +3903,7 @@ msgstr "" "他型別的成員,因此自動規格不會對設定為 ``None`` 的成員使用規格。這些會只是普" "通的 mock(通常是 MagicMocks):" -#: ../../library/unittest.mock.rst:2772 +#: ../../library/unittest.mock.rst:2795 msgid "" "If modifying your production classes to add defaults isn't to your liking " "then there are more options. One of these is simply to use an instance as " @@ -3879,7 +3919,7 @@ msgstr "" "你使用替代物件作為規格。值得慶幸的是 :func:`patch` 支援這一點 - 你可以簡單地" "將替代物件作為 *autospec* 引數傳遞: ::" -#: ../../library/unittest.mock.rst:2780 +#: ../../library/unittest.mock.rst:2803 msgid "" ">>> class Something:\n" "... def __init__(self):\n" @@ -3905,7 +3945,7 @@ msgstr "" ">>> mock.a\n" "<NonCallableMagicMock name='Something.a' spec='int' id='...'>" -#: ../../library/unittest.mock.rst:2793 +#: ../../library/unittest.mock.rst:2816 msgid "" "This only applies to classes or already instantiated objects. Calling a " "mocked class to create a mock instance *does not* create a real instance. It " @@ -3914,11 +3954,11 @@ msgstr "" "這只適用於類別或已經實例化的物件。呼叫一個被 mock 的類別來建立一個 mock 實例" "\\ *不會*\\ 建立真的實例。它僅查找屬性及對 :func:`dir` 的呼叫。" -#: ../../library/unittest.mock.rst:2798 +#: ../../library/unittest.mock.rst:2821 msgid "Sealing mocks" msgstr "密封 mock" -#: ../../library/unittest.mock.rst:2807 +#: ../../library/unittest.mock.rst:2830 msgid "" "Seal will disable the automatic creation of mocks when accessing an " "attribute of the mock being sealed or any of its attributes that are already " @@ -3927,7 +3967,7 @@ msgstr "" "當存取被密封的 mock 的屬性或其任何已經遞迴 mock 的屬性時,seal 將停用 mock 的" "自動建立。" -#: ../../library/unittest.mock.rst:2810 +#: ../../library/unittest.mock.rst:2833 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it " "won't be considered in the sealing chain. This allows one to prevent seal " @@ -3936,7 +3976,7 @@ msgstr "" "如果將具有名稱或規格的 mock 實例指派給屬性,則不會出現在密封鏈中。這表示可藉" "由固定 mock 物件的一部分來防止密封。: ::" -#: ../../library/unittest.mock.rst:2814 +#: ../../library/unittest.mock.rst:2837 msgid "" ">>> mock = Mock()\n" ">>> mock.submock.attribute1 = 2\n" @@ -3954,30 +3994,30 @@ msgstr "" ">>> mock.submock.attribute2 # This will raise AttributeError.\n" ">>> mock.not_submock.attribute2 # This won't raise." -#: ../../library/unittest.mock.rst:2826 +#: ../../library/unittest.mock.rst:2849 #, fuzzy msgid "" "Order of precedence of :attr:`!side_effect`, :attr:`!return_value` and " "*wraps*" msgstr ":attr:`side_effect`、:attr:`return_value` 和 *wraps* 的優先順序" -#: ../../library/unittest.mock.rst:2828 +#: ../../library/unittest.mock.rst:2851 msgid "The order of their precedence is:" msgstr "它們的優先順序是:" -#: ../../library/unittest.mock.rst:2830 +#: ../../library/unittest.mock.rst:2853 msgid ":attr:`~Mock.side_effect`" msgstr ":attr:`~Mock.side_effect`" -#: ../../library/unittest.mock.rst:2831 +#: ../../library/unittest.mock.rst:2854 msgid ":attr:`~Mock.return_value`" msgstr ":attr:`~Mock.return_value`" -#: ../../library/unittest.mock.rst:2832 +#: ../../library/unittest.mock.rst:2855 msgid "*wraps*" msgstr "*wraps*" -#: ../../library/unittest.mock.rst:2834 +#: ../../library/unittest.mock.rst:2857 msgid "" "If all three are set, mock will return the value from :attr:`~Mock." "side_effect`, ignoring :attr:`~Mock.return_value` and the wrapped object " @@ -3989,7 +4029,7 @@ msgstr "" "略 :attr:`~Mock.return_value` 和被包裝物件。如果設定了任兩項,則優先順序較高" "的一項將回傳該值。無論先設定哪個順序,優先順序都保持不變。" -#: ../../library/unittest.mock.rst:2852 +#: ../../library/unittest.mock.rst:2875 msgid "" "As ``None`` is the default value of :attr:`~Mock.side_effect`, if you " "reassign its value back to ``None``, the order of precedence will be checked " @@ -4000,7 +4040,7 @@ msgstr "" "``None``,則會檢查 :attr:`~Mock.return_value` 和被包裝物件之間的優先順序,忽" "略 :attr:`~Mock.side_effect`。" -#: ../../library/unittest.mock.rst:2861 +#: ../../library/unittest.mock.rst:2884 msgid "" "If the value being returned by :attr:`~Mock.side_effect` is :data:`DEFAULT`, " "it is ignored and the order of precedence moves to the successor to obtain " @@ -4009,7 +4049,7 @@ msgstr "" "如果 :attr:`~Mock.side_effect` 回傳的值是 :data:`DEFAULT`,它將被忽略,並且優" "先順序被移動到後面一個以獲得要回傳的值。" -#: ../../library/unittest.mock.rst:2870 +#: ../../library/unittest.mock.rst:2893 msgid "" "When :class:`Mock` wraps an object, the default value of :attr:`~Mock." "return_value` will be :data:`DEFAULT`." @@ -4017,13 +4057,13 @@ msgstr "" "當 :class:`Mock` 包裝一個物件時,:attr:`~Mock.return_value` 的預設值將為 :" "data:`DEFAULT`。" -#: ../../library/unittest.mock.rst:2879 +#: ../../library/unittest.mock.rst:2902 msgid "" "The order of precedence will ignore this value and it will move to the last " "successor which is the wrapped object." msgstr "優先順序將忽略該值,並將移動到最後一個,即被包裝物件。" -#: ../../library/unittest.mock.rst:2882 +#: ../../library/unittest.mock.rst:2905 msgid "" "As the real call is being made to the wrapped object, creating an instance " "of this mock will return the real instance of the class. The positional " @@ -4032,7 +4072,7 @@ msgstr "" "當對被包裝物件進行真正的呼叫時,建立此 mock 的實例將回傳該類別的真實實例。必" "須傳遞被包裝物件所需的位置引數(如果存在)。" -#: ../../library/unittest.mock.rst:2900 +#: ../../library/unittest.mock.rst:2923 msgid "" "But if you assign ``None`` to it, this will not be ignored as it is an " "explicit assignment. So, the order of precedence will not move to the " @@ -4041,13 +4081,13 @@ msgstr "" "但如果你為其賦予 ``None`` 則不會被忽略,因為它是明確賦值。因此,優先順序不會" "移至被包裝物件。" -#: ../../library/unittest.mock.rst:2908 +#: ../../library/unittest.mock.rst:2931 msgid "" "Even if you set all three at once when initializing the mock, the order of " "precedence remains the same:" msgstr "即使你在初始化 mock 時同時設定所有三個,優先順序也保持不變:" -#: ../../library/unittest.mock.rst:2925 +#: ../../library/unittest.mock.rst:2948 msgid "" "If :attr:`~Mock.side_effect` is exhausted, the order of precedence will not " "cause a value to be obtained from the successors. Instead, ``StopIteration`` " @@ -4055,3 +4095,21 @@ msgid "" msgstr "" "如果 :attr:`~Mock.side_effect` 已耗盡,則優先順序將不會使值由後面取得。相反地" "這會引發 ``StopIteration`` 例外。" + +#~ msgid "" +#~ "This can be useful where you want to make a series of assertions that " +#~ "reuse the same object. Note that :meth:`reset_mock` *doesn't* clear the :" +#~ "attr:`return_value`, :attr:`side_effect` or any child attributes you have " +#~ "set using normal assignment by default. In case you want to reset :attr:" +#~ "`return_value` or :attr:`side_effect`, then pass the corresponding " +#~ "parameter as ``True``. Child mocks and the return value mock (if any) are " +#~ "reset as well." +#~ msgstr "" +#~ "這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況" +#~ "下,:meth:`reset_mock` *不會*\\ 清除 :attr:`return_value`、:attr:" +#~ "`side_effect` 或使用普通賦值設定的任何子屬性。如果你想要重置 :attr:" +#~ "`return_value` 或 :attr:`side_effect`,則將相應的參數設置為 ``True``。" +#~ "Child mock 和回傳值 mock(如果有的話)也會被重置。" + +#~ msgid "*return_value*, and *side_effect* are keyword-only arguments." +#~ msgstr "*return_value* 和 *side_effect* 是僅限關鍵字引數。" diff --git a/library/unittest.po b/library/unittest.po index bd134aa24b..51c29d135d 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2380,7 +2380,7 @@ msgid "" "with :class:`asyncio.EventLoop` to avoid using the asyncio policy system." msgstr "" -#: ../../library/unittest.rst:1584 +#: ../../library/unittest.rst:1585 msgid "" "Method called to prepare the test fixture. This is called after :meth:" "`setUp`. This is called immediately before calling the test method; other " @@ -2389,7 +2389,7 @@ msgid "" "implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1592 +#: ../../library/unittest.rst:1594 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called before :meth:`tearDown`. This is called " @@ -2402,11 +2402,11 @@ msgid "" "the outcome of the test method. The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1604 +#: ../../library/unittest.rst:1606 msgid "This method accepts a coroutine that can be used as a cleanup function." msgstr "" -#: ../../library/unittest.rst:1608 +#: ../../library/unittest.rst:1611 msgid "" "Enter the supplied :term:`asynchronous context manager`. If successful, " "also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:" @@ -2414,7 +2414,7 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:1618 +#: ../../library/unittest.rst:1621 msgid "" "Sets up a new event loop to run the test, collecting the result into the :" "class:`TestResult` object passed as *result*. If *result* is omitted or " @@ -2424,11 +2424,11 @@ msgid "" "cancelled." msgstr "" -#: ../../library/unittest.rst:1626 +#: ../../library/unittest.rst:1629 msgid "An example illustrating the order::" msgstr "" -#: ../../library/unittest.rst:1628 +#: ../../library/unittest.rst:1631 msgid "" "from unittest import IsolatedAsyncioTestCase\n" "\n" @@ -2500,14 +2500,14 @@ msgstr "" "if __name__ == \"__main__\":\n" " unittest.main()" -#: ../../library/unittest.rst:1662 +#: ../../library/unittest.rst:1665 msgid "" "After running the test, ``events`` would contain ``[\"setUp\", " "\"asyncSetUp\", \"test_response\", \"asyncTearDown\", \"tearDown\", " "\"cleanup\"]``." msgstr "" -#: ../../library/unittest.rst:1667 +#: ../../library/unittest.rst:1670 msgid "" "This class implements the portion of the :class:`TestCase` interface which " "allows the test runner to drive the test, but does not provide the methods " @@ -2516,11 +2516,11 @@ msgid "" "`unittest`-based test framework." msgstr "" -#: ../../library/unittest.rst:1677 +#: ../../library/unittest.rst:1680 msgid "Grouping tests" msgstr "" -#: ../../library/unittest.rst:1681 +#: ../../library/unittest.rst:1684 msgid "" "This class represents an aggregation of individual test cases and test " "suites. The class presents the interface needed by the test runner to allow " @@ -2528,14 +2528,14 @@ msgid "" "is the same as iterating over the suite, running each test individually." msgstr "" -#: ../../library/unittest.rst:1686 +#: ../../library/unittest.rst:1689 msgid "" "If *tests* is given, it must be an iterable of individual test cases or " "other test suites that will be used to build the suite initially. Additional " "methods are provided to add test cases and suites to the collection later on." msgstr "" -#: ../../library/unittest.rst:1690 +#: ../../library/unittest.rst:1693 msgid "" ":class:`TestSuite` objects behave much like :class:`TestCase` objects, " "except they do not actually implement a test. Instead, they are used to " @@ -2544,47 +2544,47 @@ msgid "" "instances:" msgstr "" -#: ../../library/unittest.rst:1698 +#: ../../library/unittest.rst:1701 msgid "Add a :class:`TestCase` or :class:`TestSuite` to the suite." msgstr "" -#: ../../library/unittest.rst:1703 +#: ../../library/unittest.rst:1706 msgid "" "Add all the tests from an iterable of :class:`TestCase` and :class:" "`TestSuite` instances to this test suite." msgstr "" -#: ../../library/unittest.rst:1706 +#: ../../library/unittest.rst:1709 msgid "" "This is equivalent to iterating over *tests*, calling :meth:`addTest` for " "each element." msgstr "" -#: ../../library/unittest.rst:1709 +#: ../../library/unittest.rst:1712 msgid ":class:`TestSuite` shares the following methods with :class:`TestCase`:" msgstr "" -#: ../../library/unittest.rst:1714 +#: ../../library/unittest.rst:1717 msgid "" "Run the tests associated with this suite, collecting the result into the " "test result object passed as *result*. Note that unlike :meth:`TestCase." "run`, :meth:`TestSuite.run` requires the result object to be passed in." msgstr "" -#: ../../library/unittest.rst:1722 +#: ../../library/unittest.rst:1725 msgid "" "Run the tests associated with this suite without collecting the result. This " "allows exceptions raised by the test to be propagated to the caller and can " "be used to support running tests under a debugger." msgstr "" -#: ../../library/unittest.rst:1729 +#: ../../library/unittest.rst:1732 msgid "" "Return the number of tests represented by this test object, including all " "individual tests and sub-suites." msgstr "" -#: ../../library/unittest.rst:1735 +#: ../../library/unittest.rst:1738 msgid "" "Tests grouped by a :class:`TestSuite` are always accessed by iteration. " "Subclasses can lazily provide tests by overriding :meth:`!__iter__`. Note " @@ -2596,31 +2596,31 @@ msgid "" "overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references." msgstr "" -#: ../../library/unittest.rst:1745 +#: ../../library/unittest.rst:1748 msgid "" "In earlier versions the :class:`TestSuite` accessed tests directly rather " "than through iteration, so overriding :meth:`!__iter__` wasn't sufficient " "for providing tests." msgstr "" -#: ../../library/unittest.rst:1750 +#: ../../library/unittest.rst:1753 msgid "" "In earlier versions the :class:`TestSuite` held references to each :class:" "`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that behavior " "by overriding :meth:`TestSuite._removeTestAtIndex`." msgstr "" -#: ../../library/unittest.rst:1755 +#: ../../library/unittest.rst:1758 msgid "" "In the typical usage of a :class:`TestSuite` object, the :meth:`run` method " "is invoked by a :class:`TestRunner` rather than by the end-user test harness." msgstr "" -#: ../../library/unittest.rst:1760 +#: ../../library/unittest.rst:1763 msgid "Loading and running tests" msgstr "" -#: ../../library/unittest.rst:1764 +#: ../../library/unittest.rst:1767 msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " @@ -2629,11 +2629,11 @@ msgid "" "customization of some configurable properties." msgstr "" -#: ../../library/unittest.rst:1770 +#: ../../library/unittest.rst:1773 msgid ":class:`TestLoader` objects have the following attributes:" msgstr "" -#: ../../library/unittest.rst:1775 +#: ../../library/unittest.rst:1778 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " "the loader at any point. Fatal errors are signalled by the relevant method " @@ -2641,17 +2641,17 @@ msgid "" "synthetic test that will raise the original error when run." msgstr "" -#: ../../library/unittest.rst:1784 +#: ../../library/unittest.rst:1787 msgid ":class:`TestLoader` objects have the following methods:" msgstr "" -#: ../../library/unittest.rst:1789 +#: ../../library/unittest.rst:1792 msgid "" "Return a suite of all test cases contained in the :class:`TestCase`\\ -" "derived :class:`testCaseClass`." msgstr "" -#: ../../library/unittest.rst:1792 +#: ../../library/unittest.rst:1795 msgid "" "A test case instance is created for each method named by :meth:" "`getTestCaseNames`. By default these are the method names beginning with " @@ -2660,14 +2660,14 @@ msgid "" "method instead." msgstr "" -#: ../../library/unittest.rst:1801 +#: ../../library/unittest.rst:1804 msgid "" "Return a suite of all test cases contained in the given module. This method " "searches *module* for classes derived from :class:`TestCase` and creates an " "instance of the class for each test method defined for the class." msgstr "" -#: ../../library/unittest.rst:1808 +#: ../../library/unittest.rst:1811 msgid "" "While using a hierarchy of :class:`TestCase`\\ -derived classes can be " "convenient in sharing fixtures and helper functions, defining test methods " @@ -2676,7 +2676,7 @@ msgid "" "fixtures are different and defined in subclasses." msgstr "" -#: ../../library/unittest.rst:1814 +#: ../../library/unittest.rst:1817 msgid "" "If a module provides a ``load_tests`` function it will be called to load the " "tests. This allows modules to customize test loading. This is the " @@ -2684,24 +2684,24 @@ msgid "" "argument to ``load_tests``." msgstr "" -#: ../../library/unittest.rst:1819 +#: ../../library/unittest.rst:1822 msgid "Support for ``load_tests`` added." msgstr "" -#: ../../library/unittest.rst:1822 +#: ../../library/unittest.rst:1825 msgid "Support for a keyword-only argument *pattern* has been added." msgstr "" -#: ../../library/unittest.rst:1825 +#: ../../library/unittest.rst:1828 msgid "" "The undocumented and unofficial *use_load_tests* parameter has been removed." msgstr "" -#: ../../library/unittest.rst:1832 +#: ../../library/unittest.rst:1835 msgid "Return a suite of all test cases given a string specifier." msgstr "" -#: ../../library/unittest.rst:1834 +#: ../../library/unittest.rst:1837 msgid "" "The specifier *name* is a \"dotted name\" that may resolve either to a " "module, a test case class, a test method within a test case class, a :class:" @@ -2712,7 +2712,7 @@ msgid "" "object\"." msgstr "" -#: ../../library/unittest.rst:1842 +#: ../../library/unittest.rst:1845 msgid "" "For example, if you have a module :mod:`SampleTests` containing a :class:" "`TestCase`\\ -derived class :class:`SampleTestCase` with three test methods " @@ -2725,31 +2725,31 @@ msgid "" "a side-effect." msgstr "" -#: ../../library/unittest.rst:1852 +#: ../../library/unittest.rst:1855 msgid "The method optionally resolves *name* relative to the given *module*." msgstr "" -#: ../../library/unittest.rst:1854 +#: ../../library/unittest.rst:1857 msgid "" "If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing " "*name* then a synthetic test that raises that error when run will be " "returned. These errors are included in the errors accumulated by self.errors." msgstr "" -#: ../../library/unittest.rst:1863 +#: ../../library/unittest.rst:1866 msgid "" "Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather " "than a single name. The return value is a test suite which supports all the " "tests defined for each name." msgstr "" -#: ../../library/unittest.rst:1870 +#: ../../library/unittest.rst:1873 msgid "" "Return a sorted sequence of method names found within *testCaseClass*; this " "should be a subclass of :class:`TestCase`." msgstr "" -#: ../../library/unittest.rst:1876 +#: ../../library/unittest.rst:1879 msgid "" "Find all the test modules by recursing into subdirectories from the " "specified start directory, and return a TestSuite object containing them. " @@ -2758,14 +2758,14 @@ msgid "" "Python identifiers) will be loaded." msgstr "" -#: ../../library/unittest.rst:1882 +#: ../../library/unittest.rst:1885 msgid "" "All test modules must be importable from the top level of the project. If " "the start directory is not the top level directory then *top_level_dir* must " "be specified separately." msgstr "" -#: ../../library/unittest.rst:1886 +#: ../../library/unittest.rst:1889 msgid "" "If importing a module fails, for example due to a syntax error, then this " "will be recorded as a single error and discovery will continue. If the " @@ -2773,7 +2773,7 @@ msgid "" "as a skip instead of an error." msgstr "" -#: ../../library/unittest.rst:1891 +#: ../../library/unittest.rst:1894 msgid "" "If a package (a directory containing a file named :file:`__init__.py`) is " "found, the package will be checked for a ``load_tests`` function. If this " @@ -2783,103 +2783,103 @@ msgid "" "itself calls ``loader.discover``." msgstr "" -#: ../../library/unittest.rst:1899 +#: ../../library/unittest.rst:1902 msgid "" "If ``load_tests`` exists then discovery does *not* recurse into the package, " "``load_tests`` is responsible for loading all tests in the package." msgstr "" -#: ../../library/unittest.rst:1903 +#: ../../library/unittest.rst:1906 msgid "" "The pattern is deliberately not stored as a loader attribute so that " "packages can continue discovery themselves." msgstr "" -#: ../../library/unittest.rst:1906 +#: ../../library/unittest.rst:1909 msgid "" "*top_level_dir* is stored internally, and used as a default to any nested " "calls to ``discover()``. That is, if a package's ``load_tests`` calls " "``loader.discover()``, it does not need to pass this argument." msgstr "" -#: ../../library/unittest.rst:1910 +#: ../../library/unittest.rst:1913 msgid "*start_dir* can be a dotted module name as well as a directory." msgstr "" -#: ../../library/unittest.rst:1914 +#: ../../library/unittest.rst:1917 msgid "" "Modules that raise :exc:`SkipTest` on import are recorded as skips, not " "errors." msgstr "" -#: ../../library/unittest.rst:1918 +#: ../../library/unittest.rst:1921 msgid "*start_dir* can be a :term:`namespace packages <namespace package>`." msgstr "" -#: ../../library/unittest.rst:1921 +#: ../../library/unittest.rst:1924 msgid "" "Paths are sorted before being imported so that execution order is the same " "even if the underlying file system's ordering is not dependent on file name." msgstr "" -#: ../../library/unittest.rst:1926 +#: ../../library/unittest.rst:1929 msgid "" "Found packages are now checked for ``load_tests`` regardless of whether " "their path matches *pattern*, because it is impossible for a package name to " "match the default pattern." msgstr "" -#: ../../library/unittest.rst:1931 +#: ../../library/unittest.rst:1934 msgid "" "*start_dir* can not be a :term:`namespace packages <namespace package>`. It " "has been broken since Python 3.7 and Python 3.11 officially remove it." msgstr "" -#: ../../library/unittest.rst:1935 +#: ../../library/unittest.rst:1938 msgid "*top_level_dir* is only stored for the duration of *discover* call." msgstr "" -#: ../../library/unittest.rst:1939 +#: ../../library/unittest.rst:1942 msgid "" "The following attributes of a :class:`TestLoader` can be configured either " "by subclassing or assignment on an instance:" msgstr "" -#: ../../library/unittest.rst:1945 +#: ../../library/unittest.rst:1948 msgid "" "String giving the prefix of method names which will be interpreted as test " "methods. The default value is ``'test'``." msgstr "" -#: ../../library/unittest.rst:1948 +#: ../../library/unittest.rst:1951 msgid "" "This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods." msgstr "" -#: ../../library/unittest.rst:1954 +#: ../../library/unittest.rst:1957 msgid "" "Function to be used to compare method names when sorting them in :meth:" "`getTestCaseNames` and all the ``loadTestsFrom*`` methods." msgstr "" -#: ../../library/unittest.rst:1960 +#: ../../library/unittest.rst:1963 msgid "" "Callable object that constructs a test suite from a list of tests. No " "methods on the resulting object are needed. The default value is the :class:" "`TestSuite` class." msgstr "" -#: ../../library/unittest.rst:1964 ../../library/unittest.rst:1977 +#: ../../library/unittest.rst:1967 ../../library/unittest.rst:1980 msgid "This affects all the ``loadTestsFrom*`` methods." msgstr "" -#: ../../library/unittest.rst:1968 +#: ../../library/unittest.rst:1971 msgid "" "List of Unix shell-style wildcard test name patterns that test methods have " "to match to be included in test suites (see ``-k`` option)." msgstr "" -#: ../../library/unittest.rst:1971 +#: ../../library/unittest.rst:1974 msgid "" "If this attribute is not ``None`` (the default), all test methods to be " "included in test suites must match one of the patterns in this list. Note " @@ -2888,13 +2888,13 @@ msgid "" "have to be converted using ``*`` wildcards." msgstr "" -#: ../../library/unittest.rst:1984 +#: ../../library/unittest.rst:1987 msgid "" "This class is used to compile information about which tests have succeeded " "and which have failed." msgstr "" -#: ../../library/unittest.rst:1987 +#: ../../library/unittest.rst:1990 msgid "" "A :class:`TestResult` object stores the results of a set of tests. The :" "class:`TestCase` and :class:`TestSuite` classes ensure that results are " @@ -2902,7 +2902,7 @@ msgid "" "outcome of tests." msgstr "" -#: ../../library/unittest.rst:1992 +#: ../../library/unittest.rst:1995 msgid "" "Testing frameworks built on top of :mod:`unittest` may want access to the :" "class:`TestResult` object generated by running a set of tests for reporting " @@ -2910,61 +2910,61 @@ msgid "" "`TestRunner.run` method for this purpose." msgstr "" -#: ../../library/unittest.rst:1997 +#: ../../library/unittest.rst:2000 msgid "" ":class:`TestResult` instances have the following attributes that will be of " "interest when inspecting the results of running a set of tests:" msgstr "" -#: ../../library/unittest.rst:2003 +#: ../../library/unittest.rst:2006 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test which raised an " "unexpected exception." msgstr "" -#: ../../library/unittest.rst:2009 +#: ../../library/unittest.rst:2012 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test where a failure " "was explicitly signalled using the :ref:`assert\\* methods <assert-methods>`." msgstr "" -#: ../../library/unittest.rst:2015 +#: ../../library/unittest.rst:2018 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding the reason for skipping the test." msgstr "" -#: ../../library/unittest.rst:2022 +#: ../../library/unittest.rst:2025 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents an expected failure or " "error of the test case." msgstr "" -#: ../../library/unittest.rst:2028 +#: ../../library/unittest.rst:2031 msgid "" "A list containing :class:`TestCase` instances that were marked as expected " "failures, but succeeded." msgstr "" -#: ../../library/unittest.rst:2033 +#: ../../library/unittest.rst:2036 msgid "" "A list containing 2-tuples of test case names and floats representing the " "elapsed time of each test which was run." msgstr "" -#: ../../library/unittest.rst:2040 +#: ../../library/unittest.rst:2043 msgid "" "Set to ``True`` when the execution of tests should stop by :meth:`stop`." msgstr "" -#: ../../library/unittest.rst:2044 +#: ../../library/unittest.rst:2047 msgid "The total number of tests run so far." msgstr "" -#: ../../library/unittest.rst:2048 +#: ../../library/unittest.rst:2051 msgid "" "If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in " "between :meth:`startTest` and :meth:`stopTest` being called. Collected " @@ -2973,29 +2973,29 @@ msgid "" "error message." msgstr "" -#: ../../library/unittest.rst:2057 +#: ../../library/unittest.rst:2060 msgid "" "If set to true :meth:`stop` will be called on the first failure or error, " "halting the test run." msgstr "" -#: ../../library/unittest.rst:2064 +#: ../../library/unittest.rst:2067 msgid "If set to true then local variables will be shown in tracebacks." msgstr "" -#: ../../library/unittest.rst:2070 +#: ../../library/unittest.rst:2073 msgid "" "Return ``True`` if all tests run so far have passed, otherwise returns " "``False``." msgstr "" -#: ../../library/unittest.rst:2073 +#: ../../library/unittest.rst:2076 msgid "" "Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests " "marked with the :func:`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2079 +#: ../../library/unittest.rst:2082 msgid "" "This method can be called to signal that the set of tests being run should " "be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:" @@ -3003,7 +3003,7 @@ msgid "" "additional tests." msgstr "" -#: ../../library/unittest.rst:2084 +#: ../../library/unittest.rst:2087 msgid "" "For example, this feature is used by the :class:`TextTestRunner` class to " "stop the test framework when the user signals an interrupt from the " @@ -3011,7 +3011,7 @@ msgid "" "implementations can use this in a similar manner." msgstr "" -#: ../../library/unittest.rst:2089 +#: ../../library/unittest.rst:2092 msgid "" "The following methods of the :class:`TestResult` class are used to maintain " "the internal data structures, and may be extended in subclasses to support " @@ -3019,141 +3019,141 @@ msgid "" "tools which support interactive reporting while tests are being run." msgstr "" -#: ../../library/unittest.rst:2097 +#: ../../library/unittest.rst:2100 msgid "Called when the test case *test* is about to be run." msgstr "" -#: ../../library/unittest.rst:2101 +#: ../../library/unittest.rst:2104 msgid "" "Called after the test case *test* has been executed, regardless of the " "outcome." msgstr "" -#: ../../library/unittest.rst:2106 +#: ../../library/unittest.rst:2109 msgid "Called once before any tests are executed." msgstr "" -#: ../../library/unittest.rst:2113 +#: ../../library/unittest.rst:2116 msgid "Called once after all tests are executed." msgstr "" -#: ../../library/unittest.rst:2120 +#: ../../library/unittest.rst:2123 msgid "" "Called when the test case *test* raises an unexpected exception. *err* is a " "tuple of the form returned by :func:`sys.exc_info`: ``(type, value, " "traceback)``." msgstr "" -#: ../../library/unittest.rst:2124 +#: ../../library/unittest.rst:2127 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`errors` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2131 +#: ../../library/unittest.rst:2134 msgid "" "Called when the test case *test* signals a failure. *err* is a tuple of the " "form returned by :func:`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2134 +#: ../../library/unittest.rst:2137 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`failures` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2141 +#: ../../library/unittest.rst:2144 msgid "Called when the test case *test* succeeds." msgstr "" -#: ../../library/unittest.rst:2143 +#: ../../library/unittest.rst:2146 msgid "The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:2148 +#: ../../library/unittest.rst:2151 msgid "" "Called when the test case *test* is skipped. *reason* is the reason the " "test gave for skipping." msgstr "" -#: ../../library/unittest.rst:2151 +#: ../../library/unittest.rst:2154 msgid "" "The default implementation appends a tuple ``(test, reason)`` to the " "instance's :attr:`skipped` attribute." msgstr "" -#: ../../library/unittest.rst:2157 +#: ../../library/unittest.rst:2160 msgid "" "Called when the test case *test* fails or errors, but was marked with the :" "func:`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2160 +#: ../../library/unittest.rst:2163 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`expectedFailures` attribute, where *formatted_err* is a " "formatted traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2167 +#: ../../library/unittest.rst:2170 msgid "" "Called when the test case *test* was marked with the :func:`expectedFailure` " "decorator, but succeeded." msgstr "" -#: ../../library/unittest.rst:2170 +#: ../../library/unittest.rst:2173 msgid "" "The default implementation appends the test to the instance's :attr:" "`unexpectedSuccesses` attribute." msgstr "" -#: ../../library/unittest.rst:2176 +#: ../../library/unittest.rst:2179 msgid "" "Called when a subtest finishes. *test* is the test case corresponding to " "the test method. *subtest* is a custom :class:`TestCase` instance " "describing the subtest." msgstr "" -#: ../../library/unittest.rst:2180 +#: ../../library/unittest.rst:2183 msgid "" "If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed " "with an exception where *outcome* is a tuple of the form returned by :func:" "`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2184 +#: ../../library/unittest.rst:2187 msgid "" "The default implementation does nothing when the outcome is a success, and " "records subtest failures as normal failures." msgstr "" -#: ../../library/unittest.rst:2191 +#: ../../library/unittest.rst:2194 msgid "" "Called when the test case finishes. *elapsed* is the time represented in " "seconds, and it includes the execution of cleanup functions." msgstr "" -#: ../../library/unittest.rst:2198 +#: ../../library/unittest.rst:2201 msgid "" "A concrete implementation of :class:`TestResult` used by the :class:" "`TextTestRunner`. Subclasses should accept ``**kwargs`` to ensure " "compatibility as the interface changes." msgstr "" -#: ../../library/unittest.rst:2204 +#: ../../library/unittest.rst:2207 msgid "Added the *durations* keyword parameter." msgstr "新增 *durations* 關鍵字參數。" -#: ../../library/unittest.rst:2209 +#: ../../library/unittest.rst:2212 msgid "" "Instance of the :class:`TestLoader` class intended to be shared. If no " "customization of the :class:`TestLoader` is needed, this instance can be " "used instead of repeatedly creating new instances." msgstr "" -#: ../../library/unittest.rst:2218 +#: ../../library/unittest.rst:2221 msgid "" "A basic test runner implementation that outputs results to a stream. If " "*stream* is ``None``, the default, :data:`sys.stderr` is used as the output " @@ -3164,7 +3164,7 @@ msgid "" "unittest." msgstr "" -#: ../../library/unittest.rst:2225 +#: ../../library/unittest.rst:2228 msgid "" "By default this runner shows :exc:`DeprecationWarning`, :exc:" "`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`ImportWarning` " @@ -3174,32 +3174,32 @@ msgid "" "``None``." msgstr "" -#: ../../library/unittest.rst:2233 +#: ../../library/unittest.rst:2236 msgid "Added the *warnings* parameter." msgstr "新增 *warnings* 參數。" -#: ../../library/unittest.rst:2236 +#: ../../library/unittest.rst:2239 msgid "" "The default stream is set to :data:`sys.stderr` at instantiation time rather " "than import time." msgstr "" -#: ../../library/unittest.rst:2240 +#: ../../library/unittest.rst:2243 msgid "Added the *tb_locals* parameter." msgstr "新增 *tb_locals* 參數。" -#: ../../library/unittest.rst:2243 +#: ../../library/unittest.rst:2246 msgid "Added the *durations* parameter." msgstr "新增 *durations* 參數。" -#: ../../library/unittest.rst:2248 +#: ../../library/unittest.rst:2251 msgid "" "This method returns the instance of ``TestResult`` used by :meth:`run`. It " "is not intended to be called directly, but can be overridden in subclasses " "to provide a custom ``TestResult``." msgstr "" -#: ../../library/unittest.rst:2252 +#: ../../library/unittest.rst:2255 msgid "" "``_makeResult()`` instantiates the class or callable passed in the " "``TextTestRunner`` constructor as the ``resultclass`` argument. It defaults " @@ -3207,11 +3207,11 @@ msgid "" "class is instantiated with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2257 +#: ../../library/unittest.rst:2260 msgid "stream, descriptions, verbosity" msgstr "" -#: ../../library/unittest.rst:2261 +#: ../../library/unittest.rst:2264 msgid "" "This method is the main public interface to the ``TextTestRunner``. This " "method takes a :class:`TestSuite` or :class:`TestCase` instance. A :class:" @@ -3219,7 +3219,7 @@ msgid "" "run and the results printed to stdout." msgstr "" -#: ../../library/unittest.rst:2272 +#: ../../library/unittest.rst:2275 msgid "" "A command-line program that loads a set of tests from *module* and runs " "them; this is primarily for making test modules conveniently executable. The " @@ -3227,7 +3227,7 @@ msgid "" "of a test script::" msgstr "" -#: ../../library/unittest.rst:2277 +#: ../../library/unittest.rst:2280 msgid "" "if __name__ == '__main__':\n" " unittest.main()" @@ -3235,13 +3235,13 @@ msgstr "" "if __name__ == '__main__':\n" " unittest.main()" -#: ../../library/unittest.rst:2280 +#: ../../library/unittest.rst:2283 msgid "" "You can run tests with more detailed information by passing in the verbosity " "argument::" msgstr "" -#: ../../library/unittest.rst:2283 +#: ../../library/unittest.rst:2286 msgid "" "if __name__ == '__main__':\n" " unittest.main(verbosity=2)" @@ -3249,7 +3249,7 @@ msgstr "" "if __name__ == '__main__':\n" " unittest.main(verbosity=2)" -#: ../../library/unittest.rst:2286 +#: ../../library/unittest.rst:2289 msgid "" "The *defaultTest* argument is either the name of a single test or an " "iterable of test names to run if no test names are specified via *argv*. If " @@ -3257,14 +3257,14 @@ msgid "" "tests found in *module* are run." msgstr "" -#: ../../library/unittest.rst:2291 +#: ../../library/unittest.rst:2294 msgid "" "The *argv* argument can be a list of options passed to the program, with the " "first element being the program name. If not specified or ``None``, the " "values of :data:`sys.argv` are used." msgstr "" -#: ../../library/unittest.rst:2295 +#: ../../library/unittest.rst:2298 msgid "" "The *testRunner* argument can either be a test runner class or an already " "created instance of it. By default ``main`` calls :func:`sys.exit` with an " @@ -3272,20 +3272,20 @@ msgid "" "code of 5 indicates that no tests were run or skipped." msgstr "" -#: ../../library/unittest.rst:2300 +#: ../../library/unittest.rst:2303 msgid "" "The *testLoader* argument has to be a :class:`TestLoader` instance, and " "defaults to :data:`defaultTestLoader`." msgstr "" -#: ../../library/unittest.rst:2303 +#: ../../library/unittest.rst:2306 msgid "" "``main`` supports being used from the interactive interpreter by passing in " "the argument ``exit=False``. This displays the result on standard output " "without calling :func:`sys.exit`::" msgstr "" -#: ../../library/unittest.rst:2307 +#: ../../library/unittest.rst:2310 msgid "" ">>> from unittest import main\n" ">>> main(module='test_module', exit=False)" @@ -3293,13 +3293,13 @@ msgstr "" ">>> from unittest import main\n" ">>> main(module='test_module', exit=False)" -#: ../../library/unittest.rst:2310 +#: ../../library/unittest.rst:2313 msgid "" "The *failfast*, *catchbreak* and *buffer* parameters have the same effect as " "the same-name `command-line options`_." msgstr "" -#: ../../library/unittest.rst:2313 +#: ../../library/unittest.rst:2316 msgid "" "The *warnings* argument specifies the :ref:`warning filter <warning-filter>` " "that should be used while running the tests. If it's not specified, it will " @@ -3308,60 +3308,60 @@ msgid "" "to ``'default'``." msgstr "" -#: ../../library/unittest.rst:2319 +#: ../../library/unittest.rst:2322 msgid "" "Calling ``main`` returns an object with the ``result`` attribute that " "contains the result of the tests run as a :class:`unittest.TestResult`." msgstr "" -#: ../../library/unittest.rst:2322 +#: ../../library/unittest.rst:2325 msgid "The *exit* parameter was added." msgstr "新增 *exit* 參數。" -#: ../../library/unittest.rst:2325 +#: ../../library/unittest.rst:2328 msgid "" "The *verbosity*, *failfast*, *catchbreak*, *buffer* and *warnings* " "parameters were added." msgstr "" -#: ../../library/unittest.rst:2329 +#: ../../library/unittest.rst:2332 msgid "" "The *defaultTest* parameter was changed to also accept an iterable of test " "names." msgstr "" -#: ../../library/unittest.rst:2337 +#: ../../library/unittest.rst:2340 msgid "load_tests Protocol" msgstr "" -#: ../../library/unittest.rst:2341 +#: ../../library/unittest.rst:2344 msgid "" "Modules or packages can customize how tests are loaded from them during " "normal test runs or test discovery by implementing a function called " "``load_tests``." msgstr "" -#: ../../library/unittest.rst:2344 +#: ../../library/unittest.rst:2347 msgid "" "If a test module defines ``load_tests`` it will be called by :meth:" "`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2347 ../../library/unittest.rst:2379 +#: ../../library/unittest.rst:2350 ../../library/unittest.rst:2382 msgid "load_tests(loader, standard_tests, pattern)" msgstr "load_tests(loader, standard_tests, pattern)" -#: ../../library/unittest.rst:2349 +#: ../../library/unittest.rst:2352 msgid "" "where *pattern* is passed straight through from ``loadTestsFromModule``. It " "defaults to ``None``." msgstr "" -#: ../../library/unittest.rst:2352 +#: ../../library/unittest.rst:2355 msgid "It should return a :class:`TestSuite`." msgstr "" -#: ../../library/unittest.rst:2354 +#: ../../library/unittest.rst:2357 msgid "" "*loader* is the instance of :class:`TestLoader` doing the loading. " "*standard_tests* are the tests that would be loaded by default from the " @@ -3370,13 +3370,13 @@ msgid "" "packages as part of test discovery." msgstr "" -#: ../../library/unittest.rst:2360 +#: ../../library/unittest.rst:2363 msgid "" "A typical ``load_tests`` function that loads tests from a specific set of :" "class:`TestCase` classes may look like::" msgstr "" -#: ../../library/unittest.rst:2363 +#: ../../library/unittest.rst:2366 msgid "" "test_cases = (TestCase1, TestCase2, TestCase3)\n" "\n" @@ -3396,7 +3396,7 @@ msgstr "" " suite.addTests(tests)\n" " return suite" -#: ../../library/unittest.rst:2372 +#: ../../library/unittest.rst:2375 msgid "" "If discovery is started in a directory containing a package, either from the " "command line or by calling :meth:`TestLoader.discover`, then the package :" @@ -3406,21 +3406,21 @@ msgid "" "left up to ``load_tests`` which is called with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2381 +#: ../../library/unittest.rst:2384 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " "package. (``standard_tests`` will only contain tests collected from :file:" "`__init__.py`.)" msgstr "" -#: ../../library/unittest.rst:2385 +#: ../../library/unittest.rst:2388 msgid "" "Because the pattern is passed into ``load_tests`` the package is free to " "continue (and potentially modify) test discovery. A 'do nothing' " "``load_tests`` function for a test package would look like::" msgstr "" -#: ../../library/unittest.rst:2389 +#: ../../library/unittest.rst:2392 msgid "" "def load_tests(loader, standard_tests, pattern):\n" " # top level directory cached on loader instance\n" @@ -3430,17 +3430,17 @@ msgid "" " return standard_tests" msgstr "" -#: ../../library/unittest.rst:2396 +#: ../../library/unittest.rst:2399 msgid "" "Discovery no longer checks package names for matching *pattern* due to the " "impossibility of package names matching the default pattern." msgstr "" -#: ../../library/unittest.rst:2403 +#: ../../library/unittest.rst:2406 msgid "Class and Module Fixtures" msgstr "" -#: ../../library/unittest.rst:2405 +#: ../../library/unittest.rst:2408 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " "the test suite encounters a test from a new class then :meth:`tearDownClass` " @@ -3448,27 +3448,27 @@ msgid "" "`setUpClass` from the new class." msgstr "" -#: ../../library/unittest.rst:2410 +#: ../../library/unittest.rst:2413 msgid "" "Similarly if a test is from a different module from the previous test then " "``tearDownModule`` from the previous module is run, followed by " "``setUpModule`` from the new module." msgstr "" -#: ../../library/unittest.rst:2414 +#: ../../library/unittest.rst:2417 msgid "" "After all the tests have run the final ``tearDownClass`` and " "``tearDownModule`` are run." msgstr "" -#: ../../library/unittest.rst:2417 +#: ../../library/unittest.rst:2420 msgid "" "Note that shared fixtures do not play well with [potential] features like " "test parallelization and they break test isolation. They should be used with " "care." msgstr "" -#: ../../library/unittest.rst:2420 +#: ../../library/unittest.rst:2423 msgid "" "The default ordering of tests created by the unittest test loaders is to " "group all tests from the same modules and classes together. This will lead " @@ -3478,14 +3478,14 @@ msgid "" "functions may be called multiple times in a single test run." msgstr "" -#: ../../library/unittest.rst:2427 +#: ../../library/unittest.rst:2430 msgid "" "Shared fixtures are not intended to work with suites with non-standard " "ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to " "support shared fixtures." msgstr "" -#: ../../library/unittest.rst:2431 +#: ../../library/unittest.rst:2434 msgid "" "If there are any exceptions raised during one of the shared fixture " "functions the test is reported as an error. Because there is no " @@ -3495,15 +3495,15 @@ msgid "" "matter, but if you are a framework author it may be relevant." msgstr "" -#: ../../library/unittest.rst:2440 +#: ../../library/unittest.rst:2443 msgid "setUpClass and tearDownClass" msgstr "" -#: ../../library/unittest.rst:2442 +#: ../../library/unittest.rst:2445 msgid "These must be implemented as class methods::" msgstr "" -#: ../../library/unittest.rst:2444 +#: ../../library/unittest.rst:2447 msgid "" "import unittest\n" "\n" @@ -3527,14 +3527,14 @@ msgstr "" " def tearDownClass(cls):\n" " cls._connection.destroy()" -#: ../../library/unittest.rst:2455 +#: ../../library/unittest.rst:2458 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " "then you must call up to them yourself. The implementations in :class:" "`TestCase` are empty." msgstr "" -#: ../../library/unittest.rst:2459 +#: ../../library/unittest.rst:2462 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " @@ -3543,15 +3543,15 @@ msgid "" "instead of as an error." msgstr "" -#: ../../library/unittest.rst:2467 +#: ../../library/unittest.rst:2470 msgid "setUpModule and tearDownModule" msgstr "" -#: ../../library/unittest.rst:2469 +#: ../../library/unittest.rst:2472 msgid "These should be implemented as functions::" msgstr "" -#: ../../library/unittest.rst:2471 +#: ../../library/unittest.rst:2474 msgid "" "def setUpModule():\n" " createConnection()\n" @@ -3565,7 +3565,7 @@ msgstr "" "def tearDownModule():\n" " closeConnection()" -#: ../../library/unittest.rst:2477 +#: ../../library/unittest.rst:2480 msgid "" "If an exception is raised in a ``setUpModule`` then none of the tests in the " "module will be run and the ``tearDownModule`` will not be run. If the " @@ -3573,13 +3573,13 @@ msgid "" "having been skipped instead of as an error." msgstr "" -#: ../../library/unittest.rst:2482 +#: ../../library/unittest.rst:2485 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" -#: ../../library/unittest.rst:2488 +#: ../../library/unittest.rst:2491 msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " @@ -3588,13 +3588,13 @@ msgid "" "`addModuleCleanup` when they are added." msgstr "" -#: ../../library/unittest.rst:2494 +#: ../../library/unittest.rst:2497 msgid "" "If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:2502 +#: ../../library/unittest.rst:2505 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :func:" @@ -3602,30 +3602,30 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:2512 +#: ../../library/unittest.rst:2515 msgid "" "This function is called unconditionally after :func:`tearDownModule`, or " "after :func:`setUpModule` if :func:`setUpModule` raises an exception." msgstr "" -#: ../../library/unittest.rst:2515 +#: ../../library/unittest.rst:2518 msgid "" "It is responsible for calling all the cleanup functions added by :func:" "`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:2520 +#: ../../library/unittest.rst:2523 msgid "" ":func:`doModuleCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:2527 +#: ../../library/unittest.rst:2530 msgid "Signal Handling" msgstr "" -#: ../../library/unittest.rst:2531 +#: ../../library/unittest.rst:2534 msgid "" "The :option:`-c/--catch <unittest -c>` command-line option to unittest, " "along with the ``catchbreak`` parameter to :func:`unittest.main`, provide " @@ -3635,7 +3635,7 @@ msgid "" "A second control-c will raise a :exc:`KeyboardInterrupt` in the usual way." msgstr "" -#: ../../library/unittest.rst:2538 +#: ../../library/unittest.rst:2541 msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " @@ -3647,48 +3647,48 @@ msgid "" "disabled the :func:`removeHandler` decorator can be used." msgstr "" -#: ../../library/unittest.rst:2547 +#: ../../library/unittest.rst:2550 msgid "" "There are a few utility functions for framework authors to enable control-c " "handling functionality within test frameworks." msgstr "" -#: ../../library/unittest.rst:2552 +#: ../../library/unittest.rst:2555 msgid "" "Install the control-c handler. When a :const:`signal.SIGINT` is received " "(usually in response to the user pressing control-c) all registered results " "have :meth:`~TestResult.stop` called." msgstr "" -#: ../../library/unittest.rst:2559 +#: ../../library/unittest.rst:2562 msgid "" "Register a :class:`TestResult` object for control-c handling. Registering a " "result stores a weak reference to it, so it doesn't prevent the result from " "being garbage collected." msgstr "" -#: ../../library/unittest.rst:2563 +#: ../../library/unittest.rst:2566 msgid "" "Registering a :class:`TestResult` object has no side-effects if control-c " "handling is not enabled, so test frameworks can unconditionally register all " "results they create independently of whether or not handling is enabled." msgstr "" -#: ../../library/unittest.rst:2570 +#: ../../library/unittest.rst:2573 msgid "" "Remove a registered result. Once a result has been removed then :meth:" "`~TestResult.stop` will no longer be called on that result object in " "response to a control-c." msgstr "" -#: ../../library/unittest.rst:2577 +#: ../../library/unittest.rst:2580 msgid "" "When called without arguments this function removes the control-c handler if " "it has been installed. This function can also be used as a test decorator to " "temporarily remove the handler while the test is being executed::" msgstr "" -#: ../../library/unittest.rst:2581 +#: ../../library/unittest.rst:2584 msgid "" "@unittest.removeHandler\n" "def test_signal_handling(self):\n" diff --git a/library/uuid.po b/library/uuid.po index e3274d2fbf..87f9027d81 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -273,7 +273,7 @@ msgstr "" "通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者" "不是。" -#: ../../library/uuid.rst:187 +#: ../../library/uuid.rst:185 msgid "" "Generate a UUID from a host ID, sequence number, and the current time. If " "*node* is not given, :func:`getnode` is used to obtain the hardware address. " @@ -284,7 +284,7 @@ msgstr "" "`getnode` 獲取硬體位址。如果給定 *clock_seq*,會將其用作序列號;否則將使用一" "個隨機 14 位元的序列號。" -#: ../../library/uuid.rst:197 +#: ../../library/uuid.rst:193 msgid "" "Generate a UUID based on the MD5 hash of a namespace identifier (which is a " "UUID) and a name (which is a :class:`bytes` object or a string that will be " @@ -293,11 +293,11 @@ msgstr "" "基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一個 :class:" "`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" -#: ../../library/uuid.rst:206 +#: ../../library/uuid.rst:200 msgid "Generate a random UUID." msgstr "生成一個隨機的 UUID。" -#: ../../library/uuid.rst:213 +#: ../../library/uuid.rst:205 msgid "" "Generate a UUID based on the SHA-1 hash of a namespace identifier (which is " "a UUID) and a name (which is a :class:`bytes` object or a string that will " @@ -306,7 +306,7 @@ msgstr "" "基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " "編碼的字串)的 SHA-1 hash 來生成 UUID。" -#: ../../library/uuid.rst:219 +#: ../../library/uuid.rst:210 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." @@ -314,7 +314,7 @@ msgstr "" ":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" "碼。" -#: ../../library/uuid.rst:225 +#: ../../library/uuid.rst:216 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." @@ -322,50 +322,50 @@ msgstr "" "當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain " "name)。" -#: ../../library/uuid.rst:231 +#: ../../library/uuid.rst:222 msgid "When this namespace is specified, the *name* string is a URL." msgstr "當指定這個命名空間時,*name* 字串是一個 URL。" -#: ../../library/uuid.rst:236 +#: ../../library/uuid.rst:227 msgid "When this namespace is specified, the *name* string is an ISO OID." msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。" -#: ../../library/uuid.rst:241 +#: ../../library/uuid.rst:232 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" -#: ../../library/uuid.rst:244 +#: ../../library/uuid.rst:235 msgid "" "The :mod:`uuid` module defines the following constants for the possible " "values of the :attr:`~UUID.variant` attribute:" msgstr ":mod:`uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:" -#: ../../library/uuid.rst:250 +#: ../../library/uuid.rst:241 msgid "Reserved for NCS compatibility." msgstr "保留供 NCS 相容性使用。" -#: ../../library/uuid.rst:255 +#: ../../library/uuid.rst:246 msgid "Specifies the UUID layout given in :rfc:`4122`." msgstr "使用在 :rfc:`4122` 中給定的 UUID 佈局。" -#: ../../library/uuid.rst:260 +#: ../../library/uuid.rst:251 msgid "Reserved for Microsoft compatibility." msgstr "保留供 Microsoft 相容性使用。" -#: ../../library/uuid.rst:265 +#: ../../library/uuid.rst:256 msgid "Reserved for future definition." msgstr "保留供未來定義使用。" -#: ../../library/uuid.rst:270 +#: ../../library/uuid.rst:261 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" ":rfc:`4122` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命" "名空間" -#: ../../library/uuid.rst:271 +#: ../../library/uuid.rst:262 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." @@ -373,36 +373,36 @@ msgstr "" "這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的" "內部格式和生成 UUID 的方法。" -#: ../../library/uuid.rst:278 +#: ../../library/uuid.rst:269 msgid "Command-Line Usage" msgstr "命令列的用法" -#: ../../library/uuid.rst:282 +#: ../../library/uuid.rst:273 msgid "" "The :mod:`uuid` module can be executed as a script from the command line." msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" -#: ../../library/uuid.rst:284 +#: ../../library/uuid.rst:275 msgid "" "python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-n NAMESPACE] [-N NAME]" msgstr "" "python -m uuid [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-n NAMESPACE] [-N NAME]" -#: ../../library/uuid.rst:288 +#: ../../library/uuid.rst:279 msgid "The following options are accepted:" msgstr "可以接受以下選項:" -#: ../../library/uuid.rst:294 +#: ../../library/uuid.rst:285 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/uuid.rst:299 +#: ../../library/uuid.rst:290 msgid "" "Specify the function name to use to generate the uuid. By default :func:" "`uuid4` is used." msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" -#: ../../library/uuid.rst:305 +#: ../../library/uuid.rst:296 msgid "" "The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known " "predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, " @@ -413,21 +413,21 @@ msgstr "" "空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" "`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:312 +#: ../../library/uuid.rst:303 msgid "" "The name used as part of generating the uuid. Only required for :func:" "`uuid3` / :func:`uuid5` functions." msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:319 +#: ../../library/uuid.rst:310 msgid "Example" msgstr "範例" -#: ../../library/uuid.rst:321 +#: ../../library/uuid.rst:312 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "以下是一些 :mod:`uuid` 模組的典型使用範例: ::" -#: ../../library/uuid.rst:323 +#: ../../library/uuid.rst:314 msgid "" ">>> import uuid\n" "\n" @@ -463,17 +463,17 @@ msgid "" "UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')" msgstr "" -#: ../../library/uuid.rst:360 +#: ../../library/uuid.rst:351 msgid "Command-Line Example" msgstr "命令列的範例" -#: ../../library/uuid.rst:362 +#: ../../library/uuid.rst:353 msgid "" "Here are some examples of typical usage of the :mod:`uuid` command line " "interface:" msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" -#: ../../library/uuid.rst:364 +#: ../../library/uuid.rst:355 msgid "" "# generate a random uuid - by default uuid4() is used\n" "$ python -m uuid\n" @@ -485,22 +485,17 @@ msgid "" "$ python -m uuid -u uuid5 -n @url -N example.com" msgstr "" -#: ../../library/uuid.rst:182 -msgid "getnode" -msgstr "getnode" +#~ msgid "getnode" +#~ msgstr "getnode" -#: ../../library/uuid.rst:192 -msgid "uuid1" -msgstr "uuid1" +#~ msgid "uuid1" +#~ msgstr "uuid1" -#: ../../library/uuid.rst:201 -msgid "uuid3" -msgstr "uuid3" +#~ msgid "uuid3" +#~ msgstr "uuid3" -#: ../../library/uuid.rst:208 -msgid "uuid4" -msgstr "uuid4" +#~ msgid "uuid4" +#~ msgstr "uuid4" -#: ../../library/uuid.rst:217 -msgid "uuid5" -msgstr "uuid5" +#~ msgid "uuid5" +#~ msgstr "uuid5" diff --git a/library/wsgiref.po b/library/wsgiref.po index 17b240f7a3..2d7b85032f 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2023-12-09 21:29+0800\n" "Last-Translator: Liang-Bo Wang <me@liang2.tw>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,12 +208,13 @@ msgstr "" "這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 " "WSGI 伺服器或應用程式不應該使用它,因為所產生的數據是假的!" -#: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 -#: ../../library/wsgiref.rst:293 ../../library/wsgiref.rst:426 -msgid "Example usage::" -msgstr "用法範例: ::" +#: ../../library/wsgiref.rst:122 +msgid "" +"Example usage (see also :func:`~wsgiref.simple_server.demo_app` for another " +"example)::" +msgstr "" -#: ../../library/wsgiref.rst:124 +#: ../../library/wsgiref.rst:125 msgid "" "from wsgiref.util import setup_testing_defaults\n" "from wsgiref.simple_server import make_server\n" @@ -237,13 +238,13 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:146 +#: ../../library/wsgiref.rst:147 msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" msgstr "除了上述的環境功能外,:mod:`wsgiref.util` 模組還提供以下各類工具:" -#: ../../library/wsgiref.rst:152 +#: ../../library/wsgiref.rst:153 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." @@ -251,7 +252,7 @@ msgstr "" "如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭," "則回傳 ``True``。" -#: ../../library/wsgiref.rst:158 +#: ../../library/wsgiref.rst:159 msgid "" "A concrete implementation of the :class:`wsgiref.types.FileWrapper` protocol " "used to convert a file-like object to an :term:`iterator`. The resulting " @@ -266,7 +267,7 @@ msgstr "" "(yield)的位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且" "無法回復。" -#: ../../library/wsgiref.rst:166 +#: ../../library/wsgiref.rst:167 msgid "" "If *filelike* has a :meth:`close` method, the returned object will also have " "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" @@ -275,7 +276,12 @@ msgstr "" "如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" "法,並在呼叫時呼叫 *filelike* 物件的 :meth:`close` 方法。" -#: ../../library/wsgiref.rst:172 +#: ../../library/wsgiref.rst:171 ../../library/wsgiref.rst:294 +#: ../../library/wsgiref.rst:429 +msgid "Example usage::" +msgstr "用法範例: ::" + +#: ../../library/wsgiref.rst:173 msgid "" "from io import StringIO\n" "from wsgiref.util import FileWrapper\n" @@ -288,15 +294,15 @@ msgid "" " print(chunk)" msgstr "" -#: ../../library/wsgiref.rst:182 +#: ../../library/wsgiref.rst:183 msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "已移除對 :meth:`~object.__getitem__` 方法的支援。" -#: ../../library/wsgiref.rst:187 +#: ../../library/wsgiref.rst:188 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具" -#: ../../library/wsgiref.rst:193 +#: ../../library/wsgiref.rst:194 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." @@ -304,7 +310,7 @@ msgstr "" "這個模組提供單一類別 :class:`Headers`,用於使用類似對映的介面方便地操作 WSGI " "回應標頭。" -#: ../../library/wsgiref.rst:199 +#: ../../library/wsgiref.rst:200 msgid "" "Create a mapping-like object wrapping *headers*, which must be a list of " "header name/value tuples as described in :pep:`3333`. The default value of " @@ -313,7 +319,7 @@ msgstr "" "建立一個類似對映物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" "value 元組的標頭串列。*headers* 的預設值是一個空串列。" -#: ../../library/wsgiref.rst:203 +#: ../../library/wsgiref.rst:204 msgid "" ":class:`Headers` objects support typical mapping operations including :meth:" "`~object.__getitem__`, :meth:`~dict.get`, :meth:`~object.__setitem__`, :meth:" @@ -332,7 +338,7 @@ msgstr "" "標頭會刪除該標頭的所有現有值,然後將新值添加到包裝的標頭串列末尾。標頭的現有" "順序通常保持不變,新標頭會添加到包裝串列的末尾。" -#: ../../library/wsgiref.rst:213 +#: ../../library/wsgiref.rst:214 msgid "" "Unlike a dictionary, :class:`Headers` objects do not raise an error when you " "try to get or delete a key that isn't in the wrapped header list. Getting a " @@ -343,7 +349,7 @@ msgstr "" "不會引發例外錯誤。取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會" "有任何效果。" -#: ../../library/wsgiref.rst:218 +#: ../../library/wsgiref.rst:219 msgid "" ":class:`Headers` objects also support :meth:`keys`, :meth:`values`, and :" "meth:`items` methods. The lists returned by :meth:`keys` and :meth:`items` " @@ -358,7 +364,7 @@ msgstr "" "的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" "標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" -#: ../../library/wsgiref.rst:225 +#: ../../library/wsgiref.rst:226 msgid "" "Calling ``bytes()`` on a :class:`Headers` object returns a formatted " "bytestring suitable for transmission as HTTP response headers. Each header " @@ -370,7 +376,7 @@ msgstr "" "式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" "車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" -#: ../../library/wsgiref.rst:231 +#: ../../library/wsgiref.rst:232 msgid "" "In addition to their mapping interface and formatting features, :class:" "`Headers` objects also have the following methods for querying and adding " @@ -379,11 +385,11 @@ msgstr "" "除了對映介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" "的以及附加 MIME 參數標頭的方法:" -#: ../../library/wsgiref.rst:238 +#: ../../library/wsgiref.rst:239 msgid "Return a list of all the values for the named header." msgstr "回傳指定標頭的所有值的串列。" -#: ../../library/wsgiref.rst:240 +#: ../../library/wsgiref.rst:241 msgid "" "The returned list will be sorted in the order they appeared in the original " "header list or were added to this instance, and may contain duplicates. Any " @@ -394,14 +400,14 @@ msgstr "" "序,並且可能包含重複的內容。任何被刪除並重新插入的欄位都會被添加到標頭串列的" "末尾。如果不存在指定名稱的欄位,則回傳空串列。" -#: ../../library/wsgiref.rst:248 +#: ../../library/wsgiref.rst:249 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." msgstr "" "添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" -#: ../../library/wsgiref.rst:251 +#: ../../library/wsgiref.rst:252 msgid "" "*name* is the header field to add. Keyword arguments can be used to set " "MIME parameters for the header field. Each parameter must be a string or " @@ -418,27 +424,27 @@ msgstr "" "則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" "參數名稱。(這使用於沒有值的 MIME 參數)使用範例: ::" -#: ../../library/wsgiref.rst:259 +#: ../../library/wsgiref.rst:260 msgid "h.add_header('content-disposition', 'attachment', filename='bud.gif')" msgstr "h.add_header('content-disposition', 'attachment', filename='bud.gif')" -#: ../../library/wsgiref.rst:261 +#: ../../library/wsgiref.rst:262 msgid "The above will add a header that looks like this::" msgstr "上述操作將添加看起來像這樣的標頭: ::" -#: ../../library/wsgiref.rst:263 +#: ../../library/wsgiref.rst:264 msgid "Content-Disposition: attachment; filename=\"bud.gif\"" msgstr "Content-Disposition: attachment; filename=\"bud.gif\"" -#: ../../library/wsgiref.rst:266 +#: ../../library/wsgiref.rst:267 msgid "*headers* parameter is optional." msgstr "*headers* 參數是可選的。" -#: ../../library/wsgiref.rst:271 +#: ../../library/wsgiref.rst:272 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" msgstr ":mod:`wsgiref.simple_server` -- 一個簡單的 WSGI HTTP 伺服器" -#: ../../library/wsgiref.rst:277 +#: ../../library/wsgiref.rst:278 msgid "" "This module implements a simple HTTP server (based on :mod:`http.server`) " "that serves WSGI applications. Each server instance serves a single WSGI " @@ -454,7 +460,7 @@ msgstr "" "``PATH_INFO`` 去選擇為每個請求呼叫哪個應用程式。(例如,使用來自 :mod:" "`wsgiref.util` 的 :func:`shift_path_info` 函式。)" -#: ../../library/wsgiref.rst:288 +#: ../../library/wsgiref.rst:289 msgid "" "Create a new WSGI server listening on *host* and *port*, accepting " "connections for *app*. The return value is an instance of the supplied " @@ -466,7 +472,7 @@ msgstr "" "供 *server_class* 的實例,並將使用指定的 *handler_class* 處理請求。*app* 必須" "是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" -#: ../../library/wsgiref.rst:295 +#: ../../library/wsgiref.rst:296 msgid "" "from wsgiref.simple_server import make_server, demo_app\n" "\n" @@ -480,7 +486,7 @@ msgid "" " httpd.handle_request()" msgstr "" -#: ../../library/wsgiref.rst:309 +#: ../../library/wsgiref.rst:310 msgid "" "This function is a small but complete WSGI application that returns a text " "page containing the message \"Hello world!\" and a list of the key/value " @@ -493,7 +499,13 @@ msgstr "" "(例如 :mod:`wsgiref.simple_server`)是否能正確執行簡單的 WSGI 應用程式非常有" "用。" -#: ../../library/wsgiref.rst:318 +#: ../../library/wsgiref.rst:316 +msgid "" +"The *start_response* callable should follow the :class:`.StartResponse` " +"protocol." +msgstr "" + +#: ../../library/wsgiref.rst:321 msgid "" "Create a :class:`WSGIServer` instance. *server_address* should be a ``(host," "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" @@ -503,7 +515,7 @@ msgstr "" "port)`` 元組,而 *RequestHandlerClass* 應該是 :class:`http.server." "BaseHTTPRequestHandler` 的子類別,將用於處理請求。" -#: ../../library/wsgiref.rst:323 +#: ../../library/wsgiref.rst:326 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." @@ -511,7 +523,7 @@ msgstr "" "通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可" "以為你處理所有細節。" -#: ../../library/wsgiref.rst:326 +#: ../../library/wsgiref.rst:329 msgid "" ":class:`WSGIServer` is a subclass of :class:`http.server.HTTPServer`, so all " "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " @@ -521,17 +533,17 @@ msgstr "" "方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" "`WSGIServer` 也提供這些特定於 WSGI 的方法:" -#: ../../library/wsgiref.rst:333 +#: ../../library/wsgiref.rst:336 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." msgstr "將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" -#: ../../library/wsgiref.rst:339 +#: ../../library/wsgiref.rst:342 msgid "Returns the currently set application callable." msgstr "回傳目前設定應用程式的可呼叫物件。" -#: ../../library/wsgiref.rst:341 +#: ../../library/wsgiref.rst:344 msgid "" "Normally, however, you do not need to use these additional methods, as :meth:" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " @@ -541,7 +553,7 @@ msgstr "" "func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式(handler)實" "例的好處上。" -#: ../../library/wsgiref.rst:348 +#: ../../library/wsgiref.rst:351 msgid "" "Create an HTTP handler for the given *request* (i.e. a socket), " "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" @@ -551,7 +563,7 @@ msgstr "" "位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" "(handler)。" -#: ../../library/wsgiref.rst:351 +#: ../../library/wsgiref.rst:354 msgid "" "You do not need to create instances of this class directly; they are " "automatically created as needed by :class:`WSGIServer` objects. You can, " @@ -563,7 +575,7 @@ msgstr "" "建立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :" "func:`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" -#: ../../library/wsgiref.rst:360 +#: ../../library/wsgiref.rst:363 msgid "" "Return a :data:`~wsgiref.types.WSGIEnvironment` dictionary for a request. " "The default implementation copies the contents of the :class:`WSGIServer` " @@ -577,14 +589,14 @@ msgstr "" "從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" "`3333` 所指定的相關 CGI 環境變數的新字典。" -#: ../../library/wsgiref.rst:371 +#: ../../library/wsgiref.rst:374 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" "回傳的物件應該被用作 ``wsgi.errors`` 串流。預設實作只會回傳 ``sys.stderr``。" -#: ../../library/wsgiref.rst:377 +#: ../../library/wsgiref.rst:380 msgid "" "Process the HTTP request. The default implementation creates a handler " "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " @@ -593,11 +605,11 @@ msgstr "" "處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handler` 類別來建立處置程式" "(handler)實例來實作實際 WSGI 應用程式介面。" -#: ../../library/wsgiref.rst:383 +#: ../../library/wsgiref.rst:386 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" msgstr ":mod:`wsgiref.validate` --- WSGI 符合性檢查" -#: ../../library/wsgiref.rst:389 +#: ../../library/wsgiref.rst:392 msgid "" "When creating new WSGI application objects, frameworks, servers, or " "middleware, it can be useful to validate the new code's conformance using :" @@ -611,7 +623,7 @@ msgstr "" "個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用" "程式物件之間的通訊,以檢查雙方協議的符合性。" -#: ../../library/wsgiref.rst:396 +#: ../../library/wsgiref.rst:399 msgid "" "Note that this utility does not guarantee complete :pep:`3333` compliance; " "an absence of errors from this module does not necessarily mean that errors " @@ -623,7 +635,7 @@ msgstr "" "錯誤。但是,如果如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 " "100% 符合標準。" -#: ../../library/wsgiref.rst:401 +#: ../../library/wsgiref.rst:404 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." @@ -631,7 +643,7 @@ msgstr "" "這個模組基於 Ian Bicking 的 \"Python Paste\" 函式庫的 :mod:`paste.lint` 模" "組。" -#: ../../library/wsgiref.rst:407 +#: ../../library/wsgiref.rst:410 msgid "" "Wrap *application* and return a new WSGI application object. The returned " "application will forward all requests to the original *application*, and " @@ -642,7 +654,7 @@ msgstr "" "請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " "WSGI 規範和 :rfc:`2616`。" -#: ../../library/wsgiref.rst:412 +#: ../../library/wsgiref.rst:415 msgid "" "Any detected nonconformance results in an :exc:`AssertionError` being " "raised; note, however, that how these errors are handled is server-" @@ -658,7 +670,7 @@ msgstr "" "輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 ``sys.stderr`` 或是其他錯" "誤串流。" -#: ../../library/wsgiref.rst:419 +#: ../../library/wsgiref.rst:422 msgid "" "This wrapper may also generate output using the :mod:`warnings` module to " "indicate behaviors that are questionable but which may not actually be " @@ -672,7 +684,7 @@ msgstr "" "`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``\\ " "(*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" -#: ../../library/wsgiref.rst:428 +#: ../../library/wsgiref.rst:431 msgid "" "from wsgiref.validate import validator\n" "from wsgiref.simple_server import make_server\n" @@ -696,11 +708,11 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:451 +#: ../../library/wsgiref.rst:454 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" msgstr ":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" -#: ../../library/wsgiref.rst:457 +#: ../../library/wsgiref.rst:460 msgid "" "This module provides base handler classes for implementing WSGI servers and " "gateways. These base classes handle most of the work of communicating with " @@ -711,7 +723,7 @@ msgstr "" "處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" "輸入、輸出和錯誤串流。" -#: ../../library/wsgiref.rst:465 +#: ../../library/wsgiref.rst:468 msgid "" "CGI-based invocation via ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` and " "``os.environ``. This is useful when you have a WSGI application and want to " @@ -723,7 +735,7 @@ msgstr "" "很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望呼叫的 " "WSGI 應用程式物件。" -#: ../../library/wsgiref.rst:470 +#: ../../library/wsgiref.rst:473 msgid "" "This class is a subclass of :class:`BaseCGIHandler` that sets ``wsgi." "run_once`` to true, ``wsgi.multithread`` to false, and ``wsgi.multiprocess`` " @@ -734,7 +746,7 @@ msgstr "" "``wsgi.multithread`` 設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" "且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 串流以及環境。" -#: ../../library/wsgiref.rst:478 +#: ../../library/wsgiref.rst:481 msgid "" "A specialized alternative to :class:`CGIHandler`, for use when deploying on " "Microsoft's IIS web server, without having set the config allowPathInfo " @@ -744,7 +756,7 @@ msgstr "" "個專門替代選擇,無需設置 config 的 allowPathInfo 選項(IIS>=7),或 metabase " "的 allowPathInfoForScriptMappings 選項(IIS<7)。" -#: ../../library/wsgiref.rst:482 +#: ../../library/wsgiref.rst:485 msgid "" "By default, IIS gives a ``PATH_INFO`` that duplicates the ``SCRIPT_NAME`` at " "the front, causing problems for WSGI applications that wish to implement " @@ -754,7 +766,7 @@ msgstr "" "作路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" "徑。" -#: ../../library/wsgiref.rst:486 +#: ../../library/wsgiref.rst:489 msgid "" "IIS can be configured to pass the correct ``PATH_INFO``, but this causes " "another bug where ``PATH_TRANSLATED`` is wrong. Luckily this variable is " @@ -770,7 +782,7 @@ msgstr "" "``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" "使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" -#: ../../library/wsgiref.rst:494 +#: ../../library/wsgiref.rst:497 msgid "" "There is no way for CGI code to tell whether the option was set, so a " "separate handler class is provided. It is used in the same way as :class:" @@ -781,7 +793,7 @@ msgstr "" "別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 ``IISCGIHandler()." "run(app)`` 來使用,其中 ``app`` 是你希望呼叫的 WSGI 應用程式物件。" -#: ../../library/wsgiref.rst:504 +#: ../../library/wsgiref.rst:507 msgid "" "Similar to :class:`CGIHandler`, but instead of using the :mod:`sys` and :mod:" "`os` modules, the CGI environment and I/O streams are specified explicitly. " @@ -793,7 +805,7 @@ msgstr "" "指定 CGI 環境與 I/O 串流。*multithread* 和 *multiprocess* 值用於設置由處理程" "式(handler)實例運行的任何應用程式的旗標。" -#: ../../library/wsgiref.rst:510 +#: ../../library/wsgiref.rst:513 msgid "" "This class is a subclass of :class:`SimpleHandler` intended for use with " "software other than HTTP \"origin servers\". If you are writing a gateway " @@ -806,7 +818,7 @@ msgstr "" "狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別" "來替代 :class:`SimpleHandler`。" -#: ../../library/wsgiref.rst:519 +#: ../../library/wsgiref.rst:522 msgid "" "Similar to :class:`BaseCGIHandler`, but designed for use with HTTP origin " "servers. If you are writing an HTTP server implementation, you will " @@ -816,7 +828,7 @@ msgstr "" "在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替代 :class:" "`BaseCGIHandler`。" -#: ../../library/wsgiref.rst:523 +#: ../../library/wsgiref.rst:526 msgid "" "This class is a subclass of :class:`BaseHandler`. It overrides the :meth:`!" "__init__`, :meth:`~BaseHandler.get_stdin`, :meth:`~BaseHandler.get_stderr`, :" @@ -832,7 +844,7 @@ msgstr "" "`~BaseHandler._flush` 方法來明確提供設置環境與串流。提供的環境與串流被儲存" "在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` 環境中。" -#: ../../library/wsgiref.rst:532 +#: ../../library/wsgiref.rst:535 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." @@ -840,7 +852,7 @@ msgstr "" "*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊" "(chunk),像是 :class:`io.BufferedIOBase`。" -#: ../../library/wsgiref.rst:538 +#: ../../library/wsgiref.rst:541 msgid "" "This is an abstract base class for running WSGI applications. Each instance " "will handle a single HTTP request, although in principle you could create a " @@ -849,17 +861,17 @@ msgstr "" "這是一個運行 WSGI 應用程式的抽象基底類別。每個實例將處理單個 HTTP 請求,儘管" "原則上你可以建立一個可重用於多個請求的子類別。" -#: ../../library/wsgiref.rst:542 +#: ../../library/wsgiref.rst:545 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" msgstr ":class:`BaseHandler` 實例只有一個供外部使用的方法:" -#: ../../library/wsgiref.rst:547 +#: ../../library/wsgiref.rst:550 msgid "Run the specified WSGI application, *app*." msgstr "運行指定 WSGI 應用程式,*app*。" -#: ../../library/wsgiref.rst:549 +#: ../../library/wsgiref.rst:552 msgid "" "All of the other :class:`BaseHandler` methods are invoked by this method in " "the process of running the application, and thus exist primarily to allow " @@ -868,11 +880,11 @@ msgstr "" "此方法在運行應用程式的過程中呼叫了所有其他 :class:`BaseHandler` 的方法,因此" "這些方法主要存在是為了允許自定義整個過程。" -#: ../../library/wsgiref.rst:553 +#: ../../library/wsgiref.rst:556 msgid "The following methods MUST be overridden in a subclass:" msgstr "以下方法必須在子類別中覆寫:" -#: ../../library/wsgiref.rst:558 +#: ../../library/wsgiref.rst:561 msgid "" "Buffer the bytes *data* for transmission to the client. It's okay if this " "method actually transmits the data; :class:`BaseHandler` just separates " @@ -883,7 +895,7 @@ msgstr "" "底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" "刷新操作。" -#: ../../library/wsgiref.rst:566 +#: ../../library/wsgiref.rst:569 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." @@ -891,7 +903,7 @@ msgstr "" "強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如果 :" "meth:`_write` 實際上發送了數據),那麼是可以的。" -#: ../../library/wsgiref.rst:572 +#: ../../library/wsgiref.rst:575 msgid "" "Return an object compatible with :class:`~wsgiref.types.InputStream` " "suitable for use as the ``wsgi.input`` of the request currently being " @@ -900,7 +912,7 @@ msgstr "" "回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在" "處理請求的 ``wsgi.input``。" -#: ../../library/wsgiref.rst:579 +#: ../../library/wsgiref.rst:582 msgid "" "Return an object compatible with :class:`~wsgiref.types.ErrorStream` " "suitable for use as the ``wsgi.errors`` of the request currently being " @@ -909,13 +921,13 @@ msgstr "" "回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在" "處理請求的 ``wsgi.errors``。" -#: ../../library/wsgiref.rst:586 +#: ../../library/wsgiref.rst:589 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." msgstr "將當前請求的 CGI 變數插入到 :attr:`environ` 屬性中。" -#: ../../library/wsgiref.rst:588 +#: ../../library/wsgiref.rst:591 msgid "" "Here are some other methods and attributes you may wish to override. This " "list is only a summary, however, and does not include every method that can " @@ -927,11 +939,11 @@ msgstr "" "被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,你應該" "參考文件說明和原始碼以獲得更多資訊。" -#: ../../library/wsgiref.rst:594 +#: ../../library/wsgiref.rst:597 msgid "Attributes and methods for customizing the WSGI environment:" msgstr "用於自定義 WSGI 環境的屬性和方法:" -#: ../../library/wsgiref.rst:599 +#: ../../library/wsgiref.rst:602 msgid "" "The value to be used for the ``wsgi.multithread`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " @@ -940,7 +952,7 @@ msgstr "" "用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " "true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" -#: ../../library/wsgiref.rst:606 +#: ../../library/wsgiref.rst:609 msgid "" "The value to be used for the ``wsgi.multiprocess`` environment variable. It " "defaults to true in :class:`BaseHandler`, but may have a different default " @@ -949,7 +961,7 @@ msgstr "" "用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " "true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" -#: ../../library/wsgiref.rst:613 +#: ../../library/wsgiref.rst:616 msgid "" "The value to be used for the ``wsgi.run_once`` environment variable. It " "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " @@ -958,7 +970,7 @@ msgstr "" "用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," "但 :class:`CGIHandler` 預設將其設置為 true。" -#: ../../library/wsgiref.rst:620 +#: ../../library/wsgiref.rst:623 msgid "" "The default environment variables to be included in every request's WSGI " "environment. By default, this is a copy of ``os.environ`` at the time that :" @@ -971,7 +983,7 @@ msgstr "" "`wsgiref.handlers` 時的 ``os.environ`` 副本,但子類別可以在類別或實例層級建立" "自己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共享。" -#: ../../library/wsgiref.rst:630 +#: ../../library/wsgiref.rst:633 msgid "" "If the :attr:`origin_server` attribute is set, this attribute's value is " "used to set the default ``SERVER_SOFTWARE`` WSGI environment variable, and " @@ -984,14 +996,14 @@ msgstr "" "``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例如 :class:" "`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" -#: ../../library/wsgiref.rst:636 +#: ../../library/wsgiref.rst:639 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." msgstr "" "將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" -#: ../../library/wsgiref.rst:642 +#: ../../library/wsgiref.rst:645 msgid "" "Return the URL scheme being used for the current request. The default " "implementation uses the :func:`guess_scheme` function from :mod:`wsgiref." @@ -1002,7 +1014,7 @@ msgstr "" "`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" "attr:`environ` 變數。" -#: ../../library/wsgiref.rst:650 +#: ../../library/wsgiref.rst:653 msgid "" "Set the :attr:`environ` attribute to a fully populated WSGI environment. " "The default implementation uses all of the above methods and attributes, " @@ -1017,11 +1029,11 @@ msgstr "" "``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" "且 :attr:`server_software` 屬性被設置。" -#: ../../library/wsgiref.rst:657 +#: ../../library/wsgiref.rst:660 msgid "Methods and attributes for customizing exception handling:" msgstr "用於自定義例外處理的屬性和方法:" -#: ../../library/wsgiref.rst:662 +#: ../../library/wsgiref.rst:665 msgid "" "Log the *exc_info* tuple in the server log. *exc_info* is a ``(type, value, " "traceback)`` tuple. The default implementation simply writes the traceback " @@ -1035,7 +1047,7 @@ msgstr "" "並刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" "員,或執行其他被認為合適的操作。" -#: ../../library/wsgiref.rst:671 +#: ../../library/wsgiref.rst:674 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." @@ -1043,7 +1055,7 @@ msgstr "" "預設的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," "則包含所有幀。" -#: ../../library/wsgiref.rst:677 +#: ../../library/wsgiref.rst:680 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." @@ -1051,16 +1063,19 @@ msgstr "" "這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給用戶端" "前如果發生錯誤才會被呼叫。" -#: ../../library/wsgiref.rst:680 +#: ../../library/wsgiref.rst:683 +#, fuzzy msgid "" "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`)." +"described in the \"Error Handling\" section of :pep:`3333`). In particular, " +"the *start_response* callable should follow the :class:`.StartResponse` " +"protocol." msgstr "" "此方法使用 ``sys.exception()`` 存取當前的錯誤,當呼叫它(如 :pep:`3333` 的 " "\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。" -#: ../../library/wsgiref.rst:684 +#: ../../library/wsgiref.rst:689 msgid "" "The default implementation just uses the :attr:`error_status`, :attr:" "`error_headers`, and :attr:`error_body` attributes to generate an output " @@ -1069,7 +1084,7 @@ msgstr "" "預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" "`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" -#: ../../library/wsgiref.rst:688 +#: ../../library/wsgiref.rst:693 msgid "" "Note, however, that it's not recommended from a security perspective to spit " "out diagnostics to any old user; ideally, you should have to do something " @@ -1079,7 +1094,7 @@ msgstr "" "然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,你應該需" "要採取特殊措施才能啟用診斷輸出,這就是預設實作不包括任何診斷資訊的原因。" -#: ../../library/wsgiref.rst:696 +#: ../../library/wsgiref.rst:701 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." @@ -1087,7 +1102,7 @@ msgstr "" "用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;預設" "為 500 狀態碼和訊息。" -#: ../../library/wsgiref.rst:702 +#: ../../library/wsgiref.rst:707 msgid "" "The HTTP headers used for error responses. This should be a list of WSGI " "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " @@ -1097,7 +1112,7 @@ msgstr "" "value)`` 元組),如 :pep:`3333` 中所描述。預設串列只設置內容種類為 ``text/" "plain``。" -#: ../../library/wsgiref.rst:709 +#: ../../library/wsgiref.rst:714 msgid "" "The error response body. This should be an HTTP response body bytestring. " "It defaults to the plain text, \"A server error occurred. Please contact " @@ -1106,7 +1121,7 @@ msgstr "" "錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " "server error occurred. Please contact the administrator.\"" -#: ../../library/wsgiref.rst:713 +#: ../../library/wsgiref.rst:718 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" @@ -1114,7 +1129,7 @@ msgstr "" "用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法" "和屬性:" -#: ../../library/wsgiref.rst:719 +#: ../../library/wsgiref.rst:724 msgid "" "A ``wsgi.file_wrapper`` factory, compatible with :class:`wsgiref.types." "FileWrapper`, or ``None``. The default value of this attribute is the :" @@ -1124,7 +1139,7 @@ msgstr "" "FileWrapper` 相容,或者為 ``None``。這個屬性的預設值是 :class:`wsgiref.util." "FileWrapper` 類別。" -#: ../../library/wsgiref.rst:726 +#: ../../library/wsgiref.rst:731 msgid "" "Override to implement platform-specific file transmission. This method is " "called only if the application's return value is an instance of the class " @@ -1138,11 +1153,11 @@ msgstr "" "案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作只回傳一" "個 false 值。" -#: ../../library/wsgiref.rst:733 +#: ../../library/wsgiref.rst:738 msgid "Miscellaneous methods and attributes:" msgstr "其他方法和屬性:" -#: ../../library/wsgiref.rst:738 +#: ../../library/wsgiref.rst:743 msgid "" "This attribute should be set to a true value if the handler's :meth:`_write` " "and :meth:`_flush` are being used to communicate directly to the client, " @@ -1153,7 +1168,7 @@ msgstr "" "meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協議希望 " "HTTP 狀態在特殊的 ``Status:`` 標頭中。" -#: ../../library/wsgiref.rst:743 +#: ../../library/wsgiref.rst:748 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." @@ -1161,7 +1176,7 @@ msgstr "" "這個屬性在 :class:`BaseCGIHandler` 預設值為 true,但是在 :class:" "`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" -#: ../../library/wsgiref.rst:749 +#: ../../library/wsgiref.rst:754 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." @@ -1169,7 +1184,7 @@ msgstr "" "如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給用戶端的回應的 " "HTTP 版本。預設為 ``\"1.0\"``。" -#: ../../library/wsgiref.rst:755 +#: ../../library/wsgiref.rst:760 msgid "" "Transcode CGI variables from ``os.environ`` to :pep:`3333` \"bytes in " "unicode\" strings, returning a new dictionary. This function is used by :" @@ -1187,7 +1202,7 @@ msgstr "" "Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼" "不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" -#: ../../library/wsgiref.rst:764 +#: ../../library/wsgiref.rst:769 msgid "" "If you are implementing a CGI-based handler of your own, you probably want " "to use this routine instead of just copying values out of ``os.environ`` " @@ -1196,17 +1211,17 @@ msgstr "" "如果你自己正在實作 CGI-based 處理程式(handler),你可能想要使用這個函式來替" "換單純直接從 ``os.environ`` 中複製值。" -#: ../../library/wsgiref.rst:772 +#: ../../library/wsgiref.rst:777 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別" -#: ../../library/wsgiref.rst:778 +#: ../../library/wsgiref.rst:783 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型別檢查的型別。" -#: ../../library/wsgiref.rst:786 +#: ../../library/wsgiref.rst:791 #, fuzzy msgid "" "A :class:`typing.Protocol` describing :pep:`start_response() <3333#the-start-" @@ -1215,15 +1230,15 @@ msgstr "" "一個描述 :pep:`start_response() <3333#the-start-response-callable>` 可呼叫物" "件的 :class:`typing.Protocol` (:pep:`3333`)。" -#: ../../library/wsgiref.rst:792 +#: ../../library/wsgiref.rst:797 msgid "A type alias describing a WSGI environment dictionary." msgstr "一個描述 WSGI 環境字典的型別別名。" -#: ../../library/wsgiref.rst:796 +#: ../../library/wsgiref.rst:801 msgid "A type alias describing a WSGI application callable." msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" -#: ../../library/wsgiref.rst:800 +#: ../../library/wsgiref.rst:805 #, fuzzy msgid "" "A :class:`typing.Protocol` describing a :pep:`WSGI Input Stream <3333#input-" @@ -1232,7 +1247,7 @@ msgstr "" "一個描述 :pep:`WSGI 輸入串流 <3333#input-and-error-streams>`\\ 的 :class:" "`typing.Protocol`。" -#: ../../library/wsgiref.rst:805 +#: ../../library/wsgiref.rst:810 #, fuzzy msgid "" "A :class:`typing.Protocol` describing a :pep:`WSGI Error Stream <3333#input-" @@ -1241,7 +1256,7 @@ msgstr "" "一個描述 :pep:`WSGI 錯誤串流 <3333#input-and-error-streams>`\\ 的 :class:" "`typing.Protocol`。" -#: ../../library/wsgiref.rst:810 +#: ../../library/wsgiref.rst:815 #, fuzzy msgid "" "A :class:`typing.Protocol` describing a :pep:`file wrapper <3333#optional-" @@ -1252,15 +1267,18 @@ msgstr "" "handling>`\\ 的 :class:`typing.Protocol`。請參閱 :class:`wsgiref.util." "FileWrapper` 來瞭解此協議的具體實作。" -#: ../../library/wsgiref.rst:817 +#: ../../library/wsgiref.rst:822 msgid "Examples" msgstr "範例" -#: ../../library/wsgiref.rst:819 -msgid "This is a working \"Hello World\" WSGI application::" -msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式: ::" +#: ../../library/wsgiref.rst:824 +msgid "" +"This is a working \"Hello World\" WSGI application, where the " +"*start_response* callable should follow the :class:`.StartResponse` " +"protocol::" +msgstr "" -#: ../../library/wsgiref.rst:821 +#: ../../library/wsgiref.rst:827 msgid "" "\"\"\"\n" "Every WSGI application must have an application object - a callable\n" @@ -1289,7 +1307,7 @@ msgid "" " httpd.serve_forever()" msgstr "" -#: ../../library/wsgiref.rst:848 +#: ../../library/wsgiref.rst:854 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" @@ -1297,7 +1315,7 @@ msgstr "" "提供當前目錄的 WSGI 應用程式範例,並接受命令列上的可選目錄和埠號(預設:" "8000): ::" -#: ../../library/wsgiref.rst:851 +#: ../../library/wsgiref.rst:857 msgid "" "\"\"\"\n" "Small wsgiref based web server. Takes a path to serve from and an\n" @@ -1341,3 +1359,6 @@ msgid "" " print(\"Shutting down.\")\n" " httpd.server_close()" msgstr "" + +#~ msgid "This is a working \"Hello World\" WSGI application::" +#~ msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式: ::" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index a6c981f268..93cd20c6b2 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,29 +87,29 @@ msgid "" "class:`bytes` and :class:`bytearray` objects may be passed to calls. The " "*headers* parameter is an optional sequence of HTTP headers to send with " "each request, expressed as a sequence of 2-tuples representing the header " -"name and value. (e.g. ``[('Header-Name', 'value')]``). The obsolete " -"*use_datetime* flag is similar to *use_builtin_types* but it applies only to " -"date/time values." +"name and value. (e.g. ``[('Header-Name', 'value')]``). If an HTTPS URL is " +"provided, *context* may be :class:`ssl.SSLContext` and configures the SSL " +"settings of the underlying HTTPS connection. The obsolete *use_datetime* " +"flag is similar to *use_builtin_types* but it applies only to date/time " +"values." msgstr "" -#: ../../library/xmlrpc.client.rst:67 ../../library/xmlrpc.client.rst:549 +#: ../../library/xmlrpc.client.rst:69 ../../library/xmlrpc.client.rst:549 msgid "The *use_builtin_types* flag was added." msgstr "新增 *use_builtin_types* 旗標。" -#: ../../library/xmlrpc.client.rst:70 +#: ../../library/xmlrpc.client.rst:72 msgid "The *headers* parameter was added." msgstr "新增 *headers* 參數。" -#: ../../library/xmlrpc.client.rst:73 +#: ../../library/xmlrpc.client.rst:75 msgid "" "Both the HTTP and HTTPS transports support the URL syntax extension for HTTP " "Basic Authentication: ``http://user:pass@host:port/path``. The ``user:" "pass`` portion will be base64-encoded as an HTTP 'Authorization' header, and " "sent to the remote server as part of the connection process when invoking an " "XML-RPC method. You only need to use this if the remote server requires a " -"Basic Authentication user and password. If an HTTPS URL is provided, " -"*context* may be :class:`ssl.SSLContext` and configures the SSL settings of " -"the underlying HTTPS connection." +"Basic Authentication user and password." msgstr "" #: ../../library/xmlrpc.client.rst:82 diff --git a/reference/expressions.po b/reference/expressions.po index 2705f31c57..5fbc1d8823 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 09:21+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -715,7 +715,7 @@ msgid "" "*value* may be cleared." msgstr "" -#: ../../reference/expressions.rst:621 ../../reference/expressions.rst:802 +#: ../../reference/expressions.rst:621 ../../reference/expressions.rst:805 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." @@ -878,7 +878,7 @@ msgid "" "which are used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:757 +#: ../../reference/expressions.rst:758 msgid "" "Returns an awaitable which when run starts to execute the asynchronous " "generator or resumes it at the last executed yield expression. When an " @@ -893,12 +893,12 @@ msgid "" "has completed." msgstr "" -#: ../../reference/expressions.rst:769 +#: ../../reference/expressions.rst:770 msgid "" "This method is normally called implicitly by a :keyword:`async for` loop." msgstr "" -#: ../../reference/expressions.rst:774 +#: ../../reference/expressions.rst:776 msgid "" "Returns an awaitable which when run resumes the execution of the " "asynchronous generator. As with the :meth:`~generator.send` method for a " @@ -913,7 +913,7 @@ msgid "" "receive the value." msgstr "" -#: ../../reference/expressions.rst:790 +#: ../../reference/expressions.rst:793 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 " @@ -925,7 +925,7 @@ msgid "" "that exception propagates to the caller of the awaitable." msgstr "" -#: ../../reference/expressions.rst:810 +#: ../../reference/expressions.rst:814 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 " @@ -941,25 +941,25 @@ msgid "" "will return an awaitable that does nothing." msgstr "" -#: ../../reference/expressions.rst:826 +#: ../../reference/expressions.rst:830 msgid "Primaries" msgstr "" -#: ../../reference/expressions.rst:830 +#: ../../reference/expressions.rst:834 msgid "" "Primaries represent the most tightly bound operations of the language. Their " "syntax is:" msgstr "" -#: ../../reference/expressions.rst:840 +#: ../../reference/expressions.rst:844 msgid "Attribute references" msgstr "" -#: ../../reference/expressions.rst:846 +#: ../../reference/expressions.rst:850 msgid "An attribute reference is a primary followed by a period and a name:" msgstr "" -#: ../../reference/expressions.rst:856 +#: ../../reference/expressions.rst:860 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 " @@ -968,7 +968,7 @@ msgid "" "reference may yield different objects." msgstr "" -#: ../../reference/expressions.rst:862 +#: ../../reference/expressions.rst:866 msgid "" "This production can be customized by overriding the :meth:`~object." "__getattribute__` method or the :meth:`~object.__getattr__` method. The :" @@ -976,17 +976,17 @@ msgid "" "or raises :exc:`AttributeError` if the attribute is not available." msgstr "" -#: ../../reference/expressions.rst:868 +#: ../../reference/expressions.rst:872 msgid "" "If an :exc:`AttributeError` is raised and the object has a :meth:`!" "__getattr__` method, that method is called as a fallback." msgstr "" -#: ../../reference/expressions.rst:874 +#: ../../reference/expressions.rst:878 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:889 +#: ../../reference/expressions.rst:893 msgid "" "The subscription of an instance of a :ref:`container class <sequence-types>` " "will generally select an element from the container. The subscription of a :" @@ -994,13 +994,13 @@ msgid "" "`GenericAlias <types-genericalias>` object." msgstr "" -#: ../../reference/expressions.rst:897 +#: ../../reference/expressions.rst:901 msgid "" "When an object is subscripted, the interpreter will evaluate the primary and " "the expression list." msgstr "" -#: ../../reference/expressions.rst:900 +#: ../../reference/expressions.rst:904 msgid "" "The primary must evaluate to an object that supports subscription. An object " "may support subscription through defining one or both of :meth:`~object." @@ -1010,7 +1010,7 @@ msgid "" "called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:907 +#: ../../reference/expressions.rst:911 msgid "" "If the expression list contains at least one comma, or if any of the " "expressions are starred, the expression list will evaluate to a :class:" @@ -1018,17 +1018,17 @@ msgid "" "expression list will evaluate to the value of the list's sole member." msgstr "" -#: ../../reference/expressions.rst:912 +#: ../../reference/expressions.rst:916 msgid "Expressions in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:915 +#: ../../reference/expressions.rst:919 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:918 +#: ../../reference/expressions.rst:922 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 " @@ -1036,7 +1036,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:922 +#: ../../reference/expressions.rst:926 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 " @@ -1044,7 +1044,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:927 +#: ../../reference/expressions.rst:931 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences <sequence>`. However, built-in sequences all provide a :meth:" @@ -1058,25 +1058,25 @@ msgid "" "explicitly add that support." msgstr "" -#: ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:945 msgid "" "A :class:`string <str>` 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:949 +#: ../../reference/expressions.rst:953 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:963 +#: ../../reference/expressions.rst:967 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:976 +#: ../../reference/expressions.rst:980 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 " @@ -1086,7 +1086,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:988 +#: ../../reference/expressions.rst:992 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`~object.__getitem__` method as normal subscription) with a " @@ -1101,23 +1101,23 @@ msgid "" "missing expressions." msgstr "" -#: ../../reference/expressions.rst:1012 +#: ../../reference/expressions.rst:1016 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:1014 +#: ../../reference/expressions.rst:1018 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments <argument>`:" msgstr "" -#: ../../reference/expressions.rst:1031 +#: ../../reference/expressions.rst:1035 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:1037 +#: ../../reference/expressions.rst:1041 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -1127,7 +1127,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:1045 +#: ../../reference/expressions.rst:1049 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 " @@ -1148,7 +1148,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1065 +#: ../../reference/expressions.rst:1069 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1157,7 +1157,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1071 +#: ../../reference/expressions.rst:1075 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1166,7 +1166,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1077 +#: ../../reference/expressions.rst:1081 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 " @@ -1176,7 +1176,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1088 +#: ../../reference/expressions.rst:1092 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1186,14 +1186,14 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1095 +#: ../../reference/expressions.rst:1099 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:1099 +#: ../../reference/expressions.rst:1103 msgid "" ">>> def f(a, b):\n" "... print(a, b)\n" @@ -1219,13 +1219,13 @@ msgstr "" ">>> f(1, *(2,))\n" "1 2" -#: ../../reference/expressions.rst:1111 +#: ../../reference/expressions.rst:1115 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:1117 +#: ../../reference/expressions.rst:1121 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1234,7 +1234,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1123 +#: ../../reference/expressions.rst:1127 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 " @@ -1246,35 +1246,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1137 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:1136 +#: ../../reference/expressions.rst:1140 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:1142 +#: ../../reference/expressions.rst:1146 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:1146 +#: ../../reference/expressions.rst:1150 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1148 +#: ../../reference/expressions.rst:1152 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1155 +#: ../../reference/expressions.rst:1159 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 " @@ -1285,73 +1285,73 @@ msgid "" "``None``." msgstr "" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1166 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1173 +#: ../../reference/expressions.rst:1177 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:1176 +#: ../../reference/expressions.rst:1180 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1181 +#: ../../reference/expressions.rst:1185 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1183 +#: ../../reference/expressions.rst:1187 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1189 +#: ../../reference/expressions.rst:1193 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:1193 +#: ../../reference/expressions.rst:1197 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1198 +#: ../../reference/expressions.rst:1202 msgid "" "The class must define a :meth:`~object.__call__` method; the effect is then " "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:2007 +#: ../../reference/expressions.rst:1210 ../../reference/expressions.rst:2011 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1208 +#: ../../reference/expressions.rst:1212 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:1220 +#: ../../reference/expressions.rst:1224 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1226 +#: ../../reference/expressions.rst:1230 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:1232 +#: ../../reference/expressions.rst:1236 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:1236 +#: ../../reference/expressions.rst:1240 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 " @@ -1359,7 +1359,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1241 +#: ../../reference/expressions.rst:1245 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 " @@ -1367,41 +1367,41 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1246 +#: ../../reference/expressions.rst:1250 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:1250 +#: ../../reference/expressions.rst:1254 msgid "" "This operation can be customized using the special :meth:`~object.__pow__` " "and :meth:`~object.__rpow__` methods." msgstr "" -#: ../../reference/expressions.rst:1256 +#: ../../reference/expressions.rst:1260 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1266 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1273 +#: ../../reference/expressions.rst:1277 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`~object.__neg__` " "special method." msgstr "" -#: ../../reference/expressions.rst:1281 +#: ../../reference/expressions.rst:1285 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1288 +#: ../../reference/expressions.rst:1292 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1409,17 +1409,17 @@ msgid "" "meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1297 +#: ../../reference/expressions.rst:1301 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1304 +#: ../../reference/expressions.rst:1308 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1308 +#: ../../reference/expressions.rst:1312 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1427,7 +1427,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1323 +#: ../../reference/expressions.rst:1327 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1437,25 +1437,25 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1329 +#: ../../reference/expressions.rst:1333 msgid "" "This operation can be customized using the special :meth:`~object.__mul__` " "and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1336 +#: ../../reference/expressions.rst:1340 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1339 +#: ../../reference/expressions.rst:1343 msgid "" "This operation can be customized using the special :meth:`~object." "__matmul__` and :meth:`~object.__rmatmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1350 +#: ../../reference/expressions.rst:1354 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1465,7 +1465,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1357 +#: ../../reference/expressions.rst:1361 msgid "" "The division operation can be customized using the special :meth:`~object." "__truediv__` and :meth:`~object.__rtruediv__` methods. The floor division " @@ -1473,7 +1473,7 @@ msgid "" "and :meth:`~object.__rfloordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1366 +#: ../../reference/expressions.rst:1370 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1485,7 +1485,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1375 +#: ../../reference/expressions.rst:1379 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 " @@ -1493,7 +1493,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1384 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1502,20 +1502,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1385 +#: ../../reference/expressions.rst:1389 msgid "" "The *modulo* operation can be customized using the special :meth:`~object." "__mod__` and :meth:`~object.__rmod__` methods." msgstr "" -#: ../../reference/expressions.rst:1388 +#: ../../reference/expressions.rst:1392 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:1397 +#: ../../reference/expressions.rst:1401 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1523,40 +1523,40 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1402 +#: ../../reference/expressions.rst:1406 msgid "" "This operation can be customized using the special :meth:`~object.__add__` " "and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1414 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1413 +#: ../../reference/expressions.rst:1417 msgid "" "This operation can be customized using the special :meth:`~object.__sub__` " "and :meth:`~object.__rsub__` methods." msgstr "" -#: ../../reference/expressions.rst:1420 +#: ../../reference/expressions.rst:1424 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1427 +#: ../../reference/expressions.rst:1431 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1436 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:1435 +#: ../../reference/expressions.rst:1439 msgid "" "The left shift operation can be customized using the special :meth:`~object." "__lshift__` and :meth:`~object.__rlshift__` methods. The right shift " @@ -1564,46 +1564,46 @@ msgid "" "and :meth:`~object.__rrshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1442 +#: ../../reference/expressions.rst:1446 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:1449 +#: ../../reference/expressions.rst:1453 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1453 +#: ../../reference/expressions.rst:1457 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1464 +#: ../../reference/expressions.rst:1468 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:`~object." "__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1473 +#: ../../reference/expressions.rst:1477 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:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1482 +#: ../../reference/expressions.rst:1486 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:" "`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1490 +#: ../../reference/expressions.rst:1494 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1502 +#: ../../reference/expressions.rst:1506 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 " @@ -1611,14 +1611,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1512 +#: ../../reference/expressions.rst:1516 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:1518 +#: ../../reference/expressions.rst:1522 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 " @@ -1626,7 +1626,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1522 +#: ../../reference/expressions.rst:1526 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 " @@ -1634,24 +1634,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1527 +#: ../../reference/expressions.rst:1531 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:1534 +#: ../../reference/expressions.rst:1538 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1536 +#: ../../reference/expressions.rst:1540 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1539 +#: ../../reference/expressions.rst:1543 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 " @@ -1663,7 +1663,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1548 +#: ../../reference/expressions.rst:1552 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1671,7 +1671,7 @@ msgid "" "methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1554 +#: ../../reference/expressions.rst:1558 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1681,14 +1681,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1561 +#: ../../reference/expressions.rst:1565 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:1565 +#: ../../reference/expressions.rst:1569 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1697,13 +1697,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1571 +#: ../../reference/expressions.rst:1575 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1574 +#: ../../reference/expressions.rst:1578 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1713,7 +1713,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1581 +#: ../../reference/expressions.rst:1585 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 " @@ -1723,32 +1723,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1588 +#: ../../reference/expressions.rst:1592 msgid "" "``None`` and :data:`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:1592 +#: ../../reference/expressions.rst:1596 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:1596 +#: ../../reference/expressions.rst:1600 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:1600 +#: ../../reference/expressions.rst:1604 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1602 +#: ../../reference/expressions.rst:1606 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1757,7 +1757,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1608 +#: ../../reference/expressions.rst:1612 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1765,19 +1765,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1613 +#: ../../reference/expressions.rst:1617 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1615 +#: ../../reference/expressions.rst:1619 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:1620 +#: ../../reference/expressions.rst:1624 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 " @@ -1786,25 +1786,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1626 +#: ../../reference/expressions.rst:1630 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:1630 +#: ../../reference/expressions.rst:1634 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1632 +#: ../../reference/expressions.rst:1636 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1635 +#: ../../reference/expressions.rst:1639 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1815,110 +1815,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1643 +#: ../../reference/expressions.rst:1647 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1645 +#: ../../reference/expressions.rst:1649 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1648 +#: ../../reference/expressions.rst:1652 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1651 +#: ../../reference/expressions.rst:1655 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1654 +#: ../../reference/expressions.rst:1658 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1656 +#: ../../reference/expressions.rst:1660 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1659 +#: ../../reference/expressions.rst:1663 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1665 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1663 +#: ../../reference/expressions.rst:1667 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1665 +#: ../../reference/expressions.rst:1669 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1667 +#: ../../reference/expressions.rst:1671 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1674 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1672 +#: ../../reference/expressions.rst:1676 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1674 +#: ../../reference/expressions.rst:1678 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1681 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1679 +#: ../../reference/expressions.rst:1683 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1681 +#: ../../reference/expressions.rst:1685 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1683 +#: ../../reference/expressions.rst:1687 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:1687 +#: ../../reference/expressions.rst:1691 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:1691 +#: ../../reference/expressions.rst:1695 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:1700 +#: ../../reference/expressions.rst:1704 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1702 +#: ../../reference/expressions.rst:1706 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`` " @@ -1929,7 +1929,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1710 +#: ../../reference/expressions.rst:1714 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 " @@ -1937,14 +1937,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1715 +#: ../../reference/expressions.rst:1719 msgid "" "For user-defined classes which define the :meth:`~object.__contains__` " "method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " "value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1719 +#: ../../reference/expressions.rst:1723 msgid "" "For user-defined classes which do not define :meth:`~object.__contains__` " "but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " @@ -1953,7 +1953,7 @@ msgid "" "it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1725 +#: ../../reference/expressions.rst:1729 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1962,17 +1962,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1737 +#: ../../reference/expressions.rst:1741 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1750 +#: ../../reference/expressions.rst:1754 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1756 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 " @@ -1980,11 +1980,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1764 +#: ../../reference/expressions.rst:1768 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1775 +#: ../../reference/expressions.rst:1779 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1995,25 +1995,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1788 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1789 +#: ../../reference/expressions.rst:1793 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:1794 +#: ../../reference/expressions.rst:1798 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:1797 +#: ../../reference/expressions.rst:1801 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 " @@ -2024,11 +2024,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1816 +#: ../../reference/expressions.rst:1820 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1821 +#: ../../reference/expressions.rst:1825 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2036,11 +2036,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1830 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1828 +#: ../../reference/expressions.rst:1832 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2048,11 +2048,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1833 +#: ../../reference/expressions.rst:1837 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1835 +#: ../../reference/expressions.rst:1839 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2060,7 +2060,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1844 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2070,36 +2070,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1848 +#: ../../reference/expressions.rst:1852 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1855 +#: ../../reference/expressions.rst:1859 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1867 +#: ../../reference/expressions.rst:1871 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1870 +#: ../../reference/expressions.rst:1874 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:1874 +#: ../../reference/expressions.rst:1878 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1881 +#: ../../reference/expressions.rst:1885 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1892 +#: ../../reference/expressions.rst:1896 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2107,7 +2107,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1896 +#: ../../reference/expressions.rst:1900 msgid "" "def <lambda>(parameters):\n" " return expression" @@ -2115,25 +2115,25 @@ msgstr "" "def <lambda>(parameters):\n" " return expression" -#: ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1905 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:1909 +#: ../../reference/expressions.rst:1913 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1925 +#: ../../reference/expressions.rst:1929 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:1934 +#: ../../reference/expressions.rst:1938 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2141,16 +2141,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1943 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:1946 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1951 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2159,24 +2159,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1962 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1962 +#: ../../reference/expressions.rst:1966 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:1965 +#: ../../reference/expressions.rst:1969 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1968 +#: ../../reference/expressions.rst:1972 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2192,11 +2192,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1979 +#: ../../reference/expressions.rst:1983 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1984 +#: ../../reference/expressions.rst:1988 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2206,176 +2206,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1990 +#: ../../reference/expressions.rst:1994 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:1996 +#: ../../reference/expressions.rst:2000 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1996 +#: ../../reference/expressions.rst:2000 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:2002 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:2000 +#: ../../reference/expressions.rst:2004 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:2002 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2008 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2008 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2007 +#: ../../reference/expressions.rst:2011 msgid ":keyword:`await x <await>`" msgstr ":keyword:`await x <await>`" -#: ../../reference/expressions.rst:2009 +#: ../../reference/expressions.rst:2013 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2009 +#: ../../reference/expressions.rst:2013 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2011 +#: ../../reference/expressions.rst:2015 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2011 +#: ../../reference/expressions.rst:2015 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2013 +#: ../../reference/expressions.rst:2017 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2013 +#: ../../reference/expressions.rst:2017 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2017 +#: ../../reference/expressions.rst:2021 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2017 +#: ../../reference/expressions.rst:2021 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2019 +#: ../../reference/expressions.rst:2023 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2019 +#: ../../reference/expressions.rst:2023 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2021 +#: ../../reference/expressions.rst:2025 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2021 +#: ../../reference/expressions.rst:2025 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2023 +#: ../../reference/expressions.rst:2027 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2023 +#: ../../reference/expressions.rst:2027 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2025 +#: ../../reference/expressions.rst:2029 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2025 +#: ../../reference/expressions.rst:2029 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2027 +#: ../../reference/expressions.rst:2031 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2027 +#: ../../reference/expressions.rst:2031 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2031 +#: ../../reference/expressions.rst:2035 msgid ":keyword:`not x <not>`" msgstr ":keyword:`not x <not>`" -#: ../../reference/expressions.rst:2031 +#: ../../reference/expressions.rst:2035 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2033 +#: ../../reference/expressions.rst:2037 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2033 +#: ../../reference/expressions.rst:2037 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2035 +#: ../../reference/expressions.rst:2039 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2035 +#: ../../reference/expressions.rst:2039 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2037 +#: ../../reference/expressions.rst:2041 msgid ":keyword:`if <if_expr>` -- :keyword:`!else`" msgstr ":keyword:`if <if_expr>` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2037 +#: ../../reference/expressions.rst:2041 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2039 +#: ../../reference/expressions.rst:2043 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2039 +#: ../../reference/expressions.rst:2043 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2041 +#: ../../reference/expressions.rst:2045 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2041 +#: ../../reference/expressions.rst:2045 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2046 +#: ../../reference/expressions.rst:2050 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2047 +#: ../../reference/expressions.rst:2051 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 " @@ -2387,7 +2387,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2056 +#: ../../reference/expressions.rst:2060 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, " @@ -2395,7 +2395,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2061 +#: ../../reference/expressions.rst:2065 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 " @@ -2409,7 +2409,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2072 +#: ../../reference/expressions.rst:2076 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2417,13 +2417,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2077 +#: ../../reference/expressions.rst:2081 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:2080 +#: ../../reference/expressions.rst:2084 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2431,22 +2431,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2085 +#: ../../reference/expressions.rst:2089 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:2088 +#: ../../reference/expressions.rst:2092 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1766 -#: ../../reference/expressions.rst:1806 ../../reference/expressions.rst:1857 -#: ../../reference/expressions.rst:1883 ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1770 +#: ../../reference/expressions.rst:1810 ../../reference/expressions.rst:1861 +#: ../../reference/expressions.rst:1887 ../../reference/expressions.rst:1915 msgid "expression" msgstr "" @@ -2454,8 +2454,8 @@ msgstr "" msgid "BNF" msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1258 -#: ../../reference/expressions.rst:1306 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1310 msgid "arithmetic" msgstr "" @@ -2477,9 +2477,9 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:569 #: ../../reference/expressions.rst:624 ../../reference/expressions.rst:753 -#: ../../reference/expressions.rst:805 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:1295 ../../reference/expressions.rst:1344 -#: ../../reference/expressions.rst:1440 +#: ../../reference/expressions.rst:808 ../../reference/expressions.rst:855 +#: ../../reference/expressions.rst:1299 ../../reference/expressions.rst:1348 +#: ../../reference/expressions.rst:1444 msgid "exception" msgstr "" @@ -2519,11 +2519,11 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 #: ../../reference/expressions.rst:372 ../../reference/expressions.rst:393 #: ../../reference/expressions.rst:557 ../../reference/expressions.rst:743 -#: ../../reference/expressions.rst:851 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1163 -#: ../../reference/expressions.rst:1177 ../../reference/expressions.rst:1184 -#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:855 ../../reference/expressions.rst:884 +#: ../../reference/expressions.rst:961 ../../reference/expressions.rst:1005 +#: ../../reference/expressions.rst:1153 ../../reference/expressions.rst:1167 +#: ../../reference/expressions.rst:1181 ../../reference/expressions.rst:1188 +#: ../../reference/expressions.rst:1735 ../../reference/expressions.rst:1927 msgid "object" msgstr "object(物件)" @@ -2532,7 +2532,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:162 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1005 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2544,19 +2544,19 @@ msgstr "" msgid "empty" msgstr "" -#: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:175 ../../reference/expressions.rst:884 +#: ../../reference/expressions.rst:961 ../../reference/expressions.rst:1927 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1949 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 -#: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:955 ../../reference/expressions.rst:1005 +#: ../../reference/expressions.rst:1915 msgid ", (comma)" msgstr ", (逗號)" @@ -2573,7 +2573,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1861 msgid "if" msgstr "if" @@ -2581,13 +2581,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1202 +#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1206 msgid "await" msgstr "await" -#: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:275 ../../reference/expressions.rst:855 +#: ../../reference/expressions.rst:884 ../../reference/expressions.rst:961 +#: ../../reference/expressions.rst:1915 msgid "list" msgstr "list(串列)" @@ -2596,7 +2596,7 @@ msgstr "list(串列)" msgid "display" msgstr "" -#: ../../reference/expressions.rst:275 ../../reference/expressions.rst:876 +#: ../../reference/expressions.rst:275 ../../reference/expressions.rst:880 msgid "[] (square brackets)" msgstr "[] (方括號)" @@ -2605,7 +2605,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1915 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2622,7 +2622,7 @@ msgid "set expression" msgstr "set expression(集合運算式)" #: ../../reference/expressions.rst:329 ../../reference/expressions.rst:355 -#: ../../reference/expressions.rst:880 +#: ../../reference/expressions.rst:884 msgid "dictionary" msgstr "dictionary(字典)" @@ -2642,8 +2642,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:329 ../../reference/expressions.rst:955 +#: ../../reference/expressions.rst:1887 msgid ": (colon)" msgstr ": (冒號)" @@ -2655,13 +2655,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1088 +#: ../../reference/expressions.rst:1934 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1114 -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1118 +#: ../../reference/expressions.rst:1226 msgid "**" msgstr "**" @@ -2678,7 +2678,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1202 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1206 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2690,8 +2690,8 @@ msgstr "yield" msgid "from" msgstr "from" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1153 +#: ../../reference/expressions.rst:1167 ../../reference/expressions.rst:1887 msgid "function" msgstr "function (函式)" @@ -2707,7 +2707,7 @@ msgstr "yield from expression(yield from 運算式)" msgid "StopIteration" msgstr "StopIteration" -#: ../../reference/expressions.rst:624 ../../reference/expressions.rst:805 +#: ../../reference/expressions.rst:624 ../../reference/expressions.rst:808 msgid "GeneratorExit" msgstr "GeneratorExit" @@ -2723,489 +2723,489 @@ msgstr "asynchronous-generator(非同步產生器)" msgid "StopAsyncIteration" msgstr "StopAsyncIteration" -#: ../../reference/expressions.rst:828 +#: ../../reference/expressions.rst:832 msgid "primary" msgstr "primary(主要)" -#: ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:846 msgid "attribute" msgstr "attribute(屬性)" -#: ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:846 msgid "reference" msgstr "reference(參照)" -#: ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:846 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:846 msgid "attribute reference" msgstr "attribute reference(屬性參照)" -#: ../../reference/expressions.rst:851 +#: ../../reference/expressions.rst:855 msgid "AttributeError" msgstr "AttributeError" -#: ../../reference/expressions.rst:851 +#: ../../reference/expressions.rst:855 msgid "module" msgstr "module(模組)" -#: ../../reference/expressions.rst:876 +#: ../../reference/expressions.rst:880 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:884 ../../reference/expressions.rst:961 +#: ../../reference/expressions.rst:1735 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/expressions.rst:880 +#: ../../reference/expressions.rst:884 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:937 -#: ../../reference/expressions.rst:957 +#: ../../reference/expressions.rst:884 ../../reference/expressions.rst:941 +#: ../../reference/expressions.rst:961 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:880 ../../reference/expressions.rst:937 +#: ../../reference/expressions.rst:884 ../../reference/expressions.rst:941 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:937 +#: ../../reference/expressions.rst:941 msgid "character" msgstr "character(字元)" -#: ../../reference/expressions.rst:951 +#: ../../reference/expressions.rst:955 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:951 +#: ../../reference/expressions.rst:955 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:983 +#: ../../reference/expressions.rst:987 msgid "start (slice object attribute)" msgstr "start(切片物件屬性)" -#: ../../reference/expressions.rst:983 +#: ../../reference/expressions.rst:987 msgid "stop (slice object attribute)" msgstr "stop(切片物件屬性)" -#: ../../reference/expressions.rst:983 +#: ../../reference/expressions.rst:987 msgid "step (slice object attribute)" msgstr "step(切片物件屬性)" -#: ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1005 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1177 -#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1005 ../../reference/expressions.rst:1153 +#: ../../reference/expressions.rst:1167 ../../reference/expressions.rst:1181 +#: ../../reference/expressions.rst:1188 ../../reference/expressions.rst:1198 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1005 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1034 +#: ../../reference/expressions.rst:1005 ../../reference/expressions.rst:1038 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1005 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:1001 +#: ../../reference/expressions.rst:1005 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1114 +#: ../../reference/expressions.rst:1005 ../../reference/expressions.rst:1088 +#: ../../reference/expressions.rst:1118 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:1034 +#: ../../reference/expressions.rst:1038 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1319 -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1088 ../../reference/expressions.rst:1323 +#: ../../reference/expressions.rst:1934 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1149 +#: ../../reference/expressions.rst:1153 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1149 +#: ../../reference/expressions.rst:1153 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1167 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1167 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1167 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1177 +#: ../../reference/expressions.rst:1181 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1177 +#: ../../reference/expressions.rst:1181 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1184 +#: ../../reference/expressions.rst:1188 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1188 ../../reference/expressions.rst:1198 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1198 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1226 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1258 -#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1422 -#: ../../reference/expressions.rst:1451 ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1226 ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1310 ../../reference/expressions.rst:1426 +#: ../../reference/expressions.rst:1455 ../../reference/expressions.rst:1770 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1267 -#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1284 -#: ../../reference/expressions.rst:1319 ../../reference/expressions.rst:1332 -#: ../../reference/expressions.rst:1344 ../../reference/expressions.rst:1362 -#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 -#: ../../reference/expressions.rst:1422 ../../reference/expressions.rst:1460 -#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 -#: ../../reference/expressions.rst:1492 ../../reference/expressions.rst:1731 -#: ../../reference/expressions.rst:1740 ../../reference/expressions.rst:1782 -#: ../../reference/expressions.rst:1787 ../../reference/expressions.rst:1792 -#: ../../reference/expressions.rst:1857 ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1226 ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1280 ../../reference/expressions.rst:1288 +#: ../../reference/expressions.rst:1323 ../../reference/expressions.rst:1336 +#: ../../reference/expressions.rst:1348 ../../reference/expressions.rst:1366 +#: ../../reference/expressions.rst:1396 ../../reference/expressions.rst:1409 +#: ../../reference/expressions.rst:1426 ../../reference/expressions.rst:1464 +#: ../../reference/expressions.rst:1472 ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1496 ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1744 ../../reference/expressions.rst:1786 +#: ../../reference/expressions.rst:1791 ../../reference/expressions.rst:1796 +#: ../../reference/expressions.rst:1861 ../../reference/expressions.rst:1985 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1262 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1258 ../../reference/expressions.rst:1451 -#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1468 -#: ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1262 ../../reference/expressions.rst:1455 +#: ../../reference/expressions.rst:1464 ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1481 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1267 +#: ../../reference/expressions.rst:1271 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1267 +#: ../../reference/expressions.rst:1271 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1271 ../../reference/expressions.rst:1409 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1276 +#: ../../reference/expressions.rst:1271 ../../reference/expressions.rst:1280 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1276 +#: ../../reference/expressions.rst:1280 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1392 +#: ../../reference/expressions.rst:1280 ../../reference/expressions.rst:1396 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1288 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1288 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1295 +#: ../../reference/expressions.rst:1299 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1451 +#: ../../reference/expressions.rst:1310 ../../reference/expressions.rst:1455 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1319 +#: ../../reference/expressions.rst:1323 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1332 +#: ../../reference/expressions.rst:1336 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1332 +#: ../../reference/expressions.rst:1336 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1348 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1348 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1348 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1348 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1366 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1366 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1392 +#: ../../reference/expressions.rst:1396 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1396 ../../reference/expressions.rst:1409 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1409 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1426 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1426 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1426 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1440 +#: ../../reference/expressions.rst:1444 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1787 +#: ../../reference/expressions.rst:1464 ../../reference/expressions.rst:1791 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1460 +#: ../../reference/expressions.rst:1464 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1472 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1472 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 -#: ../../reference/expressions.rst:1792 +#: ../../reference/expressions.rst:1472 ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1796 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1472 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1481 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1481 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1492 +#: ../../reference/expressions.rst:1496 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1516 +#: ../../reference/expressions.rst:1520 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1516 +#: ../../reference/expressions.rst:1520 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1735 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1735 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1735 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1740 +#: ../../reference/expressions.rst:1735 ../../reference/expressions.rst:1744 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1740 +#: ../../reference/expressions.rst:1744 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1740 +#: ../../reference/expressions.rst:1744 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1740 +#: ../../reference/expressions.rst:1744 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1770 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1770 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1786 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1810 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1810 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1810 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1810 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1806 +#: ../../reference/expressions.rst:1810 #, fuzzy msgid "assignment" msgstr "argument(引數)" -#: ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1861 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1861 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1861 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1861 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1887 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1887 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1887 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1887 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1934 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1934 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1949 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1964 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1964 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1985 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 5fb5537144..d38e04ceba 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -358,10 +358,10 @@ msgstr "" #, fuzzy msgid "" "String literals can span multiple lines. One way is using triple-quotes: " -"``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically " -"included in the string, but it's possible to prevent this by adding a ``\\`` " -"at the end of the line. In the following example, the initial newline is " -"not included::" +"``\"\"\"...\"\"\"`` or ``'''...'''``. End-of-line characters are " +"automatically included in the string, but it's possible to prevent this by " +"adding a ``\\`` at the end of the line. In the following example, the " +"initial newline is not included::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:``\"\"\"...\"\"\"`` 或 " "``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` 來取" diff --git a/tutorial/modules.po b/tutorial/modules.po index 8c498966e7..2d0f59d379 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-13 17:13+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin <linooohon@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -623,11 +623,12 @@ msgstr "" "list: ::" #: ../../tutorial/modules.rst:312 +#, fuzzy msgid "" ">>> import fibo, sys\n" ">>> dir(fibo)\n" "['__name__', 'fib', 'fib2']\n" -">>> dir(sys) \n" +">>> dir(sys)\n" "['__breakpointhook__', '__displayhook__', '__doc__', '__excepthook__',\n" " '__interactivehook__', '__loader__', '__name__', '__package__', " "'__spec__',\n" @@ -724,9 +725,10 @@ msgstr "" "準模組 :mod:`builtins` 內: ::" #: ../../tutorial/modules.rst:354 +#, fuzzy msgid "" ">>> import builtins\n" -">>> dir(builtins) \n" +">>> dir(builtins)\n" "['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',\n" " 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',\n" " 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError',\n" diff --git a/using/configure.po b/using/configure.po index 3c2f276e05..6c0902a143 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -604,11 +604,11 @@ msgstr "設定選項" msgid "C compiler options" msgstr "C 編譯器指令。" -#: ../../using/configure.rst:338 ../../using/configure.rst:1245 +#: ../../using/configure.rst:338 ../../using/configure.rst:1251 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:342 ../../using/configure.rst:1257 +#: ../../using/configure.rst:342 ../../using/configure.rst:1263 msgid "C compiler flags." msgstr "C 編譯器旗標。" @@ -1387,44 +1387,56 @@ msgid "Options:" msgstr "選項:" #: ../../using/configure.rst:951 -msgid "``universal2``;" +#, fuzzy +msgid "``universal2`` (x86-64 and arm64);" msgstr "``universal2``;" #: ../../using/configure.rst:952 -msgid "``32-bit``;" -msgstr "``32-bit``;" +msgid "``32-bit`` (PPC and i386);" +msgstr "" #: ../../using/configure.rst:953 -msgid "``64-bit``;" -msgstr "``64-bit``;" +msgid "``64-bit`` (PPC64 and x86-64);" +msgstr "" #: ../../using/configure.rst:954 -msgid "``3-way``;" -msgstr "``3-way``;" +msgid "``3-way`` (i386, PPC and x86-64);" +msgstr "" #: ../../using/configure.rst:955 -msgid "``intel``;" -msgstr "``intel``;" +msgid "``intel`` (i386 and x86-64);" +msgstr "" #: ../../using/configure.rst:956 -msgid "``intel-32``;" +#, fuzzy +msgid "``intel-32`` (i386);" msgstr "``intel-32``;" #: ../../using/configure.rst:957 -msgid "``intel-64``;" +#, fuzzy +msgid "``intel-64`` (x86-64);" msgstr "``intel-64``;" #: ../../using/configure.rst:958 -msgid "``all``." -msgstr "``all``。" +msgid "``all`` (PPC, i386, PPC64 and x86-64)." +msgstr "" + +#: ../../using/configure.rst:960 +msgid "" +"Note that values for this configuration item are *not* the same as the " +"identifiers used for universal binary wheels on macOS. See the Python " +"Packaging User Guide for details on the `packaging platform compatibility " +"tags used on macOS <https://packaging.python.org/en/latest/specifications/" +"platform-compatibility-tags/#macos>`_" +msgstr "" -#: ../../using/configure.rst:962 +#: ../../using/configure.rst:968 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:968 +#: ../../using/configure.rst:974 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1433,31 +1445,31 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:983 #, fuzzy msgid "iOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:979 +#: ../../using/configure.rst:985 #, fuzzy msgid "See :source:`iOS/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:983 +#: ../../using/configure.rst:989 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:994 msgid "Specify the name for the framework (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:998 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:994 +#: ../../using/configure.rst:1000 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 " @@ -1465,28 +1477,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:1007 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1011 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:1009 +#: ../../using/configure.rst:1015 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:1015 +#: ../../using/configure.rst:1021 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1017 +#: ../../using/configure.rst:1023 msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:1019 +#: ../../using/configure.rst:1025 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1498,15 +1510,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1028 +#: ../../using/configure.rst:1034 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1033 +#: ../../using/configure.rst:1039 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1035 +#: ../../using/configure.rst:1041 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1518,64 +1530,64 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1042 +#: ../../using/configure.rst:1048 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:1045 +#: ../../using/configure.rst:1051 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:1047 +#: ../../using/configure.rst:1053 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:1048 +#: ../../using/configure.rst:1054 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:1049 +#: ../../using/configure.rst:1055 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:1050 +#: ../../using/configure.rst:1056 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1054 +#: ../../using/configure.rst:1060 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1056 +#: ../../using/configure.rst:1062 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:1057 +#: ../../using/configure.rst:1063 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1058 +#: ../../using/configure.rst:1064 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1060 +#: ../../using/configure.rst:1066 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1063 +#: ../../using/configure.rst:1069 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1066 +#: ../../using/configure.rst:1072 msgid "make" msgstr "" -#: ../../using/configure.rst:1068 +#: ../../using/configure.rst:1074 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1586,20 +1598,20 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1077 +#: ../../using/configure.rst:1083 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "" -#: ../../using/configure.rst:1078 +#: ../../using/configure.rst:1084 msgid "``build_wasm`` (configured with ``--with-emscripten-target``)" msgstr "" -#: ../../using/configure.rst:1079 +#: ../../using/configure.rst:1085 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "" -#: ../../using/configure.rst:1081 +#: ../../using/configure.rst:1087 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1612,11 +1624,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1094 +#: ../../using/configure.rst:1100 msgid "make platform" msgstr "" -#: ../../using/configure.rst:1096 +#: ../../using/configure.rst:1102 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1624,82 +1636,82 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1103 +#: ../../using/configure.rst:1109 msgid "make profile-opt" msgstr "" -#: ../../using/configure.rst:1105 +#: ../../using/configure.rst:1111 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1113 +#: ../../using/configure.rst:1119 msgid "make clean" msgstr "" -#: ../../using/configure.rst:1115 +#: ../../using/configure.rst:1121 msgid "Remove built files." msgstr "" -#: ../../using/configure.rst:1119 +#: ../../using/configure.rst:1125 msgid "make distclean" msgstr "" -#: ../../using/configure.rst:1121 +#: ../../using/configure.rst:1127 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1127 +#: ../../using/configure.rst:1133 msgid "make install" msgstr "" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1135 msgid "Build the ``all`` target and install Python." msgstr "" -#: ../../using/configure.rst:1133 +#: ../../using/configure.rst:1139 msgid "make test" msgstr "" -#: ../../using/configure.rst:1135 +#: ../../using/configure.rst:1141 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option. Variables:" msgstr "" -#: ../../using/configure.rst:1138 +#: ../../using/configure.rst:1144 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "" -#: ../../using/configure.rst:1139 +#: ../../using/configure.rst:1145 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "" -#: ../../using/configure.rst:1140 +#: ../../using/configure.rst:1146 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "" -#: ../../using/configure.rst:1144 +#: ../../using/configure.rst:1150 #, fuzzy msgid "make buildbottest" msgstr "主要建置步驟" -#: ../../using/configure.rst:1146 +#: ../../using/configure.rst:1152 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1151 +#: ../../using/configure.rst:1157 msgid "make regen-all" msgstr "" -#: ../../using/configure.rst:1153 +#: ../../using/configure.rst:1159 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1707,18 +1719,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1160 +#: ../../using/configure.rst:1166 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1162 +#: ../../using/configure.rst:1168 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:1166 +#: ../../using/configure.rst:1172 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1729,14 +1741,14 @@ msgid "" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" -#: ../../using/configure.rst:1176 +#: ../../using/configure.rst:1182 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:1180 +#: ../../using/configure.rst:1186 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -1752,7 +1764,7 @@ msgstr "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1188 +#: ../../using/configure.rst:1194 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-" @@ -1760,304 +1772,304 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1192 +#: ../../using/configure.rst:1198 msgid "" "The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:1196 +#: ../../using/configure.rst:1202 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1197 +#: ../../using/configure.rst:1203 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1199 +#: ../../using/configure.rst:1205 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1205 +#: ../../using/configure.rst:1211 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1207 +#: ../../using/configure.rst:1213 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1211 +#: ../../using/configure.rst:1217 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:1215 +#: ../../using/configure.rst:1221 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1221 +#: ../../using/configure.rst:1227 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1224 ../../using/configure.rst:1414 +#: ../../using/configure.rst:1230 ../../using/configure.rst:1420 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:1234 +#: ../../using/configure.rst:1240 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1236 +#: ../../using/configure.rst:1242 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1241 +#: ../../using/configure.rst:1247 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1247 +#: ../../using/configure.rst:1253 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:1251 +#: ../../using/configure.rst:1257 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1253 +#: ../../using/configure.rst:1259 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1261 +#: ../../using/configure.rst:1267 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 :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1265 +#: ../../using/configure.rst:1271 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1267 +#: ../../using/configure.rst:1273 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:1272 +#: ../../using/configure.rst:1278 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1280 +#: ../../using/configure.rst:1286 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1287 +#: ../../using/configure.rst:1293 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1291 +#: ../../using/configure.rst:1297 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1298 +#: ../../using/configure.rst:1304 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1305 +#: ../../using/configure.rst:1311 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1309 +#: ../../using/configure.rst:1315 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1313 +#: ../../using/configure.rst:1319 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1319 +#: ../../using/configure.rst:1325 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:1321 +#: ../../using/configure.rst:1327 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1325 +#: ../../using/configure.rst:1331 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1327 +#: ../../using/configure.rst:1333 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:1332 +#: ../../using/configure.rst:1338 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:1336 +#: ../../using/configure.rst:1342 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:1342 +#: ../../using/configure.rst:1348 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1344 +#: ../../using/configure.rst:1350 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:1350 +#: ../../using/configure.rst:1356 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:1356 +#: ../../using/configure.rst:1362 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1359 +#: ../../using/configure.rst:1365 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:1365 +#: ../../using/configure.rst:1371 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1367 +#: ../../using/configure.rst:1373 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:1371 +#: ../../using/configure.rst:1377 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1375 +#: ../../using/configure.rst:1381 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1377 +#: ../../using/configure.rst:1383 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:1381 +#: ../../using/configure.rst:1387 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1383 +#: ../../using/configure.rst:1389 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:1391 +#: ../../using/configure.rst:1397 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 :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1395 +#: ../../using/configure.rst:1401 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1397 +#: ../../using/configure.rst:1403 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:1404 +#: ../../using/configure.rst:1410 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1411 +#: ../../using/configure.rst:1417 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1420 +#: ../../using/configure.rst:1426 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1423 +#: ../../using/configure.rst:1429 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1427 +#: ../../using/configure.rst:1433 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1429 +#: ../../using/configure.rst:1435 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1433 +#: ../../using/configure.rst:1439 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1435 +#: ../../using/configure.rst:1441 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1439 +#: ../../using/configure.rst:1445 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1443 +#: ../../using/configure.rst:1449 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1449 +#: ../../using/configure.rst:1455 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1455 +#: ../../using/configure.rst:1461 msgid "Footnotes" msgstr "" -#: ../../using/configure.rst:1456 +#: ../../using/configure.rst:1462 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " @@ -2067,5 +2079,20 @@ msgid "" "Git, including your new, uncommitted work." msgstr "" +#~ msgid "``32-bit``;" +#~ msgstr "``32-bit``;" + +#~ msgid "``64-bit``;" +#~ msgstr "``64-bit``;" + +#~ msgid "``3-way``;" +#~ msgstr "``3-way``;" + +#~ msgid "``intel``;" +#~ msgstr "``intel``;" + +#~ msgid "``all``." +#~ msgstr "``all``。" + #~ msgid "Define the ``WITH_EDITLINE`` macro." #~ msgstr "定義 ``WITH_EDITLINE`` 巨集。" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 11cffbb96a..d30361cd6f 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1465,7 +1465,7 @@ msgid "" ">>> for letter in 'here is a sample of english text':\n" "... c[letter] += 1\n" "...\n" -">>> c \n" +">>> c\n" "Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,\n" "'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,\n" "'p': 1, 'r': 1, 'x': 1})\n" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 71d896e9f9..c032676b0b 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1995,7 +1995,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:80 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2499,10 +2499,21 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:58 #, fuzzy +msgid ":mod:`sysconfig`:" +msgstr ":mod:`os`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:60 +msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +#, fuzzy msgid ":mod:`threading`:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-3.15.rst:60 +#: ../../deprecations/pending-removal-in-3.15.rst:65 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -2510,12 +2521,12 @@ msgid "" "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:71 #, fuzzy msgid ":mod:`types`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:73 #, fuzzy msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " @@ -2528,7 +2539,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:82 #, fuzzy msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." @@ -2540,19 +2551,19 @@ msgstr "" "NamedTuple(\"NT\", x=int)``) 已棄用,並將在 3.15 中被禁止。請改用基於類別的語" "法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:83 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:93 #, fuzzy msgid ":mod:`wave`:" msgstr ":mod:`os`:" -#: ../../deprecations/pending-removal-in-3.15.rst:90 +#: ../../deprecations/pending-removal-in-3.15.rst:95 #, fuzzy msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." @@ -2910,17 +2921,10 @@ msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" #: ../../deprecations/pending-removal-in-future.rst:108 -msgid "" -":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " -"ignored." -msgstr "" -":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" - -#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:113 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -2928,11 +2932,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -2940,7 +2944,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -2948,20 +2952,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:119 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:124 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -2969,58 +2973,58 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:129 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:128 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " @@ -3030,13 +3034,13 @@ msgstr "" "class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" "`~urllib.request.urlopen` 函式和方法。" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:148 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -3047,7 +3051,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:153 +#: ../../deprecations/pending-removal-in-future.rst:150 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." @@ -5283,6 +5287,12 @@ msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" "`85858` 中貢獻。)" +#~ msgid "" +#~ ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated " +#~ "and ignored." +#~ msgstr "" +#~ ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。" + #~ msgid "" #~ "date and datetime adapter, date and timestamp converter: see the :mod:" #~ "`sqlite3` documentation for suggested replacement recipes." diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index f924143c7d..62667d1bd9 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-16 08:33+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2883,7 +2883,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1972 -#: ../../deprecations/pending-removal-in-3.15.rst:75 +#: ../../deprecations/pending-removal-in-3.15.rst:80 msgid ":mod:`typing`:" msgstr "" @@ -2925,7 +2925,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:2005 -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:93 msgid ":mod:`wave`:" msgstr "" @@ -3206,22 +3206,32 @@ msgid "" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:58 -msgid ":mod:`threading`:" +msgid ":mod:`sysconfig`:" msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:60 msgid "" +"The *check_home* argument of :func:`sysconfig.is_python_build` has been " +"deprecated since Python 3.12." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`threading`:" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:65 +msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " "not permit any arguments, but the C version allows any number of positional " "or keyword arguments, ignoring every argument." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`types`:" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:73 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -3229,7 +3239,7 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:77 +#: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -3237,14 +3247,14 @@ msgid "" "functional syntax instead." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:83 +#: ../../deprecations/pending-removal-in-3.15.rst:88 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " "it has yet to be supported by any major type checker." msgstr "" -#: ../../deprecations/pending-removal-in-3.15.rst:90 +#: ../../deprecations/pending-removal-in-3.15.rst:95 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3551,119 +3561,113 @@ msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "" #: ../../deprecations/pending-removal-in-future.rst:108 -msgid "" -":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " -"ignored." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":mod:`threading` methods:" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:113 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:115 +#: ../../deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:114 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:119 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:124 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:129 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "``splitattr()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:130 +#: ../../deprecations/pending-removal-in-future.rst:127 msgid "``splithost()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:131 +#: ../../deprecations/pending-removal-in-future.rst:128 msgid "``splitnport()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:129 msgid "``splitpasswd()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:133 +#: ../../deprecations/pending-removal-in-future.rst:130 msgid "``splitport()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:134 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "``splitquery()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:132 msgid "``splittag()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:136 +#: ../../deprecations/pending-removal-in-future.rst:133 msgid "``splittype()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "``splituser()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:135 msgid "``splitvalue()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``to_bytes()``" msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " "Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:148 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -3671,7 +3675,7 @@ msgid "" "instead." msgstr "" -#: ../../deprecations/pending-removal-in-future.rst:153 +#: ../../deprecations/pending-removal-in-future.rst:150 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 5b61ee496c..b1819d4974 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-07 08:41+0000\n" +"POT-Creation-Date: 2025-03-03 18:39+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1115,7 +1115,7 @@ msgid "" "LOAD_CONST (100)\n" "BINARY_ADD (23)\n" "RETURN_VALUE (83)\n" -">>> bytecode.dis().splitlines() \n" +">>> bytecode.dis().splitlines()\n" "[' 1 0 LOAD_FAST 0 (x)',\n" " ' --> 3 LOAD_CONST 1 (1)',\n" " ' 6 BINARY_ADD',\n"